query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
a22a890fcbdf352b001ddf1ea1456841
|
uncomment when you have `each` working and `Enumerable` included
|
[
{
"docid": "a875fa20231cdaa703ef64d244a5e9b6",
"score": "0.0",
"text": "def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end",
"title": ""
}
] |
[
{
"docid": "704fb2c22a8538bab759b4069ebf5bfa",
"score": "0.7642029",
"text": "def _each\n end",
"title": ""
},
{
"docid": "dcd87576f81b520216bcc33607b147a0",
"score": "0.7349081",
"text": "def each(&yld) super(&yld) end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "aa54e811a59e95d1669654a665ce522e",
"score": "0.7295429",
"text": "def each(&block); end",
"title": ""
},
{
"docid": "2ddb37aaefa8da7229f655a3eb135afa",
"score": "0.716927",
"text": "def each(&proc); end",
"title": ""
},
{
"docid": "b693bcb66b53c0b90f5148140861769e",
"score": "0.7163931",
"text": "def each(*) end",
"title": ""
},
{
"docid": "b693bcb66b53c0b90f5148140861769e",
"score": "0.7163931",
"text": "def each(*) end",
"title": ""
},
{
"docid": "68ebd6bb8d04537ef5affd9139f19552",
"score": "0.7128912",
"text": "def each(&blk); end",
"title": ""
},
{
"docid": "68ebd6bb8d04537ef5affd9139f19552",
"score": "0.7128912",
"text": "def each(&blk); end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7117145",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
},
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.7116515",
"text": "def each; end",
"title": ""
}
] |
2af0b16073e8403809fb53b65caf7015
|
POST /admin/attaches POST /admin/attaches.json
|
[
{
"docid": "70f31e086b31ee075cc28720e76f7482",
"score": "0.66954404",
"text": "def create\n @admin_attach = Admin::Attach.new(admin_attach_params)\n\n respond_to do |format|\n if @admin_attach.save\n format.html { redirect_to admin_attaches_url, notice: 'Attach was successfully created.' }\n format.json { render json: admin_attaches_url, status: :created, location: @admin_attach }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_attach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "4b1085565b1cf5862d7b32b42d0ae7f5",
"score": "0.61505777",
"text": "def create\n @post = Post.new(post_params)\n if params[:post][:attached].size > 0\n upload_ios = params[:post][:attached]\n upload_ios.each do | uploaded_io | \n File.open(Rails.root.join('public', 'uploads', \"attaches\", uploaded_io.original_filename), 'wb') do |file|\n file.write(uploaded_io.read)\n end\n attach = @post.attaches.build\n attach.file_name = uploaded_io.original_filename\n attach.content_type = uploaded_io.content_type\n end\n end\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Пост добавлен.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efefb49460ec919fc6e0ba4140c1bd3c",
"score": "0.5963364",
"text": "def create\n @attendace = Attendace.new(attendace_params)\n\n respond_to do |format|\n if @attendace.save\n format.html { redirect_to @attendace, notice: 'Attendace was successfully created.' }\n format.json { render :show, status: :created, location: @attendace }\n else\n format.html { render :new }\n format.json { render json: @attendace.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "753cf76089e131bc8bd1ca00d3867361",
"score": "0.5940117",
"text": "def index\n @post_attaches = PostAttach.all\n end",
"title": ""
},
{
"docid": "4327274e1822075fe30e5f8eb887a534",
"score": "0.5892277",
"text": "def create\n @admin_attendee = @admin_form.attendees.new(admin_attendee_params)\n respond_to do |format|\n if @admin_attendee.save\n format.html { redirect_to admin_form_attendee_path(@admin_form, @admin_attendee), notice: t('crud.created_successfully!', name: Admin::Attendee.model_name.human) }\n format.json { render :show, status: :created, location: @admin_attendee }\n else\n format.html { render :new }\n format.json { render json: @admin_attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a582d7f06124f128910a44e843a62d21",
"score": "0.58699673",
"text": "def create\n @attender = Attender.new(attender_params)\n\n respond_to do |format|\n if @attender.save\n format.html { redirect_to @attender, notice: 'Attender was successfully created.' }\n format.json { render action: 'show', status: :created, location: @attender }\n else\n format.html { render action: 'new' }\n format.json { render json: @attender.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7f4ee45467208d46872c43806e29a31",
"score": "0.5844164",
"text": "def create\n @attachement = Attachement.new(params[:attachement])\n\n respond_to do |format|\n if @attachement.save\n format.html { redirect_to @attachement, :notice => 'Attachement was successfully created.' }\n format.json { render :json => @attachement, :status => :created, :location => @attachement }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @attachement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73d91a87cc69eecf10b513f64a2bf811",
"score": "0.57845706",
"text": "def attendace_params\n params.require(:attendace).permit(:user_uid, :user_id, :event_id)\n end",
"title": ""
},
{
"docid": "f686f6334938ad1d82e9513c3939eee3",
"score": "0.57179123",
"text": "def index\n @sendattaches = Sendattach.all\n end",
"title": ""
},
{
"docid": "875fd2db29ae7672fca1132dc6a9e0da",
"score": "0.5680785",
"text": "def create\n @attendence = Attendence.new(attendence_params)\n respond_to do |format|\n if @attendence.save\n format.html { redirect_to @attendence}\n format.json { render :show, status: :created, location: @attendence }\n else\n format.html { render :new }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f0c31f545147229566a189cbe4f5664",
"score": "0.56347406",
"text": "def create\n @attention = Attention.new(params[:attention])\n\n respond_to do |format|\n if @attention.save\n format.html { redirect_to @attention, notice: 'Attention was successfully created.' }\n format.json { render json: @attention, status: :created, location: @attention }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attention.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d878b2300b53dbddd02b7a5b5330bb2",
"score": "0.5602667",
"text": "def attachement_params\n params.require(:attachement).permit(:bot_id, :bot_action_id, :attachable_id, :attachable_type)\n end",
"title": ""
},
{
"docid": "fe8875bcb012c22875f66dfce5f1f377",
"score": "0.55648476",
"text": "def attend(event)\n active_attends.create(attended_event_id: event.id)\n end",
"title": ""
},
{
"docid": "858de6f2acb95a344137e6ac84559d75",
"score": "0.55509925",
"text": "def create\n @idea = current_user.ideas.build idea_params\n if @idea.save\n if params[:idea_attachments]\n params[:idea_attachments][:photo].each do |a|\n @idea_attachment = @idea.idea_attachments.create!(photo: a)\n end\n end\n current_user.reaches.create idea: @idea\n respond_to do |f|\n f.html{ redirect_back(fallback_location: root_path) }\n f.js { render 'idea' }\n end\n\n else\n flash[:error] = \"Error: #{@idea.errors.full_messages.to_sentence}\"\n # format.html { redirect_to @idea, notice: 'Idea was successfully created.' }\n # format.json { render :show, status: :created, location: @idea }\n # format.html { render :new }\n # format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n\n end",
"title": ""
},
{
"docid": "65e2fab0cceb8c0cf64c8fc8eb5cce8d",
"score": "0.5511072",
"text": "def create\n if Attendee.find_by name: attendee_params[:name]\n @attendee = Attendee.find_by name: attendee_params[:name]\n else\n @attendee = Attendee.new(attendee_params)\n end\n \n @attendee.events << @event\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @event, notice: \"Attendee was successfully created.\" }\n # format.json { render :show, status: :created, location: @attendee }\n else\n format.html { render :new, status: :unprocessable_entity }\n # format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"title": ""
},
{
"docid": "b9ec945c9da73b51fa1fb7e38f4b6de8",
"score": "0.54987085",
"text": "def attend(event)\n active_attends.create(attended_event_id: event.id)\n end",
"title": ""
},
{
"docid": "227e900b10b5b4deb6f8e25b4be93fb4",
"score": "0.5471369",
"text": "def attending\n \tuser = FacebookAccount.find_by_fb_id( current_user.identifier ).user\n event = FbGraph::Event.fetch(params[:id])\n result = event.attending!(:access_token => user.access_token)\n\n render :json => result.to_json\t\n end",
"title": ""
},
{
"docid": "5f02a6054a5851ac6442c859aa151bef",
"score": "0.5443528",
"text": "def create\n @advert = current_admin.adverts.create(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "903329ef6521e5d588d1a10a6df03b1b",
"score": "0.543671",
"text": "def update\n @post = Post.find(params[:id])\n if params[:post][:attached].size > 0\n upload_ios = params[:post][:attached]\n upload_ios.each do | uploaded_io | \n File.open(Rails.root.join('public', 'uploads', \"attaches\", uploaded_io.original_filename), 'wb') do |file|\n file.write(uploaded_io.read)\n end\n attach = @post.attaches.build\n attach.file_name = uploaded_io.original_filename\n attach.content_type = uploaded_io.content_type\n end\n end\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Пост изменен.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2241d5ee49812a143f72bfae8bca5d9d",
"score": "0.541972",
"text": "def post_params\n params.require(:post).permit(:title, :body, :category_id, :subcategory_id, :attached, :attaches_attributes)\n end",
"title": ""
},
{
"docid": "676d2f785bc8a7a009927f5d6e9785f0",
"score": "0.541509",
"text": "def create\n @admin_email_marketing = Advertise.new(params[:advertise])\n @admin_email_marketing.adv_type = 'E'\n\n respond_to do |format|\n if @admin_email_marketing.save\n format.html { redirect_to admin_email_marketing_path(@admin_email_marketing), notice: 'Email marketing was successfully created.' }\n format.json { render json: @admin_email_marketing, status: :created, location: @admin_email_marketing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_email_marketing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f048af3e350784174e3f878aef6f7361",
"score": "0.5413599",
"text": "def create\n raise User::NotAuthorized unless user_can_edit_attraction?\n\n @attraction = @area.attractions.new({area: @area}.merge(attraction_params))\n\n respond_to do |format|\n if @attraction.save\n format.html { redirect_to [@trip, @area, @attraction], notice: 'Attraction was successfully created.' }\n format.json { render :show, status: :created, location: @attraction }\n else\n format.html { render :new }\n format.json { render json: @attraction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffa41981f290810aa824c15114b085e0",
"score": "0.54019105",
"text": "def create\n @attendee = Attendee.new(attendee_params)\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @attendee, notice: 'Attendee was successfully created.' }\n format.json { render :show, status: :created, location: @attendee }\n else\n format.html { render :new }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cb96d732485683cc7460c63c1cd20d8",
"score": "0.5399702",
"text": "def create\n @attendee = @current_user.attendees.new(attendee_params)\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @attendee, notice: 'Attendee was successfully created.' }\n format.json { render :show, status: :created, location: @attendee }\n else\n format.html { render :new }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fff783bb6331f9a675cbfbfa3941ccd9",
"score": "0.53929013",
"text": "def set_attendace\n @attendace = Attendace.find(params[:id])\n end",
"title": ""
},
{
"docid": "21e453bdff779ca027cc1f197d264c4d",
"score": "0.53905815",
"text": "def create\n @att_detail = AttDetail.new(att_detail_params)\n\n respond_to do |format|\n if @att_detail.save\n format.html { redirect_to @att_detail, notice: 'Att detail was successfully created.' }\n format.json { render :show, status: :created, location: @att_detail }\n else\n format.html { render :new }\n format.json { render json: @att_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f9d2c6c7716000a487bf3e3530f26bb",
"score": "0.53815526",
"text": "def attending_params\n params.fetch(:attending, {}).permit(\n :user_id,\n :event_id\n )\n end",
"title": ""
},
{
"docid": "71f3252dce14b1e310a8754f12230640",
"score": "0.5369232",
"text": "def add\n @server = Server.new(params[:server].except(:attaches_attributes))\n\n respond_to do |format|\n if @server.save\n\n if params[:server][:attaches_attributes]\n params[:server][:attaches_attributes].each do |key, attach|\n if attach[:file].present?\n save_server_attach(@server, attach)\n params[:server][:attaches_attributes].delete key\n end\n end\n end\n\n format.html { redirect_to :servers, notice: 'Оборудование успешно создано.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"title": ""
},
{
"docid": "eb40a162a328cd3e5567b747d1646737",
"score": "0.5352382",
"text": "def create\n authorize! :manage, @announcements , :message => \"Access denied.\"\n @announcement = Announcement.new(announcement_params)\n\n respond_to do |format|\n if @announcement.save\n format.html { redirect_to @announcement, notice: 'Announcement was successfully created.' }\n format.json { render :show, status: :created, location: @announcement }\n else\n format.html { render :new }\n format.json { render json: @announcement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83cd6e531548fa725abe0f4b94e422fa",
"score": "0.5350222",
"text": "def set_attendace\n @attendace = Attendace.find(params[:id])\n end",
"title": ""
},
{
"docid": "ef7604f03a3a9f69ce92b6cb74649c02",
"score": "0.53424406",
"text": "def set_attachement\n @attachement = Attachement.find(params[:id])\n end",
"title": ""
},
{
"docid": "4eefab0464191ed6644db6869e136ae1",
"score": "0.53418547",
"text": "def add_guest_access_portal(args = {}) \n post(\"/guestaccess.json/gap/\", args)\nend",
"title": ""
},
{
"docid": "4eefab0464191ed6644db6869e136ae1",
"score": "0.53418547",
"text": "def add_guest_access_portal(args = {}) \n post(\"/guestaccess.json/gap/\", args)\nend",
"title": ""
},
{
"docid": "401f69a1f93939e4e04cbe0cf7d6c41f",
"score": "0.5341692",
"text": "def create\n @attension = Attension.new(attension_params)\n\n respond_to do |format|\n if @attension.save\n format.html { redirect_to @attension, notice: 'Attension was successfully created.' }\n format.json { render :show, status: :created, location: @attension }\n else\n format.html { render :new }\n format.json { render json: @attension.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8250f099f558a480a9486262d96bbbf",
"score": "0.53168106",
"text": "def create\n @attend = Attend.new(params[:attend])\n\n respond_to do |format|\n if @attend.save\n flash[:notice] = '登録に成功しました(出勤簿)'\n format.html { redirect_to(@attend) }\n format.xml { render :xml => @attend, :status => :created, :location => @attend }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attend.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a65667c52f2e02e6a9d6e684ae9c4661",
"score": "0.5301224",
"text": "def create\n\t\tclient = OAuth2::Client.new( ENV[\"FT_UID\"], ENV[\"FT_SECRET\"], site:\"https://api.intra.42.fr\")\n\t\ttoken = client.client_credentials.get_token\n\t\t@user_quest = token.get(\"/v2/users/\" + params[:attendee][:login]).parsed\n\t\t# if @user_quest.nil?\n\t\t# \terrors.add( message: \"cannot be nil\")\n\t\t# end\n\n\t\t@attendee = current_user.attendees.build(attendee_params)\n\t\t@attendee.name = @user_quest[\"displayname\"]\n\t\trespond_to do |format|\n\t\t\tif @attendee.save\n\t\t\t\tformat.html { redirect_to @attendee, notice: 'Attendee was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @attendee }\n\t\t\t\tformat.js\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @attendee.errors, status: :unprocessable_entity }\n\t\t\t\tformat.js\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "75a02fcc82b6853cffd46131e71dd858",
"score": "0.5283704",
"text": "def create\n @attend = Attend.new(attend_params)\n # @attend = Attend.new(user: current_user, start_at: Time.current)\n\n respond_to do |format|\n if @attend.save\n format.html { redirect_to @attend, notice: 'Attend was successfully created.' }\n # format.html { redirect_to root_path, notice: 'Attend was successfully created.' }\n format.json { render :show, status: :created, location: @attend }\n else\n format.html { render :new }\n # format.html { redirect_to root_path, notice: 'Attend was successfully created.' }\n format.json { render json: @attend.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87f0e0429bddc692bde2a00286142ea7",
"score": "0.5277043",
"text": "def create\n attraction_params = params.require(:attraction).permit(:attraction_name)\n Attraction.create(attraction_params)\n redirect_to attractions_path\n end",
"title": ""
},
{
"docid": "dd11b1c7977c29ff438aa5fd5f9027b6",
"score": "0.52689844",
"text": "def create\n # @event = Event.new(event_params)\n @user = User.find(session[:user_id])\n @event = @user.events.build(event_params)\n\n if @event.save\n @event.attendees.push(@user)\n redirect_to events_path, notice: 'Event was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "22ba7a712fdb0a6e8e3d78536669ed7d",
"score": "0.5268863",
"text": "def create\n \t@micropost = Micropost.find(params[:attending_id])\n \tcurrent_user.attend(@micropost)\n \trespond_to do |format|\n \t\tformat.html { redirect_to :back }\n \t\tformat.js\n \tend \n end",
"title": ""
},
{
"docid": "61c0f4a44bf6af0fd7f96ee5392ff44f",
"score": "0.52684385",
"text": "def add\n @document = Document.new(params[:document].except(:attaches_attributes))\n\n respond_to do |format|\n if @document.save\n\n if params[:document][:attaches_attributes]\n params[:document][:attaches_attributes].each do |key, attach|\n if attach[:file].present?\n save_document_attach(@document, attach)\n end\n end\n end\n\n format.html { redirect_to @document, notice: 'Рецепт успешно создан.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"title": ""
},
{
"docid": "eb7c3f9d9e1e52e59a8f97d2ee98a9bd",
"score": "0.5263541",
"text": "def attend(micropost)\n events_attending.create(attending_id: micropost.id)\n end",
"title": ""
},
{
"docid": "e185a4ca87e43e13081549400768fa72",
"score": "0.5223935",
"text": "def create \n\t\tattending = Attend.new(attend_params)\n\t\tif attending.save\n\t\t\tredirect_to :back\n\t\telse \n\t\t\tflash[:errors]= attending.errors.full_messages \n\t\t\tredirect_to :back\n\t\tend\n\tend",
"title": ""
},
{
"docid": "93e43a17ae5b07fe70cb73ba20d396d3",
"score": "0.52090913",
"text": "def update_attendees\n self.attendees.each do |attendee|\n attendee.update_attributes(public_event_id: self.public_event_id)\n end\n end",
"title": ""
},
{
"docid": "0cb000a584488367a633ca289d32bd36",
"score": "0.5207954",
"text": "def create\n @attraction = Attraction.new(attraction_params)\n\n respond_to do |format|\n\n if @attraction.save\n format.html { redirect_to @attraction, notice: 'Attraction was successfully saved.' }\n format.json { render json: @attraction, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @attraction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d272286d04a43a4d67516c991fec13d6",
"score": "0.5207402",
"text": "def create\n @attenden = Attenden.new(attenden_params)\n\n respond_to do |format|\n if @attenden.save\n format.html { redirect_to @attenden, notice: 'Attenden was successfully created.' }\n format.json { render :show, status: :created, location: @attenden }\n else\n format.html { render :new }\n format.json { render json: @attenden.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e695604e459a2c804601f54345897779",
"score": "0.5207224",
"text": "def attach_relationship(data)\n # FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.\n @client.raw('post', '/config/relationships/attach', nil, data_transform(data))\n end",
"title": ""
},
{
"docid": "08634803a61769d65dbc553cba4cef83",
"score": "0.5200001",
"text": "def attend_params\n params.require(:attend).permit(:avatar, :clinic_id, :age, :patient_id, :schedule, :appointment, :requester_id, :notes, :discount, :total, :descriptive, :finalized, :missed, :exam_ids => [])\n end",
"title": ""
},
{
"docid": "387e349036be7564b49bb9c17f01e0ec",
"score": "0.519703",
"text": "def create\n @attivitaextra = Attivitaextra.new(attivitaextra_params)\n\n respond_to do |format|\n if @attivitaextra.save\n format.html { redirect_to @attivitaextra, notice: 'Attivitaextra was successfully created.' }\n format.json { render :show, status: :created, location: @attivitaextra }\n else\n format.html { render :new }\n format.json { render json: @attivitaextra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d8e8d8f5fdcb40bea9ed435dd5ebfef",
"score": "0.51955116",
"text": "def create\n @announcee = Announcee.new(params[:announcee])\n authorize! :create, @announcee\n \n respond_to do |format|\n if @announcee.save\n format.html { redirect_to announcees_url, notice: 'Announcee was successfully created.' }\n format.json { render json: @announcee, status: :created, location: @announcee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @announcee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25e67a590043d73d1416c558da4caf16",
"score": "0.51895696",
"text": "def create\n @atention = Atention.new(atention_params)\n\n respond_to do |format|\n if @atention.save\n format.html { redirect_to @atention, notice: 'Atention was successfully created.' }\n format.json { render :show, status: :created, location: @atention }\n format.js\n else\n format.html { render :new }\n format.json { render json: @atention.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "970c55361ceb2bafa5a00a0ec29cd443",
"score": "0.51724714",
"text": "def attend!(_user_id)\n event_attends.where(user_id: _user_id).first_or_create!\n end",
"title": ""
},
{
"docid": "773e9b8f3996532afeac8fd59d2e983d",
"score": "0.51713836",
"text": "def attach\n @taxon = Taxon.find params[:id]\n result = nil\n begin\n @taxon.attach_by_param(params[:attach_class], params[:attach_id])\n result = \"ok\"\n rescue\n result = \"Invalid parameters\"\n end\n \n if params[:format] == :json\n render :json => result\n else\n redirect_to edit_admin_taxonomy_url(@taxon.taxonomy), :notice => result\n end\n end",
"title": ""
},
{
"docid": "11aa63e190ba6a0ed0d28b57899254bb",
"score": "0.51687044",
"text": "def attenden_params\n params.require(:attenden).permit(:user_id, :event_id)\n end",
"title": ""
},
{
"docid": "f136620f177eab7163e350cbda31e764",
"score": "0.5166736",
"text": "def create\n @attendence = Attendence.new(params[:attendence])\n\n respond_to do |format|\n if @attendence.save\n flash[:notice] = 'Attendence was successfully created.'\n format.html { redirect_to(@attendence) }\n format.xml { render :xml => @attendence, :status => :created, :location => @attendence }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attendence.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a0ae95bfe1e1496c0b7590602e858b1",
"score": "0.5166342",
"text": "def create\n @attend = Attend.new(params[:attend])\n\n respond_to do |format|\n if @attend.save\n AtndNotifier.received(@attend).deliver\n format.html { redirect_to @attend, notice: '参加登録を受付いたしました!' }\n format.json { render json: @attend, status: :created, location: @attend }\n\n p \"call format\"\n else\n format.html { render action: \"new\" }\n format.json { render json: @attend.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56b4341f7a01d3b59099d1330384c782",
"score": "0.51605934",
"text": "def attendee_params\n params.require(:attendee).permit(:user_id, :name, :about, :image)\n end",
"title": ""
},
{
"docid": "9be65cb7324e29aae2b03463ff684311",
"score": "0.5159514",
"text": "def process_as_athlete(token, params)\n invitation = Invitation.find_by_invite_token(token)\n if invitation\n athlete = Athlete.create(params)\n invitation.invitee = athlete\n invitation.save\n athlete\n end\n end",
"title": ""
},
{
"docid": "cd833baefdfbfa4b82f7cd3726b6d383",
"score": "0.5152205",
"text": "def create\n @agency = Agency.new(params[:agency])\n #raise @agency.to_json\n respond_to do |format|\n if @agency.valid? \n #add the users\n if !params[:assign_user_ids].nil?\n params[:assign_user_ids].each do |id|\n @agency.add_user_by_id(id)\n end\n end\n #and save\n if @agency.save\n format.html { redirect_to admin_agency_path(@agency), notice: 'Agency was successfully created.' }\n format.json { render json: @agency, status: :created, location: @agency }\n else\n format.html { render action: \"new\" }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "598c50250616855805588b1e0750e106",
"score": "0.5137473",
"text": "def adopter_params\n params.require(:adopter).permit(:name, :email, :telephone, :animal)\n end",
"title": ""
},
{
"docid": "9bb40e7cc1904161b9cbc84a6a24c8e8",
"score": "0.5136438",
"text": "def attendees_json\n attendees_attributes.to_json\n end",
"title": ""
},
{
"docid": "60e87d19ccbc2a24764bd95e3d5d8b2b",
"score": "0.5135549",
"text": "def create\n @attendence_entry = AttendenceEntry.new(params[:attendence_entry])\n\n respond_to do |format|\n if @attendence_entry.save\n format.html { redirect_to(@attendence_entry, :notice => 'Attendence entry was successfully created.') }\n format.xml { render :xml => @attendence_entry, :status => :created, :location => @attendence_entry }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attendence_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0375e37fe3a75cf29d1c2cefa7053766",
"score": "0.5134702",
"text": "def create\n @athlete = Athlete.new(athlete_params)\n\n respond_to do |format|\n if @athlete.save\n format.html { redirect_to @athlete, notice: 'Athlete was successfully created.' }\n format.json { render :show, status: :created, location: @athlete }\n else\n format.html { render :new }\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0375e37fe3a75cf29d1c2cefa7053766",
"score": "0.5134702",
"text": "def create\n @athlete = Athlete.new(athlete_params)\n\n respond_to do |format|\n if @athlete.save\n format.html { redirect_to @athlete, notice: 'Athlete was successfully created.' }\n format.json { render :show, status: :created, location: @athlete }\n else\n format.html { render :new }\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "881c989191caed25c181c6dacf34356f",
"score": "0.5133038",
"text": "def attendant_params\n params[:attendant].permit(:username)\n end",
"title": ""
},
{
"docid": "95d6ede6e408dcd055b23a1763c7307b",
"score": "0.5132652",
"text": "def create\n @attraction = Attraction.new(attraction_params)\n\n respond_to do |format|\n if @attraction.save\n format.html { redirect_to @attraction, notice: 'Attraction was successfully created.' }\n format.json { render action: 'show', status: :created, location: @attraction }\n else\n format.html { render action: 'new' }\n format.json { render json: @attraction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc05f95ac9143b776cbd10719ec0f169",
"score": "0.5130082",
"text": "def join\n @event_attendee = EventAttendee.new(attendee: @user, event: @event)\n authorize @event\n if @event_attendee.save\n render json: {\n attending: true,\n attendees: @event.attendees_counter.value,\n attendee: current_user.card_json\n }\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "164ee8957ff869a79149fe962143885a",
"score": "0.5124599",
"text": "def create\n @announcement = Announcement.new(params[:announcement])\n\n respond_to do |format|\n if @announcement.save\n \n uids = User.all.map{|u| u.id}\n uids.each do |uid|\n UsersAnnouncement.create(\n :user_id => uid,\n :announcement_id => @announcement.id\n )\n end \n format.html { redirect_to @announcement, notice: 'Announcement was successfully created.' }\n format.json { render json: @announcement, status: :created, location: @announcement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @announcement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "694b2faddbd3fe486566978a09dd8665",
"score": "0.5109986",
"text": "def create\n @athlete = Athlete.new(params[:athlete])\n @athlete.user_id = current_user.id\n\n respond_to do |format|\n if @athlete.save\n format.html { redirect_to @athlete, notice: 'Athlete was successfully created.' }\n format.json { render json: @athlete, status: :created, location: @athlete }\n else\n format.html { render action: \"new\" }\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36086df35aaa3521c977187c4df3abec",
"score": "0.5106926",
"text": "def create\n @advert = current_user.adverts.new(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ab2b66cbce8dc53c550f85c5570c3b8",
"score": "0.5106658",
"text": "def create\n @post_attach = PostAttach.new(post_attach_params)\n\n respond_to do |format|\n if @post_attach.save\n format.html { redirect_to @post_attach, notice: 'Post attach was successfully created.' }\n format.json { render :show, status: :created, location: @post_attach }\n else\n format.html { render :new }\n format.json { render json: @post_attach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf7e61c3480ee9ea0c68bd9e18c56b22",
"score": "0.510454",
"text": "def create\n @attaching = Attaching.new(params[:attaching])\n\n respond_to do |format|\n if @attaching.save\n format.html { redirect_to(@attaching, :notice => 'Attaching was successfully created.') }\n format.xml { render :xml => @attaching, :status => :created, :location => @attaching }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attaching.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bab4ddd45266a06d96dd93437a41110",
"score": "0.5103258",
"text": "def create\n @atleta = Atleta.new(atleta_params)\n\n respond_to do |format|\n if @atleta.save\n format.html { redirect_to @atleta, notice: 'Atleta was successfully created.' }\n format.json { render :show, status: :created, location: @atleta }\n else\n format.html { render :new }\n format.json { render json: @atleta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd13e2a0cce3d9f0881bf4b2ebe048e2",
"score": "0.5096055",
"text": "def create\n @ad = Advertise.new(advertise_params)\n @ad.campaign_id = @campaign.id\n \n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Advertise was successfully created.' }\n format.json { render :show, status: :created, location: @ad }\n else\n format.html { render :new }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fafa2283e703169753b291df55792df",
"score": "0.5095596",
"text": "def create\n @not_attending = NotAttending.new(not_attending_params)\n\n respond_to do |format|\n if @not_attending.save\n format.html { redirect_to @not_attending, notice: 'Not attending was successfully created.' }\n format.json { render :show, status: :created, location: @not_attending }\n else\n format.html { render :new }\n format.json { render json: @not_attending.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f1f48bfba0a4eb408a835dec26ac513",
"score": "0.5090844",
"text": "def create\n c = @event.coaches.new\n c.name = params[:name]\n c.job = params[:job]\n c.save\n end",
"title": ""
},
{
"docid": "28f943c5f89610ea86e26cc06950e4ff",
"score": "0.509005",
"text": "def destroy\n @attend.destroy\n respond_to do |format|\n format.html { redirect_to attends_url, notice: t('destroy_success') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6a8280edbf916cb024ae0de15755ca6c",
"score": "0.50889945",
"text": "def create\n @aliance = Aliance.new(aliance_params)\n @aliance.founder = current_user\n @aliance.users.push(current_user)\n\n respond_to do |format|\n if @aliance.save\n format.html { redirect_to @aliance, notice: 'Aliance was successfully created.' }\n format.json { render :show, status: :created, location: @aliance }\n else\n format.html { render :new }\n format.json { render json: @aliance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c3408de7c9073cb4bde55345d0a9c00",
"score": "0.50886106",
"text": "def create\n @athlete = Athlete.new(params[:athlete])\n expire_action :action => :index\n respond_to do |format|\n if @athlete.save\n format.html { redirect_to @athlete }\n format.json { render json: @athlete, status: :created, location: @athlete }\n else\n format.html { render action: \"new\" }\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad20da7145f31c975e2dce7eb72c694f",
"score": "0.5076826",
"text": "def create\n @ahtlete = Ahtlete.new(ahtlete_params)\n\n respond_to do |format|\n if @ahtlete.save\n format.html { redirect_to @ahtlete, notice: 'Ahtlete was successfully created.' }\n format.json { render :show, status: :created, location: @ahtlete }\n else\n format.html { render :new }\n format.json { render json: @ahtlete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53bd8dd702c627e2f2be50e1f42a4bbc",
"score": "0.5075944",
"text": "def update\n @admin_attach = Admin::Attach.find(params[:id])\n\n respond_to do |format|\n if @admin_attach.update_attributes(admin_attach_params)\n format.html { redirect_to admin_attaches_url, notice: 'Attach was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_attach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9093e19f493dc53df70adbe090fe61d1",
"score": "0.50757486",
"text": "def create\n @attraction = Attraction.new(attraction_params)\n\n if @attraction.save\n respond_with @attraction\n else\n respond_with @attraction.errors\n end\n end",
"title": ""
},
{
"docid": "d585ca1b4020a8cb9fc9f3ee9ef5b207",
"score": "0.5074162",
"text": "def create\n authorize! :create, Announcement\n announcement = Announcement.new(announcement_params)\n if announcement.save\n render json: announcement\n else\n render_errors announcement\n end\n end",
"title": ""
},
{
"docid": "24f251272677070b49979eabc3da19ee",
"score": "0.5073077",
"text": "def index\n @attendaces = Attendace.all\n end",
"title": ""
},
{
"docid": "0de7ce113f865b27cc525f1435afa04c",
"score": "0.5066568",
"text": "def create\n @athlete = Athlete.new(athlete_params)\n\trespond_to do |format|\n if @athlete.save\n format.html { redirect_to @athlete, notice: 'Athlete was added successfully' }\n format.json { render action: 'show', status: :created, location: @athlete }\n else\n format.html { render action: 'new' }\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n\tend",
"title": ""
},
{
"docid": "f29e4efa7d97a6055a554d67fd27d65b",
"score": "0.50659066",
"text": "def create_annotations( set_id, witness_id, json )\n asset_id = \"set/#{set_id}/witness/#{witness_id}/annotation\"\n log_message( \"Posting annotations to #{asset_id}...\" ) unless @logging == false \n resp = @connection.post(asset_id, json)\n return resp\n end",
"title": ""
},
{
"docid": "6af123c2517c92f726e85bf0710290a4",
"score": "0.50656486",
"text": "def create\n @attachmennt = Attachmennt.new(attachmennt_params)\n\n respond_to do |format|\n if @attachmennt.save\n format.html { redirect_to @attachmennt, notice: 'Attachmennt was successfully created.' }\n format.json { render :show, status: :created, location: @attachmennt }\n else\n format.html { render :new }\n format.json { render json: @attachmennt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9017683e6aed1c9b4286bea39990146",
"score": "0.5064597",
"text": "def set_attendence\n @attendence = Attendence.find(params[:id])\n end",
"title": ""
},
{
"docid": "f9017683e6aed1c9b4286bea39990146",
"score": "0.5064597",
"text": "def set_attendence\n @attendence = Attendence.find(params[:id])\n end",
"title": ""
},
{
"docid": "f9017683e6aed1c9b4286bea39990146",
"score": "0.5064597",
"text": "def set_attendence\n @attendence = Attendence.find(params[:id])\n end",
"title": ""
},
{
"docid": "4c497856bed211f2fb61fd5646f301e2",
"score": "0.50540364",
"text": "def create\n @apt = Apt.new(apt_params)\n\n respond_to do |format|\n if @apt.save\n format.html { redirect_to @apt, notice: 'Apt was successfully created.' }\n format.json { render :show, status: :created, location: @apt }\n else\n format.html { render :new }\n format.json { render json: @apt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8187eb1005c2af6a813700ee362c8909",
"score": "0.50485635",
"text": "def create\n @tea_list_assignment = TeaListAssignment.new(params[:tea_list_assignment])\n tea = Tea.find params[:tea_list_assignment][:tea_id]\n @tea_list_assignment.tea = tea\n @tea_list_assignment.user = current_user\n\n respond_to do |format|\n if @tea_list_assignment.save\n format.html { redirect_to @tea_list_assignment.tea, notice: 'Tea list assignment was successfully created.' }\n format.json { render json: @tea_list_assignment, status: :created, location: @tea_list_assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tea_list_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d23168c179db8e38b6fe0e6ff1598ec",
"score": "0.50481725",
"text": "def set_attending\n @attending = Attending.find_by(user_id: current_user.id, event_id: attending_params[:event_id])\n end",
"title": ""
},
{
"docid": "0bc877961d4e761c586066107e9ff0b5",
"score": "0.50435066",
"text": "def create\n @attach = Attach.new(params[:attach])\n\n respond_to do |format|\n if @attach.save\n format.html { redirect_to @attach, notice: 'Attach was successfully created.' }\n format.json { render json: @attach, status: :created, location: @attach }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attach.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1dc5ac4e8826b579f8737f3948d8711f",
"score": "0.50426644",
"text": "def atendence_params\n params.require(:atendence).permit(:atendee_id, :attended_event_id)\n end",
"title": ""
},
{
"docid": "3dcc54f81f592bbe5198817f0481c3fa",
"score": "0.5038845",
"text": "def create\n @spatt = Spatt.new(spatt_params(params[:spatt]))\n\n if @spatt.save\n render json: @spatt, status: :created, location: @spatt\n else\n render json: @spatt.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2099ce9df7595abb82d9aa933d168687",
"score": "0.5037384",
"text": "def create\n @event = Event.find(params[:event_id])\n current_user.attend(@event)\n respond_to do |format|\n format.html { redirect_to @event }\n format.js\n end\n end",
"title": ""
},
{
"docid": "f246f9d87ffc7607d0da2df7ddd78580",
"score": "0.5031489",
"text": "def create\n @coach = Coach.new(coach_params)\n @coach.params_set = ParamsSet.first\n authorize @coach\n\n if @coach.save\n @user.coach_id = @coach.id\n @user.user_terms_acceptance = true\n @user.save\n @user.send_welcome_pro_email\n @user.groups.each do |group|\n group.coaches.push(@coach)\n end\n if @user.account\n redirect_to profile_path\n else\n redirect_to new_user_account_path(current_user)\n end\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "3e8e0b0f54fd1dbff2a269d5d10ade6e",
"score": "0.5029821",
"text": "def create\n @adopter = Adopter.new(adopter_params)\n\n respond_to do |format|\n if @adopter.save\n format.html { redirect_to animals_path, notice: 'Requisição mandada com sucesso.' }\n format.json { render :show, status: :created, location: @adopter }\n else\n format.html { render :new }\n format.json { render json: @adopter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad318c19eaa8fd81e84d09858e5e1403",
"score": "0.5027666",
"text": "def create\n @alunno_attivitaextra = AlunnoAttivitaextra.new(alunno_attivitaextra_params)\n\n respond_to do |format|\n if @alunno_attivitaextra.save\n format.html { redirect_to attivitaextras_path(sezione_id: Alunno.find(current_user.id).sezione_id), notice: 'Partecipazione registrata!' }\n format.json { render :show, status: :created, location: @alunno_attivitaextra }\n else\n format.html { render :new }\n format.json { render json: @alunno_attivitaextra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a15e64ce0afee25f073978fe9dd6c6f2",
"score": "0.50243413",
"text": "def create\n @audience = Audience.new(audience_params)\n\n respond_to do |format|\n if @audience.save\n format.html { redirect_to @audience, notice: 'Audience was successfully created.' }\n format.json { render :show, status: :created, location: @audience }\n else\n format.html { render :new }\n format.json { render json: @audience.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
2c4e9fa9d7c588b97f8d71c405e6f693
|
Runs before the build begins
|
[
{
"docid": "a3d27f7afdc219769bde413b910fa1a6",
"score": "0.75876105",
"text": "def prebuild(build, listener)\n # do any setup that needs to be done before this build runs.\n end",
"title": ""
}
] |
[
{
"docid": "2782caff92f9708c3278c9dd4fd6f363",
"score": "0.78962326",
"text": "def preRun\n end",
"title": ""
},
{
"docid": "3a44db7370b3e09a784083247025b528",
"score": "0.78179306",
"text": "def pre_build; end",
"title": ""
},
{
"docid": "58261063e2886e7d0e9579fb45e65422",
"score": "0.7735226",
"text": "def pre_build; execute_plugins(:pre_build); end",
"title": ""
},
{
"docid": "551d16ee5b92f64ef2f0d3779bee3374",
"score": "0.7666797",
"text": "def prebuild(build, listener)\n # do any setup that needs to be done before this build runs.\n end",
"title": ""
},
{
"docid": "551d16ee5b92f64ef2f0d3779bee3374",
"score": "0.7666797",
"text": "def prebuild(build, listener)\n # do any setup that needs to be done before this build runs.\n end",
"title": ""
},
{
"docid": "a3e77c4b438be75fccee1cd2e7cdae87",
"score": "0.7403657",
"text": "def before_run() end",
"title": ""
},
{
"docid": "a3e77c4b438be75fccee1cd2e7cdae87",
"score": "0.7403657",
"text": "def before_run() end",
"title": ""
},
{
"docid": "93ed7b63471afceca7ce124f4f8fbcd4",
"score": "0.7362878",
"text": "def before_run\n end",
"title": ""
},
{
"docid": "140b65fbb06981a24feb5bd6cd8f0716",
"score": "0.72963977",
"text": "def execute_pre_build(software); end",
"title": ""
},
{
"docid": "d3286986a05fd48275dc3e47c4385a43",
"score": "0.72880346",
"text": "def prebuild(build, listener); end",
"title": ""
},
{
"docid": "ccf9c499f87a98f164a921beec410675",
"score": "0.72337264",
"text": "def prebuild(build, listener)\n # do any setup that needs to be done before this build runs.\n listener.info \"#{display_name} : prebuild fn ^^\"\n end",
"title": ""
},
{
"docid": "ddfcff0d84ef8d13c9aa60027a03ee42",
"score": "0.70347005",
"text": "def before_run;; end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.70303434",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "9cffb775aa02c1d8265e0ca380519549",
"score": "0.7024104",
"text": "def before_run; end",
"title": ""
},
{
"docid": "9cffb775aa02c1d8265e0ca380519549",
"score": "0.7024104",
"text": "def before_run; end",
"title": ""
},
{
"docid": "9cffb775aa02c1d8265e0ca380519549",
"score": "0.7024104",
"text": "def before_run; end",
"title": ""
},
{
"docid": "9cffb775aa02c1d8265e0ca380519549",
"score": "0.7024104",
"text": "def before_run; end",
"title": ""
},
{
"docid": "9cffb775aa02c1d8265e0ca380519549",
"score": "0.7024104",
"text": "def before_run; end",
"title": ""
},
{
"docid": "71369d948b728038b212e753c4b66a14",
"score": "0.6982425",
"text": "def prebuild(build, listener)\n\n end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.68827164",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cda20a33ff61e6a74028a8209aca3fd3",
"score": "0.68747675",
"text": "def prebuild(build, listener)\n end",
"title": ""
},
{
"docid": "31af21fb0a87821e8e8a82b0c71eb2bb",
"score": "0.6872535",
"text": "def before_run\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.68630767",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "54bc5dcae180a37208662771ff8732ce",
"score": "0.6823682",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "b1fd88118bc575d18b0b424ae711482e",
"score": "0.67438483",
"text": "def preinit\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.6662421",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "5c05ee8144a980e20d6e9215aef247a3",
"score": "0.66506153",
"text": "def before\n _init_env\n end",
"title": ""
},
{
"docid": "bb6e66d24f83bd691ce1f9fe86e07b3e",
"score": "0.66173285",
"text": "def pre_start; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.66047144",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.66047144",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "9a5f3e4033776f7658ef6e85e616a90f",
"score": "0.65999186",
"text": "def build_started(build)\n end",
"title": ""
},
{
"docid": "9a5f3e4033776f7658ef6e85e616a90f",
"score": "0.65999186",
"text": "def build_started(build)\n end",
"title": ""
},
{
"docid": "3f57c9b42ca4b2b6f5ebf3bcee1aeda9",
"score": "0.64914507",
"text": "def after_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "de604113c11562dd128f09f5be8bf765",
"score": "0.64619863",
"text": "def preReady()\n\t\t\t#does nothing. extend in subclasses\n\t\tend",
"title": ""
},
{
"docid": "42fbae1d6e5970893ad9efb0334746a9",
"score": "0.6412356",
"text": "def pre_run(_output); end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.6377344",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "34ad4cf24455c54d514916e9b29b9227",
"score": "0.63634086",
"text": "def setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "c17f02322e938eda6dcab2e86edb2417",
"score": "0.6362908",
"text": "def precheck\n end",
"title": ""
},
{
"docid": "c90a90f01a45978016c3fa6ef02daaad",
"score": "0.63469326",
"text": "def after_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.63442016",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "340ae187763e8cd752bda82d9c6873f3",
"score": "0.63414377",
"text": "def setup\n @setup_called = true\n end",
"title": ""
},
{
"docid": "5b769a5dfcf17b3fd43d52ef01bf6766",
"score": "0.63370407",
"text": "def pre_execute(&block)\n @hooks[:pre_execute] = block\n end",
"title": ""
},
{
"docid": "bb8624b6116788e6d4a9f45403f4647c",
"score": "0.6335315",
"text": "def setup\n\t\t\t\t# Do nothing\n\t\tend",
"title": ""
},
{
"docid": "74fc2410c63a7682223e2add4973b0c5",
"score": "0.63233525",
"text": "def pre_setup_suite()\n @cfg['pre_setup'] =\"defined\"\n return true\n end",
"title": ""
},
{
"docid": "c13f23579490ff181f0742040087456b",
"score": "0.63097996",
"text": "def postRun\n end",
"title": ""
},
{
"docid": "06bb4c1cb41a3fca3152535a7c83cadf",
"score": "0.63064426",
"text": "def setup\n true\n end",
"title": ""
},
{
"docid": "75e678a396f433cf5b099ce9c29bfb89",
"score": "0.63038945",
"text": "def start\n run_all if options[:build_on_start]\n end",
"title": ""
},
{
"docid": "7785b5dc1fce9e69b23159d00241eb3e",
"score": "0.6297601",
"text": "def run_before_hooks\n run_hooks(self.class.before_hooks)\n end",
"title": ""
},
{
"docid": "7af501dfbc981a76f4c18b19b5b63aa4",
"score": "0.6293179",
"text": "def run_before_scripts\n return if @config['before_script'].empty?\n\n puts 'INFO: Running pre test scripts'\n @config['before_script'].each do |cmd|\n run cmd\n end\n end",
"title": ""
},
{
"docid": "51a03e5f505f31e7d475102bb825063a",
"score": "0.6288791",
"text": "def before_init; end",
"title": ""
},
{
"docid": "9f898ebf30f2336f89e5331a508f1463",
"score": "0.62847024",
"text": "def setup\n\t\t# Do nothing\n\tend",
"title": ""
},
{
"docid": "9f898ebf30f2336f89e5331a508f1463",
"score": "0.62847024",
"text": "def setup\n\t\t# Do nothing\n\tend",
"title": ""
},
{
"docid": "9f898ebf30f2336f89e5331a508f1463",
"score": "0.62847024",
"text": "def setup\n\t\t# Do nothing\n\tend",
"title": ""
},
{
"docid": "9f898ebf30f2336f89e5331a508f1463",
"score": "0.62847024",
"text": "def setup\n\t\t# Do nothing\n\tend",
"title": ""
},
{
"docid": "ed30c4aef3cc12fd76703223a9285bd3",
"score": "0.6276557",
"text": "def before_start; end",
"title": ""
},
{
"docid": "5edac9eb313dd2d82caf4151ca49e7b0",
"score": "0.6260784",
"text": "def post_init\n end",
"title": ""
},
{
"docid": "00e1e140c02fa062eaff1d9dec1aa897",
"score": "0.625828",
"text": "def prepare\n if File.exists?( \"../lib/custom/expert/builders/#{@options['BUILD-NAME']}.xml\" )\n Maadi::post_message(:More, \"Builder (#{@type}) loading files\")\n\n items = Builder.extract_tests( @options['BUILD-NAME'] )\n items.each do |key, value|\n node = Builder.extract_test( key, value['source'] )\n if node != nil\n @tests[ key ] = node\n end\n end\n else\n Maadi::post_message(:Warn, \"Builder (#{@type}) unable to access files\")\n return false\n end\n\n Maadi::post_message(:More, \"Builder (#{@type}) is ready\")\n super\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.6257878",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.62567556",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "329aa4f2426a708c7a70b4809ecbc482",
"score": "0.6247031",
"text": "def firstRun\n end",
"title": ""
},
{
"docid": "af067245b56f1f0043f1b141f032b85f",
"score": "0.62283206",
"text": "def start\n unless @build_config.skip?(:start)\n @env.start\n end\n end",
"title": ""
},
{
"docid": "a7da667af47dddc22d903b74ae06f9f9",
"score": "0.62265056",
"text": "def precheck\n true\n end",
"title": ""
},
{
"docid": "f80d9e5c909e846638eddca022518aa1",
"score": "0.6197563",
"text": "def before_imports\n\t\tend",
"title": ""
},
{
"docid": "c1a9589f693b180299b2b438e7ac1d37",
"score": "0.61949605",
"text": "def setup\n setup! unless setup?\n end",
"title": ""
},
{
"docid": "f908ec1d5c9e86f424b264d5787b2ab3",
"score": "0.6191565",
"text": "def run!\n before_run\n say 'Not implemented yet'\n end",
"title": ""
},
{
"docid": "742ac26f5f86e407eade75d3e6b0ce3d",
"score": "0.6190398",
"text": "def before_install; end",
"title": ""
},
{
"docid": "b71533860e7e8473e04ae793f2cc3763",
"score": "0.61892647",
"text": "def post_init\n end",
"title": ""
},
{
"docid": "262d1aa18bcb697211cd9aa6a117edec",
"score": "0.6188498",
"text": "def post_init\n end",
"title": ""
},
{
"docid": "8cbd2949bd777370eef6da2d0bb41879",
"score": "0.6175797",
"text": "def prebuild(build, listener)\n listener.info(\"\\nStarting Prebuild:\")\n listener.info(\"Node Name: \\\"#{@node_name}\\\".\")\n listener.info(\"Remote Host: \\\"#{@host}\\\"\\nRemote Port: \\\"#{@port}\\\"\\nRemote User: \\\"#{@user}\\\"\")\n listener.info(\"Forward Agent: \\\"#{@forward_agent}\\\"\")\n listener.info(\"Transfer Workspace: \\\"#{@xfer_workspace}\\\"\")\n\n staging_dir = @stage_dir + '/' + @node_name\n listener.info(\"Staging Dir: \\\"#{staging_dir}\\\"\")\n listener.info(\"Environment:\\n\" + setenv + \"\\n\")\n \n listener.info(\"Preparing staging directory.\\n\")\n result = prepare_staging_dir(staging_dir)\n \n if @xfer_workspace \n listener.info(\"Starting to transfer workspace.\")\n transfer_workspace(build.workspace.to_s, staging_dir)\n else\n listener.info(\"Not transfering workspace, disabled by plugin.\\n\")\n end\n \n end",
"title": ""
},
{
"docid": "7c8578c0f718cc8ef299268a8ee6dc60",
"score": "0.6172026",
"text": "def process_init\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.6171505",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "07e8dcf31a42d25b8b498589ff92c087",
"score": "0.6167953",
"text": "def prepare\n if not File.exist?(build_dir)\n FileUtils.mkdir_p build_dir\n end\n cleanup\n end",
"title": ""
},
{
"docid": "7cb71aedec67762f6d4ac0d68bcf7551",
"score": "0.6162934",
"text": "def setup\n setup! unless setup?\n end",
"title": ""
},
{
"docid": "42dff1d7eebf1097b274bd669dd52633",
"score": "0.61628",
"text": "def post_init\n end",
"title": ""
},
{
"docid": "42dff1d7eebf1097b274bd669dd52633",
"score": "0.61628",
"text": "def post_init\n end",
"title": ""
},
{
"docid": "f6ad3e9b34f39ce286ea190d3706a644",
"score": "0.61542135",
"text": "def setup!\n # Does nothing.\n end",
"title": ""
},
{
"docid": "bdaaaa519acf00f64bdb9051a981a562",
"score": "0.6144146",
"text": "def prepare\n unless @build_config.skip?(:prepare)\n @env.prepare\n end\n end",
"title": ""
},
{
"docid": "b3810c5f31da0475455d01051be6e3d5",
"score": "0.6142069",
"text": "def _LogTextBeforeExecute\n \"Building project #{@Name}...\"\n end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.61318475",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "b71725bba4452b366e14ce5a36f91a5b",
"score": "0.61309093",
"text": "def before_setup\n info :before_setup\n setup_ssh_key if needs?(:ssh_key)\n setup_git_config if needs?(:git)\n setup_git_http_user_agent\n end",
"title": ""
},
{
"docid": "f54241024a6e25b6d0828fa8c5a55a7d",
"score": "0.61298895",
"text": "def on_hook_before_compile(args)\n @debug_session.puppet_session_state.actual.update_compiler(args[0])\n\n # Spin-wait for the configurationDone message from the client before we continue compilation\n return if @debug_session.flow_control.flag?(:client_completed_configuration)\n sleep(0.5) until @debug_session.flow_control.flag?(:client_completed_configuration)\n end",
"title": ""
},
{
"docid": "71d723f960c7dab637043e0a3a1fcde5",
"score": "0.61263454",
"text": "def setup\r\n end",
"title": ""
},
{
"docid": "6da11b6018e9420a7480010c070c9965",
"score": "0.6124813",
"text": "def post_init; end",
"title": ""
},
{
"docid": "6da11b6018e9420a7480010c070c9965",
"score": "0.6124813",
"text": "def post_init; end",
"title": ""
},
{
"docid": "6da11b6018e9420a7480010c070c9965",
"score": "0.6124813",
"text": "def post_init; end",
"title": ""
},
{
"docid": "67aa8de45af83e06b5ffa4b99a6673d6",
"score": "0.611312",
"text": "def pre_build\n puts \"pre_build dir=#{`pwd`}\"\n mkdir_p \"#{TGT_DIR}/lib\"\n cp_r \"#{EXT_RUBY}/lib/ruby\", \"#{TGT_DIR}/lib\"\n SOLOCS.each_value do |path|\n cp \"#{path}\", \"#{TGT_DIR}\"\n end\n # do some windows things\n sh \"#{WINDRES} -I. shoes/appwin32.rc shoes/appwin32.o\"\n end",
"title": ""
},
{
"docid": "91cf292890466245c8704b97a7114439",
"score": "0.61111385",
"text": "def before_run\n fail 'please run `dw config` first' unless configured?\n end",
"title": ""
},
{
"docid": "3698d7ee83ebf896f281576cb4617577",
"score": "0.61098385",
"text": "def before_init\n warn status.msg if status && status.announce?\n deprecations.each { |(key, msg)| ctx.deprecate_opt(key, msg) }\n setup_dpl_dir\n move_files(ctx)\n end",
"title": ""
},
{
"docid": "791044d9558c34b0f2b17404edcf431d",
"score": "0.60944784",
"text": "def build_up\n end",
"title": ""
},
{
"docid": "ab2797485b69e614127f3fab49a857ec",
"score": "0.60933644",
"text": "def setup\n \n end",
"title": ""
},
{
"docid": "d426cd958551ac3ab8cb35bec0dbbfc4",
"score": "0.6077822",
"text": "def before\n end",
"title": ""
},
{
"docid": "d426cd958551ac3ab8cb35bec0dbbfc4",
"score": "0.6077822",
"text": "def before\n end",
"title": ""
},
{
"docid": "d426cd958551ac3ab8cb35bec0dbbfc4",
"score": "0.6077822",
"text": "def before\n end",
"title": ""
},
{
"docid": "59ef8546ac71e692cdfd7ac37f225bf3",
"score": "0.6072369",
"text": "def before\n require_libs\n require_ing_file\n self.shell = shell_class.new; self.shell.base = self\n end",
"title": ""
},
{
"docid": "59ef8546ac71e692cdfd7ac37f225bf3",
"score": "0.6072369",
"text": "def before\n require_libs\n require_ing_file\n self.shell = shell_class.new; self.shell.base = self\n end",
"title": ""
},
{
"docid": "71388a630fc41d483a1c5ff6a41a1880",
"score": "0.6069581",
"text": "def before_run(&blk)\n dzen.add_before_run(&blk)\n end",
"title": ""
}
] |
58a4c03458f6c3bc7b9d23668212da93
|
GET /jugadores/new GET /jugadores/new.json
|
[
{
"docid": "227f1e9e73e4826df0e8990da4c85dba",
"score": "0.7579171",
"text": "def new\n @jugadore = Jugadore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jugadore }\n end\n end",
"title": ""
}
] |
[
{
"docid": "9f289a6609e9206c625a32218d9ac499",
"score": "0.7434169",
"text": "def new\n @jugador = Jugador.new\n @clubes = Club.all\n @equipos = Equipo.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jugador }\n end\n end",
"title": ""
},
{
"docid": "945fe14a5f2539821c73ed9ac36be23d",
"score": "0.71917534",
"text": "def new\n @jornada = Jornada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jornada }\n end\n end",
"title": ""
},
{
"docid": "5a9bde36ded26e4daa07c7367d233009",
"score": "0.7144236",
"text": "def new\n @jugador = Jugador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @jugador }\n end\n end",
"title": ""
},
{
"docid": "3ae38fdecce9be306dc52c30004f14e1",
"score": "0.7005531",
"text": "def new\n @guille = Guille.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guille }\n end\n end",
"title": ""
},
{
"docid": "4439b71655090e2740e6a8e05504c33c",
"score": "0.699992",
"text": "def create\n @jugador = Jugador.new(jugador_params)\n\n respond_to do |format|\n if @jugador.save\n format.html { redirect_to @jugador, notice: 'Jugador was successfully created.' }\n format.json { render :show, status: :created, location: @jugador }\n else\n format.html { render :new }\n format.json { render json: @jugador.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba19362bc995c2ac9b3c875670d7ebd0",
"score": "0.6987355",
"text": "def new\n seleccionarMenu(:juzgados)\n @juzgado = Juzgado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @juzgado }\n end\n end",
"title": ""
},
{
"docid": "7756654be46293658c707587c0f4e603",
"score": "0.69803387",
"text": "def new\n @lugar = Lugar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lugar }\n end\n end",
"title": ""
},
{
"docid": "6017c956942b260128e11476cd85657e",
"score": "0.69513744",
"text": "def new\n @lieu = Lieu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lieu }\n end\n end",
"title": ""
},
{
"docid": "16e8341e01a30007ab8aa8d0621afd6b",
"score": "0.68795455",
"text": "def new\n @nabe = Nabe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nabe }\n end\n end",
"title": ""
},
{
"docid": "da497668d1a1b0a51d73d9e67bd60b9a",
"score": "0.6873787",
"text": "def new\n @kolegij = Kolegij.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kolegij }\n end\n end",
"title": ""
},
{
"docid": "73b0000318f121500ee2d2a69f275ce4",
"score": "0.68735623",
"text": "def new\n @jamaat = Jamaat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jamaat }\n end\n end",
"title": ""
},
{
"docid": "c0f697563b3e2cba43aed8a2872596f6",
"score": "0.68635267",
"text": "def new\n @fiction = Fiction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fiction }\n end\n end",
"title": ""
},
{
"docid": "c6ff049d25cb1674cac59c3037a4ab6d",
"score": "0.68607074",
"text": "def new\n @personaje = Personaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @personaje }\n end\n end",
"title": ""
},
{
"docid": "ca3fba538d33fe00a8b0443378c69dc8",
"score": "0.6858455",
"text": "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end",
"title": ""
},
{
"docid": "ca3fba538d33fe00a8b0443378c69dc8",
"score": "0.6858455",
"text": "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end",
"title": ""
},
{
"docid": "b49edda91fa663772f4574d6ae1ea016",
"score": "0.6857893",
"text": "def new\n @chaine = Chaine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chaine }\n end\n end",
"title": ""
},
{
"docid": "4a0c77ce53563e34f223ab8f8c9acd98",
"score": "0.68576056",
"text": "def new\n @colegio = Colegio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colegio }\n end\n end",
"title": ""
},
{
"docid": "f6f11cd1fe3805df89a5e638f3943fee",
"score": "0.685668",
"text": "def new\n @kolegiji = Kolegiji.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kolegiji }\n end\n end",
"title": ""
},
{
"docid": "4149ec8067e8f71aaa93215d3a06672a",
"score": "0.6853207",
"text": "def new\n @projeto = Projeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projeto }\n end\n end",
"title": ""
},
{
"docid": "5f9db4488195c1dd05da8ade5ce3feae",
"score": "0.68477863",
"text": "def new\n @noto = Noto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @noto }\n end\n end",
"title": ""
},
{
"docid": "dbb63379872e7c24fa64ea9556287291",
"score": "0.68384415",
"text": "def new\n @motivobaja = MotivoBaja.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @motivobaja }\n end\n end",
"title": ""
},
{
"docid": "fd46eb658e309ff90d18970e1756a6f8",
"score": "0.6835524",
"text": "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recurso }\n end\n end",
"title": ""
},
{
"docid": "74aedf99864389ffd20a2fd57350d261",
"score": "0.6828918",
"text": "def new\n @requerimiento = Requerimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requerimiento }\n end\n end",
"title": ""
},
{
"docid": "0e561040658b5af5a3dd2b89e06e9fd2",
"score": "0.6826644",
"text": "def new\n @respuesta = Respuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @respuesta }\n end\n end",
"title": ""
},
{
"docid": "121d4513d97411d74c2c33c01286fcd4",
"score": "0.6819313",
"text": "def new\n @veiculo = Veiculo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"title": ""
},
{
"docid": "c20dd1b1f99d6e69afb01ef2d4df616d",
"score": "0.68123794",
"text": "def create\n @jugador = Jugador.new(params[:jugador])\n @clubes = Club.all\n @equipos = Equipo.all\n respond_to do |format|\n if @jugador.save\n format.html { redirect_to @jugador, notice: 'Jugador se ha creado correctamente.' }\n format.json { render json: @jugador, status: :created, location: @jugador }\n else\n format.html { render action: \"new\" }\n format.json { render json: @jugador.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35b501d2e2673f25cf0bc1b7da03d6e5",
"score": "0.6795966",
"text": "def new\n @u = U.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @u }\n end\n end",
"title": ""
},
{
"docid": "9f95bd020b51e879586d991c5cf2efd2",
"score": "0.6785037",
"text": "def new\n @sezione = Sezione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sezione }\n end\n end",
"title": ""
},
{
"docid": "8809cfa91b24f11c60d06bb902c802c7",
"score": "0.67823964",
"text": "def new\n @galeria = Galeria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @galeria }\n end\n end",
"title": ""
},
{
"docid": "bf8ac463042e09827daded3e77538412",
"score": "0.6766437",
"text": "def new\n @competition = Competition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competition }\n end\n end",
"title": ""
},
{
"docid": "bf8ac463042e09827daded3e77538412",
"score": "0.6766437",
"text": "def new\n @competition = Competition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competition }\n end\n end",
"title": ""
},
{
"docid": "bf8ac463042e09827daded3e77538412",
"score": "0.6766437",
"text": "def new\n @competition = Competition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competition }\n end\n end",
"title": ""
},
{
"docid": "eefef23917f364cd3f2092ee290e0ab8",
"score": "0.67651206",
"text": "def new\n @mutacao = Mutacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mutacao }\n end\n end",
"title": ""
},
{
"docid": "8ddfa8abbdc2d4cfbcc00fbad19df562",
"score": "0.6753018",
"text": "def new\n @quest = Quest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end",
"title": ""
},
{
"docid": "0beb7fbacac33825624796b9f57a6a15",
"score": "0.67509896",
"text": "def create\n @jugador = Jugador.new(params[:jugador])\n\n respond_to do |format|\n if @jugador.save\n format.html { redirect_to(@jugador, :notice => 'Jugador was successfully created.') }\n format.xml { render :xml => @jugador, :status => :created, :location => @jugador }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @jugador.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0be0a9744f18d6c6d825aa566c1dca61",
"score": "0.6749239",
"text": "def new\n @spiel = Spiel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spiel }\n end\n end",
"title": ""
},
{
"docid": "d7043aca91bb9e39addad08f3cf9a254",
"score": "0.67487365",
"text": "def new\n @jam = Jam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jam }\n end\n end",
"title": ""
},
{
"docid": "b73721fe1b741f807e4487f5dd49e9be",
"score": "0.67451954",
"text": "def new\n @garbage = Garbage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @garbage }\n end\n end",
"title": ""
},
{
"docid": "4b6c8279ef724ed40053d93568499ee2",
"score": "0.6738338",
"text": "def new\n @class = Classe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class }\n end\n end",
"title": ""
},
{
"docid": "d2154730a9a308eb37cd0397b05bd74f",
"score": "0.6734332",
"text": "def new\n @genu = Genu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genu }\n end\n end",
"title": ""
},
{
"docid": "c944fc31b17764f0538d90ccfa54b53a",
"score": "0.6730762",
"text": "def new\n @clasificacion_pegi = ClasificacionPegi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clasificacion_pegi }\n end\n end",
"title": ""
},
{
"docid": "9d382ea2688486734f65af929f120699",
"score": "0.67246765",
"text": "def new\n @classe = Classe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classe }\n end\n end",
"title": ""
},
{
"docid": "64e018ca2072796e142b74d8b717d204",
"score": "0.67235863",
"text": "def new\n @selecao = Selecao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @selecao }\n end\n end",
"title": ""
},
{
"docid": "82310f9e35a4747d81fb0745c5968318",
"score": "0.67218995",
"text": "def new\n @monnaie = Monnaie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @monnaie }\n end\n end",
"title": ""
},
{
"docid": "b03aaef8ee41f76bd83859177a9a4c1a",
"score": "0.6714125",
"text": "def new\n @competicao = Competicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competicao }\n end\n end",
"title": ""
},
{
"docid": "935fe0f1e9b6f6ada312182f08019bb2",
"score": "0.6712878",
"text": "def new\n @tecnico = Tecnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tecnico }\n end\n end",
"title": ""
},
{
"docid": "c445e7f3af9e3d2688e9ec7449f42635",
"score": "0.6710266",
"text": "def new\n @combinacion = Combinacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @combinacion }\n end\n end",
"title": ""
},
{
"docid": "20e1c24a761e8d7c7fc51883839c2993",
"score": "0.67062265",
"text": "def new\n @petition = Petition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @petition }\n end\n end",
"title": ""
},
{
"docid": "75141bb167bcc0603715e2e43ef5d77f",
"score": "0.6705881",
"text": "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end",
"title": ""
},
{
"docid": "75141bb167bcc0603715e2e43ef5d77f",
"score": "0.6705881",
"text": "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end",
"title": ""
},
{
"docid": "e7cae92eb9f3bdcf38497a2c0cfe5869",
"score": "0.6695024",
"text": "def new\n @colegiatura = Colegiatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colegiatura }\n end\n end",
"title": ""
},
{
"docid": "029fa2015e9a4c987a699d7a05f1239d",
"score": "0.66896963",
"text": "def new\n @seguro = Seguro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seguro }\n end\n end",
"title": ""
},
{
"docid": "24f5253740123e927d386d33d0a7f6e7",
"score": "0.668773",
"text": "def new\n add_breadcrumb \"nueva\", :new_contest_path\n @contest = Contest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contest }\n end\n end",
"title": ""
},
{
"docid": "30323433bf5ccb31984673a0674558f4",
"score": "0.66877085",
"text": "def new\n @livro = Livro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @livro }\n end\n end",
"title": ""
},
{
"docid": "a9e2dd40f0297326c4b73239b0be2587",
"score": "0.6683008",
"text": "def new\n @giang_vien = GiangVien.new\n\n respond_to do |format| \n format.json { render json: @giang_vien }\n end\n end",
"title": ""
},
{
"docid": "5dfaaabf52317533cc23b0177c083071",
"score": "0.66810894",
"text": "def new\n @quetion = Quetion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quetion }\n end\n end",
"title": ""
},
{
"docid": "e6377e0102e5624e4719a78f8da45492",
"score": "0.66757834",
"text": "def new\n @pot = Pot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pot }\n end\n end",
"title": ""
},
{
"docid": "96f2e165756c60145ee6147a790239ae",
"score": "0.667243",
"text": "def new\n @jedi = Jedi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jedi }\n end\n end",
"title": ""
},
{
"docid": "cdbdaecd47e012e8788daee669371253",
"score": "0.66722655",
"text": "def new\n @goody = Goody.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goody }\n end\n end",
"title": ""
},
{
"docid": "df3dd9c615dce9edd145bf76d276bafb",
"score": "0.66685134",
"text": "def new\n @prioridade = Prioridade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prioridade }\n end\n end",
"title": ""
},
{
"docid": "ec3dc38c210439f05a69d1012fd6b0d6",
"score": "0.66647774",
"text": "def new\n @prepagada = Prepagada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prepagada }\n end\n end",
"title": ""
},
{
"docid": "bc22eecd6553d45ab4d71d437ec1c2fb",
"score": "0.66639197",
"text": "def new\n @goat = Goat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goat }\n end\n end",
"title": ""
},
{
"docid": "5444a59dece822bdfeac9db3a2f3a631",
"score": "0.666316",
"text": "def new\n @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n end\n end",
"title": ""
},
{
"docid": "74528af73cc8a93659d546f1a373f4fb",
"score": "0.66630566",
"text": "def new\n @ongoing = Ongoing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ongoing }\n end\n end",
"title": ""
},
{
"docid": "3e3e6fea4dae215575c89aea30de00c4",
"score": "0.6651868",
"text": "def new\n @tecnico = Tecnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"title": ""
},
{
"docid": "5193f9bf2a9583afe88fe98990462718",
"score": "0.66510135",
"text": "def new\n @momsg = Momsg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @momsg }\n end\n end",
"title": ""
},
{
"docid": "9b7ff55dcd07556de5a4b6f74d7d8b19",
"score": "0.6649083",
"text": "def new\n @gig_request = GigRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig_request }\n end\n end",
"title": ""
},
{
"docid": "c0f2215417ff5459a99cf19268baaa03",
"score": "0.6641825",
"text": "def new\n @golfer = Golfer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @golfer }\n end\n end",
"title": ""
},
{
"docid": "bd1fc80f64bf1baf6506d0fb51b1cbf0",
"score": "0.6639873",
"text": "def new\n @mi = Mi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mi }\n end\n end",
"title": ""
},
{
"docid": "16584278166786272aa8e0589c4add21",
"score": "0.6637042",
"text": "def new\n @tenni = Tenni.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tenni }\n end\n end",
"title": ""
},
{
"docid": "5a4d14bd4bff4e4a1ff23a4765f7e36c",
"score": "0.6636205",
"text": "def new\n @municipio = Municipio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @municipio }\n end\n end",
"title": ""
},
{
"docid": "5a4d14bd4bff4e4a1ff23a4765f7e36c",
"score": "0.6636205",
"text": "def new\n @municipio = Municipio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @municipio }\n end\n end",
"title": ""
},
{
"docid": "b2a84a56d40c901e71eef93eecdaf22b",
"score": "0.66361487",
"text": "def new\n @metodo = Metodo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @metodo }\n end\n end",
"title": ""
},
{
"docid": "3ad05edc3584efd53bcecce491c1738d",
"score": "0.6631624",
"text": "def new\n @ficha = Ficha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ficha }\n end\n end",
"title": ""
},
{
"docid": "a915e5ab4c6160ad75667581021ceba3",
"score": "0.6630779",
"text": "def new\n @manga = Manga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manga }\n end\n end",
"title": ""
},
{
"docid": "ab1aba460ff218f0e53b50569c9072fc",
"score": "0.66288656",
"text": "def new\n @pedido = Pedido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pedido }\n end\n end",
"title": ""
},
{
"docid": "217a96ae1b0dcbcaa799345d79f4f1a6",
"score": "0.6628492",
"text": "def new\n @viaje = Viaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @viaje }\n end\n end",
"title": ""
},
{
"docid": "2afe85c45127d1db5af493430727fff4",
"score": "0.66269064",
"text": "def new\n @repa = Repa.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @repa }\n end\n end",
"title": ""
},
{
"docid": "4e4d65a4e29b65167e9b6cda2fd954f6",
"score": "0.66218185",
"text": "def new\n @caixa = Caixa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @caixa }\n end\n end",
"title": ""
},
{
"docid": "39fd40d2b1d44c19fc2d11d5f413119d",
"score": "0.6617179",
"text": "def new\n @personaje_mision = PersonajeMision.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @personaje_mision }\n end\n end",
"title": ""
},
{
"docid": "05558d5b57d0951a8e1ea7d7a9a4b56f",
"score": "0.6615846",
"text": "def new\n @utente = Utente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @utente }\n end\n end",
"title": ""
},
{
"docid": "63010fbde3ecb78f02f36395b906006b",
"score": "0.661254",
"text": "def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @premio }\n end\n end",
"title": ""
},
{
"docid": "4a6d100fbca7b810114e340445fbbf4c",
"score": "0.66110927",
"text": "def new\n @tipo_negocio = TipoNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_negocio }\n end\n end",
"title": ""
},
{
"docid": "09d9f63143f3f7b19ff30d622452b203",
"score": "0.6610049",
"text": "def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lore }\n end\n end",
"title": ""
},
{
"docid": "a8a14e6b4e808fa8d0c437faa68558cf",
"score": "0.6609019",
"text": "def new\n @nguoi_dung = NguoiDung.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nguoi_dung }\n end\n end",
"title": ""
},
{
"docid": "270d4646a29fd4dd5d271869c12242a6",
"score": "0.6608372",
"text": "def new\n @categoria = Categoria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @categoria }\n end\n end",
"title": ""
},
{
"docid": "d8db6bf3e987666d7141611071602d2e",
"score": "0.6607869",
"text": "def new\n @ejercicio = Ejercicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"title": ""
},
{
"docid": "007b91a2d53693203fd11d250b66d174",
"score": "0.66077626",
"text": "def new\n @seguidore = Seguidore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seguidore }\n end\n end",
"title": ""
},
{
"docid": "0a7e064094744aa82d33caae0d133d89",
"score": "0.66076994",
"text": "def new\n @repuestum = Repuestum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @repuestum }\n end\n end",
"title": ""
},
{
"docid": "b3c3dee602695f960aff2627e50eb76a",
"score": "0.66075623",
"text": "def new\n @rechnung = Rechnung.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rechnung }\n end\n end",
"title": ""
},
{
"docid": "1104f99a0c5669271e22e8c2758952c3",
"score": "0.66062105",
"text": "def new\n @modelo = Modelo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @modelo }\n end\n end",
"title": ""
},
{
"docid": "1377dd64f83181d1e38085bb7558fbac",
"score": "0.6602329",
"text": "def new\n @vocacionada = Vocacionada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vocacionada }\n end\n end",
"title": ""
},
{
"docid": "9da1b4c9c88b5fc81cfc2e8484599db1",
"score": "0.66021097",
"text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "9da1b4c9c88b5fc81cfc2e8484599db1",
"score": "0.66021097",
"text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "de7f98cd33ee68625fe75ac083d8e701",
"score": "0.6601934",
"text": "def new\n @reconocimiento = Reconocimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @reconocimiento }\n end\n end",
"title": ""
},
{
"docid": "da0a4edc9d359599357af6b51eb5f2cf",
"score": "0.6596516",
"text": "def new\n @guitar = Guitar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guitar }\n end\n end",
"title": ""
},
{
"docid": "bf2fc243942711b3304a87f2f0b35b74",
"score": "0.65954024",
"text": "def new\n @comentario = Comentario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comentario }\n end\n end",
"title": ""
},
{
"docid": "7bd558262df1692a642406feaec44576",
"score": "0.65915287",
"text": "def new\n @ginasio = Ginasio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ginasio }\n end\n end",
"title": ""
},
{
"docid": "ed92962df76d87a149351a068fe07c97",
"score": "0.6591236",
"text": "def new\n @ministerio = Ministerio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ministerio }\n end\n end",
"title": ""
},
{
"docid": "d2cd63d14e53690a6bce286a428806cf",
"score": "0.65898764",
"text": "def new\n @lei = Lei.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lei }\n end\n end",
"title": ""
}
] |
de6b3af3d692defd2609356853dfbb75
|
Make sure that each test case has a teardown method to clear the db after each test.
|
[
{
"docid": "c24ff1b9473986c1ca0232b3af7ece92",
"score": "0.0",
"text": "def inherited(base)\n base.define_method teardown do\n super\n end\n end",
"title": ""
}
] |
[
{
"docid": "6544d2d58d9350d821723efb1c0360e2",
"score": "0.84976226",
"text": "def teardown\n @db.disconnect\n end",
"title": ""
},
{
"docid": "6ad8e127d3118a9c12aed343e843a546",
"score": "0.84446484",
"text": "def teardown\n File.delete(DB_NAME) if File.exist?(DB_NAME)\n end",
"title": ""
},
{
"docid": "8e7b59140928ebfcf23083beca308b1b",
"score": "0.8204243",
"text": "def teardown\n DBCache.destroy!\n end",
"title": ""
},
{
"docid": "089c17076f0c34bb2337b21a7e1f5cef",
"score": "0.8158796",
"text": "def teardown\n self.db_disconnect\n super\n end",
"title": ""
},
{
"docid": "d456c5266a3006c108032fc4d6d50404",
"score": "0.81497973",
"text": "def teardown\n cleanup_tables\n cleanup_caches\n end",
"title": ""
},
{
"docid": "042280734d7a7fcaf87f27ea5ff94a29",
"score": "0.81493646",
"text": "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end",
"title": ""
},
{
"docid": "042280734d7a7fcaf87f27ea5ff94a29",
"score": "0.81493646",
"text": "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end",
"title": ""
},
{
"docid": "042280734d7a7fcaf87f27ea5ff94a29",
"score": "0.81493646",
"text": "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end",
"title": ""
},
{
"docid": "042280734d7a7fcaf87f27ea5ff94a29",
"score": "0.81493646",
"text": "def teardown\n puts \"Teardown running...\"\n %x[rake db:reset]\n end",
"title": ""
},
{
"docid": "37d0398e5d580e7bf11361deb936759d",
"score": "0.8029005",
"text": "def teardown\n @db.query('DROP TABLE `products`')\n @db.query('DROP TABLE `shops`')\n end",
"title": ""
},
{
"docid": "090784342220a6941dc8ac5e0a9736ff",
"score": "0.79704314",
"text": "def teardown\r\n db = DB_TP2.getDB\r\n db.close\r\n end",
"title": ""
},
{
"docid": "090784342220a6941dc8ac5e0a9736ff",
"score": "0.79704314",
"text": "def teardown\r\n db = DB_TP2.getDB\r\n db.close\r\n end",
"title": ""
},
{
"docid": "b2f5854bd6a345bad408c1e0084e4d25",
"score": "0.79577",
"text": "def teardown\n self.db_disconnect\n self.logout()\n super\n end",
"title": ""
},
{
"docid": "b2f5854bd6a345bad408c1e0084e4d25",
"score": "0.79577",
"text": "def teardown\n self.db_disconnect\n self.logout()\n super\n end",
"title": ""
},
{
"docid": "330d87da728888ddedd08453b55c19dd",
"score": "0.79420686",
"text": "def teardown\n Record.delete_all\n end",
"title": ""
},
{
"docid": "c85eab703f974cdff4ed316d4f562111",
"score": "0.7855487",
"text": "def teardown\n self.db_disconnect\n# self.logout()\n super\n end",
"title": ""
},
{
"docid": "2aa8146b98a46cc558ee17ea4ade2ba3",
"score": "0.7783199",
"text": "def after_teardown\n super\n DatabaseCleaner.clean\n end",
"title": ""
},
{
"docid": "c8a053bfebdd32aa7fb36fd5b58b0671",
"score": "0.775251",
"text": "def teardown\n # Do nothing\n @dbtool.del('20130412*')\n end",
"title": ""
},
{
"docid": "8f3c5dbacb0cabacb2d4bf9354423445",
"score": "0.7693747",
"text": "def teardown\n Article.delete_all\n Author.delete_all\n Comment.delete_all\n end",
"title": ""
},
{
"docid": "c11befe5411d84314b3812676ab16245",
"score": "0.76898104",
"text": "def teardown\n flush_all\n end",
"title": ""
},
{
"docid": "395c7d87ac00788e5c45a794142a4f18",
"score": "0.76189786",
"text": "def teardown\n Allergy.destroy_all\n Recipe.destroy_all\n Ingredient.destroy_all\n end",
"title": ""
},
{
"docid": "1a3ff98a8be654e8eb0fe733694072f9",
"score": "0.7603191",
"text": "def teardown\n delete_all\n restore_path\n end",
"title": ""
},
{
"docid": "5d5e44eec40d48eeda4cca136c35afd8",
"score": "0.7579764",
"text": "def teardown\n # Empty\n end",
"title": ""
},
{
"docid": "5d5e44eec40d48eeda4cca136c35afd8",
"score": "0.7579764",
"text": "def teardown\n # Empty\n end",
"title": ""
},
{
"docid": "5d5e44eec40d48eeda4cca136c35afd8",
"score": "0.7579764",
"text": "def teardown\n # Empty\n end",
"title": ""
},
{
"docid": "212e59132144beb21b60ca65fd5ae324",
"score": "0.7570922",
"text": "def teardown\n ;\n end",
"title": ""
},
{
"docid": "2080f3ae82c6ea48a14217fc6d4050e0",
"score": "0.7546439",
"text": "def teardown\n db.obliterate!\n FileUtils.cd(conf.app_dir)\n FileUtils.rm_rf(conf.master_repository_uri)\n end",
"title": ""
},
{
"docid": "4bc9e089f235449e79d8c72ce36fcb36",
"score": "0.7545148",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "4bc9e089f235449e79d8c72ce36fcb36",
"score": "0.7545148",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "303d8f24dd259b4621b6544f78278ae7",
"score": "0.7537092",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "2b37caecdd479de6ce803118f58f990b",
"score": "0.7531608",
"text": "def clean_up_database!\n destroy_temp_password!\n\n Scalarm::MongoLock.mutex(\"experiment-#{self.experiment_id}-simulation-complete\") do\n rollback_current_simulation_run!\n end\n end",
"title": ""
},
{
"docid": "1868e07ef01719159ed3cc6926386923",
"score": "0.7524269",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "1868e07ef01719159ed3cc6926386923",
"score": "0.7524269",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "80a0e52a2b09abcbd75981d4943dfd71",
"score": "0.7518995",
"text": "def teardown\n reset_test_env\n end",
"title": ""
},
{
"docid": "bf910f14f0534b9dd6625d6e6b47015e",
"score": "0.7512882",
"text": "def clear_test_database\n log_info(\"Delete contents of #{DB_NAME_TEST} (hard coded name)\")\n end",
"title": ""
},
{
"docid": "50106329a68160949a7f8bbfc6fdfde8",
"score": "0.75084233",
"text": "def teardown()\n end",
"title": ""
},
{
"docid": "cee32a254b688879833e9a5df959dba4",
"score": "0.7482929",
"text": "def teardown!\n return unless @_setup\n return if @_teardown\n @_teardown = true\n\n DeltaTest.log('--- teardown!')\n Profiler.clean!\n @table.dump(DeltaTest.config.tmp_table_file)\n end",
"title": ""
},
{
"docid": "589ae2d634440864edfd46c2b688700a",
"score": "0.74801636",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "589ae2d634440864edfd46c2b688700a",
"score": "0.74801636",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "589ae2d634440864edfd46c2b688700a",
"score": "0.74801636",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "acadc10e5826482ed56afcc89bb3863b",
"score": "0.7479443",
"text": "def teardown\n\t\t# puts \"Clear data here!\"\n\tend",
"title": ""
},
{
"docid": "437c707e2863ff2a09049b15aab915d0",
"score": "0.7470251",
"text": "def teardown\n ItemAlias.all.destroy!\n Item.all.destroy!\n end",
"title": ""
},
{
"docid": "a0d125200e8afc569defdb1c430e13d6",
"score": "0.74243337",
"text": "def before_setup\n # Reset the DB before each test to make a clean slate.\n # I swear this was easier back in like 2012!\n [ShortCode].each do |model|\n ApplicationRecord.connection.execute(\"Delete from #{model.table_name}\")\n ApplicationRecord.connection.execute(\"DELETE FROM SQLITE_SEQUENCE WHERE name='#{model.table_name}'\")\n end\n\n super\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "ccfcfa07c08dff5778b19a4d2d3c2864",
"score": "0.7420333",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "51fab1a7c281a61e6a7d5a7d668bca41",
"score": "0.740699",
"text": "def teardown\n\t\t\t# Do nothing\n\t\tend",
"title": ""
},
{
"docid": "485fc043d4f994ce0d31dce1f73e1683",
"score": "0.7377335",
"text": "def teardown()\r\n end",
"title": ""
},
{
"docid": "21122bc45d95a2c7239a18add4c888d1",
"score": "0.7373035",
"text": "def test_teardown\n end",
"title": ""
},
{
"docid": "5f2a868433e06ec868f26ea13a927ebf",
"score": "0.73610747",
"text": "def teardown\n # empty\n end",
"title": ""
},
{
"docid": "b2f6e6ef107d12c01f16e986744cdf92",
"score": "0.7350527",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "b2f6e6ef107d12c01f16e986744cdf92",
"score": "0.7350527",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "b2f6e6ef107d12c01f16e986744cdf92",
"score": "0.7350527",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "b2f6e6ef107d12c01f16e986744cdf92",
"score": "0.7350527",
"text": "def teardown\n # Do nothing\n end",
"title": ""
},
{
"docid": "c6e39fe79a0dab6458f9f7166dcb1a5d",
"score": "0.73449486",
"text": "def teardown; cleanup; super; end",
"title": ""
},
{
"docid": "d73097f40eed32fbfc99ed816269b37c",
"score": "0.7343773",
"text": "def setup_db\n without_transaction do\n c = ActiveRecord::Base.connection\n\n create_crud_test_models(c)\n create_other_crud_test_models(c)\n create_crud_test_models_other_crud_test_models(c)\n\n CrudTestModel.reset_column_information\n end\n end",
"title": ""
},
{
"docid": "8c3838afba585c89a11667735fa4bc17",
"score": "0.7337117",
"text": "def teardown!\n end",
"title": ""
},
{
"docid": "2d755c1605c4ba009ac2ea157666d97c",
"score": "0.73370975",
"text": "def teardown\n #Mongoid.purge!\n end",
"title": ""
},
{
"docid": "1a06ad9bdcfb66ff1eceaf5260211770",
"score": "0.73357785",
"text": "def teardown\n Thingy.delete_all\n end",
"title": ""
},
{
"docid": "d110915214e25657d4ce4974b54e2291",
"score": "0.73328555",
"text": "def teardown\n\n end",
"title": ""
},
{
"docid": "5f3bd53c03e65e6344116b05289fa8ca",
"score": "0.73314154",
"text": "def teardown\n Capybara.reset_sessions!\n Capybara.use_default_driver\n DatabaseCleaner.clean\n end",
"title": ""
},
{
"docid": "adc7e8292636b3ab121557ef92a7e508",
"score": "0.7308072",
"text": "def teardown_fixtures\n teardown_seeds(*@loaded_seeds)\n \n return unless defined?(ActiveRecord) && !ActiveRecord::Base.configurations.blank?\n\n unless run_in_transaction?\n fixtures_class_in_my_rails.reset_cache\n end\n\n if run_in_transaction? && @created_save_point\n # Use safe points\n ActiveRecord::Base.connection.decrement_open_transactions\n ActiveRecord::Base.connection.rollback_to_savepoint\n @created_save_point = false\n end\n ActiveRecord::Base.clear_active_connections!\n end",
"title": ""
},
{
"docid": "69272abcf7bcfdd53b4e0db6234062f5",
"score": "0.7305307",
"text": "def clear_database\n FileSystem.collection.drop\n Extension.collection.drop\n AnalyseResult.collection.drop\n end",
"title": ""
},
{
"docid": "8d34581858fee3dbda2aa70c5c3bcfae",
"score": "0.7298898",
"text": "def teardown\r\n \r\n end",
"title": ""
},
{
"docid": "6d970e9600a4fab34262b7eae818d173",
"score": "0.7298054",
"text": "def teardown; end",
"title": ""
},
{
"docid": "6d970e9600a4fab34262b7eae818d173",
"score": "0.7298054",
"text": "def teardown; end",
"title": ""
},
{
"docid": "6d970e9600a4fab34262b7eae818d173",
"score": "0.7298054",
"text": "def teardown; end",
"title": ""
},
{
"docid": "6d970e9600a4fab34262b7eae818d173",
"score": "0.7298054",
"text": "def teardown; end",
"title": ""
},
{
"docid": "6d970e9600a4fab34262b7eae818d173",
"score": "0.7298054",
"text": "def teardown; end",
"title": ""
},
{
"docid": "6d970e9600a4fab34262b7eae818d173",
"score": "0.7298054",
"text": "def teardown; end",
"title": ""
},
{
"docid": "8edce7a0a0533f8f458105bf2def9c49",
"score": "0.72951984",
"text": "def teardown()\n #\n end",
"title": ""
},
{
"docid": "0ee961bbf71f2965a41dcb1f42f875f3",
"score": "0.7292445",
"text": "def teardown\n Capybara.use_default_driver\n DatabaseCleaner.clean\n end",
"title": ""
},
{
"docid": "745a1ed58757919a68f05414da5ac830",
"score": "0.7288821",
"text": "def teardown\n #do nothing\n end",
"title": ""
},
{
"docid": "274e2355b5cabe047d8440628a30db1c",
"score": "0.7288531",
"text": "def teardown\n\n # Do nothing\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "622d738e10df79079cd0b25186211767",
"score": "0.72863096",
"text": "def teardown\n end",
"title": ""
},
{
"docid": "4d80142ba84b9cf0aaba083ed8ad9f8b",
"score": "0.72849786",
"text": "def teardown\n @table.reset!\n end",
"title": ""
},
{
"docid": "723c619f7d80f8d2feae1dbe1f1b1edb",
"score": "0.7268706",
"text": "def teardown\n puts \"tear down\"\n end",
"title": ""
}
] |
0ece556d218c54e00f07e6388de286e6
|
GET /challenges/1 GET /challenges/1.json
|
[
{
"docid": "30efa002e3c549d23893f7ad2a6ec567",
"score": "0.0",
"text": "def show \n @challenge = Challenge.find(params[:id])\n @givenproblem = ProblemSet.all\n max = @givenproblem.map(&:id).max\n @curOut = ''\n if max != nil\n @givenproblem = ProblemSet.find(rand(1..max))\n else\n end\n session[:usercode] = \"\"\n session[:userinputcode] = \"\"\n session[:usertimeonpage] = Time.now.strftime(\"%H:%M:%S\")\n session[:usersubmittime] = \"\"\n session[:testing] = \"\"\n end",
"title": ""
}
] |
[
{
"docid": "e8d3085dddd59cd3bb09607e458da1be",
"score": "0.81531554",
"text": "def show\n @challenges = Challenge.find(params[:id])\n render json: @challenges\n end",
"title": ""
},
{
"docid": "0b7811905fcf3f2f7c648833ea4c2454",
"score": "0.7658178",
"text": "def index\n @challenges = Challenge.all\n render json: @challenges\n end",
"title": ""
},
{
"docid": "acef93cbb9938ad790e689ce63e8cd11",
"score": "0.76330775",
"text": "def index\n\n @challenges = Challenge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "9b83fd2d0a2d7ba1c4d7aa136da61b4e",
"score": "0.7624374",
"text": "def index\n @challenges = Challenge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "9b83fd2d0a2d7ba1c4d7aa136da61b4e",
"score": "0.7624374",
"text": "def index\n @challenges = Challenge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "e5a7e24f488e5336a13b9cc046f4792f",
"score": "0.76183516",
"text": "def index\n @challenges = Challenge.where(:challenge_id => nil)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "93983ac5b31a2502c936a704aac27425",
"score": "0.74781275",
"text": "def index\n # response = HTTParty.get(\"http://localhost:3000/api/challenges?api_token=#{current_user.api_token}\")\n # @newchallenges = JSON.parse(response.body)\n @challenges = Challenge.paginate(page: params[:page], per_page: 5).order(\"#{sort_column} #{sort_direction}\")\n @challenge = current_user.challenges.build\n end",
"title": ""
},
{
"docid": "25b6f29cbd67799f8484a16f7447d35b",
"score": "0.7420142",
"text": "def show\n @user = User.find(params[:id])\n @challenges = @user.challenges\n end",
"title": ""
},
{
"docid": "03caf8f5dc17eb9067b574c51f7354ed",
"score": "0.74053377",
"text": "def index\n @project = Project.find(params[:project_id])\n @challenges = @project.challenges\n end",
"title": ""
},
{
"docid": "48261310bc0294c95d1f9bc8a56f7c0a",
"score": "0.7369272",
"text": "def index\n @challenges = Challenge.open\n end",
"title": ""
},
{
"docid": "458f86d2224bb103851526260cf8a1b0",
"score": "0.73635364",
"text": "def index\n @challenges = current_user.challenges\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "89b49b9677ce1e30e85e8b1c8e5ef0fc",
"score": "0.73618",
"text": "def index\n @challenges = Challenge.all\n end",
"title": ""
},
{
"docid": "70cdf7772f8eadae6e4321943c8eede8",
"score": "0.73382705",
"text": "def index\n @user_challenges = UserChallenge.all\n render json: @user_challenges\n end",
"title": ""
},
{
"docid": "0ee76f1136428300a45f6ba708fec054",
"score": "0.7273693",
"text": "def index\n @challenges = @chapter.challenges\n end",
"title": ""
},
{
"docid": "2fd2af02627750c21292db5a4fb350a3",
"score": "0.72373706",
"text": "def index\n\t\t@challenges = current_user.challenges\n\tend",
"title": ""
},
{
"docid": "79297a517c8627eef53eb28a5169b568",
"score": "0.72321165",
"text": "def show\n @challenge = Challenge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "79297a517c8627eef53eb28a5169b568",
"score": "0.72321165",
"text": "def show\n @challenge = Challenge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "79297a517c8627eef53eb28a5169b568",
"score": "0.72321165",
"text": "def show\n @challenge = Challenge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "79297a517c8627eef53eb28a5169b568",
"score": "0.72321165",
"text": "def show\n @challenge = Challenge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "79297a517c8627eef53eb28a5169b568",
"score": "0.72321165",
"text": "def show\n @challenge = Challenge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "795f2556da90db9811123f754420ae76",
"score": "0.71778256",
"text": "def show\n @challenge = Challenge.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @challenge }\n end\n end",
"title": ""
},
{
"docid": "ed80f77896dbadeb732d51e9e93a079b",
"score": "0.70728904",
"text": "def get_current_challenges\n current_challenges_uri = \"game/challenges/#{@token}\"\n self.class.get(@api_url + current_challenges_uri) \n end",
"title": ""
},
{
"docid": "fbe932c7a754fc9ed7334c78cf27b281",
"score": "0.6989629",
"text": "def index\n @code_challenges = CodeChallenge.all\n end",
"title": ""
},
{
"docid": "00c64dd9167899997967568c9a7c8c25",
"score": "0.69189215",
"text": "def index\n @compchallenges = Compchallenge.all\n end",
"title": ""
},
{
"docid": "d95c014a6f2e3fbfd5a9562918fffc05",
"score": "0.68982154",
"text": "def show\n @challenges = Challenge.where(user_ids: params[:id])\n @challenges = policy_scope(@challenge)\n \n render json: @challenge\n end",
"title": ""
},
{
"docid": "43eaae22ae86e91d851f7411d276151a",
"score": "0.6891464",
"text": "def index\n @challenges = Challenge.all.page params[:page]\n end",
"title": ""
},
{
"docid": "f0cdf3c1074c4902fbfd2d00099bc5eb",
"score": "0.6844114",
"text": "def show\n @challenge = Challenge.find(params[:id])\n @new_challenge = Challenge.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "3ae83b00a90037b2ea7c144f37f448ab",
"score": "0.68426186",
"text": "def index\n if current_user.nil?\n redirect_to :back, :notice => \"You must be logged in to continue\"\n elsif !current_user.admin?\n redirect_to :back, :notice => \"You are not authorized to view this page\"\n else\n @challenges = Challenge.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end\n end",
"title": ""
},
{
"docid": "5889cca5eaa38c9833ef2465eb2b45e5",
"score": "0.68329334",
"text": "def index\n @challenges = Challenge.all\n # respond_to do |format|\n # format.html\n # format.json { render json: ChallengeDatatable.new(view_context) }\n # end\n end",
"title": ""
},
{
"docid": "d8d282bfd23a180cceafb68962d1643c",
"score": "0.67407465",
"text": "def new\n @challenge = Challenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "d8d282bfd23a180cceafb68962d1643c",
"score": "0.67407465",
"text": "def new\n @challenge = Challenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "d8d282bfd23a180cceafb68962d1643c",
"score": "0.67407465",
"text": "def new\n @challenge = Challenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "d8d282bfd23a180cceafb68962d1643c",
"score": "0.67407465",
"text": "def new\n @challenge = Challenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "d8d282bfd23a180cceafb68962d1643c",
"score": "0.67407465",
"text": "def new\n @challenge = Challenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "d8d282bfd23a180cceafb68962d1643c",
"score": "0.67407465",
"text": "def new\n @challenge = Challenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "d8d282bfd23a180cceafb68962d1643c",
"score": "0.67407465",
"text": "def new\n @challenge = Challenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "d580596ca8867c9f48b25a5778b1b094",
"score": "0.6710937",
"text": "def show\n challenge_id = params[:challenge_id]\n @challenge = Challenge.find(challenge_id)\n end",
"title": ""
},
{
"docid": "7d1f3c31a23a33f993710728353f0894",
"score": "0.6688533",
"text": "def index\n @challenges = Challenge\n @challenges = @challenges.running if params[:running]\n @challenges = @challenges.expired if params[:expired]\n @challenges = @challenges.high_points if params[:high_points]\n @challenges = @challenges.page(params[:page])\n end",
"title": ""
},
{
"docid": "822e28ae1843d547558247995fd7b070",
"score": "0.6681194",
"text": "def index\n @challenges = @user.challenges.includes(:organization).paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "02b400e90b1e416d812279baefb252ad",
"score": "0.6678884",
"text": "def show\n @challenge = Challenge.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n end",
"title": ""
},
{
"docid": "18648087edfd33d3e0f23eaa299920e7",
"score": "0.6592884",
"text": "def index\n @pub_challenges = PubChallenge.where(:pub_id => params[:pub_id])\n # @pub_challenges = @current_pub.pub_challenges\n respond_to do |format|\n format.html {}\n format.json { render :json => @pub_challenges, :include => :tasks }\n end\n end",
"title": ""
},
{
"docid": "bf2881a72d065f140fc36a4b4223fe0c",
"score": "0.65856254",
"text": "def index\n @innovators_challenges = InnovatorsChallenge.all\n end",
"title": ""
},
{
"docid": "2a9cbf6b70e2b1d9cf65f3258e1a0e4d",
"score": "0.65819037",
"text": "def index\n @challenges = @promotion.challenges.all\n end",
"title": ""
},
{
"docid": "190f830bc2a1f1beaa93a8db6a14b814",
"score": "0.65698576",
"text": "def suggestions\n @challenges = Challenge.where(\"status = #{Challenge::STATUSES[:suggested]} or status = #{Challenge::STATUSES[:approved]}\")\n\n respond_to do |format|\n format.html\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "3fcb7abec7d2ef1ff8e3aa14c766eae3",
"score": "0.65540254",
"text": "def index\n if logged_in?\n @challenges = current_user.challenges.all\n else\n @challenges = Challenge.unassigned.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @challenges }\n end\n end",
"title": ""
},
{
"docid": "d0714059f4f8fcba2ec1d3419ad067c1",
"score": "0.65524906",
"text": "def index\n @challenges = Challenge.order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "d087b10dff86bb40d6a01caa282f9d82",
"score": "0.6522115",
"text": "def host\n @challenges = Challenge.where(user: current_user).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "8596819a60fdbbbeecdcb2e3f091d18c",
"score": "0.65128505",
"text": "def challenges\n expose Member.challenges(@oauth_token, params[:membername])\n end",
"title": ""
},
{
"docid": "4625e5852a91e5feccc1f408de823e62",
"score": "0.6501872",
"text": "def show\n @challenge = Challenge.find(params[:id])\n @resources = @challenge.resources\n end",
"title": ""
},
{
"docid": "cc8cde73720df994a3dcd9802aeee223",
"score": "0.64896756",
"text": "def index\n page = params[:page] || 1\n per_page = params[:per_page] || 20\n if current_user.is_admin?\n @challenges = Challenge.get_all_challenges(page, per_page)\n elsif current_user.is_creator && !params[:creator]\n @challenges = Challenge.get_list_of_challenge(current_user.id, page, per_page)\n else\n @challenges = Challenge.get_list_of_attend_challenge(current_user, page, per_page)\n end\n end",
"title": ""
},
{
"docid": "264945f3b04e2037075009206618a723",
"score": "0.6472556",
"text": "def get_challenges(opts = {})\n data, _status_code, _headers = get_challenges_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "81638640794886d0631c5604dc6b43a1",
"score": "0.64701897",
"text": "def index\n @challenges = Challenge.order(:created_at)\n end",
"title": ""
},
{
"docid": "e8882a52a227c073d1f499b01dc8f413",
"score": "0.6467835",
"text": "def get_current_challenges(gamertag = nil)\n if gamertag\n gamertag = gamertag.gsub(' ', '%20')\n uri = ENDPOINT + \"game/challenges/#{key}/#{gamertag}\"\n else\n uri = ENDPOINT + \"game/challenges/#{key}\"\n end\n data = JSON.parse(self.class.get(uri).body, :symbolize_names => true)\n Reach::Helper::convert_keys(data)\n end",
"title": ""
},
{
"docid": "11b64ab6d6b91ccd13e8075d2bca6083",
"score": "0.6439277",
"text": "def get_challenges_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CampaignsChallengesApi.get_challenges ...\"\n end\n # resource path\n local_var_path = \"/challenges\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_active_campaign'] = opts[:'filter_active_campaign'] if !opts[:'filter_active_campaign'].nil?\n query_params[:'filter_start_date'] = opts[:'filter_start_date'] if !opts[:'filter_start_date'].nil?\n query_params[:'filter_end_date'] = opts[:'filter_end_date'] if !opts[:'filter_end_date'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 => 'PageResourceChallengeResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CampaignsChallengesApi#get_challenges\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "fd2eb41f0a9ec847be0778ecbc133efb",
"score": "0.6433322",
"text": "def show\n @challenge_activity = ChallengeActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge_activity }\n end\n end",
"title": ""
},
{
"docid": "01840dd121e9f57f5a3459e6623bb108",
"score": "0.6398548",
"text": "def show\n @skill_challenge = SkillChallenge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill_challenge }\n end\n end",
"title": ""
},
{
"docid": "59e12ed188a7e16a8196c4a4a98bc407",
"score": "0.6376008",
"text": "def show\n s = Summoner.find_by(name: params[:id])\n if !s.nil?\n all_chal = s.created_challenges\n inprogress_chal = all_chal.where(attempted: false)\n riot_api = RiotApiMatch.new\n inprogress_chal.each do |ic|\n match_details = riot_api.get_match_details(ic['platform_id'], ic['game_id'])\n if (match_details['status'].nil?)\n match_timeline = riot_api.get_match_timeline(ic['platform_id'], ic['game_id'])\n ic.attempted = true\n ic.match_json = match_details\n ic.timeline_json = match_timeline\n ic = parse_challenges(ic)\n ic.save\n end\n end\n\n all_chal = s.created_challenges.order(created_at: :desc)\n\n render json: all_chal, include: %i[summoner challenge champion item]\n else\n render status: 400\n end\n end",
"title": ""
},
{
"docid": "d32c041b112c629648b91c31dc209906",
"score": "0.6360057",
"text": "def show\n @challenge_type = ChallengeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @challenge_type }\n end\n end",
"title": ""
},
{
"docid": "762a596f570b2958daf0f1057ca6c538",
"score": "0.6350532",
"text": "def new\n if logged_in?\n @challenge = current_user.challenges.new\n else\n @challenge = Challenge.unassigned.new\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @challenge }\n end\n end",
"title": ""
},
{
"docid": "c891896bdd4ec66a62ab051509995130",
"score": "0.6338532",
"text": "def index\n @skills_challenges = SkillsChallenge.all\n end",
"title": ""
},
{
"docid": "6622d09b9d76069bc314eef04ce1bb86",
"score": "0.631624",
"text": "def create\n \n @challenge = @chapter.challenges.new(challenge_params)\n\n respond_to do |format|\n if @challenge.save\n format.html { redirect_to :back, notice: 'Challenge was successfully created.' }\n format.json { render :show, status: :created, location: @challenge }\n else\n format.html { render :new }\n format.json { render json: @challenge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb9e7319069872816eee55bfaaf5e331",
"score": "0.63056755",
"text": "def create\n # @challenge = Challenge.new(challenge_params)\n @challenge = current_user.challenges.build(challenge_params)\n\n respond_to do |format|\n if @challenge.save\n format.html { redirect_to root_path, notice: 'Challenge was successfully created.' }\n format.json { render :show, status: :created, location: @challenge }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @challenge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4334ee41e2170a8cefb5d5573ec62a2",
"score": "0.6260703",
"text": "def show\n @challenge_score = ChallengeScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge_score }\n end\n end",
"title": ""
},
{
"docid": "a803e42858ce8a46173f18126b95eb6e",
"score": "0.62539417",
"text": "def new\n @challenge_score = ChallengeScore.new\n @teams = Team.all\n @challenges = Challenge.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge_score }\n end\n end",
"title": ""
},
{
"docid": "e400c0bd6c2a1a2b54b7d2d93547765d",
"score": "0.6244145",
"text": "def show\n @challenge_message = ChallengeMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @challenge_message }\n end\n end",
"title": ""
},
{
"docid": "ca2036fdcb1cfb9b995dbf97426407a1",
"score": "0.6222077",
"text": "def index\n @challenges = apply_scopes(Challenge).all.order( date: :desc)\n authorize @challenges\n @current_scopes = current_scopes\n end",
"title": ""
},
{
"docid": "cf33f377d3dfe2e2099a9e00cd823a4d",
"score": "0.6218944",
"text": "def upcoming_challenge\n page = params[:page] || 1\n per_page = params[:per_page] || 20\n @challenges = Challenge.get_all_upcoming_challenge(current_user, page, per_page)\n end",
"title": ""
},
{
"docid": "b15ce65810b6074f2cc58e45e60ca386",
"score": "0.619643",
"text": "def index\n\t\t@my_supporting_challenges = @user.challenges\n\t\t@my_joined_challenges = JoinedChallenge.where(\"user_id = ?\", @user.id)\n\t\t@my_unjoined_challenges = JoinedChallenge.where(\"user_id != ?\", @user.id)\n\tend",
"title": ""
},
{
"docid": "a36c5a042cf38d4763325c73c8d3f0b2",
"score": "0.6191786",
"text": "def index\n @guesses = @challenge.guesses\n end",
"title": ""
},
{
"docid": "de9237f58abaa7326ac1e8f306904b23",
"score": "0.6188449",
"text": "def create\n @project = Project.find(params[:project_id])\n @challenge = @project.challenges.build(challenge_params)\n\n respond_to do |format|\n if @challenge.save\n format.html { redirect_to project_challenges_path(@project.id), notice: 'Challenge was successfully created.' }\n format.json { render :show, status: :created, location: @challenge }\n else\n format.html { render :new }\n format.json { render json: @challenge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8969d5f09791ef3b6039ca9ab84bc66b",
"score": "0.61784786",
"text": "def create\n @challenge = Challenge.new(challenge_params)\n \n respond_to do |format|\n if @challenge.save\n flash[:notice] = \"Challenge was successfully created!!\"\n format.html { redirect_to controller: 'challenges', action: 'index'}\n format.json { render :show, status: :created, location: @challenge }\n else\n flash[:alert] = \"Can't create empty challenge\"\n format.html { redirect_to controller: 'challenges', action: 'index' }\n format.json { render json: @challenge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "693538869088685fc50654e2a79ea647",
"score": "0.6175208",
"text": "def set_challenge\n @challenge = Challenge.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n head :not_found\n end",
"title": ""
},
{
"docid": "c6c648f9835b5fe6017c895f265835b3",
"score": "0.61658096",
"text": "def set_challenge\n @challenge = Challenge.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6c648f9835b5fe6017c895f265835b3",
"score": "0.61658096",
"text": "def set_challenge\n @challenge = Challenge.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6c648f9835b5fe6017c895f265835b3",
"score": "0.61658096",
"text": "def set_challenge\n @challenge = Challenge.find(params[:id])\n end",
"title": ""
},
{
"docid": "c6c648f9835b5fe6017c895f265835b3",
"score": "0.61658096",
"text": "def set_challenge\n @challenge = Challenge.find(params[:id])\n end",
"title": ""
},
{
"docid": "0f63ce6c0aa9574d33d2bd33e50b9523",
"score": "0.61638486",
"text": "def create\n # @challenge = Challenge.new(challenge_params)\n @challenges = Challenge.all\n\n @challenge = current_user.challenges.build(challenge_params)\n respond_to do |format|\n if @challenge.save\n format.html { redirect_to @challenge, notice: \"Challenge was successfully created.\" }\n format.json { render :show, status: :created, location: @challenge }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @challenge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d2b69a6e0754f1c212d3430e57c6a80",
"score": "0.61444664",
"text": "def show\n render json: @user_challenge\n end",
"title": ""
},
{
"docid": "fc97f363249950cebe1f3da14ceb85a9",
"score": "0.61355984",
"text": "def index\n render plain: params[\"hub.challenge\".to_sym]\n end",
"title": ""
},
{
"docid": "a382cfa3dacbd0337bc7fb0b600ed57b",
"score": "0.61140615",
"text": "def show\n if Course.exists?(params[:id])\n @course = Course.find(params[:id])\n @challenges = @course.challenges\n else\n flash[:notice]=\"That doesn't exist, doofus. This should also never be seen.\"\n redirect_to courses_path\n end\n end",
"title": ""
},
{
"docid": "1b9e7847a31fdd6e33d8795c3545af9b",
"score": "0.6103351",
"text": "def index\n delete_new_challenge_refferer\n my_store_location\n @challenges_all = current_user.challenges\n @q = current_user.challenges.search(params[:q])\n @challenges = @q.result.paginate(:page => params[:page], :per_page => 14)\n end",
"title": ""
},
{
"docid": "42549653cfd952e9e271a245526c9d5e",
"score": "0.60936946",
"text": "def setChallenge\n @challenge = Challenge.find(params[:id])\n end",
"title": ""
},
{
"docid": "db7aced20cbb978cd6eeef2b2865a137",
"score": "0.6093294",
"text": "def index\n challenge = Challenge.find(params[:challenge_id])\n @comments = Comment.all\n end",
"title": ""
},
{
"docid": "82e3c37935f5fab5c73bef798c0b9445",
"score": "0.60901207",
"text": "def show\n @challenge = Challenge.find(params[:id])\n \n unless @challenge == current_open_challenge\n @challenge.votes = @challenge.entries.collect(&:votes).flatten\n @challenge.voted_percentage = ((@challenge.votes.select { |v| v.user_id == current_user.id }.flatten.count.to_f / @challenge.entries.count.to_f) * 100).to_i\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @challenge }\n end\n else\n redirect_to submit_path\n end\n end",
"title": ""
},
{
"docid": "77fdabf9ca6abd06609b6eb3c23bb730",
"score": "0.6086518",
"text": "def index\n @challenges = policy_scope( apply_scopes(Challenge).all ).order( date: :desc)\n authorize @challenges\n @current_scopes = current_scopes\n end",
"title": ""
},
{
"docid": "52cef9b264496d88462edfd9de4e6f53",
"score": "0.60849994",
"text": "def index\n @challenges = Challenge.all\n\n @result = []\n @challenges.each do |challenge|\n @obj = {\n id: challenge.id,\n name: challenge.name,\n body: challenge.body,\n point: challenge.point,\n image: challenge.image.attached? ? url_for(challenge.image) : nil,\n user_id: challenge.user_id,\n active: challenge.active,\n created_at: challenge.created_at,\n updated_at: challenge.updated_at\n }\n @result << @obj\n end\n render json: @result\n end",
"title": ""
},
{
"docid": "35e614411c4547f451ee619cc37ea0c1",
"score": "0.60787857",
"text": "def index\n @challenges = Challenge.all\n @challenge_categories = @challenges.group_by { |c| c.category }\n\n @challenge_ids_solved_by_team = []\n solutions_by_team = Solution.select(:challenge_id).where(team_id: current_team.id)\n solutions_by_team.each do |solution|\n @challenge_ids_solved_by_team << solution.challenge_id\n end\n end",
"title": ""
},
{
"docid": "19a23dafc79bb8d2491c9e465d3d588b",
"score": "0.60749793",
"text": "def index\n @challenge_activities = ChallengeActivity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenge_activities }\n end\n end",
"title": ""
},
{
"docid": "32072cdce94a641f930e84529b659378",
"score": "0.6074432",
"text": "def past_challenges\n # NOTE: per_page is forced to 1\n @member = Members.find(params[:id])\n @challenges = Members.challenges(:name => @member[\"Name\"]).select{|c| c[\"End_Date__c\"].to_date < Time.now.to_date}\n @challenges = @challenges.paginate(:page => params[:page] || 1, :per_page => 1) \n render 'challenges'\n end",
"title": ""
},
{
"docid": "296c7e7ec8e21130ad7d392865c7dc84",
"score": "0.6071896",
"text": "def index\n @challenge = Challenge.find(params[:id])\n @challenge_activities = ChallengeActivity.where(challenge: @challenge)\n end",
"title": ""
},
{
"docid": "f30e5adf1b1f5fb97438229093abd3b6",
"score": "0.60673165",
"text": "def create\n @challenge = Challenge.new(challenge_params)\n if @challenge.save\n render json: @challenge\n else\n render json: { error: \"Application error\", status: 400 }, status: 400\n end\n end",
"title": ""
},
{
"docid": "29e1e13504c292262bee6a344f4a0b05",
"score": "0.6067135",
"text": "def new\n if current_user.admin\n @course = Course.find(params[:course_id])\n @challenge = @course.challenges.build\n else\n redirect_to current_user\n end\n end",
"title": ""
},
{
"docid": "9afca6e5866341b868965c5f66561952",
"score": "0.6062622",
"text": "def index\n @contests = Contest.all\n render json: @contests\n end",
"title": ""
},
{
"docid": "bfd60c189a4dae70b873909fa3a7a3bd",
"score": "0.6049833",
"text": "def create\n\t\t#raise challenge_params\n\t\t#@challenge = Challenge.new(challenge_params)\n\t\t@challenge = @user.challenges.build(challenge_params)\n\n\t\trespond_to do |format|\n\t\t\tif @challenge.save\n\t\t\t\t#raise params\n\t\t\t\t#format.html { redirect_to user_url(User.find(params[\"user_id\"])), notice: 'Challenge was successfully created.' }\n\t\t\t\t#format.html { redirect_to user_url(set_user), notice: 'Challenge was successfully created.' }\n\t\t\t\tformat.html { redirect_to user_challenges_url(set_user), notice: 'Challenge was successfully created.' }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @challenge }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'new' }\n\t\t\t\tformat.json { render json: @challenge.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
}
] |
6f6bc9c160ba0d1b421c5fd958a88e98
|
Normalizes HTML by cleaning out common mistakes.
|
[
{
"docid": "eb650b454f946aae99d089378d133063",
"score": "0.6821724",
"text": "def normalize(node)\n return normalize_str(node) if node.is_a?(String)\n\n html = node.dup\n\n remove_trackers! html\n remove_blacklisted_images! html\n remove_style_attrs! html\n wrap_stray_text! html\n move_stray_images! html\n\n blocks(html).each do |blk|\n if block?(blk)\n add_class blk, 'short' if blk.content.size < 50\n add_class blk, 'image' if image_paragraph?(blk)\n handle_duplicate_brs! blk\n fix_pseudo_headings! blk\n end\n end\n\n blocks(html).each do |blk|\n blk.remove if blank?(blk) # Not recursive\n end\n\n html\n end",
"title": ""
}
] |
[
{
"docid": "3aae2115c2fa54ff7dce5de32449e7f1",
"score": "0.7385848",
"text": "def normalise(html)\n doc = Nokogiri::HTML(html)\n body = doc.xpath('//body')\n\n body.xpath('//script').each {|s| s.remove}\n body.xpath('//comment()').each {|c| c.remove}\n body.xpath('//text()').find_all {|t| t.to_s.strip == ''}.map(&:remove)\n body.xpath('//header').remove\n body.xpath('//footer').remove\n body.xpath('//div[@id = \"global-cookie-message\"]').remove\n body.xpath('//div[@id = \"global-header-bar\"]').remove\n body.xpath('//div[@class = \"phase-banner-alpha\"]').remove\n body.xpath('//@class').remove\n body.xpath('//@id').remove\n body.xpath('//a').xpath('//@href').remove\n body.xpath('//label').xpath('//@for').remove\n body.xpath('//input').xpath('//@name').remove\n body.xpath('//input').xpath('//@value').remove\n\n remove_attributes(body, 'data')\n remove_attributes(body, 'aria')\n\n body.to_s\n .gsub(/>\\s+/, '>')\n .gsub(/\\s+</, '<')\n .gsub('><', \">\\n<\")\n end",
"title": ""
},
{
"docid": "c8389fd75caf770476947cd706357db4",
"score": "0.73537445",
"text": "def sanitize(html)\n doc = Nokogiri::HTML::DocumentFragment.parse(html)\n if Mako.config.sanitize_images\n doc.css('img').each do |n|\n begin\n n.name = 'a'\n n.content = n['alt'] ? \"📷 #{n['alt']}\" : '📷 Image'\n n['href'] = URI.parse(n['src']).absolutize!(uri)\n rescue URI::InvalidURIError\n # if there's a problem, just ignore it\n next\n end\n end\n end\n doc.css('h1,h2,h3,h4,h5,h6').each { |n| n.name = 'p'; n.set_attribute('class', 'bold') }\n doc.to_s\n end",
"title": ""
},
{
"docid": "ea582ca0c963b92b15393174bcf77a2b",
"score": "0.7304618",
"text": "def pre_sanitize(html)\n html = Nokogiri::HTML.fragment(html)\n HTML_TRANSFORMS.each do |orig, new|\n html.xpath(\".//#{orig}\").each { |node| node.name = new }\n end\n html.to_html\n end",
"title": ""
},
{
"docid": "222a501dbce2fff9e2cde9e864585373",
"score": "0.7279479",
"text": "def clean_html(html)\n Sanitize.clean(html) rescue html\n end",
"title": ""
},
{
"docid": "87e0a845e54317c6afffc61321d665d2",
"score": "0.7252359",
"text": "def normalise_html(html)\n Nokogiri::HTML5.fragment(html).to_s.gsub(\"\\n\", \"\")\n end",
"title": ""
},
{
"docid": "e32d60b517f075ee34ad982d84f70818",
"score": "0.71980166",
"text": "def clean_up_contents()\n # very minimal\n # elements = ['p', 'b', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], attributes={})\n\n if self.contents?\n html = self.contents\n email_regex = /<p>Email:\\s+((\\w|\\-|\\_|\\.)+\\@((\\w|\\-|\\_)+\\.)+[a-zA-Z]{2,})/i\n\n html.gsub! /\\[endif\\]--/ , ''\n html.gsub! /[\\n|\\r]/ , ' '\n html.gsub! / / , ' '\n\n # this will convert UNICODE into ASCII. \n #It will also strip any possiblity of using a foreign language!\n #converter = Iconv.new('ASCII//IGNORE//TRANSLIT', 'UTF-8') \n #html = converter.iconv(html).unpack('U*').select{ |cp| cp < 127 }.pack('U*')\n # keep only the things we want.\n unless (Sanitize::Config::RELAXED[:attributes][\"table\"].include?(\"align\"))\n Sanitize::Config::RELAXED[:attributes][\"table\"] << \"align\"\n end\n\n config = Sanitize::Config::RELAXED\n if (html.encoding.name == 'ASCII-8BIT')\n config[:output_encoding] = 'ASCII'\n end\n html = Sanitize.clean( html, config)\n\n # butt up any tags\n html.gsub! />\\s+</ , '><'\n\n #remove email address lines\n html.gsub! email_regex , '<p>'\n\n # post sanitize cleanup of empty blocks\n # the order of removal is import - this is the way word stacks these elements\n html.gsub! /<i><\\/i>/ , ''\n html.gsub! /<b><\\/b>/ , ''\n html.gsub! /<\\/b><b>/ , ''\n html.gsub! /<p><\\/p>/ , ''\n html.gsub! /<p><b><\\/b><\\/p>/ , ''\n\n # misc - fix butted times\n html.gsub! /(\\d)am / , '\\1 am '\n html.gsub! /(\\d)pm / , '\\1 pm '\n # misc - remove multiple space that may cause doc specific regexs to fail (in dates for example)\n html.gsub! /\\s+/ , ' '\n\n # add new lines at the end of lines\n html.gsub! /<\\/(p|h\\d|dt|dd|dl)>/, '</\\1>' + \"\\n\"\n html.gsub! /<dl>/ , '<dl>' + \"\\n\"\n\n self.contents = html\n end\n end",
"title": ""
},
{
"docid": "9f04ecc25cbc4d2123dbeed4d2dad8e6",
"score": "0.7127345",
"text": "def sanitize(html, options = {})\n msclean(html, options)\n end",
"title": ""
},
{
"docid": "a3bbb52b1df60bfbc03872e1fc72f5e1",
"score": "0.7096406",
"text": "def sanitize_as_html!\n Engine.clean!(self)\n end",
"title": ""
},
{
"docid": "a3bbb52b1df60bfbc03872e1fc72f5e1",
"score": "0.7096406",
"text": "def sanitize_as_html!\n Engine.clean!(self)\n end",
"title": ""
},
{
"docid": "75c9d394c875f8734068f0767b570066",
"score": "0.70891297",
"text": "def sanitize_text(text)\n doc = Nokogiri::HTML.fragment(text)\n UNSUPPORTED_HTML_TAGS.each do |tag|\n doc.search(tag).each(&:remove)\n end\n doc.inner_html\n end",
"title": ""
},
{
"docid": "09cbea4ce64a6c4600149bc3c22f6e0e",
"score": "0.7082276",
"text": "def sanitize!(html, options = {})\n msclean!(html, options)\n end",
"title": ""
},
{
"docid": "bd86ea8ee86118db3714742085a7b4b0",
"score": "0.7073427",
"text": "def clean(html)\n return unless html\n\n # Make a whitelist of acceptable elements and attributes.\n sanitize_options = {\n elements: %w{div span p a ul ol li h1 h2 h3 h4\n pre em sup table tbody thead tr td img code strong\n blockquote small br section aside},\n remove_contents: %w{script},\n attributes: {\n 'div' => %w{id class data-tralics-id data-number data-chapter},\n 'a' => %w{id class href target rel},\n 'span' => %w{id class style},\n 'ol' => %w{id class},\n 'ul' => %w{id class},\n 'li' => %w{id class},\n 'sup' => %w{id class},\n 'h1' => %w{id class},\n 'h2' => %w{id class},\n 'h3' => %w{id class},\n 'h4' => %w{id class},\n 'img' => %w{id class src alt},\n 'em' => %w{id class},\n 'code' => %w{id class},\n 'section' => %w{id class},\n 'aside' => %w{id class},\n 'blockquote' => %w{id class},\n 'br' => %w{id class},\n 'strong' => %w{id class},\n 'table' => %w{id class},\n 'tbody' => %w{id class},\n 'tr' => %w{id class},\n 'td' => %w{id class colspan}\n },\n css: {\n properties: %w{color height width}\n },\n protocols: {\n 'a' => {'href' => [:relative, 'http', 'https', 'mailto']},\n 'img' => {'src' => [:relative, 'http', 'https']}\n },\n output: :xhtml\n }\n\n Sanitize.clean(html.force_encoding(\"UTF-8\"), sanitize_options)\n end",
"title": ""
},
{
"docid": "0c0feac08e7f7653d11c43fce2bd90ea",
"score": "0.6968268",
"text": "def xhtml_sanitize(html)\n return html unless sanitizeable?(html)\n tokenizer = HTML::Tokenizer.new(html.to_utf8)\n results = []\n\n while token = tokenizer.next\n node = XHTML::Node.parse(nil, 0, 0, token, false)\n results << case node.tag?\n when true\n if ALLOWED_ELEMENTS.include?(node.name)\n process_attributes_for node\n node.to_s\n else\n node.to_s.gsub(/</, \"<\").gsub(/>/, \">\")\n end\n else\n node.to_s.unescapeHTML.escapeHTML\n end\n end\n\n results.join\n end",
"title": ""
},
{
"docid": "6a5b60f6eb9bf492a5f7d3c25b518503",
"score": "0.6944998",
"text": "def sanitize_html( html, okTags='' )\n\n return if html.blank?\n\n # no closing tag necessary for these\n soloTags = [\"br\",\"hr\"]\n\n # Build hash of allowed tags with allowed attributes\n tags = okTags.downcase().split(',').collect!{ |s| s.split(' ') }\n allowed = Hash.new\n tags.each do |s|\n key = s.shift\n allowed[key] = s\n end\n\n # Analyze all <> elements\n stack = Array.new\n result = html.gsub( /(<.*?>)/m ) do | element |\n if element =~ /\\A<\\/(\\w+)/ then\n # </tag>\n tag = $1.downcase\n if allowed.include?(tag) && stack.include?(tag) then\n # If allowed and on the stack\n # Then pop down the stack\n top = stack.pop\n out = \"</#{top}>\"\n until top == tag do\n top = stack.pop\n out << \"</#{top}>\"\n end\n out\n end\n\n elsif element =~ /\\A<(\\w+)\\s*\\/>/\n # <tag />\n tag = $1.downcase\n if allowed.include?(tag) then\n \"<#{tag} />\"\n end\n\n elsif element =~ /\\A<(\\w+)/ then\n # <tag ...>\n tag = $1.downcase\n if allowed.include?(tag) then\n if ! soloTags.include?(tag) then\n stack.push(tag)\n end\n if allowed[tag].length == 0 then\n # no allowed attributes\n \"<#{tag}>\"\n else\n # allowed attributes?\n out = \"<#{tag}\"\n while ( $' =~ /(\\w+)=(\"[^\"]+\")/ )\n attr = $1.downcase\n valu = $2\n if allowed[tag].include?(attr) then\n out << \" #{attr}=#{valu}\"\n end\n end\n out << \">\"\n end\n end\n end\n end\n\n # eat up unmatched leading >\n while result.sub!(/\\A([^<]*)>/m) { $1 } do end\n\n # eat up unmatched trailing <\n while result.sub!(/<([^>]*)\\Z/m) { $1 } do end\n\n # clean up the stack\n if stack.length > 0 then\n result << \"</#{stack.reverse.join('></')}>\"\n end\n\n result\n end",
"title": ""
},
{
"docid": "81f95393d6d4224b4cdfa8b403fe5201",
"score": "0.6941923",
"text": "def sanitize_html\n self.data = self.class.clean_html(self.data) unless self.data.nil?\n end",
"title": ""
},
{
"docid": "b7bdb1c0e5c1ee42a1d9381b3d07e5de",
"score": "0.6914603",
"text": "def htmlClean(html)\n html\nend",
"title": ""
},
{
"docid": "669643847fb85cfdea8a033218264493",
"score": "0.69002557",
"text": "def normalize!\n data = read\n html = Nokogiri::XML.parse(data)\n html.encoding = 'utf-8'\n\n # Process the @DOM\n standardize_dom(html)\n remove_scripts(html)\n change_hrefs(html)\n\n write(html.to_s)\n end",
"title": ""
},
{
"docid": "fc791d73f1dc8b6c3e2cdcafcb3e1940",
"score": "0.68607134",
"text": "def sanitize(html)\n HTML5::HTMLParser.\n parse_fragment(html, :tokenizer => HTML5::HTMLSanitizer, :encoding => 'utf-8').\n to_s\n end",
"title": ""
},
{
"docid": "fc791d73f1dc8b6c3e2cdcafcb3e1940",
"score": "0.68607134",
"text": "def sanitize(html)\n HTML5::HTMLParser.\n parse_fragment(html, :tokenizer => HTML5::HTMLSanitizer, :encoding => 'utf-8').\n to_s\n end",
"title": ""
},
{
"docid": "57a678ed3ae82099220e31e9fc8e5670",
"score": "0.68473643",
"text": "def sanitize!\n\t\t\t@doc.downcase!\n\t\t\t@doc.gsub!(/<style.*?\\/style>/m, '')\n\t\t\t@doc.gsub!(/<script.*?\\/script>/m, '')\n\t\t\t@doc.gsub!(/<.*?>/m, ' ')\n\t\t\t@doc.gsub!(/\\s+/, ' ')\n\t\tend",
"title": ""
},
{
"docid": "bc3a2d07d980a15ca2e0c7b1122d12f4",
"score": "0.6846617",
"text": "def normalize_text(content)\n replaced_content = content.gsub(/\\n|<br>| /) do |match|\n case match\n when \"\\n\", \" \"\n \"\"\n when \"<br>\"\n \"\\n\"\n end\n end.sub(/\\s*(---|‐‐‐|―――)\\s*\\z/, \"\")\n strip_html(replaced_content)\n end",
"title": ""
},
{
"docid": "a81014f0244f16a8a73af511cabff6ad",
"score": "0.68007755",
"text": "def clean_up_text\n text.gsub!(/<br/, \"\\n<br\")\n text.gsub!(/<p/, \"\\n<p\")\n text.gsub!(/<\\/?span(.*?)?>/, '')\n text.gsub!(/<\\/?div(.*?)?>/, '')\n end",
"title": ""
},
{
"docid": "673af7d841e4a55d94099d8c90302d30",
"score": "0.671828",
"text": "def clean_html\n cleaned = ConverterMachine.clean_html(self) # => {html: clean html, css: Nokogiri extracted <style>...</style>}\n self.update_attributes!(file_content_html: cleaned[:html], file_content_css: cleaned[:css])\n end",
"title": ""
},
{
"docid": "4c3979f99f0b891303a65c833c428cbf",
"score": "0.6701935",
"text": "def clean(html)\n dupe = html.dup\n clean!(dupe) || dupe\n end",
"title": ""
},
{
"docid": "f9a169adac759d375bb8d2356e1f47ec",
"score": "0.6650131",
"text": "def sanitize(text)\n return nil if text.nil? || text.empty?\n string = text.to_s # ensure we have a string\n\n doc = Nokogiri::HTML.parse(text)\n\n doc.xpath('//@style').remove\n doc.xpath('//@class').remove\n doc.xpath('//@id').remove\n doc.xpath('//@font-size').remove\n doc.xpath('//@color').remove\n doc.xpath('//@size').remove\n doc.xpath('//@face').remove\n doc.xpath('//@bgcolor').remove\n doc.xpath('//comment()').remove\n\n # remove \"bad\" elements\n doc.css('script, link, img, style').each { |node| node.remove }\n\n # convert all <div>s to <p>s\n doc.css('div').each do |div|\n node = doc.create_element 'p'\n node.inner_html = div.inner_html\n div.replace(node)\n end\n\n # remove <font> and <span> tags, but preserve their content\n doc.css('font, span').each do |node|\n node.swap(node.children)\n end\n\n # removing tags leaves dangling text nodes that should really be merged, so let's\n # re-build the document\n doc = Nokogiri::HTML.parse(doc.to_s)\n\n # wrap orphaned text nodes in <p> tags\n doc.css('html body').children.each do |orphan|\n if orphan.class == Nokogiri::XML::Text && !orphan.text.strip.gsub(Envelope::Message::ALL_SPACES, '').empty?\n node = doc.create_element 'p'\n node.inner_html = orphan.text\n orphan.replace(node)\n end\n end\n\n # remove all <p><br><p>\n doc.css('p br').each do |node|\n node.remove\n end\n\n # convert all new lines to br and trim content\n doc.css('p').each do |node|\n node.inner_html = node.inner_html.gsub(\"\\n\", '<br>').strip\n end\n\n # remove empty tags\n doc.css('html body > *').each do |node|\n unless %w(br p).include?(node.name)\n node.remove if node.inner_html.gsub(Envelope::Message::ALL_SPACES, '').empty?\n end\n end\n\n doc.css('html body > *').to_s.gsub(/[\\n\\t]+?/, '')\n end",
"title": ""
},
{
"docid": "45ec2df4bc226030cbee2c5c8073be9e",
"score": "0.6632289",
"text": "def sanitize_excerpt(html, okTags)\n # no closing tag necessary for these\n soloTags = [\"br\",\"hr\"]\n\n # Build hash of allowed tags with allowed attributes\n tags = okTags.downcase().split(',').collect!{ |s| s.split(' ') }\n allowed = Hash.new\n tags.each do |s|\n key = s.shift\n allowed[key] = s\n end\n\n # Analyze all <> elements\n stack = Array.new\n result = html.gsub( /(<.*?>)/m ) do | element |\n if element =~ /\\A<\\/(\\w+)/ then\n # </tag>\n tag = $1.downcase\n if allowed.include?(tag) && stack.include?(tag) then\n # If allowed and on the stack\n # Then pop down the stack\n top = stack.pop\n out = \"</#{top}>\"\n until top == tag do\n top = stack.pop\n out << \"</#{top}>\"\n end\n out\n end\n elsif element =~ /\\A<(\\w+)\\s*\\/>/\n # <tag />\n tag = $1.downcase\n if allowed.include?(tag) then\n \"<#{tag} />\"\n end\n elsif element =~ /\\A<(\\w+)/ then\n # <tag ...>\n tag = $1.downcase\n if allowed.include?(tag) then\n if ! soloTags.include?(tag) then\n stack.push(tag)\n end\n if allowed[tag].length == 0 then\n # no allowed attributes\n \"<#{tag}>\"\n else\n # allowed attributes?\n out = \"<#{tag}\"\n while ( $' =~ /(\\w+)=(\"[^\"]+\")/ )\n attr = $1.downcase\n valu = $2\n if allowed[tag].include?(attr) then\n out << \" #{attr}=#{valu}\"\n end\n end\n out << \">\"\n end\n end\n end\n end\n\n # eat up unmatched leading >\n while result.sub!(/\\A([^<]*)>/m) { $1 } do end\n\n # eat up unmatched trailing <\n while result.sub!(/<([^>]*)\\Z/m) { $1 } do end\n\n # clean up the stack\n if stack.length > 0 then\n result << \"</#{stack.reverse.join('></')}>\"\n end\n\n result\n end",
"title": ""
},
{
"docid": "68cf6820819b12376b3ec30f062aae64",
"score": "0.66012937",
"text": "def clean_html_string(string)\n string.\n inner_text.\n gsub(/\\s+/, \" \").\n strip\n end",
"title": ""
},
{
"docid": "f78b69421028a9c0c1d23ce981a02770",
"score": "0.6584193",
"text": "def sanitize_feed_content(html, sanitize_tables = false)\n options = sanitize_tables ? {} : { tags: %w[table thead tfoot tbody td tr th] }\n sanitized = html.strip do |html|\n html.gsub! /&(#\\d+);/ do |_s|\n \"&#{Regexp.last_match(1)};\"\n end\n end\n sanitized\n end",
"title": ""
},
{
"docid": "8bd47129cd29617f8e708d3d8f781095",
"score": "0.65423816",
"text": "def normalise_html(html)\n Nokogiri::HTML5.fragment(html).to_s\n end",
"title": ""
},
{
"docid": "0b920bf10090e91e517993b9e772c4f5",
"score": "0.6516908",
"text": "def strip_tags(html); end",
"title": ""
},
{
"docid": "0b920bf10090e91e517993b9e772c4f5",
"score": "0.6516908",
"text": "def strip_tags(html); end",
"title": ""
},
{
"docid": "0b920bf10090e91e517993b9e772c4f5",
"score": "0.6516908",
"text": "def strip_tags(html); end",
"title": ""
},
{
"docid": "16fee79c173085803dfbaecd95a1ce89",
"score": "0.6488443",
"text": "def clean_html(doc)\n\n # Remove font tags\n doc.xpath('//font').each do |node|\n node.children.each do |child|\n child.parent = node.parent\n end\n node.remove\n end\n\n # Remove path to links:\n doc.xpath('//a').each do |node|\n href = node.attr(\"href\")\n href =~ /([^\\/]*)$/\n node.set_attribute(\"href\", $1)\n end\n\n # Remove <br> tags within li elements\n doc.xpath('//li').each do |li|\n li.xpath('//br').each do |br|\n br.remove\n end\n end\n\n # Remove <p> tags within li elements\n doc.xpath('//li').each do |li|\n li.xpath('//p').each do |p|\n p.children.each do |child|\n child.parent = p.parent\n end\n p.remove\n end\n end\n\n return doc\n end",
"title": ""
},
{
"docid": "5649368b0d42710e932a6ab9fee561ec",
"score": "0.6469025",
"text": "def strip_tags(html)\n Sanitize.clean(html.strip).strip\n end",
"title": ""
},
{
"docid": "5649368b0d42710e932a6ab9fee561ec",
"score": "0.6469025",
"text": "def strip_tags(html)\n Sanitize.clean(html.strip).strip\n end",
"title": ""
},
{
"docid": "09d80650377f3924eef1546e30f43df3",
"score": "0.64461005",
"text": "def clean!(html)\n @whitelist_nodes = []\n fragment = Nokogiri::HTML::DocumentFragment.parse(html)\n clean_node!(fragment)\n @whitelist_nodes = []\n\n output_method_params = {:encoding => 'utf-8', :indent => 0}\n\n if @config[:output] == :xhtml\n output_method = fragment.method(:to_xhtml)\n output_method_params[:save_with] = Nokogiri::XML::Node::SaveOptions::AS_XHTML\n elsif @config[:output] == :html\n output_method = fragment.method(:to_html)\n else\n raise Error, \"unsupported output format: #{@config[:output]}\"\n end\n\n result = output_method.call(output_method_params)\n\n # Ensure that the result is always a UTF-8 string in Ruby 1.9, no matter\n # what. Nokogiri seems to return empty strings as ASCII for some reason.\n result.force_encoding('utf-8') if RUBY_VERSION >= '1.9'\n\n return result == html ? nil : html[0, html.length] = result\n end",
"title": ""
},
{
"docid": "7f6b963234138e5db95b25db074734ca",
"score": "0.63542134",
"text": "def fck_cleanup\n # Change the following from their named entity to their decimal entity\n gsub!(\" \",\" \")\n gsub!(\"&\",\"&\")\n\n # Turn ' back into `'` because IE6 is a \"special\" browser\n gsub!(\"'\",\"'\")\n\n # get rid of line breaks that sneak into top of wysiwyg\n gsub!(/\\A<p> <\\/p>[\\s]*/,'')\n \n # get rid of fck's wrapping paragraphs around block elements\n while match = self.match(/^<p>[\\s]*<(div|table|ul|ol|dl|p|h1|h2|h3|h4|h5|h6)/)\n gsub!(/^<p>[\\s]*<#{match[1]}/, \"<#{match[1]}\")\n gsub!(/<\\/#{match[1]}>[\\s]*<\\/p>/, \"</#{match[1]}>\")\n end\n \n return self\n end",
"title": ""
},
{
"docid": "8f7198dffa0ee616eef32b729c9af6d9",
"score": "0.6340812",
"text": "def purify_html\n doc= Nokogiri::XML::DocumentFragment.parse(self.to_s)\n doc.search(\".//strong\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h4\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h3\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h2\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h1\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n\n doc.search(\".//em\").each do |e|\n e.swap \"<i>#{e.inner_html}</i>\"\n end\n\n doc.search(\".//ul\").each do |e|\n e.swap \"#{e.inner_html}\"\n end\n doc.search(\".//ol\").each do |e|\n e.swap \"#{e.inner_html}\"\n end\n doc.search(\".//li\").each do |e|\n e.swap \"<p>#{e.inner_html}</p>\"\n end\n doc.search(\".//span\").each do |e|\n e.swap \"#{e.inner_html}\"\n end\n\n doc.to_xml(:encoding => \"UTF-8\").gsub(/\\n/,\" \").gsub(/\\s+/,\" \")\n end",
"title": ""
},
{
"docid": "4b61aff6948a8276d12837282681459c",
"score": "0.6317639",
"text": "def strip_html_tags!\n @raw.gsub!(/<[^>]+?>/, ' ')\n end",
"title": ""
},
{
"docid": "60db19e737ba7494cfc1061bf1235e10",
"score": "0.6310541",
"text": "def strip_tags(html)\n strip(Sanitize.clean(html, :elements => [], :attributes => []))\n end",
"title": ""
},
{
"docid": "f1c75242ecf56dab707666f3d8859f4f",
"score": "0.6303855",
"text": "def app_sanitize(html)\n sanitize(html, attributes: %w[style])\n end",
"title": ""
},
{
"docid": "e57c0555e962458ce3705f8fffbbffb3",
"score": "0.6277634",
"text": "def sanitize(text)\n text.gsub('<', '<').gsub('>', '>')\n end",
"title": ""
},
{
"docid": "484bd819783ed6234ecd3c0d0c856b53",
"score": "0.6275606",
"text": "def sanitized_html\n @sanitized_html ||= begin\n return nil if html_part.nil?\n Envelope::MessageTools.sanitize(html_part)\n end\n end",
"title": ""
},
{
"docid": "bf78d26e80b2e553de9d080eff7ef603",
"score": "0.6273772",
"text": "def fix_html(ary)\n text = \"\"\n\n ary.each do |s|\n temp = s.gsub('<', '<').gsub('>', '>')\n temp = temp.gsub('&b', '<b>').gsub('&/b', '</b>')\n temp = temp.gsub('&i', '<i>').gsub('&/i', '</i>')\n\n text += \" #{temp}<br />\\n\"\n end\n\n return text\nend",
"title": ""
},
{
"docid": "0dee1f4416bbe96fb7254d85a1507b68",
"score": "0.62641644",
"text": "def clean()\n #strip all illegal content here. (scripts, shit that will break layout, etc.)\n end",
"title": ""
},
{
"docid": "b3c79895ced90d5523b6bc220fe6e04f",
"score": "0.62500745",
"text": "def clean_html\n HTML::WhiteListSanitizer.allowed_protocols << 'data'\n self.content = ActionController::Base.helpers.sanitize(self.body, :tags => ALLOWED_TAGS, :attributes => ALLOWED_ATTRIBUTES)\n end",
"title": ""
},
{
"docid": "7a853bed02ee4adb2cb2e5db43d9ca18",
"score": "0.6228605",
"text": "def strip_tags(html)\n # First we need to get rid of any embedded code.\n html = strip_embedded(html)\n\n # Remove comments\n html = html.gsub(/<!--.*?--\\s*>/m, \"\\xEF\\xBF\\xBC\")\n\n # SGML Declarations\n html = html.gsub(/<!.*?>/m, \"\\xEF\\xBF\\xBC\")\n\n # Remove script and css blocks\n html = html.gsub(/<script.*?>.*?<\\/script>/m, \"\\xEF\\xBF\\xBC\")\n html = html.gsub(/<style.*?>.*?<\\/style>/m, \"\\xEF\\xBF\\xBC\")\n\n # Strip html tags\n html = html.gsub(/<\\/? # opening tag with optional slash\n (\n [^<>\"'] | # match anything unquoted\n \".*?\" | # match double quotes…\n '.*?' # and single ones\n )* # any combination of the three\n > # close tag\n /xm, \"\\xEF\\xBF\\xBC\") # placeholder\n\n # Handle placeholders\n html = html.gsub(/^[ \\t]*\\xEF\\xBF\\xBC[ \\t]*(\\n|\\r|\\r\\n)/xm, '') # Remove lines with only tags\n html = html.gsub(/\\xEF\\xBF\\xBC/xm, '') # Remove other placeholders\n return html\nend",
"title": ""
},
{
"docid": "a1ccce8a32a491d7ecaa4b6e269e85a4",
"score": "0.6221719",
"text": "def strip_html\n gsub(HTML_TAG_PATTERN, \"\")\n end",
"title": ""
},
{
"docid": "538c712d54431a0332588010e2343392",
"score": "0.621317",
"text": "def strip_dangerous_html_tags(allowed_tags = 'a|span|strong|b|img|i|s|p|br|h1|h2|h3|h4|h5|h6|blockquote|footer', attributes = {'img' => ['src', 'alt'], 'a' => ['href', 'title', 'target']})\n if allowed_tags.present?\n Sanitize.fragment(self, {elements: allowed_tags.split('|'), attributes: attributes})\n else\n self.gsub('<', \"<\").gsub('>', \">\")\n end\n end",
"title": ""
},
{
"docid": "980e9e812b59272b1b2cab9c7ab38a5c",
"score": "0.6192195",
"text": "def safe_xhtml_sanitize(html, options = {})\n sanitized = xhtml_sanitize(html.purify)\n doc = Nokogiri::XML::Document.parse(\"<div xmlns='http://www.w3.org/1999/xhtml'>#{sanitized}</div>\", nil, (options[:encoding] || 'UTF-8'), 0)\n sanitized = doc.root.children.to_xml(:indent => (options[:indent] || 2), :save_with => 2 )\n rescue Nokogiri::XML::SyntaxError\n sanitized = sanitized.escapeHTML\n end",
"title": ""
},
{
"docid": "d0c99821b6f044ccb22b2d0b71849369",
"score": "0.616871",
"text": "def strip_html(text)\n @name =\n # Remove HTML from the text\n Sanitize.clean(text).\n # Replace newlines with a space\n gsub(/\\n|\\r/, ' ').\n # Replaces runs of spaces by a single space\n squeeze(' ').\n # Remove leading and trailing whitespace\n strip\nend",
"title": ""
},
{
"docid": "af475d624aaec013871f3fd7e9337274",
"score": "0.61571085",
"text": "def clean(text = nil, escape_ampersands_twice = false)\n text.gsub!(\" \", \" \")\n converted = convert_html(text)\n entity_converted = convert_entities(converted)\n # puts \"entity_converted: #{entity_converted}\"\n escaped = escape(entity_converted)\n # escaped = escaped.gsub(/&/, '\\\\\\\\&')\n escaped = escaped.gsub(\"&\", \"\\&\")\n escaped = escaped.gsub(/&/, '\\\\\\\\&') if escape_ampersands_twice\n # puts \"escaped: #{escaped}\"\n # puts \"\\n\"\n escaped\n end",
"title": ""
},
{
"docid": "c5799ab43b94c3428b881a23e4005a35",
"score": "0.6156922",
"text": "def sanitize_html(content)\n require 'cgi'\n CGI.escapeHTML(content)\n end",
"title": ""
},
{
"docid": "5e8224315de119fe0c3cfb579d84e76e",
"score": "0.61420393",
"text": "def strip_html(string=\"\")\n begin\n string = strip_tags(string)\n string = string.gsub(/<\\/?[^>]*>/, \"\")\n string = string.gsub(/\\&+\\w*\\;/, \" \") # replace with a space\n string.html_safe\n rescue\n raw(\"<!-- error stripping html from: #{string} -->\")\n end\n end",
"title": ""
},
{
"docid": "02f1f8847568858cbecb7025c3e9e2da",
"score": "0.6125277",
"text": "def clean_entries(feed)\n full_sanitizer = Rails::Html::FullSanitizer.new\n feed.entries.map do |entry|\n clean_summary = full_sanitizer.sanitize(entry.summary)\n clean_sentences(clean_summary)\n end\n end",
"title": ""
},
{
"docid": "feec1c29cb1fa750579c19bb75ce29cd",
"score": "0.60951406",
"text": "def clean_html(options={:url => nil})\n use_http_get = true\n call_api('clean-html', options, use_http_get)\n end",
"title": ""
},
{
"docid": "d4a782eb36897d049aec644d2b5fb81f",
"score": "0.6076418",
"text": "def pre_normalize(text); end",
"title": ""
},
{
"docid": "74bb438be1a75e0dd4bf1dd88d4dbd49",
"score": "0.6049308",
"text": "def strip_html(string=\"\")\n begin\n string = string.gsub(/<\\/?[^>]*>/, \"\")\n string = string.gsub(/\\&+\\w*\\;/, \" \") # replace with a space\n string.html_safe\n rescue\n raw(\"<!-- error stripping html from: #{string} -->\")\n end\n end",
"title": ""
},
{
"docid": "74bb438be1a75e0dd4bf1dd88d4dbd49",
"score": "0.6049308",
"text": "def strip_html(string=\"\")\n begin\n string = string.gsub(/<\\/?[^>]*>/, \"\")\n string = string.gsub(/\\&+\\w*\\;/, \" \") # replace with a space\n string.html_safe\n rescue\n raw(\"<!-- error stripping html from: #{string} -->\")\n end\n end",
"title": ""
},
{
"docid": "d79df9a17f28bdc814b1f50b08063470",
"score": "0.60475624",
"text": "def strip_html(allow)\n str = self.strip || ''\n allow_arr = allow.join('|')\n str = str.gsub(/<\\s*/,'<')\n str = str.gsub(/<\\/\\s*/,'</')\n # First part of | prevents matches of </allowed. Second case prevents matches of <allowed\n # and keeps the / chacter from matching the ?! allowed.\n str.gsub(/<(\\/(?!(#{allow_arr}))|(?!(\\/|#{allow_arr})))[^>]*?>/mi,'')\n end",
"title": ""
},
{
"docid": "860de4f6dd4738f380c4616db9466bf5",
"score": "0.60445356",
"text": "def correct_unclosed_html_tags(element)\n [:i, :sup].each do |tag|\n strip_stray_close_tags(element,tag)\n append_missing_close_tags(element,tag)\n end\n end",
"title": ""
},
{
"docid": "44ee34555976eecf27f6102bafe18b0b",
"score": "0.6031957",
"text": "def preprocess!\n input_html\n nil\n end",
"title": ""
},
{
"docid": "e2742dcf26f7f495e451e29a8d948384",
"score": "0.6027979",
"text": "def html_sanitizer(string, set=:basic)\n if set == :basic\n $htmlmap = MAPPINGS[:base]\n else\n $htmlmap = MAPPINGS[:base].merge!(MAPPINGS[:title])\n end\n\n string = string.split(\"\")\n string.map! { |char|\n ( $htmlmap.has_key?(char.unpack('U')[0]) ) ? $htmlmap[char.unpack('U')[0]] : char\n }\n\n\n return string.join\nend",
"title": ""
},
{
"docid": "a0bbc9c8b2b8bb0a0e715146e7dc01cf",
"score": "0.6022126",
"text": "def clean_text(text)\n text = strip_html_quote_entities(text)\n text = Helper::Text.strip_html_tags(text)\n text = strip_copyright_text(text)\n text.strip!\n text = Helper::Text.clean_verse_start(text)\n text = Helper::Text.clean_verse_end(text)\n end",
"title": ""
},
{
"docid": "5f4e387920a7a493d24aab0b1e57c0f8",
"score": "0.6008984",
"text": "def normalize! page\n mediawiki = text page\n html = text_wikimedia_html page\n norm_mediawiki = normalize_text mediawiki, html, page\n if mediawiki != norm_mediawiki\n write! page, norm_mediawiki\n else\n pp %Q{normalize! page #{page} already normalized}\n end\n norm_mediawiki\n end",
"title": ""
},
{
"docid": "a5cb5f48cc79f5a946f74f50dae69205",
"score": "0.59618664",
"text": "def process_markdown\n self.data = self.class.convert_markdown(self.data)\n sanitize_html\n end",
"title": ""
},
{
"docid": "0dd6d7e1011c79eb88aee738050fbfb4",
"score": "0.5960968",
"text": "def strip_tags_delicately\n self.gsub(/<.[^<]*>/, ' ')\n end",
"title": ""
},
{
"docid": "d36678828be60ec8220b1e30a0e876bd",
"score": "0.5956067",
"text": "def strip_links(html); end",
"title": ""
},
{
"docid": "d36678828be60ec8220b1e30a0e876bd",
"score": "0.5956067",
"text": "def strip_links(html); end",
"title": ""
},
{
"docid": "d36678828be60ec8220b1e30a0e876bd",
"score": "0.5956067",
"text": "def strip_links(html); end",
"title": ""
},
{
"docid": "b6dde7731a2090b69039fe057c4f7d29",
"score": "0.5946338",
"text": "def clean_posts(post)\r\n\t\t# takes html-free post and parses it back togther with one space per word.\r\n\t\t# guards against improperly concatenating text together in sister method clean_string\r\n\t\twords = clean_string(post).split()\r\n\t\tpolished = ''\r\n\t\twords.each { |word| polished += word + ' ' }\r\n\t\treturn polished\r\n\tend",
"title": ""
},
{
"docid": "6e0c4e4549b793eee29275ec824e733d",
"score": "0.5936065",
"text": "def strip_html_tags(text)\n return text.gsub!(/(<[^>]*>)|\\n|\\t/s) {\" \"}\n end",
"title": ""
},
{
"docid": "26daa4989609221fc45743bf812ab6b2",
"score": "0.5901638",
"text": "def sanitize(input, options={})\n return \"\" if input.nil? or input.empty?\n \n # Only take elements inside of <body>\n @doc = Hpricot(input)\n @doc = Hpricot(@doc.at(\"body\").inner_html) if @doc.at(\"body\")\n sanitized = Aqueduct::RailsSanitizer.white_list_sanitizer.sanitize(@doc.to_html)\n\n # Start parsing sanitized doc\n @doc = Hpricot(sanitized)\n\n # Rewrite all id's to appened network_key\n append_id(@options[:append]) unless @options[:append].nil?\n\n @options[:formatted] == false ? @doc.to_html.gsub(/\\r|\\n/i,'') : @doc.to_html \n end",
"title": ""
},
{
"docid": "edc6059beb47fbace29a706ec88b2cd1",
"score": "0.58802456",
"text": "def standardize\n strip_and_squeeze.\n ampersands_into_text.\n into_ampersand_if_second_to_last.\n remove_indian_languages.\n remove_screening_details.\n replace_non_film_prefix.\n remove_newlines.\n remove_dates.\n title_case\n to_s\n end",
"title": ""
},
{
"docid": "7b5cff0770e306963a51c40f89d8bfef",
"score": "0.58757496",
"text": "def unnormalize(code)\n code = code.gsub(/<text:line-break\\/>/, \"\\n\")\n code = code.gsub(/<text:tab\\/>/, \"\\t\")\n code = code.gsub(/<text:s(\\/|(\\s[^>]*))>/, \" \")\n return REXML::Text.unnormalize(code)\n end",
"title": ""
},
{
"docid": "66b0650604aa72f6dc14c3edafdeea6f",
"score": "0.58748066",
"text": "def sanitize(tainted)\n untainted = tainted\n \n untainted = rule1_sanitize(tainted)\n \n # Start - RULE #2 - Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes\n # End - RULE #2 - Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes\n \n # Start - RULE #3 - JavaScript Escape Before Inserting Untrusted Data into HTML JavaScript Data Values\n # End - RULE #3 - JavaScript Escape Before Inserting Untrusted Data into HTML JavaScript Data Values\n \n # Start - RULE #4 - CSS Escape Before Inserting Untrusted Data into HTML Style Property Values\n # End - RULE #4 - CSS Escape Before Inserting Untrusted Data into HTML Style Property Values\n \n untainted\n end",
"title": ""
},
{
"docid": "e4f17b2f6e001376ae22f6f9ce743c4d",
"score": "0.5874226",
"text": "def clean_article_body\n get_source_selectors.each do |selector|\n if @page.search(selector).present?\n @page = page.search(selector)\n break\n end\n end\n # Strip unwanted spaces and newlines.\n @page.collect {|elt| elt.content.strip.gsub(/\\n|\\r/, '').gsub(/\\ +/, ' ')}.join(' ')\n end",
"title": ""
},
{
"docid": "ffe6a8692705d73fd20ccd3e105cb297",
"score": "0.58671093",
"text": "def strip_tags(html)\n return html if html.blank?\n if html.index(\"<\")\n text = \"\"\n tokenizer = ::HTML::Tokenizer.new(html)\n while token = tokenizer.next\n node = ::HTML::Node.parse(nil, 0, 0, token, false)\n # result is only the content of any Text nodes\n text << node.to_s if node.class == ::HTML::Text\n end\n # strip any comments, and if they have a newline at the end (ie. line with\n # only a comment) strip that too\n text.gsub(/<!--(.*?)-->[\\n]?/m, \"\")\n else\n html # already plain text\n end\n end",
"title": ""
},
{
"docid": "8263ba59c2d66c1431762bf8e7bd1a97",
"score": "0.5862523",
"text": "def strip_html(str,allow=['dm','dl'])\n str = str.strip || ''\n allow_arr = allow.join('|') << '|\\/'\n str.gsub(/<(\\/|\\s)*[^(#{allow_arr})][^>]*>/,'').strip\n end",
"title": ""
},
{
"docid": "1ab831f1ac315b4312df47e6ee06225e",
"score": "0.585866",
"text": "def sanitize_metadata\n return unless metadata_changed?\n sanitizers = {\n 'title' => [:html_entities],\n 'notes' => [:html, :css],\n 'endnotes' => [:html, :css],\n 'summary' => [:html]\n }\n sanitizers.each do |field, sanitizers|\n value = metadata[field]\n next if value.blank?\n self.metadata[field] = sanitized_value(value, sanitizers)\n end\n sanitize_associations\n end",
"title": ""
},
{
"docid": "d227dcfa6cceee21f606510e07456126",
"score": "0.5851448",
"text": "def correct_unncessarily_escaped_html_tags(element)\n statement = element.statement\n [:sup, :i].each do |tag|\n statement.gsub!(/<#{tag}>/,%Q{<#{tag}>})\n statement.gsub!(/<\\/#{tag}>/,%Q{</#{tag}>})\n end\n element.instance_variable_set(:@statement,statement)\n end",
"title": ""
},
{
"docid": "6361cfbaca8f94599ece6ea35ea421a2",
"score": "0.58487535",
"text": "def clean text\n text.gsub(/(\\n|\\t|\\r)/, ' ').gsub(/>\\s*</, '><').squeeze(' ')\n end",
"title": ""
},
{
"docid": "ce9af4d7bf76661c4ad304fe5e906b44",
"score": "0.5836671",
"text": "def sanitize_from_db(text, allowed_tags = NB.allowed_html_tags)\n text = sanitize_from_evernote(text)\n text = text.gsub(/#{ NB.truncate_after_regexp }.*\\Z/m, '')\n .gsub(/<br[^>]*?>/, \"\\n\")\n .gsub(/<b>|<h\\d>/, '<strong>')\n .gsub(%r{</b>|</h\\d>}, '</strong>')\n # OPTIMIZE: Here we need to allow a few more tags than we do on output\n # e.g. image tags for inline image.\n text = sanitize_by_settings(text, allowed_tags)\n text = format_blockquotes(text)\n text = format_code(text)\n text = remove_instructions(text)\n end",
"title": ""
},
{
"docid": "0eb49adf95f9024949f0b6af9418b979",
"score": "0.58358544",
"text": "def html_clean(content,\r\n output_type)\r\n # Prepare query url.\r\n _path_url = '/html-clean'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'content' => content,\r\n 'output-type' => output_type\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n CustomQueryAuth.apply(_request)\r\n _context = execute_request(_request, binary: true)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "d3e19626c731f117740a42d3b877b3e0",
"score": "0.5806436",
"text": "def html_remove\n gsub(/<\\/?[^>]+>/, '')\n end",
"title": ""
},
{
"docid": "b7e415e96e6113b59666062d6fe6c19f",
"score": "0.5806143",
"text": "def repair_html( html, debug=false )\n parents=[]\n depth=0\n html.scan( %r{<(/?)(\\w*)([^>]*)>} ).each do |m|\n if m[-1] == \"/\"\n if debug\n puts 'IGNORE: <'+m[0]+m[1]+'/>' + depth.to_s\n puts 'parents='+parents.join('; ')\n end\n next\n end\n if m[0] == \"\" \n parents[depth]=m[1]\n depth+=1\n if debug\n puts '<'+m[0]+m[1]+'> ' + depth.to_s\n puts 'parents='+parents.join('; ')\n end\n else\n depth-=1\n if debug and (depth <0) \n puts 'ERROR repair_html: '\n puts 'HTML: ' + html\n puts '---'\n repair_html(html,true)\n puts 'END_ERROR'\n end\n if debug\n puts '<'+m[0]+m[1]+'> ' + depth.to_s\n end\n end\n end\n res=html.sub(/<[^>]*$/m,'')\n depth -= 1\n if debug and (depth < 0) \n parents=[]\n depth=0\n html.scan( %r{<(/?)(\\w*)[^>]*(/?)>} ).each do |m|\n if m[2] == \"/\"\n puts 'IGNORE: <'+m[0]+m[1]+m[2]+'> ' + depth.to_s\n next\n end\n if m[0] == \"\" \n parents[depth]=m[1]\n depth+=1\n puts '<'+m[0]+m[1]+'> ' + depth.to_s\n puts 'parents='+parents.join('; ')\n else\n depth-=1\n puts '<'+m[0]+m[1]+'> ' + depth.to_s\n end\n end\n end\n depth.downto(0).each { |x| res<<= %{</#{parents[x]}>} }\n res\nend",
"title": ""
},
{
"docid": "fe8d4b9a410aa822f9799c93ab3b8cfb",
"score": "0.57950234",
"text": "def strip_html(text)\n unless text.nil?\n strip_tags(text)\n end\n end",
"title": ""
},
{
"docid": "0d6084b259860cf4a4356edf6cbcfdf0",
"score": "0.57891434",
"text": "def sanitize(string_or_io)\n loofah_fragment = Loofah.html4_fragment(string_or_io)\n loofah_fragment.scrub!(:strip)\n loofah_fragment.xpath(\"./form\").each(&:remove)\n loofah_fragment.to_s\n end",
"title": ""
},
{
"docid": "d849162e694b80b74752334f5163bc22",
"score": "0.5760445",
"text": "def msclean(html, options = {})\n config = options.delete(:config) || {}\n radius = options.delete(:radius) || false\n if( radius ) then\n Sanitize.clean(html.gsub(/<r:([a-z0-9 _'\"=-]+) \\/>/i, '(r:\\1 /)'), config).gsub(' ',\"\").gsub(/\\(r:([a-z0-9 _'\"=-]+) \\/\\)/i, '<r:\\1 />')\n else\n Sanitize.clean(html, config).gsub(' ',\"\")\n end\n end",
"title": ""
},
{
"docid": "8b35c1a3282e1da7d29472126b5d9fb1",
"score": "0.5752288",
"text": "def safe_sanitize(html_fragment)\n html_fragment = \"\" if (html_fragment.nil?)\n Sanitize.fragment(html_fragment, Sanitize::Config::BASIC)\n end",
"title": ""
},
{
"docid": "d0dc3d58db62eef6a75eb7574f41482e",
"score": "0.5746136",
"text": "def sanitize!\n return self if @sanitized\n replace(HTMLEntities.new.encode(self))\n @sanitized = true\n return self\n end",
"title": ""
},
{
"docid": "1555141b20e0799308841a28b8614c95",
"score": "0.5730588",
"text": "def convert!\n # Fonts and headings\n semanticize_font_styles!\n semanticize_headings!\n\n # Tables\n remove_paragraphs_from_tables!\n semanticize_table_headers!\n\n # list items\n remove_paragraphs_from_list_items!\n remove_unicode_bullets_from_list_items!\n remove_whitespace_from_list_items!\n remove_numbering_from_list_items!\n end",
"title": ""
},
{
"docid": "c8bf01390e9e118fda6594825bfa9623",
"score": "0.57267785",
"text": "def cleaned s, whitelist=%w[ref]\r\n\ts ||= ''\r\n\twhitelist << '---' # prevent empty (?!) in regexes\r\n\t\r\n\ts.gsub(/'{2,3}/, '').gsub(/<(?!#{whitelist.join '|'})(?!\\/(?:#{whitelist.join '|'}))[^>]+>/, '')\r\nend",
"title": ""
},
{
"docid": "ba5c7d2c445cb9b97baffa58be2449f0",
"score": "0.5708693",
"text": "def md_cleanup\n puts ' cleaning up obsolete stuff in Markdown'\n # generation/output of the bibliography (note: the LaTeX package _biblatex_ is used)\n # a) the JLESC publications\n document.content.gsub! BIBLIOGRAPHY_MATCHER_JLESC, '\\printbibliography[heading=none,keyword=own]'\n # b) external references\n document.content.gsub! BIBLIOGRAPHY_MATCHER_EXTERNAL, '\\printbibliography[heading=none,notkeyword=own]'\n\n # the _jekyll-scholar_ +cite+ Liquid tag needs to be replace as it generates HTML code\n document.content.gsub! CITATION_MATCHER, \"\\\\cite{\\\\k<bibtex_id>-#{document.data['slug'].gsub(/_/, '-')}}\"\n end",
"title": ""
},
{
"docid": "0194b4739884344a34b031de9316cd06",
"score": "0.5708633",
"text": "def clean_markdown(md)\n lines = md.split(\"\\n\")\n cleaned = []\n last_stripped = ''\n\n lines.each do |itm|\n stripped = itm.strip\n\n if stripped.start_with?('* ')\n # make sure there is a blank line before the first line of a UL\n if last_stripped != \"\\n\" && !last_stripped.start_with?('* ')\n cleaned << ''\n end\n\n elsif stripped.start_with?('1. ')\n # make sure there is a blank line before the first line of a OL\n if last_stripped != \"\\n\" && !last_stripped.start_with?('1. ')\n cleaned << ''\n end\n\n elsif stripped.start_with?('>')\n # make sure there is a blank line before the first line of a block quote\n if last_stripped != \"\\n\" && !last_stripped.start_with?('>')\n cleaned << ''\n end\n end\n\n cleaned << itm\n last_stripped = stripped\n end\n\n cleaned.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "61e306d080ebf16ae76cdfa1f1b42937",
"score": "0.5692017",
"text": "def html_data_normalize(data)\n data.transform_keys { |key| key.to_s.underscore.to_sym }\n end",
"title": ""
},
{
"docid": "5558449ae1194b0943e0e1930a486122",
"score": "0.56803614",
"text": "def strip_html(str)\n str.gsub HTML_TAG, \"\" if str\n end",
"title": ""
},
{
"docid": "35c594777acb154b7e3c8ac8c6015007",
"score": "0.5678285",
"text": "def sanitize(text)\n text.squeeze\n text.capitalize!\n text.gsub!('&', '&')\n text.gsub!('<', '<')\n text.gsub!('>', '>')\n return text\nend",
"title": ""
},
{
"docid": "c21f785233860319d80651eae156218e",
"score": "0.56749904",
"text": "def normalize\n return if @children.nil?\n old = nil\n children = @children.to_a.dup\n children.each do |child|\n if !old.nil? && old.nodeType == TEXT_NODE &&\n child.nodeType == TEXT_NODE\n old.appendData(child.nodeValue)\n self.removeChild(child)\n else\n if child.nodeType == ELEMENT_NODE\n child.normalize\n end\n old = child\n end\n end\n end",
"title": ""
},
{
"docid": "f9fd87494d6cd677ca26d88d3696d98e",
"score": "0.56554466",
"text": "def parse_text(text)\n ## Strip html\n Sanitize::clean!(text, :remove_contents => ['script','style'])\n text.gsub!(/[\\n\\t]+/, ' ')\n text\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "6a23fa678a4d12718ecd6818873a0fe1",
"score": "0.0",
"text": "def creaditcharge_params\n params.require(:creaditcharge).permit(:paid, :amount, :currency, :refunded)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69811666",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6782836",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6747644",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.6742015",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6735273",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6593917",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.65037674",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6498627",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6482372",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64795715",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64566946",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6439213",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.6380714",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.6378147",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.63657266",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63206697",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.6300169",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.62992156",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6295538",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.62943023",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62915146",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290595",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.62824667",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.62420255",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62403506",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6217174",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.6213706",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.62112075",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6194868",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6178784",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174678",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.6172499",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.61630744",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.61544263",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.615248",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.6147727",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61221075",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6119646",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.61076134",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6106584",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6094013",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6081423",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6071337",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6063637",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.6021453",
"text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.6018253",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.60161054",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.60112554",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60071784",
"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.60071784",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.60004836",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6000254",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.5999255",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59930664",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.59919107",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.5991741",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980763",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59663844",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59605104",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5960486",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5959414",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957901",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.59538954",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953327",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.59450173",
"text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59391475",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59391475",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.59386194",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.59351885",
"text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.593139",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.5926316",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5925927",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59176016",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59119296",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.5909275",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5908221",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.59053046",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.58983994",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.58980995",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.58964473",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5895902",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5893993",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.58927304",
"text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.5887752",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.58841616",
"text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.5880381",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58752084",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.586956",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.5868584",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.58679324",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5867004",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.58667004",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58642864",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5863347",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.58626384",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.58615845",
"text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58594906",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854959",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.5854423",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.58506453",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850135",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
}
] |
f71d17792972860f016aee9ae0ba9818
|
job: Hash > Hash
|
[
{
"docid": "c2006646c13a5dc1230ab763674e0823",
"score": "0.0",
"text": "def bulk_load_preview(job)\n # retry_request = true\n path = LIST + '/preview'\n res = api { post(path, job.to_json) }\n unless res.ok?\n raise_error('BulkLoad job preview failed', res)\n end\n JSON.load(res.body)\n end",
"title": ""
}
] |
[
{
"docid": "43ef24702f4bfcf7f6a52f923c49e7ef",
"score": "0.7854207",
"text": "def hash\n\t\t\t@jobsInQs.hash\n end",
"title": ""
},
{
"docid": "663942df152f1131a2be6eff690d8881",
"score": "0.7156184",
"text": "def job_hash(job_params)\n {:class => self.to_s, :args => job_params}\n end",
"title": ""
},
{
"docid": "0cd609f8d55f2d55393217b8d63a39cb",
"score": "0.70747983",
"text": "def to_job_hash\n [:id, :slug, :name, :email, :firstname].inject({}) {|m, a| m.merge!(a => send(a))}\n end",
"title": ""
},
{
"docid": "ab1204eaea4cb311b30c80435c907d04",
"score": "0.69976944",
"text": "def jobs_key; end",
"title": ""
},
{
"docid": "680d180d43f3d0c6abbc6945261a03b0",
"score": "0.68368024",
"text": "def build_job_hash\n\t\tjob_hash = {}\n\t\tself.get_jobs.each do |job|\n\t\t\tjob_hash[job.id] = job\n\t\tend\n\t\tjob_hash\n\tend",
"title": ""
},
{
"docid": "fd677a914374295ce665e43570c659b1",
"score": "0.68300915",
"text": "def jobs_hash\n hash = {}\n jobs.each_with_index { |job, idx| hash[idx.to_s] = job }\n hash\n end",
"title": ""
},
{
"docid": "016b775877231aebe7fff41686255ce9",
"score": "0.6806898",
"text": "def job_to_hash(job)\n ret_value = {}\n job_stats = job.stats\n job_stats.keys.each { |key| ret_value[key] = job_stats[key] }\n ret_value['body'] = job.body.inspect\n ret_value\n end",
"title": ""
},
{
"docid": "09d20db429f65c8d286740c75de41feb",
"score": "0.6756995",
"text": "def results_as_hash=(_arg0); end",
"title": ""
},
{
"docid": "10c5fe298fff0d37eaf6fd6f1c4df367",
"score": "0.6731573",
"text": "def format_job_data\n hash[:job_id] = RequestStore.store[:job_id] if RequestStore.store[:job_id].present?\n hash[:job_queue] = RequestStore.store[:job_queue] if RequestStore.store[:job_queue].present?\n end",
"title": ""
},
{
"docid": "262457799fbcc625fd9902ff4e9e12a6",
"score": "0.67189044",
"text": "def result_hash(jobs = nil)\n jobs = get_jobs(jobs)\n\n # the #result method automatically reloads the result here if needed but this will\n # do it in one SQL call\n jobs = Job.find(jobs.collect(&:id))\n\n require 'yaml'\n jobs.inject({}) do |hash, job|\n hash.merge(job.args => job.result)\n end\n end",
"title": ""
},
{
"docid": "3c05654cc126caef7622f81280f6f3c5",
"score": "0.6634339",
"text": "def to_h\n\n @jobs.inject({}) { |h, j| h[j.job_id] = j; h }\n end",
"title": ""
},
{
"docid": "57a35b1c44244f8a2e64c9ee9156516f",
"score": "0.65374476",
"text": "def hash\n [_end, error, git, id, job_id, job_name, level, metrics, name, node, parameters, pipeline_name, pipeline_unique_id, stage_id, stage_name, start, status, tags, url].hash\n end",
"title": ""
},
{
"docid": "51cc563d52df6345faac272726f054f2",
"score": "0.6500105",
"text": "def hash\n super +\n @end_time.hash +\n @execution_host.hash +\n @external.hash +\n @external_type.hash +\n @job.hash +\n @number.hash +\n @parent_step.hash +\n @progress.hash +\n @start_time.hash +\n @statistics.hash +\n @status.hash +\n @type.hash\n end",
"title": ""
},
{
"docid": "9cf3dd12ce94f0b0fdacfe50cd5a6fec",
"score": "0.6383522",
"text": "def store(hash)\n store_for_id @job_id, hash, @expiration\n end",
"title": ""
},
{
"docid": "40058450f33acd80aec2a2ec51a2e8ed",
"score": "0.6379574",
"text": "def job\n decode(redis.get(\"#{REDIS_SINGLE_WORKER_KEY}:#{@worker}\")) || {}\n end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.63728803",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.63728803",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.63728803",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "5d5c3902f76458701b949248d31b8a6c",
"score": "0.6369612",
"text": "def hash\n [class_id, object_type, action, cleanup, is_source, job_details, job_exception_message, job_id, job_state, policy_moid, request_id, settings, source_uuid, target_uuid, version, src_cluster, tgt_cluster].hash\n end",
"title": ""
},
{
"docid": "7d4f7c3d68baea4c50f14668ffafbbbd",
"score": "0.63041973",
"text": "def hash\n super +\n @threads.hash\n end",
"title": ""
},
{
"docid": "5bf6ffe76425c67509627c62e32b64be",
"score": "0.6296097",
"text": "def job\n OSC::Machete::Job.new(job_cache.symbolize_keys)\n end",
"title": ""
},
{
"docid": "afae454ec9bacb9ef7722547e047b385",
"score": "0.6295868",
"text": "def get_job_response\n {:job=>\n {:name=>\"demo_ad_tech_etl_job\",\n :role=>\"convergdb-demo_ad_tech_etl_job-2760114836018639773\",\n :created_on=>'2018-03-27 12:19:02 -0700',\n :last_modified_on=>'2018-06-21 09:56:35 -0700',\n :execution_property=>{:max_concurrent_runs=>1},\n :command=>\n {:name=>\"glueetl\",\n :script_location=>\n \"s3://convergdb-admin-9083c59b16173549/9083c59b16173549/scripts/aws_glue/demo_ad_tech_etl_job/demo_ad_tech_etl_job.py\"},\n :default_arguments=>\n {\"--conf\"=>\"spark.yarn.executor.memoryOverhead=1024\",\n \"--convergdb_deployment_id\"=>\"9083c59b16173549\",\n \"--extra-py-files\"=>\n \"s3://convergdb-admin-9083c59b16173549/9083c59b16173549/scripts/aws_glue/demo_ad_tech_etl_job/convergdb.zip\"},\n :connections=>{},\n :max_retries=>0,\n :allocated_capacity=>2}}\n end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.62892824",
"text": "def hash; end",
"title": ""
},
{
"docid": "54414707e9a12c137e197345a196d33c",
"score": "0.6252016",
"text": "def hash_args; end",
"title": ""
},
{
"docid": "54414707e9a12c137e197345a196d33c",
"score": "0.6252016",
"text": "def hash_args; end",
"title": ""
},
{
"docid": "54414707e9a12c137e197345a196d33c",
"score": "0.6252016",
"text": "def hash_args; end",
"title": ""
},
{
"docid": "54414707e9a12c137e197345a196d33c",
"score": "0.6252016",
"text": "def hash_args; end",
"title": ""
},
{
"docid": "54414707e9a12c137e197345a196d33c",
"score": "0.6252016",
"text": "def hash_args; end",
"title": ""
},
{
"docid": "54414707e9a12c137e197345a196d33c",
"score": "0.6252016",
"text": "def hash_args; end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.62516147",
"text": "def hash\n end",
"title": ""
},
{
"docid": "73b3f16bd7e0ffb83d3e2cb654ee521b",
"score": "0.6247982",
"text": "def [] key\n self.jobs[key]\n end",
"title": ""
},
{
"docid": "b25335f81604509e40309e4802018ee6",
"score": "0.6244315",
"text": "def work(job); end",
"title": ""
},
{
"docid": "b25335f81604509e40309e4802018ee6",
"score": "0.6244315",
"text": "def work(job); end",
"title": ""
},
{
"docid": "8c7059bd72a0f34cd1f809210e2d3058",
"score": "0.6242963",
"text": "def perform\n\n mem = {}\n basename = File.join(job.job_dir, job.jobid)\n mem['basename'] = basename\n mem['logfile'] = File.join(job.job_dir, \"status.log\")\n mem['infile'] = basename+\".in\"\n mem['fasfile'] = basename+\".fas\"\n mem['psifile'] = basename+\".psi\"\n mem['queryfile'] = basename+\".query\"\n mem['seqfile'] = basename+\".seq\"\n mem['clufile'] = basename+\".clu\"\n mem['a3mfile'] = basename+\".a3m\"\n mem['chkfile'] = basename+\".chk\"\n mem['matrixfile'] = basename+\".matrx\"\n mem['alnfasfile'] = basename+\".afas\"\n mem['buildalilog'] = basename+\".balilog\"\n mem['psiblog'] = basename+\".pblog\"\n mem['psipredfile'] = basename+\".psipred\"\n mem['ss2file'] = basename+\".ss2\"\n mem['jnetfile'] = basename+\".jnet\"\n # mem['memsatfile'] = basename+\".memsat2\"\n mem['memsatsvmfile'] = basename+\".memsatsvm\"\n mem['phobiusfile'] = basename+\".phobius\"\n mem['predisifile'] = basename+\".predisi\"\n mem['hmmtopfile'] = basename+\".hmmtop\"\n mem['profoualifile']= basename+\".profouali\"\n mem['coilsfile'] = basename+\".coils\"\n mem['accfile'] = basename+\".acc\"\n mem['htmfile'] = basename+\".htm\"\n mem['secfile'] = basename+\".sec\"\n #mem['vsl2file'] = basename+\".vsl2\"\n mem['disopredfile'] = basename+\".horiz_d\"\n mem['iupredfile'] = basename+\".iupred\"\n mem['headerfile'] = basename+\".header\"\n mem['al2cofile'] = basename+\".al2co\"\n mem['al2comapent'] = basename+\".al2comapent\"\n mem['al2comapvar'] = basename+\".al2comapvar\"\n mem['al2comapssp'] = basename+=\".al2comapssp\"\n\n self.flash = mem\n self.save!\n params_to_file( flash['infile'], 'sequence_input', 'sequence_file' )\n\n init_vars\n reformat(@informat,\"fas\", flash['infile'], flash['fasfile'])\n if @informat == \"a3m\"\n system(\"cp #{flash['infile']} #{flash['a3mfile']}\")\n end\n prepareFiles\n end",
"title": ""
},
{
"docid": "0dc7fca0ee31dd3315d2b5cc55e8ae6c",
"score": "0.62385184",
"text": "def job( pid )\n @jobs.each do |j|\n next if j['pid'] != pid\n cjob = j.dup\n\n cjob['currtime'] = Time.now\n cjob['age'] = cjob['currtime'] - cjob['birthdate']\n cjob['runtime'] = cjob['currtime'] - cjob['starttime']\n cjob['proc'] = proc_hash( cjob['pid'] )\n\n return cjob\n end\n end",
"title": ""
},
{
"docid": "c91c00398e8a4536353d7a85b830a6c0",
"score": "0.6230272",
"text": "def to_h\n {\n worker: self.class.to_s,\n job_id: job_id,\n job_args: job_args,\n job_meta: job_meta.to_h,\n job_retries: job_retries,\n job_queue: job_queue,\n task_id: task_id\n }\n end",
"title": ""
},
{
"docid": "e6225ffc7cbbe52e59dfbd0c03662fa0",
"score": "0.6202413",
"text": "def hash\n\n\t\t\t@arg.hash\n\t\tend",
"title": ""
},
{
"docid": "e6225ffc7cbbe52e59dfbd0c03662fa0",
"score": "0.6202413",
"text": "def hash\n\n\t\t\t@arg.hash\n\t\tend",
"title": ""
},
{
"docid": "cfcdabc30e812aebc59ad99bbffe3f5e",
"score": "0.6188109",
"text": "def make(hash) #new job is a Hash\n raise NoSuchJob unless jr_job = JR.jobs[hash['name']]\n\n job = hash\n add_start_callback(job) if JR.config[:log_job_processing]\n job.callback(&jr_job[:job])\n\n jr_job[:callbacks].each do |callback|\n job.callback(&callback[1])\n end if jr_job[:callbacks]\n\n add_last_callback(job) if JR.config[:log_job_processing]\n\n add_start_errback(job) if JR.config[:log_job_processing]\n\n jr_job[:errbacks].each do |errback|\n job.errback(&errback[1])\n end if jr_job[:errbacks]\n\n add_complete_errback(job) if JR.config[:log_job_processing]\n\n job\n end",
"title": ""
},
{
"docid": "7e1e6b34d931da411a32a16fbc3c51ab",
"score": "0.6187316",
"text": "def call(job_params)\n @result = OpenStruct.new(jid: SecureRandom.uuid)\n\n redis.with do |c|\n c.set(\"antelopes:job:#{@result.jid}\", JSON.generate(job_params.merge(jid: @result.jid)))\n c.lpush('antelopes:todo', @result.jid)\n end\n\n logger.info \"Pushed #{@result.jid} - #{job_params}\"\n\n @result\n end",
"title": ""
},
{
"docid": "f2af293b8302a930e8a20036e73b2b89",
"score": "0.6183848",
"text": "def process_job(job)\n job = job.stringify_keys\n @destination = job['destination']\n @job_id = job['atlas_id']\n @taxonomy = job['taxonomy']\n @output_folder = job['output_folder']\n end",
"title": ""
},
{
"docid": "7f5d38dff8cf2105dd01bad52c16973a",
"score": "0.6173845",
"text": "def job_hash\n {\n \"application_id\": CarrierWave::Blitline.blitline_application_id,\n \"src\": url,\n \"v\": BLITLINE_VERSION,\n \"functions\": functions\n }.with_indifferent_access\n end",
"title": ""
},
{
"docid": "22befe6c08efc483c596c36008e176da",
"score": "0.61009336",
"text": "def run_jobs(jobs)\n if jobs = {\"a\" => \" \", \"b\" => \" \", \"c\" => \" \"}\n run_jobs.each_key do |key, value| \n jobs.push(key)\n puts key\n end\n end\n end",
"title": ""
},
{
"docid": "13d2c1ca013061c2322af546f472a14b",
"score": "0.60857785",
"text": "def initialize(hash)\n @job_id = hash[:job_id] || (\"job-\" + UUIDTools::UUID.random_create.to_s)\n @tasks = hash[:tasks] || Array.new\n @cloud_credentials = hash[:cloud_credentials]\n @created_at = hash[:created_at] || Time.now\n @updated_at = hash[:updated_at] || Time.now\n @username = hash[:username]\n @orgname = hash[:orgname]\n @orgdb = hash[:orgdb]\n @status = hash[:status]\n @status_details = hash[:status_details]\n @values = hash[:values] || {}\n\n # TODO tim 2011-5-11: duck-typing for these checks?\n raise ArgumentError, \"Job: tasks must be an Array: #{@tasks.class}\" unless @tasks.kind_of?(Array)\n raise ArgumentError, \"Job: tasks must be an Array of Tasks\" unless @tasks.select {|o| o.kind_of?(Task)}.length == @tasks.length\n raise ArgumentError, \"Job: created_at must be a Time: #{@created_at.class}\" unless @created_at.kind_of?(Time)\n raise ArgumentError, \"Job: updated_at must be a Time: #{@updated_at.class}\" unless @updated_at.kind_of?(Time)\n\n # created_at and updated_at are rounded down to nearest second.\n @created_at = Time.at(@created_at.to_i)\n @updated_at = Time.at(@updated_at.to_i)\n end",
"title": ""
},
{
"docid": "8aa9bac7b58240f1ad8ae671bb7760a7",
"score": "0.6059916",
"text": "def serializable_hash; end",
"title": ""
},
{
"docid": "ef271f96ef379a6e7531ff97afc0a5be",
"score": "0.6045469",
"text": "def to_hash\n {\n :type => \"job_definition\",\n :file_queue_name => @file_queue_name,\n :reply_exchange_name => @reply_exchange_name,\n :sync => @sync,\n :callbacks => @callbacks\n }\n end",
"title": ""
},
{
"docid": "b4b1e2489e338bf8e2968a6f845a7b90",
"score": "0.6036905",
"text": "def hash\n [_end, error, git, is_manual, is_resumed, level, metrics, name, node, parameters, parent_pipeline, partial_retry, pipeline_id, previous_attempt, queue_time, start, status, tags, unique_id, url].hash\n end",
"title": ""
},
{
"docid": "2e124e423c8eba03867f34227524840f",
"score": "0.6027424",
"text": "def to_hash\n {:type => \"job_definition\", :file_queue_name => @file_queue_name, :reply_exchange_name => @reply_exchange_name, :source_tree_path => @source_tree_path, :sync_exclude => @sync_exclude, :callbacks => @callbacks}\n end",
"title": ""
},
{
"docid": "b78a8c3fbbda0dc6b3ed59f810316f24",
"score": "0.6006334",
"text": "def hash(*) end",
"title": ""
},
{
"docid": "14096fb3bb613a11448fe0c88b3f7ded",
"score": "0.5992914",
"text": "def [](key)\n redis { |conn| conn.hget(redis_job_hkey, key) }\n end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.5986556",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.5986556",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "1541e1727994e38ab80d327689afc71b",
"score": "0.5976024",
"text": "def to_h\n {\n content: content,\n args: args,\n submit_as_hold: submit_as_hold,\n rerunnable: rerunnable,\n job_environment: job_environment,\n workdir: workdir,\n email: email,\n email_on_started: email_on_started,\n email_on_terminated: email_on_terminated,\n job_name: job_name,\n shell_path: shell_path,\n input_path: input_path,\n output_path: output_path,\n error_path: error_path,\n reservation_id: reservation_id,\n queue_name: queue_name,\n priority: priority,\n start_time: start_time,\n wall_time: wall_time,\n accounting_id: accounting_id,\n job_array_request: job_array_request,\n qos: qos,\n gpus_per_node: gpus_per_node,\n native: native,\n copy_environment: copy_environment\n }\n end",
"title": ""
},
{
"docid": "24dbc72072a61f5e15879fa71fdeae1e",
"score": "0.59672195",
"text": "def job #getter method\n @job\n end",
"title": ""
},
{
"docid": "b336cd4930d4caaa3ff0760525dbecf5",
"score": "0.59596664",
"text": "def formatRawJob(rjob, is_live) \n\n job = Hash.new\n job[:rjob] = rjob\n job[:id] = rjob[\"id\"]\n job[:name] = rjob[\"name\"]\n\n # Determine whether to expose the job name (which contains an AndrewID).\n if !@cud.user.administrator? then\n if !@cud.instructor? then \n # Students can see only their own job names\n if !job[:name][@cud.user.email] then\n job[:name] = \"*\"\n end\n else\n # Instructors can see only their course's job names\n if !rjob[\"notifyURL\"] then\n job[:name] = \"*\"\n end\n end\n end\n\n # Extract timestamps of first and last trace records \n if rjob[\"trace\"] then\n job[:first] = rjob[\"trace\"][0].split(\"|\")[0] \n job[:last] = rjob[\"trace\"][-1].split(\"|\")[0] \n \n # Compute elapsed time. Live jobs show time from submission\n # until now. Dead jobs show end-to-end elapsed time.\n t1 = DateTime.parse(job[:first]).to_time\n if is_live then\n snow = Time.now.localtime.to_s\n t2 = DateTime.parse(snow).to_time\n else \n t2 = DateTime.parse(job[:last]).to_time\n end\n job[:elapsed] = t2.to_i - t1.to_i # elapsed seconds\n job[:tlast] = t2.to_i # epoch time when the job completed\n\n # Get status and overall summary of the job's state\n job[:status] = rjob[\"trace\"][-1].split(\"|\")[1]\n end\n\n if is_live then\n if job[:status][\"Added job\"] then\n job[:state] = \"Waiting\"\n else\n job[:state] = \"Running\"\n end\n else\n job[:state] = \"Completed\"\n end\n\n return job\n end",
"title": ""
},
{
"docid": "365e99b8b4c3433ab876bd878aa60ad5",
"score": "0.59483486",
"text": "def hash\n @hash ||= to_quad.hash\n end",
"title": ""
},
{
"docid": "365e99b8b4c3433ab876bd878aa60ad5",
"score": "0.59483486",
"text": "def hash\n @hash ||= to_quad.hash\n end",
"title": ""
},
{
"docid": "6331f2bcafd8acb6c0ce276c2677e1cd",
"score": "0.5928876",
"text": "def to_hash\n {\n :type => \"job_definition\",\n :file_queue_name => @file_queue_name,\n :reply_exchange_name => @reply_exchange_name,\n :sync => @sync,\n :callbacks => @callbacks\n }\n end",
"title": ""
},
{
"docid": "7e88aa4285c04533c949cf414cf9e78f",
"score": "0.59116083",
"text": "def state\n redis.get(job_gid)&.to_sym\n end",
"title": ""
},
{
"docid": "66d89572ed57932f6884fa60d901e212",
"score": "0.59060395",
"text": "def convertToJobModel(job)\n job_hash = {}\n job_hash[:title] = job[:job_title]\n job_hash[:company] = job[:company]\n job_hash[:img_url] = job[:company_logo]\n job_hash[:description] = job[:description]\n job_hash[:location] = job[:location]\n job_hash[:type] = get_job_type(job_hash[:title])\n job_hash[:culture_video_url] = job[:video_url]\n job_hash[:job_url] = job[:job_url]\n job_hash[:post_date] = job[:active_time]\n job_hash[:id] = job[:id]\n job_hash[:source] = \"AngelList\"\n job_hash[:email] = \"applications@resu.me\"\n job_hash[:job_url] = job[:job_url]\n return job_hash\nend",
"title": ""
}
] |
c7fc5cc10c08ff54bb791528dc9af36f
|
Adds a cache key association to your model
|
[
{
"docid": "dd580e15d304abc28eb849cdcd9e22b0",
"score": "0.0",
"text": "def has_cache_key(*args)\n if (options = args.extract_options!)\n options[:composed_of] ||= args.flatten\n else\n options = {}\n end\n options[:composed_of] = Array(options[:composed_of])\n options[:name] ||= name.to_s.demodulize.underscore\n options[:format] ||= \"#{options[:name]}-#{options[:composed_of].map { |k| \"%{#{k}}\" }.join('-')}\"\n cache_key = HasCacheKey::CacheKey.new(*options[:composed_of], options)\n (@cache_keys ||= []) << cache_key\n (@cache_key_by_name ||= {}.with_indifferent_access)[cache_key.name] = cache_key\n end",
"title": ""
}
] |
[
{
"docid": "990ee383dcca7e188f17ba95a512356c",
"score": "0.6563144",
"text": "def associate_cache(active_record, *association_names)\n require 'adequate_serialization/rails/cache_refresh'\n\n unless active_record.respond_to?(:associate_cache)\n active_record.extend(CacheRefresh)\n end\n\n association_names.each do |association_name|\n active_record.associate_cache(association_name)\n end\n end",
"title": ""
},
{
"docid": "3805d0b3aa83bcdced3f380b4ce2681b",
"score": "0.63102686",
"text": "def add_cache_index(key, cache_key)\n # it appends cache_key to list retrieved from cache by key\n # if cache doesn't have such key - we create it\n list = Rails.cache.read(to_cache_key(key))\n list = list.nil? ? [] : list.dup\n cache_key = fragment_cache_key(cache_key)\n Rails.cache.write(to_cache_key(key), list.push(cache_key).uniq)\n end",
"title": ""
},
{
"docid": "d266f24bf0a1a156e37285251c8e9cde",
"score": "0.62816006",
"text": "def cache_key(id); end",
"title": ""
},
{
"docid": "fc7fced08c8d3e3c86e6dc087bb41e57",
"score": "0.62309396",
"text": "def store_cache_id(args)\n @model.cache_id = cache_id\n end",
"title": ""
},
{
"docid": "04c1022a71917495fa24907b5b5c93b6",
"score": "0.621772",
"text": "def update_cache_hash key, options={}\n\n model = get_model options[:model]\n\n if options[:time]\n cachehash = CacheHash.new(model, options[:time])\n else\n cachehash = CacheHash.new(model, options[:route_id])\n end\n\n cachehash.add(key, options)\n\n end",
"title": ""
},
{
"docid": "eec6cf2ecf998c7dba5239bc872d9435",
"score": "0.6190792",
"text": "def add_to_cache(config, object)\n # we take a shortcut here assuming that the cache has already been primed with the primary key column\n # because this method should always be guarded by #already_loaded?\n column_cache = @cache[config]\n column_cache.each do |column_name, unique_key_cache|\n unique_key_cache[object.send(column_name)] = object\n end\n object\n end",
"title": ""
},
{
"docid": "596e019b1e4c795f511b087195e4e01c",
"score": "0.6182403",
"text": "def get_cache_key col, belongs_to_assoc = nil\n if belongs_to_assoc\n klass_name = col.class.name\n foreign_key = col.class.reflect_on_association(belongs_to_assoc).foreign_key\n else\n klass_name = self.class.reflect_on_association(col).klass.name\n foreign_key = self.class.reflect_on_association(col).foreign_key\n end\n \"#{self.class}_#{self.id}_has_many_#{klass_name}_#{foreign_key}\"\n end",
"title": ""
},
{
"docid": "edbb4ca38ce7da1a70abf3855ca6bad2",
"score": "0.6131003",
"text": "def cached_association; end",
"title": ""
},
{
"docid": "edbb4ca38ce7da1a70abf3855ca6bad2",
"score": "0.6131003",
"text": "def cached_association; end",
"title": ""
},
{
"docid": "37951207013cb70f5945db7b387aeba1",
"score": "0.6108417",
"text": "def cache_has_one(association, embed:); end",
"title": ""
},
{
"docid": "37951207013cb70f5945db7b387aeba1",
"score": "0.6108417",
"text": "def cache_has_one(association, embed:); end",
"title": ""
},
{
"docid": "cc44aec6bd3bd7f48311bb13f2d13506",
"score": "0.61079043",
"text": "def cache_key\n attributes.fetch(:cache_key) { \"#{self.class.name.downcase}/#{id}\" }\n end",
"title": ""
},
{
"docid": "cc44aec6bd3bd7f48311bb13f2d13506",
"score": "0.61079043",
"text": "def cache_key\n attributes.fetch(:cache_key) { \"#{self.class.name.downcase}/#{id}\" }\n end",
"title": ""
},
{
"docid": "11994121bf015ac9adf523f8accde245",
"score": "0.61055607",
"text": "def attr_cached_key\n [self, :attr_cache_store]\n end",
"title": ""
},
{
"docid": "87290b624619f775b7a69f00b313e7ba",
"score": "0.6087918",
"text": "def belongs_to_cache_key(name, polymorphic=nil)\n name = name.to_s if name.is_a?(Symbol)\n\n key = if polymorphic && self.respond_to?(:\"#{name}_type\")\n return nil unless self.send(:\"#{name}_type\").present?\n \"#{base_class_or_name(self.send(:\"#{name}_type\"))}/#{self.send(:\"#{name}_id\")}\"\n else\n \"#{base_class_or_name(name)}/#{self.send(:\"#{name}_id\")}\"\n end\n\n modified_cache_key key\n end",
"title": ""
},
{
"docid": "1c6882b640d6ff93d0c5340237cc0686",
"score": "0.6049945",
"text": "def add_key(id, key)\n push!\n end",
"title": ""
},
{
"docid": "793aab5ef9a448f17083e9029fbc0b3a",
"score": "0.6032458",
"text": "def add_key(key)\n @key = key\n end",
"title": ""
},
{
"docid": "22e35792ae046a6da8c916a6244226ac",
"score": "0.60212743",
"text": "def garner_cache_key\n key_strategy.apply(self)\n end",
"title": ""
},
{
"docid": "22e35792ae046a6da8c916a6244226ac",
"score": "0.60212743",
"text": "def garner_cache_key\n key_strategy.apply(self)\n end",
"title": ""
},
{
"docid": "7bc40b671469cbb749e3af69e746c971",
"score": "0.599444",
"text": "def add_key(key)\n self.key_list_set.add(key)\n end",
"title": ""
},
{
"docid": "4ec4308fc100f240f6dec20b5699eab4",
"score": "0.59931475",
"text": "def cache_key\n self.class.cache_key_for(id)\n end",
"title": ""
},
{
"docid": "85ceffa65b1a2416c7069fc7fbf78766",
"score": "0.599226",
"text": "def initialize_association_cache\n @association_cache = {}\n end",
"title": ""
},
{
"docid": "8a1abc979ead4177481d934af109df40",
"score": "0.59866476",
"text": "def add_key(_path)\n # TODO: Think of a generic mechanism\n end",
"title": ""
},
{
"docid": "0a4bba930683cdd26e806707afef0f45",
"score": "0.598044",
"text": "def belongs_to association_id, options={}, &extension \n options.should_not! :include, :counter_cashe\n if options.delete(:counter_cache) || options.delete('counter_cache')\n association_id = association_id.to_s\n association_key = \"#{association_id}_id\"\n cache_attribute = \"#{name.pluralize.underscore}_count\"\n cache_class = association_id.classify.constantize\n cache_class.keys.should! :include, cache_attribute \n increase_method_name = \"increase_#{cache_class.name.underscore}_#{name.pluralize.underscore}_counter\"\n decrease_method_name = \"decrease_#{cache_class.name.underscore}_#{name.pluralize.underscore}_counter\"\n \n define_method increase_method_name do\n cache_class.upsert self.send(association_key), :$inc => {cache_attribute => 1}\n end\n protected increase_method_name \n \n define_method decrease_method_name do\n cache_class.upsert self.send(association_key), :$inc => {cache_attribute => -1}\n end\n protected decrease_method_name\n \n after_create increase_method_name\n after_destroy decrease_method_name\n end\n \n super association_id, options, &extension\n end",
"title": ""
},
{
"docid": "5c414d4fdbc25bec6d3d56b09cf216db",
"score": "0.59689707",
"text": "def add_key(key)\n self << key\n @key_indexes[key] = @key_indexes.size\n end",
"title": ""
},
{
"docid": "1d45d450007a916cfd27dca9d74327b8",
"score": "0.5967168",
"text": "def store_key_references; end",
"title": ""
},
{
"docid": "2b8c9fe43188e168800c8880201e21df",
"score": "0.5962576",
"text": "def arid_cache_key(key, options={})\n object_key = if self.is_a?(Class)\n self.name.downcase\n elsif options[:auto_expire]\n self.cache_key\n else\n result = \"#{AridCache::Inflector.pluralize(self.class.name.downcase)}\"\n result += \"/#{self[:id]}\" if self.respond_to?(:[]) && !self[:id].nil?\n result\n end\n 'arid-cache-' + object_key + '-' + key.to_s\n end",
"title": ""
},
{
"docid": "fad2e785304a7efedfd39da3c88f6ce6",
"score": "0.59446526",
"text": "def find_cache_belongs_to(attribute, model, foreign_key)\n send :define_method, attribute.to_sym do |*args|\n model.find_cache(self.send(foreign_key.to_sym))\n end\n end",
"title": ""
},
{
"docid": "e59ffae7d8de6e7259a7951603de420e",
"score": "0.593738",
"text": "def cache_id(*args)\n key_callbacks[args.first] = args.second\n end",
"title": ""
},
{
"docid": "b6d73b838c6f1c8fbf1e02787035b38f",
"score": "0.5922961",
"text": "def add_key(key)\n keys[key.name] = key\n end",
"title": ""
},
{
"docid": "fad0c882372df7a212a4a065a74ea93b",
"score": "0.5896979",
"text": "def cache_key\n ActiveSupport::Cache.expand_cache_key([\n self.class.model_name.name.downcase,\n \"#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\"\n ].compact)\n end",
"title": ""
},
{
"docid": "fad0c882372df7a212a4a065a74ea93b",
"score": "0.5896979",
"text": "def cache_key\n ActiveSupport::Cache.expand_cache_key([\n self.class.model_name.name.downcase,\n \"#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\"\n ].compact)\n end",
"title": ""
},
{
"docid": "aa95eef0c782c10a9cb7b9eda4f7a855",
"score": "0.5890465",
"text": "def assoc(key); end",
"title": ""
},
{
"docid": "2b97acb9e86611077e89303d23990ae5",
"score": "0.5889038",
"text": "def cache_key\n CacheKeyGenerator.new.for_collection(self)\n end",
"title": ""
},
{
"docid": "675a9ec323d82b95f83ed7935526ac14",
"score": "0.58720684",
"text": "def cache_key\n ActiveSupport::Cache.expand_cache_key([\n self.class.model_name.name.downcase,\n \"#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\"\n ].compact)\n end",
"title": ""
},
{
"docid": "e3e33bd0b16e2745b591c7b00e6331d7",
"score": "0.5871001",
"text": "def cache_key(*_)\n if new_record?\n \"#{model_name.cache_key}/new\"\n else\n \"#{model_name.cache_key}/#{id}\"\n end\n end",
"title": ""
},
{
"docid": "567b0e421d6af6d70b82d28d83eaafa2",
"score": "0.5859222",
"text": "def save\n super\n # update self in the cache\n self.class.cache[self.id] = self\n end",
"title": ""
},
{
"docid": "3a2c7ad8c37ddda9519b602173f63972",
"score": "0.58353674",
"text": "def belong_association_cache_key(name, polymorphic=nil)\n name = name.to_s if name.is_a?(Symbol)\n\n if polymorphic && self.respond_to?(:\"#{name}_type\")\n return nil unless self.send(:\"#{name}_type\").present?\n \"#{base_class_or_name(self.send(:\"#{name}_type\"))}/#{self.send(:\"#{name}_id\")}\"\n else\n \"#{base_class_or_name(name)}/#{self.send(:\"#{name}_id\")}\"\n end\n end",
"title": ""
},
{
"docid": "f7fe8208acef2b05aea21b94074ec722",
"score": "0.5826675",
"text": "def cache_key\n @cache_key ||= compute_cache_key\n end",
"title": ""
},
{
"docid": "861704d8926af5363ffb6f604f113ead",
"score": "0.58191323",
"text": "def arid_cache_key(*args)\n options = args.last.is_a?(Hash) ? args.pop : {} # args.extract_options! is not removing the options from the array\n key_base =\n if self.is_a?(Class)\n id, key = args.size == 2 ? args : [nil, args.first]\n if id.present?\n AridCache.class_name(self, :downcase, :pluralize) + '/' + id.to_s + '-' + key.to_s\n else\n AridCache.class_name(self, :downcase) + '-' + key.to_s\n end\n elsif options[:auto_expire]\n self.cache_key + '-' + args.first.to_s\n else\n id, key = (self.respond_to?(:[]) ? self[:id] : nil), args.first\n AridCache.class_name(self, :downcase, :pluralize) + (id.present? ? '/' + id.to_s : '') + '-' + key.to_s\n end\n 'arid-cache-' + key_base\n end",
"title": ""
},
{
"docid": "3b9650199f7504d4f72569958ddc41fe",
"score": "0.580324",
"text": "def cache_key\n attributes.fetch(:cache_key) { \"#{self.class.name.downcase}/#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\" }\n end",
"title": ""
},
{
"docid": "53073a2e70b6772034ad94976920e2fa",
"score": "0.5799317",
"text": "def add(key, value)\n if @cache[key]\n @list.freshen(@cache[key], value)\n else\n link = @list.append(key,value)\n @cache[key] = link\n eject! if @cache.length > @max\n end\n end",
"title": ""
},
{
"docid": "5ff116034182ca13b7badf333ed5e9b9",
"score": "0.5798132",
"text": "def controller_cache_key(record_or_scope, options)\r\n parts = Array.new\r\n if (key = options[:cache_key]).present?\r\n controller_cache_convert_timestamp_to_keys(parts, key)\r\n controller_cache_add_generic_keys(parts, options)\r\n else\r\n case\r\n when controller_cache_record_or_scope_is_a_scope?(record_or_scope)\r\n controller_cache_add_collection_key(parts, record_or_scope, options)\r\n when record_or_scope.is_a?(Array)\r\n controller_cache_add_collection_key(parts, record_or_scope, options)\r\n else\r\n controller_cache_add_member_key(parts, record_or_scope, options)\r\n end\r\n end\r\n parts.join('/')\r\n end",
"title": ""
},
{
"docid": "9ef6b162ee9558826c4093893e7c296c",
"score": "0.5795489",
"text": "def _cache_key\n self.object\n end",
"title": ""
},
{
"docid": "ac001d787f70150711480e8f37e9927b",
"score": "0.5793568",
"text": "def cache_key_components\n simple_cache_key_components.append(events_cache_key)\n end",
"title": ""
},
{
"docid": "93280a1684fedfd6aa95abfcac01f76c",
"score": "0.57820815",
"text": "def cache_key\n @cache_key ||= generate_key\n end",
"title": ""
},
{
"docid": "a91a838b99844964ce42f37750f9d573",
"score": "0.57783276",
"text": "def cache_store_key(key)\n 'cache-' << Digest::MD5.hexdigest(key)\n end",
"title": ""
},
{
"docid": "494e43f1a620453726564f211721f34d",
"score": "0.5774875",
"text": "def association(key)\n @associations[key] ||= Association.children(@model, key)\n end",
"title": ""
},
{
"docid": "5772552ac14d50ff3684d17231d17f3a",
"score": "0.5774213",
"text": "def cache_key_memcache\n return \"active_record:#{cache_key_local}\"\n end",
"title": ""
},
{
"docid": "5772552ac14d50ff3684d17231d17f3a",
"score": "0.5774213",
"text": "def cache_key_memcache\n return \"active_record:#{cache_key_local}\"\n end",
"title": ""
},
{
"docid": "84482c9c92df318b3f871fa4ba98665b",
"score": "0.5749402",
"text": "def _cache_key\n object\n end",
"title": ""
},
{
"docid": "c0b6c61866591d0389f9288efa98fda6",
"score": "0.5745999",
"text": "def add_key key\n @keystore.add_key(key)\n @storage.add_watched_address(key[:addr])\n end",
"title": ""
},
{
"docid": "375518142e9e2540ad17c0a461fb0874",
"score": "0.5725463",
"text": "def cache_key\n @cache_key ||=\n [\n CACHE_KEY_PREFIX,\n serializer.cache_key_base,\n serializer.dependency_key,\n addons_key,\n cacheable_cache_key\n ].flatten.compact.join(CACHE_KEY_SEPARATOR)\n end",
"title": ""
},
{
"docid": "7c709854331f49df900b67b856f737df",
"score": "0.5717693",
"text": "def cache_key\n [object, @options[:include_books], @options[:include_contents]]\n end",
"title": ""
},
{
"docid": "c7fa700f9780ac6473125fd360d9dcc3",
"score": "0.5716663",
"text": "def memcache_key_object\n @m_k_o ||= MemcacheKey.new('chain_addresses.details')\n end",
"title": ""
},
{
"docid": "0dae8c8b0e6fcab3189c852f4685f677",
"score": "0.5714503",
"text": "def cache_key(id, params = {})\n model_name = self.to_s.pluralize.underscore\n params_hash = Digest::MD5.hexdigest(params.to_s)\n \n cache_key = \"#{model_name}/#{id}-#{params_hash}\"\n end",
"title": ""
},
{
"docid": "282df24dd0c2e55a9ec6d6b876b998f7",
"score": "0.5707669",
"text": "def set_id_to_cache_key_map\n @identifiers.each do |id|\n @id_to_cache_key_map[id] = get_cache_key(id)\n end\n end",
"title": ""
},
{
"docid": "b17287aff26368b4f22ee86c5bb94682",
"score": "0.57058954",
"text": "def add_item(key, item, value)\n @cache[key] = item\n @cache[key].value = value\n @cache[key].time = Time.new\n @cache[key].id = @highest_id\n @highest_id += 1\n end",
"title": ""
},
{
"docid": "3f51df51f9e6aa04598f7e5f02bbe29e",
"score": "0.5702832",
"text": "def cache_key\n @o.cache_key\n end",
"title": ""
},
{
"docid": "1189aec5be7176188d891f79ef2f5d1e",
"score": "0.5702058",
"text": "def cache_has_many(association, embed: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1189aec5be7176188d891f79ef2f5d1e",
"score": "0.5702058",
"text": "def cache_has_many(association, embed: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "3d221f8c446e6c2c01058e8b19c86b1f",
"score": "0.56944627",
"text": "def add_to_cache(entry)\n raise ArgumentError, \"entry can't be nil\" unless entry\n @cache[entry.hash_id] = entry\n end",
"title": ""
},
{
"docid": "b1f25919a6b8c0c7cabafcfbf9f06ad0",
"score": "0.569025",
"text": "def cache_key(obj, options)\n key_components = [cache_key_class_name]\n key_components << (obj.try(:is_root_resource) ? 'r' : 'l')\n key_components << obj\n key_components << options.select{|k,v| Array(options['_keys']).include?(k.to_s)}\n\n ActiveSupport::Cache.expand_cache_key(key_components)\n end",
"title": ""
},
{
"docid": "4db01cabbb2c6e25526e6a98799e246e",
"score": "0.5688968",
"text": "def cache_key\n end",
"title": ""
},
{
"docid": "dd31a4aefa9abfb55c125f3f48c5da07",
"score": "0.568882",
"text": "def add(key)\r\n @hash << key\r\n end",
"title": ""
},
{
"docid": "aa2bf60a428a343ae35750fa84fb4a45",
"score": "0.5685988",
"text": "def cache\n self.class.store.store.set_resource(resource_key, id, self)\n end",
"title": ""
},
{
"docid": "84629a0477f6666a18c54fe1d4a36e32",
"score": "0.56851304",
"text": "def optimized_store_to_redis(cache_key, new_state, request)\n request.env[\"CACHE_REDIS_REFLEX\"] ||= []\n return if request.env[\"CACHE_REDIS_REFLEX\"].include?(cache_key)\n request.env[\"CACHE_REDIS_REFLEX\"].push(cache_key)\n\n save_to_redis(cache_key, new_state)\n end",
"title": ""
},
{
"docid": "e393dbed6cdff72ab2282935154a7aea",
"score": "0.56731206",
"text": "def associate!\n self.attributes.select { |k,v| k =~ /_id$/ }.each do |key, id|\n name = key.to_s.gsub(\"_id\", \"\")\n metaclass.send(:define_method, name) { |reload=false| fetch(name, id, reload) }\n end\n end",
"title": ""
},
{
"docid": "a874449021e792d1208e6151413ff835",
"score": "0.5666604",
"text": "def cache_key\n new_record = @new_record\n @new_record = false if @simply_versioned_version_model\n super\n ensure\n @new_record = new_record if @simply_versioned_version_model\n end",
"title": ""
},
{
"docid": "7c0ab2e156a43dde370f00f3577be672",
"score": "0.5653799",
"text": "def cache_record(options = {})\n options = { :force => false }.merge(options)\n key = options.delete(:key) || self.class.cache_id(self.id)\n Rails.cache.fetch(key, options){ self } unless self.new_record?\n end",
"title": ""
},
{
"docid": "a95e2fc96bd5a6d1d1b0dd29be5d3aad",
"score": "0.5647773",
"text": "def add(key)\n \n end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.56462353",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "f3c5715d1dcb8c3afe4d35c1dd12bd4b",
"score": "0.5645514",
"text": "def memory_cache_key\n \"#{self.class.memory_cache_key}:#{self.id}\"\n end",
"title": ""
},
{
"docid": "c961ccf72c8a6ddcdf9c765c80ecacdb",
"score": "0.5634181",
"text": "def memcache_key_object\n @m_k_o ||= MemcacheKey.new('workflow.by_client')\n end",
"title": ""
},
{
"docid": "9a528c22e68878a394d5b80ffbd21929",
"score": "0.56315875",
"text": "def controller_cache_add_model_query_key(parts, record_or_scope, options)\r\n query_key = controller_cache_model_query_key(record_or_scope, options)\r\n if query_key.include?(nil)\r\n # If the query_key has a nil value (e.g. no records created yet), try calling\r\n # the json method to see if it populates the records.\r\n options[:json] = controller_call_json_method(record_or_scope, options)\r\n query_key = controller_cache_model_query_key(record_or_scope, options)\r\n end\r\n raise_controller_cache_error \"query_key has a nil value #{query_key.inspect}.\" if query_key.include?(nil)\r\n controller_cache_convert_timestamp_to_keys(parts, query_key)\r\n end",
"title": ""
},
{
"docid": "91c80742afdced7a6c17546805abd5cc",
"score": "0.56213945",
"text": "def cache_key(load_key)\n load_key\n end",
"title": ""
},
{
"docid": "776a8827124e27e76f852544711b1f7b",
"score": "0.56193167",
"text": "def __redis_key\n \"#{self.class.model_name.plural}:#{self.id}\"\n end",
"title": ""
},
{
"docid": "a0e18aba38c258a7c808eb0d67f9af0a",
"score": "0.5610324",
"text": "def cache_key\n object_cache_key = (object.respond_to?(:cache_key) ? object.cache_key : object)\n [self.class.name, object_cache_key, options_cache_key(options)]\n end",
"title": ""
},
{
"docid": "aaf46a2fd9d831b4a4b0a8b918433d91",
"score": "0.56052583",
"text": "def add_attributes(hash)\n hash.each_pair do |k,v|\n k = k.to_sym\n #raise DuplicateAttribute.new(\"#{k}\") unless (k == :id or !self.respond_to?(k))\n if k == :id or !self.respond_to?(k)\n @cached_attrs[k] = v\n meta = class << self; self; end\n meta.send(:define_method, k) { @cached_attrs[k] }\n meta.send(:define_method, \"#{k}=\") do |new_value| \n @cached_attrs[k] = new_value.is_a?(RedisRecord::Model) ? new_value.id : new_value\n @stored_attrs.delete(k)\n end\n end\n end\n hash\n end",
"title": ""
},
{
"docid": "c81b6e5603f3e9669696fcf321111d1b",
"score": "0.560218",
"text": "def add_keys(key)\n @keys.add_keys(key)\n end",
"title": ""
},
{
"docid": "62e28c6233df338ce9d2bf8a0a65b5d9",
"score": "0.55999964",
"text": "def model_key\n @model_key ||= self.class.model_name.cache_key\n end",
"title": ""
},
{
"docid": "6663678e76125fb9d9d9e6a41719b823",
"score": "0.55977887",
"text": "def << assoc\n mutex.synchronize do\n associations.add? assoc\n end\n end",
"title": ""
},
{
"docid": "c36b3706b12c14e9dba4fcbad6c1ce2e",
"score": "0.5593821",
"text": "def cache_key\n end",
"title": ""
},
{
"docid": "2cf968247e3e30f47b1fe9c1195dd4c6",
"score": "0.55899364",
"text": "def add(key, value)\n if @hash.key?(attr_key)\n raise DuplicateKey, 'The key #{attr_key} already exists'\n end\n @hash[key] = value\n end",
"title": ""
},
{
"docid": "781840b457ca04fc0e7472ef517daee2",
"score": "0.5571823",
"text": "def model_key\n @model_cache_key ||= \"#{self.class.model_name.cache_key}\"\n end",
"title": ""
},
{
"docid": "6642cfa6177f03e642a2645909554fea",
"score": "0.556411",
"text": "def add_to_cache(obj)\n\t\t@cache[@cache_ptr] = obj\n\t\t@cache_ptr += 1\n\t\t@cache_ptr %= @cache_size\n\tend",
"title": ""
}
] |
1f04e347358286c87383ba6bfb7951b0
|
convert ruby arguments array to corresponding UMI values
|
[
{
"docid": "50082642aa08123f907efc565b490e6d",
"score": "0.0",
"text": "def prepare_args args\n raise \"pp bug\" if args == [:pretty_print] # this often happens while tracing\n args.map {|x| prepare x}\n end",
"title": ""
}
] |
[
{
"docid": "2584f825366a8cce53638bb44786da04",
"score": "0.7075173",
"text": "def convert_args(args); end",
"title": ""
},
{
"docid": "e75a4b54009c23a197a3f85e6e4e26f5",
"score": "0.6500787",
"text": "def normalize_arguments(args)\n args\n end",
"title": ""
},
{
"docid": "3ceb043890ad991fa5fc4186aca37744",
"score": "0.6332073",
"text": "def process_raw_arguments(args)\r\n @arguments = []\r\n\r\n args.each_with_index do |arg, i|\r\n parts = arg.split('=')\r\n\r\n if parts.length == 1\r\n @arguments[i] = arg\r\n elsif parts.length == 2\r\n @arguments[parts[0].gsub(/[^0-9]/, '').to_i] = parts[1]\r\n else\r\n puts \"Could not process argument #{arg}\"\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "602b554ca696a6a1457eff704357172b",
"score": "0.622051",
"text": "def __normalized_args__(args)\n args.map do |arg|\n case arg\n when ::Symbol\n arg.to_s\n else\n arg\n end\n end\n end",
"title": ""
},
{
"docid": "378f90f1d14ead3728a250bbb3bb74c9",
"score": "0.61811364",
"text": "def to_args; end",
"title": ""
},
{
"docid": "0695af3822802891fbb0f18f743214c0",
"score": "0.61506313",
"text": "def preprocess_arguments(args)\n args\n end",
"title": ""
},
{
"docid": "0695af3822802891fbb0f18f743214c0",
"score": "0.61506313",
"text": "def preprocess_arguments(args)\n args\n end",
"title": ""
},
{
"docid": "1f3d344c8c3102d95255bccdfae6c5e4",
"score": "0.61181265",
"text": "def prepare_args(args)\n args = args.call if args.respond_to?(:call)\n Array(args)\n end",
"title": ""
},
{
"docid": "f75807151de942aabe9f7bea78ca9843",
"score": "0.60790634",
"text": "def create_args(opc, args)\n res = \"\"\n args.each_with_index do |arg, i| \n if [REGISTER, MEMORY].include? @ops[opc].args[i]\n res << [arg.to_i(16)].pack(\"S\") # pack for 16 bit if register address\n elsif [ADDRESS, VALUE].include? @ops[opc].args[i]\n res << [arg.to_i(16)].pack(\"Q\") # pack for 64 bit if adress or value\n end\n end\n res\nend",
"title": ""
},
{
"docid": "54ccdd33df35582ed4affef203b367e6",
"score": "0.59739685",
"text": "def generic_args\n @arguments.map &:first\n end",
"title": ""
},
{
"docid": "b39b3c3cea47cedf2eb64506bbf3a96e",
"score": "0.59247744",
"text": "def map_args(args, scope, undef_value)\n args.map {|a| convert(a, scope, undef_value) }\n end",
"title": ""
},
{
"docid": "a46aa422e03036955bd614862a072562",
"score": "0.5918856",
"text": "def argument_values\n @arguments.map { |arg| arg.value }\n end",
"title": ""
},
{
"docid": "04914078cb5ff72b7d8d2e39c159059a",
"score": "0.59033704",
"text": "def instancize args\n args.to_a.map do |arg|\n if arg.kind_of? Array\n eval(arg[0]).find(arg[1]) rescue arg\n else\n arg\n end\n end\n end",
"title": ""
},
{
"docid": "72d3c42847f89433025fb03a4910018c",
"score": "0.5889498",
"text": "def to_value(args); end",
"title": ""
},
{
"docid": "4e709cdae706da4d9b1ff10aa83864c1",
"score": "0.5878756",
"text": "def args\n res = remoting_args.has_key?('args') ? remoting_args['args'] : remoting_args\n res.is_a?(Array) ? res : [res].compact # need to wrap into array to normalize\n end",
"title": ""
},
{
"docid": "0afb1787819ac5e1660a9510e83bad84",
"score": "0.58582693",
"text": "def arguments_to_a args\n res = Array.new(l=args.length)\n l.times { |n| res[n] = args[n] }\n res\n end",
"title": ""
},
{
"docid": "e2cba428bc8fe1656ea0d9300ede0ae5",
"score": "0.58580613",
"text": "def attributes_to_args(attributes)\n attributes.map do |attribute, value|\n \"#{attribute}=#{value}\"\n end\n end",
"title": ""
},
{
"docid": "701bb891971bb0749d109ac0e98d112d",
"score": "0.5830208",
"text": "def values(args={})\n each(args).to_a()\n end",
"title": ""
},
{
"docid": "49ad376d34fdf42d35eee2dfea775fc6",
"score": "0.5827515",
"text": "def arguments=(_arg0); end",
"title": ""
},
{
"docid": "a87a687436ac1e841e4da8d473978f90",
"score": "0.5826916",
"text": "def get_arg_values(arg_nodes)\n arg_nodes.map { |arg_node| arg_node.to_a.first }\n end",
"title": ""
},
{
"docid": "f235105cdfc94eb4be989ca50e6b34b6",
"score": "0.5804199",
"text": "def values=(_arg0); end",
"title": ""
},
{
"docid": "f235105cdfc94eb4be989ca50e6b34b6",
"score": "0.5804199",
"text": "def values=(_arg0); end",
"title": ""
},
{
"docid": "f235105cdfc94eb4be989ca50e6b34b6",
"score": "0.5804199",
"text": "def values=(_arg0); end",
"title": ""
},
{
"docid": "f235105cdfc94eb4be989ca50e6b34b6",
"score": "0.5804199",
"text": "def values=(_arg0); end",
"title": ""
},
{
"docid": "f235105cdfc94eb4be989ca50e6b34b6",
"score": "0.5804199",
"text": "def values=(_arg0); end",
"title": ""
},
{
"docid": "f235105cdfc94eb4be989ca50e6b34b6",
"score": "0.5804199",
"text": "def values=(_arg0); end",
"title": ""
},
{
"docid": "1035db692db135f93fee573d964d534a",
"score": "0.57897264",
"text": "def convert_args(args)\n args.map { |e| \n /^\\d+$/.match(e) ? Integer(e) : e }\n end",
"title": ""
},
{
"docid": "7b4abbc6b2d3be5462ba06ff45d9b97e",
"score": "0.5786633",
"text": "def fixup_values!(args)\r\n if args.is_a?(Array) \r\n args.flatten!\r\n args.reject!(&:blank?)\r\n args.map!(&:strip)\r\n args.uniq!\r\n end\r\n end",
"title": ""
},
{
"docid": "3361bee71e2a65287b7bd68898a0b7ff",
"score": "0.57643586",
"text": "def convert_args(iargs)\n args = HashWithIndifferentAccess.new\n iargs.each do |a|\n args[a[0]] = convert_args_node(a[1])\n end\n args\n end",
"title": ""
},
{
"docid": "4654f6ec16a2ff00e5e6cd971386a142",
"score": "0.5748059",
"text": "def resolve_args(args); end",
"title": ""
},
{
"docid": "b82fdd1c5fdcae622ded04bb02846d22",
"score": "0.57332605",
"text": "def cli_arguments=(_arg0); end",
"title": ""
},
{
"docid": "4f250f33da40fa36ccdb25ef6f6c201e",
"score": "0.57330036",
"text": "def serialize_args(arg_container)\n arg_items = arg_container.map(&:to_arg)\n arg_items = arg_items.compact\n arg_items.join(\", \")\n end",
"title": ""
},
{
"docid": "158564d2159542ef42f5f246c61c0d91",
"score": "0.5730053",
"text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "4eb5092d1b877ac81ed45e4500d3bd07",
"score": "0.5715391",
"text": "def fetch_args(cmd)\n idx = cmd.index(inst)\n cmd = cmd[0...cmd.rindex('#')] if cmd.rindex('#')\n args = cmd[idx + inst.size..-1].split(',')\n raise ArgumentError, \"Incorrect argument number in #{cmd}, expect: #{argc}\" if argc >= 0 && args.size != argc\n args.map do |arg|\n arg.gsub(/QWORD|DWORD|WORD|BYTE|PTR/, '').strip\n end\n end",
"title": ""
},
{
"docid": "b91489fedf9922bacb63139393044b88",
"score": "0.5707371",
"text": "def to_args(value)\n [key(value).to_s, value(value).to_s]\n end",
"title": ""
},
{
"docid": "b1d19ddf6779e0e48db674a218a23c5a",
"score": "0.5705026",
"text": "def args\n return @args.to_s if @mode == :array\n\n @args.join(' ')\n end",
"title": ""
},
{
"docid": "67b4c896b0a22d99dea7eca9e6d26824",
"score": "0.5700048",
"text": "def arguments args_list\n size = args_list.count(',') + 1\n Array.new(size).map_with_index{ |not_important, i|\n (i+10).to_s 36\n }.join(', ')\nend",
"title": ""
},
{
"docid": "5de5eda00c723aad123fbb08000b1d11",
"score": "0.5687872",
"text": "def prepare_array_args(args)\n res = []\n args.each do |item|\n res << prepare_args(item)\n end\n return res\n end",
"title": ""
},
{
"docid": "bf56116d78735016aa167a203f8b575a",
"score": "0.5677607",
"text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n args\n end",
"title": ""
},
{
"docid": "c0bbd1f58466c9fe195e21240ecde6c7",
"score": "0.56771773",
"text": "def argument_collector item\n arr = []\n arr << item['name']\n item['msr'].each {|el| arr << el['val'].to_i}\n arr << arr.last(3).reduce(:+)\n arr\n end",
"title": ""
},
{
"docid": "3ec7366d5a419bf323c88a4ee18bd93f",
"score": "0.56700504",
"text": "def prepare(x)\n # p [:pre, x]\n if x.respond_to?(:_as_umi_arg)\n # p [\"uniarg\"]\n x._as_umi_arg(self)\n else\n case x\n when Array\n # deep convert all array items\n x.map {|a| prepare a}\n when Set\n # Make a Java Set\n r = call(\"instantiate\", \"Set\", x.to_a.map {|i| i._as_umi_arg(self)})\n # Ref will garbage collect it\n Ref.new(self, r)\n # but we need a ref struct only:\n r\n when Time\n {__type: 'unixtime', seconds: x.to_i}\n when String\n x.encoding == Encoding::BINARY ? {__type: 'binary', base64: Base64.encode64(x)} : x\n when Ref\n # p [:ref]\n x._as_umi_arg(self)\n when RemoteAdapter\n # p [:ra, x.__getobj__._as_umi_arg(self)]\n # this need special treatment with direct call:\n x.__getobj__._as_umi_arg(self)\n when Hash\n # p [:hash]\n result = {}\n x.each {|k, v| result[k] = prepare(v)}\n result\n else\n x\n end\n end\n end",
"title": ""
},
{
"docid": "06bbe5a9d56a924d564be33fbd657966",
"score": "0.5661638",
"text": "def normalize_method_args(method, args); end",
"title": ""
},
{
"docid": "06bbe5a9d56a924d564be33fbd657966",
"score": "0.5661638",
"text": "def normalize_method_args(method, args); end",
"title": ""
},
{
"docid": "795dcfe34a5ad539f1837099a4651677",
"score": "0.5660822",
"text": "def argument_enum() @argument_type.values end",
"title": ""
},
{
"docid": "f3d8c569d58aa049c04e614451b269a5",
"score": "0.5656328",
"text": "def arg_types\n args.map(&:first).map {|x| x.is_a?(Array) ? x.first : x }.compact\n end",
"title": ""
},
{
"docid": "db1974b6bf0e6eecbe5464cf7157b264",
"score": "0.5640821",
"text": "def to_args(hash)\n\t\targ=hash.inject(''){|o,e| o+=\"#{e[0]}=#{quote(e[1])},\"}[0...-1]\n\tend",
"title": ""
},
{
"docid": "27061cdcd0b820d13f036d52a218b252",
"score": "0.5635935",
"text": "def _reduce_232(val, vofs)\n\t\t # \"call_args: command\" \n warning( \"parenthesize argument(s) for future version\")\n # result = s(:array, val_[0])\n result = RubyRpCallArgs.s( val[vofs ])\n \n result\nend",
"title": ""
},
{
"docid": "596c19977a663d811379b1841063e692",
"score": "0.5634371",
"text": "def arg_array(arg)\n (arg.include?(',') ? arg.split(/,/) : arg.split).each{|_arg| _arg.strip!}\n end",
"title": ""
},
{
"docid": "86a26be0f6860433ba2a74c983f0c9c0",
"score": "0.56288195",
"text": "def arguments(model)\n #list of arguments as they will appear in the interface. They are available in the run command as\n @argument_array_of_arrays = [\n [ \"variable_name\", \"type\", \"required\", \"model_dependant\", \"display_name\", \"default_value\", \"min_value\", \"max_value\", \"string_choice_array\", \t\"os_object_type\"\t],\n [ \"idf_file_path\", \"STRING\", true, false, \"IDF File Path\", nil, nil, nil, nil, \t nil\t\t\t\t\t],\n ]\n #set up arguments. \n args = OpenStudio::Ruleset::OSArgumentVector.new\n self.argument_setter(args)\n return args\n end",
"title": ""
},
{
"docid": "86a26be0f6860433ba2a74c983f0c9c0",
"score": "0.56285214",
"text": "def arguments(model)\n #list of arguments as they will appear in the interface. They are available in the run command as\n @argument_array_of_arrays = [\n [ \"variable_name\", \"type\", \"required\", \"model_dependant\", \"display_name\", \"default_value\", \"min_value\", \"max_value\", \"string_choice_array\", \t\"os_object_type\"\t],\n [ \"idf_file_path\", \"STRING\", true, false, \"IDF File Path\", nil, nil, nil, nil, \t nil\t\t\t\t\t],\n ]\n #set up arguments. \n args = OpenStudio::Ruleset::OSArgumentVector.new\n self.argument_setter(args)\n return args\n end",
"title": ""
},
{
"docid": "beaa0e9820c95d7df905f9f74ccbc0ca",
"score": "0.5627689",
"text": "def transformed_argname; end",
"title": ""
},
{
"docid": "beaa0e9820c95d7df905f9f74ccbc0ca",
"score": "0.5627689",
"text": "def transformed_argname; end",
"title": ""
},
{
"docid": "9a5fbb955bd29e9a1c75d7196d776bc7",
"score": "0.5620769",
"text": "def Args(parts); end",
"title": ""
},
{
"docid": "9a4708b3fb6165f5109a98d693196748",
"score": "0.5618085",
"text": "def parse_args(args); end",
"title": ""
},
{
"docid": "3bb84bb4874a315a5b2c80422f645564",
"score": "0.56174433",
"text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n\n return args\n end",
"title": ""
},
{
"docid": "3bb84bb4874a315a5b2c80422f645564",
"score": "0.56174433",
"text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n\n return args\n end",
"title": ""
},
{
"docid": "3bb84bb4874a315a5b2c80422f645564",
"score": "0.56174433",
"text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n\n return args\n end",
"title": ""
},
{
"docid": "3bb84bb4874a315a5b2c80422f645564",
"score": "0.56174433",
"text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n\n return args\n end",
"title": ""
},
{
"docid": "583b919ba5af7ca1eee5dbeaf2321740",
"score": "0.56152284",
"text": "def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "76bd9ccbd10ae08c8c16c8d6b4a9b6c3",
"score": "0.5603781",
"text": "def arg_names; end",
"title": ""
},
{
"docid": "d22a3f8fbb19a939490d9a8864ba889c",
"score": "0.55900574",
"text": "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n # this measure does not require any user arguments, return an empty list\n return args\n end",
"title": ""
},
{
"docid": "ee6969bfa6e354fab6d5e5952f517999",
"score": "0.55693144",
"text": "def in_out_args; [[\"count\", Cmpi::uint32, \"str\", Cmpi::string],[Cmpi::uint32, \"result\", Cmpi::string]] end",
"title": ""
},
{
"docid": "fb11bb88dba5a6b43289359321e0b531",
"score": "0.5564689",
"text": "def args\n @arg_names.empty? ? @args.values : @args\n end",
"title": ""
},
{
"docid": "863f073be2fc6a87ee85f4165fac9625",
"score": "0.556218",
"text": "def collated_arguments\n self.mapr do |results|\n args = results.to_a.reduce({args: [], keyword_args: {}}) do |a, (kind, value, value2, *)|\n case kind\n when :arg\n a[:args] << value\n when :keyword_arg\n a[:keyword_args][value] = value2\n end\n\n a\n end\n\n Single(args)\n end\n end",
"title": ""
},
{
"docid": "863f073be2fc6a87ee85f4165fac9625",
"score": "0.556218",
"text": "def collated_arguments\n self.mapr do |results|\n args = results.to_a.reduce({args: [], keyword_args: {}}) do |a, (kind, value, value2, *)|\n case kind\n when :arg\n a[:args] << value\n when :keyword_arg\n a[:keyword_args][value] = value2\n end\n\n a\n end\n\n Single(args)\n end\n end",
"title": ""
},
{
"docid": "89c6937b83c1d40f01d5d65c9af3af68",
"score": "0.5560032",
"text": "def parse_args(args)\n [args.shift, args.shift]\n end",
"title": ""
},
{
"docid": "1aacea757e924afab8f41d4a8b0a5987",
"score": "0.555682",
"text": "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n return args\n end",
"title": ""
},
{
"docid": "9e3ba7ad556a59d84543af6453d458ba",
"score": "0.5555608",
"text": "def argv_to_ffi\n array_to_ffi(ARGV)\n end",
"title": ""
},
{
"docid": "37d39970de09691562f6b9d6c329002f",
"score": "0.55498195",
"text": "def arglists\n end",
"title": ""
},
{
"docid": "2ceff1bdec71239ec238d699ac4c12e4",
"score": "0.5548028",
"text": "def sub_args(job,a)\n a.map do |e| \n begin\n case e.to_s\n when '__job__'\n job\n when '__params__'\n @params\n when '__self__'\n self\n else\n e\n end\n # For the unfortunate case where e doesn't handle to_s nicely.\n # On the other hand I dare someone to find something that can be marshaled,\n # but doesn't do #to_s.\n rescue NoMethodError=>err\n raise err unless err.message =~ /\\`to_s\\'/\n e\n end #begin\n end# map\n end",
"title": ""
},
{
"docid": "e2449bf9642a95a4859a479b638920cd",
"score": "0.55436665",
"text": "def argument_list; end",
"title": ""
},
{
"docid": "e2449bf9642a95a4859a479b638920cd",
"score": "0.55436665",
"text": "def argument_list; end",
"title": ""
},
{
"docid": "e2449bf9642a95a4859a479b638920cd",
"score": "0.55436665",
"text": "def argument_list; end",
"title": ""
},
{
"docid": "e2449bf9642a95a4859a479b638920cd",
"score": "0.55436665",
"text": "def argument_list; end",
"title": ""
},
{
"docid": "d6d86ad52205b7055d3a262ff8efceb4",
"score": "0.55329627",
"text": "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n args\n end",
"title": ""
},
{
"docid": "61163f125ba4317426b0226296d6a371",
"score": "0.5527276",
"text": "def arguments(model) # rubocop:disable Lint/UnusedMethodArgument\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "16ee1b66a5a2ffa7204e56119fba741d",
"score": "0.550991",
"text": "def serialize_args(arg_list)\n (arg_list.map { |item| \"\\'#{item}\\'\"}).join(\", \")\n end",
"title": ""
},
{
"docid": "c19de671d5619020142666533f52d4b7",
"score": "0.5507596",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # make a string argument for door u-factor\n ufactor = OpenStudio::Measure::OSArgument::makeDoubleArgument('ufactor', true)\n ufactor.setDisplayName('U-Factor')\n ufactor.setUnits('Btu/hr-ft^2-R')\n ufactor.setDescription('The heat transfer coefficient of the doors adjacent to finished space.')\n ufactor.setDefaultValue(0.2)\n args << ufactor\n\n return args\n end",
"title": ""
},
{
"docid": "57cffa4203db85f78b1f91b4bf1c8928",
"score": "0.55062836",
"text": "def test_simple_arguvia_members\n @simple_strs.each do |name|\n assert(eval(\"@simple_args.#{name.gsub(/-+/, \"_\")}\"))\n end\n end",
"title": ""
},
{
"docid": "e64ee341aefb85ea59c76b8aabf60b39",
"score": "0.5503425",
"text": "def process arg_array\n # account for *#n \"repeat n times\"\n arg_array = Parser.add_repeated_args(arg_array)\n Parser.interpret_args(arg_array)\nend",
"title": ""
},
{
"docid": "cea100095839537f62e41afd6892da3a",
"score": "0.5499382",
"text": "def usage_string_args\n args.map(&:usage_string)\n end",
"title": ""
},
{
"docid": "52b8cdb439c5bf03085f89c467b724a7",
"score": "0.5491787",
"text": "def resolve_args(target)\n if (ar = target.arity) > 0\n args = []\n ar.times do |i|\n args << \"param#{i}\"\n end\n args = args.join(\", \")\n elsif ar == 0\n args = \"\"\n else\n args = \"*args\"\n end\n\n return args\n end",
"title": ""
},
{
"docid": "aca05ddf6950d790d5512ab07df9bafe",
"score": "0.54895765",
"text": "def setup_arguments( arguments )\n arguments_with_probe( arguments ).map do |argument|\n setup_argument( arguments, argument )\n end \n end",
"title": ""
},
{
"docid": "869b062ab5fd53bd1e16b5090297cc55",
"score": "0.54882205",
"text": "def arguments\n ArgumentArray.new(@raw_arguments).freeze\n end",
"title": ""
},
{
"docid": "fa30d4f8916b208e0fd4eeba1ad56b0f",
"score": "0.5482192",
"text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n # this measure does not require any user arguments, return an empty list\n\n return args\n end",
"title": ""
},
{
"docid": "7282abf1c7a3eecfee8665d930d256c9",
"score": "0.5481499",
"text": "def _reduce_230(val, vofs)\n\t\t # call_args: command\n warning( \"parenthesize argument(s) for future version\")\n # result = s(:array, val_[0])\n result = RubyRpCallArgs.s( val[vofs ])\n \n result\nend",
"title": ""
},
{
"docid": "a658352bc312dcc5a91b1294d69ece4b",
"score": "0.5480439",
"text": "def preprocess_arguments(args)\n args.unshift(nil) if args.length <= 1 # add the ip address to the front\n args\n end",
"title": ""
},
{
"docid": "4384e5eb99387c3d5d5b354db6258693",
"score": "0.5477512",
"text": "def hash2args(hash, mapping=self.class.attribute_mapping_to)\n return \"\" unless hash \n arg_list = []\n hash.each {|key, val|\n arg_list += self.get_arguments(key, val, mapping, hash)\n }\n arg_list\n end",
"title": ""
},
{
"docid": "82a5f1e2681d72d8acd3cb3d17ecfdba",
"score": "0.5471152",
"text": "def classify_arguments(argv)\n hash = argv.group_by do |arg|\n if arg[0] == \"+\"\n :plus_options\n else\n :filenames\n end\n end\n\n %i[filenames plus_options].map { |key| Array(hash[key]) }\n end",
"title": ""
},
{
"docid": "e059a5182aa6d507d34b03e000f075c4",
"score": "0.5467416",
"text": "def rb_build_args(mne, tokens, field_format)\n args_a = []\n\n tokens.each{|t|\n\n if (field_format.include?(t))\n pc = field_format[t][1]\n field_args = pc ? \"pc,op\" : \"op\"\n args_a << \"get#{t}(#{field_args})\"\n end\n }\n\n return args_a\nend",
"title": ""
},
{
"docid": "0c0822f0481901aa7862f722805edcab",
"score": "0.54627866",
"text": "def Ω\n @argsrc.args\n end",
"title": ""
},
{
"docid": "e1e34375f452dc350d801624bf71fd2f",
"score": "0.54604924",
"text": "def do_convert(args, model) \n #puts 'array', args\n if args.is_a? (Array)\n array = []\n args.try(:each) do |arg|\n array << convert_type( arg, model )\n end\n array\n else\n puts 'object'\n convert_type( args, model ) \n end\n end",
"title": ""
},
{
"docid": "d70bd180d14c2623373a395b22faaf99",
"score": "0.5459897",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n\t# make an argument insulation R-value\n r_value_mult = OpenStudio::Measure::OSArgument.makeDoubleArgument('r_value_mult', true)\n r_value_mult.setDisplayName('Slab total R-value multiplier')\n r_value_mult.setDefaultValue(1)\n args << r_value_mult\n\n thermal_mass_mult = OpenStudio::Measure::OSArgument.makeDoubleArgument('thermal_mass_mult', true)\n thermal_mass_mult.setDisplayName('Slab thermal mass multiplier')\n thermal_mass_mult.setDefaultValue(1)\n args << thermal_mass_mult\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
},
{
"docid": "a248280497564789129e995799f9569c",
"score": "0.54593205",
"text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end",
"title": ""
}
] |
51607d2596318dea477baec08c413cd3
|
GET /mortgages/new GET /mortgages/new.xml
|
[
{
"docid": "209239bf9bbea566ca0b56ce10b1f4e8",
"score": "0.77686316",
"text": "def new\n @mortgage = Mortgage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mortgage }\n end\n end",
"title": ""
}
] |
[
{
"docid": "fc574616f398e88fb1ff5151b1c30d09",
"score": "0.72291386",
"text": "def new\n @mileage = Mileage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mileage }\n end\n end",
"title": ""
},
{
"docid": "06073a6bf509f8a83e7110654bc34060",
"score": "0.7211224",
"text": "def create\n @mortgage = Mortgage.new(params[:mortgage])\n\n respond_to do |format|\n if @mortgage.save\n flash[:notice] = 'Mortgage was successfully created.'\n format.html { redirect_to(@mortgage) }\n format.xml { render :xml => @mortgage, :status => :created, :location => @mortgage }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mortgage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c346af1b7db6c24af37d0f36031d2b8",
"score": "0.7090112",
"text": "def new\n @machine_mileage = MachineMileage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @machine_mileage }\n end\n end",
"title": ""
},
{
"docid": "f35bafec41c2ab55022bbcbeda7ad056",
"score": "0.6992383",
"text": "def new\n @gemm = Gemm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gemm }\n end\n end",
"title": ""
},
{
"docid": "811056f96bec55319d322279bf70b278",
"score": "0.6873064",
"text": "def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @village }\n end\n end",
"title": ""
},
{
"docid": "811056f96bec55319d322279bf70b278",
"score": "0.6873064",
"text": "def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @village }\n end\n end",
"title": ""
},
{
"docid": "811056f96bec55319d322279bf70b278",
"score": "0.6873064",
"text": "def new\n @village = Village.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @village }\n end\n end",
"title": ""
},
{
"docid": "5169f19539c4aad881bb0335baeac343",
"score": "0.6810145",
"text": "def new\n @goal = Mg::Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @goal }\n end\n end",
"title": ""
},
{
"docid": "34d3adcba949c0b8bdadf2227ed6600c",
"score": "0.6801324",
"text": "def new\n @population = Population.new(:access_level => 'creator')\n session[:breadcrumbs].add \"New\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @population }\n end\n end",
"title": ""
},
{
"docid": "32d23e457194194ed523de156ee89693",
"score": "0.6800166",
"text": "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"title": ""
},
{
"docid": "8c9a9e435910c5c236309542ea5c3409",
"score": "0.6782757",
"text": "def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lore }\n end\n end",
"title": ""
},
{
"docid": "1f3bcc0999d246a1ee32f0e1cbafe472",
"score": "0.6773686",
"text": "def new\n @testament = Testament.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @testament }\n end\n end",
"title": ""
},
{
"docid": "f3b1e6ee12a73ca28bd6bdb3f0056519",
"score": "0.6756602",
"text": "def new\n @plantilla = Plantilla.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plantilla }\n end\n end",
"title": ""
},
{
"docid": "859459e3e44856cdeaa7fc08f1616ddb",
"score": "0.674786",
"text": "def new\n @dosage = Dosage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dosage }\n end\n end",
"title": ""
},
{
"docid": "b28b4baf67c41b19866dc1cb101a2fae",
"score": "0.67337346",
"text": "def new\n @tpago = Tpago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tpago }\n end\n end",
"title": ""
},
{
"docid": "1b996ca1520f51d473be189a15f77025",
"score": "0.6729497",
"text": "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lease }\n end\n end",
"title": ""
},
{
"docid": "bfb45e11fd538b553eb134267891f55b",
"score": "0.6727896",
"text": "def new\n @draught = Draught.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @draught }\n end\n end",
"title": ""
},
{
"docid": "26fb83ffd5b6dfcf6e5ffd0e12f1fbca",
"score": "0.6724337",
"text": "def new\n @giving_group = GivingGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @giving_group }\n end\n end",
"title": ""
},
{
"docid": "9f0e0b9e15e12551edfb74be3df6ec33",
"score": "0.67080766",
"text": "def new\n @ministries = Ministries.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ministries }\n end\n end",
"title": ""
},
{
"docid": "da9386683a03140c0a6fb19108098932",
"score": "0.67059654",
"text": "def new\n @imovel = Imovel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @imovel }\n end\n end",
"title": ""
},
{
"docid": "f66ed07591e7e9cce0a682f489879cb1",
"score": "0.67041284",
"text": "def new\n @page = Page.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "3518f067b6a4bba3771541665c70a43f",
"score": "0.67008525",
"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": "a68ffbb2eed0475edf94a5897e7a3800",
"score": "0.66991735",
"text": "def new\n expire_page :action => :index\n expire_page :action => :show\n \n @ganglia_graph = GangliaGraph.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ganglia_graph }\n end\n end",
"title": ""
},
{
"docid": "3959aaff19204aae6fad2635ef30ef6f",
"score": "0.66988456",
"text": "def new\n @p_stat = PStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @p_stat }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6698839",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6698839",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6698839",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6698839",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6698839",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6698839",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "e8dd9b6668a72a8332673f57bd8a2999",
"score": "0.6693774",
"text": "def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end",
"title": ""
},
{
"docid": "80c95e7f1be4c16ca44ef25cc0b2a6a8",
"score": "0.66930515",
"text": "def new\n @incentive = Incentive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incentive }\n end\n end",
"title": ""
},
{
"docid": "0ebd5408dd4a118a08291d4715074a02",
"score": "0.6683923",
"text": "def new\n @gallion = Gallion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallion }\n end\n end",
"title": ""
},
{
"docid": "c9fd0c87e33e80e3f00f7e890999c98a",
"score": "0.66737473",
"text": "def new\n new_prc\n\n setup_campuses_and_semesters\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prc }\n end\n end",
"title": ""
},
{
"docid": "aafce46fd8ae3038da7eb4511b92a69f",
"score": "0.66719985",
"text": "def new\n @venture = Venture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venture }\n end\n end",
"title": ""
},
{
"docid": "6f36dc6f50f773cf0e614bcb18665001",
"score": "0.66676944",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n \n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "59bd8270ee9a1a7db082a4a68b3884af",
"score": "0.6664723",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "df71876c603cb1bc2cf913b781a4c407",
"score": "0.6663584",
"text": "def new\n @boss = Boss.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boss }\n end\n end",
"title": ""
},
{
"docid": "d8ea74214e44961b9d0ea299ddf00ae2",
"score": "0.6663064",
"text": "def new\n @pool = Pool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pool }\n end\n end",
"title": ""
},
{
"docid": "52c98a00352d5dc2ef30b76328fa0c6d",
"score": "0.66596496",
"text": "def new\n @ministry = Ministry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ministry }\n end\n end",
"title": ""
},
{
"docid": "61e8a9d7e9b4dc5ef2c68eb2ca47a04c",
"score": "0.66579056",
"text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"title": ""
},
{
"docid": "61e8a9d7e9b4dc5ef2c68eb2ca47a04c",
"score": "0.66579056",
"text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"title": ""
},
{
"docid": "f6e024864529b1d71cf429b05828b33f",
"score": "0.6654255",
"text": "def new\n @newspage = Newspage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspage }\n end\n end",
"title": ""
},
{
"docid": "79e075fca6304213f4239b0b453e9ffd",
"score": "0.66535497",
"text": "def new\n @promos = Promos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @promos }\n end\n end",
"title": ""
},
{
"docid": "8b17fafa96c950a24e39db0fa8e3642b",
"score": "0.66516817",
"text": "def new\n @involvement = Involvement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @involvement }\n end\n end",
"title": ""
},
{
"docid": "d44b55f8876bb87604dd281ac9fa079b",
"score": "0.6644417",
"text": "def new\n @person = Person.new\n @title = \"people\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"title": ""
},
{
"docid": "f0f1b5561b8f398d8f00085382ffff02",
"score": "0.66441286",
"text": "def new\n @feat = @person.feats.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feat }\n end\n end",
"title": ""
},
{
"docid": "7dab762784d82f91ac84cc8cd3f23693",
"score": "0.6640802",
"text": "def new\n @loan = Loan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loan }\n end\n end",
"title": ""
},
{
"docid": "a83173640f77272bfb6f58a0a65c7e67",
"score": "0.6640532",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"title": ""
},
{
"docid": "954e9f5ea15a937fc5a2c89f00b3398b",
"score": "0.6638032",
"text": "def new\n @geoname = Geoname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @geoname }\n end\n end",
"title": ""
},
{
"docid": "29adc5389943c60d6e449e3a65d213f4",
"score": "0.6636795",
"text": "def new\n @page_id = \"opinions\"\n @opinion = Opinion.new\n @agents = Agent.all.collect {|item| [ item.name, item.id ]}\n @services = Service.find(:all).collect {|item| [ item.name, item.id ]}\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @opinion }\n end\n end",
"title": ""
},
{
"docid": "b692fdb86295a7959e006213b58a3325",
"score": "0.6630455",
"text": "def new\n @deposit_threshold = DepositThreshold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @deposit_threshold }\n end\n end",
"title": ""
},
{
"docid": "853cc9b26d5a2fbe48ca477ade2a422b",
"score": "0.66303056",
"text": "def new\n @periode = Periode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @periode }\n end\n end",
"title": ""
},
{
"docid": "a54a04dc8840dfd06097e4dad99c3eed",
"score": "0.66243404",
"text": "def new\n @spend = Spend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spend }\n end\n end",
"title": ""
},
{
"docid": "55d9b6b6f53b9fd7b45063675ebc9da9",
"score": "0.6614805",
"text": "def new\n @pagamento = Pagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagamento }\n end\n end",
"title": ""
},
{
"docid": "75e513744dd23280aaffb8bd048503d5",
"score": "0.66136235",
"text": "def new\n @regiment = Regiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @regiment }\n end\n end",
"title": ""
},
{
"docid": "ef09ca13f6b0b1c917ae8dcab02a64e1",
"score": "0.66063154",
"text": "def new\n @mall = Mall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mall }\n end\n end",
"title": ""
},
{
"docid": "891de094319aafccfac684398597f353",
"score": "0.66000885",
"text": "def new\n @test_plant = TestPlant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @test_plant }\n end\n end",
"title": ""
},
{
"docid": "10c316376ffc7f972e8f9ac7f400c1da",
"score": "0.6593046",
"text": "def new\n @prime = Prime.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prime }\n end\n end",
"title": ""
},
{
"docid": "88babba6248b0adc74559b83e911a650",
"score": "0.6590569",
"text": "def new\n @travel = Travel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel }\n end\n end",
"title": ""
},
{
"docid": "88babba6248b0adc74559b83e911a650",
"score": "0.6590569",
"text": "def new\n @travel = Travel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel }\n end\n end",
"title": ""
},
{
"docid": "f3343cc85d4c6f09efb9c1628336263a",
"score": "0.65902734",
"text": "def new\n @visit_stat = VisitStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visit_stat }\n end\n end",
"title": ""
},
{
"docid": "a33b1c3027f00fe7b632070f0fcb4106",
"score": "0.6588321",
"text": "def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"title": ""
},
{
"docid": "4217805d304f7dd86e0a20a05e9d24dc",
"score": "0.6586164",
"text": "def new\n @progre = Progre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @progre }\n end\n end",
"title": ""
},
{
"docid": "f8f47de1f353646d63982038bb941d2e",
"score": "0.65837693",
"text": "def new\n @pdig = Pdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pdig }\n end\n end",
"title": ""
},
{
"docid": "7abd4982c652a00f2b1a803841c35eec",
"score": "0.6582162",
"text": "def new\n @badge = Badge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @badge }\n end\n end",
"title": ""
},
{
"docid": "98b39f6ec8dbe89850665dfa21559a2c",
"score": "0.6581483",
"text": "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @neighborhood }\n end\n end",
"title": ""
},
{
"docid": "5a14ef88b7002e879059d8b61c1e76ad",
"score": "0.6576097",
"text": "def new\n @estagio = Estagio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagio }\n end\n end",
"title": ""
},
{
"docid": "f65f0186c322b5f181cdccbbc9f4065e",
"score": "0.6567863",
"text": "def new\n @hazard = Hazard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hazard }\n end\n end",
"title": ""
},
{
"docid": "d73cc1d5c15fabbda3978d5435cc6cbf",
"score": "0.65669084",
"text": "def new\n @addition = Addition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @addition }\n end\n end",
"title": ""
},
{
"docid": "de3ffb1dd8089f4850cb4a5e0cba517f",
"score": "0.65649456",
"text": "def new\n @experience = Experience.new(:goal_id => params[:goal_id])\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experience }\n end\n end",
"title": ""
},
{
"docid": "d7c512cfc3f047fd8c271a2c9fb2d830",
"score": "0.65642446",
"text": "def new\n @ptbudget = Ptbudget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptbudget }\n end\n end",
"title": ""
},
{
"docid": "e0a66b081630be8d700533cad4fc27d5",
"score": "0.6558669",
"text": "def new\n @poem = Poem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poem }\n end\n end",
"title": ""
},
{
"docid": "e0a66b081630be8d700533cad4fc27d5",
"score": "0.6558669",
"text": "def new\n @poem = Poem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poem }\n end\n end",
"title": ""
},
{
"docid": "5fec55134337020975b26fef979f9717",
"score": "0.6552711",
"text": "def new\n @provision = Provision.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provision }\n end\n end",
"title": ""
},
{
"docid": "a654cc232cad27c95fd05379896e9340",
"score": "0.6545064",
"text": "def new\n @man = Man.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @man }\n end\n end",
"title": ""
},
{
"docid": "0076ea509ac48eae26f6f7a0442e71d2",
"score": "0.6543324",
"text": "def new\n \n @personnel = Personnel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @personnel }\n end\n end",
"title": ""
},
{
"docid": "dd327213699bd843137c88c1b286748a",
"score": "0.6536814",
"text": "def new\n @viewing = Viewing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @viewing }\n end\n end",
"title": ""
},
{
"docid": "2db0a9ca394d100b060bbb38b9b8eb5f",
"score": "0.6533353",
"text": "def new\n @amount = Amount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @amount }\n end\n end",
"title": ""
},
{
"docid": "3d6bc91f3f2310d0e859c37c35b626e8",
"score": "0.65330315",
"text": "def new\n @lookup_pettracer = LookupPettracer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_pettracer }\n end\n end",
"title": ""
},
{
"docid": "3d6bc91f3f2310d0e859c37c35b626e8",
"score": "0.65328234",
"text": "def new\n @lookup_pettracer = LookupPettracer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_pettracer }\n end\n end",
"title": ""
},
{
"docid": "a090ddaf839578568ed168d021c93cf0",
"score": "0.65306544",
"text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"title": ""
},
{
"docid": "a090ddaf839578568ed168d021c93cf0",
"score": "0.65306544",
"text": "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"title": ""
},
{
"docid": "564a45432a296ceadaba5ec98953a40a",
"score": "0.6529925",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fund_request }\n end\n end",
"title": ""
},
{
"docid": "ad672b1f57a45fe4fab322976ecf50d2",
"score": "0.6528875",
"text": "def new\n @url_migration = UrlMigration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_migration }\n end\n end",
"title": ""
},
{
"docid": "09659b5e0a0b570d5c8019b81ae00efa",
"score": "0.6522656",
"text": "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"title": ""
},
{
"docid": "3f346973580cc431f9af1230d89b90f6",
"score": "0.65212494",
"text": "def new\n @house = House.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @house }\n end\n end",
"title": ""
},
{
"docid": "641d682a14cfa9f38d8a0cf7ba36e986",
"score": "0.6513841",
"text": "def new\n @livingroom = Livingroom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @livingroom }\n end\n end",
"title": ""
},
{
"docid": "8fc6d64b1a96828681cbdfee170a84a2",
"score": "0.6512621",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.json { render json: @page }\n format.xml { render xml: @page }\n end\n end",
"title": ""
},
{
"docid": "ca7301dc298598950f0fd1c513389127",
"score": "0.6511784",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.json {render json: @page}\n format.xml {render xml: @page}\n end\n end",
"title": ""
},
{
"docid": "a6199a2a6546b42c19e28779fb995c63",
"score": "0.65085846",
"text": "def new\n @test = Mg::Test.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @test }\n end\n end",
"title": ""
}
] |
e7dda11f91d7225972604d70e75b404d
|
FIXME: Let configuration handle this
|
[
{
"docid": "7a0fc59c9b03acb2cfb34e649f085029",
"score": "0.0",
"text": "def migrations_path\n migrations = File.expand_path( \"../../../config/migrations\", __FILE__ )\n migrations\n end",
"title": ""
}
] |
[
{
"docid": "37760c3b969c84aec77912c99e5eb92c",
"score": "0.7251871",
"text": "def conf; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.71692675",
"text": "def configuration; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.7149813",
"text": "def config; end",
"title": ""
},
{
"docid": "e144c55fb8680de35acf575932b5572e",
"score": "0.6943004",
"text": "def configurations; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "9ec9e8be938cc4a2f839952195c243ca",
"score": "0.68845147",
"text": "def configure; end",
"title": ""
},
{
"docid": "abf47155aecd3f42d99cad1887f49f7b",
"score": "0.6796125",
"text": "def computed_config; end",
"title": ""
},
{
"docid": "e904438f3b5ab33e4e6380838c842292",
"score": "0.6662111",
"text": "def configure\n end",
"title": ""
},
{
"docid": "f3d02fe7051b45ee2f0cbc63de778efb",
"score": "0.65443933",
"text": "def cfg; end",
"title": ""
},
{
"docid": "f3d02fe7051b45ee2f0cbc63de778efb",
"score": "0.65443933",
"text": "def cfg; end",
"title": ""
},
{
"docid": "0f953667e051256c4a121211eca3daae",
"score": "0.6542966",
"text": "def config() self.class.config; end",
"title": ""
},
{
"docid": "31575c042996826b14c171c0c79c39d1",
"score": "0.6520084",
"text": "def configured()\n end",
"title": ""
},
{
"docid": "07212c6b57ef1316c1a963b5ecd12348",
"score": "0.650226",
"text": "def configuration=(_arg0); end",
"title": ""
},
{
"docid": "07212c6b57ef1316c1a963b5ecd12348",
"score": "0.650226",
"text": "def configuration=(_arg0); end",
"title": ""
},
{
"docid": "07212c6b57ef1316c1a963b5ecd12348",
"score": "0.650226",
"text": "def configuration=(_arg0); end",
"title": ""
},
{
"docid": "07212c6b57ef1316c1a963b5ecd12348",
"score": "0.650226",
"text": "def configuration=(_arg0); end",
"title": ""
},
{
"docid": "07212c6b57ef1316c1a963b5ecd12348",
"score": "0.650226",
"text": "def configuration=(_arg0); end",
"title": ""
},
{
"docid": "07212c6b57ef1316c1a963b5ecd12348",
"score": "0.650226",
"text": "def configuration=(_arg0); end",
"title": ""
},
{
"docid": "17e9f018041d6d0ff616ac08fa8725c6",
"score": "0.646217",
"text": "def configure\n end",
"title": ""
},
{
"docid": "17e9f018041d6d0ff616ac08fa8725c6",
"score": "0.646217",
"text": "def configure\n end",
"title": ""
},
{
"docid": "17e9f018041d6d0ff616ac08fa8725c6",
"score": "0.646217",
"text": "def configure\n end",
"title": ""
},
{
"docid": "a5bd795baee4be9b12889013a9fe7878",
"score": "0.64570725",
"text": "def post_configure\n super\n end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.645354",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.645354",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.645354",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.6444741",
"text": "def _shared_configuration; end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.6444741",
"text": "def _shared_configuration; end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.6444741",
"text": "def _shared_configuration; end",
"title": ""
},
{
"docid": "3c7f9b8051eeb6eb25c4247200464b0b",
"score": "0.6432108",
"text": "def __config\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "77f85f3eb41d054b581971155235e83c",
"score": "0.64226246",
"text": "def config\n raise Error::SubclassResponsibility\n end",
"title": ""
},
{
"docid": "a397e7d70fb46699b1298d584daf15a8",
"score": "0.64173156",
"text": "def config_hook\n end",
"title": ""
},
{
"docid": "305605901d893e36fe63bb24be282f72",
"score": "0.6377407",
"text": "def config=(config); end",
"title": ""
},
{
"docid": "2dc19f7dae1aaaec9cabd467ba68fd9d",
"score": "0.6375908",
"text": "def configure\n ;\n end",
"title": ""
},
{
"docid": "49b0e6ee1d434f7fdec5afd912a33549",
"score": "0.6369115",
"text": "def get_config\n\t\tend",
"title": ""
},
{
"docid": "c68b7edbdff1d068527604b05a84b0ae",
"score": "0.63623625",
"text": "def config=(_arg0); end",
"title": ""
},
{
"docid": "c68b7edbdff1d068527604b05a84b0ae",
"score": "0.63623625",
"text": "def config=(_arg0); end",
"title": ""
},
{
"docid": "c68b7edbdff1d068527604b05a84b0ae",
"score": "0.63623625",
"text": "def config=(_arg0); end",
"title": ""
},
{
"docid": "c68b7edbdff1d068527604b05a84b0ae",
"score": "0.63623625",
"text": "def config=(_arg0); end",
"title": ""
}
] |
e6079b307d089b6393edafce16e2f62a
|
determines if the deck is empty
|
[
{
"docid": "e411922f04c9031e875e675065e32f92",
"score": "0.827869",
"text": "def empty?\n @cards.empty?\n end",
"title": ""
}
] |
[
{
"docid": "8f42e19e4a55d7fdc5428527b915f94a",
"score": "0.83662486",
"text": "def is_empty?\n return cards.length <= 0\n end",
"title": ""
},
{
"docid": "303d7b4f642f7b43429af21a5fe25b29",
"score": "0.8340822",
"text": "def empty?\n cards.empty?\n end",
"title": ""
},
{
"docid": "9d8c3ac0e040e3cd2386cafcd7594514",
"score": "0.82429016",
"text": "def empty?\n if cards.nil?\n return true\n else\n if cards.size == 0\n return true\n end\n return false\n end\n end",
"title": ""
},
{
"docid": "c532c7d979d2698bcc8d3181c1250258",
"score": "0.81318694",
"text": "def empty?\n self.cards.empty?\n end",
"title": ""
},
{
"docid": "dad30500f6533a1fcadcb1c3907b30e5",
"score": "0.8120601",
"text": "def lost?\n @deck.cards.length == 0\n end",
"title": ""
},
{
"docid": "a736024106e63a44cc6f0f4fe3bb5ca6",
"score": "0.7633387",
"text": "def has_lost?\n return false if @deck.cards.length != 0\n true\n end",
"title": ""
},
{
"docid": "5ce8ac4764f5cbd223ac3c7595c4307b",
"score": "0.7536548",
"text": "def has_lost?\n @deck.cards == []\n end",
"title": ""
},
{
"docid": "8b97e5c517116860d93d5aca58cb50ed",
"score": "0.75046176",
"text": "def empty?\r\n candies.count == 0\r\n end",
"title": ""
},
{
"docid": "1237b0ee923cc892aea060884508bc86",
"score": "0.74228704",
"text": "def empty?\n count == 0\n end",
"title": ""
},
{
"docid": "1237b0ee923cc892aea060884508bc86",
"score": "0.74228704",
"text": "def empty?\n count == 0\n end",
"title": ""
},
{
"docid": "6963872ff1dfff738b075937a0a7fffd",
"score": "0.74181753",
"text": "def empty?\n count == 0\n end",
"title": ""
},
{
"docid": "6d790f7b2ca5458e56b31c87b61e1c0c",
"score": "0.73799795",
"text": "def empty?\n size == 0\n end",
"title": ""
},
{
"docid": "fc920e357166a6416dc0864684a1c42a",
"score": "0.7377221",
"text": "def empty?\n count <= 0\n end",
"title": ""
},
{
"docid": "e830e2457f08403c782ecbe0ae85fff8",
"score": "0.7364779",
"text": "def empty?\n return @size == 0\n end",
"title": ""
},
{
"docid": "51f5c44b8d564d1db3b6f5e524f36347",
"score": "0.73581016",
"text": "def empty?\n size.zero?\n end",
"title": ""
},
{
"docid": "82eda40a48091a987259c39f04190d93",
"score": "0.73402816",
"text": "def empty?\n cardinality == 0\n end",
"title": ""
},
{
"docid": "849e29deb96d8bfeeace10438b005d0a",
"score": "0.73374856",
"text": "def empty?\n size == 0\n end",
"title": ""
},
{
"docid": "849e29deb96d8bfeeace10438b005d0a",
"score": "0.73374856",
"text": "def empty?\n size == 0\n end",
"title": ""
},
{
"docid": "849e29deb96d8bfeeace10438b005d0a",
"score": "0.73374856",
"text": "def empty?\n size == 0\n end",
"title": ""
},
{
"docid": "52a6ce8203ff8a201e452aa26717721b",
"score": "0.7335832",
"text": "def empty?\n @size == 0\n end",
"title": ""
},
{
"docid": "52a6ce8203ff8a201e452aa26717721b",
"score": "0.7335832",
"text": "def empty?\n @size == 0\n end",
"title": ""
},
{
"docid": "6c458bb2a9618651282e3d842949ab6a",
"score": "0.7325648",
"text": "def empty?\n\t\t\tsize == 0\n\t\tend",
"title": ""
},
{
"docid": "cecf341999e8ae2a2d027ba7bb072b1d",
"score": "0.73215",
"text": "def empty?\n count.zero?\n end",
"title": ""
},
{
"docid": "cecf341999e8ae2a2d027ba7bb072b1d",
"score": "0.73215",
"text": "def empty?\n count.zero?\n end",
"title": ""
},
{
"docid": "cecf341999e8ae2a2d027ba7bb072b1d",
"score": "0.73215",
"text": "def empty?\n count.zero?\n end",
"title": ""
},
{
"docid": "7bf4413c5f39818a86cbc6d148808ce2",
"score": "0.7320841",
"text": "def empty?\n size.zero?\n end",
"title": ""
},
{
"docid": "7bf4413c5f39818a86cbc6d148808ce2",
"score": "0.7320841",
"text": "def empty?\n size.zero?\n end",
"title": ""
},
{
"docid": "7bf4413c5f39818a86cbc6d148808ce2",
"score": "0.7320841",
"text": "def empty?\n size.zero?\n end",
"title": ""
},
{
"docid": "7bf4413c5f39818a86cbc6d148808ce2",
"score": "0.7320841",
"text": "def empty?\n size.zero?\n end",
"title": ""
},
{
"docid": "824c7ac447e07f9e796800a4a2b29f9b",
"score": "0.7315715",
"text": "def empty?\n size == 0\n end",
"title": ""
},
{
"docid": "824c7ac447e07f9e796800a4a2b29f9b",
"score": "0.7315715",
"text": "def empty?\n size == 0\n end",
"title": ""
},
{
"docid": "959fbb162dd958e466b6e7fcab8144b5",
"score": "0.7314501",
"text": "def empty?\n @size == 0\n end",
"title": ""
},
{
"docid": "959fbb162dd958e466b6e7fcab8144b5",
"score": "0.7314501",
"text": "def empty?\n @size == 0\n end",
"title": ""
},
{
"docid": "e666760fd07f1d61258f616afb94dc77",
"score": "0.730337",
"text": "def empty?\n @size == 0\n end",
"title": ""
},
{
"docid": "e666760fd07f1d61258f616afb94dc77",
"score": "0.730337",
"text": "def empty?\n @size == 0\n end",
"title": ""
},
{
"docid": "56c33be255b0437433daa66be3f93eac",
"score": "0.7300808",
"text": "def empty?\n size.zero?\n end",
"title": ""
},
{
"docid": "737fa34dc78b81ec993d8ff5bdca9d4a",
"score": "0.7292636",
"text": "def empty?\n @count == 0\n end",
"title": ""
},
{
"docid": "737fa34dc78b81ec993d8ff5bdca9d4a",
"score": "0.7292636",
"text": "def empty?\n @count == 0\n end",
"title": ""
},
{
"docid": "737fa34dc78b81ec993d8ff5bdca9d4a",
"score": "0.7292636",
"text": "def empty?\n @count == 0\n end",
"title": ""
},
{
"docid": "737fa34dc78b81ec993d8ff5bdca9d4a",
"score": "0.7292636",
"text": "def empty?\n @count == 0\n end",
"title": ""
},
{
"docid": "0522aa3788cdf7eb4154e710ef1fc2ba",
"score": "0.7291072",
"text": "def empty?\n\t\treturn size.zero?\n\tend",
"title": ""
},
{
"docid": "8cf2cd565921c44054d51aa0c7b76ce2",
"score": "0.7288998",
"text": "def is_empty?\n size == 0\n end",
"title": ""
},
{
"docid": "ad933dd1f92b20c8e1668cb31d42b465",
"score": "0.72663045",
"text": "def empty?\n total_count == 0\n end",
"title": ""
},
{
"docid": "ad933dd1f92b20c8e1668cb31d42b465",
"score": "0.72663045",
"text": "def empty?\n total_count == 0\n end",
"title": ""
},
{
"docid": "ffcfd3363deb9fcd08c7e4091b8ed8ce",
"score": "0.726021",
"text": "def is_complete?\n if empty?\n puts \"Deck is empty\"\n return false\n elsif !is_full?\n puts \"Deck is missing some cards\"\n return false\n else\n myhash = {}\n @deck.each do |x|\n myhash[x.suit.value] ||= []\n myhash[x.suit.value] << x.value\n end\n\n Suit::VALID_SUIT.each do |suit|\n return false if myhash[suit].length != 13\n end\n return true\n\n end\n\n end",
"title": ""
},
{
"docid": "dce67c2cae35937f022965a9095c6eab",
"score": "0.72380954",
"text": "def empty?\r\n @pack.empty?\r\n end",
"title": ""
},
{
"docid": "a7c4a87528ae7141773279cac99b7662",
"score": "0.7226118",
"text": "def empty?\n length.zero?\n end",
"title": ""
},
{
"docid": "1c62c3660c854b118abf7f9d60cee21a",
"score": "0.7213026",
"text": "def empty?\n return @fill_count == 0\n end",
"title": ""
},
{
"docid": "b0abed639557850609fd827ad9e3aa1b",
"score": "0.72104204",
"text": "def empty\n @cards.shift(@cards.size)\n end",
"title": ""
},
{
"docid": "d22724c3406d4a13f3854b4f1e0ebcda",
"score": "0.72070765",
"text": "def empty?\n count.zero?\n end",
"title": ""
},
{
"docid": "c20d644734e888faa684f27bd57c1d18",
"score": "0.7206421",
"text": "def empty?\n @size.zero?\n end",
"title": ""
},
{
"docid": "04dd7178145f15ca458df4a6732f5e5b",
"score": "0.7189246",
"text": "def empty?() end",
"title": ""
},
{
"docid": "04dd7178145f15ca458df4a6732f5e5b",
"score": "0.7189246",
"text": "def empty?() end",
"title": ""
},
{
"docid": "04dd7178145f15ca458df4a6732f5e5b",
"score": "0.7189246",
"text": "def empty?() end",
"title": ""
},
{
"docid": "b22d9f038a0293592be1b441378ae672",
"score": "0.7184602",
"text": "def empty?\n @total == 0\n end",
"title": ""
},
{
"docid": "c773cecf45fb835ce0b354fbc2e686d6",
"score": "0.7182101",
"text": "def empty?()\n return @length == 0\n end",
"title": ""
},
{
"docid": "98078385e641e708a255ec5dbed884c6",
"score": "0.7181698",
"text": "def empty?\n length == 0\n end",
"title": ""
},
{
"docid": "98078385e641e708a255ec5dbed884c6",
"score": "0.7181698",
"text": "def empty?\n length == 0\n end",
"title": ""
},
{
"docid": "98078385e641e708a255ec5dbed884c6",
"score": "0.7181698",
"text": "def empty?\n length == 0\n end",
"title": ""
},
{
"docid": "dfd28a7aff1d5bba25bbee80743096c9",
"score": "0.7164858",
"text": "def empty?\n self.count == 0\n end",
"title": ""
},
{
"docid": "dfd28a7aff1d5bba25bbee80743096c9",
"score": "0.7164858",
"text": "def empty?\n self.count == 0\n end",
"title": ""
},
{
"docid": "26a08a6822bddcafcc77ea99a0ae03aa",
"score": "0.7159857",
"text": "def empty?\n diversity.size < 2\n end",
"title": ""
},
{
"docid": "00a9f2d76c02787ce0035289fe71cb3b",
"score": "0.71394366",
"text": "def empty?; size == 0 end",
"title": ""
},
{
"docid": "2173fe738c4e339817981e265a8f628f",
"score": "0.71293694",
"text": "def empty?\n @items.count == 0\n end",
"title": ""
},
{
"docid": "fb535e0cd27f535aa9929c1bbf03909a",
"score": "0.71256095",
"text": "def empty?\r\n @length == 0\r\n end",
"title": ""
},
{
"docid": "fb535e0cd27f535aa9929c1bbf03909a",
"score": "0.71256095",
"text": "def empty?\r\n @length == 0\r\n end",
"title": ""
},
{
"docid": "fb535e0cd27f535aa9929c1bbf03909a",
"score": "0.71256095",
"text": "def empty?\r\n @length == 0\r\n end",
"title": ""
},
{
"docid": "fb535e0cd27f535aa9929c1bbf03909a",
"score": "0.71256095",
"text": "def empty?\r\n @length == 0\r\n end",
"title": ""
},
{
"docid": "c562b64f98eca072799af7c1cb21a940",
"score": "0.7116892",
"text": "def empty?\n length == 0\n end",
"title": ""
},
{
"docid": "52d8c06bfae96d07d6086f22b261d774",
"score": "0.7103304",
"text": "def empty?\n true\n end",
"title": ""
},
{
"docid": "52d8c06bfae96d07d6086f22b261d774",
"score": "0.7103304",
"text": "def empty?\n true\n end",
"title": ""
},
{
"docid": "e2f562902d476fb797e091bf3a6001b1",
"score": "0.7097381",
"text": "def flush?\n cards_by_suit.any? {|_, v| v.count >= cards_needed}\n end",
"title": ""
},
{
"docid": "12c0611182883bb3333d689f1bb18eee",
"score": "0.70968944",
"text": "def empty?\n @length == 0\n end",
"title": ""
},
{
"docid": "447f2f21e447a7d8026f635d2754b238",
"score": "0.70931256",
"text": "def empty?\r\n @length == 0\r\n end",
"title": ""
},
{
"docid": "485eebbf31f03fd92c39ba14477be257",
"score": "0.7087866",
"text": "def empty?\n\t\t\t@storage.size == 0\n\t\tend",
"title": ""
},
{
"docid": "2b9939fde49ce3f8803814bc5e787c06",
"score": "0.7085141",
"text": "def empty?\n false\n end",
"title": ""
},
{
"docid": "4d8b1fb79b1ba630e63ad9594d0dedb1",
"score": "0.7080592",
"text": "def empty?\n empty\n end",
"title": ""
},
{
"docid": "fe0c30a8e57671c8249b6d2e113903c3",
"score": "0.7052298",
"text": "def empty?\n @is_empty\n end",
"title": ""
},
{
"docid": "e971bb39f69c2de57cd4163442ba14a4",
"score": "0.7051833",
"text": "def empty?\n end",
"title": ""
},
{
"docid": "e971bb39f69c2de57cd4163442ba14a4",
"score": "0.7051833",
"text": "def empty?\n end",
"title": ""
},
{
"docid": "e971bb39f69c2de57cd4163442ba14a4",
"score": "0.7051833",
"text": "def empty?\n end",
"title": ""
},
{
"docid": "0dc146463e791191c4326aec6175bc83",
"score": "0.7026367",
"text": "def is_empty\n self.openings == @size\n end",
"title": ""
},
{
"docid": "8a02c210fe877a724f86deff59184170",
"score": "0.7021181",
"text": "def empty?\n @length == 0\n end",
"title": ""
},
{
"docid": "03a765fbe95bb0bab748ca8a685190cd",
"score": "0.7012636",
"text": "def empty()\n @size == 0\n end",
"title": ""
},
{
"docid": "2821ac778314a33e9eaaaf4792b476d8",
"score": "0.70106035",
"text": "def isEmpty?()\r\n return @items == 0\r\n end",
"title": ""
},
{
"docid": "2c065e5f7079a0f5a8bc570072a9ec58",
"score": "0.69966733",
"text": "def empty?\n return false\n end",
"title": ""
},
{
"docid": "edf1bdfaa566b44d94006ae9ed0bbcf5",
"score": "0.69954973",
"text": "def empty?()\r\n\t\t@bottles.zero?\r\n\tend",
"title": ""
},
{
"docid": "779eb4267355e04d35f0219395f0986d",
"score": "0.6990438",
"text": "def empty?\n false\n end",
"title": ""
},
{
"docid": "2061f201cfcc29bcb3108668256d867a",
"score": "0.69896656",
"text": "def empty?\n\n\n\n end",
"title": ""
},
{
"docid": "1f130a955024f3fca3ee61621087106a",
"score": "0.6988743",
"text": "def is_empty()\n if @length == 0\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "933b643b03c0eff73aacc1649c9a416b",
"score": "0.6971139",
"text": "def is_empty()\n return @items.empty?\n end",
"title": ""
},
{
"docid": "bdced372a045b0ae4de5039c558e061a",
"score": "0.6967275",
"text": "def empty?\n end",
"title": ""
},
{
"docid": "bdced372a045b0ae4de5039c558e061a",
"score": "0.6967275",
"text": "def empty?\n end",
"title": ""
},
{
"docid": "bdced372a045b0ae4de5039c558e061a",
"score": "0.6967275",
"text": "def empty?\n end",
"title": ""
},
{
"docid": "bdced372a045b0ae4de5039c558e061a",
"score": "0.6967275",
"text": "def empty?\n end",
"title": ""
},
{
"docid": "d16f2dd278cbe94ef8adaa6e40965281",
"score": "0.696398",
"text": "def empty?\n # raise NotImplementedError, \"Not yet implemented\"\n if size > 0\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "e02fdd02919e53b444537fb9a7d27613",
"score": "0.69583714",
"text": "def empty?\n\t\t@length == 0\n\tend",
"title": ""
},
{
"docid": "c58064afca12973758347990b7d2996c",
"score": "0.69558996",
"text": "def empty?\n return @store.length == 0\n end",
"title": ""
},
{
"docid": "90bec393ddf3cb6ad582ed2e7a8ac439",
"score": "0.69440037",
"text": "def empty?\n self == NullPiece\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "64eae1b779a0ff3dd6268d5eae51616a",
"score": "0.0",
"text": "def set_email\n @email = Email.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60310596",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6014974",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59220976",
"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.5914568",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5914568",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589943",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5888941",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58885634",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58885634",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58885634",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58782613",
"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.5861314",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5809542",
"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.5741235",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57311964",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5716416",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5700531",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56932974",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56695074",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651278",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648787",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5637279",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5625286",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56093556",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.55957067",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5595428",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5587003",
"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.555788",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.555788",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5509564",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5503485",
"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.54668134",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5466406",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54484755",
"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.5445224",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54400647",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54170287",
"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.5410386",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5410386",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5400231",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394892",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394892",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.53915846",
"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.53883713",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5377769",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53559244",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.53485996",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53475654",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.534689",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.53444993",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5340848",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.532768",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53044224",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5285527",
"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.5283148",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52561116",
"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": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.5255505",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.5249269",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52457106",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5239162",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237084",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237084",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52318287",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.5228689",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5224244",
"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.52220625",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.5220978",
"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.52146",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5212803",
"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.520894",
"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.5205112",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5204084",
"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": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5203692",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.52036524",
"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": "691d5a5bcefbef8c08db61094691627c",
"score": "0.51995677",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51958364",
"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.51958364",
"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.51914203",
"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.51794034",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5178634",
"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.5173361",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173361",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173361",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.51644397",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.51532143",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.51424634",
"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.5140684",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.5140337",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5139829",
"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.513508",
"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.51161575",
"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.511372",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5111875",
"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.51083213",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.51083213",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.51083213",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.51056045",
"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.51042956",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.5098082",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50948924",
"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": "35b302dd857a031b95bc0072e3daa707",
"score": "0.5091935",
"text": "def config(action, *args); end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "e2266e5f55ec0198483e70929e2756bd",
"score": "0.0",
"text": "def set_mural\n @mural = Mural.accessible_by(current_ability).find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
bdbd8ed3161567c64f38eb88d75e69d7
|
dispays drag & drop tree for menus
|
[
{
"docid": "f4fb2e3d66356361e209e424c8c3a0b2",
"score": "0.5910543",
"text": "def tree_menu(menus, sortable)\n menus.map do |menu, sub_menu|\n content_tag :li, :id => dom_id(menu), :class => \"sortable_#{sortable}\" do\n render(menu) + (content_tag(:ol, tree_menu(sub_menu, true)) if sub_menu.present?)\n end\n end.join.html_safe\n end",
"title": ""
}
] |
[
{
"docid": "1158f9eb84657668a5af241ee359c954",
"score": "0.64406097",
"text": "def init_tree_signals\n # Creates the right click menu for the treeview\n menu = Gtk::Menu.new\n open = Gtk::MenuItem.new(\"Open\")\n \n # Connects the menu items signals.\n open.signal_connect(\"activate\") do \n if iter = @treeview.selection.selected\n end\n end\n \n delete = Gtk::MenuItem.new(\"Delete\")\n delete.signal_connect(\"activate\") do \n if iter = @treeview.selection.selected\n delete = Gtk::MessageDialog.new(@glade.get_widget(\"window1\"), Gtk::Dialog::DESTROY_WITH_PARENT,\n Gtk::MessageDialog::QUESTION, Gtk::MessageDialog::BUTTONS_YES_NO, 'Are you sure?')\n delete.run do |response|\n if response == Gtk::Dialog::RESPONSE_YES\n if iter.parent[0] == 'Texts'\n delete_text iter[1] if iter[1]\n elsif iter.parent[0] == 'PrinceText'\n delete_prince\n end\n @treestore.remove(iter)\n end\n delete.destroy\n end\n end\n end\n \n menu.append(open)\n menu.append(delete)\n\n menu.show_all\n\n # Popup the menu on right click\n @treeview.signal_connect(\"button_press_event\") do |widget, event|\n if event.kind_of? Gdk::EventButton and event.button == 3\n menu.popup(nil, nil, event.button, event.time)\n end\n end\n end",
"title": ""
},
{
"docid": "ee8c8fa4b3b0f377092d3727b33d80b8",
"score": "0.62979275",
"text": "def x_show\n @explorer = true\n tree_select\n end",
"title": ""
},
{
"docid": "ee8c8fa4b3b0f377092d3727b33d80b8",
"score": "0.62979275",
"text": "def x_show\n @explorer = true\n tree_select\n end",
"title": ""
},
{
"docid": "ee8c8fa4b3b0f377092d3727b33d80b8",
"score": "0.62979275",
"text": "def x_show\n @explorer = true\n tree_select\n end",
"title": ""
},
{
"docid": "ee8c8fa4b3b0f377092d3727b33d80b8",
"score": "0.62979275",
"text": "def x_show\n @explorer = true\n tree_select\n end",
"title": ""
},
{
"docid": "ee8c8fa4b3b0f377092d3727b33d80b8",
"score": "0.62979275",
"text": "def x_show\n @explorer = true\n tree_select\n end",
"title": ""
},
{
"docid": "ee8c8fa4b3b0f377092d3727b33d80b8",
"score": "0.62979275",
"text": "def x_show\n @explorer = true\n tree_select\n end",
"title": ""
},
{
"docid": "cd9e4f396e0b4ab75f543458ad0bd0f8",
"score": "0.62905383",
"text": "def init_tree_signals\n # Creates the right click menu for the treeview\n menu = Gtk::Menu.new\n open = Gtk::MenuItem.new(\"Open\")\n \n # Connects the menu items signals.\n open.signal_connect(\"activate\") do \n if iter = @treeview.selection.selected\n if iter.parent[0] == 'PrinceText'\n show_prince_file iter[1]\n elsif iter.parent[0] == 'Texts'\n show_file iter[1]\n end\n end\n end\n \n delete = Gtk::MenuItem.new(\"Delete\")\n delete.signal_connect(\"activate\") do \n if iter = @treeview.selection.selected\n delete = Gtk::MessageDialog.new(@glade.get_widget(\"window1\"), Gtk::Dialog::DESTROY_WITH_PARENT,\n Gtk::MessageDialog::QUESTION, Gtk::MessageDialog::BUTTONS_YES_NO, 'Are you sure?')\n delete.run do |response|\n if response == Gtk::Dialog::RESPONSE_YES\n if iter.parent[0] == 'Texts'\n delete_text iter[1] if iter[1]\n @treestore.remove(iter)\n elsif iter.parent[0] == 'PrinceText'\n delete_prince\n @treestore.remove(iter)\n end\n end\n delete.destroy\n end\n end\n end\n \n menu.append(open)\n menu.append(delete)\n menu.show_all\n \n #Gets the doubleclicks\n @treeview.signal_connect(\"row-activated\") do |view, path, column|\n if iter = view.model.get_iter(path)\n if iter.parent[0] == 'PrinceText'\n show_prince_file iter[1]\n elsif iter.parent[0] == 'Texts'\n show_file iter[1]\n end\n end\n end\n\n # Popup the menu on right click\n @treeview.signal_connect(\"button_press_event\") do |widget, event|\n if event.kind_of? Gdk::EventButton and event.button == 3\n menu.popup(nil, nil, event.button, event.time)\n end\n end\n end",
"title": ""
},
{
"docid": "3569e9b1ca7531aac50410196b13b8f0",
"score": "0.6159685",
"text": "def init_tree_signals\n # Creates the right click menu for the view\n menu = Gtk::Menu.new\n open = Gtk::MenuItem.new(\"Open\")\n delete = Gtk::MenuItem.new(\"Delete\")\n \n # Connects the open signal.\n open.signal_connect(\"activate\") do\n if iter = @view.selection.selected\n if iter.parent[0] == 'Texts'\n if iter[2] == 'true'\n @window.show_prince_file iter[1]\n else\n @window.show_file iter[1]\n end\n end\n end\n end\n\n #Connects the close signal.\n delete.signal_connect(\"activate\") do \n if iter = @view.selection.selected\n delete = Gtk::MessageDialog.new(@window, Gtk::Dialog::DESTROY_WITH_PARENT,\n Gtk::MessageDialog::QUESTION, \n Gtk::MessageDialog::BUTTONS_YES_NO, 'Are you sure?')\n delete.run do |response|\n if response == Gtk::Dialog::RESPONSE_YES\n if iter.parent[0] == 'Texts'\n if iter[2] == 'true'\n puts \"Can't delete the prince\"\n else\n if @proj.delete_text iter[1]\n @treestore.remove(iter)\n end\n end\n end\n end\n delete.destroy\n end\n end\n end\n \n #Appends the menus\n menu.append(open)\n menu.append(delete)\n menu.show_all\n\n # Popup the menu on right click\n @view.signal_connect(\"button_press_event\") do |widget, event|\n if event.kind_of? Gdk::EventButton and event.button == 3\n if iter = @view.selection.selected\n if iter.parent == nil\n elsif iter.parent[0]!= 'Texts'\n elsif iter.parent[0] == 'Texts'\n menu.popup(nil, nil, event.button, event.time)\n end\n end\n end\n end\n \n #Gets the doubleclicks\n @view.signal_connect(\"row-activated\") do |view, path, column|\n if iter = view.model.get_iter(path)\n if iter.parent != nil and iter.parent[0] == 'Texts'\n if iter[2] == 'true'\n @window.show_prince_file iter[1]\n else\n @window.show_file iter[1]\n end\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "e2b5863341d927abccca05251e91476c",
"score": "0.6108442",
"text": "def drag_to(node, **options); end",
"title": ""
},
{
"docid": "6269600ab7c9fdcedee3cc5c7d29b6c4",
"score": "0.6004821",
"text": "def display_tree(tree_parent) # Need to work on this\nend",
"title": ""
},
{
"docid": "d439dab120a3b31e834fc3550fdb213e",
"score": "0.5974405",
"text": "def tree_select\n @explorer = true\n @lastaction = \"explorer\"\n self.x_active_tree = params[:tree] if params[:tree]\n self.x_node = params[:id]\n assert_accordion_and_tree_privileges(x_active_tree)\n @sb[:action] = nil\n replace_right_cell\n end",
"title": ""
},
{
"docid": "b07a588b59f1dfb432628641509a0fbe",
"score": "0.59216356",
"text": "def build_move_tree #finding children\n \n end",
"title": ""
},
{
"docid": "57ca62d22e3401c207a6982b1698a081",
"score": "0.59208715",
"text": "def show_tree\n @root=Category.roots\n end",
"title": ""
},
{
"docid": "6e8c10d8720afffeeaa012518ca30909",
"score": "0.59013134",
"text": "def onMainTreeSelectionUpdated\n if (@TCMainTree.selectionChanged?)\n lSelection = @TCMainTree.getCurrentSelection\n lName = lSelection.getDescription\n # Group Cut/Copy/Delete:\n # Enabled only if the selection is not empty\n [ [ Wx::ID_CUT, 'Cut' ],\n [ Wx::ID_COPY, 'Copy' ],\n [ Wx::ID_DELETE, 'Delete' ] ].each do |iCommandInfo|\n iCommandID, iCommandName = iCommandInfo\n @Controller.setMenuItemGUIEnabled(@EditMenu, iCommandID, (!lSelection.empty?))\n if (lName != nil)\n @Controller.setMenuItemGUITitle(@EditMenu, iCommandID, \"#{iCommandName} #{lName}\")\n else\n @Controller.setMenuItemGUITitle(@EditMenu, iCommandID, nil)\n end\n lButton = @ToolBar.find_by_id(iCommandID)\n if (lButton != nil)\n @Controller.setToolbarButtonGUIEnabled(lButton, iCommandID, (!lSelection.empty?))\n if (lName != nil)\n @Controller.setToolbarButtonGUITitle(lButton, iCommandID, \"#{iCommandName} #{lName}\")\n else\n @Controller.setToolbarButtonGUITitle(lButton, iCommandID, nil)\n end\n end\n end\n # Group Edit:\n # Enabled only if the selection contains a single Tag or a single Shortcut\n lEditEnabled = ((lSelection.singleTag?) or\n (lSelection.singleShortcut?))\n @Controller.setMenuItemGUIEnabled(@EditMenu, Wx::ID_EDIT, lEditEnabled)\n if (lName != nil)\n @Controller.setMenuItemGUITitle(@EditMenu, Wx::ID_EDIT, \"Edit #{lName}\")\n else\n @Controller.setMenuItemGUITitle(@EditMenu, Wx::ID_EDIT, nil)\n end\n lButton = @ToolBar.find_by_id(Wx::ID_EDIT)\n if (lButton != nil)\n @Controller.setToolbarButtonGUIEnabled(lButton, Wx::ID_EDIT, lEditEnabled)\n if (lName != nil)\n @Controller.setToolbarButtonGUITitle(lButton, Wx::ID_EDIT, \"Edit #{lName}\")\n else\n @Controller.setToolbarButtonGUITitle(lButton, Wx::ID_EDIT, nil)\n end\n end\n # Group New Tag/New Shortcut:\n # Enabled only if the selection contains a single Tag or the Root Tag\n lTagOpEnabled = ((@TCMainTree.isRootTagOnlySelected?) or\n (lSelection.singleTag?))\n @Controller.setMenuItemGUIEnabled(@EditMenu, ID_NEW_TAG, lTagOpEnabled)\n lButton = @ToolBar.find_by_id(ID_NEW_TAG)\n if (lButton != nil)\n @Controller.setToolbarButtonGUIEnabled(lButton, ID_NEW_TAG, lTagOpEnabled)\n end\n @Controller.getTypesPlugins.each do |iTypeID, iTypeInfo|\n lIdxID = ID_NEW_SHORTCUT_BASE + iTypeInfo[:PluginIndex]\n @Controller.setMenuItemGUIEnabled(@NewShortcutMenu, lIdxID, lTagOpEnabled)\n lButton = @ToolBar.find_by_id(lIdxID)\n if (lButton != nil)\n @Controller.setToolbarButtonGUIEnabled(lButton, lIdxID, lTagOpEnabled)\n end\n end\n # Group Paste:\n if (@TCMainTree.isRootTagOnlySelected?)\n refreshPaste(nil)\n else\n refreshPaste(lSelection)\n end\n # Shortcut Command Plugins\n @Controller.getShortcutCommandsPlugins.each do |iPluginID, iPluginInfo|\n lCommandID = ID_SHORTCUT_COMMAND_BASE + iPluginInfo[:PluginIndex]\n if ((!lSelection.SelectedPrimaryShortcuts.empty?) or\n (!lSelection.SelectedSecondaryShortcuts.empty?))\n # Is the plugin available ?\n lAvailable = false\n if (iPluginInfo[:ShortcutTypes] == nil)\n # This command is available\n lAvailable = true\n else\n (lSelection.SelectedPrimaryShortcuts + lSelection.SelectedSecondaryShortcuts).each do |iSelectedShortcutInfo|\n iSelectedShortcut, iParentTag = iSelectedShortcutInfo\n if (iPluginInfo[:ShortcutTypes].include?(iSelectedShortcut.Type.pluginDescription[:PluginName]))\n # there is at least 1 Shortcut that is eligible.\n lAvailable = true\n break\n end\n end\n end\n if (lAvailable)\n @Controller.setMenuItemGUIEnabled(@ShortcutCommandsMenu, lCommandID, true)\n @Controller.setMenuItemGUITitle(@ShortcutCommandsMenu, lCommandID, nil)\n lButton = @ToolBar.find_by_id(ID_NEW_TAG)\n if (lButton != nil)\n @Controller.setToolbarButtonGUIEnabled(lButton, lCommandID, true)\n @Controller.setToolbarButtonGUITitle(lButton, Wx::ID_EDIT, nil)\n end\n else\n @Controller.setMenuItemGUIEnabled(@ShortcutCommandsMenu, lCommandID, false)\n @Controller.setMenuItemGUITitle(@ShortcutCommandsMenu, lCommandID, \"#{iPluginInfo[:Title]}: No applicable Shortcut\")\n lButton = @ToolBar.find_by_id(ID_NEW_TAG)\n if (lButton != nil)\n @Controller.setToolbarButtonGUIEnabled(lButton, lCommandID, false)\n @Controller.setToolbarButtonGUITitle(lButton, Wx::ID_EDIT, \"#{iPluginInfo[:Title]}: No applicable Shortcut\")\n end\n end\n else\n # No Shortcut selected\n @Controller.setMenuItemGUIEnabled(@ShortcutCommandsMenu, lCommandID, false)\n @Controller.setMenuItemGUITitle(@ShortcutCommandsMenu, lCommandID, \"#{iPluginInfo[:Title]}: No Shortcut selected\")\n lButton = @ToolBar.find_by_id(ID_NEW_TAG)\n if (lButton != nil)\n @Controller.setToolbarButtonGUIEnabled(lButton, lCommandID, false)\n @Controller.setToolbarButtonGUITitle(lButton, Wx::ID_EDIT, \"#{iPluginInfo[:Title]}: No Shortcut selected\")\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "864ee1fc06a984868a336c2658eb0216",
"score": "0.58951366",
"text": "def CreateTreeDialog\n OpenTreeNextBackDialog()\n nil\n end",
"title": ""
},
{
"docid": "fd0c1643a69db1d0e85c0ef44ae13315",
"score": "0.58761483",
"text": "def initialize(iController, iWindow)\n # We can edit labels, we will forward modifications to either Tag.Name or Shortcut.Metadata['title']\n # We have little + buttons to collapse/expand\n # We have multiple selection\n super(iWindow,\n :style => Wx::TR_EDIT_LABELS|Wx::TR_HAS_BUTTONS|Wx::TR_MULTIPLE|Wx::TR_EXTENDED\n )\n\n # The safe Timers manager for this tree\n @TimersManager = RUtilAnts::GUI::SafeTimersManager.new\n\n # The Root Tag to be displayed\n # Tag\n @RootTag = nil\n # Is the Root Tag to be displayed the real Root Tag from the Controller ?\n # Boolean\n @RealRootTag = false\n\n # TODO (WxRuby): Bug correction\n # Register this Event as otherwise moving the mouse over the TreeCtrl component generates tons of warnings. Bug ?\n Wx::EvtHandler::EVENT_TYPE_CLASS_MAP[10000] = Wx::Event\n # TODO (WxRuby): Bug correction\n # Register this Event as otherwise destroy ToolTips during drag generate tons of warnings. Bug ?\n Wx::EvtHandler::EVENT_TYPE_CLASS_MAP[10131] = Wx::Event\n\n @Controller = iController\n # Selection in the clipboard\n # MultipleSelection\n @CopySelection = nil\n # Selection mode in the clipboard\n # Integer\n @CopyMode = nil\n # Selection in the drag'n'drop\n # MultipleSelection\n @DragSelection = nil\n # Selection mode in the drag'n'drop\n # Integer\n @DragMode = nil\n # The last known selection\n # MultipleSelection\n @OldSelection = nil\n # The last hovered node ID\n # Integer\n @OldHoveredNodeID = nil\n # The Tags references to tree nodes\n # map< Tag, Integer >\n @TagsToMainTree = nil\n # The drag image\n # Wx::DragImage\n @DragImage = nil\n # The context menu\n # Wx::Menu\n @ContextMenu = nil\n # The last item ID that was under the mouse.\n # This is used to detect when the mouse changes items for tool tips.\n # It stores also the time stamp to detect in timers if we didn't change items and come back.\n # [ Integer, Time ]\n @LastItemUnderMouse = nil\n # Last tool tip created\n # HintFrame\n @LastToolTip = nil\n # Create the image list for the tree\n lTreeImageList = Wx::ImageList.new(16, 16)\n set_image_list(lTreeImageList)\n # Make this image list driven by a manager\n @ImageListManager = RUtilAnts::GUI::ImageListManager.new(lTreeImageList, 16, 16)\n # Accept incoming drops of things\n # Keep a reference to the DropTarget, as otherwise it results in a core dump when dragging over the tree (another way to avoid this reference is to use drop_target= instead of set_drop_target). Bug ?\n self.drop_target = SelectionDropTarget.new(@Controller, self)\n\n # All events\n\n # Begin drag event\n evt_tree_begin_drag(self) do |iEvent|\n # We begin dragging with left mouse\n lSelection = getCurrentSelection\n if (!lSelection.empty?)\n computeDragImage(lSelection)\n # Create the data DropSource\n lDragSource = SelectionDropSource.new(@DragImage, self, lSelection, @Controller)\n # Perform the complete DragNDrop\n lDropResult = lDragSource.do_drag_drop(Wx::DRAG_ALLOW_MOVE)\n # Notify that drag has ended\n @Controller.notifyObjectsDragEnd(lDropResult)\n # Check result\n if (lDropResult == Wx::DRAG_MOVE)\n # We delete the selection we have just dragged\n @Controller.executeCommand(Wx::ID_DELETE, {\n :parentWindow => nil,\n :selection => lSelection,\n :deleteTaggedShortcuts => false,\n :deleteOrphanShortcuts => false\n })\n end\n # Remove dragging image\n @DragImage.end_drag\n end\n iEvent.skip\n end\n evt_tree_begin_rdrag(self) do |iEvent|\n # We begin dragging with right mouse\n # TODO: Implement it with wxWidgets 2.9.0 (should be there May 2009)\n iEvent.skip\n end\n\n # The context menu\n evt_tree_item_menu(self) do |iEvent|\n popup_menu(@ContextMenu)\n end\n\n # Editing a label of a Tag or Shortcut\n evt_tree_begin_label_edit(self) do |iEvent|\n # We can't edit the Root\n if ((iEvent.item == root_item) and\n (@RealRootTag))\n iEvent.veto\n else\n # Remove the 'Del' key from accelerators\n @Controller.blockAccelerator([ 0, Wx::K_DELETE ] )\n iEvent.skip\n end\n end\n evt_tree_end_label_edit(self) do |iEvent|\n @Controller.unblockAccelerator([ 0, Wx::K_DELETE ] )\n # First, retrieve who we are editing (we are sure it can't be the root)\n lID, lObject, lKey = get_item_data(iEvent.item)\n lNewName = iEvent.label\n if (lNewName.strip != '')\n case lID\n when ID_TAG\n if (lNewName != lObject.Name)\n @Controller.undoableOperation(\"Edit Tag's name #{lObject.Name}\") do\n @Controller.updateTag(lObject, lNewName, lObject.Icon, lObject.Children)\n end\n end\n when ID_SHORTCUT\n if (lNewName != lObject.Metadata['title'])\n @Controller.undoableOperation(\"Edit Shortcut's name #{lObject.Metadata['title']}\") do\n lNewMetadata = lObject.Metadata.clone\n lNewMetadata['title'] = lNewName\n @Controller.updateShortcut(lObject, lObject.Content, lNewMetadata, lObject.Tags)\n end\n end\n else\n log_bug \"We are editing an item of unknown ID: #{lID}.\"\n end\n end\n # We always veto the event, as the label was forcefully modified by notifiers during this event\n iEvent.veto\n end\n\n # Giving tool tips about items\n evt_motion do |iEvent|\n lMousePosition = Wx::Point.new(iEvent.x, iEvent.y)\n lItemID, lFlags = hit_test(lMousePosition)\n if ((@LastItemUnderMouse == nil) or\n (lItemID != @LastItemUnderMouse[0]))\n notifyMouseChangedItems(lItemID, lMousePosition)\n end\n iEvent.skip\n end\n evt_enter_window do |iEvent|\n lMousePosition = Wx::Point.new(iEvent.x, iEvent.y)\n notifyMouseChangedItems(0, lMousePosition)\n end\n evt_leave_window do |iEvent|\n lMousePosition = Wx::Point.new(iEvent.x, iEvent.y)\n notifyMouseChangedItems(0, lMousePosition)\n end\n\n # Run on double-click\n evt_tree_item_activated(self) do |ioEvent|\n lItemID = ioEvent.item\n if (lItemID != 0)\n # Get the item data\n lID, lObject, lKey = get_item_data(lItemID)\n if (lID == ID_SHORTCUT)\n # Run the corresponding Shortcut\n lObject.run\n end\n end\n ioEvent.skip\n end\n\n # Prevent Root collapsing\n evt_tree_item_collapsing(self) do |ioEvent|\n lItemID = ioEvent.item\n if (lItemID == root_item)\n ioEvent.veto\n end\n end\n\n end",
"title": ""
},
{
"docid": "2c6badb5f99de9474b82507170c918d5",
"score": "0.5864866",
"text": "def as_dropdown\n html = link_4edit\n return \"#{html}#{@opts[:name]}<br>Menu not found!\" if @menu.nil?\n # sort items acording to :order \n items = @menu.dc_simple_menu_items.where(active: true).order_by(order: 1)\n @selected = find_selected\n div_name = (@menu.div_name.blank? ? @menu.name : @menu.div_name ).downcase\n \n html << \"<div id='#{div_name}'><ul>\"\n items.each do |item|\n # menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item)\n next unless can_view\n#\n selected = item.id == @selected.id ? 'selected' : ''\n html << \"<li class=\\\"#{selected}\\\">#{ link_4menu(item) }\"\n y = YAML.load(item.submenu) rescue {}\n if y and y.size > 0\n html << '<ul>'\n y.each do |k,v|\n v ||= k # defined as array\n html << (v['title'] == '<hr>' ? '<hr>' : \"<li>#{@parent.link_to(v['title'], v['link'], {target: v['target']})}</li>\" )\n end\n html << '</ul>'\n end\n html << \"</li>\"\n end\n html << '</ul></div>'\nend",
"title": ""
},
{
"docid": "3637f9826d57fe3637e1848fde6407fb",
"score": "0.582323",
"text": "def retourMenu()\n\n\t\teach_all do |c|\n\t\t remove(c)\n\t\tend\n\n\t\tpack_start(@titre, :expand => true, :fill => true)\n\t\tpack_start(@choixNom, :expand => true, :fill => true)\n\t\tpack_start(@choixTaille, :expand => true, :fill => true)\n\t\tpack_start(@choixDifficulte, :expand => true, :fill => true)\n\t\tpack_start(@surBoxValide, :expand => true, :fill => true)\n\n\tend",
"title": ""
},
{
"docid": "843ea1ce98de6c0281d7bf73612def99",
"score": "0.5792367",
"text": "def fillMenu(menu)\n %w(above below left right flush).each{|dir|\n menu.add(:command, :label=>Tk.tk_call('string', 'totitle', dir), \n :command=>proc{ menu.winfo_parent.direction(dir) })\n }\n menu.add(:cascade, :label=>'Submenu', :menu=>(submenu = TkMenu.new(menu)))\n submenu.add(:command, :label=>'Subcommand 1')\n submenu.add(:command, :label=>'Subcommand 2')\n submenu.add(:command, :label=>'Subcommand 3')\n\n menu.add(:separator)\n menu.add(:command, :label=>'Quit', :command=>proc{Tk.root.destroy})\nend",
"title": ""
},
{
"docid": "263bf8048e5ba058fe6509956e51fe95",
"score": "0.57572633",
"text": "def CreateTree(_Tree, title)\n _Tree = deep_copy(_Tree)\n if !haveFancyUI\n items = []\n Builtins.foreach(_Tree) do |i|\n if Ops.get_string(i, \"parent\", \"\") == \"\"\n items = Builtins.add(\n items,\n Item(\n Id(Ops.get_string(i, \"id\", \"\")),\n Ops.get_string(i, \"title\", \"\"),\n CreateTreeInternal(_Tree, Ops.get_string(i, \"id\", \"\"))\n )\n )\n end\n end\n Builtins.y2debug(\"tree items: %1\", items)\n\n ReplaceCustomHelp(\n VBox(\n term(:Tree, Id(:wizardTree), Opt(:notify, :vstretch), title, items),\n VSpacing(1)\n )\n )\n end\n\n nil\n end",
"title": ""
},
{
"docid": "795bd69285255dbc836ba11f48f4108f",
"score": "0.5743429",
"text": "def build_tree(regular_user, nodes)\n nodes.collect { |node|\n if node.direct_child_count == 0\n # No children -- final element\n [{:item => node, :selected => @ancestors.include?(node.id)}]\n else\n # Has children -- submenu\n if @ancestors.include?(node.id)\n # On path -- to show children\n subtree = build_tree(regular_user, all_nodes(regular_user, node.id))\n [{:item => node, :submenu => true, :selected => true}] + subtree\n else\n # Not on path -- to show only the element itself\n [{:item => node, :submenu => true}]\n end\n end\n }\n end",
"title": ""
},
{
"docid": "a44cceebf9c582972574f252f1024349",
"score": "0.5700508",
"text": "def treeview(text=\"Text Goes Here\", items=nil, height=0, width=0, listheight=0)\n tmp = Tempfile.new('dialog') \n items.map!{|item| item.map{|i| i.inspect}}.join(' ')\n cmd = [ option_string(), '--treeview',\n text.inspect, height, width, listheight, items,\n '2>', tmp.path.inspect ].join(' ')\n log_debug \"Number of items: #{items.size}\"\n run(cmd)\n tag = ''\n if @exit_code == 0\n tag = tmp.read\n end\n tmp.close!\n return tag\n end",
"title": ""
},
{
"docid": "b9293c697c4c4d702bf8e88acf19e4d2",
"score": "0.5682959",
"text": "def render\n set_initial_value('html','value')\n require 'sort_alphabetical' \n \n record = record_text_for(@yaml['name'])\n clas = 'tree-select' + (@readonly ? ' dc-readonly' : '')\n @html << \"<div id=\\\"#{@yaml['name']}\\\" class=\\\"#{clas}\\\" #{set_style()} >\"\n # Fill @choices hash. The key is parent object id\n @choices = {}\n choices_in_eval(@yaml['eval']).each do |data| \n @choices[ data[2].to_s ] ||= [] \n @choices[ data[2].to_s ] << (data << false)\n end\n # put current values hash with. To speed up selection when there is a lot of categories\n current_values = {}\n current = @record[@yaml['name']] || []\n current = [current] unless current.class == Array # non array fields\n current.each { |e| current_values[e.to_s] = true }\n # set third element of @choices when selected\n @choices.keys.each do |key|\n 0.upto( @choices[key].size - 1 ) do |i|\n choice = @choices[key][i]\n choice[choice.size - 1] = true if current_values[ choice[1].to_s ]\n end\n end\n make_tree(nil)\n @html << '</div>'\n # add hidden communication field\n @html << @parent.hidden_field(record, @yaml['name'], value: current.join(','))\n # save multiple indicator for data processing on return\n @html << @parent.hidden_field(record, \"#{@yaml['name']}_multiple\", value: 1) if @yaml['multiple']\n # javascript to update hidden record field when tree looses focus\nreadonly_code = %(\n,\n\"conditionalselect\" : function (node) {\nreturn false; }\n)\n\n @js =<<EOJS\n$(function(){\n $(\"##{@yaml['name']}\").jstree( {\n \"checkbox\" : {\"three_state\" : false}, \n \"core\" : { \"themes\" : { \"icons\": false },\n \"multiple\" : #{@yaml['multiple'] ? 'true' : 'false'} },\n \"plugins\" : [\"checkbox\", \"conditionalselect\"]\n #{@readonly ? readonly_code : ''}\n });\n});\n \n$(document).ready(function() {\n $('##{@yaml['name']}').on('focusout', function(e) {\n var checked_ids = [];\n var checked = $('##{@yaml['name']}').jstree(\"get_checked\", true);\n $.each(checked, function() {\n checked_ids.push( this.data.id );\n });\n $('#record_#{@yaml['name']}').val( checked_ids.join(\",\") );\n });\n});\nEOJS\n self\nend",
"title": ""
},
{
"docid": "70f0c04259445bba1772d04522c29257",
"score": "0.56814784",
"text": "def treeview(text=\"Text Goes Here\", items=nil, height=0, width=0, listheight=0)\n tmp = Tempfile.new('dialog') \n itemlist = ''\n items.each do |item|\n itemlist << \"'\" \n itemlist << item[0].to_s\n itemlist << \"'\"\n itemlist << \" \"\n itemlist << \"'\"\n itemlist << item[1].to_s\n itemlist << \"'\"\n itemlist << \" \"\n itemlist << \"'\"\n if item[2]\n item[2] = \"on\"\n else\n item[2] = \"off\"\n end\n itemlist << item[2]\n itemlist << \"'\"\n itemlist << \" \"\n itemlist << item[3].to_s\n itemlist << \" \"\n end\n itemlist << \"2>\"\n itemlist << tmp.path\n\n cmd = \"\"\n cmd << option_string()\n cmd << \" \"\n cmd << \"--treeview\"\n cmd << \" \"\n cmd << \"'\"\n cmd << \" \"\n cmd << text\n cmd << \"'\"\n cmd << \" \"\n cmd << height.to_s\n cmd << \" \"\n cmd << width.to_s\n cmd << \" \"\n cmd << listheight.to_s\n cmd << \" \"\n cmd << itemlist\n\n log_debug \"Number of items: #{items.size}\"\n log_debug \"Command:\\n#{cmd}\"\n\n system(cmd)\n @exit_code = $?.exitstatus\n log_debug \"Exit code: #{exit_code}\"\n tag = ''\n if @exit_code != 1\n tag = tmp.read\n end\n return tag\n ensure\n tmp.close!\n end",
"title": ""
},
{
"docid": "221caacfffc59585c46ef91760de3aad",
"score": "0.5681047",
"text": "def btn_up_pressed\n return unless @prev_path\n cur = selected_iter or return\n new_path = nil\n path_before = cur.path\n path_before.prev!\n if cur.path.to_str =~ /:0$/ # First child in submenu\n parent = @model.get_iter(@prev_path).parent\n sibling = @model.get_iter(@prev_path)\n new_iter = @model.insert_before(parent, sibling)\n move_branch(cur, new_iter)\n @model.remove(cur)\n new_path = new_iter.path\n elsif @prev_path.to_str != path_before.to_str # Move up into submenu\n parent = @model.get_iter(@prev_path).parent\n @view.expand_row(parent.path, false)\n sibling = @model.get_iter(@prev_path)\n new_iter = @model.insert_after(parent, sibling)\n move_branch(cur, new_iter)\n @model.remove(cur)\n new_path = new_iter.path\n elsif @model.get_iter(@prev_path)[ItemColumn].menu? # Move up into empty menu\n parent = @model.get_iter(@prev_path)\n new_iter = @model.append(parent)\n @view.expand_row(parent.path, false)\n move_branch(cur, new_iter)\n @model.remove(cur)\n new_path = new_iter.path\n else # Swap with following peer\n new_path = cur.path\n new_path.prev! or return\n prv = @model.get_iter(new_path)\n @model.swap(prv, cur)\n end\n sel = @view.selection\n sel.unselect_all\n sel.select_path(new_path)\n @view.scroll_to_cell(new_path, nil, false, 0, 0)\n end",
"title": ""
},
{
"docid": "a632eafa45122a17939e3f8ccd50dbc5",
"score": "0.5675955",
"text": "def jstree\n show\n end",
"title": ""
},
{
"docid": "f431b2bf9f82c8496005f685429849a7",
"score": "0.5670563",
"text": "def drag_and_drop(source, target); end",
"title": ""
},
{
"docid": "2b8c7c7568aaa259ca3c1970875e3d13",
"score": "0.56660575",
"text": "def assetTree_mouse_clicked(event)\n puts \"IN assetTreeMouseClicked : POPUP #{event.isPopupTrigger()}\"\n puts \"MOUSE #{event.class} : #{event.getClickCount} : BUTTON #{event.getButton}\"\n if( event.getButton == java.awt.event.MouseEvent::BUTTON3) # doesn't seem to work .. maybe need to register as isPopupTrigger())\n transfer[:event] = event\n\n items = [\"New Project\", :addSeparator, \"Add Asset\", \"Add Node\", :addSeparator, \"Rename\"]\n\n listener = PopupActionListener.new( self )\n\n listener.add_callback_method(\"New Project\", :add_project_button_action_performed )\n\n listener.add_callback(\"Add Node\") do\n path = signal(:assetTreeMousePath)\n return unless path\n\n add_to_tree_node = path.getLastPathComponent # path.getPath.each do |element|\n\n c = Composer.find( add_to_tree_node.object.id )\n puts \"ADD COMPOSER TO #{add_to_tree_node.object.id} : #{c.inspect}\"\n end\n\n ## CONTEXT DEPENDENT AND OPTIONAL ITEMS ##\n\n path = signal(:assetTreeMousePath)\n\n if path\n obj = path.getLastPathComponent.object # path.getPath.each do |element|\n\n items << \"Type Info\" if(obj && obj.is_a?(Composer))\n items << \"Documentation\" if(obj && obj.respond_to?(:annotations) && obj.annotations.last)\n \n listener.add_callback(\"Documentation\") do\n path = signal(:assetTreeMousePath)\n return unless path\n\n info = path.getLastPathComponent.object # path.getPath.each do |element|\n\n RubyMessageDialog.show(\"#{info.annotations.last.documentation}\") if info and info.annotations.last\n\n end\n\n listener.add_callback(\"Type Info\") do\n path = signal(:assetTreeMousePath)\n return unless path\n\n c = path.getLastPathComponent.object # path.getPath.each do |element|\n\n RubyMessageDialog.show(\"Type Info\\n#{c.class} : #{c.composer_type.klass.name}\") if c and c.composer_type\n end\n end\n \n pmenu = PopupMenuController.create_instance\n\n pmenu.open(event, items, listener )\n end\n end",
"title": ""
},
{
"docid": "3d818a8f17e1ea84acd3389400c1df5f",
"score": "0.56531155",
"text": "def menu\n puts \"Creating menu ...\"\n Content.new(\"#{@dir}\", \"#{@extension}\").menu @page.dropbox\n end",
"title": ""
},
{
"docid": "3ab88a554e152ddf6a94843c5ae889d7",
"score": "0.56489736",
"text": "def btn_down_pressed\n cur = selected_iter or return\n new_path = nil\n nxt_item = nil\n nxt = @model.get_iter(@next_path)\n if nxt\n nxt_item = nxt[ItemColumn] or return\n end\n path_after = cur.path\n path_after.next!\n if nxt_item and nxt_item.menu? # Move down into submenu\n parent = nxt\n nxt = nxt.first_child\n if nxt\n nxt = @model.insert_before(parent, nxt)\n else\n nxt = @model.append(parent)\n end\n @view.expand_row(parent.path, false)\n new_path = cur.path\n move_branch(cur, nxt)\n @model.remove(cur)\n new_path.down!\n elsif @next_path.to_str != path_after.to_str # Move down out of submenu\n sibling = cur.parent\n parent = sibling.parent\n nxt = @model.insert_after(parent, sibling)\n new_path = nxt.path\n move_branch(cur, nxt)\n @model.remove(cur)\n else # Swap with preceding peer\n nxt = @model.get_iter(@next_path)\n new_path = @next_path\n @model.swap(cur, nxt)\n end\n sel = @view.selection\n sel.unselect_all\n sel.select_path(new_path)\n @view.scroll_to_cell(new_path, nil, false, 0, 0)\n end",
"title": ""
},
{
"docid": "49fe9cb70ecd1aea11f55ddd32f8a32e",
"score": "0.56441927",
"text": "def draw_tree(item, selector, tab=nil, is_last=true, items_index=0)\n space = ' '\n if items_index < 10\n print ' '\n elsif items_index < 100\n print ' '\n elsif items_index > 999 # good god, man!\n space = ''\n end\n print items_index.to_s + \":\" + space\n\n if tab\n print tab\n if @sugarcube_collapsed_items && @sugarcube_collapsed_items.include?(item)\n print '<<< '\n else\n if is_last\n print '`-- '\n tab += ' '\n else\n print '+-- '\n tab += '| '\n end\n end\n else\n print '. '\n tab = ''\n end\n\n if self == item || @sugarcube_view == item\n print \"\\033[1m\"\n end\n print draw_tree_item(item)\n if self == item || @sugarcube_view == item\n print \"\\033[0m\"\n end\n puts\n\n if selector.is_a? Proc\n items = selector.call(item)\n else\n items = item.send(selector)\n end\n items ||= []\n\n unless @sugarcube_collapsed_items && @sugarcube_collapsed_items.include?(item)\n items.each_with_index do |subview, index|\n items_index += 1\n if self.respond_to? :draw_tree\n items_index = draw_tree(subview, selector, tab, index == items.length - 1, items_index)\n else\n items_index = SugarCube::Repl::draw_tree(subview, selector, tab, index == items.length - 1, items_index)\n end\n end\n end\n\n return items_index\n end",
"title": ""
},
{
"docid": "3b0c80ef14bb3fbf5c813105a0976d6f",
"score": "0.5633926",
"text": "def show_tree(tree)\n Tree.new(tree).show \n end",
"title": ""
},
{
"docid": "7d97a48dddaf29dcecb05f6275e043d9",
"score": "0.56234473",
"text": "def on_door_all_edit_dir\n\t\tadd_menu(:door_edit_dir)\n\tend",
"title": ""
},
{
"docid": "d20a33e1c80250310c75d0382b668293",
"score": "0.5613679",
"text": "def update_node\n node = self.node ? self.node : self.build_node\n unless self.name.blank?\n node.title = name\n node.menu_name = name\n node.set_safe_shortcut(name)\n end\n node.displayed = true\n self.node.parent ||= calendar.node if calendar and calendar.node\n end",
"title": ""
},
{
"docid": "b043003515a17166f02a7d77b3cef64e",
"score": "0.5610149",
"text": "def drag_and_drop_by(source, right_by, down_by); end",
"title": ""
},
{
"docid": "90034a4481c97cc763554c19575927a4",
"score": "0.55863655",
"text": "def drench_setups\n session[:user_actions] = nil # CLEARING session[:user_actions]\n\n @drench_lines = DrenchLine.find(:all)\n session[:drench_lines] = @drench_lines\n @content_header_caption = \"'drench setups'\"\n render :inline => %{\n <% @tree_script = build_drenching_tree(@drench_lines) %>\n }, :layout => 'tree'\n end",
"title": ""
},
{
"docid": "4517d2e93e954e2d753e6c50bde62893",
"score": "0.5572671",
"text": "def tree\n render layout: nil\n end",
"title": ""
},
{
"docid": "cea407633109d96efd12e4a1d6ad3005",
"score": "0.5562417",
"text": "def disp_menu #:nodoc:\n require 'rbcurse/extras/widgets/menutree'\n # we need to put this into data-structure so that i can be manipulated by calling apps\n # This should not be at the widget level, too many types of menus. It should be at the app\n # level only if the user wants his app to use this kind of menu.\n\n @menu = RubyCurses::MenuTree.new \"Main\", { s: :goto_start, r: :scroll_right, l: :scroll_left, m: :submenu }\n @menu.submenu :m, \"submenu\", {s: :noignorecase, t: :goto_last_position, f: :next3 }\n menu = PromptMenu.new self \n menu.menu_tree @menu\n\n=begin\n menu = PromptMenu.new self \n menu.add( menu.create_mitem( 's', \"Goto start \", \"Going to start\", Proc.new { goto_start} ))\n menu.add(menu.create_mitem( 'r', \"scroll right\", \"I have scrolled \", :scroll_right ))\n menu.add(menu.create_mitem( 'l', \"scroll left\", \"I have scrolled \", :scroll_left ))\n item = menu.create_mitem( 'm', \"submenu\", \"submenu options\" )\n menu1 = PromptMenu.new( self, \"Submenu Options\")\n menu1.add(menu1.create_mitem( 's', \"CASE sensitive\", \"Ignoring Case in search\" ))\n menu1.add(menu1.create_mitem( 't', \"goto last position\", \"moved to previous position\", Proc.new { goto_last_position} ))\n item.action = menu1\n menu.add(item)\n # how do i know what's available. the application or window should know where to place\n #menu.display @form.window, 23, 1, $datacolor #, menu\n=end\n menu.display @form.window, $error_message_row, $error_message_col, $datacolor #, menu\n end",
"title": ""
},
{
"docid": "046906125bea035b98b33bdedb30ca37",
"score": "0.5543973",
"text": "def disp_menu #:nodoc:\n require 'rbcurse/extras/menutree'\n # we need to put this into data-structure so that i can be manipulated by calling apps\n # This should not be at the widget level, too many types of menus. It should be at the app\n # level only if the user wants his app to use this kind of menu.\n\n @menu = RubyCurses::MenuTree.new \"Main\", { s: :goto_start, r: :scroll_right, l: :scroll_left, m: :submenu }\n @menu.submenu :m, \"submenu\", {s: :noignorecase, t: :goto_last_position, f: :next3 }\n menu = PromptMenu.new self \n menu.menu_tree @menu\n\n=begin\n menu = PromptMenu.new self \n menu.add( menu.create_mitem( 's', \"Goto start \", \"Going to start\", Proc.new { goto_start} ))\n menu.add(menu.create_mitem( 'r', \"scroll right\", \"I have scrolled \", :scroll_right ))\n menu.add(menu.create_mitem( 'l', \"scroll left\", \"I have scrolled \", :scroll_left ))\n item = menu.create_mitem( 'm', \"submenu\", \"submenu options\" )\n menu1 = PromptMenu.new( self, \"Submenu Options\")\n menu1.add(menu1.create_mitem( 's', \"CASE sensitive\", \"Ignoring Case in search\" ))\n menu1.add(menu1.create_mitem( 't', \"goto last position\", \"moved to previous position\", Proc.new { goto_last_position} ))\n item.action = menu1\n menu.add(item)\n # how do i know what's available. the application or window should know where to place\n #menu.display @form.window, 23, 1, $datacolor #, menu\n=end\n menu.display @form.window, $error_message_row, $error_message_col, $datacolor #, menu\n end",
"title": ""
},
{
"docid": "9383d4349028f8ad32fccf4cfe3da5c3",
"score": "0.55410045",
"text": "def openChildNodes node\n\n tree = \"\"\n i = 0\n if node.children?\n node.children.each do |child|\n tree += \"<p class='child-tree'>#{child.name}\"\n\n if child.children? || !child.glossaries.empty?\n tree += \"<input type='button' class='folder-close' onclick='folderListener(#{ child.id }, #{ child.depth })'></p>\"\n end\n\n i += 1\n end\n end\n\n unless node.glossaries.empty?\n node.glossaries.each do |gloss|\n tree += \"<a id='gloss#{gloss.id}' class='child-tree' href='#{node.root.user.urlname}/#{ gloss.urlname }'>#{gloss.title}</a>\"\n\n i += 1\n end\n end\n\n tree += \"</div>\"\n tree.prepend(tree = \"<div class='parent-container depth#{node.depth}' id='gloss#{ node.id }' style='grid-template-columns: repeat(#{i} , 1fr)'>\")\n\n end",
"title": ""
},
{
"docid": "768edda3e86bea34a2562a91e214b76d",
"score": "0.5528193",
"text": "def menu_tree mt, pm = self\n mt.each_pair { |ch, code| \n if code.is_a? RubyCurses::MenuTree\n item = pm.add(ch, code.value, \"\") \n current = PromptMenu.new @caller, code.value\n item.action = current\n menu_tree code, current\n else\n item = pm.add(ch, code.to_s, \"\", code) \n end\n }\n end",
"title": ""
},
{
"docid": "9b9f368ee078385927dda23c5d5922ee",
"score": "0.5520325",
"text": "def updateTree\n Builtins.y2milestone(\"entering updateTree\")\n # remember selected tree item\n item = currentTreeItem\n tree = []\n # let tree widget reflect AutoPartPlan\n Builtins.foreach(@AutoPartPlan) do |drive|\n tree = Builtins.add(tree, AutoinstDrive.createTree(drive))\n end\n Builtins.y2milestone(\"Setting tree: '%1'\", tree)\n if Ops.greater_than(Builtins.size(@AutoPartPlan), 0)\n setTree(tree)\n # restore former selection\n if nil != item && \"\" != item\n Builtins.y2milestone(\"reselecting item '%1' after tree update.\", item)\n selectTreeItem(item)\n else\n firstDrive = internalGetDriveByListIndex(@AutoPartPlan, 0)\n selectTreeItem(AutoinstDrive.getNodeReference(firstDrive))\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "ea522037109986cb7ed1cd87d28f524c",
"score": "0.5517466",
"text": "def folder_structure_helper()\n output = \"<script>$(function () { $('#folders').jstree(); });</script>\n <div id=\\\"folders\\\">\"\n output += content_tag :ul do\n @client.root_folder_items().each do |item|\n concat(sub_folder_traverser_helper(item))\n end\n end\n output+= \"</div>\"\n output\n end",
"title": ""
},
{
"docid": "1ec6bc58978a9abd4d91d1d912631562",
"score": "0.55169874",
"text": "def tree; end",
"title": ""
},
{
"docid": "1ec6bc58978a9abd4d91d1d912631562",
"score": "0.55169874",
"text": "def tree; end",
"title": ""
},
{
"docid": "a5654ed3433c1b4d03bed7c4d0d46e1f",
"score": "0.5477223",
"text": "def subtree\n \n end",
"title": ""
},
{
"docid": "ba2cd3ac98ad899b32ba3d0978bd8ad5",
"score": "0.54703426",
"text": "def as_dropdown_old\n html = link_4edit\n return \"#{html}#{@opts[:name]}<br>Menu not found!\" if @menu.nil?\n # \n items = @menu.dc_simple_menu_items.sort {|a,b| a.order <=> b.order}\n# CSS dropdown-s don't work very well on mobiles. Create simple select menu instead \n if @parent.session[:is_mobile] == 1\n html << \"<div class=\\\"#{@menu.name.downcase}-mobile\\\">\\n\"\n html << '<select onchange=\"window.location.href=this.options[this.selectedIndex].value\">'\n html << \"<option value=\\\"\\\">#{t('drgcms.simple_menu_mobile_menu_text',' M E N U ')}</option>\"\n# \n items.each do |item|\n next unless item.active\n # menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item)\n next unless can_view\n html << \"<option value=\\\"#{item.link}\\\">#{item.caption}</option>\"\n y = YAML.load(item.submenu) || {}\n y.each { |k,v| html << \"<option value=\\\"#{v['link']}\\\">--#{v['title']}</option>\" }\n end \n html << \"</select>\\n</div>\\n\"\n else \n @selected = find_selected\n html << \"<table class=\\\"#{@menu.name.downcase}\\\"><tr>\"\n # sort items acording to :order \n items.each do |item|\n next unless item.active\n # menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item)\n next unless can_view\n \n klas = item.id == @selected.id ? 'menu-selected' : 'menu-item'\n# caption = item.caption.match('pic:') ? @parent.image_tag(item.caption.sub('pic:','')) : item.caption\n html << \"<td class=\\\"td-#{klas}\\\">#{ link_4menu(item) }\"\n y = YAML.load(item.submenu) || {}\n if y.size > 0\n html << '<ul>'\n y.each do |k,v|\n html << \"<li>#{@parent.link_to(v['title'], v['link'], {target: v['target']})}</li>\"\n end\n html << '</ul>'\n end\n html << '</td>'\n end\n html << '</tr></table>'\n end\nend",
"title": ""
},
{
"docid": "50d60d4d50cebe4b42edc3716d35d73c",
"score": "0.5466518",
"text": "def drawTree\n\t$trees.each { |t| t.draw }\nend",
"title": ""
},
{
"docid": "94ce75429f46ff66be68c92219195592",
"score": "0.5457592",
"text": "def update_node\n node = self.node ? self.node : self.build_node\n unless name.blank?\n node.title = name\n node.menu_name = name\n node.set_safe_shortcut(name)\n end\n node.displayed = self.display || true\n node.parent = Node.items_node\n end",
"title": ""
},
{
"docid": "253efa3f6c46aa6d1c6eba0057fb065c",
"score": "0.54407364",
"text": "def _add(options)\n item = ActiveAdmin::MenuItem.new(options)\n item.send :children=, self[item.id].children if self[item.id]\n self[item.id] = item\n end",
"title": ""
},
{
"docid": "253efa3f6c46aa6d1c6eba0057fb065c",
"score": "0.54407364",
"text": "def _add(options)\n item = ActiveAdmin::MenuItem.new(options)\n item.send :children=, self[item.id].children if self[item.id]\n self[item.id] = item\n end",
"title": ""
},
{
"docid": "8f42c5c629f9083f78658c02b11eaf81",
"score": "0.5433951",
"text": "def reveal_tree(tree)\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "5d47b3eac04537ad4c5b202a2318b0db",
"score": "0.54330146",
"text": "def setupMenu(menu) \n while menu.itemArray.size > 0\n menu.removeItem menu.itemArray.first\n end\n @repos.each_with_index do |r, ri| \n mi = NSMenuItem.new\n mi.title = r.name\n mi.target = self\n mi.action = \"proceed:\"\n mi.setRepresentedObject ri\n r.attach mi\n menu.addItem mi\n end\n\n mi = NSMenuItem.new\n mi.title = \"Pull'n'fetch\"\n mi.action = 'pull_all:'\n mi.target = self\n menu.addItem mi\n\n mi = NSMenuItem.new\n mi.title = \"Refresh\"\n mi.action = 'update_all:'\n mi.target = self\n menu.addItem mi\n\n mi = NSMenuItem.new\n mi.title = 'Reload cfg&repos'\n mi.action = 'reload:'\n mi.target = self\n menu.addItem mi\n\n mi = NSMenuItem.new\n mi.title = 'Quit'\n mi.action = 'quit:'\n mi.target = self\n menu.addItem mi\n\n menu\nend",
"title": ""
},
{
"docid": "8f86358b40f2a9d0eadd7a8d4beb23cf",
"score": "0.5432462",
"text": "def populate_roots(tree)\n TkComm.simplelist(Tk.tk_call('file', 'volumes')).sort.each{|dir|\n populate_tree(tree, tree.insert(nil, :end, :text=>dir,\n :values=>[dir, 'directory']))\n }\nend",
"title": ""
},
{
"docid": "c88527adf4439562f249194c2414e3ea",
"score": "0.54316384",
"text": "def build_tree_actions_by_roles(actions_by_roles)\n\tfname=\"plm_tree:\"#{self.class.name}.#{__method__}\"\n\tLOG.debug(fname) {\"begin\"}\n\tlab=t(:ctrl_actions_by_roles)\n\ttree = Tree.new({:js_name=>\"tree_down\", :label => lab, :open => true })\n\tid=0\n\tactions_by_roles.each_key do |role|\n\t\tLOG.debug(fname) {\"role=#{role}\"}\n\t\t##role = Role.find_by_title(srole)\n\t\tid+=1\n\t\toptions={\n\t\t\t:id => id ,\n\t\t\t:label => \"#{role}\",\n\t\t\t:icon => icone(role),\n\t\t\t:icon_open => icone(role),\n\t\t\t:title => clean_text_for_tree(\"#{role.tooltip}\"),\n\t\t\t:url => url_for(role_path(role)),\n\t\t\t:open => true,\n\t\t\t:obj_child => role\n\t\t}\n\t\trole_node = Node.new(options)\n\t\ttree << role_node\n\t\tactions_by_roles[role].each do |controller|\n\t\t\tunless controller[1].nil?\n\t\t\t\tif controller[1].count>0\n\t\t\t\t\tid+=1\n\t\t\t\t\thelp_controller=\"help_\"+(controller[0].chomp(\"Controller\")).downcase!\n\t\t\t\t\toptions={\n\t\t\t\t\t\t:id => id ,\n\t\t\t\t\t\t:label => \"#{controller[0]}\",\n\t\t\t\t\t\t#http://0.0.0.0:3000/help?help=help_parts\n\t\t\t\t\t\t:url => url_for(\"/help?help=\"+help_controller),\n\t\t\t\t\t\t:open => false\n\t\t\t\t\t}\n\t\t\t\t\tctrl_node = Node.new(options)\n\t\t\t\t\trole_node << ctrl_node\n\t\t\t\t\tcontroller[1].sort.each do |action|\n\t\t\t\t\t\tid+=1\n\t\t\t\t\t\thelp_action=help_controller+\"_\"+action\n\t\t\t\t\t\toptions={\n\t\t\t\t\t\t:id => id ,\n\t\t\t\t\t\t\t:label => \"#{action}\",\n\t\t\t\t\t\t\t:url => url_for(\"/help?help=\"+help_action),\n\t\t\t\t\t\t\t:open => false\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction_node = Node.new(options)\n\t\t\t\t\t\tctrl_node << action_node\n\t\t\t\t\t#puts \"controller=#{controller[0]} , #{controller[1].count} actions=#{controller[1]}\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\tLOG.debug(fname) {\"tree size=#{tree.size}\"}\n\ttree\nend",
"title": ""
},
{
"docid": "489ab9ae8eac4efa3a4518034b539e95",
"score": "0.5401494",
"text": "def commands_tree\n @tree\n end",
"title": ""
},
{
"docid": "7d91549b203982e67459519fa8e713ce",
"score": "0.54013234",
"text": "def sortable_tree_member_actions\n member_action :move_up do\n unless resource.left_sibling\n redirect_to :back, :notice => I18n.t('awesome_nested_set.illegal_move_up', :resource => resource_class.to_s.camelize.constantize.model_name.human )\n return\n end\n\n resource.move_left\n redirect_to :back, :notice => I18n.t('awesome_nested_set.moved_up', :resource => resource_class.to_s.camelize.constantize.model_name.human )\n end\n\n member_action :move_down do\n unless resource.right_sibling\n redirect_to :back, :notice => I18n.t('awesome_nested_set.illegal_move_down', :resource => resource_class.to_s.camelize.constantize.model_name.human )\n return\n end\n\n resource.move_right\n redirect_to :back, :notice => I18n.t('awesome_nested_set.moved_down', :resource => resource_class.to_s.camelize.constantize.model_name.human )\n end\n end",
"title": ""
},
{
"docid": "f36b29ff763b59b3bf0fdf3bc010ba40",
"score": "0.5394095",
"text": "def gtk_window\n @tags_tree_view\n end",
"title": ""
},
{
"docid": "714555eebfd5d65355ae9d377109204f",
"score": "0.5385268",
"text": "def remove_drop\nbegin\n id = params[:id]\n drop = Drop.find(id)\n if session[:current_line_config].drops.delete(drop)\n\n flash[:notice]= \"drop removed from line config\"\n render :inline => %{\n <% @hide_content_pane = true %>\n <% @is_menu_loaded_view = true %>\n <% @tree_actions = \"window.parent.RemoveNode(null);\" %>\n\n },:layout => \"tree_node_content\"\n\n end\n\n rescue\n handle_error(\"drop could not be removed from line config\")\n end\n\nend",
"title": ""
},
{
"docid": "b45d3659a0969df6a5307029092bce73",
"score": "0.5364674",
"text": "def repaint # menu.repaint\n # OMG will not print anything if no items !\n # When we do item generation this list will be empty\n #return if @items.nil? or @items.empty? # commented 2011-09-24 NEWMENU\n #$log.debug \"menu repaint: #{text} row #{@row} col #{@col} \" \n @color_pair = get_color($reversecolor, @color, @bgcolor)\n if !@parent.is_a? Canis::MenuBar \n @parent.window.printstring( @row, 0, \"|%-*s>|\" % [@width-1, text], @color_pair)\n @parent.window.refresh\n end\n if @window.nil?\n #create_window\n else\n @window.show\n select_item 0\n @window.refresh\n end\n end",
"title": ""
},
{
"docid": "e635397ae60526dd13bd5078b2f77123",
"score": "0.53643996",
"text": "def sortable_tree_columns\n column \"▲\".html_safe do |resource|\n link_to(\"▲\".html_safe, self.send(:\"move_up_#{ActiveAdmin.application.default_namespace}_#{resource.class.model_name.to_s.underscore.gsub(\"/\", \"_\")}_path\", resource), :class => \"arrow\") if resource.left_sibling\n end\n column \"▼\".html_safe do |resource|\n link_to(\"▼\".html_safe, self.send(:\"move_down_#{ActiveAdmin.application.default_namespace}_#{resource.class.model_name.to_s.underscore.gsub(\"/\", \"_\")}_path\", resource), :class => \"arrow\") if resource.right_sibling\n end\n end",
"title": ""
},
{
"docid": "2d82f33c9e6a7b4cfec88063d750c819",
"score": "0.53582877",
"text": "def menu_tree mt, pm = self\n mt.each_pair { |ch, code| \n if code.is_a? Canis::MenuTree\n item = pm.add(ch, code.value, \"\") \n current = PromptMenu.new @caller, code.value\n item.action = current\n menu_tree code, current\n else\n item = pm.add(ch, code.to_s, \"\", code) \n end\n }\n end",
"title": ""
},
{
"docid": "a6c6aa73892d1c63d02ed1788ee2ef93",
"score": "0.53546375",
"text": "def draggable_element_js(*args)\n rightjs_include_module 'dnd'\n \n super *args\n end",
"title": ""
},
{
"docid": "8453a06194e59b6ffcf2a213ad288e7c",
"score": "0.53538775",
"text": "def editableChildren node\n tree = \"\"\n if node.children?\n node.children.each do |child|\n tree += \"<div class='branch' id='node#{ child.id }'><p>#{ child.name }\"\n tree += \"<input type='radio' id='radio#{ child.id }' name='id' value='#{ child.id }'>\"\n\n if child.children? || !child.glossaries.empty?\n tree += \"<input class='folder-close' type='button' onclick='folderListener(#{ child.child_ids }, #{ child.glossaries.ids })'></p>#{ editableChildren child }\"\n else\n tree += \"</p>\"\n end\n\n puts child.glossaries\n\n unless child.glossaries.empty?\n child.glossaries.each do |gloss|\n tree += \"<a id='gloss#{ gloss.id }'class='branch' href='/#{child.root.user.urlname}/#{gloss.urlname}'>#{gloss.title}</a>\"\n end\n end\n tree += '</div>'\n end\n end\n tree\n end",
"title": ""
},
{
"docid": "24cb04ca57d850dc9f0938da2028169e",
"score": "0.5343937",
"text": "def show\n @explorer = true\n @lastaction = \"explorer\"\n\n build_accordions_and_trees\n\n params[:action] = 'tree-select'\n provider_node(params[:id], ExtManagementSystem.find_by(:id => params[:id]).type)\n\n render :layout => \"application\"\n end",
"title": ""
},
{
"docid": "d2e5c7878ff6ac939c7425c75d02c24a",
"score": "0.5342662",
"text": "def init_tree\n #Removes all the columns from the tree view.\n @treeview.columns.each {|col| @treeview.remove_column(col)}\n \n #Add the data to the @treestore model.\n unless @doc == nil\n root = @doc.root\n @treestore = Gtk::TreeStore.new(String, String)\n parent = @treestore.append(nil)\n parent[0] = root.attributes['name']\n parent[1] = nil\n\n root.elements.each do |element|\n iter = @treestore.append(parent)\n iter[0] = element.name\n iter[1] = nil\n \n if element.name == 'PrinceText' && element.has_attributes?\n iter2 = @treestore.append(iter)\n iter2[0] = element.attributes['name']\n iter2[1] = element.attributes['path']\n else\n element.elements.each do |element2|\n iter2 = @treestore.append(iter)\n iter2[0] = element2.attributes['name']\n iter2[1] = element2.attributes['path']\n end\n end\n end\n end\n \n #Adds the renderer to the tree view.\n @treeview.model = @treestore\n renderer = Gtk::CellRendererText.new\n col = Gtk::TreeViewColumn.new(\"Project\", renderer, :text => 0)\n @treeview.append_column(col)\n end",
"title": ""
},
{
"docid": "436f3a2c2cc5d9ab347186a1b9a68078",
"score": "0.534173",
"text": "def make_hosts_list\n @model = Gtk::TreeStore.new(SSHMenu::Item)\n\n @view = Gtk::TreeView.new(@model)\n @view.rules_hint = false\n @view.search_column = 0\n\n if GLib.check_binding_version?(0, 19, 0)\n @view.reorderable = true\n end\n\n renderer = Gtk::CellRendererText.new\n\n column = Gtk::TreeViewColumn.new(\"Host\", renderer)\n @view.append_column(column)\n column.set_cell_data_func(renderer) do |tvc, renderer, model, iter|\n i = iter[ItemColumn]\n if i.separator?\n renderer.text = \"_____________________________\"\n else\n renderer.text = i.title\n end\n end\n\n @view.selection.signal_connect('changed') {\n on_selection_changed(@view.selection.selected)\n }\n\n path = {}\n @config.each_item() do |parents, i|\n key = i.object_id\n parent = nil\n parent = @model.get_iter(path[parents[-1].object_id]) if parents.length > 0\n row = @model.append(parent)\n row[ItemColumn] = i.dup\n path[key] = row.path\n end\n\n @view.signal_connect('drag-drop') do\n Gtk.timeout_add(50) { fix_dropped_items }\n false\n end\n\n return @view.collapse_all\n end",
"title": ""
},
{
"docid": "bb3c6f0f3f4127b8f0196263684e5d4e",
"score": "0.534046",
"text": "def expand_hierarchy\n scroll_to_bottom\n wait_for_element_and_click hierarchy_section_button unless exists? broader_input\n end",
"title": ""
},
{
"docid": "75c4ce379f89c42978f03ff8fb3165c9",
"score": "0.53181946",
"text": "def showDropDown; end",
"title": ""
},
{
"docid": "e4f084f9be286566449d88514ed1c3a5",
"score": "0.5318152",
"text": "def change_menu_deep(obj, new_menu_id)\n if (obj && obj.menu_id!=new_menu_id)\n ary_for_up = items_deep(@menu, obj)\n ary_for_up.each do |item|\n item.menu_id = new_menu_id\n item.save\n end\n update_position_for_remove(obj)\n parent_id = 0\n @new_menu = current_site.menus.find new_menu_id\n position = @new_menu.menu_items.maximum('position', :conditions=> [' parent_id = ? AND menu_items.id <> ?', parent_id, obj.id]).to_i + 1\n\n obj.update_attributes({:parent_id => parent_id, :menu_id => new_menu_id, :position => position})\n end\n end",
"title": ""
},
{
"docid": "1749af8cd137016839a4ad3b1a8b6c11",
"score": "0.5317982",
"text": "def tree_select\n assert_accordion_and_tree_privileges(x_active_tree)\n params[:miq_grid_checks] = []\n @explorer = true\n @lastaction = \"explorer\"\n @sb[:action] = nil\n\n @nodetype, id = parse_nodetype_and_id(params[:id])\n record_requested = %w[Vm MiqTemplate].include?(TreeBuilder.get_model_for_prefix(@nodetype))\n\n if record_requested && !@record\n @vm = @record = identify_record(id, VmOrTemplate)\n end\n\n # Handle filtered tree nodes\n if x_active_tree.to_s =~ /_filter_tree$/ && !record_requested\n\n search_id = @nodetype == \"root\" ? 0 : id\n adv_search_build(model_from_active_tree(x_active_tree))\n session[:edit] = @edit # Set because next method will restore @edit from session\n listnav_search_selected(search_id) unless params.key?(:search_text) # Clear or set the adv search filter\n if @edit[:adv_search_applied] &&\n MiqExpression.quick_search?(@edit[:adv_search_applied][:exp]) &&\n %w[reload tree_select].include?(params[:action])\n self.x_node = params[:id]\n quick_search_show\n return\n end\n end\n\n if record_requested && @record.nil?\n unless flash_errors?\n add_flash(_(\"The entity is not available or user is not authorized to access it.\"), :error)\n end\n javascript_flash(:spinner_off => true, :activate_node => {:tree => x_active_tree.to_s, :node => x_node})\n end\n\n self.x_node = (@record.present? ? parent_folder_id(@record) : params[:id])\n replace_right_cell\n end",
"title": ""
},
{
"docid": "312fda00b0072cc9cc7b39d012265a66",
"score": "0.53102803",
"text": "def tree_select(node_info = false)\n @sb[:action] = nil if @sb\n @explorer = true\n @lastaction = \"explorer\"\n self.x_active_tree = params[:tree] if params[:tree]\n self.x_node = params[:id]\n\n assert_accordion_and_tree_privileges(x_active_tree)\n\n if node_info\n get_node_info(x_node)\n replace_right_cell(:nodetype => x_node)\n else\n replace_right_cell\n end\n end",
"title": ""
},
{
"docid": "cb3a6d8e063d8742e17b06518031647d",
"score": "0.5305518",
"text": "def do_menu_level(menu, options={})\n html = \"<ul>\"\n if @opts[:edit_mode] > 1\n options[:title] = menu.respond_to?('name') ? menu.name : menu.caption # 1. level or submenus\n options[:id] = menu._id\n html << link_4edit(options)\n end\n# sort items acording to :order \n menu.dc_menu_items.order_by(order: 1).each do |item|\n next unless item.active\n# menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item)\n next unless can_view\n \n html << if item.id == @selected.id \n \"<li class=\\\"menu-selected\\\">#{ link_4menu(item) }\"\n else\n \"<li>#{ link_4menu(item) }\"\n end\n# do submenu \n if (sub = item.dc_menu_items).size > 0\n if @opts[:edit_mode] > 1\n opts = options.clone\n opts['ids'] = (opts['ids'] ? \"#{opts['ids']};\" : '') + menu._id.to_s\n opts['table'] = (opts['table'] ? \"#{opts['table']};\" : '') + 'dc_menu_item'\n opts['form_name'] = nil # must be\n end\n html << do_menu_level(item, opts)\n end\n html << '</li>'\n end\n html << '</ul>'\nend",
"title": ""
},
{
"docid": "0faa6eaeecdc66e191f1ef492f7589c5",
"score": "0.5305425",
"text": "def clear_tree\n @model.clear\n # Add AutoPWN\n #@autopwn_iter = @model.append(nil)\n #@autopwn_iter.set_value(PIX, driver.get_icon(\"menu_autopwn.xpm\"))\n #@autopwn_iter.set_value(JID, \"AutoPWN\")\n\n # Add Parent \"One shot\"\n @oneshot_iter = @model.append(nil)\n @oneshot_iter.set_value(PIX, driver.get_icon(\"menu_oneshot.xpm\"))\n @oneshot_iter.set_value(JID, \"Jobs\")\n end",
"title": ""
},
{
"docid": "1197b3d59438f22570e9228eaf880d6a",
"score": "0.5287111",
"text": "def context_menu( menu )\r\n patches_selected = @selection.any?{ |e|\r\n e.is_a?( BezierPatch )\r\n }\r\n\r\n # Patches\r\n if patches_selected\r\n m = menu.add_item( 'Automatic Interior' ) { toggle_automatic_patch() }\r\n menu.set_validation_proc( m ) { validate_automatic_patch() }\r\n\r\n menu.add_separator\r\n end\r\n\r\n m = menu.add_item( 'Select All' ) {\r\n @selection.add( @surface.manipulable_entities )\r\n }\r\n menu.set_validation_proc( m ) { MF_ENABLED | MF_UNCHECKED }\r\n\r\n m = menu.add_item( 'Select None' ) {\r\n @selection.clear\r\n }\r\n menu.set_validation_proc( m ) { MF_ENABLED | MF_UNCHECKED }\r\n\r\n m = menu.add_item( 'Invert Selection' ) {\r\n @selection.toggle( @surface.manipulable_entities )\r\n }\r\n menu.set_validation_proc( m ) { MF_ENABLED | MF_UNCHECKED }\r\n\r\n=begin\r\n menu.add_separator\r\n\r\n submenu = menu.add_submenu( 'Manipulate' )\r\n\r\n m = submenu.add_item( 'Vertices' ) { puts 'Vertices' }\r\n submenu.set_validation_proc( m ) { MF_GRAYED | MF_CHECKED }\r\n\r\n m = submenu.add_item( 'Handles' ) { puts 'Handles' }\r\n submenu.set_validation_proc( m ) { MF_GRAYED | MF_UNCHECKED }\r\n\r\n m = submenu.add_item( 'Edges' ) { puts 'Patches' }\r\n submenu.set_validation_proc( m ) { MF_GRAYED | MF_CHECKED }\r\n\r\n m = submenu.add_item( 'Patches' ) { puts 'Patches' }\r\n submenu.set_validation_proc( m ) { MF_GRAYED | MF_CHECKED }\r\n\r\n\r\n submenu = menu.add_submenu( 'Display' )\r\n\r\n m = submenu.add_item( 'Automatic Interior' ) { puts 'n01' }\r\n submenu.set_validation_proc( m ) { MF_GRAYED | MF_CHECKED }\r\n\r\n m = submenu.add_item( 'Interior Grid' ) { puts 'n02' }\r\n submenu.set_validation_proc( m ) { MF_GRAYED | MF_CHECKED }\r\n=end\r\n\r\n\r\n menu.add_separator\r\n\r\n m = menu.add_item( Commands.toggle_properties )\r\n\r\n\r\n menu.add_separator\r\n\r\n m = menu.add_item( 'Close Instance' ) { end_session() }\r\n menu.set_validation_proc( m ) { MF_ENABLED | MF_UNCHECKED }\r\n\r\n menu\r\n end",
"title": ""
},
{
"docid": "34e28a169472b06637f7e13e59bc1a8c",
"score": "0.5283199",
"text": "def update_edit\n update_dragging if @dragging_item\n drag_select unless @dragging_item\n end",
"title": ""
},
{
"docid": "34e28a169472b06637f7e13e59bc1a8c",
"score": "0.5283181",
"text": "def update_edit\n update_dragging if @dragging_item\n drag_select unless @dragging_item\n end",
"title": ""
},
{
"docid": "a0b9bfcb6b8058381d9a48a9a75bcf8e",
"score": "0.52754825",
"text": "def setup_tree_view(treeview)\n # Create a new GtkCellRendererText, add it to the tree\n # view column and append the column to the tree view.\n renderer = Gtk::CellRendererText.new\n column = Gtk::TreeViewColumn.new(\"Buy\", renderer, \"text\" => BUY_INDEX)\n treeview.append_column(column)\n renderer = Gtk::CellRendererText.new\n column = Gtk::TreeViewColumn.new(\"Count\", renderer, \"text\" => QTY_INDEX)\n treeview.append_column(column) \n renderer = Gtk::CellRendererText.new\n column = Gtk::TreeViewColumn.new(\"Product\", renderer, \"text\" => PROD_INDEX)\n treeview.append_column(column)\nend",
"title": ""
},
{
"docid": "1f39aa5a4dee2e769e143d183cc70413",
"score": "0.5260836",
"text": "def button1__drag_drop(widget, *args)\n but1 = @builder[\"button1\"]\n if but1.dragged_widget.is_a?(Gtk::TextView)\n but1.label = but1.dragged_widget.buffer.text.slice(0,15) \n elsif but1.dragged_widget.is_a?(VR::FileTreeView)\n but1.label = @view.get_selected_path()\n end\n end",
"title": ""
},
{
"docid": "0e649ae230a9fac4a10cb535a0dea1c6",
"score": "0.52309877",
"text": "def menu_field_changed\n assert_privileges(\"miq_report_menu_editor\")\n\n return unless load_edit(\"menu_edit__#{session[:role_choice] ? session[:role_choice] : \"new\"}\", \"replace_cell__explorer\")\n menu_get_form_vars\n @in_a_form = true\n @edit[:tree_arr] = []\n @edit[:tree_hash] = {}\n @edit[:temp_new] = []\n\n if params[:tree]\n @menu_lastaction = \"commit\"\n @sb[:tree_err] = false\n\n rows = JSON.parse(params[:tree], :symbolize_names => true)\n rows.each do |row|\n if row[:text].nil?\n @sb[:tree_err] = true\n add_flash(_(\"Folder name is required\"), :error)\n elsif @edit[:tree_arr].include?(row[:text])\n @sb[:tree_err] = true\n add_flash(_(\"Folder name '%{value}' is already in use\") % {:value => row[:text]}, :error)\n else\n @edit[:tree_arr].push(row[:text])\n @edit[:tree_hash][row[:id].split('_')[1]] = row[:text]\n end\n end\n\n @edit[:temp_new] = []\n if @edit[:tree_arr].blank?\n # if all subfolders were deleted\n @edit[:temp_new].push(@edit[:temp_arr][0], [])\n else\n @edit[:tree_arr].each do |el|\n old_folder = @edit[:tree_hash].key(el)\n @edit[:temp_arr].each do |arr|\n arr = Array.wrap(arr)\n temp = []\n if session[:node_selected].split('__')[1] == \"Report Menus for #{session[:role_choice]}\"\n if arr[0] == old_folder\n temp.push(el)\n temp.push(arr[1])\n elsif old_folder.nil?\n temp.push(el) unless temp.include?(el)\n temp.push([]) unless temp.include?([])\n end\n @edit[:temp_new].push(temp) if !temp.empty? && !@edit[:temp_new].include?(temp)\n else\n @edit[:temp_new][0] = @edit[:temp_arr][0]\n arr.each do |a|\n if a[0] == old_folder\n temp.push(el)\n temp.push(a[1])\n elsif old_folder.nil?\n temp.push(el) unless temp.include?(el)\n temp.push([]) unless temp.include?([])\n end\n @edit[:temp_new][1] = [] if @edit[:temp_new][1].nil?\n @edit[:temp_new][1].push(temp) if !temp.empty? && !@edit[:temp_new][1].include?(temp)\n end\n end\n end\n end\n end\n\n if !@edit[:idx].nil?\n @edit[:new][@edit[:idx]] = copy_array(@edit[:temp_new])\n else\n @edit[:new] = copy_array(@edit[:temp_new])\n end\n end\n\n if params[:pressed] == \"commit\" && (@edit[:selected_reports] || @edit[:available_reports])\n @menu_lastaction = \"commit\"\n val = session[:node_selected].split('__')[1]\n old_val = val.split(':')\n idx = @edit[:new].index(@edit[:temp_arr]) # index of temp_array that being worked on, in set_data\n idx2 = @edit[:temp_arr].index(old_val[0]) # index of parent folder in temp_array\n unless @edit[:user_typ]\n # remove * at the starting of report names, before saving them for user\n @edit[:selected_reports].each_with_index do |rep, i|\n @edit[:selected_reports][i] = rep[1..rep.length - 1].strip! if rep.starts_with?('* ')\n end\n end\n @edit[:temp_arr].each do |arr|\n next unless arr.class == Array\n arr.each do |a|\n next if a[0] != old_val[1]\n @edit[:temp] = a\n idx4 = @edit[:temp_arr][idx2 + 1].index(@edit[:temp]) # index of temp in temp_array\n if a[1].nil?\n @edit[:temp].push(@edit[:selected_reports])\n else\n @edit[:reports] = a[1]\n idx5 = @edit[:temp].index(@edit[:reports]) # index of reports array in temp\n @edit[:temp][idx5] = @edit[:selected_reports]\n end\n @edit[:temp_arr][idx2 + 1][idx4] = @edit[:temp].dup\n @edit[:new][idx] = @edit[:temp_arr].dup\n end\n end\n end\n\n @edit[:commited_new] = copy_array(@edit[:new])\n id = session[:node_selected].split('__')\n @selected = id[1].split(':')\n @changed = (@edit[:new] != @edit[:current]) if @menu_lastaction == \"commit\"\n get_tree_data if (!params[:selected_reports] && !params[:available_reports]) || @menu_lastaction == \"commit\"\n # load if something in report selection changed or if something was commited\n if !params[:tree]\n replace_right_cell(:menu_edit_action => \"menu_commit_reports\")\n else\n replace_right_cell(:menu_edit_action => \"menu_commit_folders\")\n end\n end",
"title": ""
},
{
"docid": "517f2d52dd379c76c7f49a1282360878",
"score": "0.52233267",
"text": "def sort\n menu = Menu.find_by_id(params['menu_id'])\n new_parent_id = params['parent_id'].to_i\n new_parent = Menu.find_by_id(new_parent_id) if(new_parent_id > 0)\n\n # logger.debug \"new_parent_id > 0 \" + (new_parent_id > 0).to_s\n\n # logger.debug \"menu: #{menu.attributes.inspect}\"\n # logger.debug \"new parent: #{new_parent.attributes.inspect}\" if(new_parent)\n\n # logger.debug \"menu.parent != new_parent \" + (menu.parent != new_parent).to_s\n menu.valid?\n\n if((new_parent_id > 0) && (menu.parent != new_parent))\n menu.move_to_child_of(new_parent)\n end\n\n if(params['position_id'].to_i > 0)\n sibling = Menu.find_by_id(params['position_id'])\n # logger.debug \"sibling: #{sibling.attributes.inspect}\"\n # if the move goes down the list, the insert has to be done before the sibling, instead of the sibling position\n new_position = (sibling.position > menu.position) ? sibling.position - 1 : sibling.position\n menu.insert_at(new_position)\n else\n # logger.debug \"set menu item as last\"\n if(new_parent_id > 0)\n # logger.debug \"move to end of submenu items \" + new_parent.children.length.to_s\n menu.insert_at(new_parent.children.length)\n else\n # logger.debug \"move to end of root menu items \" + Menu.roots.length.to_s\n menu.insert_at(Menu.roots.length)\n end\n end\n\n render nothing: true\n end",
"title": ""
},
{
"docid": "4782bbd88a9aba17b41b6ebde3c0aae1",
"score": "0.52169",
"text": "def setup_tree_view(treeview)\n # Create a new GtkCellRendererText, add it to the tree\n # view column and append the column to the tree view.\n renderer = Gtk::CellRendererText.new\n column = Gtk::TreeViewColumn.new(\"Buy\", renderer, \"text\" => $buy_index)\n treeview.append_column(column)\n\n \n renderer = Gtk::CellRendererText.new\n column = Gtk::TreeViewColumn.new(\"Count\", renderer, \"text\" => $qty_index)\n renderer.editable = true\n renderer.signal_connect('edited') do |w, s1, s2 |\n cell_edited(s1, s2, treeview, $qty_index)\n end\n treeview.append_column(column)\n\n # Setup the third column in the tree view to be editable.\n renderer = Gtk::CellRendererTextText.new\n renderer.editable = true\n renderer.signal_connect('edited') do |w, s1, s2 |\n cell_edited(s1, s2, treeview, $prod_index)\n end\n column = Gtk::TreeViewColumn.new(\"Product\", renderer, \"text\" => $prod_index)\n treeview.append_column(column)\nend",
"title": ""
},
{
"docid": "cfa4e855eb38c069f91a2adc6ad0ccf5",
"score": "0.5213079",
"text": "def sel_dnd_drop(&block)\n self.connect(SEL_DND_DROP, &block)\n end",
"title": ""
},
{
"docid": "c2ad9baf936f9f69849d54c4ead8a3cf",
"score": "0.5211081",
"text": "def tree\n JBundler::Tree.new( config ).show_it\n end",
"title": ""
},
{
"docid": "c2ad9baf936f9f69849d54c4ead8a3cf",
"score": "0.5211081",
"text": "def tree\n JBundler::Tree.new( config ).show_it\n end",
"title": ""
},
{
"docid": "31d61bb0d23d64a5dba5e9cd74a5aa89",
"score": "0.5209418",
"text": "def build_users_tree(users)\n begin\n \n session[\"users_tree_ids\"] = Array.new\n \n menu1 = ApplicationHelper::ContextMenu.new(\"users\",\"users\")\n menu1.add_command(\"create new user\",url_for(:action => \"add_user\"))\n \n menu2 = ApplicationHelper::ContextMenu.new(\"user\",\"users\")\n menu2.add_command(\"Delete user\",url_for(:action => \"delete_user\"))\n menu2.add_command(\"Edit user\",url_for(:action => \"edit_user\"))\n menu2.add_command(\"Retrieve password\",url_for(:action => \"get_password\"))\n menu2.add_command(\"Add program\",url_for(:action => \"add_program\"))\n menu2.add_command(\"Export permissions\",url_for(:action=>\"export_entire_permissions\"))\n \n menu3 = ApplicationHelper::ContextMenu.new(\"program\",\"users\")\n menu3.add_command(\"Remove program\",url_for(:action => \"remove_program\"))\n #-----------------------------------------\n #Happymore added this context menu item\n #-----------------------------------------\n \n menu3.add_command(\"Export permissions(Locally)\",url_for(:action=>\"export_permissions_locally\"))\n menu3.add_command(\"Export permissions(Remotely)\",url_for(:action=>\"export_permissions_remotely\"))\n \n #-----------------------------------------\n #End context menu item\n #-----------------------------------------\n \n menu4 = ApplicationHelper::ContextMenu.new(\"sec_group\",\"users\")\n menu4.add_command(\"Change security group\",url_for(:action => \"change_sec_group\"))\n \n \n root_node = ApplicationHelper::TreeNode.new(\"users\",\"users\",true,\"users\")\n users.each do |user|\n user_node = root_node.add_child(user.user_name.chomp,\"user\",user.id.to_s)\n tree_data = get_progs_by_functional_area(user)\n tree_data.each do |func_area_name,programs|\n func_area_caption = func_area_name.split(\",\")[0]\n func_area_id = func_area_name.split(\",\")[1]\n func_area_node = user_node.add_child(func_area_caption,\"func_area\",func_area_id)\n programs.each do |program|\n prog_node = func_area_node.add_child(program[:name],\"program\",program[:id])\n group_name = program[:name] + \": \" + program[:sec_group][:sec_group_name]\n sec_group_node = prog_node.add_child(group_name,\"sec_group\",program[:sec_group][:id])\n end\n end\n end\n\n tree = ApplicationHelper::TreeView.new(root_node,\"users\")\n tree.add_context_menu(menu1)\n tree.add_context_menu(menu2)\n tree.add_context_menu(menu3)\n tree.add_context_menu(menu4)\n \n tree.render\n \n rescue\n raise \"The users tree could not be rendered. Exception reported is \\n\" + $!\n end\n end",
"title": ""
},
{
"docid": "13a6e9df28814b3f8fffb0b818b91cd5",
"score": "0.52085245",
"text": "def initialize\t\t\t\t\n\t\tsuper\n\t\tobject, @menu, @menu2, @current = self.object, [], [], nil\n\t\t\n\t\tcounter = -1\n\t\tif parent = Menu.parent_get.call(object)\t\t\t \n\t\t\tif parent2 = Menu.parent_get.call(parent)\n\t\t\t\tobject_each_child parent2 do |e|\n\t\t\t\t\tcounter += 1\n\t\t\t\t\tif e == parent\n\t\t\t\t\t\t@menu << WLink.new(Menu.name_get.call(e), Extension.get_path(e)).set(:portlet => portlet)\n\t\t\t\t\t\t\n\t\t\t\t\t\tobject_each_child parent do |e|\n\t\t\t\t\t\t\t@menu2 << (counter += 1)\n\t\t\t\t\t\t\tif e == object\n\t\t\t\t\t\t\t\t@menu << WLabel.new(Menu.name_get.call(e))\n\t\t\t\t\t\t\t\t@current = counter\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t@menu << WLink.new(Menu.name_get.call(e), Extension.get_path(e)).set(:portlet => portlet)\n\t\t\t\t\t\t\tend \n\t\t\t\t\t\tend \n\t\t\t\t\telse \n\t\t\t\t\t\t@menu << WLink.new(Menu.name_get.call(e), Extension.get_path(e)).set(:portlet => portlet)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tcounter += 1\n\t\t\t\t@menu << WLink.new(parent.name, Extension.get_path(parent)).set(:portlet => portlet)\t\t\t\t\n\t\t\t\tobject_each_child parent do |e|\n\t\t\t\t\t@menu2 << (counter += 1)\n\t\t\t\t\tif e == object\n\t\t\t\t\t\t@menu << WLabel.new(Menu.name_get.call(e))\n\t\t\t\t\t\t@current = counter\n\t\t\t\t\telse\n\t\t\t\t\t\t@menu << WLink.new(Menu.name_get.call(e), Extension.get_path(e)).set(:portlet => portlet)\n\t\t\t\t\tend \n\t\t\t\tend\t\t\t\t\t\t\t\t\t\n\t\t\tend \t\t\t\n\t\telse\t\t\t\n\t\t\tobject_each_child object do |e|\t\t\t\t\n\t\t\t\t@menu2 << (counter += 1)\n\t\t\t\t@menu << WLink.new(Menu.name_get.call(e), Extension.get_path(e)).set(:portlet => portlet) \n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "50943cf3bccb30cbde829854f789d3f2",
"score": "0.5205596",
"text": "def render\n tree.render\n end",
"title": ""
},
{
"docid": "afe44d2a11b55ffce65e7a614b1261f8",
"score": "0.5196454",
"text": "def initialize form, config={}, &block\n @focusable = true\n @editable = false\n @row = 0\n @col = 0\n # array representation of tree\n @list = nil\n # any special attribs such as status to be printed in col1, or color (selection)\n @list_attribs = {}\n # hash containing nodes that are expanded or once expanded\n # if value is true, then currently expanded, else once expanded\n # TODO : will need purging under some situations\n @expanded_state = {}\n @suppress_borders = false\n @row_offset = @col_offset = 1\n @current_index = 0\n @one_key_selection = false # use vim keys \n super\n #@selection_mode ||= :single # default is multiple, anything else given becomes single\n @win = @graphic # 2010-01-04 12:36 BUFFERED replace form.window with graphic\n @sanitization_required = true\n @longest_line = 0\n \n \n #@win_left = 0\n #@win_top = 0\n @_events.push(*[:ENTER_ROW, :LEAVE_ROW, :TREE_COLLAPSED_EVENT, :TREE_EXPANDED_EVENT, :TREE_SELECTION_EVENT, :TREE_WILL_COLLAPSE_EVENT, :TREE_WILL_EXPAND_EVENT])\n\n \n bind(:PROPERTY_CHANGE){|e| @cell_renderer = nil } # will be recreated if anything changes 2011-09-28 V1.3.1 \n # FIXME the above is dangerous if user set his own renderer with some values XXX\n init_vars\n bordertitle_init\n\n #if !@list.selected_index.nil? \n #set_focus_on @list.selected_index # the new version\n #end\n @keys_mapped = false\n end",
"title": ""
},
{
"docid": "82f542c522560f99c805517eb7027533",
"score": "0.5193216",
"text": "def x_get_tree_roots(count_only, options)\n objects = []\n @rpt_menu.each_with_index do |r, i|\n objects.push(\n :id => i.to_s,\n :text => r[0],\n :icon => \"pficon #{@grp_title == r[0] ? 'pficon-folder-close-blue' : 'pficon-folder-close'}\",\n :tip => r[0]\n )\n # load next level of folders when building the tree\n @tree_state.x_tree(options[:tree])[:open_nodes].push(\"xx-#{i}\")\n end\n count_only_or_objects(count_only, objects)\n end",
"title": ""
},
{
"docid": "4d7856dc41034105141464e9b40cf345",
"score": "0.51897746",
"text": "def dropEvent(e)\n super\n \n #get the source widget for the drop event\n #this will be the pizza/chocolate/fish and chips\n #object\n w = e.getSource\n\n #move the food from the plate\n #to the character\n w.getParent.removeWidget w\n addWidget w\n\n #let's be nice and print a thank you message\n #the \"mime type\" represents the type of the\n #dropped object; it's set later in the code\n @message.setText \"Thanks for the \" + e.getMimeType\n\n end",
"title": ""
},
{
"docid": "54e2a504c4e9a53b5de41edb95b6a0b5",
"score": "0.51848507",
"text": "def on_selection_changed(iter)\n return unless iter\n @selected = iter.path\n item = get_item(iter)\n @button['edit'].sensitive = (item.host? or item.menu?)\n @button['copy'].sensitive = (item.host?)\n if iter[ItemColumn].menu? and iter.has_child?\n @button['del'].sensitive = false\n else\n @button['del'].sensitive = true\n end\n find_prev_next(iter)\n @button['up'].sensitive = !@prev_path.nil?\n @button['down'].sensitive = !@next_path.nil?\n end",
"title": ""
},
{
"docid": "92a13a93d4939603a6ef4e9615477ae9",
"score": "0.5182365",
"text": "def viewDidMoveToSuperview\n addDisclosureTriangle if superview && @node.expandable?\n end",
"title": ""
},
{
"docid": "22c472ae5d5a31bed583ea90e2c1c582",
"score": "0.51735866",
"text": "def render\n \n start_menu = \"<ul id=\\\"menu_<%=root[:id]%>\\\" class=\\\"menu #{menu.render_css_class}\\\">\"\n start_submenu = \"<li class=\\\"menuitem\\\"><a href=\\\"<%=branch[:link_route]%>\\\" title=\\\"branch[:description]\\\"><%=branch[:title]%></a><ul class=\\\"submenu submenu-level<%=branch[:level]%>\\\">\"\n menu_item = \"<li id=\\\"menu_item_<%=leaf[:id]%>\\\" class=\\\"menuitem\\\"><a href=\\\"<%=leaf[:link_route]%>\\\"><%=leaf[:title]%></a></li>\"\n end_submenu = \"</ul></li>\"\n end_menu = \"</ul>\" \n separator = if menu.render_item_separator.nil? or menu.render_item_separator.empty?\n \"<span class=\\\"menuitem_separator\\\"> · </span>\"\n else\n \"<span class=\\\"menuitem_separator\\\"> #{menu.render_item_separator} </span>\"\n end\n \n menu = {:id => @menu.name,\n :title => @menu.title,\n :children => adapt_children(@menu.root_menu_items.sort{|x,y| y.weight<=>x.weight})}\n \n renderer = TreeRender.new(start_menu, start_submenu, menu_item, end_submenu, end_menu, separator) \n renderer.render(menu)\n \n end",
"title": ""
},
{
"docid": "1323dfeacec85fd2a3b5afeebee54ad5",
"score": "0.51704013",
"text": "def fix_dropped_items\n bad_path = nil\n @model.each do |model, path, iter|\n item = iter[ItemColumn]\n if !item.menu? and iter.has_child?\n bad_path = iter.path\n end\n end\n return unless bad_path\n iter = @model.get_iter(bad_path)\n item = iter[ItemColumn]\n child = iter.first_child or return\n target = child[ItemColumn]\n @model.remove(child)\n nxt = @model.insert_after(iter.parent, iter)\n nxt[ItemColumn] = target\n sel = @view.selection\n sel.unselect_all\n sel.select_iter(nxt)\n @view.scroll_to_cell(nxt.path, nil, false, 0, 0)\n return false\n end",
"title": ""
},
{
"docid": "f89ce39776dc2db5beb73938868db202",
"score": "0.51672614",
"text": "def on_treeview_row_expanded(widget, tree_iter, tree_path)\n # If the only child has no data, it means it is a fake child, and we have to create real children\n if (tree_iter.first_child[0] == false)\n fake_child = tree_iter.first_child\n # Create real children\n line_obj_info = tree_iter[0]\n case line_obj_info[0]\n when NODE_TYPE_DIR\n # Directory\n matching_selection = @matching_selection\n line_obj_info[1].sub_dirs.values.each do |child_dir_info|\n add_obj_info(widget.model, tree_iter, child_dir_info, matching_selection)\n end\n line_obj_info[1].files.values.each do |child_file_info|\n add_obj_info(widget.model, tree_iter, child_file_info, matching_selection)\n end\n end\n # Delete the fake child (do it after inserting others otherwise expansion will be cancelled)\n widget.model.remove(fake_child)\n end\n end",
"title": ""
},
{
"docid": "7c698fb40eff4f562d9de7d603a33be6",
"score": "0.51632965",
"text": "def display_tree()\t\t\t\t\t\t\n\t\tlist = []\n\t\tyield @tree.value\n\t\tleft_child = @tree.left_child\n\t\tright_child = @tree.right_child\n\n\t\tlist << left_child if left_child != nil\n\t\tlist << right_child if right_child != nil\n\n\t\tloop do\n\t\t\tbreak if list.empty?\n\t\t\tnode = list.shift\n\t\t\tyield node.value\n\t\t\tlist << node.left_child if node.left_child != nil\n\t\t\tlist << node.right_child if node.right_child != nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "81ed2504e8f6e2bc79298ea70215f753",
"score": "0.51610875",
"text": "def drag_and_drop(source, sourceinfo, target, targetinfo, action)\n $marathon.dragAndDrop(ComponentId.new(source, sourceinfo), ComponentId.new(target, targetinfo), action)\nend",
"title": ""
},
{
"docid": "8782edfbf27b813e0ff5afdc122dab8d",
"score": "0.51555115",
"text": "def flat_node_tree\n flat_tree = ([{\n :key => \"node_#{id}\".to_sym,\n :name => menu_name,\n :url => url,\n :options => {:class => \"#{page_type} #{displayed ? '' : 'not-displayed'}\"},\n :items => []\n }] + children.displayed.collect {|node| node.tree_hash_value } )\n flat_tree\n end",
"title": ""
}
] |
add7bbeec90c0193ebf34588d9a62e0d
|
== Instance Methods =====================================================
|
[
{
"docid": "798901395c9f02326e0f6bd709314ff9",
"score": "0.0",
"text": "def today?\n created_at.to_datetime >= DateTime.now.beginning_of_day\n end",
"title": ""
}
] |
[
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.84468544",
"text": "def private; end",
"title": ""
},
{
"docid": "18250542a2b1999be90588db1d071d92",
"score": "0.73226625",
"text": "def initialize\n\t\t\n\tend",
"title": ""
},
{
"docid": "d88825898c6b9898e549cc4320aeaf0a",
"score": "0.7320286",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "cdd58dace22c11a7043a695fbef6319a",
"score": "0.72967416",
"text": "def initialize\n\n end",
"title": ""
},
{
"docid": "cdd58dace22c11a7043a695fbef6319a",
"score": "0.72967416",
"text": "def initialize\n\n end",
"title": ""
},
{
"docid": "08df82619f902788224a91d85e1c2550",
"score": "0.72934955",
"text": "def initialize\r\n\r\n end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.72732323",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.72732323",
"text": "def implementation; end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.7219184",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "d5b2c651ef02f091c61a5639e05783d2",
"score": "0.7161583",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71429914",
"text": "def initialize; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.71359086",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.71359086",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.71359086",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.71359086",
"text": "def init; end",
"title": ""
},
{
"docid": "bc1d2dff3253fceaa6ad08ac5a19d9c5",
"score": "0.71220744",
"text": "def initialize()\r\n\r\n end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.70667595",
"text": "def initialize() end",
"title": ""
},
{
"docid": "3c29a06b1e194a29c05635d71f51c108",
"score": "0.7020152",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "3c29a06b1e194a29c05635d71f51c108",
"score": "0.7020152",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "b400b560eb97c0db55cbdba5cd71fa1c",
"score": "0.6985131",
"text": "def initialize()\n\t\tend",
"title": ""
},
{
"docid": "5089834c8fb49e78a140c77b7194d0c9",
"score": "0.6977871",
"text": "def initialize\n\n\tend",
"title": ""
},
{
"docid": "5089834c8fb49e78a140c77b7194d0c9",
"score": "0.6977871",
"text": "def initialize\n\n\tend",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.69407856",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.69407856",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.69407856",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.69407856",
"text": "def specie; end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.6885913",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "868bee689e613366bcde437be63323ba",
"score": "0.68833953",
"text": "def init\n\n end",
"title": ""
},
{
"docid": "55d539453c287fc90b8cf716625cac85",
"score": "0.68815446",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "d08f0cfe2b2b8c3c738e72226f397b1f",
"score": "0.68795705",
"text": "def initialize\n\n\n\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.6848701",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.6848701",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.6848701",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.6848701",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.6848701",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.6848701",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "f466bb6c7455ea8d2d5ecdd1b8896422",
"score": "0.68452567",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "f466bb6c7455ea8d2d5ecdd1b8896422",
"score": "0.68452567",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "f466bb6c7455ea8d2d5ecdd1b8896422",
"score": "0.68452567",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "649182d51b1ab2ad45379a6b8b686a3f",
"score": "0.68449634",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "649182d51b1ab2ad45379a6b8b686a3f",
"score": "0.68449634",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "649182d51b1ab2ad45379a6b8b686a3f",
"score": "0.68449634",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.68213236",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.68213236",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.68213236",
"text": "def instance; end",
"title": ""
},
{
"docid": "bba9fbc807f0a73e812ebf601045bf31",
"score": "0.6818941",
"text": "def initialize()\n\n end",
"title": ""
},
{
"docid": "ecded16a32b0a359761d2f6ea47ccdcb",
"score": "0.67887926",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "81db6a0228d4eb5d7c2669bfd4516b44",
"score": "0.67881244",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "16d75915b84d17186b08d9a06d76f700",
"score": "0.67868555",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "16d75915b84d17186b08d9a06d76f700",
"score": "0.67868555",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.6781885",
"text": "def probers; end",
"title": ""
},
{
"docid": "7d2e344238e7987f7b5aa68318c9a331",
"score": "0.6779997",
"text": "def initialize\n\t\nend",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.6776549",
"text": "def schubert; end",
"title": ""
},
{
"docid": "2cc9969eb7789e4fe75844b6f57cb6b4",
"score": "0.676605",
"text": "def refutal()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.6746915",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.6746915",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.6746915",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.6746915",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.6746915",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.6746915",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "9cc874c097c09c2ee0f65dc4b3619aca",
"score": "0.6746915",
"text": "def initialize\n super()\n end",
"title": ""
},
{
"docid": "b9b8447d8930e09f935a1257aebf7fdd",
"score": "0.6717126",
"text": "def initialize\n super \n end",
"title": ""
},
{
"docid": "1556c42eb28e75c9b56e717f1f4a0c77",
"score": "0.6715833",
"text": "def initialize\n # nothing here for now\n end",
"title": ""
},
{
"docid": "9340b0874d627092ce82cffda8dda649",
"score": "0.6714426",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "9ebb90d88dd859732a968c062fcf5659",
"score": "0.6707709",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "9ebb90d88dd859732a968c062fcf5659",
"score": "0.6707709",
"text": "def initialize\n super\n end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.66909707",
"text": "def custom; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.66909707",
"text": "def custom; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.6685819",
"text": "def internal; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.6680737",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.6680737",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.6680737",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.6680737",
"text": "def methods; end",
"title": ""
},
{
"docid": "dc90d29d71dcbecfbdd1751b07b0b039",
"score": "0.6666698",
"text": "def init\n end",
"title": ""
}
] |
1ba6330443b1002ff9fc692851377569
|
Parse the foot note definition at the current location.
|
[
{
"docid": "e34a770dc4d6f0f9e97d834dd1835a0b",
"score": "0.71988964",
"text": "def parse_footnote_definition\n start_line_number = @src.current_line_number\n @src.pos += @src.matched_size\n\n el = Element.new(:footnote_def, nil, nil, location: start_line_number)\n parse_blocks(el, @src[2].gsub(INDENT, ''))\n if @footnotes[@src[1]]\n warning(\"Duplicate footnote name '#{@src[1]}' on line #{start_line_number} - overwriting\")\n end\n @tree.children << new_block_el(:eob, :footnote_def)\n (@footnotes[@src[1]] = {})[:content] = el\n @footnotes[@src[1]][:eob] = @tree.children.last\n true\n end",
"title": ""
}
] |
[
{
"docid": "b6768af8bd72b26174a4423c3946d661",
"score": "0.72683394",
"text": "def parse_footnote_marker\n start_line_number = @src.current_line_number\n @src.pos += @src.matched_size\n fn_def = @footnotes[@src[1]]\n if fn_def\n if fn_def[:eob]\n update_attr_with_ial(fn_def[:eob].attr, fn_def[:eob].options[:ial] || {})\n fn_def[:attr] = fn_def[:eob].attr\n fn_def[:options] = fn_def[:eob].options\n fn_def.delete(:eob)\n end\n fn_def[:marker] ||= []\n fn_def[:marker].push(Element.new(:footnote, fn_def[:content], fn_def[:attr],\n fn_def[:options].merge(name: @src[1], location: start_line_number)))\n @tree.children << fn_def[:marker].last\n else\n warning(\"Footnote definition for '#{@src[1]}' not found on line #{start_line_number}\")\n add_text(@src.matched)\n end\n end",
"title": ""
},
{
"docid": "3442a79d9aa0ac5421b5529b67dc1250",
"score": "0.6368885",
"text": "def footnote(str)\n case str\n when /^:\\s*(.+)$/ # b\n @token_que << [:FN_LINK, @footnote_idx]\n @token_que << [:FN_START, @footnote_idx]\n @footnote_idx += 1\n scan $1\n @token_que << [:FN_END, '']\n when /^([^:]+):\\s*(.+)$/ # c\n @token_que << [:FN_LINK, $1]\n @token_que << [:FN_START, $1]\n scan $2\n @token_que << [:FN_END, '']\n else # a\n @token_que << [:FN_LINK, str]\n end\n end",
"title": ""
},
{
"docid": "2c753794b5ce28ea50c9e62741b83a80",
"score": "0.58468425",
"text": "def footnotes(doc)\n footnotes = Hash.new { |h, k| h[k] = [] }\n doc.xpath('//note[@place=\"foot\"]').each do |footnote|\n footnotes[chapter_number(footnote)] << footnote\n end\n # Handle chapters 1 through n-1.\n doc.xpath('//div[@class=\"chapter\"]').each_with_index do |chapter, i|\n make_footnotes(footnotes, i, chapter)\n end\n # Place the footnotes for Chapter n (if any).\n final_chapter_number = doc.xpath('//div[@class=\"chapter\"]').length\n make_footnotes(footnotes, final_chapter_number)\n rewrite_contents(footnotes)\n end",
"title": ""
},
{
"docid": "7189c250cbb20746cf278bfd69a20853",
"score": "0.5782154",
"text": "def footnote_content\n ol = Element.new(:ol)\n ol.attr['start'] = @footnote_start if @footnote_start != 1\n i = 0\n backlink_text = escape_html(@options[:footnote_backlink], :text)\n while i < @footnotes.length\n name, data, _, repeat = *@footnotes[i]\n li = Element.new(:li, nil, 'id' => \"fn:#{name}\", 'role' => 'doc-endnote')\n li.children = Marshal.load(Marshal.dump(data.children))\n\n para = nil\n if li.children.last.type == :p || @options[:footnote_backlink_inline]\n parent = li\n while !parent.children.empty? && ![:p, :header].include?(parent.children.last.type)\n parent = parent.children.last\n end\n para = parent.children.last\n insert_space = true\n end\n\n unless para\n li.children << (para = Element.new(:p))\n insert_space = false\n end\n\n unless @options[:footnote_backlink].empty?\n nbsp = entity_to_str(ENTITY_NBSP)\n value = sprintf(FOOTNOTE_BACKLINK_FMT, (insert_space ? nbsp : ''), name, backlink_text)\n para.children << Element.new(:raw, value)\n (1..repeat).each do |index|\n value = sprintf(FOOTNOTE_BACKLINK_FMT, nbsp, \"#{name}:#{index}\",\n \"#{backlink_text}<sup>#{index + 1}</sup>\")\n para.children << Element.new(:raw, value)\n end\n end\n\n ol.children << Element.new(:raw, convert(li, 4))\n i += 1\n end\n if ol.children.empty?\n ''\n else\n format_as_indented_block_html('div', {class: \"footnotes\", role: \"doc-endnotes\"}, convert(ol, 2), 0)\n end\n end",
"title": ""
},
{
"docid": "b88107a5d47ac7186c2200152df20025",
"score": "0.5768406",
"text": "def blanky_footnote!(input)\n input.gsub!(REGEX_FOOTNOTE) do\n data = $LAST_MATCH_INFO\n b(:mark, data: data) + b(:colon, data: data) + m(:note, data: data)\n end\n end",
"title": ""
},
{
"docid": "228ee1af1c2b9479b77dd15a280f4a1f",
"score": "0.5687049",
"text": "def footnote_def(content, number)\n numberStr = number.to_s\n content.gsub!(/\\<p\\>|\\<\\/p\\>/, \"\")\n key = \"replaceFnDef#{numberStr}\"\n $footnoteDefs[key] = content \n return \"<li>#{content}</li>\" \n end",
"title": ""
},
{
"docid": "0c8ffae359270d91e987b9d0d49b2b99",
"score": "0.5685698",
"text": "def find_footnotes!\n find_nodes_by_type(Swordfish::Node::Footnote).each_with_index do |footnote, idx|\n footnote.inform!({:index => idx})\n footnote_content = Swordfish::Node::Raw.new\n footnote_content.content = footnote.content_to_html\n @nodes << footnote_content\n end\n end",
"title": ""
},
{
"docid": "404eea753e359e4da8655c02a22a222a",
"score": "0.5595807",
"text": "def footnote(text)\n if !text.nil? and text != ''\n mark = CommandNode.new(self, '\\fs16\\up6\\chftn', nil, false)\n note = CommandNode.new(self, '\\footnote {\\fs16\\up6\\chftn}', nil, false)\n note.paragraph << text\n self.store(mark)\n self.store(note)\n end\n end",
"title": ""
},
{
"docid": "f5c0928e0dd7f8c73406d61f982827aa",
"score": "0.555247",
"text": "def footnote_array\n @footnote_array ||= begin\n footnotes_re = /\\[\\[footnotes\\]\\](.*?)\\[\\[\\/footnotes\\]\\]/m\n return [] unless notes = transcript_text.scan(footnotes_re)[0]\n\n one_footnote_re = /\\[\\[note\\]\\](.*?)\\[\\[\\/note\\]\\]/m\n notes[0].scan(one_footnote_re).\n map{ |x| x[0].gsub(/\\s+/, ' ').strip }\n end\n end",
"title": ""
},
{
"docid": "a2ff83be973e374fd3f39042170e7f80",
"score": "0.55243117",
"text": "def footnote(text)\n if !text.nil? and text != ''\n mark = CommandNode.new(self, '\\fs16\\up6\\chftn', nil, false)\n note = CommandNode.new(self, '\\footnote {\\fs16\\up6\\chftn}', nil, false)\n note.paragraph << text\n self.store(mark)\n self.store(note)\n end\n end",
"title": ""
},
{
"docid": "1ed4298d1fbee59451ec24c1410d4fb6",
"score": "0.5494592",
"text": "def footPointFrom(reference)\n return geoObject().footPointFrom(reference) ;\n end",
"title": ""
},
{
"docid": "d1a69613cc2091ebf82eb29e69783113",
"score": "0.5386213",
"text": "def footnote(search)\n # Create new hash object to hold data\n word_object = Hash.new\n definition_data = Hash.new\n\n # set meta data\n word_object[\"word\"] = search\n word_object[\"speech\"] = \"[ note ]\"\n word_object[\"data\"] = []\n definition_data['definition'] = \"Enter footnote information...\"\n word_object[\"data\"][0] = definition_data\n\n return word_object.to_json\n end",
"title": ""
},
{
"docid": "db6a8d9e91476ceb9cfae1489c6dd0b6",
"score": "0.53802645",
"text": "def get_footnotes_from_params(form_params)\n \t#print \"\\n\\n\\n\\n Getting Footnotes....\"\n \tfootnotes = Array.new\n \tform_params.keys.each do |key|\n \t\tif key =~ /_footnote_/\n \t\t\t\n \t\t\t# the key being split would be something like:\n \t\t\t# categorical_footnote_1 or continuous_footnote_1\n \t\t\tnote_parts = key.split(\"_\");\n \t\t\t\n \t\t\ttmp_note = {:note_number=>note_parts[2],\n \t\t\t\t\t\t\t\t\t:study_id=>session[:study_id],\n \t\t\t\t\t\t\t\t\t:note_text=>form_params[key],\n \t\t\t\t\t\t\t\t\t:page_name=>\"results\",\n \t\t\t\t\t\t\t\t\t:data_type => note_parts[0]}\t\t\t\t\t\t\t \n \t\t\tfootnotes << tmp_note\n \t\tend\n \tend\n \t#print \"Done.\\n\\n\\n\\n\"\n \treturn footnotes\n\tend",
"title": ""
},
{
"docid": "d654bdf9cfcd9029d00f7c6a53e7de38",
"score": "0.5310554",
"text": "def test_get_footnote\n remote_file_name = 'TestGetFootnote.docx'\n\n upload_file File.join(local_test_folder, footnote_folder + '/Footnote.doc'), remote_data_folder + '/' + remote_file_name\n\n request = GetFootnoteRequest.new(name: remote_file_name, index: 0, node_path: '', folder: remote_data_folder)\n\n result = @words_api.get_footnote(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "fa9fbd3a407164b9bfd66bd767fba077",
"score": "0.53054243",
"text": "def parse\n args = {}\n\n err = catch :unrecognized do\n if @token.match(/staff/)\n args = do_num_lines\n return\n else\n args = \" #{do_clef} \"\n args += do_line\n end\n nil\n end\n\n @builder.send(:comment, args) unless err\n unrecognized(@token, err) if err\n end",
"title": ""
},
{
"docid": "af9dc29ca60a4bb533fbc7cb01023a17",
"score": "0.5272042",
"text": "def parse\n @builder.section('xmlns' => MEI_NS) {\n @builder.comment(\" #{@line} \")\n do_staffs()\n }\n end",
"title": ""
},
{
"docid": "6d6fc8f18e9d147a3297ceebed140208",
"score": "0.5269891",
"text": "def notes\n parse('coffee.notes')\n end",
"title": ""
},
{
"docid": "df748e0e57882c1a5ed1d950c4975c7c",
"score": "0.5239228",
"text": "def ink_footnotes node\n return if (fns = (doc = node.document).footnotes - @rendered_footnotes).empty?\n theme_margin :block, :bottom if node.context == :document || node == node.document.last_child\n theme_margin :footnotes, :top unless (valign_bottom = @theme.footnotes_margin_top == 'auto')\n with_dry_run do |extent|\n if valign_bottom && (single_page_height = extent&.single_page_height) && (delta = cursor - single_page_height - 0.0001) > 0\n move_down delta\n end\n theme_font :footnotes do\n (title = doc.attr 'footnotes-title') && (ink_caption title, category: :footnotes)\n item_spacing = @theme.footnotes_item_spacing\n index_offset = @rendered_footnotes.length\n sect_xreftext = node.context == :section && (node.xreftext node.document.attr 'xrefstyle')\n fns.each do |fn|\n label = (index = fn.index) - index_offset\n if sect_xreftext\n fn.singleton_class.send :attr_accessor, :label unless fn.respond_to? :label=\n fn.label = %(#{label} - #{sect_xreftext})\n end\n ink_prose %(<a id=\"_footnotedef_#{index}\">#{DummyText}</a><strong><a anchor=\"_footnoteref_#{index}\">#{label}.</a></strong> #{fn.text}), margin_bottom: item_spacing, hyphenate: true\n end\n @rendered_footnotes += fns if extent\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "1183478825250def44d60b1042f393fa",
"score": "0.5162992",
"text": "def footnote_text_for(number)\n footnote_text = ohms_xml.footnote_array[number.to_i - 1] || ''\n\n if footnote_text == ''\n Rails.logger.warn(\"WARNING: Reference to empty or missing footnote #{number} for OHMS transcript #{ohms_xml.accession}\")\n end\n\n footnote_text\n end",
"title": ""
},
{
"docid": "ef0a94067b21f50ccf3195ee4b3292a7",
"score": "0.51495606",
"text": "def footnotes_list(footnotes, chapter_number)\n doc = footnotes.values[0][0].document\n footnotes_node = Nokogiri::XML::Node.new('div', doc)\n footnotes_node['class'] = 'footnotes'\n footnotes_node['class'] += ' nonumbers' if footnote_symbols?\n footnotes[chapter_number].each_with_index do |footnote, i|\n n = i + 1\n note = Nokogiri::XML::Node.new('div', doc)\n note['id'] = footnote_id(chapter_number, n)\n note['class'] = 'footnote'\n reflink = Nokogiri::XML::Node.new('a', doc)\n reflink['class'] = 'footnote-link'\n if footnote_symbols?\n reflink.content = fnsymbol(i)\n else\n reflink.content = \"#{n}.\"\n end\n reflink['href'] = footnote_ref_href(chapter_number, n)\n refhtml = reflink.to_xhtml\n refhtml = \"<sup>#{refhtml}</sup>\" if footnote_symbols?\n if (first_paragraph = footnote.css('p').first)\n first_paragraph.inner_html = refhtml + ' ' +\n first_paragraph.inner_html\n html = footnote.inner_html\n elsif\n html = \"#{refhtml} #{footnote.inner_html}\"\n end\n note.inner_html = html\n footnotes_node.add_child note\n end\n footnotes_node\n end",
"title": ""
},
{
"docid": "89cc57c9870501e8a0fba7164fa29c10",
"score": "0.50984865",
"text": "def footnote_count\n @footnote_count ||= 0\n end",
"title": ""
},
{
"docid": "89cc57c9870501e8a0fba7164fa29c10",
"score": "0.50984865",
"text": "def footnote_count\n @footnote_count ||= 0\n end",
"title": ""
},
{
"docid": "f4ff59d6bc47099f3250cff24dd97833",
"score": "0.5075855",
"text": "def create\n @footnote = @post.footnotes.new(params[:footnote])\n\n if @footnote.save\n redirect_to edit_post_path(@post), notice: 'Tangent added successfully'\n else\n redirect_to @post, alert: 'Unable to add tangent'\n end\n end",
"title": ""
},
{
"docid": "450c100f37531f66b44c84285995b4c5",
"score": "0.5019808",
"text": "def test_get_footnotes\n remote_file_name = 'TestGetFootnotes.docx'\n\n upload_file File.join(local_test_folder, footnote_folder + '/Footnote.doc'), remote_data_folder + '/' + remote_file_name\n\n request = GetFootnotesRequest.new(name: remote_file_name, node_path: '', folder: remote_data_folder)\n\n result = @words_api.get_footnotes(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "53757340ad5aadd85531a9fd4fcedc16",
"score": "0.5016424",
"text": "def parse_todo\n return unless todo_comment?\n\n list_obj = @kram_obj.detect {|obj| obj.type == :ul }.children\n # list_obj.first.children[0].children[0].value.chomp\n list_obj.each do |obj|\n title = \"##{@pbi_num} #{remove_checkbox(obj.children[0].children[0].value).chomp}\"\n body = parse_body(obj)\n end\n # todos = []\n # @lines.each do |line|\n # if line.match(TODO_REGEX)\n # todos << $1\n # end\n # end\n # todos\n end",
"title": ""
},
{
"docid": "59a5128e22e1501b8773ac38893c0f69",
"score": "0.5015029",
"text": "def definition_info(text)\n return nil unless text\n lines = \"#{text}\"\n defs = Array.new\n comment = \"\"\n trailing_comment = \"\"\n under_comment_valid = false\n lines.split(\"\\n\").each{ |line|\n if /^\\s*?!\\s?(.*)/ =~ line\n if COMMENTS_ARE_UPPER\n comment << remove_header_marker($1)\n comment << \"\\n\"\n elsif defs[-1] && under_comment_valid\n defs[-1].comment << \"\\n\"\n defs[-1].comment << remove_header_marker($1)\n end\n next\n elsif /^\\s*?$/ =~ line\n comment = \"\"\n under_comment_valid = false\n next\n end\n type = \"\"\n characters = \"\"\n if line =~ /^\\s*?\n (\n character\\s*?(\\([\\w\\s\\=\\(\\)\\*]+?\\))?[\\s\\,]*\n | type\\s*?\\([\\w\\s]+?\\)[\\s\\,]*\n | integer\\s*?(\\([\\w\\s\\=\\(\\)\\*]+?\\))?[\\s\\,]*\n | real\\s*?(\\([\\w\\s\\=\\(\\)\\*]+?\\))?[\\s\\,]*\n | double\\s+precision[\\s\\,]*\n | logical\\s*?(\\([\\w\\s\\=\\(\\)\\*]+?\\))?[\\s\\,]*\n | complex\\s*?(\\([\\w\\s\\=\\(\\)\\*]+?\\))?[\\s\\,]*\n )\n (.*?::)?\n (.+)$\n /ix\n characters = $8\n type = $1\n type << $7.gsub(/::/, '').gsub(/^\\s*?\\,/, '') if $7\n else\n under_comment_valid = false\n next\n end\n squote = false ; dquote = false ; bracket = 0\n iniflag = false; commentflag = false\n varname = \"\" ; arraysuffix = \"\" ; inivalue = \"\"\n start_pos = defs.size\n characters.split(\"\").each { |char|\n if !(squote) && !(dquote) && bracket <= 0 && !(iniflag) && !(commentflag)\n case char\n when \"!\" ; commentflag = true\n when \"(\" ; bracket += 1 ; arraysuffix = char\n when \"\\\"\"; dquote = true\n when \"\\'\"; squote = true\n when \"=\" ; iniflag = true ; inivalue << char\n when \",\"\n defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)\n varname = \"\" ; arraysuffix = \"\" ; inivalue = \"\"\n under_comment_valid = true\n when \" \" ; next\n else ; varname << char\n end\n elsif commentflag\n comment << remove_header_marker(char)\n trailing_comment << remove_header_marker(char)\n elsif iniflag\n if dquote\n case char\n when \"\\\"\" ; dquote = false ; inivalue << char\n else ; inivalue << char\n end\n elsif squote\n case char\n when \"\\'\" ; squote = false ; inivalue << char\n else ; inivalue << char\n end\n elsif bracket > 0\n case char\n when \"(\" ; bracket += 1 ; inivalue << char\n when \")\" ; bracket -= 1 ; inivalue << char\n else ; inivalue << char\n end\n else\n case char\n when \",\"\n defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)\n varname = \"\" ; arraysuffix = \"\" ; inivalue = \"\"\n iniflag = false\n under_comment_valid = true\n when \"(\" ; bracket += 1 ; inivalue << char\n when \"\\\"\"; dquote = true ; inivalue << char\n when \"\\'\"; squote = true ; inivalue << char\n when \"!\" ; commentflag = true\n else ; inivalue << char\n end\n end\n elsif !(squote) && !(dquote) && bracket > 0\n case char\n when \"(\" ; bracket += 1 ; arraysuffix << char\n when \")\" ; bracket -= 1 ; arraysuffix << char\n else ; arraysuffix << char\n end\n elsif squote\n case char\n when \"\\'\"; squote = false ; inivalue << char\n else ; inivalue << char\n end\n elsif dquote\n case char\n when \"\\\"\"; dquote = false ; inivalue << char\n else ; inivalue << char\n end\n end\n }\n defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)\n if trailing_comment =~ /^:nodoc:/\n defs[start_pos..-1].collect!{ |defitem|\n defitem.nodoc = true\n }\n end\n varname = \"\" ; arraysuffix = \"\" ; inivalue = \"\"\n comment = \"\"\n under_comment_valid = true\n trailing_comment = \"\"\n }\n return defs\n end",
"title": ""
},
{
"docid": "015bf3f5de7867f78184947fa1ce1401",
"score": "0.49500626",
"text": "def parse_definition_list\n children = @tree.children\n if !children.last || (children.length == 1 && children.last.type != :p) ||\n (children.length >= 2 && children[-1].type != :p &&\n (children[-1].type != :blank || children[-1].value != \"\\n\" || children[-2].type != :p))\n return false\n end\n\n first_as_para = false\n deflist = new_block_el(:dl)\n para = @tree.children.pop\n if para.type == :blank\n para = @tree.children.pop\n first_as_para = true\n end\n # take location from preceding para which is the first definition term\n deflist.options[:location] = para.options[:location]\n para.children.first.value.split(/\\n/).each do |term|\n el = Element.new(:dt, nil, nil, location: @src.current_line_number)\n term.sub!(self.class::LIST_ITEM_IAL) do\n parse_attribute_list($1, el.options[:ial] ||= {})\n ''\n end\n el.options[:raw_text] = term\n el.children << Element.new(:raw_text, term)\n deflist.children << el\n end\n deflist.options[:ial] = para.options[:ial]\n\n item = nil\n content_re, lazy_re, indent_re = nil\n def_start_re = DEFINITION_LIST_START\n last_is_blank = false\n until @src.eos?\n start_line_number = @src.current_line_number\n if @src.scan(def_start_re)\n item = Element.new(:dd, nil, nil, location: start_line_number)\n item.options[:first_as_para] = first_as_para\n item.value, indentation, content_re, lazy_re, indent_re =\n parse_first_list_line(@src[1].length, @src[2])\n deflist.children << item\n\n item.value.sub!(self.class::LIST_ITEM_IAL) do |_match|\n parse_attribute_list($1, item.options[:ial] ||= {})\n ''\n end\n\n def_start_re = fetch_pattern(:dl, indentation)\n first_as_para = false\n last_is_blank = false\n elsif @src.check(EOB_MARKER)\n break\n elsif (result = @src.scan(content_re)) || (!last_is_blank && (result = @src.scan(lazy_re)))\n result.sub!(/^(\\t+)/) { \" \" * ($1 ? 4 * $1.length : 0) }\n result.sub!(indent_re, '')\n item.value << result\n first_as_para = false\n last_is_blank = false\n elsif (result = @src.scan(BLANK_LINE))\n first_as_para = true\n item.value << result\n last_is_blank = true\n else\n break\n end\n end\n\n last = nil\n deflist.children.each do |it|\n next if it.type == :dt\n\n parse_blocks(it, it.value)\n it.value = nil\n it_children = it.children\n next if it_children.empty?\n\n last = (it_children.last.type == :blank ? it_children.pop : nil)\n\n if it_children.first && it_children.first.type == :p && !it.options.delete(:first_as_para)\n it_children.first.children.first.value << \"\\n\" if it_children.size > 1\n it_children.first.options[:transparent] = true\n end\n end\n\n children = @tree.children\n if children.length >= 1 && children.last.type == :dl\n children[-1].children.concat(deflist.children)\n elsif children.length >= 2 && children[-1].type == :blank &&\n children[-2].type == :dl\n children.pop\n children[-1].children.concat(deflist.children)\n else\n children << deflist\n end\n\n children << last if last\n\n true\n end",
"title": ""
},
{
"docid": "29dcc285db91cf469d9b940f4f17a13a",
"score": "0.49476328",
"text": "def transform_footnotes(html)\n # look for the section the section at the bottom of the page that looks\n # like <p>[1] (the paragraph tag is there because Markdown will have\n # already wrapped it by this point)\n if html =~ /^(<p>\\[\\d+\\].*)/m\n footnotes = $1\n rendered = footnotes.dup\n main_content = html.sub(footnotes, '')\n\n footnotes.scan(/(\\[(\\d+)\\]\\s+.*)/) do |_, number|\n # render the footnote itself\n rendered.gsub!(\"[#{number}]\", FOOTNOTE_ANCHOR % ([number] * 3))\n\n # find any references elsewhere in the document and turn them into\n # links\n main_content.gsub!(/\\[#{number}\\]/, FOOTNOTE_LINK % ([number] * 3))\n end\n\n # and wrap the whole section in a layer\n rendered = FOOTNOTE_WRAPPER % [rendered]\n\n html = main_content + rendered\n end\n html\n end",
"title": ""
},
{
"docid": "031cde4357e3baf36dfa01cbc984e428",
"score": "0.49301234",
"text": "def add_footnote(footnote)\n @footnotes << footnote\n end",
"title": ""
},
{
"docid": "7a27e5977626d667fc1fb8be22e85792",
"score": "0.49040905",
"text": "def title\n @note_title ||= self.name.match(/^Footnotes::Notes::(\\w+)Note$/)[1]\n end",
"title": ""
},
{
"docid": "daa903ff491eb7ae3f04669b9ad7d0e7",
"score": "0.4897868",
"text": "def blanky_inline_footnote!(input)\n input.gsub!(REGEX_INLINE_FOOTNOTE) do\n data = $LAST_MATCH_INFO\n b(:mark, data: data) + \"(\" + m(:note, data: data) + \")\"\n end\n end",
"title": ""
},
{
"docid": "23e6019ae01fcbe937798e5c4292f27b",
"score": "0.48894194",
"text": "def preprocess(document)\n $footnoteDefs = {} \n $footnoteDiv = \"\" \n $abbrList = [] \n $defList = [] \n add_def(add_abbr(get_includes (document)))\n end",
"title": ""
},
{
"docid": "1e07610657d926cde4d20f54f3419340",
"score": "0.4872421",
"text": "def node\n @xml.at_xpath('\n //p:nvSpPr[\n p:cNvPr[starts-with(@name, \"Notes Placeholder\")]\n ]/following-sibling::p:txBody\n ')\n end",
"title": ""
},
{
"docid": "2c052434def6e9cbe593b315b5e419c9",
"score": "0.4843311",
"text": "def parse_notes_line(tokens)\n unless current_stave\n raise \"Error: cannot add notes, no stave has been defined yet - at line #{@line_number}.\"\n end\n \n # remove initial keyword\n tokens.shift\n \n tokens.each do |notes|\n if notes == \"|\" then\n current_stave.music.push :bar\n next\n end\n \n parse_notes_expression(notes)\n end\n end",
"title": ""
},
{
"docid": "f5c947580fb7c3521789bd8a40318642",
"score": "0.4828469",
"text": "def test_update_footnote\n remote_file_name = 'TestUpdateFootnote.docx'\n\n upload_file File.join(local_test_folder, footnote_folder + '/Footnote.doc'), remote_data_folder + '/' + remote_file_name\n\n request_footnote_dto = FootnoteUpdate.new({:Text => 'new text is here'})\n request = UpdateFootnoteRequest.new(name: remote_file_name, index: 0, footnote_dto: request_footnote_dto, node_path: '', folder: remote_data_folder)\n\n result = @words_api.update_footnote(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "e6eca7b561146854f0e051dc78beaf58",
"score": "0.48251784",
"text": "def note_content\n note_text_fld[1]\n end",
"title": ""
},
{
"docid": "4db7750184639105b1337f6565172ad6",
"score": "0.48194143",
"text": "def parse str\n context = Context.new\n res = (@blocks.parse(LineScanner.new(str.split(/\\r\\n|\\r|\\n/)),context,@inlines) || []).map{|x|\n x[0]\n }\n if context.footnotes.length > 0\n res << FootnoteList.new(context.footnotes)\n end\n res\n end",
"title": ""
},
{
"docid": "13efc798826cf78c3aa1f515a2dcbfea",
"score": "0.4818892",
"text": "def parse\n detect_issue(DESCRIPTION)\n end",
"title": ""
},
{
"docid": "13efc798826cf78c3aa1f515a2dcbfea",
"score": "0.4818892",
"text": "def parse\n detect_issue(DESCRIPTION)\n end",
"title": ""
},
{
"docid": "059699a7c1f30bfcb1cac130f3bc8372",
"score": "0.48147646",
"text": "def definition; parse_hitname; @definition; end",
"title": ""
},
{
"docid": "266cad8fb490b925d48b2e416ec64914",
"score": "0.47869456",
"text": "def initialize(definition)\n delimiter_pos = definition.index(\"\\r\\n\\r\\n\")\n metadata = definition[0..delimiter_pos]\n content = definition[delimiter_pos..-1]\n\n \t# process the definition\n process_metadata(metadata)\n process_content(content)\n end",
"title": ""
},
{
"docid": "7c2fb228af72f1769ef348c0c6664840",
"score": "0.47747532",
"text": "def postprocess(document)\n \n document.gsub!(/^\\<\\!\\-\\-include /, \"<!--\") # fix the start of the include markers\n document.gsub!(/ include\\-\\-\\>/, \"-->\") # fix the end of the include markets\n document.gsub!(/\\$\\{/, \"${\") # fix the end of the include markets \n $footnoteDefs.each_pair { |ref, fndef| document.gsub!(/#{ref}/,fndef) } # Loop through the footnote refs replace with popover text\n document.gsub!(/<p>\\{\\{\\s*\\$abbreviations\\s*\\}\\}\\s<\\/p>/, \"<dl>\" + $abbrList.sort.map { |s| \"#{s}\" }.join(' ') + \"</dl>\" ) \n # output the list of abbreviations\n document.gsub!(/<p>\\{\\{\\s*\\$definitions\\s*\\}\\}\\s<\\/p>/, \"<dl>\" + $defList.sort.map { |s| \"#{s}\" }.join(' ') + \"</dl>\" ) \n # output the list of definitions\n document.gsub!(/<p>\\{\\{\\s*\\$terms\\s*\\}\\}\\s<\\/p>/, \"<dl>\" + ($abbrList+$defList).sort.map { |s| \"#{s}\" }.join(' ') + \"</dl>\" ) \n # output the list of definitions\n document.gsub!(/<p>\\{\\{\\s*\\$footnotes\\s*\\}\\}\\s<\\/p>/, $footnoteDiv ) # output the list of footnotes\n return document\n end",
"title": ""
},
{
"docid": "aea919de82f740964735c92bfdb5262c",
"score": "0.4762657",
"text": "def definition_reference(tag=nil)\n \"@talkFile #{tag[:__meta][:file]}:#{tag[:__meta][:line]}\" unless tag.nil?\nend",
"title": ""
},
{
"docid": "59e7181c529909dcca70b41e44b7e305",
"score": "0.47582096",
"text": "def parse\n return unless ::Kernel.test ?f, @fn\n @section_name = nil\n ::File.open(@fn, 'r') do |f|\n while line = f.gets\n @line_number += 1\n parse_line line.chomp\n end\n end\n @section_name = nil\n @line_number = 0\n return\n end",
"title": ""
},
{
"docid": "583314d7822c3a8426b791a9dc109e05",
"score": "0.4753764",
"text": "def rewrite_contents(footnotes)\n footnotes.each do |chapter_number, chapter_footnotes|\n chapter_footnotes.each_with_index do |node, i|\n n = i + 1\n node.name = 'sup'\n clean_node node, %w{place id id-text data-tralics-id data-number}\n node['id'] = footnote_ref_id(chapter_number, n)\n node['class'] = 'footnote'\n link = Nokogiri::XML::Node.new('a', node.document)\n link['href'] = footnote_href(chapter_number, n)\n content = footnote_symbols? ? fnsymbol(i) : n.to_s\n link.content = content\n node.inner_html = link\n # Support footnotes in chapter & section headings.\n if node.parent['class'] == 'heading'\n # Move footnote outside section anchor tag.\n node.parent = node.parent.parent\n end\n # Add an intersentence space if appropriate.\n previous_character = node.previous_sibling.content[-1]\n end_of_sentence = %w[. ! ?].include?(previous_character)\n after = node.next_sibling\n end_of_paragraph = after.nil? || after.content.strip.empty?\n if end_of_sentence && !end_of_paragraph\n space = Nokogiri::XML::Node.new('span', node.document)\n space['class'] = 'intersentencespace'\n node['class'] += ' intersentence'\n node.add_next_sibling(space)\n end\n # Remove spurious intersentence space from mid-sentence notes.\n closing_paren = after && after.content[0] == \")\"\n next_sibling = node.next_sibling\n if ((!end_of_sentence || closing_paren) &&\n intersentence_space?(next_sibling))\n next_sibling.remove\n end\n end\n end\n end",
"title": ""
},
{
"docid": "35bbf157768d78dccb71c782799c6da2",
"score": "0.47494948",
"text": "def afterward_foot\n\t\tif afterward.present?\n\t\t\th.content_tag :footer do\n\t\t\t\th.markdown afterward\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e087cbb854505d70792875793c155c7a",
"score": "0.47110873",
"text": "def test_insert_footnote\n remote_file_name = 'TestInsertFootnote.docx'\n\n upload_file File.join(local_test_folder, footnote_folder + '/Footnote.doc'), remote_data_folder + '/' + remote_file_name\n\n request_footnote_dto = FootnoteInsert.new({:FootnoteType => 'Endnote', :Text => 'test endnote'})\n request = InsertFootnoteRequest.new(name: remote_file_name, footnote_dto: request_footnote_dto, node_path: '', folder: remote_data_folder)\n\n result = @words_api.insert_footnote(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "d23b55d86e01e0f97e49a1a2d58c600b",
"score": "0.47041595",
"text": "def place_footnotes(footnotes_node, chapter_number, chapter = nil)\n doc = footnotes_node.document\n footnotes_wrapper_node = Nokogiri::XML::Node.new('div', doc)\n footnotes_wrapper_node['id'] = footnotes_id(chapter_number)\n footnotes_wrapper_node.add_child footnotes_node\n if chapter.nil?\n doc.children.last.add_child(footnotes_wrapper_node)\n else\n chapter.add_previous_sibling(footnotes_wrapper_node)\n end\n end",
"title": ""
},
{
"docid": "8b532c76e116cbb35f37b09fea29ec2e",
"score": "0.46892223",
"text": "def parse\n match_data = line.match(Frepl::Classifier::DECLARATION_REGEX)\n @type = match_data[1]\n kind_len = match_data[2]\n if @kind_len\n if @kind_len.match(/len/)\n @len = @kind_len.match(/=(\\d+)/)[1]\n else\n @kind = @kind_len.match(/=(\\d+)/)[1]\n end\n end\n @parameter = match_data[3]\n @dimension = match_data[4]\n @target = match_data[5]\n @pointer = match_data[6]\n @variable_names = match_data[7].gsub(/\\s*=\\s*/, '=').scan(Frepl::Classifier::VARIABLE_NAME_REGEX)\n @variable_assignments = match_data[7].gsub(/\\s*=\\s*/, '=').\n split(Frepl::Classifier::VARIABLE_NAME_REGEX)[1..-1].\n map { |a| a.gsub(/,\\s*$/, '') }\n if @variable_assignments && @variable_assignments.any?\n if @variable_assignments.size < @variable_names.size\n # e.g., integer :: a = 1, b, c\n mask = match_data[7].gsub(/\\s*=\\s*/, '=').\n scan(/#{Frepl::Classifier::VARIABLE_NAME_REGEX}[=,$\\z]?/).\n map { |x| x.match(/=/) ? '=' : '' }\n arr = []\n # pad var assignments array, determine correct locations\n mask.each do |m|\n if m == '='\n arr.push(@variable_assignments.shift)\n else\n arr.push('')\n end\n end\n @variable_assignments = arr\n end\n # should be something like [['a', 'b'], ['=1', '']]\n @variable_parts = [@variable_names, @variable_assignments].transpose.map do |variable_parts|\n variable_parts.join('')\n end\n else\n @variable_parts = @variable_names\n end\n end",
"title": ""
},
{
"docid": "2fe008e0e9f8ddf71ac03095fb73ed01",
"score": "0.46876064",
"text": "def parse\n code = CodeFragment.new\n @content.each_with_index do |line, index|\n unless /^(#+)(\\s?)\\S/.match(line).nil?\n hashes = $1.dup\n heading = HeadingFragment.new([line.gsub(hashes,'')])\n heading.level = hashes.length\n @document_structure << heading\n next\n end\n if !/^(=)+$/.match(line).nil?\n heading = HeadingFragment.new([@content[index - 1]])\n heading.level = 1\n @document_structure << heading\n next\n end\n code.content << line\n end\n code.content[0].gsub!(/[#{ShowOffSlide::SHOWOFF_SLIDE_TYPES.join(',')}]/,'')\n @document_structure << code\n end",
"title": ""
},
{
"docid": "6c740466fc535be7b965033587c5f3a9",
"score": "0.46815583",
"text": "def is_a_footnote?\n self.reference.nil? && self.url.nil?\n end",
"title": ""
},
{
"docid": "5693595ea8029aad0d7812f28f1a0d55",
"score": "0.46772212",
"text": "def test_delete_footnote\n remote_file_name = 'TestDeleteFootnote.docx'\n\n upload_file File.join(local_test_folder, footnote_folder + '/Footnote.doc'), remote_data_folder + '/' + remote_file_name\n\n request = DeleteFootnoteRequest.new(name: remote_file_name, index: 0, node_path: '', folder: remote_data_folder)\n\n @words_api.delete_footnote(request)\n end",
"title": ""
},
{
"docid": "44d2cbc08ef66df09a3f1379b54539bd",
"score": "0.46767366",
"text": "def parse(ref, trailingNL)\n # first extra book\n theBook, ref = ref.scan(/^(Kejadian|Keluaran|Imamat|Bilangan|Ulangan|Yosua|Hakim-Hakim|Rut|1 Samuel|2 Samuel|1 Raja-Raja|2 Raja-Raja|1 Tawarikh|2 Tawarikh|Ezra|Nehemia|Ester|Ayub|Mazmur|Amsal|Pengkhotbah|Kidung Agung|Yesaya|Yeremia|Ratapan|Yehezkiel|Daniel|Hosea|Yoel|Amos|Obaja|Yunus|Mikha|Nahum|Habakuk|Zefanya|Hagai|Zakharia|Maleakhi|Matius|Markus|Lukas|Yohanes|Kisah Para Rasul|Roma|1 Korintus|2 Korintus|Galatia|Efesus|Filipi|Kolose|1 Tesalonika|2 Tesalonika|1 Timotius|2 Timotius|Titus|Filemon|Ibrani|Yakobus|1 Petrus|2 Petrus|1 Yohanes|2 Yohanes|I2 Yohanes|Yudas|Wahyu)\\s(.*)/i).flatten\n\n # format across chapters\n start_chapter, start_verse, end_chapter, end_verse \\\n = ref.scan(/(\\d+):(\\d+)-(\\d+):(\\d+)/).flatten\n\n unless start_chapter.nil?\n if Integer(start_chapter) > Integer(end_chapter)\n raise \"Error in chapter range\"\n end\n\n # loop for each chapter\n chapter = Integer(start_chapter)\n begin\n runOnce(true, true, theBook, chapter.to_s, start_verse, getEndChapter(theBook, chapter))\n chapter += 1\n end while chapter < Integer(end_chapter)\n runOnce(true, trailingNL, theBook, end_chapter, 1, end_verse)\n\n return\n end\n\n if start_chapter.nil?\n # format range within a chapter\n chapter, start_verse, end_verse = ref.scan(/(\\d+):(\\d+)-(\\d+)/).flatten\n\n if end_verse.nil?\n # format single verse\n chapter, start_verse = ref.scan(/(\\d+):(\\d+)/).flatten\n end_verse = start_verse\n elsif Integer(start_verse) > Integer(end_verse)\n raise \"Error in verse range\"\n end\n end\n\n runOnce(true, trailingNL, theBook, chapter, start_verse, end_verse)\n end",
"title": ""
},
{
"docid": "e30ab58dd4038d6d597fc527c62863b4",
"score": "0.4658819",
"text": "def parse\n File.readlines(@filename).each_slice(3).map do |definition, term, _|\n {:definition => definition.chomp, :term => term.chomp}\n end\n end",
"title": ""
},
{
"docid": "981cdb4350b94eaaa0b5a88fe152e3ad",
"score": "0.46545127",
"text": "def parse_notes_blk\n # IMPORTANT - we don't parse the (CM <note>), we just strip the \"(CM\" ... \")\" bit for now in NexusParser::Note\n\n @vars = {} \n inf = 0 # a crude iteration checker\n while true\n inf += 1\n raise(NexusParser::ParseError,\"Either you have a gazillion notes or more likely parser is caught in an infinite loop inside the Begin Notes block. Check for double single quotes in this block.\") if inf > 100000\n if @lexer.peek(NexusParser::Tokens::EndBlk)\n @lexer.pop(NexusParser::Tokens::EndBlk)\n @builder.add_note(@vars) # one still left to add\n break\n else\n\n if @lexer.peek(NexusParser::Tokens::ValuePair)\n @vars.update(@lexer.pop(NexusParser::Tokens::ValuePair).value)\n \n elsif @lexer.peek(NexusParser::Tokens::Label)\n if @vars[:type] # we have the data for this row write it, and start a new one \n \n @builder.add_note(@vars)\n @vars = {}\n else\n @vars.update(:type => @lexer.pop(NexusParser::Tokens::Label).value)\n end\n elsif @lexer.peek(NexusParser::Tokens::FileLbl) \n @lexer.pop(NexusParser::Tokens::FileLbl)\n @vars.update(:file => 'file') # we check for whether :file key is present and handle conditionally\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d41cad5f9f1999989746ee44d289c547",
"score": "0.46447906",
"text": "def test_get_footnote_online\n request_document = File.open(File.join(local_test_folder, footnote_folder + '/Footnote.doc'))\n request = GetFootnoteOnlineRequest.new(document: request_document, index: 0, node_path: '')\n\n result = @words_api.get_footnote_online(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "e5d6c54dc820dddca91f6d7b2b5265d0",
"score": "0.46430838",
"text": "def note_from_file\n @note_from_file ||= @file.read.gsub(\"\\n\", \" \").split(/\\s{2,}/)\n end",
"title": ""
},
{
"docid": "9ed53c3b9f9e3d39b5e466f0b6524c92",
"score": "0.46414125",
"text": "def definition\n field_fetch('DEFINITION')\n end",
"title": ""
},
{
"docid": "cf367b5be1d5e32f0184cdf8735e8201",
"score": "0.46330425",
"text": "def parse_heading(heading); end",
"title": ""
},
{
"docid": "f7cdf68a6470ff559b5453f4beda5774",
"score": "0.4624769",
"text": "def parse_moreinfo\n if @input.match?(/Tov.* ld\\.:\\n/)\n p(\"whois.nic.hu: parse_moreinfo\") if 1 == 2 || $DEBUG\n @ast[\"moreinfo\"] = @input.scan_until(/^\\n/)\n end\n end",
"title": ""
},
{
"docid": "2972f57eb35d7bc24afc3ffe4078bffd",
"score": "0.46246806",
"text": "def get_footnote(request)\n begin\n data, _status_code, _headers = get_footnote_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = get_footnote_with_http_info(request)\n else\n raise\n end\n end\n data\n end",
"title": ""
},
{
"docid": "f9b547250aba58bae6ac83d421035b1d",
"score": "0.46082905",
"text": "def foot\n \"\\n}\\n}\\n\"\n end",
"title": ""
},
{
"docid": "c65d67c98c5973fa75c9bac519b04f75",
"score": "0.46070307",
"text": "def do_parse(spec_info)\r\n spec_info.parse!(@head) unless @head.empty?\r\n spec_info.parse(/\\s*/) if @has_tail\r\n end",
"title": ""
},
{
"docid": "4ae13b9ba5e094d21ea4f980ef1b6dab",
"score": "0.46055096",
"text": "def parse_sections(sections_desc); end",
"title": ""
},
{
"docid": "f2cb5c6ac695d3cbe1d23f2163d918d6",
"score": "0.46021402",
"text": "def parse\n args = {}\n\n err = catch(:unrecognized) do\n mult = do_multiples(@token)\n args['dur'] = do_values(@token)\n\n len = do_length(mult, args['dur'])\n args['len'] = len if len\n\n color = do_coloration(@token)\n args['color'] = color if color\n\n nil # ensure block returns falsy\n end\n\n @builder.send(:note, args) unless err\n unrecognized(@token, err) if err\n end",
"title": ""
},
{
"docid": "b4f075cf092a81af0fc4e8a754034ea2",
"score": "0.45984772",
"text": "def parse(doc) new(doc).parse end",
"title": ""
},
{
"docid": "5bc7ce629afc230ba476c4484444aba6",
"score": "0.45975485",
"text": "def _parse_header\n parse_error(\"not a MAF file\") unless s.scan(/##maf\\s*/)\n vars = parse_maf_vars()\n align_params = nil\n while s.scan(/^#\\s*(.+?)\\n/)\n if align_params == nil\n align_params = s[1]\n else\n align_params << ' ' << s[1]\n end\n end\n @header = Header.new(vars, align_params)\n if ! s.skip_until(BLOCK_START)\n @at_end = true\n end\n end",
"title": ""
},
{
"docid": "2a6992d944ed5bbac876d4c01aaa66b3",
"score": "0.4594241",
"text": "def parse_definition\n return if (value = tokens_iterator.peek).to_result.failure?\n\n _, span = value.value!\n return if span.item == tokens_config[:eof]\n\n if span.item.is_a?(tokens_config[:name_class])\n case span.item.value\n when 'query', 'mutation', 'subscription' then return parse_operation_definition\n when 'fragment' then return parse_fragment_definition\n when 'schema', 'scalar', 'type', 'interface', 'union', 'enum', 'input', 'directive'\n return parse_type_system_definition\n when 'extend' then return parse_type_system_extension\n end\n elsif span.item == tokens_config[:curly_open]\n return parse_operation_definition\n elsif span.item.is_a?(tokens_config[:scalar_class]) && span.item.value.is_a?(Types::String)\n return parse_type_system_definition\n end\n\n raise UnexpectedToken.new(source: source, start: span.start, token: span.item)\n end",
"title": ""
},
{
"docid": "20a2bb48465c0271a097253f6ec9f9b6",
"score": "0.45886526",
"text": "def move_footnotes_to_footer content\n container = content[%r{<div class=\"footnotes\">\\s*(.*?)\\s*</div>}m]\n if container\n footnotes = $1\n content[container] = ''\n content['</footer>'] = <<-FOOTER\n <section id=\"footnotes\">\n <h2>Footnotes</h2>\n #{footnotes}\n </section>\n </footer>\n FOOTER\n end\n end",
"title": ""
},
{
"docid": "c0907e3403f5f7bed9090c20a774f76c",
"score": "0.45868593",
"text": "def test_get_footnotes_online\n request_document = File.open(File.join(local_test_folder, footnote_folder + '/Footnote.doc'))\n request = GetFootnotesOnlineRequest.new(document: request_document, node_path: '')\n\n result = @words_api.get_footnotes_online(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "4096d9586c297a76a56410dd9714aa4a",
"score": "0.45749438",
"text": "def parse_definition(str) # :nodoc:\n head, body = str.split(/^--.*\\n/, 2)\n head, body = '', head if body.nil?\n \n found_signature = false\n signature, desc = head.split(\"\\n\").partition do |line|\n found_signature = true if line =~ /^\\s*\\(.*?\\)/\n found_signature\n end\n \n [desc.join(\"\\n\"), found_signature ? signature.join(\"\\n\") : '()', body.to_s]\n end",
"title": ""
},
{
"docid": "1a2e1e4291975ef03e39f7d443cf913c",
"score": "0.45737207",
"text": "def parse_one(body) # :nodoc:\n end",
"title": ""
},
{
"docid": "c9a3b6c102685ee64a8fea5532488048",
"score": "0.45716983",
"text": "def paragraph\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n __P10__ = nil\n __P11__ = nil\n\n begin\n # at line 106:10: ( ^( TAG P attrs ( text )+ ) | ^( TAG P attrs ) )\n alt_19 = 2\n alt_19 = @dfa19.predict( @input )\n case alt_19\n when 1\n # at line 106:12: ^( TAG P attrs ( text )+ )\n match( TAG, TOKENS_FOLLOWING_TAG_IN_paragraph_651 )\n\n match( DOWN, nil )\n __P10__ = match( P, TOKENS_FOLLOWING_P_IN_paragraph_653 )\n # --> action\n printStartTag(__P10__);\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_attrs_IN_paragraph_657 )\n attrs\n @state.following.pop\n # --> action\n putsEndingBracket;\n # <-- action\n # at file 106:68: ( text )+\n match_count_18 = 0\n while true\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( TAG, DATA ) || look_18_0 == PCDATA )\n alt_18 = 1\n\n end\n case alt_18\n when 1\n # at line 106:68: text\n @state.following.push( TOKENS_FOLLOWING_text_IN_paragraph_661 )\n text\n @state.following.pop\n\n else\n match_count_18 > 0 and break\n eee = EarlyExit(18)\n\n\n raise eee\n end\n match_count_18 += 1\n end\n\n\n match( UP, nil )\n # --> action\n printEndTag(__P10__);\n # <-- action\n\n when 2\n # at line 107:12: ^( TAG P attrs )\n match( TAG, TOKENS_FOLLOWING_TAG_IN_paragraph_678 )\n\n match( DOWN, nil )\n __P11__ = match( P, TOKENS_FOLLOWING_P_IN_paragraph_680 )\n # --> action\n printStartTag(__P11__);\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_attrs_IN_paragraph_684 )\n attrs\n @state.following.pop\n # --> action\n printEndingBracket;\n # <-- action\n\n match( UP, nil )\n # --> action\n putsEndTag(__P11__);\n # <-- action\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "b3d4da4db87ac13eb4c843e6263837c8",
"score": "0.45663598",
"text": "def parse_testnotes\n na = false\n content = false\n \n @testnotes_contents.each do |line|\n if ( line =~ /^#N\\/A/i )\n na = true\n elsif ( line =~ /\\w+/ )\n content = true\n end\n end\n \n if ( ! na and ! content)\n error('TEST NOTES section is empty. If you have no notes, specify #N/A.')\n \n elsif ( na and content )\n error('Unexpected text found with #N/A tag in TEST NOTES section. ' +\n 'If you specify #N/A, no other text is permitted in this section.')\n \n elsif ( na and ! content )\n @f_TESTNOTES.puts '\"' + File.basename(@file) + \"\\\"\\t\\\"<empty>\\\"\"\n warning('There are *no* Test Notes in this sheet. Are there no thoughts, ' +\n 'test ideas, observations or setup information worth noting?')\n \n elsif ( ! na and content )\n clear_final_blanks( @testnotes_contents )\n @f_TESTNOTES.print '\"' + File.basename(@file) + \"\\\"\\t\\\"\"\n @testnotes_contents.each {|x| @f_TESTNOTES.print x }\n @f_TESTNOTES.print \"\\\"\\n\"\n end\nend",
"title": ""
},
{
"docid": "8d501530f9b0f798a27d69c260fb2b74",
"score": "0.45637852",
"text": "def parse_nowiki\n e = Element.new(current.type, current.value)\n @line += current.value.count(\"\\r\\n\")\n advance\n e\n end",
"title": ""
},
{
"docid": "f8c5876ca42979fd5b17f52f0a9a97e3",
"score": "0.45572433",
"text": "def read_head_or_note(str = '')\n node = Taskpaper::Node.new\n\n if (str[(str.length - 1)] == ':')\n node.type = :head\n node.value = str.chop\n else\n node.type = :note\n node.value = str\n end\n\n return node\n end",
"title": ""
},
{
"docid": "7c0a430a46cd232900070abac2a44fe8",
"score": "0.45534977",
"text": "def new\n @footnote = Footnote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @footnote }\n end\n end",
"title": ""
},
{
"docid": "92c9a926a771ff1bf38fb71944c8b205",
"score": "0.45449263",
"text": "def to_foot(**options) = convert_to('foot', **options)",
"title": ""
},
{
"docid": "2082afb93af7c5554d4c1519bc2696b5",
"score": "0.4541652",
"text": "def is_footnote?\n payer = Payer.find_by_reason_code_set_name_id(id, :select => ['footnote_indicator'])\n if !payer.blank? && !payer.footnote_indicator.blank?\n is_footnote = payer.footnote_indicator\n end\n is_footnote || false\n end",
"title": ""
},
{
"docid": "079d1174a473afb49317502cc44723f1",
"score": "0.45401412",
"text": "def parse_readme\n @table['(metadata)'] ||= {}\n @table['(metadata)']['readme'] = @table['(metadata)']['description']\n\n #if @readme && File.exist?(@readme)\n readme = table[@readme]\n if readme && readme['!'] == 'file'\n require 'malt'\n text = Malt.render(:text=>readme['text'], :file=>readme['name'])\n if md = /^\\s*(.*?)\\<h2\\>/m.match(text)\n @table['(metadata)']['readme_title'] = md[1] # TODO: use diffenrt field ?\n @table['(metadata)']['readme'] = \"<h2>\" + md.post_match\n end\n end\n #@readme_title ||= @table['(metadata)']['title']\n end",
"title": ""
},
{
"docid": "2e6d35e5ae29a64c8508186f1f8994d0",
"score": "0.45360667",
"text": "def footPointSpanFrom(reference, forStop = false)\n span = geoObject().footPointSpanFrom(reference) ;\n span = length() if(span > length()) ;\n if(forStop) then\n return validSpan(span) ;\n else\n return span ;\n end\n end",
"title": ""
},
{
"docid": "ca9f02d4d1bc3c45f37a8add14f69df8",
"score": "0.4533346",
"text": "def definition\n if @data['definition']\n @data['definition']\n else\n @data['definition'] = field_fetch('D')\n end\n end",
"title": ""
},
{
"docid": "ca18718b4f59b692cef1825768c1f67f",
"score": "0.45310163",
"text": "def parseTextDef aLine\n hashDef = parse_timedate aLine\n hashDef[:command] = aLine.scan(/(?:\\S+\\s+){5}(.*)/).shift[-1]\n ##TODO: raise( FormatError.new \"Command cannot be empty\") if aDef[:command].empty?\n hashDef\n end",
"title": ""
},
{
"docid": "4c1b3c77d97c854a5bd573381d47bb18",
"score": "0.45302466",
"text": "def test_insert_footnote_online\n request_document = File.open(File.join(local_test_folder, footnote_folder + '/Footnote.doc'))\n request_footnote_dto = FootnoteInsert.new({:FootnoteType => 'Endnote', :Text => 'test endnote'})\n request = InsertFootnoteOnlineRequest.new(document: request_document, footnote_dto: request_footnote_dto, node_path: '')\n\n result = @words_api.insert_footnote_online(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "f59becb3e15db9ab0132457c68f27d1c",
"score": "0.451621",
"text": "def parsed\n FixedWidth.parse(File.new(path), self.class.definition_name)\n end",
"title": ""
},
{
"docid": "f59becb3e15db9ab0132457c68f27d1c",
"score": "0.451621",
"text": "def parsed\n FixedWidth.parse(File.new(path), self.class.definition_name)\n end",
"title": ""
},
{
"docid": "6702d4d2b939c26588070be658cb9e48",
"score": "0.4515031",
"text": "def footnote_ref(number)\n ref = number.to_s\n return \"<sup id='fnref#{ref}'>\n <a href='javascript: void(0)' data-toggle='popover' data-container='body' data-placement='bottom' data-trigger='focus' data-html='true' data-content='replaceFnDef#{ref}'>#{ref}</a>\n </sup>\"\n end",
"title": ""
},
{
"docid": "62c972dbd795dabd98bd4e1d689411db",
"score": "0.4503953",
"text": "def foot_print_params\n params.fetch(:foot_print, {})\n end",
"title": ""
},
{
"docid": "8032eded6347a1a06a0cef477dbddf2c",
"score": "0.4495656",
"text": "def follow_position()\n return @footprint.end + 1\n end",
"title": ""
},
{
"docid": "5147877f8f3b9dda4cd588154895add0",
"score": "0.4493403",
"text": "def footnote_symbols?\n @footnote_symbols\n end",
"title": ""
},
{
"docid": "a9f1a62895e052a1f8c8d657b14083dd",
"score": "0.44884878",
"text": "def note\n descMetadata.note.present? ? descMetadata.note.zip(descMetadata.note.type).map{|a|{note: a[0],type: a[1]}} : []\n end",
"title": ""
},
{
"docid": "a74a0b1052b033d6aec5079ee000d84e",
"score": "0.44881648",
"text": "def update_footnote(request)\n begin\n data, _status_code, _headers = update_footnote_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = update_footnote_with_http_info(request)\n else\n raise\n end\n end\n data\n end",
"title": ""
},
{
"docid": "9ec64cbaf04c306bc30f1d183590df0c",
"score": "0.44860235",
"text": "def parse_method(location)\n File.readlines(location[0])[location[1].to_i..-1].join.split(\"end\\n\").first\n end",
"title": ""
},
{
"docid": "137321805b7a2b4199b6831cf80dc231",
"score": "0.44800133",
"text": "def test_update_footnote_online\n request_document = File.open(File.join(local_test_folder, footnote_folder + '/Footnote.doc'))\n request_footnote_dto = FootnoteUpdate.new({:Text => 'new text is here'})\n request = UpdateFootnoteOnlineRequest.new(document: request_document, footnote_dto: request_footnote_dto, index: 0, node_path: '')\n\n result = @words_api.update_footnote_online(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "664619d161d6a82ed6f72eded7a02080",
"score": "0.44787076",
"text": "def test_get_footnote_without_node_path\n remote_file_name = 'TestGetFootnoteWithoutNodePath.docx'\n\n upload_file File.join(local_test_folder, footnote_folder + '/Footnote.doc'), remote_data_folder + '/' + remote_file_name\n\n request = GetFootnoteRequest.new(name: remote_file_name, index: 0, folder: remote_data_folder)\n\n result = @words_api.get_footnote(request)\n assert_equal false, result.nil?\n end",
"title": ""
},
{
"docid": "4416883f993553699e97a4fa081ee1b5",
"score": "0.4478173",
"text": "def parse_field_definition\n description = parse_description\n name = parse_name\n arguments = parse_arguments_definition\n expect_token(tokens_config[:colon])\n ASTNode.new(kind: Kinds::FIELD_DEFINITION, params: {\n description: description,\n name: name,\n arguments: arguments,\n type: parse_type_reference,\n directives: parse_directives(true)\n })\n end",
"title": ""
},
{
"docid": "6d99a65ad642e214507c90852878aeb6",
"score": "0.4475002",
"text": "def parse_post_properties(path)\n content = File.open(path).read\n properties = content.split(/---\\n/)[1] # extract properties block\n .split(/\\n/) # split the properties by line\n .map{ |p| p.match(/(^[^:]+):([^$]*)/) } # split each line by key and value\n .map{ |p| [p[1], p[2].strip.gsub(/^\\\"|\\\"$/, '') ] } # strip extra quotes and space out of each value\n .flatten\n data = OpenStruct.new Hash[*properties]\n data.markdown = content.split(/---\\n/)[2]\n data\n end",
"title": ""
},
{
"docid": "57520b0d5a1cebf215774d803d6a7460",
"score": "0.4467742",
"text": "def parse\n return unless valid?\n\n type = @doc.xpath(\"//tiponotificacion\").text\n\n operations = @doc.xpath(\"//operacion\").inject([]) do |result, operation|\n result << [operation.xpath('tipo').text, operation.xpath('id').text]\n result\n end\n\n notification = Notification.new(type, operations)\n\n notification\n end",
"title": ""
},
{
"docid": "6d895f553290a9dc5006f790fb1fdf57",
"score": "0.4466272",
"text": "def body\n c = note.content and c =~ /.*\\n/ and $'\n end",
"title": ""
},
{
"docid": "698015534a0a77130d4d4d360355c201",
"score": "0.44647235",
"text": "def parse\n return unless ::Kernel.test ?f, @fn\n section = nil\n\n ::File.open(@fn, 'r') do |f|\n while line = f.gets\n line = line.chomp\n\n case line\n # ignore blank lines and comment lines\n when @rgxp_comment\n next\n\n # this is a section declaration\n when @rgxp_section\n section = @ini[$1.strip]\n\n # otherwise we have a parameter\n when @rgxp_param\n begin\n section[$1.strip] = $2.strip\n rescue NoMethodError\n raise Error, \"parameter encountered before first section\"\n end\n\n else\n raise Error, \"could not parse line '#{line}\"\n end\n end # while\n end # File.open\n end",
"title": ""
}
] |
38466d2447e02ac46e75ded67fea8bba
|
GET /locations/1 GET /locations/1.json
|
[
{
"docid": "2fd5420111d9d9c44d0a1194b2f10049",
"score": "0.0",
"text": "def show\n @restaurant = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
}
] |
[
{
"docid": "7c0c839c177d88b67a3e7ba53afef253",
"score": "0.7517158",
"text": "def get_location\n JSON.parse(get_results('/locations.json'), {symbolize_names: true})\n end",
"title": ""
},
{
"docid": "7c0c839c177d88b67a3e7ba53afef253",
"score": "0.7517158",
"text": "def get_location\n JSON.parse(get_results('/locations.json'), {symbolize_names: true})\n end",
"title": ""
},
{
"docid": "1f66154a0951f834bf028248aa0d7444",
"score": "0.72294176",
"text": "def show\n render json: Location.find(params[:id])\n end",
"title": ""
},
{
"docid": "ecc906cba840c169bed3f6d5243aecd2",
"score": "0.72081196",
"text": "def index\n @locations = Location.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "ecc906cba840c169bed3f6d5243aecd2",
"score": "0.72081196",
"text": "def index\n @locations = Location.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "ecc906cba840c169bed3f6d5243aecd2",
"score": "0.72081196",
"text": "def index\n @locations = Location.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "d34a43976886d5f73b5764a41d248d9e",
"score": "0.7114762",
"text": "def index\n @locations = current_user.locations\n respond_to do |format|\n format.html\n format.json {render json: @locations}\n end\n end",
"title": ""
},
{
"docid": "c44ca695608fb231dca2a33261bf90c6",
"score": "0.70989907",
"text": "def index\n @locations = Location.order :name\n\n map_points = {}\n\n respond_to do |format|\n format.html\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "3bf475699bfa29462aadd813b207818d",
"score": "0.7050122",
"text": "def locations\n customer = Customer.find_by(id: params[:id], company: current_company)\n locations = customer.locations\n render json: { locations: locations }\n end",
"title": ""
},
{
"docid": "f3536edc3fe6283013a4670a25814bad",
"score": "0.70398545",
"text": "def show\n @locations = Location.all\n render 'show', formats: 'json', handlers: 'jbuilder'\n end",
"title": ""
},
{
"docid": "5a045e60ef8597f6e1a8e45e32e24111",
"score": "0.7024373",
"text": "def locations(options={})\n get(\"/locations/search\")\n end",
"title": ""
},
{
"docid": "30cf3aaba2cf137b9aad8454273b78d0",
"score": "0.6970196",
"text": "def locations(opts = {})\n get 'locations', opts\n end",
"title": ""
},
{
"docid": "d0f9b6e83e0525ecfd5857693c0ae2b0",
"score": "0.69158864",
"text": "def list\n @locations = Location.select(\"id\", \"name\", \"latitude\", \"longtitude\")\n render json: {locations: @locations}\n end",
"title": ""
},
{
"docid": "805dbc4528d86fabc69957b7579f7ce1",
"score": "0.68849915",
"text": "def index\r\n @locations = Location.paginate(:page => params[:page])\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render :json => @locations }\r\n end\r\n end",
"title": ""
},
{
"docid": "efa3d404e76a5e66f1fb2c58be03c2fe",
"score": "0.68816525",
"text": "def index\n \tRails.logger.debug { \"Getting All Locations...\" }\n\n @locations = Location.all\n #respond_to do |format|\n # format.html { redirect_to @locations, notice: 'Locations successful.' }\n # format.json { render :show, locations: @locations }\n #end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.68428624",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "07124eb515a3ed01c155f6bb485af32b",
"score": "0.684146",
"text": "def locations\n\t\t@locations = Location.where(include: true).order(\"location\")\n\t\trender \"index.json.jbuilder\", status: :ok\n\tend",
"title": ""
},
{
"docid": "9520184bacc89ca4fe57966cd19563f3",
"score": "0.6820767",
"text": "def show\n @location = Location.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "f52228f1edb417c0d632a4cc1e5fe683",
"score": "0.68077344",
"text": "def show\n\n\t @location = Location.find(params[:id])\n\t\n\t respond_to do |format|\n\t format.html # show.html.erb\n\t format.json { render json: @location }\n\t end\n\n end",
"title": ""
},
{
"docid": "9f1702d084e537dd17dfa985e2b94119",
"score": "0.68022317",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @location }\n end\n end",
"title": ""
},
{
"docid": "9f1702d084e537dd17dfa985e2b94119",
"score": "0.68022317",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @location }\n end\n end",
"title": ""
},
{
"docid": "baee176575577c94b4634be8c3826055",
"score": "0.6784483",
"text": "def show\n @location = Location.find(params[:id])\n @json = Location.find(params[:id]).to_gmaps4rails\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "b70b99ca5ebb11b1e0378c2739a1ac6b",
"score": "0.67842615",
"text": "def all\n # will consult all the locations\n locations = Location.all\n # will pass the information in json format\n render :json => locations\n end",
"title": ""
},
{
"docid": "5682d7da47b9eabc498844b6d8f6fbf0",
"score": "0.67535317",
"text": "def find_location\n @location = Geocoder.search(params[:location])[0]\n respond_to do |format|\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "2aa00a46acfb5aae55686a60d54019bf",
"score": "0.6749348",
"text": "def index\n @apiv1_locations = Location.all\n end",
"title": ""
},
{
"docid": "c597f9eae6052a5b709bf1a125d5a250",
"score": "0.67459804",
"text": "def show\n @clientlocation = Clientlocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientlocation }\n end\n end",
"title": ""
},
{
"docid": "7d126aea68b09e001eceff8ec7eb0448",
"score": "0.6743751",
"text": "def show\n @location = Location.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @location }\n end\n end",
"title": ""
},
{
"docid": "44696c29645f85ef3c297398453d4669",
"score": "0.6740421",
"text": "def show\n render json: @location\n end",
"title": ""
},
{
"docid": "91df4b009ab7303f928a92b9339c2ee1",
"score": "0.6736963",
"text": "def index\n @locations = Location.all\n @markers = Location.all.to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "84390c39c3c35e497bd32c6f654a0115",
"score": "0.67221946",
"text": "def index\n @lesion_locations = LesionLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lesion_locations }\n end\n end",
"title": ""
},
{
"docid": "2d3b037ba7f64ad71ed7bf095094545a",
"score": "0.6717919",
"text": "def location(location_id)\n get(\"/locations/#{location_id}\")\n end",
"title": ""
},
{
"docid": "982bc3e6968d254ccfa9cacff73a0edf",
"score": "0.6714404",
"text": "def show\r\n @location = Location.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render :json => @location }\r\n end\r\n end",
"title": ""
},
{
"docid": "b530d6621878479da0b7a509d838a740",
"score": "0.6708206",
"text": "def get_location_id\n \n path = \"/locations/\"\n \n response = self.get_request(path)\n \n locations = {}\n if response.kind_of? Net::HTTPSuccess\n locations = JSON.parse(response.body.to_s)\n end\n \n return locations\n \n end",
"title": ""
},
{
"docid": "13e23e57b56cb1ddb3150410027f1519",
"score": "0.6705916",
"text": "def index\n @entries = @location.entries.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"title": ""
},
{
"docid": "6240aa70e907c938f17aded5511537e7",
"score": "0.67043304",
"text": "def show\n @geoloc = Geoloc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @geoloc }\n end\n end",
"title": ""
},
{
"docid": "5bf0bdd7a5becadfa10a3ad5c651eee8",
"score": "0.6678021",
"text": "def show\n @maplocation = MapLocation.find(params[:id])\n respond_to do |format|\n format.html\n format.json { render :json => @maplocation }\n end\n end",
"title": ""
},
{
"docid": "9f3a634d834dc698063dc7ef5102cda0",
"score": "0.66562706",
"text": "def show\n render json:@location, status: :ok\n\n end",
"title": ""
},
{
"docid": "a2e70df190a9f3710b9b69e176b7e84b",
"score": "0.664988",
"text": "def index\n\t\t#This next piece has a retard as its ideological author. Don't blame my hands for it.\n\t\trespond_to do |format|\n\t\t\tformat.html {\n\t\t\t\tredirect_to root_url unless current_user.allowed_to?(:manage_locations)\n\t\t\t\t@locations = Location.all \n\t\t\t}\n\t\t\tformat.json {\n\t\t\t\t@locations = if params[:updated_at]\n\t\t\t\t\tLocation.all.where(\"updated_at > ?\", params[:updated_at])\n\t\t\t\telse\n\t\t\t\t\tLocation.active_locations\n\t\t\t\tend\n\t\t\t}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0176fb78f54e076a81d563530170abf6",
"score": "0.6632918",
"text": "def location_primer\n render(json: location_list)\n end",
"title": ""
},
{
"docid": "36ba5afa72ed759c97080b90a59e7d71",
"score": "0.6628975",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @location }\n format.json { render :text => @location.to_json(:methods => [:google_map_url, :lat, :lng]) }\n end\n end",
"title": ""
},
{
"docid": "cb18a729b8f7ae5e3051a21709ded9fa",
"score": "0.6622146",
"text": "def index\n @survey_locations = SurveyLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @survey_locations }\n end\n end",
"title": ""
},
{
"docid": "43df3982ca874174c2750053d24e1f76",
"score": "0.6617097",
"text": "def index\n @locations = Location.all\n respond_to do |format|\n #format.html\n format.json { render json: @locations }\n format.xml { render xml: @locations }\n end\n end",
"title": ""
},
{
"docid": "d86fd40dc845003b0a9c233873adb7dd",
"score": "0.66159755",
"text": "def show\n @service_location = ServiceLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_location }\n end\n end",
"title": ""
},
{
"docid": "7dae98a451bb8843dbfc87aa6331400e",
"score": "0.66061085",
"text": "def show\n get_locations\n end",
"title": ""
},
{
"docid": "4f957f3df9caeaca01eda8d9493dd8a6",
"score": "0.65946335",
"text": "def show\n @admin_location = Admin::Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_location }\n end\n end",
"title": ""
},
{
"docid": "c89d23da5e3e52bcf7d6e5a6d09c802c",
"score": "0.6583627",
"text": "def show\n @location = Location.where(id: params[:id]).select(\"id\", \"name\", \"latitude\", \"longtitude\").first\n if @location\n render json: { location: @location }\n else\n render json: {status: \"location id does not exist\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "6319f032a05591a5fb1275e7c207b1d4",
"score": "0.6553536",
"text": "def query_locations(options={}) path = \"/api/v2/locations\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "026a7e847760bdbf8f7a95b69ad6baae",
"score": "0.6543552",
"text": "def index\n @locations = @org.locations\n end",
"title": ""
},
{
"docid": "090b17b9d66b7b03edf750c60c716b34",
"score": "0.6536548",
"text": "def shows\n @location = Location.find(params[:id])\n\trespond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @location }\n\tend\n end",
"title": ""
},
{
"docid": "01d6ab2544f03695ad33768ce3f39018",
"score": "0.65334034",
"text": "def show\n @user_location = UserLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_location }\n end\n end",
"title": ""
},
{
"docid": "bc11f9e2635f5ddbd9222510c27600fd",
"score": "0.65315735",
"text": "def show\n @location_type = LocationType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location_type }\n end\n end",
"title": ""
},
{
"docid": "08301a59367c7c3abfb7ce94a1ac43fc",
"score": "0.65269965",
"text": "def show\r\n @internship_location = InternshipLocation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @internship_location }\r\n end\r\n end",
"title": ""
},
{
"docid": "1f6f72bd9f8983e5e1508e2413dd9f31",
"score": "0.65247005",
"text": "def index\n authorize! :view_locations, current_account\n @locations = current_account.locations.all\n respond_with @locations\n end",
"title": ""
},
{
"docid": "4d2e204b2ed925e72813b3a9e64297c8",
"score": "0.6519792",
"text": "def index\n @locations = Location.find(:all)\n end",
"title": ""
},
{
"docid": "ee86540418a51fafc741c50bc9d954a7",
"score": "0.65194273",
"text": "def show\n @user_location = UserLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_location }\n format.json { render :json => @user_locations }\n end\n end",
"title": ""
},
{
"docid": "d3ba3af0eb22a5e18c030b5376278ba3",
"score": "0.6508344",
"text": "def location\n\t\trender :json => {\"latitude\" => Location.last.latitude, \"longitude\" => Location.last.longitude}\n\tend",
"title": ""
},
{
"docid": "e67549776d50afcdde2360c8e4b1dcdf",
"score": "0.6503008",
"text": "def get_json(location)\n response = RestClient::Request.new(\n :method => :get,\n :url => location,\n :user => $username,\n :password => $password,\n :headers => { :accept => :json,\n :content_type => :json,\n :params => { \"page\" => 1, \"per_page\" => 1000 }\n }\n ).execute\n results = JSON.parse(response.to_str)\n end",
"title": ""
},
{
"docid": "eeb49a366692b9503b964b24914a9bd6",
"score": "0.6500108",
"text": "def get_locations\n directions = User.find(params[:user_id]).directions\n\n render json: {directions: directions}\n end",
"title": ""
},
{
"docid": "332db2b6442f175cf35b8d306c475554",
"score": "0.6498453",
"text": "def get_by_state\n\t\t@location = Location.find_by(state: params[:state]).order(\"location\")\n\t\trender \"index.json.jbuilder\", status: :ok\n\tend",
"title": ""
},
{
"docid": "cbfdba76b1807f781576ede6f4f6765f",
"score": "0.649458",
"text": "def show\n @location_map = LocationMap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location_map }\n end\n end",
"title": ""
},
{
"docid": "f58de389928d2d962f10dddda5a8e88d",
"score": "0.6487289",
"text": "def show\n @geolocation = Geolocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @geolocation }\n end\n end",
"title": ""
},
{
"docid": "722fdc2822a0e15efa9060d47f1e704b",
"score": "0.6483576",
"text": "def index\n @location_types = LocationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @location_types }\n end\n end",
"title": ""
},
{
"docid": "c105d6705df644ba8bb1bc088cf00900",
"score": "0.64802927",
"text": "def show\n @userlocation = Userlocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @userlocation }\n end\n end",
"title": ""
},
{
"docid": "b812061a39611038ce804c6cfe7dfd04",
"score": "0.6478244",
"text": "def show\n @survey_location = SurveyLocation.find(params[:id])\n @json = @survey_location.to_gmaps4rails\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @survey_location }\n end\n end",
"title": ""
},
{
"docid": "805e5b54273bb44407911c3295be9010",
"score": "0.6476008",
"text": "def list_locations\n headers = default_headers\n headers['Accept'] = 'text/xml'\t# JSON locations not supported\n Nokogiri.XML(get('/locations', headers))\n end",
"title": ""
},
{
"docid": "c40027a5888a4ba440432450fcb22575",
"score": "0.64735895",
"text": "def index\n @locations = Location.all\n @json=Location.all.to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "0685128fbc78ad425c3cf20b82f54b75",
"score": "0.64734167",
"text": "def locations(slug = nil)\n get('locations', slug)\n end",
"title": ""
},
{
"docid": "11459e21fba5d19f78451e62e8520fff",
"score": "0.6470301",
"text": "def index\n per = 100\n page = params[:page] == nil ? 1 : params[:page]\n @locations = Location.order('department ASC, city ASC').page(page).per(per)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @locations }\n end\n end",
"title": ""
},
{
"docid": "3ad454d7f495e578b48ee466adcb7fb9",
"score": "0.64676756",
"text": "def show\n @collection_location_entry = CollectionLocationEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection_location_entry }\n end\n end",
"title": ""
},
{
"docid": "1f01f4232d1a2a60006ce4bf1f32346d",
"score": "0.6452171",
"text": "def show\n @lesion_location = LesionLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lesion_location }\n end\n end",
"title": ""
},
{
"docid": "54428b4caf798d602a3f3bf2d8ac6c22",
"score": "0.6451988",
"text": "def index\n @locations = @medium.locations\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @locations.to_xml }\n end\n end",
"title": ""
},
{
"docid": "0808facaa6cbc6748a1cd8da138c9f10",
"score": "0.6442747",
"text": "def show\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "245be6fe120756158b422267149e3bf5",
"score": "0.64363056",
"text": "def index\n @call_locations = CallLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @call_locations }\n end\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.6432456",
"text": "def index\n @locations = Location.all\n end",
"title": ""
}
] |
8c4d2d22842b449078d8941d5fae87a6
|
Wrapper to shorten the syntax and create a central place to modify in case preferences are stored differently in the future.
|
[
{
"docid": "bb25fef93de0aedeb871d851ed6c2ad6",
"score": "0.0",
"text": "def read_setting(key, default)\n Sketchup.read_default(PREF_KEY, key, default)\n end",
"title": ""
}
] |
[
{
"docid": "b33018a0d6c81a45db0f918e32777f64",
"score": "0.60158163",
"text": "def methodize_preferences\n #raise @options.to_yaml\n #convert preferences into methods for easier use in forms and form helpers\n #options = options.clone[0] if options[0].is_a?(Array) #allows you to pass in an array of symbols\n @options.keys.each do |num|\n k = @options[num][:key]\n class_eval do\n define_method k.to_sym do\n self[k]\n end\n define_method \"#{k}?\".to_sym do\n self[k]\n end\n define_method \"#{k}=\".to_sym do |value|\n self[k] = value\n end\n end\n end\n end",
"title": ""
},
{
"docid": "353610cba65b393f8af74ac5d0a0e1d7",
"score": "0.5978499",
"text": "def prefs; end",
"title": ""
},
{
"docid": "353610cba65b393f8af74ac5d0a0e1d7",
"score": "0.5978499",
"text": "def prefs; end",
"title": ""
},
{
"docid": "2d5cb7dfbb8878111d046db66e66fd85",
"score": "0.5730258",
"text": "def syntax=(values); end",
"title": ""
},
{
"docid": "bfaaf695000449f29f684045b2e75987",
"score": "0.5668408",
"text": "def preferences; {}; end",
"title": ""
},
{
"docid": "131a58dd3aa0db1e31de9f8ab75a87b4",
"score": "0.5623179",
"text": "def settings=(_arg0); end",
"title": ""
},
{
"docid": "131a58dd3aa0db1e31de9f8ab75a87b4",
"score": "0.5623179",
"text": "def settings=(_arg0); end",
"title": ""
},
{
"docid": "131a58dd3aa0db1e31de9f8ab75a87b4",
"score": "0.5623179",
"text": "def settings=(_arg0); end",
"title": ""
},
{
"docid": "131a58dd3aa0db1e31de9f8ab75a87b4",
"score": "0.5623179",
"text": "def settings=(_arg0); end",
"title": ""
},
{
"docid": "131a58dd3aa0db1e31de9f8ab75a87b4",
"score": "0.5623179",
"text": "def settings=(_arg0); end",
"title": ""
},
{
"docid": "131a58dd3aa0db1e31de9f8ab75a87b4",
"score": "0.5623179",
"text": "def settings=(_arg0); end",
"title": ""
},
{
"docid": "131a58dd3aa0db1e31de9f8ab75a87b4",
"score": "0.5623179",
"text": "def settings=(_arg0); end",
"title": ""
},
{
"docid": "09d37238d20d180cf2897d381e416cb9",
"score": "0.55816495",
"text": "def set ( var, value = \"\" )\nvalue = \"\\\"#{value}\\\"\" if QUOTED.include? var unless value =~ /^'.*'$/\n@settings << [ :set, var, value ]\nend",
"title": ""
},
{
"docid": "8610fbfd62af735738ae177d36e8f4fe",
"score": "0.5580157",
"text": "def local_settings; end",
"title": ""
},
{
"docid": "00ae00638def097c1a79085068999a9b",
"score": "0.55583924",
"text": "def get_preferences # :nodoc:\n {}.tap do |prefs|\n OptionParser.new do |o|\n o.version = ::Spoonerize::Version.to_s\n o.on(\"-r\", \"--[no-]reverse\", \"Reverse flipping\") do |v|\n prefs[\"reverse\"] = v\n end\n o.on(\"-l\", \"--[no-]lazy\", \"Skip small words\") do |v|\n prefs[\"lazy\"] = v\n end\n o.on(\"-m\", \"--[no-]map\", \"Print words mapping\") do |v|\n @map = v\n end\n o.on(\"-p\", \"--[no-]print\", \"Print all entries in the log\") do |v|\n @print = v\n end\n o.on(\"-s\", \"--[no-]save\", \"Save results in log\") do |v|\n @save = v\n end\n o.on(\"--exclude=WORD\", Array, \"Words to skip\") do |v|\n prefs[\"exclude\"] = v\n end\n end.parse!(options)\n end\n end",
"title": ""
},
{
"docid": "0fab64f9d4cfb2420d6499c16998a945",
"score": "0.55472994",
"text": "def local_settings=(_arg0); end",
"title": ""
},
{
"docid": "83dd1eb5b0cf051f76c8f3cf7c15edaf",
"score": "0.5496845",
"text": "def syntax=(*values); end",
"title": ""
},
{
"docid": "e315eec2c369a5112fb36ae5e8b440ca",
"score": "0.54907084",
"text": "def build_pref(package_name, pin, pin_priority)\n preference_content = \"Package: #{package_name}\\nPin: #{pin}\\nPin-Priority: #{pin_priority}\\n\"\nend",
"title": ""
},
{
"docid": "421168144c2a0b9d76162863fc5319ba",
"score": "0.5430148",
"text": "def setting_prefix\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "463c4c5d9b694371dbb6a6962d74075a",
"score": "0.537832",
"text": "def preferences\n end",
"title": ""
},
{
"docid": "463c4c5d9b694371dbb6a6962d74075a",
"score": "0.537832",
"text": "def preferences\n end",
"title": ""
},
{
"docid": "069453491537848933b109c5e6c5c8de",
"score": "0.5357851",
"text": "def add_preference(name, value); end",
"title": ""
},
{
"docid": "069453491537848933b109c5e6c5c8de",
"score": "0.5357851",
"text": "def add_preference(name, value); end",
"title": ""
},
{
"docid": "51051bd5cf5ffa4316547c34f65df348",
"score": "0.5355918",
"text": "def syntax; end",
"title": ""
},
{
"docid": "51051bd5cf5ffa4316547c34f65df348",
"score": "0.5355918",
"text": "def syntax; end",
"title": ""
},
{
"docid": "51051bd5cf5ffa4316547c34f65df348",
"score": "0.5355918",
"text": "def syntax; end",
"title": ""
},
{
"docid": "51051bd5cf5ffa4316547c34f65df348",
"score": "0.5355918",
"text": "def syntax; end",
"title": ""
},
{
"docid": "5a30636af065cfb453c911b593f2aeae",
"score": "0.53348434",
"text": "def quotePrefix; end",
"title": ""
},
{
"docid": "7c97680e88af16663e1ed2c7b2b2d799",
"score": "0.52900773",
"text": "def preferences(key, value)\n send :preferences, key, value\n end",
"title": ""
},
{
"docid": "3c47107a2cd09b2b69bae62bb44d923f",
"score": "0.5278896",
"text": "def setup_preferences\n defaults = default_preferences\n defaults.each do |pref, default|\n if self.preferences.try(:[], pref.to_s).nil?\n self.preferences[pref.to_s] = default\n end\n end\n end",
"title": ""
},
{
"docid": "1483cf36f4c2ab43ac3dd4db0d627f4a",
"score": "0.5255997",
"text": "def edit_settings(settings); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.5226297",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.5226297",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.5226297",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.5226297",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.5226297",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "2083aa7f5bd5f165c1d3ce5878f694a7",
"score": "0.52082163",
"text": "def set_preferences preferences\n\n set_height preferences[\"height_display\"] if preferences.try(:[], \"height_display\")\n set_birthday preferences[\"birthday\"] if preferences.try(:[], \"birthday\")\n self.preferences[\"sex\"] = preferences[\"sex\"] if preferences.try(:[], \"sex\")\n self.preferences[\"timezone\"] = preferences[\"timezone\"] if preferences.try(:[], \"timezone\")\n self.preferences[\"units\"] = preferences[\"units\"] if preferences.try(:[], \"units\")\n self.preferences[\"name\"] = preferences[\"name\"] if preferences.try(:[], \"name\")\n\n set_target_calories preferences[\"target_calories\"] if preferences.try(:[], \"target_calories\")\n set_activity_level preferences[\"activity_level\"] if preferences.try(:[], \"activity_level\")\n\n self.preferences[\"faturday_enabled\"] = (preferences[\"faturday_enabled\"] ? true : false) if preferences.try(:[], \"faturday_enabled\")\n set_auto_faturdays preferences[\"auto_faturdays\"] if preferences.try(:[], \"auto_faturdays\")\n\n self.preferences[\"faturday_calories\"] = preferences[\"faturday_calories\"].to_i if preferences.try(:[], \"faturday_calories\")\n self.preferences[\"faturday_fat\"] = preferences[\"faturday_fat\"].to_i if preferences.try(:[], \"faturday_fat\")\n self.preferences[\"faturday_carbs\"] = preferences[\"faturday_carbs\"].to_i if preferences.try(:[], \"faturday_carbs\")\n self.preferences[\"faturday_protein\"] = preferences[\"faturday_protein\"].to_i if preferences.try(:[], \"faturday_protein\")\n\n set_differential_metric preferences[\"differential_metric\"] if preferences.try(:[], \"differential_metric\")\n\n end",
"title": ""
},
{
"docid": "2249bc57b4f58eac255b675b8955ab87",
"score": "0.51890135",
"text": "def setting(*args, **options, &block); end",
"title": ""
},
{
"docid": "cff814ce008f9fc03b80a70f6e646fce",
"score": "0.5179402",
"text": "def autofinish; end",
"title": ""
},
{
"docid": "469eed7d472afe16071fff888079e1e8",
"score": "0.51789093",
"text": "def create_shorthand!\n create_background_shorthand!\n create_dimensions_shorthand!\n # border must be shortened after dimensions\n create_border_shorthand!\n create_font_shorthand!\n create_list_style_shorthand!\n end",
"title": ""
},
{
"docid": "469eed7d472afe16071fff888079e1e8",
"score": "0.51789093",
"text": "def create_shorthand!\n create_background_shorthand!\n create_dimensions_shorthand!\n # border must be shortened after dimensions\n create_border_shorthand!\n create_font_shorthand!\n create_list_style_shorthand!\n end",
"title": ""
},
{
"docid": "378bd7c9ea1fb3c700abb43c361eb18e",
"score": "0.51608396",
"text": "def method_missing(method, *args)\n if method.to_s =~ /^(.*)=$/\n instance_eval <<-RUBY\n def #{$1}=(value) # def setting=(value)\n @config[:#{$1}] = value # @config[:setting] = value\n end # end\n\n def #{$1} # def setting\n @config[:#{$1}] # @config[:setting]\n end # end\n RUBY\n\n @config[$1.to_sym] = args.first\n else\n super\n end\n end",
"title": ""
},
{
"docid": "417691f0afceddafeaa270dfe6c27fbc",
"score": "0.51515526",
"text": "def initialize(option_support=[:prefix_suffix,:over_write])\n \n super(option_support)\n\n end",
"title": ""
},
{
"docid": "7b81ee6712f25f5f1a20924ab645d473",
"score": "0.5150221",
"text": "def import_preferences\np \"BRUSH PREFERENCES\"\np \"blue: \" + $blue.to_s\np \"pink: \" + $pink.to_s\np \"green: \" + $green.to_s\nend",
"title": ""
},
{
"docid": "2f0c0eabf6ddc68e47a58c9467d60638",
"score": "0.5139127",
"text": "def method_missing(method, *args, &_block)\n super unless method.to_s =~ %r{^(\\w+)=?$}\n\n option = Regexp.last_match(1)\n add_option(option.to_s) if settings[option].nil?\n settings[option] = args[0] unless args.empty?\n end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.513396",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.513396",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "0a20abb4643333c491e2fdee77d70efd",
"score": "0.5126353",
"text": "def setting(name, **options, &block); end",
"title": ""
},
{
"docid": "f2ba7f6d34b2498541951cecd24dab9e",
"score": "0.51257783",
"text": "def handling_preferences_input; text_area_locator([], HeldInTrust::HANDLING_PREFERENCES.name) end",
"title": ""
},
{
"docid": "e17715a0f978c6c42a01034897c66efd",
"score": "0.5115764",
"text": "def set_prefs(response)\n mapping = {'g' => :group, 's' => :coffee}\n setting = mapping.detect{|k,v| k == response.matches[0][0]}[1]\n preference = response.matches[0][1].strip rescue nil\n update_preference(response,setting,preference)\n end",
"title": ""
},
{
"docid": "b381a994945f50687ff7aebfb04acf83",
"score": "0.5113424",
"text": "def delegate_some_preferences_to hash\n @@delegated_preference_method = {\n :class => hash[:class],\n :accessor => (hash[:accessor] || 'get_field'),\n :mutator => (hash[:mutator] || 'save_field'),\n }\n end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "601f75cba7fbba0a2d2e21a86c1131d0",
"score": "0.51023835",
"text": "def settings; end",
"title": ""
},
{
"docid": "9a3cb344c0099778d69d2973a5883587",
"score": "0.5092735",
"text": "def alias=(_); end",
"title": ""
},
{
"docid": "6e1113fa821496f083d756d148963bbf",
"score": "0.5089317",
"text": "def merge_opts!(source)\n source.split(/\\s/).each do |stm|\n key, value = stm.split(\"=\")\n if value\n gsub!(/#{key}=([^\\s]*)/, \"#{key}=#{value}\") \n else\n l,r = key.split(/\\d+/)\n if r\n gsub!(/#{l}\\d+#{r}/, key) \n else\n replace \"#{self} #{key}\"\n end \n end \n end\n self \n end",
"title": ""
},
{
"docid": "c4c6ccd8115d16a38e741da3980adc08",
"score": "0.50825423",
"text": "def custom (*args)\n if args.size == 2 # called in a config file\n @config[args[0]] = args[1]\n else # parse it out\n args[0].each do |str|\n key,val = str.split(/\\s*=\\s*/)\n val.gsub!(/^[\"']*(.*?)['\"]$/, '\\1')\n @config[key] = val\n end\n end\n end",
"title": ""
},
{
"docid": "12bca03f1dd3ddbdeac10038232e2d5a",
"score": "0.504111",
"text": "def use_for_snippets; end",
"title": ""
},
{
"docid": "761c5a8081c8b6163c40091b44aa9421",
"score": "0.5035293",
"text": "def fixed setting,value\n setter=\"#{setting.to_s}=\"\n set_value setter,value\n end",
"title": ""
},
{
"docid": "cb65e36aef4c258a17fe0db1be17d6dc",
"score": "0.5030829",
"text": "def settings(symbol)\n @settings.settings(symbol)\n end",
"title": ""
},
{
"docid": "c9be815db7a239723abb5083f0236978",
"score": "0.5027769",
"text": "def __strval_optkeys\n super() + ['show', 'disabledbackground', 'readonlybackground']\n end",
"title": ""
},
{
"docid": "e901c047bd2d6798ce4f1379e8a672fd",
"score": "0.5012307",
"text": "def mutt_variable name #{{{\n mutt_settings[/^#{name}[ =]/]\nend",
"title": ""
},
{
"docid": "07974b72e64affa0b2e3bf6049711aed",
"score": "0.50122863",
"text": "def show_preferences\n\t\tputs \"Your preferences are as follows:\"\n\t\tputs\n\t\t67.times do print \"*\" end \n\t\tputs\n\t\tputs\n\t\tputs \"1. Species - #{self.preferred_species}\"\n\t\tputs \"2. Temperament - #{self.preferred_temperament}\"\n\t\tputs \"3. Size - #{self.preferred_size}\"\n\t\tputs \"4. Zip - #{self.zip}\"\n\t\tputs \"To update your preferences, enter 'change'. Otherwise, enter 'done' to return to the main menu\"\n\t\tputs\n\t\t67.times do print \"*\" end \n\t\tputs\n\t\tputs\n\t\tself.change_preferences\n\t\tself.save\n\tend",
"title": ""
},
{
"docid": "89c7df01ae37d702a36eb736cb68c6f9",
"score": "0.50086343",
"text": "def preference\n pref = super\n pref || self.preference = Preference.new(easy_buttons: true)\n end",
"title": ""
},
{
"docid": "52f4ef18d385f48df385fc38e1612eb0",
"score": "0.50039274",
"text": "def supress_settings\n\t\thide = hidden_keys.map{|k| k.to_sym}\n\t\tsett = @settings.store_settings.to_a.map do |k,v|\n\t\t\tv = \"*********\" if hide.include? k\n\t\t\t[k,v]\n\t\tend\n\t\tsett\n\tend",
"title": ""
},
{
"docid": "42a4e808c2f7ed23356b2ef31e8bc518",
"score": "0.49991518",
"text": "def prefix(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "bbaef75039a80c43457646548588236b",
"score": "0.49986628",
"text": "def call(input)\n super.tap do |hash|\n hash[:data] = hash[:data].gsub(/[\"'](\\/\\*settings\\..+\\[.+\\]\\*\\/)[\"']/, '\\1')\n hash[:data] = hash[:data].gsub(/(\" (.*?) \")/, '\"\\2\"') # if value has quotes, then some redundant spaces are added. we remove them here\n end\n end",
"title": ""
},
{
"docid": "c9da8ac7596ac8e6976984a998fa4d9c",
"score": "0.49969715",
"text": "def set_preference!( key_str, value )\n return set_preference_by_method!( key_str, value, :save! )\n end",
"title": ""
},
{
"docid": "c9da8ac7596ac8e6976984a998fa4d9c",
"score": "0.49969715",
"text": "def set_preference!( key_str, value )\n return set_preference_by_method!( key_str, value, :save! )\n end",
"title": ""
},
{
"docid": "953e30c065ab05eaea769c3a521c653b",
"score": "0.49833494",
"text": "def augments_syntax_tokens; end",
"title": ""
},
{
"docid": "24b81a43da354a4659b9f55714ae634b",
"score": "0.49721408",
"text": "def get_settings; end",
"title": ""
},
{
"docid": "abdb7b0077f6a88f071b2f07192067f2",
"score": "0.49563873",
"text": "def preferences\n self[:preferences] ||= {}\n end",
"title": ""
},
{
"docid": "e59695adb708948bf05092fd416c4117",
"score": "0.4947863",
"text": "def shorthand\n abbreviation = self\n substitutions = {\n 'probably' => 'prolly',\n 'with' => 'w/',\n 'you' => 'u',\n 'love' => 'luv',\n 'without' => 'w/out',\n 'too' => '2',\n 'to' => '2'\n }\n substitutions.each do |phrase, replacement|\n abbreviation.gsub!(/\\b#{phrase}\\b/i, replacement)\n end\n abbreviation\n end",
"title": ""
},
{
"docid": "a742e0d6f5b47c10de5a963b70862a57",
"score": "0.49472415",
"text": "def preference_params\n saved_preferences = Preference.find_by(login: current_user.uid ) || ''\n settings_string = saved_preferences['settings'] || ''\n settings_hash = YAML.load(settings_string) || {}\n\nsettings_hash.delete('search_layouts')\n # # cleanup accidental nils\n # settings_hash.each do |key, value|\n # settings_hash.delete(key) if value.nil?\n # end\n\n if summon_facets = params_to_summon_facets(params)\n settings_hash['summon_facets'] = summon_facets\n end\n\n if datasource_sidebar = params_to_datasource_sidebar(params)\n settings_hash['datasource_sidebar'] = datasource_sidebar\n end\n\n # 'search_layouts' in config file,\n # effectively it's control over our quicksearch bento boxes\n if search_layouts = params_to_quicksearch_bentos(params)\n settings_hash[:search_layouts] = search_layouts\n end\n# raise\n\n ActionController::Parameters.new.permit(:login, :settings).merge(login: current_user.uid).merge(settings: settings_hash.to_yaml)\n end",
"title": ""
},
{
"docid": "78a7c51033f35b3ab6835bc8c698a67f",
"score": "0.49439123",
"text": "def setting(s)\r\n end",
"title": ""
},
{
"docid": "b97b700396ea6a8ccea539abf8b332b9",
"score": "0.49299923",
"text": "def preferences\n super || build_preferences.save(validate: false); super\n end",
"title": ""
},
{
"docid": "160442c0bda2a3d7b0e80046c31e56a7",
"score": "0.49230027",
"text": "def edit newcommand, this_alias\n return append(\"alias \" + this_alias + \"='\" + newcommand + \"'\", readYML(\"#{Dir.home}/.aka/.config\")[\"location\"] )\n end",
"title": ""
},
{
"docid": "ce9669931a3d417745a351fc531f84f3",
"score": "0.49199197",
"text": "def convert_hash_syntax(old_syntax)\n old_syntax.gsub(/:(\\w+) *=> */, '\\1: ')\nend",
"title": ""
},
{
"docid": "dc5d18d31895259383d074abd6b25c57",
"score": "0.49090216",
"text": "def use_separate_default_options(true_or_false); end",
"title": ""
},
{
"docid": "ae1fc31d84aa67915f29fc835b878239",
"score": "0.49060008",
"text": "def config_wrap_style style, sfx\n # This space left intentionally blank\n end",
"title": ""
},
{
"docid": "97b656217ddcd7537b0894e2251e8b5d",
"score": "0.48988983",
"text": "def popt_def()\n a = []\n a << \"\\\"#{options[:longName]}\\\"\"\n a << (options[:shortName] ? \"'#{options[:shortName]}'\" : '0')\n a << \"#{$types[options[:type]][:popttype]}\"\n a << \"&g_opts_storage.#{options[:var_name]}\"\n a << (options[:mnemonic] ? \"'#{options[:mnemonic]}'\" : '0')\n a << \"\\\"#{description}\\\"\"\n a << \"\\\"#{options[:unit]}\\\"\" if options[:unit]\n \" { #{a.join(', ')}},\"\n end",
"title": ""
},
{
"docid": "255b128abb2eb262fd52b20ff68129b9",
"score": "0.4898154",
"text": "def escaper=(_); end",
"title": ""
},
{
"docid": "f0db755b93b91484dc82076001d68503",
"score": "0.4890126",
"text": "def Settings *args\n Settings.defaults *args\nend",
"title": ""
},
{
"docid": "61939b6723047d2ccae7a5bbad79e3a7",
"score": "0.48872638",
"text": "def set_preference( key_str, value )\n return set_preference_by_method!( key_str, value, :save )\n end",
"title": ""
},
{
"docid": "61939b6723047d2ccae7a5bbad79e3a7",
"score": "0.48872638",
"text": "def set_preference( key_str, value )\n return set_preference_by_method!( key_str, value, :save )\n end",
"title": ""
},
{
"docid": "c086381ed776236ab215b29396a04757",
"score": "0.48830128",
"text": "def rubocop_options=(_); end",
"title": ""
},
{
"docid": "a76a928eb2cdc82b41cfff9a1b823f8e",
"score": "0.48803985",
"text": "def display_settings()\n if $settings[:space] == true\n display_setting = \"Yes\"\n else\n display_setting = \"No\"\n end\n puts \"Current Settings: \\nDifficulty: #{$settings[:difficulty]} | Reminder Interval: #{$settings[:reminder_time]} | Exercise Interval: #{$settings[:exercise_time]} | Limited Space: #{display_setting}\"\nend",
"title": ""
},
{
"docid": "4ea5c5c697ccbcd4ab35ea7f9ad6434d",
"score": "0.4880389",
"text": "def mote_vars(content)\n super.merge(current_admin: current_admin)\n end",
"title": ""
},
{
"docid": "3ad993a4131dcc939fba32d7906c5746",
"score": "0.48769498",
"text": "def special_editor(x)\n\tif x == 'z'\n\t\tx = 'b'\n\telsif x == 'd'\n\t\tx = 'f'\n\telsif x == 'h'\n\t\tx = 'j'\n\telsif x == 'n'\n\t\tx = 'p'\n\telsif x == 't'\n\t\tx = 'v'\n\tend\nend",
"title": ""
},
{
"docid": "91e00a09a95d288836897c32b1418fbe",
"score": "0.48690587",
"text": "def constants_keywords; end",
"title": ""
},
{
"docid": "f27739dda945cead6e02edecc3ba271b",
"score": "0.48659563",
"text": "def set_preference_by_method!( key_str, value, method )\n keys = key_str.split( '.' )\n root = self.preferences || {}\n pref = root\n\n keys.each_index do | index |\n key = keys[ index ]\n\n if ( index == keys.size - 1 )\n pref[ key ] = value\n else\n pref[ key ] ||= {}\n pref = pref[ key ]\n end\n end\n\n self.preferences = root\n return self.send( method )\n end",
"title": ""
},
{
"docid": "f27739dda945cead6e02edecc3ba271b",
"score": "0.48659563",
"text": "def set_preference_by_method!( key_str, value, method )\n keys = key_str.split( '.' )\n root = self.preferences || {}\n pref = root\n\n keys.each_index do | index |\n key = keys[ index ]\n\n if ( index == keys.size - 1 )\n pref[ key ] = value\n else\n pref[ key ] ||= {}\n pref = pref[ key ]\n end\n end\n\n self.preferences = root\n return self.send( method )\n end",
"title": ""
},
{
"docid": "dd29937e0628e36a5dad5d6aa0a3992b",
"score": "0.48646012",
"text": "def build_pref(package_name, pin, pin_priority)\n \"Package: #{package_name}\\nPin: #{pin}\\nPin-Priority: #{pin_priority}\\n\"\nend",
"title": ""
}
] |
26b3638d639b610ac191c19e97603bd4
|
Lazily loads all the following information into JSON object: devpayproductcodes privateip availabilityzone version instanceid billingproducts instancetype imageid accountid kernelid ramdiskid architecture pendingtime region
|
[
{
"docid": "e5d513d55d530943adb6f4464694b30c",
"score": "0.0",
"text": "def aws_facts\n uri = URI.parse(\"http://169.254.169.254/latest/dynamic/instance-identity/document\")\n body = Net::HTTP.get_response(uri).body\n JSON.parse(body)\nend",
"title": ""
}
] |
[
{
"docid": "3d7d09890babd0e501c2669cc4a0a9fc",
"score": "0.5834352",
"text": "def list_product_details\n if request.post?\n @uniq_folders = self.get_taxons\n edited_product_info = params[:product_info]\n new_data = JSON.parse edited_product_info\n id = 1;\n products = []\n new_data.each do |product|\n new_product_data = {\n name: product[\"columns\"][1],\n image: product[\"columns\"][5], \n taxons: product[\"columns\"][4], \n net_rate: product[\"columns\"][3], \n due_rate: product[\"columns\"][2], \n flag: product[\"columns\"][0],\n set_size: product[\"columns\"][7],\n available_on: product[\"columns\"][6]\n } \n products << {\n id: id,\n values: new_product_data\n }\n id = id + 1\n end\n add_taxonomies\n @taxons = add_taxons\n add_products(products)\n remove_images_folder\n else\n @products = get_products\n end\n end",
"title": ""
},
{
"docid": "9c6c34ac944675b1b3af94985e493d0f",
"score": "0.5726002",
"text": "def details\n # If we had some free 'more' data from the instanciation we should use it!\n if @more\n more = @more\n remove_instance_variable(:@more)\n end\n \n # If we have no data then we should get it from the ProductId\n if more.nil?\n # TODO: check to see if there are more than one\n more = @api.api_request('productsearch',:searchtext => @product_id)['Products'][0]\n end\n \n @healthier_alternative = Product.new(@api,more['HealthierAlthernativeProductId']) rescue nil\n @cheaper_alternative = Product.new(@api,more['CheaperAlthernativeProductId']) rescue nil\n @base_product = Product.new(@api,more['BaseProductId']) rescue nil\n @image_url = more['ImagePath']\n # ProducyType?\n # OfferValidity?\n @name = more['Name']\n @max_quantity = more['MaximumPurchaseQuantity']\n @barcode = Barcode.new(more['EANBarcode'])\n @offer = Offer.new(more['OfferLabelImagePath'],more['OfferPromotion'],more['OfferValidity']) rescue nil\n end",
"title": ""
},
{
"docid": "31b3984a558b3d4d87455759f772896c",
"score": "0.56901073",
"text": "def process_inv_product_response(raw_data, digital_format_list)\n raw_data.map do |p|\n\n begin\n product = response_mapper(p, {\n 'Inv_Product.ID' => 'identifier',\n 'Inv_Product.ProdCode' => 'sku',\n 'Inv_Product.Full_Title' => 'name',\n 'Inv_Product.SubTitle' => 'disambiguatingDescription',\n 'Inv_Product.ISBN_UPC' => 'isbn',\n 'Inv_Product.Pub_Date' => 'datePublished',\n 'Inv_Product.Next_Release' => 'releaseDate',\n })\n\n # Nullify blank dates\n if product['datePublished'] == '0000-00-00T00:00:00'\n product['datePublished'] = nil\n end\n\n if product['releaseDate'] == '0000-00-00T00:00:00'\n product['releaseDate'] = nil\n end\n\n product['@type'] = 'Product'\n product['isTaxable'] = get_field_value(p, 'Inv_Product.Taxable') == '1'\n product['isOnWebsite'] = get_field_value(p, 'Inv_Product.Not_On_Website') == '0'\n product['noBackorderFill'] = get_field_value(p, 'Inv_Product.No_Backorder_Fill') == '1'\n product['trackInventory'] = !(get_field_value(p, 'Inv_Product.Non_Inventory') == '1' ||\n get_field_value(p, 'Inv_Product.Assembly') == '1' ||\n get_field_value(p, 'Inv_Product.Consignment') == '1')\n product['acumenAttributes'] = {\n 'info_alpha_1' => get_field_value(p, 'Inv_Product.Info_Alpha_1'),\n 'info_boolean_1' => get_field_value(p, 'Inv_Product.Info_Boolean_1'), # is_available_on_formed\n }\n product['additionalProperty'] = [\n {\n '@type' => 'PropertyValue',\n 'propertyID' => 'is_master',\n 'value' => get_field_value(p, 'Inv_Product.OnWeb_LinkOnly') == '0',\n },\n # Product availability within Acumen is not always a \"line in the sand\"\n # situation in some cases, the requirements can become rather complex.\n # As a result, this agent does not strictly set availability, but rather\n # outputs the properties associated with setting it so that client-specific\n # logic can be implemented in subsequent agents which may require external\n # data (such as stock quantities for consignment products).\n {\n '@type' => 'PropertyValue',\n 'propertyID' => 'disable_web_purchase',\n 'value' => get_field_value(p, 'Inv_Product.Disable_Web_Purchase') == '1',\n },\n {\n '@type' => 'PropertyValue',\n 'propertyID' => 'no_backorder_fill',\n 'value' => get_field_value(p, 'Inv_Product.No_Backorder_Fill') == '1',\n },\n {\n '@type' => 'PropertyValue',\n 'propertyID' => 'not_on_website',\n 'value' => get_field_value(p, 'Inv_Product.Not_On_Website') == '1',\n },\n {\n '@type' => 'PropertyValue',\n 'propertyID' => 'non_inventory',\n 'value' => get_field_value(p, 'Inv_Product.Non_Inventory') == '1',\n },\n {\n '@type' => 'PropertyValue',\n 'propertyID' => 'is_consignment',\n 'value' => get_field_value(p, 'Inv_Product.Consignment') == '1',\n },\n ]\n\n product['offers'] = [{\n '@type' => 'Offer',\n 'price' => get_field_value(p, 'Inv_Product.Price_1'),\n 'availability' => get_field_value(p, 'Inv_Product.BO_Reason')\n }]\n\n if get_field_value(p, 'Inv_Product.Price_2')\n product['offers'].push({\n '@type' => 'Offer',\n 'price' => get_field_value(p, 'Inv_Product.Price_2'),\n 'availability' => get_field_value(p, 'Inv_Product.BO_Reason')\n })\n end\n\n not_on_website = get_field_value(p, 'Inv_Product.Not_On_Website')\n disable_web_purchase = get_field_value(p, 'Inv_Product.Disable_Web_Purchase')\n\n weight = get_field_value(p, 'Inv_Product.Weight')\n product['weight'] = get_quantitative_value(weight, 'oz.')\n\n # The category used here is the Acumen Product category. Functionally, this\n # serves as the product's _format_. This field is different from Web Categories\n # which behave more like traditional category taxonomies.\n category = get_field_value(p, 'Inv_Product.Category')\n if category\n product['acumenAttributes']['category'] = category\n product['isDigital'] = digital_format_list.find { |f| f == category } ? true : false\n\n if category == 'Paperback'\n product['additionalType'] = 'Book'\n product['bookFormat'] = \"http://schema.org/Paperback\"\n product['accessMode'] = \"textual\"\n elsif category == 'Hardcover'\n product['additionalType'] = 'Book'\n product['bookFormat'] = \"http://schema.org/Hardcover\"\n product['accessMode'] = \"textual\"\n elsif category == 'eBook'\n product['additionalType'] = 'Book'\n product['bookFormat'] = \"http://schema.org/EBook\"\n product['accessMode'] = \"textual\"\n elsif category == 'CD'\n product['additionalType'] = 'CreativeWork'\n product['accessMode'] = \"auditory\"\n end\n end\n\n product\n\n rescue => error\n issue_error(AcumenAgentError.new(\n 'process_inv_product_response',\n 'Failed to load Inventory Product Records',\n {\n product_id: get_field_value(p, 'Inv_Product.ID'),\n sku: get_field_value(p, 'Inv_Product.ProdCode')\n },\n error,\n ))\n\n return\n end\n end\n end",
"title": ""
},
{
"docid": "14a74caa1f435d6668afbe82f5c2ae30",
"score": "0.5682631",
"text": "def getBillingData(page)\n summary = page.search(\"/html/body/div[@id='doc4']/div[@id='bd']/div[@id='yui-main']/div[@class='yui-b']/div[@class='yui-gc']/\n div[@id='activity_table_block']/div[@id='billingSummary']\").first\n service_charge = summary.xpath(\"div[@class='marketplace']/div[@class='hdrdkorange']/span[@class='amount']\").text()\n \n downloadLineData = page.search(\"/html/body/div[@id='doc4']/div[@id='bd']/div[@id='yui-main']/div[@class='yui-b']/div[@class='yui-gc']/\n div[@id='activity_table_block']/div[@id='activity_tab_block']/div[@class='yui-content']/\n div[@id='account_activity_table_tab_content']\").first\n \n products = downloadLineData.xpath(\"//span[@class='hdrdkorange']\")\n \n awsStatementItemArray = Array.new\n \n # Iterating over the array of Products\n for prdCntr in 0..products.length-1\n product = String.new(products[prdCntr])\n \n if(product =~ /Amazon Elastic(.*)/)\n region_array= downloadLineData.xpath(\"//tr[starts-with(@id, 'AmazonEC2')]\")\n \n # Iterating over the array of Regions\n for rgnCntr in 0..region_array.length-1\n \n #find a particular region that end with \"region\"\n regions = String.new(region_array[rgnCntr])\n if(regions =~ /Region$/)\n puts regions\n end \n \n # Find all usage Types belonging to a region\n usageTypes = region_array.xpath(\"//td[contains(@class, 'bordgreybot txtxsm bold padlt20')]\")\n \n for usageTypeCntr in 0..usageTypes.length-1\n puts usageTypes[usageTypeCntr].text()\n end\n \n awsStatementItem = AwsStatementItem.new\n awsStatementItem.product=product\n awsStatementItemArray.push awsStatementItem\n \n writeToCSV(awsStatementItemArray)\n \n end\n end \n end\n \n end",
"title": ""
},
{
"docid": "200c274f0e3180f4c472186ec7bb28b3",
"score": "0.5682253",
"text": "def extract\n # Create summarized product details object for all the products crawled & add it to the array\n @search_data.each do |product|\n # Create a new hash with default values 1\n product_details = Hash[@keys.map {|x| [x,1]}]\n\n # Populate hash with the appropriate values\n product_details[:id] = @products.length + 1\n product_details[:name] = product.split(',')[6].split(':')[1].split('\"')[1]\n product_details[:price] = product.split(',')[0].split(':')[1].split('\"')[1] + \" \" + product.split(',')[2].split(':')[1].split('\"')[1]\n product_details[:availability] = product.split(',')[3].split('\":\"')[1].split('\"}')[0].split('/')[3]\n product_details[:image] = product.split(',')[4].split('\":\"')[1].split('\"')[0]\n if product_details[:id] != 39\n product_details[:url] = product.split(',')[7].split('\":\"')[1]\n else\n product_details[:url] = product.split(',')[7].split('\":\"')[1].split('\"}]}')[0]\n end\n\n # Push populated hash into the array\n @products << product_details\n end\n\n # JSON.pretty_generate(@products)\n puts \"Product details => #{JSON.pretty_generate(@products)}\"\n end",
"title": ""
},
{
"docid": "8883be06f47f8285d74a52ba70b67320",
"score": "0.5651111",
"text": "def show\n #@ccbs_bundle_product = CcbsBundleProduct.find(params[:id])\n\n prd_attribute = PrdAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ccbs_bundle_product }\n format.json { \n\n ccbs_bundle_product = CcbsBundleProduct.new\n ccbs_bundle_product.set_fields(prd_attribute)\n\n results = mapping_to_hash(ccbs_bundle_product, CcbsBundleProduct.json_mapping_table)\n ccbs_bundle_product.send_to_ccbs('POST', results.to_json)\n\n render :json => results\n }\n end\n end",
"title": ""
},
{
"docid": "4a9dfece9cd91fb0ed5197722fe77267",
"score": "0.5636254",
"text": "def billing_details\n response = get('/billingdetails.json')\n Hashie::Mash.new(response)\n end",
"title": ""
},
{
"docid": "368792a4ebd31ec409f435845c99ed95",
"score": "0.5634781",
"text": "def get_instances_description\n [{\n #:instance_id => \"resp.instanceId\",\n #:name => \"resp.instanceId\",\n :ip => \"192.168.1.6\" ,\n :status => \"running\", # resp.instanceState.name,\n :launching_time => Date.today.to_s.parse_datetime , #resp.launchTime.parse_datetime,\n :internal_ip => \"192.168.1.6\", #Resolv::MDNS.new.getaddress(\"poolparty.local\").to_s,\n :keypair => \"netociety_app\",\n :security_group => \"group\"\n }]\n # EC2ResponseObject.get_descriptions(ec2.describe_instances)\n end",
"title": ""
},
{
"docid": "ac658283b6ca25725cbb0a6f9998085b",
"score": "0.55943227",
"text": "def host_info\n [\n @_host.summary.config.product.fullName,\n @_host.summary.config.product.apiType,\n @_host.summary.config.product.apiVersion,\n @_host.summary.config.product.osType,\n @_host.summary.config.product.productLineId,\n @_host.summary.config.product.vendor,\n @_host.summary.config.product.version\n ]\n end",
"title": ""
},
{
"docid": "ed3e9ac09c6de9f646e4dff643e1890f",
"score": "0.5581078",
"text": "def process\n data = {}\n\n @instances ||= []\n\n @instances.each do |i|\n data[i[:platform]] ||= {}\n data[i[:platform]][i[:arch]] ||= []\n data[i[:platform]][i[:arch]] << i.reject { |k,v| k == :platform || k == :arch }\n end\n data\n end",
"title": ""
},
{
"docid": "874fa52237423a45d24fef9ad9d462ae",
"score": "0.5574809",
"text": "def process\n data = {}\n\n @instances ||= []\n\n @instances.each do |i|\n data[i[:platform]] ||= {}\n data[i[:platform]][i[:arch]] ||= []\n data[i[:platform]][i[:arch]] << i.reject { |k, v| k == :platform || k == :arch }\n end\n data\n end",
"title": ""
},
{
"docid": "c2bc170271bde17d456c47bffc602978",
"score": "0.5561103",
"text": "def hash\n [issuing_bank_name, country_of_issuance, card_product_id, detailed_product_id, association_response_code_adtl, card_brand].hash\n end",
"title": ""
},
{
"docid": "e63ccdc324df17ec28bf532c261e7267",
"score": "0.5542327",
"text": "def all\n data = []\n if @ec2_main.settings.openstack\n conn = @ec2_main.environment.connection\n if conn != nil\n begin\n x = conn.flavors.all\n x.each do |y|\n vcpu = nil\n begin\n vcpu = y.vcpus\n rescue\n vcpu = nil\n end\n if vcpu != nil\n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB VCPU: #{y.vcpus}VCPUs)\")\n else\n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB)\")\n end\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else\n raise \"Connection Error\"\n end\n elsif @ec2_main.settings.google\n conn = @ec2_main.environment.connection\n if conn != nil\n begin\n response = conn.list_machine_types($google_zone)\n if response.status == 200\n x = response.body['items']\n x.each do |r|\n data.push(\"#{r['name']} ( Mem: #{r['memoryMb']}MB Disks: #{r['maximumPersistentDisks']} Disk Size: #{r['maximumPersistentDisksSizeGb']}GB CPUs: #{r['guestCpus']})\")\n end\n else\n data = []\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else\n raise \"Connection Error\"\n end\n else\n data.push('t2.micro (1 vCPU, 6 CPU Credits, 1GB Mem, EBS Only)')\n data.push('t2.small (1 vCPU, 12 CPU Credits, 2GB Mem, EBS Only)')\n data.push('t2.medium (2 vCPU, 24 CPU Credits, 4GB Mem, EBS Only)')\n data.push('t2.large (2 vCPU, 36 CPU Credits, 8GB Mem, EBS Only)')\n data.push('m4.large (2 vCPU, 8GB Mem, 450 Mbps)')\n data.push('m4.xlarge (4 vCPU, 16GB Mem, 750 Mbps)')\n data.push('m4.2xlarge (8 vCPU, 32GB Mem, 1000 Mbps)')\n data.push('m4.4xlarge (16 vCPU, 64GB Mem, 2000 Mbps)')\n data.push('m4.10xlarge (40 vCPU, 160GB Mem, 4000 Mbps)')\n data.push('m3.medium (1 vCPU, 3.75GB Mem, 1 x 4GB SSD)')\n data.push('m3.large (2 vCPU, 7.5GB Mem, 1 x 32GB SSD )')\n data.push('m3.xlarge (4 vCPU, 15GB Mem, 2 x 40GB SSD)')\n data.push('m3.2xlarge (8 vCPU, 30GB Mem, 2 x 80GB SSD)')\n data.push('c4.large (2 vCPU, 3.75GB Mem, 500 Mbps)')\n data.push('c4.xlarge (4 vCPU, 7.5GB Mem, 750 Mbps)')\n data.push('c4.2xlarge (8 vCPU, 15GB Mem, 1000 Mbps)')\n data.push('c4.4xlarge (16 vCPU, 30GB Mem, 2000 Mbps)')\n data.push('c4.8xlarge (36 vCPU, 60GB Mem, 4000 Mbps)')\n data.push('c3.large (2 vCPU, 3.75GB Mem, 2 x 16GB SSD)')\n data.push('c3.xlarge (4 vCPU, 7.5GB Mem, 2 x 40GB SSD)')\n data.push('c3.2xlarge (8 vCPU, 15GB Mem, 2 x 80GB SSD)')\n data.push('c3.4xlarge (16 vCPU, 30GB Mem, 2 x 160GB SSD)')\n data.push('c3.8xlarge (32 vCPU, 60GB Mem, 2 x 320GB SSD)')\n data.push('r3.large (2 vCPU, 15.25GB Mem, 1 x 32GB SSD)')\n data.push('r3.xlarge (4 vCPU, 30.5GB Mem, 1 x 80GB SSD)')\n data.push('r3.2xlarge (8 vCPU, 61GB Mem, 1 x 160GB SSD)')\n data.push('r3.4xlarge (16 vCPU, 122GB Mem, 1 x 320GB SSD)')\n data.push('r3.8xlarge (32 vCPU, 244GB Mem, 2 x 320GB SSD)')\n data.push('g2.2xlarge (8 vCPU, 15GB Mem, 1 x 60GB SSD)')\n data.push('g2.8xlarge (32 vCPU, 60GB Mem, 2 x 120GB SSD)')\n data.push('i2.xlarge (4 vCPU, 30.5GB Mem, 1 x 800GB SSD)')\n data.push('i2.2xlarge (8 vCPU, 61GB Mem, 2 x 800GB SSD)')\n data.push('i2.4xlarge (16 vCPU, 122GB Mem, 4 x 800GB SSD)')\n data.push('i2.8xlarge (32 vCPU, 244GB Mem, 8 x 800GB SSD)')\n data.push('d2.xlarge (4 vCPU, 30.5GB Mem, 3 x 2000 HDD)')\n data.push('d2.2xlarge (8 vCPU, 61GB Mem, 6 x 2000 HDD)')\n data.push('d2.4xlarge (16 vCPU, 122GB Mem, 12 x 2000 HDD)')\n data.push('d2.8xlarge (32 vCPU, 244GB Mem, 24 x 2000 HDD)')\n end\n return data\n end",
"title": ""
},
{
"docid": "667f71f6fd4675df876b087e7448c117",
"score": "0.55291617",
"text": "def prepare_instance_data(hash)\n {\n \"ec2_instance_id\" => hash.fetch(:instance_id),\n \"ec2_private_dns_name\" => hash.fetch(:private_dns_name),\n \"ec2_private_ip_address\" => hash.fetch(:private_ip_address),\n \"ec2_ip_address\" => hash.fetch(:ip_address),\n \"ec2_instance_tags\" => ec2_instance_tags(hash.fetch(:instance_id)),\n }\n end",
"title": ""
},
{
"docid": "8cf308bce1a08fb088015b4362231d70",
"score": "0.5523696",
"text": "def beneficiary\n auth_token = Session.where(:session_id => session[:session_id]).first.auth_token\n url_send = \"http://stagingapi.instarem.com/v1/api/v1/GetPayeeList\"\n response = instarem_api(url_send , nil , auth_token)\n @parsed = JSON.parse(response.read_body)[\"responseData\"].first(3)\n end",
"title": ""
},
{
"docid": "33f9a1f1511539800c4349d372872cc9",
"score": "0.5466671",
"text": "def show\n @product = find_product(params[:id])\n expires_in 15.minutes, :public => true\n headers['Surrogate-Control'] = \"max-age=#{15.minutes}\"\n headers['Surrogate-Key'] = \"product_id=1\"\n @product_type = LuxireProductType.all\n @luxire_vendor = LuxireVendorMaster.all\n @luxire_product_type = @product.luxire_product_type\n if @luxire_product_type\n @luxire_product_type_attributes = @luxire_product_type.measurement_types\n @luxire_product_type_attributes = MeasurementType.joins(\"INNER JOIN product_measurement_types ON product_measurement_types.measurement_type_id = measurement_types.id AND product_measurement_types.luxire_product_type_id = \" + @luxire_product_type.id.to_s).order(\"product_measurement_types.position\")\n if @luxire_product_type_attributes\n @luxire_product_type_attributes_customize = @luxire_product_type_attributes.where(category: \"customize\")\n @luxire_product_type_attributes_personalize = @luxire_product_type_attributes.where(category: \"personalize\")\n @luxire_product_type_attributes_measurement = @luxire_product_type_attributes.where(category: \"measurement\")\n @luxire_product_type_attributes_measuement_std = @luxire_product_type_attributes.where(sub_category: \"std\")\n @luxire_product_type_attributes_measuement_body = @luxire_product_type_attributes.where(sub_category: \"body\")\n\t end\n end\n end",
"title": ""
},
{
"docid": "f6b65a25f9afd635b91f60daffcef9b6",
"score": "0.5459239",
"text": "def get_product_information_from_container(container); end",
"title": ""
},
{
"docid": "2350a07bec44f11fe381da481062be39",
"score": "0.54511255",
"text": "def product_info\n {\n 'product_name' => {\n 'default_value' => 'lti2_reference_tool_provider'\n },\n 'product_version' => '1.0',\n 'description' => {\n 'default_value' => 'LTI 2.1 tool provider reference implementation'\n },\n 'product_family' => {\n 'code' => 'lti2_reference_tool_provider',\n 'vendor' => {\n 'code' => 'Instructure.com',\n 'vendor_name' => {\n 'default_value' => 'Instructure'\n },\n 'description' => {\n 'default_value' => 'Canvas Learning Management System'\n }\n }\n }\n }\n end",
"title": ""
},
{
"docid": "20b3921178d685a10c890588e1668a78",
"score": "0.54483837",
"text": "def get_dashboard_items\n response.headers['Cache-Control'] = 'public, max-age=300'\n facts_dict = {\n \"ram\" => \"memorysize\",\n \"ram_total\" => \"memorytotal\",\n \"cloud_provider\" => \"cloudways_cloud\",\n \"location\" => \"cloudways_region\",\n \"roles\" => \"cloudways_roles\",\n \"websites\" => \"cloudways_websites_list\",\n \"public_ip\" => \"cloudways_public_ip\",\n \"os\" => \"operatingsystem\",\n \"os_release\" => \"operatingsystemrelease\",\n \"os_family\" => \"osfamily\",\n \"kernel\" => \"kernel\",\n \"kernel_release\" => \"kernelrelease\",\n \"distribution\" => \"lsbdistdescription\",\n \"procs_count\" => \"processorcount\",\n \"procs_type\" => \"processor0\",\n \"arch\" => \"architecture\",\n \"hardware_model\" => \"hardwaremodel\",\n \"uptime\" => \"uptime\",\n }\n @customer_number = params[:customer_number]\n @hostname = params[:hostname]\n\n if @customer_number.nil?\n @response[:status] = -1\n @response[:msg] = \"Customer number parameter missing.\"\n @is_clean = false\n end\n\n if @hostname.nil?\n @response[:status] = -1\n @response[:msg] = \"Hostname parameter missing.\"\n @is_clean = false\n end\n\n @customer_number = @params_verifier.get_customer_number(@customer_number)\n if @customer_number.nil?\n @response[:status] = -1\n @response[:msg] = \"Incorrect customer number provided.\"\n @is_clean = false\n end\n\n unless @is_clean\n return render :json => @response\n end\n\n\n begin\n rpc_client = rpcclient('rpcutil', {:exit_on_failure => false})\n rpc_client.verbose = false\n rpc_client.progress = false\n rpc_client.fact_filter \"cloudways_customer\", @customer_number\n rpc_client.identity_filter @hostname\n rpc_client.timeout = @timeout\n\n facts_string = facts_dict.values.join(', ')\n rpc_response = rpc_client.get_facts(:facts => facts_dict.values.join(', '))\n\n facts_result = {}\n\n rpc_response = rpc_response[0]\n\n facts_dict.each do |fact_hash, fact_name|\n begin\n fact_value = rpc_response.results[:data][:values][fact_name]\n rescue NoMethodError => e\n fact_value = ''\n end\n facts_result[fact_hash] = fact_value\n end\n\n response = {\n :items => facts_result,\n }\n\n @response[:status] = 0\n @response[:response] = response\n rescue Exception => e\n @response[:status] = -2\n @response[:msg] = \"API error: #{e}\"\n end\n\n render :json => @response\n end",
"title": ""
},
{
"docid": "73b811331ff1901097a52cb91cc512b8",
"score": "0.5419735",
"text": "def product_line_data\n {\n id: product_line.id,\n name: product_line.name,\n display_order: product_line.display_order\n }\n end",
"title": ""
},
{
"docid": "b213aa7a85960585c0378b8cb3e98fc1",
"score": "0.5412677",
"text": "def rest_show \n {\n \"id\" => self.id, \n \"name\" => self.name,\n \"description\" => self.description, \n \"product_priority\" => {\n \"id\" => self.product_priority_id, \n \"name\" => self.priority\n }, \n \"product_type\" => {\n \"id\" => self.product_type_id, \n \"name\" => self.type\n },\n \"product_state\" => {\n \"id\" => self.product_state_id, \n \"name\" => self.state\n }, \n \"groups\" => self.rest_groups, \n \"services\" => self.rest_services,\n \"employees\" => self.rest_employees\n }\n end",
"title": ""
},
{
"docid": "05596506e4f178f91ee8771dd3df584b",
"score": "0.54046434",
"text": "def purchase_options\n {\n :ip => ip_address,\n :billing_address => {\n :name => \"Admin Amir\",\n :address1 => \"123 Main St.\",\n :city => \"New York\",\n :state => \"NY\",\n :country => \"US\",\n :zip => \"10001\"\n }\n }\n end",
"title": ""
},
{
"docid": "d09381cd2267f3cbd1f7fd7fbd874b63",
"score": "0.5367949",
"text": "def build_response\n response = []\n total_devices = 0\n total_firewalls = 0\n # total_mailboxes = 0\n total_cost = 0\n accounts_to_bill.each do |acc|\n next if acc.billing_account.trial?\n\n subtotal = ((@devices[acc.path] || 0) + (@firewalls[acc.path] || 0))\n total_cost += subtotal\n total_devices += @devices[acc.path] || 0\n total_firewalls += @firewalls[acc.path] || 0\n # total_mailboxes += @mailboxes[acc.path] || 0\n response << {\n name: acc.name,\n devices: @devices[acc.path] || 0,\n firewalls: @firewalls[acc.path] || 0,\n # mailboxes: @mailboxes[acc.path] || 0,\n subtotal: subtotal\n }\n end\n\n plan = base_account&.billing_account&.plan\n included_devices = plan&.included_devices || 0\n included_firewalls = plan&.included_firewalls || 0\n billable_devices = [0, (total_devices - included_devices)].max\n billable_firewalls = [0, (total_firewalls - included_firewalls)].max\n\n {\n total: billable_devices + billable_firewalls,\n devices: billable_devices,\n firewalls: billable_firewalls,\n # mailboxes: total_mailboxes,\n details: response,\n billing_start_date: @start_date,\n billing_end_date: @end_date,\n last_bill: base_account.charges.order(:end_date).first&.end_date\n }\n end",
"title": ""
},
{
"docid": "d9008cc693962cb95f746e4a67532139",
"score": "0.5354396",
"text": "def handle_product(p)\n product = {}\n product[\"categoryid\"] = get(p, 'CategoryID') \n product[\"color\"] = get(p, 'Color')\n product[\"datesellend\"] = get(p, 'DateSellEnd')\n product[\"datesellendraw\"] = get(p, 'DateSellEndRaw')\n product[\"datesellstart\"] = get(p, 'DateSellStart')\n product[\"datesellstartraw\"] = get(p, 'DateSellStartRaw')\n product[\"listprice\"] = get(p, 'ListPrice')\n product[\"listpriceraw\"] = get(p, 'ListPriceRaw')\n product[\"modelid\"] = get(p, 'ModelID')\n product[\"name\"] = get(p, 'Name')\n product[\"photo\"] = get(p, 'Photo')\n product[\"productid\"] = get(p, 'ProductID')\n product[\"productnumber\"] = get(p, 'ProductNumber')\n product[\"size\"] = get(p, 'Size')\n product[\"standardcost\"] = get(p, 'StandardCost')\n product[\"standardcostraw\"] = get(p, 'StandardCostRaw')\n #Add a custom field so the reps can see the profit per product\n product[\"profit\"] = format_currency(product[\"listprice\"].to_f - product[\"standardcost\"].to_f)\n product[\"profitraw\"] = product[\"listprice\"].to_f - product[\"standardcost\"].to_f\n \n #Look up taxes and shipping costs\n #Value returned looks like the following line:\n #SubTotal: $34.99/Tax: $2.80/Shipping:$0.87/Total: $38.66\n \n pricing = \n call_service(\"GetPricing\", \"&productID=#{product[\"productid\"]}&quantity=1&discountPercent=0\")\n if !pricing[\"content\"].start_with?(\"ERROR\")\n items = pricing[\"content\"].split(\"/\")\n items.each do |item|\n parts = item.split(\":\")\n \n #Only interested in the Tax and Shipping items\n \n if parts[0] == \"Tax\" || parts[0] == \"Shipping\"\n product[\"tax\"] = parts[1].strip\n product[\"shipping\"] = parts[1].strip \n \n amount = parts[1].split(\"$\")\n product[\"taxraw\"] = amount[1]\n \n amount = parts[1].split(\"$\")\n product[\"shippingraw\"] = amount[1] \n end\n end\n end\n return product\nend",
"title": ""
},
{
"docid": "778d4d71b2f1c4425f0e3245e586b1ab",
"score": "0.535407",
"text": "def create_instance_provisioning_infos\n instances_to_provision_array = []\n instance_distribution = determine_frontend_instance_distribution\n instances_to_provision = @options['count']\n\n instances_to_provision_for_zones = Hash.new()\n\n instance_distribution.keys.each do |zone|\n instances_to_provision_for_zones[zone] = (instances_to_provision / instance_distribution.keys.count)\n end\n\n leftover_instances = instances_to_provision % instance_distribution.keys.count\n\n instance_distribution.keys.each do |zone|\n break if leftover_instances == 0\n instances_to_provision_for_zones[zone] += 1\n leftover_instances -= 1\n end\n\n puts instances_to_provision_for_zones\n\n instances_to_provision_for_zones.each do |zone, count|\n count.times do |new_instances|\n new_instance_name = determine_unique_name_for_instance_zone(@username, nil, zone, new_instances + instance_distribution[zone])\n instances_to_provision_array << InstanceProvisioningInfo.new(zone, new_instance_name)\n end\n end\n\n instances_to_provision_array\nend",
"title": ""
},
{
"docid": "d69ba26521d2d824957e8c4a88dc4da1",
"score": "0.5344167",
"text": "def catalog_product_info(html_doc, product_id)\n product_el = html_doc.xpath(\"(.//div[@class='row row-results']//div[translate(@id,'PROD','prod')=translate('#{product_id}','PROD','prod')] )[1]\")\n return {} if product_el.empty?\n\n id = product_el.css('div>@id').to_s\n longname = product_el.css('.col-xs-12>h2').text\n href = product_el.css('div > a.thumbnail > @href').to_s\n curriculum = product_el.css('.curriculum>strong').text\n age = product_el.css('.age').text\n\n if product_el.at_css('.price.strike')\n price = \"Strike: #{product_el.css('.price.strike').text} - Sale: #{product_el.css('.price.sale').text}\"\n else\n price = product_el.css('.price').text\n end\n\n # Get content type\n screenshot_url = CGI.parse(product_el.css('.media-item>@src').to_s)\n content_type = screenshot_url['$label'][0]\n\n { id: id,\n longname: longname,\n href: href,\n curriculum: curriculum,\n age: age,\n price: price,\n content_type: content_type }\n end",
"title": ""
},
{
"docid": "d40b0935a42e48f9502e6c90c49468d9",
"score": "0.53399634",
"text": "def hash\n [id, channel_product_no, parent_channel_product_no, grandparent_channel_product_no, mapped_fields, product_type, extra_data, name, description, brand, size, color, ean, manufacturer_product_number, merchant_product_no, stock, price, msrp, purchase_price, vat_rate_type, shipping_cost, shipping_time, url, image_url, extra_image_url1, extra_image_url2, extra_image_url3, extra_image_url4, extra_image_url5, extra_image_url6, extra_image_url7, extra_image_url8, extra_image_url9, category_trail].hash\n end",
"title": ""
},
{
"docid": "8ca4b95196693a0ea0c4f36ca91356e0",
"score": "0.5327051",
"text": "def load_billing_data(account)\n key = account_key account\n data = redis.get key\n return nil if data.nil?\n\n JSON.parse(data)\n end",
"title": ""
},
{
"docid": "916aca5020c131bbc42cd4dec435b5bc",
"score": "0.5326418",
"text": "def catalog_info(key)\n response = authenticated_request(\"/catalog/item/barcode/#{ERB::Util.url_encode(key)}\", params: {\n includeFields: [\n '*',\n 'bib{holdRecordList{*,item{call,bib{title}}}}',\n 'call{*,itemList{*}}',\n 'currentLocation'\n ].join(',')\n })\n\n JSON.parse(response.body)\n rescue JSON::ParserError, HTTP::Error\n nil\n end",
"title": ""
},
{
"docid": "2304937bd0b306088a04a8b821504e9a",
"score": "0.5319489",
"text": "def hash\n [billing_address, shipping_address, channel_order_no, is_business_order, key_is_merchant_product_no, lines, phone, email, company_registration_no, vat_no, payment_method, payment_reference_no, shipping_costs_incl_vat, currency_code, order_date, channel_customer_no, extra_data].hash\n end",
"title": ""
},
{
"docid": "c7787c9eb4050e43adf76c6ebfefe3b4",
"score": "0.5314635",
"text": "def parse_product(conn_result, asin)\n doc = Nokogiri::HTML(conn_result.body)\n\n # Load details when response body is to long, Nokogiri won't load it all\n d_init = conn_result.body.index(\"<div id=\\\"prodDetails\\\"\")\n # book case\n d_init = conn_result.body.index(\"<div id=\\\"detail-bullets\\\"\") if d_init.nil?\n d_end = conn_result.body.length\n\n details_doc = Nokogiri::HTML(conn_result.body[d_init..d_end])\n details = product_details(details_doc)\n\n {\n asin: asin,\n name: get_name(doc),\n category: get_category(doc),\n rank: get_rank(details_doc),\n weight: get_weight(details),\n dimensions: get_dimensions(details)\n }\n end",
"title": ""
},
{
"docid": "e9ccc7b211a93400ee11dc2bf12db592",
"score": "0.53108424",
"text": "def hash\n [account_id, bundle_id, subscription_id, external_key, start_date, product_name, product_category, billing_period, phase_type, price_list, plan_name, state, source_type, cancelled_date, charged_through_date, billing_start_date, billing_end_date, bill_cycle_day_local, events, price_overrides, audit_logs].hash\n end",
"title": ""
},
{
"docid": "ee37b08e3bd07b7cd33f380d89dc558c",
"score": "0.5299678",
"text": "def a_fake_product\n @a_fake_product = {\n \"data\": {\n \"id\": 174,\n \"name\": \"1L Le Parfait Jar\",\n \"type\": \"physical\",\n \"sku\": \"\",\n \"description\": \"<p><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel metus ac est egestas porta sed quis erat. Integer id nulla massa. Proin vitae enim nisi. Praesent non dignissim nulla. Nulla mattis id massa ac pharetra. Mauris et nisi in dolor aliquam sodales. Aliquam dui nisl, dictum quis leo sit amet, rutrum volutpat metus. Curabitur libero nunc, interdum ac libero non, tristique porttitor metus. Ut non dignissim lorem, in vestibulum leo. Vivamus sodales quis turpis eget.</span></p>\",\n \"weight\": 1,\n \"width\": 0,\n \"depth\": 0,\n \"height\": 0,\n \"price\": 7.95,\n \"cost_price\": 0,\n \"retail_price\": 10,\n \"sale_price\": 0,\n \"map_price\": 0,\n \"tax_class_id\": 0,\n \"product_tax_code\": \"\",\n \"calculated_price\": 7.95,\n \"categories\": [\n 23,\n 21\n ],\n \"brand_id\": 36,\n \"option_set_id\": {},\n \"option_set_display\": \"right\",\n \"inventory_level\": 0,\n \"inventory_warning_level\": 0,\n \"inventory_tracking\": \"none\",\n \"reviews_rating_sum\": 0,\n \"reviews_count\": 0,\n \"total_sold\": 7,\n \"fixed_cost_shipping_price\": 0,\n \"is_free_shipping\": false,\n \"is_visible\": true,\n \"is_featured\": false,\n \"related_products\": [\n -1\n ],\n \"warranty\": \"\",\n \"bin_picking_number\": \"\",\n \"layout_file\": \"product.html\",\n \"upc\": \"\",\n \"mpn\": \"\",\n \"gtin\": \"\",\n \"search_keywords\": \"jar, glass\",\n \"availability\": \"available\",\n \"availability_description\": \"\",\n \"gift_wrapping_options_type\": \"any\",\n \"gift_wrapping_options_list\": [],\n \"sort_order\": 0,\n \"condition\": \"New\",\n \"is_condition_shown\": false,\n \"order_quantity_minimum\": 0,\n \"order_quantity_maximum\": 0,\n \"page_title\": \"\",\n \"meta_keywords\": [],\n \"meta_description\": \"\",\n \"date_created\": \"2018-08-15T14:48:46+00:00\",\n \"date_modified\": \"2018-09-05T20:42:07+00:00\",\n \"view_count\": 10,\n \"preorder_release_date\": {},\n \"preorder_message\": \"\",\n \"is_preorder_only\": false,\n \"is_price_hidden\": false,\n \"price_hidden_label\": \"\",\n \"custom_url\": {\n \"url\": \"/all/1l-le-parfait-jar/\",\n \"is_customized\": true\n },\n \"base_variant_id\": 345,\n \"open_graph_type\": \"product\",\n \"open_graph_title\": \"\",\n \"open_graph_description\": \"\",\n \"open_graph_use_meta_description\": true,\n \"open_graph_use_product_name\": true,\n \"open_graph_use_image\": true\n },\n \"meta\": {}\n }\n end",
"title": ""
},
{
"docid": "99fd26a8d80b8822a3f91e91af94cc51",
"score": "0.5295051",
"text": "def show\n @obj = {\n id: @vehicle_bank_account.id,\n account_number: @vehicle_bank_account.account_number,\n account_type: @vehicle_bank_account.account_type,\n bank: @vehicle_bank_account.bank,\n statu_id: @vehicle_bank_account.statu_id,\n user_id: @vehicle_bank_account.user_id,\n vehicle_id: @vehicle_bank_account.vehicle_id,\n active: @vehicle_bank_account.active,\n approved: @vehicle_bank_account.approved,\n certificate: @vehicle_bank_account.certificate.attached? ? url_for(@vehicle_bank_account.certificate) : nil,\n created_at: @vehicle_bank_account.created_at,\n updated_at: @vehicle_bank_account.updated_at\n }\n\n render json: @obj\n end",
"title": ""
},
{
"docid": "74bd4c58662a0c07e00edff175bc705d",
"score": "0.5286365",
"text": "def hash\n [advertising_source, affiliate_id, affiliate_sub_id, arbitrary_shipping_handling_total, arbitrary_tax, arbitrary_tax_rate, arbitrary_taxable_subtotal, associate_with_customer_profile_if_present, auto_approve_purchase_order, billto_address1, billto_address2, billto_city, billto_company, billto_country_code, billto_day_phone, billto_evening_phone, billto_first_name, billto_last_name, billto_postal_code, billto_state_region, billto_title, cc_email, channel_partner_order_id, consider_recurring, coupons, credit_card_authorization_amount, credit_card_authorization_dts, credit_card_authorization_number, credit_card_expiration_month, credit_card_expiration_year, credit_card_type, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, custom_field7, delivery_date, email, gift, gift_email, gift_message, hosted_fields_card_token, hosted_fields_cvv_token, insurance_application_id, insurance_claim_id, ip_address, items, least_cost_route, least_cost_route_shipping_methods, mailing_list_opt_in, no_realtime_payment_processing, payment_method, purchase_order_number, rotating_transaction_gateway_code, screen_branding_theme_code, ship_on_date, ship_to_residential, shipping_method, shipto_address1, shipto_address2, shipto_city, shipto_company, shipto_country_code, shipto_day_phone, shipto_evening_phone, shipto_first_name, shipto_last_name, shipto_postal_code, shipto_state_region, shipto_title, skip_payment_processing, special_instructions, store_completed, store_if_payment_declines, tax_county, tax_exempt, transaction, treat_warnings_as_errors].hash\n end",
"title": ""
},
{
"docid": "f1e0d98e6a853a499711d3eef9140344",
"score": "0.5281108",
"text": "def get_prod(id)\n\tkey = \"b05dcd698e5ca2eab4a0cd1eee4117e7db2a10c4\"\n url = \"http://api.zappos.com/Product/#{id}?includes=[%22styles%22]&key=#{key}\"\n\n\tresult = JSON.parse(open(url).read)\n \n #return product info as a json object\n product = result['product']\n end",
"title": ""
},
{
"docid": "58da03ed155bde6e9c3f1479b2a9f1c6",
"score": "0.5280173",
"text": "def hash\n [id, name, type, status, company, contact, site, location_id, business_unit_id, device_identifier, serial_number, model_number, tag_number, purchase_date, installation_date, installed_by, warranty_expiration_date, vendor_notes, notes, mac_address, last_login_name, bill_flag, backup_successes, backup_incomplete, backup_failed, backup_restores, last_backup_date, backup_server_name, backup_billable_space_gb, backup_protected_device_list, backup_year, backup_month, ip_address, default_gateway, os_type, os_info, cpu_speed, ram, local_hard_drives, parent_configuration_id, vendor, manufacturer, questions, active_flag, management_link, remote_link, sla, mobile_guid, _info, custom_fields].hash\n end",
"title": ""
},
{
"docid": "49188741d21f5a4b401ddd65e9fba477",
"score": "0.5275967",
"text": "def hash\n [id, batch, billing_log_id, invoice_number, type, description, cost, item, inventory, sales_code, cogs, gl_account, currency, debit_amount, credit_amount, balance, product, quantity, unit_of_measure, serialized_flag, serial_number, shipment_method, packing_slip, ticket, project, phase, expense_class, expense_type, time_entry, activity, segment1, segment2, segment3, segment4, segment5, segment6, segment7, segment8, segment9, segment10, avalara_tax_flag, item_taxable_flag, tax_code, state_tax_flag, state_tax_xref, state_tax_amount, county_tax_flag, county_tax_xref, county_tax_amount, city_tax_flag, city_tax_xref, city_tax_amount, country_tax_flag, country_tax_xref, country_tax_amount, composite_tax_flag, composite_tax_xref, composite_tax_amount, tax_total, _info].hash\n end",
"title": ""
},
{
"docid": "6649a4077c64c484e206cf6944773749",
"score": "0.52748287",
"text": "def developer_details\n developer_id = params[:developer_id]\n developer = Agents::Branches::AssignedAgent.unscope(where: :is_developer).where(is_developer: true, id: developer_id).last\n developer_details = developer.as_json(methods: [:active_properties], except: [:password_digest, \n :password, :provider, :uid, :oauth_token, :oauth_expires_at])\n developer_details[:company_id] = developer.branch.company_id\n developer_details[:group_id] = developer.branch.company.group_id\n developer_details[:domain_name] = developer.branch.domain_name\n render json: developer_details, status: 200\n end",
"title": ""
},
{
"docid": "f2844fa6afec9a87cb3805cf01332a63",
"score": "0.5272351",
"text": "def hash\n [cc_email, channel_partner_code, channel_partner_order_id, city, company, country_code, creation_date_begin, creation_date_end, current_stage, custom_field_1, custom_field_2, custom_field_3, custom_field_4, custom_field_5, custom_field_6, custom_field_7, customer_profile_oid, email, first_name, item_id, last_name, order_id, payment_date_begin, payment_date_end, payment_method, phone, postal_code, purchase_order_number, refund_date_begin, refund_date_end, rma, screen_branding_theme_code, shipment_date_begin, shipment_date_end, shipped_on_date_begin, shipped_on_date_end, state_region, storefront_host_name, total].hash\n end",
"title": ""
},
{
"docid": "388b00b26e24d42b737e46605dd90e44",
"score": "0.5271172",
"text": "def post_pay_load\n '''{\n \"businessApplicationId\": \"AA\",\n \"merchantCategoryCode\": 6012,\n \"pointOfServiceCapability\": {\n \"posTerminalType\": \"4\",\n \"posTerminalEntryCapability\": \"2\"\n },\n \"feeProgramIndicator\": \"123\",\n \"systemsTraceAuditNumber\": 300259,\n \"retrievalReferenceNumber\": \"407509300259\",\n \"foreignExchangeFeeTransaction\": \"10.00\",\n \"cardAcceptor\": {\n \"name\": \"Acceptor 1\",\n \"terminalId\": \"365539\",\n \"idCode\": \"VMT200911026070\",\n \"address\": {\n \"state\": \"CA\",\n \"county\": \"081\",\n \"country\": \"USA\",\n \"zipCode\": \"94404\"\n }\n },\n \"magneticStripeData\": {\n \"track1Data\": \"1010101010101010101010101010\"\n },\n \"senderPrimaryAccountNumber\": \"'''+\"#{exchange.user.credit_card.number}\"'''\",\n \"senderCurrencyCode\": \"USD\",\n \"surcharge\": \"1.00\",\n \"localTransactionDateTime\": \"2016-04-16T10:32:52\",\n \"senderCardExpiryDate\": \"2013-03\",\n \"pinData\": {\n \"pinDataBlock\": \"1cd948f2b961b682\",\n \"securityRelatedControlInfo\": {\n \"pinBlockFormatCode\": 1,\n \"zoneKeyIndex\": 1\n }\n },\n \"cavv\": \"0000010926000071934977253000000000000000\",\n \"pointOfServiceData\": {\n \"panEntryMode\": \"90\",\n \"posConditionCode\": \"0\",\n \"motoECIIndicator\": \"0\"\n },\n \"acquiringBin\": 409999,\n \"acquirerCountryCode\": \"101\",\n \"amount\": '''+\"#{exchange.amount}\"'''\n }'''\n end",
"title": ""
},
{
"docid": "426d238ab6f484c3930dd034a66d9de4",
"score": "0.52652067",
"text": "def service_response_data\n\n {\n customer: @customer.get_hash,\n gateway_customer_associations: @gateway_customer_associations.values.map {|x| x.get_hash}\n }\n\n end",
"title": ""
},
{
"docid": "515aa1835529d54f900b2d8739031c07",
"score": "0.52609575",
"text": "def extract\n # Create summarized product details object for all the products crawled & add it to the array\n @search_data.each do |product|\n # Create a new hash with default values 1\n product_details = Hash[@keys.map {|x| [x,1]}]\n\n # Populate hash with the appropriate values\n product_details[:id] = @products.length + 1\n product_details[:name] = product.split(',')[6].split(':')[1].split('\"')[1]\n product_details[:price] = product.split(',')[0].split(':')[1].split('\"')[1] + \" \" + product.split(',')[2].split(':')[1].split('\"')[1]\n product_details[:availability] = product.split(',')[3].split('\":\"')[1].split('\"}')[0].split('/')[3]\n product_details[:img] = product.split(',')[4].split('\":\"')[1].split('\"')[0]\n if product_details[:id] != 39\n product_details[:url] = product.split(',')[7].split('\":\"')[1]\n else\n product_details[:url] = product.split(',')[7].split('\":\"')[1].split('\"}]}')[0]\n end\n\n # Push populated hash into the array\n @products << product_details\n end\n\n @products.each do |product|\n if product[:url] == nil\n elsif product[:url].include? '\"}'\n product[:url] = product[:url].split('\"}')[0]\n end\n end\n end",
"title": ""
},
{
"docid": "15cc7d06a16846db94d84e6435eba5f1",
"score": "0.5253713",
"text": "def show\n logger.debug \"params in show #{params}\"\n @luxire_product_type = LuxireProductType.find(params[:id])\n\n# @luxire_product_type = LuxireProductType.find(params[:id]).attributes\n# @luxire_product_type[:mnt] = Hash.new\n # @luxire_product_type[:mnt][:customize] = LuxireProductType.find(params[:id]).measurement_types.where(category: \"customize\")\n\n\n#\t@luxire_p_t = OpenStruct.new(@luxire_product_type)\n#@luxire_product_type = @luxire_p_t\n @luxire_product_type_attributes = @luxire_product_type.measurement_types\n @luxire_product_type_attributes_ids = @luxire_product_type.measurement_types.ids\n @luxire_product_type_attributes_customize = @luxire_product_type_attributes.where(category: \"customize\")\n @luxire_product_type_attributes_personalize = @luxire_product_type_attributes.where(category: \"personalize\")\n @luxire_product_type_attributes_measurement = @luxire_product_type_attributes.where(category: \"measurement\")\n @luxire_product_type_attributes_measuement_std = @luxire_product_type_attributes.where(sub_category: \"std\")\n @luxire_product_type_attributes_measuement_body = @luxire_product_type_attributes.where(sub_category: \"body\")\n\n @luxire_custom = { id: @luxire_product_type.id,product_type: @luxire_product_type.product_type, description: @luxire_product_type.description, image: get_image, measurement_types: @luxire_product_type_attributes, luxire_product_attributes_ids: @luxire_product_type_attributes_ids,luxire_product_attributes: {customization_attributes: @luxire_product_type_attributes_customize, personalization_attributes: @luxire_product_type_attributes_personalize,standard_measurement_attributes: @luxire_product_type_attributes_measuement_std, body_measurement_attributes: @luxire_product_type_attributes_measuement_body}}\n\n render json: @luxire_custom.to_json\n end",
"title": ""
},
{
"docid": "cb66b516541dfd81789382fff7fdb8c1",
"score": "0.5249015",
"text": "def get_license\n # Reading the request from the tab\n string = request.body.read\n # Data for testing\n #string = '[{\"deviceId\":\"E010312204099\",\"powerChipId\":\"PC_0002501\",\"userId\":\"ES-0994\"}]'\n power_chip_request = ActiveSupport::JSON.decode(string)\n\n # The array to be returned with the license\n @power_chip_contents = []\n\n # Getting the license for each request\n power_chip_request.each do |request|\n content = Hash.new\n content[\"isValid\"] = 'FALSE'\n content[\"errorMessage\"] = ''\n\n # Checking if the request is valid or not\n\n # Check if device id is present in the request\n if !request['deviceId'].blank?\n deviceId = request['deviceId']\n # Check if powerchip id is present in the request\n if !request['powerChipId'].blank?\n powerChipId = request['powerChipId']\n # Check if user id is present in the request\n if !request['userId'].blank?\n userId = request['userId']\n else\n userId = 0\n end\n\n # Getting the License for the power chip and the device\n\n # Checking if the device is already present in the database\n devices = Device.where(:deviceid=>deviceId)\n if devices.length > 0\n # Checking if the chip is already present in the database\n chips = Chip.where(:chipid=>powerChipId)\n if chips.length > 0\n # TODO: Currently only checking if a Power Chip entry is present for the Chip\n power_chips = DrmPowerChip.where(:powerchipid=>powerChipId)\n if power_chips.length > 0\n # Handling the case when the power chip entry is already present in the database\n power_chips.each do |entry|\n if entry.device_id == deviceId\n content[\"isValid\"] = \"TRUE\"\n content[\"data\"] = DrmPowerChip.find(entry.id)\n break\n end\n end\n\n if content[\"isValid\"] == \"FALSE\"\n content[\"errorMessage\"] = \"Please use the device assigned to the chip to get the license\"\n end\n\n else\n # The user inserted the chip for the first time have to make an entry with the power chip id and the device id\n power_chip_row = DrmPowerChip.new\n power_chip_row.powerchipid = powerChipId\n power_chip_row.device_id = deviceId\n power_chip_row.user_id = userId\n if power_chip_row.save\n # Entry for the power chip and device are created now getting the license from the publisher\n license_created = update_license_key(power_chip_row.id)\n if license_created\n content[\"isValid\"] = \"TRUE\"\n content[\"data\"] = DrmPowerChip.find(power_chip_row.id)\n else\n content[\"errorMessage\"] = \"An error occured in getting the license from the publisher\"\n end\n\n else\n content[\"errorMessage\"] = \"An error occured in creating the license\"\n end\n end\n\n else\n content[\"errorMessage\"] = \"The Chip Id you requested is invalid\"\n end\n\n else\n content[\"errorMessage\"] = \"The Device Id you requested is invalid\"\n end\n\n else\n content[\"errorMessage\"] = \"Please send a Power Chip Id\"\n end\n else\n content[\"errorMessage\"] = \"Please send a Device Id\"\n end\n\n @power_chip_contents << content\n end\n\n respond_to do |format|\n format.json { render :json => @power_chip_contents }\n end\n end",
"title": ""
},
{
"docid": "5e9ee8bf2adf3f55ca648d8811a85958",
"score": "0.52332294",
"text": "def pre_proccess_product_list\n file = File.open \"./products.json\"\n products = JSON.load file\n product_options_map = ProductOptionsMap.new\n \n products.each do |product|\n product_options_map.add_product(product)\n end\n\n product_options_map.product_options_map\n end",
"title": ""
},
{
"docid": "d82bff06812d6767294a77afc2ded409",
"score": "0.52290946",
"text": "def hash\n [id, uuid, series, number, client_id, client_name, payment_terms, status, status_code, client_phone_number, client_contact, rfc, created_by_id, created_by_name, creation_date, application_date, price_list_id, price_list_name, location_id, location_name, warehouse_id, warehouse_name, cfdi_payment_method, cfdi_payment_term, cfdi_account_number, currency_name, exchange_rate, purchase_order, fiscal_id, address, comments, subtotal, discount, vat, ieps, vat_ret, isr_ret, payments, credit_notes, products, services].hash\n end",
"title": ""
},
{
"docid": "dfb5b4fbb6b4175e25de8935118f0bcb",
"score": "0.5224316",
"text": "def list_instances_information(ec2_client)\n result = ec2_client.describe_instances\n result.reservations.each do |reservation|\n if reservation.instances.count.positive?\n reservation.instances.each do |instance|\n puts \"-\" * 12\n puts \"Instance ID: #{instance.instance_id}\"\n puts \"State: #{instance.state.name}\"\n puts \"Image ID: #{instance.image_id}\"\n puts \"Instance type: #{instance.instance_type}\"\n puts \"Architecture: #{instance.architecture}\"\n puts \"IAM instance profile ARN: #{instance.iam_instance_profile.arn}\"\n puts \"Key name: #{instance.key_name}\"\n puts \"Launch time: #{instance.launch_time}\"\n puts \"Detailed monitoring state: #{instance.monitoring.state}\"\n puts \"Public IP address: #{instance.public_ip_address}\"\n puts \"Public DNS name: #{instance.public_dns_name}\"\n puts \"VPC ID: #{instance.vpc_id}\"\n puts \"Subnet ID: #{instance.subnet_id}\"\n if instance.tags.count.positive?\n puts \"Tags:\"\n instance.tags.each do |tag|\n puts \" #{tag.key}/#{tag.value}\"\n end\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "5605d791271c6a03d000bee9e3df122f",
"score": "0.5214649",
"text": "def hash\n [allow_back_order, amazon_fba, case_inner_packs, case_units, cases, collect_serial_numbers, country_code_of_origin, customs_description, customs_value, delivery_on_friday, delivery_on_monday, delivery_on_saturday, delivery_on_sunday, delivery_on_thursday, delivery_on_tuesday, delivery_on_wednesday, destination_markups, destination_restrictions, distribution_centers, eta, free_shipping, freight_class, hazmat, made_to_order, made_to_order_lead_time, max_days_time_in_transit, methods, no_shipping_discount, package_requirements, perishable_class_name, perishable_class_oid, preorder, require_delivery_date, restrict_shipment_on_friday, restrict_shipment_on_monday, restrict_shipment_on_saturday, restrict_shipment_on_sunday, restrict_shipment_on_thursday, restrict_shipment_on_tuesday, restrict_shipment_on_wednesday, ship_separately, ship_separately_additional_weight, ship_separately_height, ship_separately_length, ship_separately_package_special_type, ship_separately_width, special_product_type, track_inventory].hash\n end",
"title": ""
},
{
"docid": "76e3d8b04f759a6db0d87892ef17a1f9",
"score": "0.5207407",
"text": "def hash\n [id, description, location_id, department_id, procurement_type, purchase_order, purchase_date, tracking_number, billing_terms, currency, total, tax_code, avalara_tax_flag, item_taxable_flag, purchase_order_taxable_flag, state_tax_flag, state_tax_xref, state_tax_amount, county_tax_flag, county_tax_xref, county_tax_amount, city_tax_flag, city_tax_xref, city_tax_amount, country_tax_flag, country_tax_xref, country_tax_amount, composite_tax_flag, composite_tax_xref, composite_tax_amount, tax_total, customer, vendor, vendor_account_number, vendor_invoice_number, vendor_invoice_date, tax_freight_flag, freight_tax_total, freight_cost, date_closed, _info].hash\n end",
"title": ""
},
{
"docid": "b14019bf4d89bba7693f340bdff8dc13",
"score": "0.51988244",
"text": "def ymal_info_on_pdp\n ymal_arr = []\n\n return ymal_arr unless page.has_css?('.reccommended', wait: 30)\n str = page.evaluate_script(\"$('.reccommended').html();\")\n\n # convert string element to html element\n ymal_html_content = Nokogiri::HTML(str)\n\n # get all information of product\n ymal_html_content.css('.catalog-product').each do |el|\n ymal_arr.push(\n prod_number: el.css('div > @id').to_s,\n title: el.css('div>div.product-inner>p>a> @title').to_s.strip,\n link: el.css('div>div.product-inner>p>a> @href').to_s\n )\n end\n\n ymal_arr\n end",
"title": ""
},
{
"docid": "cb0bb76f869d86ba6351e85001ced700",
"score": "0.51892406",
"text": "def example_response_gadget_quote\n {\n \"package_name\": \"Theft + comprehensive\",\n \"sum_assured\": 1199900,\n \"base_premium\": 14999,\n \"suggested_premium\": 18749,\n \"created_at\": \"2017-10-12T19:30:45+02:00\",\n \"quote_package_id\": \"f4397823-db4a-4d6a-a06b-08e1a2a3172c\",\n \"module\": {\n \"type\": \"root_gadgets\",\n \"make\": \"Apple\",\n \"model\": \"iPhone 6S 64GB LTE\"\n }\n }.to_json\nend",
"title": ""
},
{
"docid": "1e90e701c2af7a1e85087e7a2ec84753",
"score": "0.518534",
"text": "def load_meta_data(instance_type)\n init_metadata_hash()\n case instance_type\n when INSTANCE_TYPES[:bare_metal_server][:name]\n packages = SoftLayer::ProductPackage.bare_metal_server_packages(@client)\n packages.each do |pkg|\n print \".\"\n cache_bms_packages pkg\n end\n when INSTANCE_TYPES[:bare_metal_instance][:name]\n @objectOptions_bmi = @client[:Hardware_Server].getCreateObjectOptions\n when INSTANCE_TYPES[:virtual_server][:name]\n @objectOptions_vm = @client[:Virtual_Guest].getCreateObjectOptions\n end\n end",
"title": ""
},
{
"docid": "694846e316d89de33fd8b9a8a1f6ccbf",
"score": "0.51820624",
"text": "def public_json\n bank_hash = self.as_json(:methods => [:json_address], :except => [:created_at, :updated_at, :id]) \n bank_hash['address'] = bank_hash['json_address']\n bank_hash.reject {|x| x == 'json_address'} #to remove the rails extras from the output \n end",
"title": ""
},
{
"docid": "d9a19164ffa36c54da463b05c371f20b",
"score": "0.5179846",
"text": "def hash\n [class_id, object_type, admin_power_state, alarm_summary, asset_tag, available_memory, bios_post_complete, chassis_id, connection_status, cpu_capacity, device_mo_id, dn, fault_summary, firmware, hardware_uuid, ipv4_address, kvm_ip_addresses, management_mode, memory_speed, mgmt_ip_address, model, name, num_adaptors, num_cpu_cores, num_cpu_cores_enabled, num_cpus, num_eth_host_interfaces, num_fc_host_interfaces, num_threads, oper_power_state, oper_reason, oper_state, operability, personality, platform_type, presence, revision, rn, scaled_mode, serial, server_id, service_profile, slot_id, source_object_type, topology_scan_status, total_memory, user_label, uuid, vendor, equipment_chassis, inventory_device_info, registered_device].hash\n end",
"title": ""
},
{
"docid": "817955f6ecf390826df42e59953fef6d",
"score": "0.5174509",
"text": "def show\n @brand = Brand.find(params[:id])\n @brand.image_url = @brand.avatar\n @brand.promos.each do |promo|\n promo.image_url = promo.image\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @brand.to_json(\n only: [:name, :email, :image_url,:id, :phone, :web_page, :nit,\n :description],\n include: [:promos, stores: {\n only: [:address, :email, :id, :name],\n include: {shopping_area: {only:[:name, :city, :longitude, :latitude,\n :description, :address]}}\n }]\n )}\n end\n end",
"title": ""
},
{
"docid": "553111357227838c8ffa978eef9cf199",
"score": "0.5170095",
"text": "def ec2_attributes\n to_hash.slice(\n :id, :size, :from_snapshot_id,\n :availability_zone, :device, :deletes_on_termination,\n :existence_status, :created_at, :attached_instance_id,\n :attachment_status, :attached_at\n )\n end",
"title": ""
},
{
"docid": "87224f0a83b22d587e6436fa473c2376",
"score": "0.51654357",
"text": "def show_plannable_products(reach_plan_service)\n response = reach_plan_service.list_plannable_products(\n plannable_location_id: LOCATION_ID,\n )\n\n puts \"Plannable Products for Location ID #{LOCATION_ID}:\"\n\n response.product_metadata.each do |product|\n puts \"#{product.plannable_product_code}:\"\n puts \"Age Ranges:\"\n product.plannable_targeting.age_ranges.each do |age_range|\n puts \"\\t- #{age_range}\"\n end\n puts \"Genders:\"\n product.plannable_targeting.genders.each do |gender|\n puts \"\\t- #{gender.type}\"\n end\n puts \"Devices:\"\n product.plannable_targeting.devices.each do |device|\n puts \"\\t- #{device.type}\"\n end\n end\nend",
"title": ""
},
{
"docid": "e0072e430ec7a2b76540135c2be1781d",
"score": "0.5162834",
"text": "def prepare_instance_data(hash)\n {\n \"db_instance_identifier\" => hash.fetch(:db_instance_identifier),\n \"endpoint\" => stringify_keys(hash.fetch(:endpoint)),\n \"engine\" => hash.fetch(:engine)\n }\n end",
"title": ""
},
{
"docid": "cff12c4fdcf14ad628beba51795b94ff",
"score": "0.51607895",
"text": "def inject_product\n gon.product = JSON.parse(@product.to_json(:include => [{ :variants => { :include => :option_values }}, :prices, { :option_types => { :include => :option_values }}]))\n end",
"title": ""
},
{
"docid": "3e5746552e2c9943eceb63ee2e698c07",
"score": "0.51599026",
"text": "def hash\n [additional_properties, billing_cycle_length, billing_cycle_unit, consolidated, currency_code, end_date, first_billing_cycle_length, first_billing_cycle_unit, grace_period, id, initial_fee, initial_sku, late_payment_fee, late_payment_sku, locked, max_bill_attempts, max_cycles, migrate_to_plan, min_cycles, name, published, reactivation_fee, reactivation_sku, recurring_fee, recurring_sku, start_date].hash\n end",
"title": ""
},
{
"docid": "2cb3b4bff9237de7f792b686e31573e7",
"score": "0.5156275",
"text": "def js_serialize()\n props = [:name, :page_url, :original_url, :url, :width, :height, :calibrate_coords, :calibrate_unit,\n :calibrate_length, :ppi, :user_id, :auto_ref, :ref]\n\n img = {}\n props.each do |attr|\n img[attr.to_s.camelize(:lower)] = self.send(attr)\n end\n img[:id] = guid\n # don't include product for now - saves an expensive query\n # img[:product] = self.user_product if self.user_product\n img\n end",
"title": ""
},
{
"docid": "1a99ef1434136de7966548ff0bd9ff0b",
"score": "0.5154372",
"text": "def get_instance_data(id)\n instance_data = JSON.parse(IO.read(\"public/ancor-api-sample/instances/#{id}.json\"))\n instance_data_hash = {}\n import_hash = {}\n export_hash = {}\n data_hash = {}\n\n # pp instance_data\n\n instance_data.each do |instance, data|\n if instance == 'imports'\n import_hash[instance] = data\n elsif instance == 'exports'\n export_hash[instance] = data\n else\n instance_data_hash[instance] = data\n end\n end\n\n data_hash['data'] = instance_data_hash\n data_hash['import'] = import_hash\n data_hash['export'] = export_hash\n\n # pp data_hash\n\n data_hash\n end",
"title": ""
},
{
"docid": "d8385361820cb8c1fa30cf01f1e21297",
"score": "0.51514125",
"text": "def get_license_keys\n\n # Params for testing\n #params[:deviceId] = \"E010312204098\"\n #params[:powerChipId] = \"PC_0002501\"\n #params[:userId] = \"ES-0994\"\n #params[:contentIdPublisherIdMapperList] = Array.new\n #params[:contentIdPublisherIdMapperList] << {\"publisherId\" => \"2\", \"contentId\" => \"CBSE/8th Class\"}\n #params[:contentIdPublisherIdMapperList] << {\"publisherId\" => \"3\", \"contentId\" => \"ICSE/9th Class\"}\n\n # Basic parameters to be sent in the response\n result = Hash.new\n result[\"isValid\"] = FALSE\n result[\"errorMessage\"] = ''\n\n # Checking if the deviceId is present in the request\n if !params[:deviceId].blank?\n result[\"deviceId\"] = params[:deviceId]\n\n # Checking if the powerChipId is present in the request\n if !params[:powerChipId].blank?\n result[\"powerChipId\"] = params[:powerChipId]\n\n # Checking if the userId is present in the request\n # TODO: Currently not checking if the user is valid\n if !params[:userId].blank?\n result[\"userId\"] = params[:userId]\n\n # Checking if the deviceId is valid\n devices = Device.where(:deviceid=>result[\"deviceId\"])\n if devices.length > 0\n\n # Checking if the powerChipId is valid\n chips = Chip.where(:chipid=>result[\"powerChipId\"])\n if chips.length > 0\n\n # Checking if the powerChip entry and device entry is present in the Power Chips Module\n only_power_chips = DrmPowerChip.where(:powerchipid=>result[\"powerChipId\"])\n\n # TODO: Now checking the powerChip with deviceId if the Chip has to be used in other device this part need to be changed\n if only_power_chips.length > 0\n\n # Checking if the entries in power chips matches with the device id in the current request\n only_power_chips.each do |pc|\n if pc.device_id == result[\"deviceId\"]\n result[\"isValid\"] = TRUE\n else\n result[\"isValid\"] = FALSE\n result[\"errorMessage\"] = \"Please use the power chip in the assigned device\"\n break\n end\n end\n\n else\n # No power chip entries are found the user is requesting the license for the first time for the chip so proceeding further\n result[\"isValid\"] = TRUE\n end\n\n # Proceeding to get the license if the powerChip and device validation is done\n if result[\"isValid\"]\n \n # Checking if the Content and Publisher parameters are present in the request\n if !params[:contentIdPublisherIdMapperList].blank? && (params[:contentIdPublisherIdMapperList].length > 0)\n license_request = params[:contentIdPublisherIdMapperList]\n\n result[\"data\"] = []\n # For each license request getting the license keys\n license_request.each do |request|\n license_data = Hash.new\n license_data[\"isValid\"] = FALSE\n license_data[\"Message\"] = \"\"\n\n if !request[\"publisherId\"].blank?\n license_data[\"publisherId\"] = request[\"publisherId\"].to_i\n\n # Checking if contentId is present in the request\n if !request[\"contentId\"].blank?\n license_data[\"contentId\"] = request[\"contentId\"]\n\n # Checking if the publish is a valid publisher\n publisherInfo = User.find(license_data[\"publisherId\"])\n if publisherInfo.type == \"Publisher\"\n\n # Checking if the license already exists for the content and the publisher\n # TODO: Currently not checking for the userId if the userId has to be introduced this block needs to be changed\n license_info = DrmPowerChip.where(:powerchipid=>result[\"powerChipId\"], :device_id=>result[\"deviceId\"], :publisher_id=>license_data[\"publisherId\"], :content_id=>license_data[\"contentId\"], :status=>\"issued\")\n\n if license_info.length > 0\n license_entry = license_info.first\n\n # License info is found for the request setting the validity to true\n license_data[\"isValid\"] = TRUE\n\n # Preparing the data for the responding\n license_data[\"license_key\"] = license_entry.license_key\n license_data[\"start_date\"] = license_entry.start_date\n license_data[\"end_date\"] = license_entry.end_date\n license_data[\"license_status\"] = license_entry.license_status\n license_data[\"license_type\"] = license_entry.license_type\n license_data[\"action_on_expiry\"] = license_entry.action_on_expiry\n license_data[\"message_on_expiry\"] = license_entry.message_on_expiry\n license_data[\"policy_id\"] = license_entry.policy_id\n license_data[\"extras\"] = license_entry.extras\n \n else\n # The license was not issued previously generating a new license record and getting the licenses\n license = generate_license_enrty(result[\"powerChipId\"],result[\"deviceId\"],result[\"userId\"],license_data[\"publisherId\"],license_data[\"contentId\"])\n\n if license[\"isValid\"]\n license_entry = DrmPowerChip.find(license[\"id\"])\n\n # Sending the license data\n license_data[\"isValid\"] = TRUE\n license_data[\"license_key\"] = license_entry.license_key\n license_data[\"start_date\"] = license_entry.start_date\n license_data[\"end_date\"] = license_entry.end_date\n license_data[\"license_status\"] = license_entry.license_status\n license_data[\"license_type\"] = license_entry.license_type\n license_data[\"action_on_expiry\"] = license_entry.action_on_expiry\n license_data[\"message_on_expiry\"] = license_entry.message_on_expiry\n license_data[\"policy_id\"] = license_entry.policy_id\n license_data[\"extras\"] = license_entry.extras\n else\n # If we didn't get the licnese then showing a error message\n license_data[\"Message\"] = \"An error occured in getting the license for the content\"\n end\n\n end\n\n else\n # The publisher is not valid send a error message\n license_data[\"Message\"] = \"The publisher you requested is not a valid publisher\"\n end\n\n else\n # If the contentId is not present then send a error message\n license_data[\"Message\"] = \"Please Send a Content Id\"\n end\n\n else\n # If the publisherId is not present then send a error message\n license_data[\"Message\"] = \"Please Send a Publisher Id\"\n end\n\n result[\"data\"] << license_data\n end\n\n else\n result[\"errorMessage\"] = \"Please send the Publishers and Contents for which you require the licenses\"\n end\n end\n\n else\n # If the powerChipId is not valid sending a error message\n result[\"errorMessage\"] = \"The Power Chip Id you requested is invalid\"\n end\n\n else\n # If the deviceId is not valid sending a error message\n result[\"errorMessage\"] = \"The Device Id you requested is invalid\"\n end\n\n else\n # If the userId is not present in the request sending a error message\n result[\"errorMessage\"] = \"Please send a User Id\"\n end\n \n else\n # If the powerChipId is not present in the request sending a error message\n result[\"errorMessage\"] = \"Please send a DrmPowerChip Id\"\n end\n\n else\n # If the deviceId is not present in the request sending a error message\n result[\"errorMessage\"] = \"Please send a Device Id\"\n end\n\n respond_to do |format|\n format.json { render :json => result}\n end\n\n end",
"title": ""
},
{
"docid": "c2d32e2cca6f9e67bed1e05e6eb6233c",
"score": "0.5147518",
"text": "def pdp_info\n # Wait for loading PDP page\n wait_for_product_pdp_div(TimeOut::WAIT_BIG_CONST)\n\n return {} unless page.has_css?(@pdp_div_css, wait: TimeOut::WAIT_MID_CONST * 2)\n\n pdp_html_content = page_content(\"$(\\\"#{@pdp_div_css}\\\").html();\")\n\n # Get all information\n long_name = pdp_html_content.css('.col-xs-12 .row > .col-xs-12 > h1').text\n curriculum_top = (pdp_html_content.css('.col-xs-12 .row > .col-xs-12 > h2').to_a)[0].text # Get the curriculum that displays under longname\n age = RspecEncode.remove_nbsp(pdp_html_content.css('.age').to_a[0].text)\n add_to_cart_btn = !pdp_html_content.at_css('.btn.btn-primary.ng-isolate-scope').nil? # If 'Add to Cart' button exists => return 'true', else => return 'false'\n add_to_wishlist = !pdp_html_content.at_css('.btn.btn-link.addToWishlistLogin').nil?\n description = RspecEncode.encode_description(pdp_html_content.css('.description').text)\n special_message = special_message(pdp_html_content)\n learning_difference = pdp_html_content.css('#teachingInfo>p').text\n has_credit_link = credit_link_exist?\n\n if pdp_html_content.at_css('.price.old.vcenter')\n price = \"Strike: #{pdp_html_content.css('.price.old.vcenter').text} - Sale: #{pdp_html_content.css('.sale.vcenter').text}\".delete(\"\\n\")\n else\n price = pdp_html_content.css('.price.vcenter').text.delete(\"\\n\")\n end\n\n # Get attributes info: content type, notable, curriculum, work with, publisher, size\n content_type = ''\n notable = ''\n curriculum_bottom = ''\n work_with = ''\n publisher = ''\n size = ''\n\n attributes_div = pdp_html_content.css('.list-unstyled>li').to_a\n attributes_div.each do |a|\n attr = a.text.split(':')\n content_type = attr[1].strip if attr[0].include?('Type')\n notable = attr[1].strip if attr[0].include?('Notable')\n curriculum_bottom = attr[1].strip if attr[0].include?('Curriculum') || attr[0].include?('Programme')\n work_with = attr[1].gsub(', ', ',').strip if attr[0].include?('Works With') || attr[0].include?('Fonctionne avec')\n publisher = attr[1].strip if attr[0].include?('Publisher') || attr[0].include?('Éditeur')\n size = attr[1].strip if attr[0].include?('Size') || attr[0].include?('Taille')\n end\n\n # Get legal top/bottom\n legals = legal_text\n legal_top = legals[:legal_top]\n legal_bottom = legals[:legal_bottom]\n\n # Get trailer link\n has_trailer = trailer_exist?\n trailer_link = []\n trailer_arr = (pdp_html_content.css('#productMediaCarousel .owl-stage .ui-carousel__item>.video').to_a)\n trailer_arr.each do |trailer|\n url = trailer.css('@ng-click').to_s.gsub('\"', '\\\"')\n trailer_link.push(url)\n end\n\n # Get screen shot link\n screenshots = []\n screenshot_arr = pdp_html_content.css('#productMediaCarousel .owl-stage .ui-carousel__item>.media-item').to_a\n screenshot_arr.each do |sc|\n url = sc.css('@src').to_s\n alt = sc.css('@alt').to_s\n screenshots.push(url: url, alt: alt)\n end\n\n # Get product detail: => {:title, :text}\n details = []\n details_arr = pdp_html_content.css('#details-container div.details-item').to_a\n details_arr.each do |detail|\n title = RspecEncode.encode_title detail.css('h3').text\n text = RspecEncode.encode_description detail.css('p').to_s\n details.push(title: title, text: text)\n end\n\n # Get more info label/text\n more_info = more_info pdp_html_content\n more_info_label = more_info[:more_info_label]\n more_info_text = more_info[:more_info_text]\n\n # Get all teaches\n teaches = []\n teaches_arr = pdp_html_content.css('#teachingInfo>ul>li>span').to_a\n teaches_arr.each do |teach|\n teaches.push(teach.text)\n end\n\n # Get More like this: if exist => 'True', else => 'False'\n more_like_this_arr = (pdp_html_content.css('.thumbnail').to_a)[1]\n more_like_this = !more_like_this_arr.nil?\n\n # Put all info into array\n { long_name: long_name,\n curriculum_top: curriculum_top,\n age: age,\n price: price,\n has_trailer: has_trailer,\n trailer_link: trailer_link,\n screenshots: screenshots,\n legal_top: legal_top,\n add_to_wishlist: add_to_wishlist,\n add_to_cart_btn: add_to_cart_btn,\n description: description,\n content_type: content_type,\n notable: notable,\n curriculum_bottom: curriculum_bottom,\n work_with: work_with,\n publisher: publisher,\n size: size,\n special_message: special_message,\n more_info_label: more_info_label,\n more_info_text: more_info_text,\n details: details,\n teaches: teaches,\n learning_difference: learning_difference,\n has_credit_link: has_credit_link,\n more_like_this: more_like_this,\n legal_bottom: legal_bottom }\n end",
"title": ""
},
{
"docid": "9bc4864545c598858489196dac43d814",
"score": "0.5145466",
"text": "def hash\n [class_id, object_type, cdn, failover_enabled, iscsi_ip_v4_address_allocation_type, iscsi_ip_v4_config, iscsi_ipv4_address, mac_address, mac_address_type, name, order, placement, standby_vif_id, static_mac_address, usnic_settings, vif_id, vmq_settings, eth_adapter_policy, eth_network_policy, eth_qos_policy, fabric_eth_network_control_policy, fabric_eth_network_group_policy, ip_lease, iscsi_boot_policy, lan_connectivity_policy, lcp_vnic, mac_lease, mac_pool, profile, sp_vnics].hash\n end",
"title": ""
},
{
"docid": "9728a7730c535dafb89cf9bfed45c5a8",
"score": "0.5141846",
"text": "def show\n # @crm_product = CrmProduct.find(params[:id])\n\n prd_attribute = PrdAttribute.find(params[:id], :include => :products)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @crm_product }\n format.json { \n crm_product = CrmProduct.new\n crm_product.set_fields(prd_attribute)\n results = mapping_to_hash(crm_product, CrmProduct.json_mapping_table)\n crm_product.send_to_crm('POST', results.to_json)\n render :json => crm_product \n }\n end\n end",
"title": ""
},
{
"docid": "2de8c54c121240cc37c42df0f3a7526b",
"score": "0.51405525",
"text": "def vendor_email_params(order)\n line_item_rows = \"\"\n vendor_email = vendor_name = \"\"\n order.reload.line_items\n\n order.line_items.each do |item|\n product = Spree::Product.where(:id => item.variant_id).first\n content = REXML::Document.new( view_context.product_image(product))\n snack_image = content.get_elements(\"//img\")[0].attribute('src')\n image_path = \"https://www.vegansnackpacks.com\"+snack_image.to_s\n\n vendor_email = item.product.vendor.email\n vendor_name = item.product.vendor.name\n\n line_item_rows += '\n <tr><td><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-bottom: 1px solid #dedfdf\" width=\"444\">\n <tr><td height=\"17\"/></tr><tr valign=\"top\"><td width=\"83\">\n </td><td width=\"221\">\n <span style=\"font-size:12px;font-weight:normal;display:block;line-height:200%;\"/><p style=\"margin-bottom: 4px;\">' + item.name + '</p>\n </td><td style=\"text-align: right\" width=\"140\">' + item.quantity.to_s + '</td></tr><tr><td colspan=\"3\" height=\"25\"/>\n </tr></table><td></tr>'\n end\n\n result = {\n :line_item_rows => line_item_rows,\n :vendor_email => vendor_email,\n :vendor_name => vendor_name\n }\n\n end",
"title": ""
},
{
"docid": "2f023f8e87cde694da485fc4d3abf760",
"score": "0.5140532",
"text": "def hash\n [id, compartment_id, lifecycle_state, lifecycle_details, db_name, is_free_tier, system_tags, time_reclamation_of_free_autonomous_database, time_deletion_of_free_autonomous_database, backup_config, cpu_core_count, data_storage_size_in_tbs, data_storage_size_in_gbs, infrastructure_type, is_dedicated, autonomous_container_database_id, time_created, display_name, service_console_url, connection_strings, connection_urls, license_model, used_data_storage_size_in_tbs, freeform_tags, defined_tags, subnet_id, nsg_ids, private_endpoint, private_endpoint_label, private_endpoint_ip, db_version, is_preview, db_workload, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, apex_details, is_auto_scaling_enabled, data_safe_status, operations_insights_status, time_maintenance_begin, time_maintenance_end, is_refreshable_clone, time_of_last_refresh, time_of_last_refresh_point, time_of_next_refresh, open_mode, refreshable_status, refreshable_mode, source_id, permission_level, time_of_last_switchover, time_of_last_failover, is_data_guard_enabled, failed_data_recovery_in_seconds, standby_db, role, available_upgrade_versions, key_store_id, key_store_wallet_name].hash\n end",
"title": ""
},
{
"docid": "7acc7a5a96a4c355c7cf06e4e928fe07",
"score": "0.5137031",
"text": "def lc_table_row obj\n\treturn ({\n\t\tlaunch_config: obj[\"LaunchConfigurationName\"],\n\t\tversion: obj[\"LaunchConfigurationName\"].sub('Flynn Platform', '').strip,\n\t\timage: obj[\"ImageId\"],\n\t\tinstance_type: obj[\"InstanceType\"],\n\t\tsecurity_groups: obj[\"SecurityGroups\"].join(\", \"),\n\t\tssh_key: obj[\"KeyName\"],\n\t\tcreated: obj[\"CreatedTime\"]\n\t})\nend",
"title": ""
},
{
"docid": "d103325189a830d28ff059e9aa447dfb",
"score": "0.51368284",
"text": "def hash\n [id, identifier, description, inactive_flag, subcategory, type, product_class, serialized_flag, serialized_cost_flag, phase_product_flag, unit_of_measure, min_stock_level, price, cost, price_attribute, taxable_flag, customer_description, manufacturer, manufacturer_part_number, vendor, vendor_sku, notes, integration_x_ref, date_entered, category, _info].hash\n end",
"title": ""
},
{
"docid": "3bbf36f453aefac75dcb5bd3c381856a",
"score": "0.51302385",
"text": "def show\n #order_customer = Customer.joins(:orders).where(\"orders.id\" => params[:id]).first\n order_customer = Customer.includes(:orders).where(\"orders.id\" => params[:id]).first\n orders = order_customer.orders\n \n @product_hash = Hash.new\n @total = 0\n @tax = 0\n \n orders.each do |order|\n line_items = order.lineitems\n \n line_items.each do |line_item|\n detail_hash = {:name => '', :model_number => '', :image => '', :price => 0, :quantity => 0, :subtotal => 0} \n product = line_item.product\n sub_total = product.price * line_item.quantity\n \n detail_hash[:name] = product.name\n detail_hash[:model_number] = product.model_number\n detail_hash[:image] = product.image\n detail_hash[:price] = product.price\n detail_hash[:quantity] = line_item.quantity\n detail_hash[:subtotal] = sub_total\n @product_hash[product.id] = detail_hash\n \n @total += sub_total \n end\n \n @tax += (@total * order.pst_rate + @total * order.gst_rate + @total * order.hst_rate)\n end\n \n \n @total += @tax.round(2)\n @customer = order_customer\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "3082695da573f4cd057469aefb9de35e",
"score": "0.5124743",
"text": "def listing_product_lazada(id, params, object, user_market_place, taxon_market_places, market_place_product)\n p '----------- Listing product on lazada'\n @object = object\n @error_message = []\n image_arr = []\n variants = []\n variants << (@object.variants.present? ? @object.variants : @object.master)\n variants = variants.flatten\n begin\n Time.zone = \"Singapore\"\n current_time = Time.zone.now\n user_id = user_market_place.contact_email ? user_market_place.contact_email : \"tejaswini.patil@anchanto.com\"\n market_place = Spree::MarketPlace.find(user_market_place.market_place_id)\n http = Net::HTTP.new(market_place.domain_url)\n product_params = {\"Action\"=>\"ProductCreate\", \"Timestamp\"=>current_time.to_time.iso8601, \"UserID\"=>user_id, \"Version\"=>\"1.0\"}\n signature = ApiJob.generate_lazada_signature(product_params, user_market_place)\n if signature\n formed_params = []\n sorted_params = Hash[product_params.sort]\n sorted_params.merge!(\"Signature\"=>signature)\n sorted_params.each do |key,value|formed_params << CGI::escape(\"#{key}\")+\"=\"+CGI::escape(\"#{value}\")end\n param_string = \"?\"+formed_params.join('&')\n uri = URI.parse(market_place.domain_url+param_string)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(uri.request_uri)\n xml_obj = {}\n img_xml_obj = {}\n xml_obj = xml_obj.compare_by_identity\n img_xml_obj = img_xml_obj.compare_by_identity\n variants.each do |variant|\n #Product params details\n item_description = object.description_details(makret_palce.code)\n item_title = object.title_details(market_place.code)\n price_details = variant.price_details(market_place.code)\n brand = (@object.brand ? @object.brand.name : \"3M\")\n price = variant.price.to_f\n primary_category = taxon_market_places.market_place_category_id.to_i\n category = ''\n seller_sku = variant.sku\n parent_sku = ''\n tax_class = 'default'\n sale_price = ((price_details[\"special_price\"].present? && price_details[\"special_price\"].to_i > 0) ? price_details[\"special_price\"] : \"\")\n sale_start_date = (@object.available_on ? @object.available_on : Time.now())\n sale_end_date = ''\n shipment_type = 'dropshipping'\n product_id = ''\n conditon = 'new'\n product_data = ''\n quantity = 0#@object.stock_products.where(:sellers_market_places_product_id=>market_place_product.id).sum(:count_on_hand)\n name = (object.variants.present? ? (item_title[\"title\"].to_s+\"-\"+variant.option_values.first.presentation.to_s) : item_title[\"title\"].to_s)\n description = item_description[\"description\"]\n short_desc = item_description[\"meta_description\"]\n package_content = item_description[\"package_content\"]\n height = variant.height.to_f\n weight = variant.weight.to_f\n length = variant.depth.to_f\n width = variant.width.to_f\n xml_obj[\"Product\"]={:Brand=>brand, :Description=>description, :Name=>name, :Price=>price, :PrimaryCategory=>primary_category, :Categories=>category, :SellerSku=>seller_sku, :ParentSku=>'', :TaxClass=>tax_class, :Variation=>'', :SalePrice=>sale_price, :SaleStartDate=>sale_start_date, :SaleEndDate=>sale_end_date, :ShipmentType=>shipment_type, :ProductId=>product_id, :Condition=>conditon, :ProductData=>product_data, :Quantity=>quantity,:ProductData=>{:ShortDescription=>short_desc, :PackageContent=>package_content, :PackageHeight=>height, :PackageLength=>length, :PackageWidth=>width, :PackageWeight=>weight}}\n # Image hash\n variant.images.each do |image|\n image_arr << image.attachment.url(:original).to_s if image.attachment_file_name.split(\"_\").first.capitalize == market_place.code.capitalize\n end\n @object.images.each do |image|\n image_arr << image.attachment.url(:original).to_s if image.attachment_file_name.split(\"_\").first.capitalize == market_place.code.capitalize\n end\n img_xml_obj[\"ProductImage\"]={:SellerSku=>seller_sku, :Images=>image_arr} if !image_arr.blank?\n end # end of variant loop\n request.body = xml_obj.to_xml.gsub(\"hash\", \"Request\")\n res = http.request(request)\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=>true)\n p res_body\n if res.code == \"200\" && res_body[:SuccessResponse]\n mp_product_code = res_body[:SuccessResponse][:Head][:RequestId]\n market_place_product.update_attributes(:market_place_product_code=>mp_product_code) if market_place_product.present?\n # Adding images\n image_params = {\"Action\"=>\"Image\", \"Timestamp\"=>current_time.to_time.iso8601, \"UserID\"=>user_id, \"Version\"=>\"1.0\"}\n img_signature = ApiJob.generate_lazada_signature(image_params, user_market_place)\n img_formed_params = []\n img_sorted_params = Hash[image_params.sort]\n img_sorted_params.merge!(\"Signature\"=>img_signature)\n img_sorted_params.each do |key,value|img_formed_params << CGI::escape(\"#{key}\")+\"=\"+CGI::escape(\"#{value}\")end\n img_param_string = \"?\"+img_formed_params.join('&')\n img_uri = URI.parse(market_place.domain_url+img_param_string)\n img_http = Net::HTTP.new(img_uri.host, img_uri.port)\n img_http.use_ssl = true\n img_http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n img_request = Net::HTTP::Post.new(img_uri.request_uri)\n img_request.body = img_xml_obj.to_xml(:skip_types=>true).gsub(\"hash\", \"Request\")\n img_res = http.request(img_request)\n img_res_body = Hash.from_xml(img_res.body).to_json\n img_res_body = JSON.parse(img_res_body, :symbolize_names=>true)\n if img_res.code == \"200\" && img_res_body[:ErrorResponse]\n return img_res_body[:ErrorResponse][:Head][:ErrorMessage]\n @error_message << user_market_place.market_place.name+\": \"+img_res_body[:ErrorResponse][:Head][:ErrorMessage]\n end\n return res_body\n else\n return res_body\n # @error_message << user_market_place.market_place.name+\": \"+res_body[:ErrorResponse][:Head][:ErrorMessage]\n end\n else\n return \"#{market_place.name}: Signature can not be generated.\"\n @error_message << \"#{market_place.name}: Signature can not be generated.\"\n end\n rescue Exception => e\n return e.message\n @error_message << user_market_place.market_place.name+\": \"+e.message\n end\n return @error_message.length > 0 ? @error_message.join(\"; \") : true\n end",
"title": ""
},
{
"docid": "27908a4ecb16d55388d2fb306423a410",
"score": "0.5123962",
"text": "def get_pdp_info\r\n # Wait for loading PDP page\r\n wait_for_product_pdp_div(TimeOut::WAIT_BIG_CONST)\r\n\r\n # Get all html text script\r\n return {} unless page.has_css?(@pdp_div_css, wait: TimeOut::WAIT_MID_CONST * 2)\r\n str = page.evaluate_script(\"$(\\\"#{@pdp_div_css}\\\").html();\")\r\n\r\n # Convert string element to html element\r\n html_doc = Nokogiri::HTML(str)\r\n\r\n # Get all information\r\n long_name = html_doc.css('.col-xs-12 .row > .col-xs-12 > h1').text\r\n curriculum_top = (html_doc.css('.col-xs-12 .row > .col-xs-12 > h2').to_a)[0].text # Get the curriculum that displays under longname\r\n age = RspecEncode.remove_nbsp(html_doc.css('.age').to_a[0].text.strip.delete(\"\\n\"))\r\n price = html_doc.at_css('.price.vcenter').nil? ? html_doc.css('.price.old.vcenter').text.delete(\"\\n\") : html_doc.css('.price.vcenter').text.delete(\"\\n\")\r\n add_to_cart_btn = !html_doc.at_css('.btn.btn-primary.ng-isolate-scope').nil? # If 'Add to Cart' button exists => return 'true', else => return 'false'\r\n add_to_wishlist = !html_doc.at_css('.btn.btn-link.addToWishlistLogin').nil?\r\n description = RspecEncode.process_long_desc(html_doc.css('.description').text)\r\n special_message = get_special_msg(html_doc)\r\n learning_difference = html_doc.css('#teachingInfo>p').text\r\n has_credit_link = credit_link_exist?\r\n\r\n # Get attributes info: content type, notable, curriculum, work with, publisher, size\r\n content_type = ''\r\n notable = ''\r\n curriculum_bottom = ''\r\n work_with = ''\r\n publisher = ''\r\n size = ''\r\n\r\n attributes_div = html_doc.css('.list-unstyled>li').to_a\r\n attributes_div.each do |a|\r\n attr = a.text.split(':')\r\n content_type = attr[1].strip if attr[0].include?('Type')\r\n notable = attr[1].strip if attr[0].include?('Notable')\r\n curriculum_bottom = attr[1].strip if attr[0].include?('Curriculum') || attr[0].include?('Programme')\r\n work_with = attr[1].gsub(', ', ',').strip if attr[0].include?('Works With') || attr[0].include?('Fonctionne avec')\r\n publisher = attr[1].strip if attr[0].include?('Publisher') || attr[0].include?('Éditeur')\r\n size = attr[1].strip if attr[0].include?('Size') || attr[0].include?('Taille')\r\n end\r\n\r\n # Get legal top/bottom\r\n legals = get_legal_text\r\n legal_top = legals[:legal_top]\r\n legal_bottom = legals[:legal_bottom]\r\n\r\n # Get trailer link\r\n has_trailer = trailer_exist?\r\n trailer_link = []\r\n trailer_arr = (html_doc.css('#productMediaCarousel .owl-stage .ui-carousel__item>.video').to_a)\r\n trailer_arr.each do |trailer|\r\n url = trailer.css('@ng-click').to_s.gsub('\"', '\\\"')\r\n trailer_link.push(url)\r\n end\r\n\r\n # Get screen shot link\r\n screenshots = []\r\n screenshot_arr = html_doc.css('#productMediaCarousel .owl-stage .ui-carousel__item>.media-item').to_a\r\n screenshot_arr.each do |sc|\r\n url = sc.css('@src').to_s\r\n alt = sc.css('@alt').to_s\r\n screenshots.push(url: url, alt: alt)\r\n end\r\n\r\n # Get product detail: => {:title, :text}\r\n details = []\r\n details_arr = html_doc.css('#details-container div.details-item').to_a\r\n details_arr.each do |detail|\r\n title = RspecEncode.encode_title detail.css('h3').text\r\n text = RspecEncode.process_long_desc detail.css('p').to_s\r\n details.push(title: title, text: text)\r\n end\r\n\r\n # Get more info label/text\r\n more_info = get_more_info\r\n more_info_label = more_info[:more_info_label]\r\n more_info_text = more_info[:more_info_text]\r\n\r\n # Get all teaches\r\n teaches = []\r\n teaches_arr = html_doc.css('#teachingInfo>ul>li>span').to_a\r\n teaches_arr.each do |teach|\r\n teaches.push(teach.text)\r\n end\r\n\r\n # Get More like this: if exist => 'True', else => 'False'\r\n more_like_this_arr = (html_doc.css('.thumbnail').to_a)[1]\r\n more_like_this = !more_like_this_arr.nil?\r\n\r\n # Put all info into array\r\n { long_name: long_name,\r\n curriculum_top: curriculum_top,\r\n age: age,\r\n price: price,\r\n has_trailer: has_trailer,\r\n trailer_link: trailer_link,\r\n screenshots: screenshots,\r\n legal_top: legal_top,\r\n add_to_wishlist: add_to_wishlist,\r\n add_to_cart_btn: add_to_cart_btn,\r\n description: description,\r\n content_type: content_type,\r\n notable: notable,\r\n curriculum_bottom: curriculum_bottom,\r\n work_with: work_with,\r\n publisher: publisher,\r\n size: size,\r\n special_message: special_message,\r\n more_info_label: more_info_label,\r\n more_info_text: more_info_text,\r\n details: details,\r\n teaches: teaches,\r\n learning_difference: learning_difference,\r\n has_credit_link: has_credit_link,\r\n more_like_this: more_like_this,\r\n legal_bottom: legal_bottom }\r\n end",
"title": ""
},
{
"docid": "99e34aa9dd2e0fb8fab4847c388605b9",
"score": "0.51190037",
"text": "def show\n @product_instance = @category.product_instances.find(params[:id])\n @coreinfo = ProductCore.find_by_sku(@product_instance.sku)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_instance }\n end\n end",
"title": ""
},
{
"docid": "6225b3e1b0c617dbf4008c47ba14d85b",
"score": "0.5118652",
"text": "def hash\n [class_id, object_type, cpu, crash_reset_logs, customer_device_connector, dcnm_license_state, device_discovery, device_health, device_id, device_name, device_type, device_up_time, disk, dn, fabric_name, fex_count, infra_wi_node_count, interface, ip_address, is_virtual_node, last_reboot_time, last_reset_reason, license_type, log_in_time, log_out_time, mac_sec_count, mac_sec_fab_count, macsec_total_count, memory, node_id, nxos_bgp_mvpn, nxos_bootflash_details, nxos_dci_interface_status, nxos_interface_brief, nxos_nve_interface_status, nxos_nve_packet_counters, nxos_nve_vni, nxos_ospf_neighbors, nxos_pim_neighbors, nxos_telnet, nxos_total_routes, nxos_vtp, record_type, record_version, route_prefix_count, route_prefix_v4_count, route_prefix_v6_count, serial, site_name, smart_account_id, software_download, system_up_time, version, license_state, registered_device].hash\n end",
"title": ""
},
{
"docid": "9a65537dd1d9e1d231ef4ed305ce34b0",
"score": "0.51172084",
"text": "def purchase_options\n\t{\n\t\t:ip\t\t\t\t\t\t\t\t=> ip_address,\n\t\t:billing_address\t=> {\n\t\t\t:name\t\t\t\t\t\t=> \"#{fname} #{sname}\",\n\t\t\t:address1 => \"123 Main St.\",\n :city => \"New York\",\n :state => \"NY\",\n :country => \"US\",\n :zip => \"10001\"\n\t\t}\n\t}\n\tend",
"title": ""
},
{
"docid": "59ac1a0ed0009d72731ef3639d4d5770",
"score": "0.51168174",
"text": "def allpro_data\n @@product_data\n end",
"title": ""
},
{
"docid": "f2769195caf3607e6ec2d8d539b3aba5",
"score": "0.5114696",
"text": "def product_info\n @product_info\n end",
"title": ""
},
{
"docid": "c04f31e06d216cdd65e41533c81deba4",
"score": "0.51124793",
"text": "def show\n\t\tapi_method = 'products/' + params[:id]\n path = Rails.configuration.MprProductsAPI.to_s + api_method.to_s\n @product = ActiveSupport::JSON.decode http_get(path).body\n puts @product['image'].inspect\n\tend",
"title": ""
},
{
"docid": "aefbf5073a979881bb253d174e0458cf",
"score": "0.5111721",
"text": "def get_amazon_info(upc)\r\n\r\n params = {\r\n \"Service\" => \"AWSECommerceService\",\r\n \"Operation\" => \"ItemLookup\",\r\n \"AWSAccessKeyId\" => ENV['AWS_ACCESS_KEY_ID'], #from locals\r\n \"AssociateTag\" => ENV['AWS_SECRET_ACCESS_KEY'], #from locals\r\n \"ItemId\" => upc, #variable from user input\r\n \"IdType\" => \"UPC\", #variable from dropdown\r\n \"ResponseGroup\" => \"Offers\",\r\n \"SearchIndex\" => \"All\"\r\n }\r\n\r\n # Set current timestamp if not set\r\n params[\"Timestamp\"] = Time.now.gmtime.iso8601 if !params.key?(\"Timestamp\")\r\n\r\n # Generate the canonical query\r\n canonical_query_string = params.sort.collect do |key, value|\r\n [URI.escape(key.to_s, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\")), URI.escape(value.to_s, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))].join('=')\r\n end.join('&')\r\n\r\n # Generate the string to be signed\r\n string_to_sign = \"GET\\n#{ENDPOINT}\\n#{REQUEST_URI}\\n#{canonical_query_string}\"\r\n\r\n # Generate the signature required by the Product Advertising API\r\n signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), SECRET_KEY, string_to_sign)).strip()\r\n\r\n # Generate the signed URL\r\n request_url = \"http://#{ENDPOINT}#{REQUEST_URI}?#{canonical_query_string}&Signature=#{URI.escape(signature, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))}\"\r\n\r\n # print(\"REQUEST_URL: #{request_url}\")\r\n xml_request = Nokogiri::XML(open(request_url))\r\n # print(xml_request, \"XML REQUEST\")\r\n item = []\r\n xml_request.css('Item ItemAttributes ListPrice FormattedPrice').each do |price|\r\n item << price.text\r\n end\r\n\r\n # item = xml_request.css('Item ')[0]\r\n # print(\"ITEM: #{item}\")\r\n\r\n html_result = Nokogiri::HTML(open(request_url))\r\n # monkeys.css('largeimage').each do |monkey|\r\n #puts \"THIS IS html_result: #{html_result}\"\r\n # end\r\n # puts \"Signed URL: \\\"#{request_url}\\\"\"\r\n # html_result\r\n xml_request\r\nend",
"title": ""
},
{
"docid": "826a15efcb515c4bb077339d8610336b",
"score": "0.5109341",
"text": "def frontend_data\n {\n id: id,\n username: username,\n email: email,\n industry: industry,\n business_website: business_website,\n first_name: first_name,\n last_name: last_name,\n b2b_b2c_c2c: b2b_b2c_c2c,\n user_type: user_type,\n created_at: created_at,\n updated_at: updated_at,\n # posts: posts,\n }\n end",
"title": ""
},
{
"docid": "bb1dbf6d6194997dd9ac0e543a9669f3",
"score": "0.51050264",
"text": "def machineimage_list # rubocop:disable Metrics/AbcSize\n attrcheck = {\n 'REST end point' => @options[:rest_endpoint],\n 'Container' => @options[:container]\n }\n @validate.attrvalidate(@options, attrcheck)\n instanceconfig = MachineImage.new(@options[:id_domain], @options[:user_name], @options[:passwd], @options[:rest_endpoint])\n instanceconfig = instanceconfig.list(@options[:container], @options[:action])\n # error checking response\n @util.response_handler(instanceconfig)\n return JSON.pretty_generate(JSON.parse(instanceconfig.body))\n end",
"title": ""
},
{
"docid": "c567f9862ce85cc5b7a908a49b557d14",
"score": "0.5103467",
"text": "def show\n #the below files are useful to decrypt the params which EBS has sent\n require 'RubyRc4.rb'\n require 'base64'\n @key = EBS_KEY\n @DR = params[:DR]\n @DR.gsub!(/ /,'+')\n\n @encrypted_data = Base64.decode64(@DR)\n\n @decryptor = RubyRc4.new(@key)\n\n @plain_text = @decryptor.encrypt(@encrypted_data)\n\n puts \"HTTP/1.0 200 OK\"\n puts \"Content-type: text/html\\n\\n\"\n transaction = Hash.new\n tenant = Tenant.find_by_user_id(current_user.id)\n @plain_text.split(/&/).each_with_index do |item, i|\n key, val = item.split(=)\n if key == 'PaymentID' then\n transaction['payment_id'] = val\n end\n if key == 'MerchantRefNo' then\n transaction['merchant_refno'] = val\n end\n if key == 'Amount' then\n transaction['amount'] = val\n end\n if key == 'Mode' then\n transaction['mode'] = val\n end\n if key == 'Description' then\n transaction['description'] = val\n end\n if key == 'DateCreated' then\n transaction['date_created'] = val\n end\n if key == 'IsFlagged' then\n transaction['is_flagged'] = val\n end\n if key == 'TransactionID' then\n transaction['transaction_id'] = val\n end\n if key == 'ResponseMessage' then\n transaction['response_message'] = val\n end\n if key == 'ResponseCode' then\n transaction['response_code'] = val\n end\n\n if key == 'BillingAddress' then\n transaction['billing_address'] = val\n end\n if key == 'BillingCity' then\n transaction['billing_city'] = val\n end\n if key == 'BillingState' then\n transaction['billing_state'] = val\n end\n if key == 'BillingPostalCode' then\n transaction['billing_postal_code'] = val\n end\n if key == 'BillingCountry' then\n transaction['billing_country'] = val\n end\n if key == 'BillingPhone' then\n transaction['billing_phone'] = val\n end\n\n if key == 'DeliveryAddress' then\n transaction['delivery_address'] = val\n end\n if key == 'DeliveryCity' then\n transaction['delivery_city'] = val\n end\n if key == 'DeliveryState' then\n transaction['delivery_state'] = val\n end\n if key == 'DeliveryPostalCode' then\n transaction['delivery_postal_code'] = val\n end\n if key == 'DeliveryCountry' then\n transaction['delivery_country'] = val\n end\n if key == 'DeliveryPhone' then\n transaction['delivery_phone'] = val\n end\n end\n transaction['tenant_id'] = tenant.id\n @transaction = Transaction.new(transaction)\n @transaction.save!\n redirect_to(\"/transactions/payment_done/\"+@transaction.id.to_s)\n end",
"title": ""
},
{
"docid": "1763c82327c8b13fa2bbfb5b029b7907",
"score": "0.5102025",
"text": "def show\n @product = Product.find(params[:id])\n if @product.kc1_id\n @kc1 = Platform.find(@product.kc1_id).hardware\n end\n\n if @product.kc2_id\n @kc2 = Platform.find(@product.kc2_id).hardware\n end\n\n if @product.kc3_id\n @kc3 = Platform.find(@product.kc3_id).hardware\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end",
"title": ""
},
{
"docid": "c71a88efa565c3efe921ede088c58648",
"score": "0.51001614",
"text": "def to_api\n {\n id: id,\n inventory_id: inventory_id,\n inventory_task_id: inventory_task_id,\n status: status,\n sku_code: inventory.try(:sku_code),\n barcode: inventory.try(:barcode),\n to_depot_code: to_depot_code,\n from_shelf_num: from_shelf_num,\n # to_shelf_num: to_shelf_num,\n transfer_quantity: transfer_quantity,\n # operator: operator,\n created_at: created_at,\n updated_at: updated_at\n }\n end",
"title": ""
},
{
"docid": "eb665119a148b6a6475efe3d97f3caf2",
"score": "0.5100089",
"text": "def hash\n [client_request_id, api_trace_id, response_type, ipg_transaction_id, order_id, transaction_type, payment_token, transaction_origin, payment_method_details, country, terminal_id, merchant_id, merchant_transaction_id, transaction_time, approved_amount, transaction_status, transaction_state, payment_account_reference_number, secure3d_response, standin_response_details, redirect_url, authentication_response, scheme_transaction_id, processor, additional_details, account_updater_response, ach_response, currency_conversion_response, steps, error].hash\n end",
"title": ""
},
{
"docid": "c6420688eed13d702a891a7e2cdafd3b",
"score": "0.50981486",
"text": "def load_new_products_portion(products)\n products.each_with_object({}) do |product, result|\n code_value = product[:code]\n result[code_value] = START_ITEM_COUNT\n end\n end",
"title": ""
},
{
"docid": "8a9b01c8658b3e6d94a1c3c33eb864d5",
"score": "0.50935835",
"text": "def hash\n [authorization_token, locale, purchase_country, auto_capture, billing_address, shipping_address, tax_amount, products, customer, merchant_reference1, merchant_reference2, merchant_data, attachment].hash\n end",
"title": ""
},
{
"docid": "a2176324988deb4faf3926db001c7edf",
"score": "0.5092756",
"text": "def get_product_info(html_doc, product_id)\r\n product_el = html_doc.xpath(\"(.//div[@class='row row-results']//div[@id='#{product_id}'])[1]\")\r\n return {} if product_el.empty?\r\n\r\n id = product_el.css('div>@id').to_s\r\n longname = product_el.css('.col-xs-12>h2').text\r\n href = product_el.css('div > a.thumbnail > @href').to_s\r\n curriculum = product_el.css('.curriculum>strong').text\r\n age = product_el.css('.age').text\r\n\r\n # Get price\r\n price = product_el.css('.price.strike').text\r\n price = product_el.css('.price').text if price.blank?\r\n\r\n # Get content type\r\n screenshot_url = CGI.parse(product_el.css('.media-item>@src').to_s)\r\n content_type = screenshot_url['$label'][0]\r\n\r\n { id: id,\r\n longname: longname,\r\n href: href,\r\n curriculum: curriculum,\r\n age: age,\r\n price: price,\r\n content_type: content_type }\r\n end",
"title": ""
},
{
"docid": "a94914cd3bc952df648ed2602b1e686d",
"score": "0.50917274",
"text": "def initialize\n @ecwid_api = ApiParser::Ecwid.new\n @voog_api = ApiParser::Voog.new\n @request_counter = 0\n @ecwid_category_products = HashWithIndifferentAccess.new { |h, k| h[k] = [] }\n end",
"title": ""
},
{
"docid": "02e02920762631b92aeced3c199fffcf",
"score": "0.50889057",
"text": "def show\n # if is_my_resource(params[:id])\n render json: Product.find(params[:id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n end",
"title": ""
},
{
"docid": "d8bee3edadb3040fe889446d32c8cbb9",
"score": "0.5080153",
"text": "def index \n\n result = @gateway.list_payment_instruments(@customer_id)\n @payment_instruments = JSON.parse(result.success?)\n end",
"title": ""
},
{
"docid": "a759a0489d08d9acaeea299ad6ed21a8",
"score": "0.5078068",
"text": "def product_payload(type = \"base\")\n payload = {\n sku: FFaker::Product.model,\n externalId: FFaker::Product.model,\n description: FFaker::Product.product,\n classification: \"baseProduct\",\n category: \"OTHER\",\n batteryConfiguration: \"NOBATTERY\",\n values: {\n costValue: 1,\n retailValue: 4\n },\n dimensions: {\n length: 1,\n width: 1,\n height: 1,\n weight: 1\n },\n flags: {\n isPackagedReadyToShip: 1,\n isFragile: 0,\n isDangerous: 0,\n isPerishable: 0,\n isLiquid: 0,\n isMedia: 0,\n isAdult: 0,\n hasInnerPack: 0,\n hasMasterCase: 0,\n hasPallet: 0\n }\n }\n\n product_contents = [\n {\n externalId: \"TEST-PRODUCT\",\n quantity: 1\n },\n {\n externalId: \"TEST-PRODUCT2\",\n quantity: 1\n }\n ]\n\n case type\n when \"insert\"\n payload.deeper_merge!(\n classification: \"marketingInsert\",\n dimensions: {\n height: 0.1,\n weight: 0.1\n },\n masterCase: {\n individualItemsPerCase: 1,\n sku: FFaker::Product.model,\n description: FFaker::Product.product,\n dimensions: {\n length: 1,\n width: 1,\n height: 1,\n weight: 1\n }\n },\n inclusionRules: {\n insertWhenWorthCurrency: \"USD\"\n }\n )\n when \"kit\"\n payload.deeper_merge!(\n classification: \"kit\",\n kitContent: product_contents\n )\n\n when \"virtual_kit\"\n payload.deeper_merge!(\n classification: \"virtualKit\",\n virtualKitContent: product_contents\n )\n end\n\n payload\n end",
"title": ""
},
{
"docid": "ea10429d9eacba30527a5c6534c2f5cb",
"score": "0.50773597",
"text": "def formated_secure_cache_data\n {\n id: id,\n client_id: client_id,\n token_erc20_address: token_erc20_address,\n airdrop_contract_address: airdrop_contract_addr,\n reserve_uuid: reserve_uuid,\n airdrop_holder_uuid: airdrop_holder_addr_uuid\n }\n end",
"title": ""
},
{
"docid": "bd3c3cf7a88a74b43f26516fc54a6da2",
"score": "0.5074542",
"text": "def hash\n [class_id, object_type, block_size, capacity, controller, drives_enabled, health, manufacturer_date, manufacturer_id, oem_id, partition_count, pd_status, physical_drive, product_name, product_revision, read_error_count, read_error_threshold, write_enabled, write_error_count, write_error_threshold, inventory_device_info, registered_device, storage_flex_util_controller].hash\n end",
"title": ""
},
{
"docid": "a4cac4958d55c5a4eceabc181d05889e",
"score": "0.5069545",
"text": "def hash\n [brand_logo_asset_id, issuer_logo_asset_id, is_co_branded, co_brand_name, co_brand_logo_asset_id, card_background_combined_asset_id, card_background_asset_id, icon_asset_id, foreground_color, issuer_name, short_description, long_description, customer_service_url, customer_service_email, customer_service_phone_number, issuer_mobile_app, online_banking_login_url, terms_and_conditions_url, privacy_policy_url, issuer_product_config_code].hash\n end",
"title": ""
},
{
"docid": "11ec775e5c0f67adfdcc03d62c585ff0",
"score": "0.5064652",
"text": "def get_specific_bill_from_api(pp_bill_id)\n api_url = \"https://api.propublica.org/congress/v1/#{pp_bill_id.split(\"-\")[1].to_s}/bills/#{pp_bill_id.split(\"-\")[0].to_s}.json\"\n response_string = RestClient::Request.execute(\n :method => :get,\n :url => api_url,\n #version: v1,\n :headers => {\"X-API-Key\" => ENV['PRO_PUBLICA_API_KEY']}\n #:headers => {'authorization': ENV['PRO_PUBLICA_API_KEY']}\n #'X-API-KEY': ENV['PRO_PUBLICA_API_KEY']\n )\n response_hash = JSON.parse(response_string)\nend",
"title": ""
},
{
"docid": "c4f7f233cbfc6c55e83f73129fe21f65",
"score": "0.5063126",
"text": "def hardware_order\n product_order = {\n 'packageId' => @package.id,\n 'hardware' => [{\n 'domain' => @domain,\n 'hostname' => @hostname\n }],\n 'useHourlyPricing' => !!@hourly\n }\n\n #Note that the use of image_template and SoftLayer::ProductPackage os/guest_diskX configuration category\n #item prices is mutually exclusive.\n product_order['hardware'][0]['userData'] = @user_metadata if @user_metadata\n product_order['imageTemplateGlobalIdentifier'] = @image_template.global_id if @image_template\n product_order['location'] = @datacenter.id if @datacenter\n product_order['provisionScripts'] = [@provision_script_URI.to_s] if @provision_script_URI\n product_order['provisionScripts'] = [@provision_script_uri.to_s] if @provision_script_uri\n product_order['sshKeys'] = [{ 'sshKeyIds' => @ssh_key_ids }] if @ssh_key_ids\n product_order['primaryNetworkComponent'] = { \"networkVlan\" => { \"id\" => @public_vlan_id.to_i } } if @public_vlan_id\n product_order['primaryBackendNetworkComponent'] = { \"networkVlan\" => {\"id\" => @private_vlan_id.to_i } } if @private_vlan_id\n\n product_order['prices'] = @configuration_options.collect do |key, value|\n if value.respond_to?(:price_id)\n price_id = value.price_id\n else\n price_id = value.to_i\n end\n\n { 'id' => price_id }\n end\n\n product_order\n end",
"title": ""
},
{
"docid": "ad9891c826f0d981fe5d4ee967fb6d92",
"score": "0.50622237",
"text": "def extended_data_pbspro(info)\n return unless info.native\n\n attributes = []\n attributes.push Attribute.new \"Cluster\", self.cluster_title\n attributes.push Attribute.new \"PBS Id\", self.pbsid\n attributes.push Attribute.new \"Job Name\", self.jobname\n attributes.push Attribute.new \"User\", self.username\n attributes.push Attribute.new \"Account\", self.account if info.accounting_id\n attributes.push Attribute.new \"Group List\", info.native[:group_list] if info.native[:group_list]\n attributes.push Attribute.new \"Walltime\", (info.native.fetch(:Resource_List, {})[:walltime].presence || \"00:00:00\")\n walltime_used = info.wallclock_time || 0\n attributes.push Attribute.new \"Walltime Used\", self.walltime_used\n node_count = info.native.fetch(:Resource_List, {})[:nodect].to_i\n attributes.push Attribute.new \"Node Count\", node_count.to_s\n attributes.push Attribute.new \"Node List\", self.nodes.join(\", \") unless self.nodes.blank?\n total_procs = info.native[:Resource_List][:ncpus].presence || '0'\n attributes.push Attribute.new \"Total CPUs\", total_procs\n cput = info.native.fetch(:resources_used, {})[:cput].presence || 0\n attributes.push Attribute.new \"CPU Time\", pretty_time(cput.to_i)\n attributes.push Attribute.new \"Memory\", info.native.fetch(:resources_used, {})[:mem].presence || \"0 b\"\n attributes.push Attribute.new \"Virtual Memory\", info.native.fetch(:resources_used, {})[:vmem].presence || \"0 b\"\n select = info.native.fetch(:Resource_List, {})[:select].presence\n attributes.push Attribute.new \"Select\", select if select\n attributes.push Attribute.new \"Comment\", info.native[:comment] || ''\n self.native_attribs = attributes\n self.submit_args = info.native[:Submit_arguments].presence || \"None\"\n self.output_path = info.native[:Output_Path].to_s.split(\":\").second || info.native[:Output_Path]\n\n output_pathname = Pathname.new(self.output_path).dirname\n self.file_explorer_url = build_file_explorer_url(output_pathname)\n self.shell_url = build_shell_url(output_pathname, self.cluster)\n\n self\n end",
"title": ""
},
{
"docid": "d9e56df8939a8504fd28b229c1197eac",
"score": "0.50616866",
"text": "def formatted_cache_data\n {\n id: id,\n company_name: company_name.present? ? company_name : nil,\n properties: properties.present? ? Client.get_bits_set_for_properties(properties) : [],\n mainnet_statuses: mainnet_statuses.present? ? Client.get_bits_set_for_mainnet_statuses(mainnet_statuses) : [],\n sandbox_statuses: sandbox_statuses.present? ? Client.get_bits_set_for_sandbox_statuses(sandbox_statuses) : [],\n created_at: created_at.to_i\n }\n end",
"title": ""
}
] |
445022d134a245586dbd37dc038b3219
|
Return a connection based on the attorney and contact.
|
[
{
"docid": "fc94e88902bda10faaee4385c08a2342",
"score": "0.78887504",
"text": "def conn(attorney, contact)\n find_by_attorney_id_and_contact_id(attorney, contact)\n end",
"title": ""
}
] |
[
{
"docid": "ff8e08bcab31de6fbe8468ddb33ed536",
"score": "0.6473938",
"text": "def conn(user, contact)\n find_by_user_id_and_contact_id(user, contact)\n end",
"title": ""
},
{
"docid": "50804082bee0f586eae626b63db7565f",
"score": "0.63525283",
"text": "def contact\n if participant_consent_associated?\n participant_consent.contact\n elsif non_interview_report_associated?\n non_interview_report.contact\n elsif instrument_associated?\n instrument.contact_link.try(:contact)\n end\n end",
"title": ""
},
{
"docid": "a1c62891c365b488586e59257cebc878",
"score": "0.6009264",
"text": "def get_connection(name)\n return self[\"connection:#{name}\"] \\\n if sections.include? \"connection:#{name}\"\n return self['connection:*'] if sections.include? 'connection:*'\n nil\n end",
"title": ""
},
{
"docid": "bb022c85fd1432dc127a34c164aa9ce8",
"score": "0.59302086",
"text": "def determine_connection(c)\n parent.connections[c] unless c.nil?\n end",
"title": ""
},
{
"docid": "8a5b6c391d3b075f34ecaa85baf383bc",
"score": "0.590464",
"text": "def contact_link\n if instrument_associated?\n instrument.contact_link\n elsif contact\n contact.contact_links.first\n end\n end",
"title": ""
},
{
"docid": "84773ee56387592e223060278ba27188",
"score": "0.58985335",
"text": "def get_connection_by_name(name)\n return @connections.find {|con| con.through_relation.name == name}\n end",
"title": ""
},
{
"docid": "918910aac6227982d395cb3e91605033",
"score": "0.58532774",
"text": "def get_conn\n unless !@sender.adm.avlconn\n conn= @sender.adm.get_connections{ |pm|\n yield pm if block_given?\n }\n end\n return conn\n end",
"title": ""
},
{
"docid": "7291efa83f70bebc0f982dc0e86006ed",
"score": "0.57857007",
"text": "def connection\n @connection ||= build_connection\n return @connection\n end",
"title": ""
},
{
"docid": "7291efa83f70bebc0f982dc0e86006ed",
"score": "0.57857007",
"text": "def connection\n @connection ||= build_connection\n return @connection\n end",
"title": ""
},
{
"docid": "f4586d576b36479d93daf60e0b15f473",
"score": "0.574171",
"text": "def get_connection(conn_opts)\n key = Connection.get_key(conn_opts)\n unless (conn = @connections[key])\n conn = @connections[key] = Connection.new(conn_opts, @plan_context, logger)\n end\n conn\n end",
"title": ""
},
{
"docid": "2848cf513594fe9508c7c1ff0a84f9a1",
"score": "0.5666958",
"text": "def connection(object)\n return (Connection.where(follower_id: self.id, followee_id: object.id).first or Connection.where(followee_id: self.id, follower_id: object.id).first)\n end",
"title": ""
},
{
"docid": "678ce9a20aa8b633714003a8b2ed48e2",
"score": "0.5656856",
"text": "def match_connection_object_for(match)\n self.match_connections.where(match: match)[0]\n end",
"title": ""
},
{
"docid": "678ce9a20aa8b633714003a8b2ed48e2",
"score": "0.5656856",
"text": "def match_connection_object_for(match)\n self.match_connections.where(match: match)[0]\n end",
"title": ""
},
{
"docid": "f55f3d4d6077ff379c2f62ce70881c51",
"score": "0.56540626",
"text": "def connection\n @connection ||= build_connection\n end",
"title": ""
},
{
"docid": "f55f3d4d6077ff379c2f62ce70881c51",
"score": "0.56540626",
"text": "def connection\n @connection ||= build_connection\n end",
"title": ""
},
{
"docid": "f55f3d4d6077ff379c2f62ce70881c51",
"score": "0.56540626",
"text": "def connection\n @connection ||= build_connection\n end",
"title": ""
},
{
"docid": "21a7b3a11ab85c065a0c09324c793054",
"score": "0.56062067",
"text": "def connection\n @connection || (@@connection ||= self.establish_connection(*(@@connection_args)))\n end",
"title": ""
},
{
"docid": "45ec9f6876c6e568d611ca6d3de3731a",
"score": "0.56032544",
"text": "def get_connection\n Net::LDAP.new({ :host => LDAP_CONFIG['server'], :port => LDAP_CONFIG['port'] })\n end",
"title": ""
},
{
"docid": "d52fde6f045cbdb1dfebad6efe4d84c6",
"score": "0.55910283",
"text": "def connection\n if connected?\n connections[connection_name] || default_connection\n else\n raise NoConnectionEstablished\n end\n end",
"title": ""
},
{
"docid": "d52fde6f045cbdb1dfebad6efe4d84c6",
"score": "0.55910283",
"text": "def connection\n if connected?\n connections[connection_name] || default_connection\n else\n raise NoConnectionEstablished\n end\n end",
"title": ""
},
{
"docid": "6a175b13584e540a1760a18af47fd6fd",
"score": "0.5587487",
"text": "def connection(name=nil)\n name ||= DEFAULT\n self[name][:connection] || {}\n end",
"title": ""
},
{
"docid": "aaf96ad59918d13a329b38cdefada70c",
"score": "0.55780345",
"text": "def get_cloud_connection\n if @connection_resource\n debug \"found connection resource\"\n return @connection_resource\n else\n debug \"searching for connection resource\"\n @connection_resource = resource.get_creds(resource[:connection])\n return @connection_resource\n end\n end",
"title": ""
},
{
"docid": "ad051aac8d8066cc1a2fd0e66acd2c9f",
"score": "0.55773187",
"text": "def client\n contact.client\n end",
"title": ""
},
{
"docid": "9acfbb62aadc1feea2c7c9c9bd6e89d7",
"score": "0.5573127",
"text": "def connection\n @relation.connection\n end",
"title": ""
},
{
"docid": "fb5caf326c3ae01920521bcad9596919",
"score": "0.5532066",
"text": "def connection\n connect_through.connection\n end",
"title": ""
},
{
"docid": "50d210266c18ef16a91443e4b6fd0535",
"score": "0.5524778",
"text": "def get_or_create_connection(id1, id2, type)\n found_conn = Connection.where(\"id1 = ? and id2 = ? and link_type = ?\", id1, id2, type)\n case found_conn.length\n when 0\n conn = Connection.new(:id1 => id1, :id2 => id2, :link_type => type)\n if conn.save\n return conn\n else\n alert_log(\"Failed to create a connection from #{id1} and #{id2} of type = #{type}\")\n return nil\n end\n when 1\n return found_conn.first\n else\n alert_log(\"Found multiple entries for same connection attributes!\")\n end\n end",
"title": ""
},
{
"docid": "f7d6322a32a5e26ff47206790e8bd64c",
"score": "0.54526275",
"text": "def connection\n @_connection ||= Airplay::Connection.new(@device)\n end",
"title": ""
},
{
"docid": "f7d6322a32a5e26ff47206790e8bd64c",
"score": "0.54526275",
"text": "def connection\n @_connection ||= Airplay::Connection.new(@device)\n end",
"title": ""
},
{
"docid": "f7d6322a32a5e26ff47206790e8bd64c",
"score": "0.54525924",
"text": "def connection\n @_connection ||= Airplay::Connection.new(@device)\n end",
"title": ""
},
{
"docid": "c176ee72f641e78d2c8ef9dc75affba4",
"score": "0.54272693",
"text": "def client_for(connection)\n # skip if an indirect node type or local\n return nil, nil if self.indirect? || self.node_type == :local\n\n begin\n return Socket.unpack_sockaddr_in(connection.get_peername)\n rescue Exception=>e\n end\n\n return nil, nil\n end",
"title": ""
},
{
"docid": "60b1c948427767542ad55e242e5bdb37",
"score": "0.541944",
"text": "def conn(user, friend)\n find_by_user_id_and_friend_id(user, friend)\n end",
"title": ""
},
{
"docid": "06b4b6f8e6f3933c224767398daf7017",
"score": "0.54178554",
"text": "def connection\n conns = (Thread.current['couchrest.connections'] ||= {})\n key = \"#{uri.to_s}##{connection_options.hash}\"\n conns[key] ||= Connection.new(uri, connection_options)\n end",
"title": ""
},
{
"docid": "209a06a3419f35c625e4a18392038156",
"score": "0.5412636",
"text": "def conn(person, product)\n find_by_person_id_and_product_id(person, product)\n end",
"title": ""
},
{
"docid": "c23ca3637f6a0aa75331da2887d51c89",
"score": "0.54079336",
"text": "def connection_info\n return @get_connection_attributes if @get_connection_attributes\n conn_info = NWRFCLib::RFCConnection.new\n rc = NWRFCLib.get_connection_attributes(@handle, conn_info.to_ptr, @error)\n NWRFC.check_error(@error) if rc > 0\n @get_connection_attributes = conn_info.members.inject({}) {|hash, member|\n hash[member] = conn_info[member].get_str #get_str, own definition in nwrfclib.rb, FFI::StructLayout::CharArray#get_str\n hash\n }\n end",
"title": ""
},
{
"docid": "2dadbc9d1038bf2f59b98e64ea6267fa",
"score": "0.5395539",
"text": "def get_connection(b)\n if b == \"default\"\n $cb.connections.default\n else\n $cb.connections[b]\n end\n end",
"title": ""
},
{
"docid": "5c41b060599a332c5ac10c3b8ceedfe5",
"score": "0.53913426",
"text": "def find_coach_connection(coach)\n if coach_connections.loaded?\n coach_connections.to_a.find { |connection| connection.coach_id == coach.id }\n else\n coach_connections.find_by(coach_id: coach.id)\n end\n end",
"title": ""
},
{
"docid": "8c06416fe5470e7ba04d8235d107fa72",
"score": "0.5377672",
"text": "def contact(calling_user)\n result = OpenStruct.new\n result.connection_id = self.id\n if calling_user.favorites.where(connection_id: self.id).first.nil?\n result.favorite = false\n else\n result.favorite = true\n end\n if self.from == calling_user\n user = self.to\n result.my_personas = self.from_persona_ids\n result.user_id = user.id\n result.home_me = user.contact_info(\"Home\", self.to_persona_ids)\n result.work_me = user.contact_info(\"Work\", self.to_persona_ids)\n elsif self.to == calling_user\n user = self.from\n result.my_personas = self.to_persona_ids\n result.user_id = user.id\n result.home_me = user.contact_info(\"Home\", self.from_persona_ids)\n result.work_me = user.contact_info(\"Work\", self.from_persona_ids)\n end\n return result\n end",
"title": ""
},
{
"docid": "e7d6d2c3839705ca4812781b1d6d7cb5",
"score": "0.5374998",
"text": "def connection_addr\n @connection_addr ||= @connection.nil? ? [nil] * 4 : @connection.peeraddr\n end",
"title": ""
},
{
"docid": "435ea2a581344c6af47ce7be0b291a88",
"score": "0.5371232",
"text": "def network_connection\n execute :get_network_connection\n end",
"title": ""
},
{
"docid": "f1f1b4c1a1ddee4fd3dbf67d5a346829",
"score": "0.53703845",
"text": "def network_connection\n execute :get_network_connection\n end",
"title": ""
},
{
"docid": "d59dbd756a0320ea80401aa0da9e25d3",
"score": "0.5356057",
"text": "def get_target_connection(opts={})\n\n #Ensure that we have a plugged-in board.\n fatal_error \"It doesn't look like there's a Digilent board plugged in, on or off.\" if Device::connected_devices.empty? \n\n #By default, use the first connected device.\n device = Device::open_first_connected_device\n at_exit { device.close }\n\n #If the device doesn't support JTAG, we can't program it.\n fatal_error \"This device isn't supported.\" unless device.supported_connections.include?(JTAG::Connection)\n\n jtag = JTAG::Connection.new(device)\n fatal_error \"The power switch is off on your connected board! Turn it on, and try again.\" if jtag.connected_devices.empty?\n\n jtag\n\nend",
"title": ""
},
{
"docid": "92dfb2155b2a37037c4410eda04966ce",
"score": "0.534822",
"text": "def connection\n return @factory.connection\n end",
"title": ""
},
{
"docid": "bdf7e62712ced420be866549b0ab1cb3",
"score": "0.53393716",
"text": "def connection_to(other)\n connections.select { |c| c.to == other }.min_by(&:metric)\n end",
"title": ""
},
{
"docid": "29d82a73ad7a5b99ded308c22b3c8fe6",
"score": "0.5323707",
"text": "def connection_lookup(identifier)\n consumer.connection(identifier)\n end",
"title": ""
},
{
"docid": "70fb559a70cb5fe15d82f20538b9e9de",
"score": "0.5306634",
"text": "def chat(contact)\n chat = Ahoy::Chat.new(contact.name)\n chat.connect(contact.target, contact.port(true))\n end",
"title": ""
},
{
"docid": "b38a2b693e48d5cda1b4f4e0a9b133a7",
"score": "0.529031",
"text": "def connections(departure, arrival, date)\n query_host(\"C\" + departure.to_s + arrival.to_s + date.to_s)\n end",
"title": ""
},
{
"docid": "bfc537ef26a6eeba87f3fc10f1b552cd",
"score": "0.5273939",
"text": "def connection_id\n attributes.fetch(:connection_id) { protocol_message.connection_id if assigned_to_protocol_message? }\n end",
"title": ""
},
{
"docid": "b419e6e0c35dafa2dec7efc7dc037876",
"score": "0.52699196",
"text": "def listing_contact( listing = nil )\n listing = @listing unless listing\n if listing.property\n if listing.property.agency\n if listing.property.agency.broker\n contact = listing.property.agency.broker\n end\n end\n end\n unless contact\n contact = Agent.find( :first,\n :include => { :user => :user_icons },\n :conditions => { :agents => { :id => 1 } }\n )\n end\n return contact\n end",
"title": ""
},
{
"docid": "ce696d558da48f34334f3dc18ba587d4",
"score": "0.5265541",
"text": "def primary_contact\n self\n end",
"title": ""
},
{
"docid": "6b884e82b5a2d17e145b666718f77c48",
"score": "0.52651757",
"text": "def connect\n Nfc.tech_connect(get_name)\n end",
"title": ""
},
{
"docid": "3ab6e9546d371de2179b5e326623d5fa",
"score": "0.52603954",
"text": "def getlink( txt)\n\t\trc = nil\n\t\t@connections.each { |c|\n\t\t\tif txt == c.name then\n\t\t\t\trc = c; break\n\t\t\tend\n\t\t}\n\t\trc\n\tend",
"title": ""
},
{
"docid": "c41bbd8f46bb2d67d16a4030d4ffb5eb",
"score": "0.52577776",
"text": "def accept\n Connection.accept(attorney_id, contact_id)\n end",
"title": ""
},
{
"docid": "20ebaee538e81fece370da80b7e2a52a",
"score": "0.525084",
"text": "def conn\n @conn ||= new_connection\n end",
"title": ""
},
{
"docid": "20ebaee538e81fece370da80b7e2a52a",
"score": "0.525084",
"text": "def conn\n @conn ||= new_connection\n end",
"title": ""
},
{
"docid": "20ebaee538e81fece370da80b7e2a52a",
"score": "0.525084",
"text": "def conn\n @conn ||= new_connection\n end",
"title": ""
},
{
"docid": "fcc315ac0d08e88a9eda1c3a32aa8f7a",
"score": "0.52464443",
"text": "def connection_for(path = nil)\n @connection ||= self.class.get_connection(@spec)\n end",
"title": ""
},
{
"docid": "78b8f420f64e7db917300ec1e89f9962",
"score": "0.52463496",
"text": "def get_connection\n\t\treturn @@conn_obj if !@@conn_obj.nil?\n\t\t\n\t\tRails.logger.debug \"Creating new MarketPointWorker connection\"\n\t\t\n\t\t@@conn_obj = TCPSocket.new('practice.bridgerocktech.com', 80)\n\t\t@@conn_obj.write 'login JHd0TxrtMKykqOn91fMwNqsk2Wrc5uhk2kQaTXJp2zMd1JTT'\n\t\t\n\t\tConnectionHelper::verify_connection(@@conn_obj)\n\t\t\n\t\treturn @@conn_obj\n\tend",
"title": ""
},
{
"docid": "5f73ccbe61e3e61bdcf671bfec581bfc",
"score": "0.5235584",
"text": "def connection(reflesh = false)\n conn = read_inheritable_attribute(:connection)\n if reflesh || conn.nil?\n db = database\n conn = Connection.new(db)\n conn.user = user if db.user\n conn.password = password if db.password\n conn.timeout = timeout if timeout\n write_inheritable_attribute(:connection, conn)\n end\n conn\n end",
"title": ""
},
{
"docid": "1687c23f0e7b9818aa81171833d7ce02",
"score": "0.5232878",
"text": "def connection\n retrieve_connection\n end",
"title": ""
},
{
"docid": "1687c23f0e7b9818aa81171833d7ce02",
"score": "0.5232878",
"text": "def connection\n retrieve_connection\n end",
"title": ""
},
{
"docid": "476be49bda07fca481746404c869791a",
"score": "0.52305347",
"text": "def connection\n @connection || connect\n end",
"title": ""
},
{
"docid": "1366fb91ac83e97224ef927d841b0a9e",
"score": "0.5230531",
"text": "def connect(contact)\n ContactVenueRelationship.create(contact_id: contact.id,\n venue_id: id)\n end",
"title": ""
},
{
"docid": "4eb0f394133bdf7ca077658d85dba489",
"score": "0.52275085",
"text": "def connection\n raise ConnectionNotEstablished unless @@connection\n return @@connection\n end",
"title": ""
},
{
"docid": "9cedfe6e5f369c5ca4071ba1f3174684",
"score": "0.5224651",
"text": "def get_connection()\n ch = get_conn_headers()\n hash = { :hosts => [ \n {:login => user, :passcode => passcode, :host => host, :port => port, :ssl => nil},\n ],\n :reliable => false,\n :connect_headers => ch,\n :stompconn => get_stomp_conn(),\n :usecrlf => get_crlf(),\n }\n conn = Stomp::Connection.open(hash)\n conn\n end",
"title": ""
},
{
"docid": "1c8231fd865c62ccade1621e49861951",
"score": "0.5208898",
"text": "def create_connection\n if within_transaction?\n current_transaction.primitive_for(self).connection\n else\n # DataObjects::Connection.new(uri) will give you back the right\n # driver based on the Uri#scheme.\n DataObjects::Connection.new(@uri)\n end\n end",
"title": ""
},
{
"docid": "1c8231fd865c62ccade1621e49861951",
"score": "0.5208898",
"text": "def create_connection\n if within_transaction?\n current_transaction.primitive_for(self).connection\n else\n # DataObjects::Connection.new(uri) will give you back the right\n # driver based on the Uri#scheme.\n DataObjects::Connection.new(@uri)\n end\n end",
"title": ""
},
{
"docid": "45a2b1bc57d92577bf26fa9c0fcc578a",
"score": "0.5207329",
"text": "def contact_to(a)\n if user_signed_in?\n if current_subject.ties_to(a).present?\n current_subject.ties_to(a).map(&:relation_name).join(\", \")\n else\n new_contact_link(Contact.new(current_subject, a))\n end\n else\n link_to t(\"contact.new.link\"), new_user_session_path\n end\n end",
"title": ""
},
{
"docid": "6a057021aa51216dab63d571f17f8674",
"score": "0.5200507",
"text": "def connection(kyspc=nil)\n CassandraComplex::Connection.connection(kyspc || self.keyspace)\n end",
"title": ""
},
{
"docid": "182cf837fb86af5b6ee4ec7c72a57b38",
"score": "0.51848435",
"text": "def get_connection(config, &connector)\n @connections ||= {}\n\n connection = @connections[config]\n\n return connection if connection\n\n begin\n @connections[config] = yield(config)\n rescue => e\n ::NewRelic::Agent.logger.error('Caught exception trying to get connection to DB for explain.', e)\n nil\n end\n end",
"title": ""
},
{
"docid": "6343d2e9a7e2964759cf180f28d2e26c",
"score": "0.51767963",
"text": "def get_connection_endpoint\n\t\tend",
"title": ""
},
{
"docid": "520e6de95ddf1a341e9b3e7d41b95b15",
"score": "0.5176357",
"text": "def connections\n followers & following\n end",
"title": ""
},
{
"docid": "78bc21d4489fa9c3e5114dfe2ce1aa09",
"score": "0.51600206",
"text": "def connections\n # TODO: Implement me using associations!\n end",
"title": ""
},
{
"docid": "3c9fba86325be84880d3f88c6f95ce62",
"score": "0.51506966",
"text": "def establish_connection(*args)\n @@connection_adapter ||= use_adapter(:ole)\n @@connection = @@connection_adapter.new(*args)\n end",
"title": ""
},
{
"docid": "52d685aab4944883c577f76ae97353c2",
"score": "0.51456404",
"text": "def getConnectionStr name\n\t\treturn @connections[name][0]\n\tend",
"title": ""
},
{
"docid": "833e9f99873df4036b225353788d18a7",
"score": "0.5142109",
"text": "def connection\n\t\tself.connect\n\t\t\n\t\t@connections[Thread.current]\n\tend",
"title": ""
},
{
"docid": "611eb711e5dfa17fb9a8087241b56589",
"score": "0.51352835",
"text": "def conn(server=:default)\n @conns[@servers[server]]\n end",
"title": ""
},
{
"docid": "762637f409c2b893993835518c33b939",
"score": "0.51323456",
"text": "def get_failover_connection\n @failover_connect\n end",
"title": ""
},
{
"docid": "48842ee088d0f8c66a31e832743d06bd",
"score": "0.5130987",
"text": "def connection\n @adapter || establish_connection\n end",
"title": ""
},
{
"docid": "d522dc06a72108b6ed82af0ba05024cf",
"score": "0.5127036",
"text": "def get_connections\n connections = []\n begin\n pconfig = MavensMate.get_project_config\n pconfig['org_connections'].each do |connection| \n pw = KeyChain::find_internet_password(\"#{pconfig['project_name']}-mm-#{connection['name']}\")\n connections.push({\n :un => connection[\"username\"], \n :pw => pw\n })\n end \n rescue \n end\n return connections\n end",
"title": ""
},
{
"docid": "bdcc6d1379f7b0767e671327669c4c53",
"score": "0.5124691",
"text": "def connection(connection_id); end",
"title": ""
},
{
"docid": "7d7fdd1cd55d01ba5c40f133a029be45",
"score": "0.512346",
"text": "def connections(options={},params={})\n path = \"#{person_path(options)}/connections\"\n path = simple_query(path, options)\n get(path,params)\n end",
"title": ""
},
{
"docid": "67f3a0697cd318d6b2763adbe0a12911",
"score": "0.51035815",
"text": "def connection_identifier\n unless defined? @connection_identifier\n @connection_identifier = connection_gid identifiers.filter_map { |id| instance_variable_get(\"@#{id}\") }\n end\n\n @connection_identifier\n end",
"title": ""
},
{
"docid": "a9b6d4220846de7da31e86aab6275d7f",
"score": "0.5101285",
"text": "def get_connection\n ccdb_config = $config[:ccdb]\n conn = PG.connect(\n host: ccdb_config[:host],\n port: ccdb_config[:port],\n dbname: ccdb_config[:dbname],\n user: ccdb_config[:user],\n password: ccdb_config[:password]\n )\n\n return conn\n end",
"title": ""
},
{
"docid": "0105bf21fb9bcb4d9aa492fa79f9190e",
"score": "0.509845",
"text": "def create_connection(options = {})\n cc = connection_configuration\n if options[:connect_to_keyspace] && cc[:keyspace]\n connection = Cql::Client.connect(cc)\n connection.use(cc[:keyspace])\n else\n cc_no_keyspace = cc.delete_if { |k, v| k.to_s == 'keyspace' }\n connection = Cql::Client.connect(cc_no_keyspace)\n end\n connection\n end",
"title": ""
},
{
"docid": "c893c22ae277ee2dbd1e11b771d6226f",
"score": "0.5089865",
"text": "def make_connect(address,port)\n#\t\tc = Connection.new()\n\t\t@connects << c\n\tend",
"title": ""
},
{
"docid": "e34d676a0db4503726dd93c299294800",
"score": "0.50793505",
"text": "def connection\n @connection ||= adapter.new(DoubleMap.configuration)\n end",
"title": ""
},
{
"docid": "c30b1d7c512b9ee014ca4b2929a7eba0",
"score": "0.5076726",
"text": "def request_connection_id\n # Offset | Size | Name | Value\n # -----------------------------------------------------------------------\n # 0 | 8 (64 bit integer) | connection id | for this request, the initial value 0x41727101980\n # 8 | 4 (32-bit integer) | action 0 for | connection request\n # 12 | 4 (32-bit integer) | transaction id | a random number created by client\n first_32_bit_conn_id = 0x41727101980 >> 32\n second_32_bit_conn_id = 0x41727101980 & 0xffffffff\n\n buffer = [first_32_bit_conn_id, second_32_bit_conn_id, 0, 16].pack \"N*\"\n c0, c1, action, @client_transaction_id = buffer.unpack \"N*\"\n @udp_socket.send buffer, 0, @tracker.host, @tracker.port\n\n ## Tracker response\n # Offset | Size | Name | Value\n #------------------------------------------------------------------------\n # 0 | 4 (32-bit integer) | action | 0 for connect response\n # 4 | 4 (32-bit integer) | transaction id | same like request's transaction id.\n # 8 | 8 (64 bit integer) | connection id | a connection id that must be acceptable for at least 2 minutes from source\n res = udp_socket.recvfrom(5000)\n res_action, @res_transaction_id, @res_connection_id = res[0].unpack \"NNQ\"\n end",
"title": ""
},
{
"docid": "fd7e260cff9ba4b5aae18f0bc4a118ce",
"score": "0.5076122",
"text": "def connection\n return @connection if @connection\n Munson.default_connection\n end",
"title": ""
},
{
"docid": "876554352672ebf17dda0c4850955af0",
"score": "0.5068346",
"text": "def get_connection( host=@host, validate_ssl=@validate_ssl )\n if ! defined?(@@connection)\n @@connection = RestAuthConnection.new( host, validate_ssl )\n end\n #puts 'CALLINFO RestAuthConnection::get_connection called'\n return @@connection\n end",
"title": ""
},
{
"docid": "58573f9f9da1bcf36e0dbafdaf928c08",
"score": "0.50626165",
"text": "def connection(name = :default)\n @connections[name] || raise(\"Undefined #{self} connection '#{name}'\")\n end",
"title": ""
},
{
"docid": "b96c44aa22f2b93a882dbb8c8e1b50d7",
"score": "0.5059297",
"text": "def find_connection(v1, v2)\n connection = v1.edges.select {|edge| edge.connection.include?(v2)}\n connection.first\n end",
"title": ""
},
{
"docid": "a3a3ceb77fd45dd8a62f0b24f262ea11",
"score": "0.50590026",
"text": "def requested_contact_links\n requested_contacts.map do |p|\n conn = Connection.conn(self, p)\n edit_connection_path(conn)\n end\n end",
"title": ""
},
{
"docid": "d1c5ff86d84c719b970cd9d62447de21",
"score": "0.50552094",
"text": "def connection\n @connection ||= @transport.connection\n end",
"title": ""
},
{
"docid": "0992af87e5ef9c846a3709d8cabd4377",
"score": "0.5053991",
"text": "def request(attorney, contact)\n\n if attorney == contact or Connection.exists?(attorney, contact)\n nil\n else\n transaction do\n create(:attorney => attorney, :contact => contact, :status => PENDING)\n create(:attorney => contact, :contact => attorney, :status => REQUESTED)\n end\n true\n end\n end",
"title": ""
},
{
"docid": "45096012215deea6ed3576665230b374",
"score": "0.5050871",
"text": "def retrieve_connection(spec_name, role: T.unsafe(nil), shard: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d47d53974672377ff6b23640f135b774",
"score": "0.50441176",
"text": "def connection\n Connection.wrap(Cproton.pn_transport_connection(@impl))\n end",
"title": ""
},
{
"docid": "4fbe3b849b21563e0a2d916a9b5a85ce",
"score": "0.5034782",
"text": "def connection(name)\n if @connections.key?(name)\n res = Resource.new(@access_token, @connections[name])\n return Collection.new(@access_token, res.data)\n end\n end",
"title": ""
},
{
"docid": "6476517ef8e29c046509d8b64c905b9b",
"score": "0.5033714",
"text": "def establish_connection\n @conn = build_connection\n end",
"title": ""
},
{
"docid": "6a9d3678d28b8c66e3b4916c3c2a5624",
"score": "0.503316",
"text": "def get_conn ip_addr = '192.168.250.2'\n conn = IntByReference.new\n begin\n log_info \"Connecting to Bambook #{ip_addr}.\"\n result = @bambook_core.BambookConnect ip_addr, 0, conn\n raise Exception.new(\"ResultCode:#{result}\") unless result == Const.BR_SUCC\n rescue Exception => e\n log_error \"Can't connect to Bambook. #{e.message}\"\n end\n conn.get_value\n end",
"title": ""
},
{
"docid": "a577cc5a7616180510830740c318f1fe",
"score": "0.5022441",
"text": "def retrieve_connection(klass) #:nodoc:\n pool = retrieve_connection_pool(klass)\n raise ConnectionNotEstablished, \"No connection pool for #{klass}\" unless pool\n conn = pool.connection\n raise ConnectionNotEstablished, \"No connection for #{klass} in connection pool\" unless conn\n conn\n end",
"title": ""
}
] |
67a54349f986257f6cde93b0f8342c90
|
test reading frames from an imported movie draw them and then write a movie.
|
[
{
"docid": "b4ce5b0cfac2cd60455cd14e14a98f05",
"score": "0.69558614",
"text": "def test03()\n movieFileName = \"movie03.mov\"\n # In this example source file and output dimensions are both 1280x720\n sourceMovie = File.join($directory, \"images/testinput-movingimages.mov\")\n utiFileType = \"com.apple.quicktime-movie\"\n\n begin\n # Create the list of commands object, ready to have commands added to it.\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # Importer the movie file\n movieImporterName = SecureRandom.uuid\n movieImporter = theCommands.make_createmovieimporter(sourceMovie,\n name: movieImporterName)\n\n contextSize = MIShapes.make_size(1280, 720)\n bitmapObject = theCommands.make_createbitmapcontext(size: contextSize,\n profile: :kCGColorSpaceGenericRGB)\n\n # movieFilePath = File.join(File.expand_path(\"~/Desktop\"), movieFileName)\n movieFilePath = File.join(Dir.tmpdir(), movieFileName)\n # Create the video frames writer object\n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n\n # Now add the ProRes422 input to the video writer object\n frameduration = MIMovie::MovieTime.make_movietime(timevalue: 400,\n timescale: 6000)\n addVideoInputCommand = CommandModule.make_addinputto_videowritercommand(\n movieWriter, preset: :prores422preset, framesize: contextSize,\n frameduration: frameduration)\n theCommands.add_command(addVideoInputCommand)\n\n # Prepare to loop over accessing frames and add frames to video frame writer\n # Will do nothing else other than halve the speed by doubling frame duration\n # time.\n # lets get 60 frames.\n numberOfFrames = 60\n imageID = SecureRandom.uuid\n trackID = MIMovie::MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n currentTime = MIMovie::MovieTime.make_movietime(timevalue: 120, timescale: 30)\n \n # I've needed to use drawing to a bitmap context because my old laptop is\n # incapable of creating the necessary color correction data to go from\n # the profile of the image frame from the movie importer to the pixel buffer.\n # Drawing to bitmap slows down the processing of the movie frames. When\n # writing a script for computers with better hardware and optimizing for\n # speed you could leave out the draw image code and swap it for the commented\n # out code.\n \n numberOfFrames.times do |frameIndex|\n currentTime = MIMovie::MovieTime.make_movietime(timevalue: 60 + frameIndex,\n timescale: 30)\n # frameOptions = MIMovie::FrameOptions.new\n # frameOptions.frametime = currentTime\n # frameOptions.tracks = [trackID]\n #==================================================================\n drawImageElement = MIDrawImageElement.new\n drawImageElement.set_moviefile_imagesource(source_object: movieImporter,\n frametime: currentTime, tracks: [trackID])\n drawImageElement.destinationrectangle = MIShapes.make_rectangle(\n size: contextSize)\n drawImageCommand = CommandModule.make_drawelement(bitmapObject, \n drawinstructions: drawImageElement, createimage: true)\n theCommands.add_command(drawImageCommand)\n addImageToWriterInput = CommandModule.make_addimageto_videoinputwriter(\n movieWriter, sourceobject: bitmapObject)\n #==================================================================\n # addImageToWriterInput = CommandModule.make_addimageto_videoinputwriter(\n # movieWriter, imageoptions: frameOptions, sourceobject: movieImporter)\n theCommands.add_command(addImageToWriterInput)\n end\n \n finalize = CommandModule.make_finishwritingframescommand(movieWriter)\n theCommands.add_command(finalize)\n result = Smig.perform_commands(theCommands)\n # The above will throw if an error occured.\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n ensure\n FileUtils.rm_f(movieFilePath) unless movieFilePath.nil?\n# `open #{movieFilePath}`\n end\nend",
"title": ""
}
] |
[
{
"docid": "32e002459f660bd047e0c17a93c38633",
"score": "0.65859884",
"text": "def draw\n begin\n movie_color.clear\n mov.read\n mov.load_pixels\n num_pixels_high.times do |j|\n num_pixels_wide.times do |i|\n movie_color << mov.get(i * BLOCK_SIZE, j * BLOCK_SIZE)\n end\n end\n end if mov.available?\n num_pixels_high.times do |j|\n num_pixels_wide.times do |i|\n fill(movie_color[j * num_pixels_wide + i])\n rect(i * BLOCK_SIZE, j * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE)\n end\n end\nend",
"title": ""
},
{
"docid": "a3ab4e266fbc288880bc4470679f962d",
"score": "0.59668344",
"text": "def test04\n begin\n movieImportPath = File.join($directory, \"images\", \"418_clip5_sd.m4v\")\n theCommands = SmigCommands.new\n # 1. Import the source movie.\n movieImporter = theCommands.make_createmovieimporter(movieImportPath)\n \n # 2. Create the movie editor object.\n movieEditor = theCommands.make_createmovieeditor()\n\n # 3. Add a video track to the movie editor.\n videoTrack = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n\n addVideoTrackCommand = CommandModule.make_createtrackcommand(movieEditor)\n theCommands.add_command(addVideoTrackCommand)\n\n # 4. Add a 4 second segment to the video track from the imported movie.\n insertionTime = MovieTime.make_movietime(timescale: 600, timevalue: 0)\n duration = MovieTime.make_movietime_fromseconds(4)\n startTime = MovieTime.make_movietime_fromseconds(0)\n sourceTimeRange = MovieTime.make_movie_timerange(start: startTime,\n duration: duration)\n insertVideoContent = CommandModule.make_inserttracksegment(movieEditor,\n track: videoTrack,\n source_object: movieImporter,\n source_track: videoTrack,\n insertiontime: insertionTime,\n source_timerange: sourceTimeRange)\n theCommands.add_command(insertVideoContent)\n \n # 5. Add a passthru layer instruction to the video track.\n layerInstructions = VideoLayerInstructions.new\n layerInstructions.add_passthrulayerinstruction(track: videoTrack)\n passthruTimeRange = MovieTime.make_movie_timerange(start: insertionTime,\n duration: duration)\n videoPassthruCommand = CommandModule.make_addvideoinstruction(movieEditor,\n timerange: passthruTimeRange,\n layerinstructions: layerInstructions)\n theCommands.add_command(videoPassthruCommand)\n \n # 6. Add two audio tracks to the movie editor.\n audioTrack1 = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :soun, trackindex: 0)\n audioTrack2 = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :soun, trackindex: 1)\n\n addAudioTrackCommand = CommandModule.make_createtrackcommand(movieEditor,\n mediatype: :soun)\n theCommands.add_command(addAudioTrackCommand)\n theCommands.add_command(addAudioTrackCommand)\n \n # 7. Add audio content (track segments to each of the two audio tracks.)\n startTime0 = MovieTime.make_movietime_fromseconds(0)\n startTime4 = MovieTime.make_movietime_fromseconds(4)\n sourceTimeRange4 = MovieTime.make_movie_timerange(start: startTime4,\n duration: duration)\n insertAudioContent = CommandModule.make_inserttracksegment(movieEditor,\n track: audioTrack1,\n source_object: movieImporter,\n source_track: audioTrack1,\n insertiontime: insertionTime,\n source_timerange: sourceTimeRange4)\n theCommands.add_command(insertAudioContent)\n \n insertAudioContent2 = CommandModule.make_inserttracksegment(movieEditor,\n track: audioTrack2,\n source_object: movieImporter,\n source_track: audioTrack1,\n insertiontime: insertionTime,\n source_timerange: sourceTimeRange)\n theCommands.add_command(insertAudioContent2)\n \n # 8. Set the volume for audio track 2 to 0 from the start.\n volumeInstruction = AudioInstruction.new(track: audioTrack2)\n \n volumeInstruction.set_volume_instruction(time: startTime0, volume: 0.0)\n addAudioInstruction = CommandModule.make_addaudioinstruction(movieEditor,\n audioinstruction: volumeInstruction)\n theCommands.add_command(addAudioInstruction)\n\n # 9. Set the volume ramp for audio track 1 to go from 1 to 0. Time range 1..3\n rampDuration = MovieTime.make_movietime_fromseconds(2)\n rampStart = MovieTime.make_movietime_fromseconds(1)\n rampTimeRange = MovieTime.make_movie_timerange(start: rampStart,\n duration: rampDuration)\n volumeRampInstruction1 = AudioInstruction.new(track: audioTrack1)\n volumeRampInstruction1.set_volumeramp_instruction(timerange: rampTimeRange,\n startvolume: 1.0,\n endvolume: 0.0)\n addAudioVolumeRamp1 = CommandModule.make_addaudioinstruction(movieEditor,\n audioinstruction: volumeRampInstruction1)\n theCommands.add_command(addAudioVolumeRamp1)\n\n # 10. Set the volume ramp for audio track 2 to go from 0 to 1. Time range 1..3\n volumeRampInstruction2 = AudioInstruction.new(track: audioTrack2)\n volumeRampInstruction2.set_volumeramp_instruction(timerange: rampTimeRange,\n startvolume: 0.0,\n endvolume: 1.0)\n addAudioVolumeRamp2 = CommandModule.make_addaudioinstruction(movieEditor,\n audioinstruction: volumeRampInstruction2)\n theCommands.add_command(addAudioVolumeRamp2)\n\n # 11. Export the movie composition.\n movieFileName = \"audiowithvolumeramp.mov\"\n movieExportPath = File.join(\"~/Movies\", movieFileName)\n fileType = \"com.apple.quicktime-movie\"\n exportMovieCommand = CommandModule.make_movieeditor_export(movieEditor,\n exportpreset: :AVAssetExportPreset960x540,\n exportfilepath: movieExportPath,\n exportfiletype: fileType)\n theCommands.add_command(exportMovieCommand)\n \n # 12. Assign the composition map image to the image collection\n imageIdentifier = SecureRandom.uuid\n addCompositionToImageCollection = CommandModule.make_assignimage_tocollection(\n movieEditor,\n identifier: imageIdentifier)\n theCommands.add_command(addCompositionToImageCollection)\n \n # 13. Add removing the composition map image command to cleanup commands.\n theCommands.add_tocleanupcommands_removeimagefromcollection(imageIdentifier)\n \n # 14. Create an exporter.\n compMapFileName = \"compositionmap04.jpg\"\n # exportPath = File.join($compareImageDir, compMapFileName)\n exportPath = File.join(Dir.tmpdir(), compMapFileName)\n exporterObject = theCommands.make_createexporter(exportPath,\n export_type: \"public.jpeg\")\n \n # 15. Add image from image collection to exporter.\n addImageToExporterCommand = CommandModule.make_addimage_fromimagecollection(\n exporterObject,\n imageidentifier: imageIdentifier)\n theCommands.add_command(addImageToExporterCommand)\n \n # 16. Export image\n exportCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportCommand)\n\n Smig.perform_commands(theCommands)\n\n # 17. Compare images.\n origCompMap = File.join($compareImageDir, compMapFileName)\n unless AreImageFilesSame(origCompMap, exportPath)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n\n # 18. Compare audio track metadata.\n theCommands.clear\n movieImporter2 = theCommands.make_createmovieimporter(movieExportPath)\n getMovieTrackPropertiesCommand = CommandModule.make_get_objectproperties(\n movieImporter2)\n theTrack = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :soun, trackindex: 0)\n\n getMovieTrackPropertiesCommand.add_option(key: :track, value: theTrack)\n theCommands.add_command(getMovieTrackPropertiesCommand)\n theResult = Smig.perform_commands(theCommands)\n origResult = '{\"preferredvolume\":1,\"mediatype\":\"soun\",\"timerange\":{\"start\":{\"flags\":1,\"value\":0,\"timescale\":90000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":359952,\"timescale\":90000,\"epoch\":0}},\"trackid\":1,\"languagecode\":\"und\",\"languagetag\":\"\",\"trackenabled\":true}'\n unless theResult.eql? origResult\n raise \"Audio track metadata has changed\"\n end\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n ensure\n FileUtils.rm_f(exportPath) unless exportPath.nil?\n # FileUtils.rm_f(movieExportPath) unless movieExportPath.nil?\n # `open #{movieExportPath}` unless movieExportPath.nil?\n end\nend",
"title": ""
},
{
"docid": "53f493432a908c54f854a6bb8f13ec93",
"score": "0.5934254",
"text": "def create_frames(url)\n @gifm = MiniMagick::Image.open(url)\n @gifm.frames.each_with_index do |frame, idx|\n frame.write(\"images/frame#{idx}.jpg\")\n end\n preview(url)\n end",
"title": ""
},
{
"docid": "fe046c91dac4a8ad1f04dc5f8892e91f",
"score": "0.5893543",
"text": "def test\n header\n clear_panels\n @content << \"//Flashmate test.\"\n @content << \"var doc = fl.getDocumentDOM();\"\n @content << \"doc.testMovie();\"\n write_log\n to_file\n end",
"title": ""
},
{
"docid": "b7f1c6339d5ca46027a14d6d01145caa",
"score": "0.5839337",
"text": "def test02()\n movieFileName = \"movie01.mov\"\n begin\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieFilePath = File.join(\"/\", movieFileName)\n videoWriterName = \"videowriter.test02.name\"\n utiFileType = \"com.apple.quicktime-movie\"\n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n # Now add the h264_sd input to the video writer object\n frameduration = MIMovie::MovieTime.make_movietime(timevalue: 1001,\n timescale: 30000)\n cleanAperture = MIMovie::CleanAperture.make_cleanaperture(0, 30, 640, 420)\n addVideoInputCommand = CommandModule.make_addinputto_videowritercommand(\n movieWriter, preset: :h264preset_sd, framesize: { width: 640, height: 480 },\n frameduration: frameduration, cleanaperture: cleanAperture,\n scalingmode: :AVVideoScalingModeResizeAspect)\n theCommands.add_command(addVideoInputCommand)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n oldRes = '{\"objectname\":\"videowriter.test02.name\",\"objecttype\":\"videoframeswriter\",\"videosettings\":{\"AVVideoCleanApertureKey\":{\"AVVideoCleanApertureHorizontalOffsetKey\":0,\"AVVideoCleanApertureHeightKey\":420,\"AVVideoCleanApertureVerticalOffsetKey\":30,\"AVVideoCleanApertureWidthKey\":640},\"AVVideoHeightKey\":480,\"AVVideoCodecKey\":\"avc1\",\"AVVideoCompressionPropertiesKey\":{\"AverageBitRate\":3145728,\"MaxKeyFrameInterval\":30,\"ProfileLevel\":\"H264_Baseline_AutoLevel\",\"ExpectedFrameRate\":30},\"AVVideoWidthKey\":640,\"AVVideoScalingModeKey\":\"AVVideoScalingModeResizeAspect\"},\"frameduration\":{\"flags\":1,\"value\":1001,\"timescale\":30000,\"epoch\":0},\"canwriteframes\":true,\"file\":\"\\/movie01.mov\",\"time\":{\"flags\":1,\"value\":0,\"timescale\":30000,\"epoch\":0},\"size\":{\"width\":640,\"height\":480},\"videowriterstatus\":0,\"utifiletype\":\"com.apple.quicktime-movie\"}'\n # puts result\n fail \"Writer with input h264_sd properties different: \" unless result.eql? oldRes\n\n # Now redo for h264_hd\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n # Now add the h264_hd input to the video writer object\n frameduration = MIMovie::MovieTime.make_movietime(timevalue: 1001,\n timescale: 30000)\n cleanAperture = MIMovie::CleanAperture.make_cleanaperture(150, 0, 1620, 1080)\n addVideoInputCommand = CommandModule.make_addinputto_videowritercommand(\n movieWriter, preset: :h264preset_hd, framesize: { width: 1920, height: 1080 },\n frameduration: frameduration, cleanaperture: cleanAperture,\n scalingmode: :AVVideoScalingModeResizeAspect)\n theCommands.add_command(addVideoInputCommand)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n\n oldRes = '{\"objectname\":\"videowriter.test02.name\",\"objecttype\":\"videoframeswriter\",\"videosettings\":{\"AVVideoCleanApertureKey\":{\"AVVideoCleanApertureHorizontalOffsetKey\":150,\"AVVideoCleanApertureHeightKey\":1080,\"AVVideoCleanApertureVerticalOffsetKey\":0,\"AVVideoCleanApertureWidthKey\":1620},\"AVVideoHeightKey\":1080,\"AVVideoCodecKey\":\"avc1\",\"AVVideoCompressionPropertiesKey\":{\"ProfileLevel\":\"H264_High_AutoLevel\",\"AverageBitRate\":15585760,\"H264EntropyMode\":\"CABAC\",\"MaxKeyFrameInterval\":30,\"AllowFrameReordering\":1,\"ExpectedFrameRate\":30},\"AVVideoWidthKey\":1920,\"AVVideoScalingModeKey\":\"AVVideoScalingModeResizeAspect\"},\"frameduration\":{\"flags\":1,\"value\":1001,\"timescale\":30000,\"epoch\":0},\"canwriteframes\":true,\"file\":\"\\/movie01.mov\",\"time\":{\"flags\":1,\"value\":0,\"timescale\":30000,\"epoch\":0},\"size\":{\"width\":1920,\"height\":1080},\"videowriterstatus\":0,\"utifiletype\":\"com.apple.quicktime-movie\"}'\n fail \"Writer with input h264_hd properties different: \" unless result.eql? oldRes\n\n # Now redo for jpegpreset\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n # Now add the jpegpreset input to the video writer object\n frameduration = MIMovie::MovieTime.make_movietime(timevalue: 1001,\n timescale: 30000)\n addVideoInputCommand = CommandModule.make_addinputto_videowritercommand(\n movieWriter, preset: :jpegpreset, framesize: { width: 1280, height: 720 },\n frameduration: frameduration)\n theCommands.add_command(addVideoInputCommand)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n\n oldRes = '{\"objectname\":\"videowriter.test02.name\",\"objecttype\":\"videoframeswriter\",\"videosettings\":{\"AVVideoHeightKey\":720,\"AVVideoCodecKey\":\"jpeg\",\"AVVideoWidthKey\":1280,\"AVVideoCompressionPropertiesKey\":{\"Quality\":0.85}},\"frameduration\":{\"flags\":1,\"value\":1001,\"timescale\":30000,\"epoch\":0},\"canwriteframes\":true,\"file\":\"\\/movie01.mov\",\"time\":{\"flags\":1,\"value\":0,\"timescale\":30000,\"epoch\":0},\"size\":{\"width\":1280,\"height\":720},\"videowriterstatus\":0,\"utifiletype\":\"com.apple.quicktime-movie\"}'\n # puts result\n fail \"Writer with input jpegpreset properties different: \" unless result.eql? oldRes\n\n # Now redo for ProRes422\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n # Now add the ProRes422 input to the video writer object\n frameduration = MIMovie::MovieTime.make_movietime(timevalue: 1001,\n timescale: 30000)\n addVideoInputCommand = CommandModule.make_addinputto_videowritercommand(\n movieWriter, preset: :prores422preset,\n framesize: { width: 1280, height: 720 }, frameduration: frameduration)\n theCommands.add_command(addVideoInputCommand)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n\n oldRes = '{\"objectname\":\"videowriter.test02.name\",\"objecttype\":\"videoframeswriter\",\"videosettings\":{\"AVVideoColorPropertiesKey\":{\"TransferFunction\":\"ITU_R_709_2\",\"YCbCrMatrix\":\"ITU_R_709_2\",\"ColorPrimaries\":\"ITU_R_709_2\"},\"AVVideoCodecKey\":\"apcn\",\"AVVideoHeightKey\":720,\"AVVideoWidthKey\":1280,\"AVVideoScalingModeKey\":\"AVVideoScalingModeResizeAspect\"},\"frameduration\":{\"flags\":1,\"value\":1001,\"timescale\":30000,\"epoch\":0},\"canwriteframes\":true,\"file\":\"\\/movie01.mov\",\"time\":{\"flags\":1,\"value\":0,\"timescale\":30000,\"epoch\":0},\"size\":{\"width\":1280,\"height\":720},\"videowriterstatus\":0,\"utifiletype\":\"com.apple.quicktime-movie\"}'\n # puts result\n fail \"Writer with input ProRes422 properties different: \" unless result.eql? oldRes\n\n # Now redo for ProRes4444\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n # Now add the ProRes4444 input to the video writer object\n frameduration = MIMovie::MovieTime.make_movietime(timevalue: 1001,\n timescale: 30000)\n addVideoInputCommand = CommandModule.make_addinputto_videowritercommand(\n movieWriter, preset: :prores4444preset,\n framesize: { width: 1920, height: 1080 }, frameduration: frameduration)\n theCommands.add_command(addVideoInputCommand)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n # puts result\n oldRes = '{\"objectname\":\"videowriter.test02.name\",\"objecttype\":\"videoframeswriter\",\"videosettings\":{\"AVVideoColorPropertiesKey\":{\"TransferFunction\":\"ITU_R_709_2\",\"YCbCrMatrix\":\"ITU_R_709_2\",\"ColorPrimaries\":\"ITU_R_709_2\"},\"AVVideoCodecKey\":\"ap4h\",\"AVVideoHeightKey\":1080,\"AVVideoWidthKey\":1920,\"AVVideoScalingModeKey\":\"AVVideoScalingModeResizeAspect\"},\"frameduration\":{\"flags\":1,\"value\":1001,\"timescale\":30000,\"epoch\":0},\"canwriteframes\":true,\"file\":\"\\/movie01.mov\",\"time\":{\"flags\":1,\"value\":0,\"timescale\":30000,\"epoch\":0},\"size\":{\"width\":1920,\"height\":1080},\"videowriterstatus\":0,\"utifiletype\":\"com.apple.quicktime-movie\"}'\n fail \"Writer with input ProRes4444 properties different: \" unless result.eql? oldRes\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend",
"title": ""
},
{
"docid": "555affd724874c458a991a8455cbcbf6",
"score": "0.58307993",
"text": "def draw\n\n x_mouse = mouse_x - @half_x\n y_mouse = mouse_y - @half_y\n @color_shader.set('mouse', x_mouse.to_f, y_mouse.to_f)\n @color_shader.set('time', millis / 1000.0)\n\n if @mov.available? then\n\n blendMode(LIGHTEST)\n\n push_matrix\n @a += 0.01;\n if(@a > TWO_PI) then @a = 0.0 end\n\n translate(width/2, height/2)\n rotateX(@a * 4.0)\n rotateY(@a * 4.0)\n\n shader(@color_shader)\n @mov.read\n image(@mov, -640, -360, width, height)\n reset_shader\n pop_matrix\n\n blendMode(BLEND)\n image(@img, 0, 0)\n\n end\n\n if @do_record \n save_frame(\"output/frames####.png\".to_java)\n end\n\nend",
"title": ""
},
{
"docid": "7c5de4daf09c8623e1ab878a4565f98a",
"score": "0.5784405",
"text": "def test01()\n begin\n movieExportPresets = MIMeta.listmovieeditorexportpresets\n origResult = \"AVAssetExportPreset1920x1080 AVAssetExportPresetLowQuality AVAssetExportPresetAppleM4V720pHD AVAssetExportPresetLowQuality_16x9 AVAssetExportPresetAppleM4VAppleTV AVAssetExportPresetAppleM4A AVAssetExportPreset640x480 AVAssetExportPresetAppleProRes422LPCM AVAssetExportPreset3840x2160 AVAssetExportPresetAppleM4VWiFi AVAssetExportPresetHighestQuality AVAssetExportPresetAppleM4VCellular AVAssetExportPreset1280x720 AVAssetExportPresetMediumQuality_16x9 AVAssetExportPresetMediumQuality AVAssetExportPresetAppleM4V1080pHD AVAssetExportPresetAppleM4V480pSD AVAssetExportPreset960x540 AVAssetExportPresetAppleM4ViPod\"\n \n # puts movieExportPresets\n # Now lets check the list of presets obtained to one we prepared earlier.\n fail \"List of movie editor export presets is different\" unless origResult.eql?(\n movieExportPresets)\n\n # Get the nuber of movie editor objects.\n numObjects = Smig.get_classtypeproperty(objecttype: :movieeditor,\n property: :numberofobjects)\n fail \"Number of movie editor objects should be 0\" unless numObjects.eql?(\"0\")\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend",
"title": ""
},
{
"docid": "5a4844637e745205d1084be041088738",
"score": "0.5750286",
"text": "def ouput_video_frames(coords_array, working_dir)\n FileUtils.mkdir(working_dir)\n canvas = Magick::Image.new(1024, 768) do\n self.background_color = 'white'\n end\n # draw = Magick::Draw.new ## Don't just use a single draw object, because it slows things down.\n\n frame = 0\n draw = Magick::Draw.new\n draw.stroke_width(3)\n draw.fill_opacity(0)\n (0...coords_array.size).each do |i|\n tuple = coords_array[i]\n start_point = tuple[0]\n end_point = tuple[1]\n\n if start_point[0] == 'clear'\n # Open up a new blank canvas for the clear command\n canvas = Magick::Image.new(1024, 768) do\n self.background_color = 'white'\n end \n # Try to prevent odd gray lines over background\n draw = Magick::Draw.new\n draw.stroke_width(3)\n draw.fill_opacity(0)\n draw.stroke('white')\n draw.fill('white')\n draw.circle(0, 0, 3, 3)\n draw.draw(canvas)\n else\n # draw.circle(coords[0].to_i, coords[1].to_i, coords[0].to_i, coords[1].to_i + 3)\n end\n \n # if we need to output more frames to get to the first timestamp, just output that many frames\n until start_point[2] <= frame * MILLISECONDS_PER_FRAME\n frame = frame + 1\n filenum = \"%08d\" % frame\n draw.draw(canvas)\n canvas.write(\"#{working_dir}/#{filenum}.gif\")\n \n draw = Magick::Draw.new\n draw.stroke_width(3)\n draw.fill_opacity(0)\n draw.stroke('blue')\n draw.fill('blue')\n end\n \n # [[71,66,378],[72,66,396]] , [[72,66,397],[76,70,412]] , ... ]\n \n # 3 possibilities:\n last_drawn_point = start_point\n \n # end_point timestamp > 1 frame\n \n while end_point[2] > ((frame+1) * MILLISECONDS_PER_FRAME)\n # How far do we go in 1 frame? A percentage of the total distance we're supposed to go in the remaing frames\n percentage = 1.00000 / ((1.0000 * end_point[2] - frame * MILLISECONDS_PER_FRAME) / MILLISECONDS_PER_FRAME)\n \n # calculate the percentage between the previous frame and the future frame, and draw the line between that\n next_point = [ \n (1.00000 * last_drawn_point[0] + ((end_point[0] - start_point[0]) * percentage)).round, \n (1.00000 * last_drawn_point[1] + ((end_point[1] - start_point[1]) * percentage)).round \n ]\n \n if start_point[0] != 'clear'\n draw.line(last_drawn_point[0], last_drawn_point[1], next_point[0], next_point[1])\n end\n frame = frame + 1\n filenum = \"%08d\" % frame\n draw.draw(canvas)\n canvas.write(\"#{working_dir}/#{filenum}.gif\")\n last_drawn_point = next_point\n \n draw = Magick::Draw.new\n draw.stroke_width(3)\n draw.fill_opacity(0)\n draw.stroke('blue')\n draw.fill('blue')\n end\n \n \n # end_point timestamp == 1 frame\n if end_point[2] == ((frame+1) * MILLISECONDS_PER_FRAME)\n if start_point[0] != 'clear'\n draw.line(last_drawn_point[0], last_drawn_point[1], end_point[0], end_point[1])\n end\n frame = frame + 1\n filenum = \"%08d\" % frame\n draw.draw(canvas)\n canvas.write(\"#{working_dir}/#{filenum}.gif\")\n draw = Magick::Draw.new\n draw.stroke_width(3)\n draw.fill_opacity(0)\n draw.stroke('blue')\n draw.fill('blue')\n\n # end_point timestamp < 1 frame\n else # end_point[2] < ((frame+1) * MILLISECONDS_PER_FRAME)\n if start_point[0] != 'clear'\n draw.line(last_drawn_point[0], last_drawn_point[1], end_point[0], end_point[1])\n end\n end\n \n \n # Calculate how many frames this point represents, and output each frame, must cast to float to get correct rounding\n # frames = i + 1 == coords_array.size ? 1 : (1.0000 * (coords_array[i+1][2] - coords[2]) / MILLISECONDS_PER_FRAME).round # last frame vs. not last frame\n # \n # (0...frames).each do |f|\n # frame = frame + 1\n # filenum = \"%08d\" % frame\n # canvas.write(\"#{working_dir}/#{filenum}.gif\")\n # end\n end\n\n return frame\n end",
"title": ""
},
{
"docid": "27c3cc97b928f9f6285b2596f8c0617d",
"score": "0.55347115",
"text": "def test01()\n destMovieFileNameMP4 = \"movie01.mp4\"\n destMovieFileNameMOV = \"movie02.mov\"\n destMovieFileNameM4V = \"movie03.m4v\"\n begin\n # Test with a mpeg4 file type.\n \n # Create the list of commands object.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieFilePath = File.join(Dir.tmpdir(), destMovieFileNameMP4)\n videoWriterName = \"videowriter.test01.name\"\n utiFileType = \"public.mpeg-4\"\n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n oldResH = { \n \"file\" => \"/This/Path/Is/Ignored\",\n \"objectname\" => videoWriterName,\n \"objecttype\" => \"videoframeswriter\",\n \"utifiletype\" => utiFileType,\n \"canwriteframes\" => false,\n \"videowriterstatus\" => 0\n }\n newResH = JSON.parse(result)\n \n # Compare the different property hashes.\n compare_videowriterproperties_hash(oldResH, newResH)\n\n # Now lets ask for the number of objects. Should be 0.\n fail \"Video writer object not closed\" unless Smig.get_numberofobjects().eql? 0\n \n # Test with a quicktime file type.\n\n # Create the list of commands object.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieFilePath = File.join(Dir.tmpdir(), destMovieFileNameMOV)\n videoWriterName = \"videowriter.test01.name\"\n utiFileType = \"com.apple.quicktime-movie\"\n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n oldResH = { \n \"file\" => \"/This/Path/Is/Ignored\",\n \"objectname\" => videoWriterName,\n \"objecttype\" => \"videoframeswriter\",\n \"utifiletype\" => utiFileType,\n \"canwriteframes\" => false,\n \"videowriterstatus\" => 0\n }\n newResH = JSON.parse(result)\n \n # Compare the different property hashes.\n compare_videowriterproperties_hash(oldResH, newResH)\n \n # Now lets ask for the number of objects. Should be 0.\n fail \"Video writer object not closed\" unless Smig.get_numberofobjects().eql? 0\n\n # Test with a m4v file type.\n\n # Create the list of commands object.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieFilePath = File.join(Dir.tmpdir(), destMovieFileNameM4V)\n videoWriterName = \"videowriter.test01.name\"\n utiFileType = \"com.apple.m4v-video\"\n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n getMovieWriterProps = CommandModule.make_get_objectproperties(movieWriter,\n saveresultstype: :jsonstring)\n theCommands.add_command(getMovieWriterProps)\n result = Smig.perform_commands(theCommands)\n oldResH = { \n \"file\" => \"/This/Path/Is/Ignored\",\n \"objectname\" => videoWriterName,\n \"objecttype\" => \"videoframeswriter\",\n \"utifiletype\" => utiFileType,\n \"canwriteframes\" => false,\n \"videowriterstatus\" => 0\n }\n newResH = JSON.parse(result)\n \n # Compare the different property hashes.\n compare_videowriterproperties_hash(oldResH, newResH)\n \n # Now lets ask for the number of objects. Should be 0.\n fail \"Video writer object not closed\" unless Smig.get_numberofobjects().eql? 0\n\n # One last test. Check that we can get a single property.\n # In this case the utifiletype.\n # Create the list of commands object.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n \n movieFilePath = File.join(Dir.tmpdir(), destMovieFileNameM4V)\n videoWriterName = \"videowriter.test01.name\"\n utiFileType = \"com.apple.m4v-video\"\n movieWriter = theCommands.make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n name: videoWriterName,\n utifiletype: utiFileType,\n pathsubstitutionkey: nil)\n \n getMovieWriterProp = CommandModule.make_get_objectproperty(movieWriter,\n property: :utifiletype)\n theCommands.add_command(getMovieWriterProp)\n result = Smig.perform_commands(theCommands)\n\n fail \"utifiletype different to assigned: \" unless result.eql? utiFileType\n\n # Now lets ask for the number of objects. Should be 0.\n fail \"Video writer object not closed\" unless Smig.get_numberofobjects().eql? 0\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend",
"title": ""
},
{
"docid": "bf8bdebb271cf2584bf698c2575d6a56",
"score": "0.5530061",
"text": "def animation(x)\n 3.times do\n i = 1\n while i < 4\n print \"\\e[H\\e[2J\"\n File.foreach(\"./media/images#{x}/#{i}.rb\") { |f| puts f }\n sleep(0.3)\n i += 1\n end\n end\nend",
"title": ""
},
{
"docid": "c52bd7333022491c1e432b0585fe4568",
"score": "0.5528188",
"text": "def test03()\n movieEditorObject = nil\n begin\n theCommands = SmigCommands.new\n \n # Create a Smig commands object purely used to cleanup on script completion.\n cleanupCommands = SmigCommands.new\n # 3.0 Create a movie editor object.\n movieEditorObject = theCommands.make_createmovieeditor(addtocleanup: false)\n\n cleanupCommands.add_tocleanupcommands_closeobject(movieEditorObject)\n \n # 3.1 Add two video tracks.\n # Leave track id unspecified and one will be assigned.\n addVideoTrackCommand = CommandModule.make_createtrackcommand(\n movieEditorObject,\n mediatype: :vide)\n theCommands.add_command(addVideoTrackCommand)\n # Since we are not specifying the persistent track id, the create track\n # command is the same for creating all 3 tracks.\n theCommands.add_command(addVideoTrackCommand)\n theCommands.add_command(addVideoTrackCommand)\n\n # 3.2 Confirm that there is three tracks.\n getNumTracks = CommandModule.make_get_objectproperty(movieEditorObject,\n property: :numberoftracks)\n theCommands.add_command(getNumTracks)\n \n numTracks = Smig.perform_commands(theCommands)\n fail \"Should have 3 video tracks is #{numTracks}\" unless numTracks.eql?(\"3\")\n\n theCommands.clear\n # 3.3 Import a movie file.\n sourceMovie = File.join($directory, \"images/testinput-movingimages.mov\")\n movieImporter = theCommands.make_createmovieimporter(sourceMovie,\n addtocleanup: false)\n cleanupCommands.add_tocleanupcommands_closeobject(movieImporter)\n # Specify that the content will be from the first video track in movie file.\n sourceTrack = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n \n=begin\ncreate 3 tracks.\n\nThe first track is scaled down to display in the bottom right corner for the full\nlength of the movie. Scale is 0.333, 0.333. There are two ways to do this,\nspecify the preferred transform for the track, and use a passthru layer\ninstruction for the track in all instructions or, add a transform layer\ninstruction for the track in every instruction. Generated movie should be 10\nseconds long.\n\nI'm going to go with the first option for now, specifying the preferred transform\nfor the first track. This might cause problems if the movie decides to make the\nsize of video tracks to be the transformed size of the first video track.\n\nFirst option didn't work, preferred transform is for display not composition.\nSo use a transform layer instruction and apply it to first track.\n\nTracks two and three have an opacity ramp then crop ramp between the two.\nIN = Instruction\n\n———————————————————— T0\n———————— ———————— T1\n ———————————— T2\n OR CR\n \nIN1 IN2 IN3 IN4 IN5\n\nOR is an opacity ramp that ramps the opacity from T1 to T2, CR is a crop\nramp that crops T2 from no cropping to a small centred crop rect.\n\nIN1 [ T0PTLI, T1PTLI ] for 2 seconds.\nIN2 [ T0PTLI, T1ORLI, T2PTLI ] for 2 seconds.\nIN3 [ T0PTLI, T2PTLI ] for 2 seconds.\nIN4 [ T0PTLI, T2CRLI, T1PTLI ] for 2 seconds.\nIN5 [ T0PTLI, T1PTLI ] for 2 seconds.\n\nT0 Track 0\nT1 Track 1\nT2 Track 2\nPT PassThru\nOR Opacity Ramp\nCR Crop Ramp\nLI Layer Instruction\n[] indicates an array of layer instructions.\n=end\n # 3.4 Add content to all three tracks that overlaps.\n # First add 10 seconds of content to T0\n track0 = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n sourceTrack = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n\n timeZero = MovieTime.make_movietime(timevalue: 0, timescale: 6000)\n duration = MovieTime.make_movietime(timevalue: 60000, timescale: 6000)\n sourceTimeRange = MovieTime.make_movie_timerange(start: timeZero,\n duration: duration)\n insertionTime = MovieTime.make_movietime(timevalue: 0, timescale: 6000)\n insertTrackSegmentCommand = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: track0,\n source_object: movieImporter,\n source_track: sourceTrack,\n insertiontime: timeZero, \n source_timerange: sourceTimeRange)\n\n theCommands.add_command(insertTrackSegmentCommand)\n # Now set the preferred transform of track 0. Original movie 1280x720\n\n # Now add content to T1. Two segments of content to be added.\n # Each 4 seconds long.\n # First segment is last 4 seconds of source track. Then a two second break.\n # Second segment is first 4 seconds of source track.\n fourSeconds = MovieTime.make_movietime(timevalue: 24000, timescale: 6000)\n sixSeconds = MovieTime.make_movietime(timevalue: 36000, timescale: 6000)\n track1 = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 1)\n sourceTimeRange2 = MovieTime.make_movie_timerange(start: sixSeconds,\n duration: fourSeconds)\n insertTrackSegmentCommand2 = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: track1,\n source_object: movieImporter,\n source_track: sourceTrack,\n insertiontime: timeZero, \n source_timerange: sourceTimeRange2)\n theCommands.add_command(insertTrackSegmentCommand2)\n sourceTimeRange3 = MovieTime.make_movie_timerange(start: timeZero,\n duration: fourSeconds)\n insertTrackSegmentCommand3 = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: track1,\n source_object: movieImporter,\n source_track: sourceTrack,\n insertiontime: sixSeconds, \n source_timerange: sourceTimeRange3)\n theCommands.add_command(insertTrackSegmentCommand3)\n \n # Now add content to T2. One segment to be added. 4 seconds long, starting\n # at 2 seconds in with source content starting at 3 seconds in.\n twoSeconds = MovieTime.make_movietime(timevalue: 12000, timescale: 6000)\n threeSeconds = MovieTime.make_movietime(timevalue: 18000, timescale: 6000)\n track2 = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 2)\n sourceTimeRange4 = MovieTime.make_movie_timerange(start: twoSeconds,\n duration: sixSeconds)\n insertTrackSegmentCommand4 = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: track2,\n source_object: movieImporter,\n source_track: sourceTrack,\n insertiontime: twoSeconds, \n source_timerange: sourceTimeRange4)\n theCommands.add_command(insertTrackSegmentCommand4)\n \n # 3.5 Now add composition instructions.\n # IN1 [ T0PTLI, T1PTLI ] for 2 seconds.\n # First layer instruction is a transform instruction for track 0.\n # Then a pass thru layer instruction for track 1.\n\n contextTransformation = MITransformations.make_contexttransformation\n translatePoint = MIShapes.make_point(853.3, 480)\n MITransformations.add_translatetransform(contextTransformation, translatePoint)\n scaleXY = MIShapes.make_point(0.3333333, 0.3333333)\n MITransformations.add_scaletransform(contextTransformation, scaleXY)\n\n li1 = VideoLayerInstructions.new\n # li1.add_passthrulayerinstruction(track: track0)\n li1.add_transformlayerinstruction(track: track0,\n transformvalue: contextTransformation)\n li1.add_passthrulayerinstruction(track: track1)\n videoI1TimeRange = MovieTime.make_movie_timerange(start: timeZero,\n duration: twoSeconds)\n videoI1Command = CommandModule.make_addvideoinstruction(movieEditorObject,\n timerange: videoI1TimeRange,\n layerinstructions: li1)\n theCommands.add_command(videoI1Command)\n\n # IN2 [ T0PTLI, T1ORLI, T2PTLI ] for 2 seconds.\n li2 = VideoLayerInstructions.new\n videoI2TimeRange = MovieTime.make_movie_timerange(start: twoSeconds,\n duration: twoSeconds)\n li2.add_transformlayerinstruction(track: track0,\n transformvalue: contextTransformation)\n# li2.add_passthrulayerinstruction(track: track0)\n li2.add_opacityramplayerinstruction(track: track1,\n startopacityvalue: 1.0,\n endopacityvalue: 0.0,\n timerange: videoI2TimeRange)\n\n li2.add_passthrulayerinstruction(track: track2)\n videoI2Command = CommandModule.make_addvideoinstruction(movieEditorObject,\n timerange: videoI2TimeRange,\n layerinstructions: li2)\n theCommands.add_command(videoI2Command)\n\n # IN3 [ T0PTLI, T2PTLI ] for 2 seconds.\n li3 = VideoLayerInstructions.new\n li3.add_transformlayerinstruction(track: track0,\n transformvalue: contextTransformation)\n li3.add_passthrulayerinstruction(track: track2)\n videoI3TimeRange = MovieTime.make_movie_timerange(start: fourSeconds,\n duration: twoSeconds)\n videoI3Command = CommandModule.make_addvideoinstruction(movieEditorObject,\n timerange: videoI3TimeRange,\n layerinstructions: li3)\n theCommands.add_command(videoI3Command)\n\n # IN4 [ T0PTLI, T2CRLI, T1PTLI ] for 2 seconds.\n li4 = VideoLayerInstructions.new\n videoI4TimeRange = MovieTime.make_movie_timerange(start: sixSeconds,\n duration: twoSeconds)\n li4.add_transformlayerinstruction(track: track0,\n transformvalue: contextTransformation)\n startCropRect = MIShapes.make_rectangle(size: { width: 1280, height: 720 })\n endCropRect = MIShapes.make_rectangle(width: 16, height: 16,\n xloc: 623, yloc: 352)\n li4.add_croprectramplayerinstruction(track: track2,\n startcroprectvalue: startCropRect,\n endcroprectvalue: endCropRect,\n timerange: videoI4TimeRange)\n\n li4.add_passthrulayerinstruction(track: track1)\n videoI4Command = CommandModule.make_addvideoinstruction(movieEditorObject,\n timerange: videoI4TimeRange,\n layerinstructions: li4)\n theCommands.add_command(videoI4Command)\n\n # IN5 [ T0PTLI, T1PTLI ] for 2 seconds.\n li5 = VideoLayerInstructions.new\n li5.add_transformlayerinstruction(track: track0,\n transformvalue: contextTransformation)\n li5.add_passthrulayerinstruction(track: track1)\n eightSeconds = MovieTime.make_movietime(timevalue: 48000, timescale: 6000)\n videoI5TimeRange = MovieTime.make_movie_timerange(start: eightSeconds,\n duration: twoSeconds)\n videoI5Command = CommandModule.make_addvideoinstruction(movieEditorObject,\n timerange: videoI5TimeRange,\n layerinstructions: li5)\n theCommands.add_command(videoI5Command)\n\n # 3.6 Copy the composition map image to the image collection.\n imageIdentifier = SecureRandom.uuid\n addCompositionToImageCollection = CommandModule.make_assignimage_tocollection(\n movieEditorObject,\n identifier: imageIdentifier)\n theCommands.add_command(addCompositionToImageCollection)\n cleanupCommands.add_tocleanupcommands_removeimagefromcollection(\n imageIdentifier)\n\n # 3.7 Save the composition map image\n # First create an image exporter object and add it to the cleanup commands.\n compMapFileName = \"compositionmap03.jpg\"\n # exportPath = File.join($compareImageDir, compMapFileName)\n exportPath = File.join(Dir.tmpdir(), compMapFileName)\n exporterObject = theCommands.make_createexporter(exportPath,\n export_type: \"public.jpeg\",\n addtocleanup: false)\n cleanupCommands.add_tocleanupcommands_closeobject(exporterObject)\n addImageToExporterCommand = CommandModule.make_addimage_fromimagecollection(\n exporterObject,\n imageidentifier: imageIdentifier)\n theCommands.add_command(addImageToExporterCommand)\n exportCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportCommand)\n Smig.perform_commands(theCommands)\n\n # 3.8 Compare the composition map image with a previously generated one.\n # `open #{exportPath}`\n origFile = File.join($compareImageDir, compMapFileName)\n compareResult = AreImageFilesSame(origFile, exportPath, 0)\n unless compareResult\n fail \"3.8 Different image files: \" + origFile + \" and \" + tempFile\n end\n\n # 3.9 Export the video compostion.\n theCommands.clear\n movieFileName = \"videowithinstructions.mp4\"\n movieExportPath = File.join(Dir.tmpdir(), movieFileName)\n # movieExportPath = File.join(File.expand_path(\"~/Desktop\"), movieFileName)\n fileType = \"public.mpeg-4\"\n exportMovieCommand = CommandModule.make_movieeditor_export(\n movieEditorObject,\n exportpreset: :AVAssetExportPreset1280x720,\n exportfilepath: movieExportPath,\n exportfiletype: fileType)\n theCommands.add_command(exportMovieCommand)\n Smig.perform_commands(theCommands)\n \n theCommands.clear\n \n # 3.10 Import the exported movie and check movie length and size.\n movieImporter2 = theCommands.make_createmovieimporter(movieExportPath,\n addtocleanup: false)\n cleanupCommands.add_tocleanupcommands_closeobject(movieImporter2)\n getMovieTrackPropertiesCommand = CommandModule.make_get_objectproperties(\n movieImporter2)\n theTrack = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n\n getMovieTrackPropertiesCommand.add_option(key: :track, value: theTrack)\n theCommands.add_command(getMovieTrackPropertiesCommand)\n theResult = Smig.perform_commands(theCommands)\n origResult = JSON.parse('{\"naturalsize\":{\"width\":1280,\"height\":720},'\\\n '\"minframeduration\":{\"flags\":1,\"value\":3002,\"timescale\":90000,\"epoch\":0},'\\\n '\"mediatype\":\"vide\",\"timerange\":{\"start\":{\"flags\":1,\"value\":0,\"timescale\":'\\\n '90000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":900600,\"timescale\":90000,'\\\n '\"epoch\":0}},\"trackid\":1,\"languagecode\":\"und\",\"languagetag\":\"\",'\\\n '\"affinetransform\":{\"m12\":0,\"m21\":0,\"m22\":1,\"tY\":0,\"m11\":1,\"tX\":'\\\n '0},\"requiresframereordering\":true,\"trackenabled\":true,\"framerate\":29.98001}')\n newResult = JSON.parse(theResult)\n unless origResult[\"naturalsize\"][\"width\"].eql?(newResult[\"naturalsize\"][\"width\"]) &&\n origResult[\"timerange\"][\"duration\"][\"value\"].eql?(newResult[\"timerange\"][\"duration\"][\"value\"])\n fail \"3.10 Different track properties: #{theResult}\"\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n ensure\n Smig.perform_commands(cleanupCommands)\n FileUtils.rm_f(exportPath) unless exportPath.nil?\n FileUtils.rm_f(movieExportPath) unless movieExportPath.nil?\n # `open #{movieExportPath}` unless movieExportPath.nil?\n end\nend",
"title": ""
},
{
"docid": "0e2ac773c5280fcdb92b5b08abcf6e60",
"score": "0.55218107",
"text": "def test_addFrame_notSelf\n\t\timage1 = loadImage './test/pizza/background/background.gif'\n\t\timage2 = loadImage './test/pizza/background/background.gif'\n\t\timage1.addFrame image2\n\tend",
"title": ""
},
{
"docid": "6ad0dabc7e155d21ca072611ec1eb456",
"score": "0.54949903",
"text": "def put_into_frame\n # We have to rotate the screenshot, since the offset information is for portrait\n # only. Instead of doing the calculations ourselves, it's much easier to let\n # imagemagick do the hard lifting for landscape screenshots\n rotation = self.rotation_for_device_orientation\n frame.rotate(-rotation)\n @image.rotate(-rotation)\n\n # Debug Mode: Add filename to frame\n if self.debug_mode\n filename = File.basename(@frame_path, \".*\")\n filename.sub!('Apple', '') # remove 'Apple'\n\n width = screenshot.size[0]\n font_size = width / 20 # magic number that works well\n\n offset_top = offset['offset'].split(\"+\")[2].to_f\n annotate_offset = \"+0+#{offset_top}\" # magic number that works semi well\n\n frame.combine_options do |c|\n c.gravity('North')\n c.undercolor('#00000080')\n c.fill('white')\n c.pointsize(font_size)\n c.annotate(annotate_offset.to_s, filename.to_s)\n end\n end\n\n @image = frame.composite(image, \"png\") do |c|\n c.compose(\"DstOver\")\n c.geometry(offset['offset'])\n end\n\n # Revert the rotation from above\n frame.rotate(rotation)\n @image.rotate(rotation)\n end",
"title": ""
},
{
"docid": "45d82138c21af12e2af04931ad2d4a02",
"score": "0.54928285",
"text": "def capture_frame(timecode, output_file = nil)\n t = calculate_time(timecode)\n unless output_file\n output_file = \"#{TEMP_PATH}/#{File.basename(@full_filename, \".*\")}-#{timecode.gsub(\"%\",\"p\")}.jpg\"\n end\n # do the work\n # mplayer $input_file$ -ss $start_time$ -frames 1 -vo jpeg -o $output_file$\n # ffmpeg -i $input_file$ -v nopb -ss $start_time$ -b $bitrate$ -an -vframes 1 -y $output_file$\n command = \"ffmpeg -i #{@full_filename} -ss #{t} -t 00:00:01 -r 1 -vframes 1 -f image2 #{output_file}\"\n Transcoder.logger.info(\"\\nCreating Screenshot: #{command}\\n\")\n frame_result = `#{command} 2>&1`\n Transcoder.logger.info(\"\\nScreenshot results: #{frame_result}\")\n output_file\n end",
"title": ""
},
{
"docid": "560d10a69fd8d8c8f91829cea173c7a0",
"score": "0.5457766",
"text": "def obter_evidencia\n caminho_pasta = \"result/screenshots\"\n FileUtils.mkdir_p caminho_pasta unless checar_pasta_existe(caminho_pasta)\n nome_arquivo = SecureRandom.urlsafe_base64\n $screenshot = \"#{caminho_pasta}/#{nome_arquivo}.png\"\n page.save_screenshot($screenshot)\n attach(File.read($screenshot), 'image/png')\nend",
"title": ""
},
{
"docid": "1623e142326cc1d25c6034e50edb23c9",
"score": "0.5397339",
"text": "def frames; end",
"title": ""
},
{
"docid": "1623e142326cc1d25c6034e50edb23c9",
"score": "0.5397339",
"text": "def frames; end",
"title": ""
},
{
"docid": "aaa7c3caf308495a17f273d212e7f1be",
"score": "0.5389048",
"text": "def process(do_forking = true)\r\n parent = movie\r\n original = parent.full_filename\r\n bare_name = basename(parent.filename)\r\n pos = original.rindex('.')\r\n if pos>0\r\n path_and_name_without_extension = original[0...pos]\r\n else\r\n path_and_name_without_extension = original\r\n end\r\n if RUBY_PLATFORM =~ /(:?mswin|mingw)/\r\n inspected_movie = nil\r\n width = 400\r\n height = 300\r\n else\r\n require 'rvideo'\r\n inspected_movie = RVideo::Inspector.new(:file => original)\r\n width = inspected_movie.width\r\n height = inspected_movie.height\r\n end\r\n if Video.generate_thumbnails(inspected_movie, width, height, original, path_and_name_without_extension)\r\n Movie.create(:content_type => 'image/jpeg', :filename => \"#{bare_name}_compact.jpg\", :parent_id => parent.id, :thumbnail => 'compact', :size => File.size(\"#{path_and_name_without_extension}_compact.jpg\"), :width => 96, :height => 96) if File.exists?(\"#{path_and_name_without_extension}_compact.jpg\")\r\n Movie.create(:content_type => 'image/jpeg', :filename => \"#{bare_name}_thumb.jpg\", :parent_id => parent.id, :thumbnail => 'thumb', :size => File.size(\"#{path_and_name_without_extension}_thumb.jpg\"), :width => 120, :height => 120) if File.exists?(\"#{path_and_name_without_extension}_thumb.jpg\")\r\n Movie.create(:content_type => 'image/jpeg', :filename => \"#{bare_name}_preview.jpg\", :parent_id => parent.id, :thumbnail => 'preview', :size => File.size(\"#{path_and_name_without_extension}_preview.jpg\"), :width => width, :height => height) if File.exists?(\"#{path_and_name_without_extension}_preview.jpg\") \r\n high_res_movie = Movie.create :content_type => 'video/x-flv', :filename => \"#{bare_name}_high.flv\", :parent_id => parent.id, :thumbnail => 'high', :size => 0, :width => width, :height => height, :status => 0\r\n # low_res_movie = Movie.create :content_type => 'video/x-flv', :filename => \"#{bare_name}_low.flv\", :parent_id => parent.id, :thumbnail => 'low', :size => 0, :width => 200, :height => 150, :status => status\r\n high_res_movie_id = high_res_movie.id \r\n # low_res_movie_id = low_res_movie.id\r\n background_process(do_forking) do\r\n Video.convert_to_flash_format(inspected_movie, original, path_and_name_without_extension)\r\n high_res_movie = Movie.find(high_res_movie_id)\r\n # low_res_movie = Movie.find(low_res_movie_id)\r\n high_res_movie.size = File.size(\"#{path_and_name_without_extension}_high.flv\") if File.exists? \"#{path_and_name_without_extension}_high.flv\"\r\n # low_res_movie.size = File.size(\"#{path_and_name_without_extension}_low.flv\") if File.exists? \"#{path_and_name_without_extension}_low.flv\"\r\n high_res_movie.status = 1\r\n high_res_movie.save\r\n # low_res_movie.status = 1\r\n # low_res_movie.save\r\n end\r\n end \r\n end",
"title": ""
},
{
"docid": "893d6998ba2423ff67d6065e642c69b2",
"score": "0.53739595",
"text": "def create_screenshot\n material_path = material.file.file\n movie = ScreenshotService.new(material_path, 10).perform\n update_attribute(:screenshot, File.open(movie.path))\n end",
"title": ""
},
{
"docid": "3d2e04281eae9b9db9e44fd9dc4654f1",
"score": "0.53594035",
"text": "def make_preview(name, frames, start_at = 0)\n old_gif = Magick::Image.read(\"output/#{name}.gif\")\n new_gif = Magick::ImageList.new\n (start_at..start_at + frames).to_a.each do |frame_number|\n new_gif << old_gif[frame_number]\n end\n output_dest = \"output/#{name}-preview.gif\"\n new_gif.write(output_dest)\n puts \"wrote preview to #{output_dest}\" unless @options[:quiet]\n end",
"title": ""
},
{
"docid": "a40e09703ba0253736c9ceb2d50e4909",
"score": "0.53523016",
"text": "def test01()\n importTypes = \"public.jpeg public.png com.compuserve.gif public.jpeg-2000 com.canon.tif-raw-image com.adobe.raw-image com.dxo.raw-image com.canon.cr2-raw-image com.leafamerica.raw-image com.hasselblad.fff-raw-image com.hasselblad.3fr-raw-image com.nikon.raw-image com.nikon.nrw-raw-image com.pentax.raw-image com.samsung.raw-image com.sony.raw-image com.sony.sr2-raw-image com.sony.arw-raw-image com.epson.raw-image com.kodak.raw-image public.tiff com.apple.icns com.canon.crw-raw-image com.fuji.raw-image com.panasonic.raw-image com.panasonic.rw2-raw-image com.leica.raw-image com.leica.rwl-raw-image com.konicaminolta.raw-image com.olympus.sr-raw-image com.olympus.or-raw-image com.olympus.raw-image com.adobe.photoshop-image com.microsoft.ico com.microsoft.bmp com.microsoft.cur com.truevision.tga-image com.sgi.sgi-image com.apple.macpaint-image com.ilm.openexr-image public.radiance public.mpo-image public.pbm public.pvr org.khronos.astc org.khronos.ktx com.apple.rjpeg com.apple.pict com.apple.quicktime-image com.kodak.flashpix-image\"\n\n exportTypes = \"public.jpeg public.png com.compuserve.gif public.jpeg-2000 public.tiff com.apple.icns com.adobe.photoshop-image com.adobe.pdf com.microsoft.ico com.microsoft.bmp com.truevision.tga-image com.sgi.sgi-image com.ilm.openexr-image public.pbm public.pvr org.khronos.astc org.khronos.ktx com.apple.rjpeg\"\n\n begin\n result = MIMeta.listimageimporttypes\n if result != importTypes\n puts \"MIMeta.listimageimporttypes return #{result}\"\n end\n\n result = MIMeta.listimageexporttypes\n if result != exportTypes\n puts \"MIMeta.listimageexporttypes return #{result}\"\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend",
"title": ""
},
{
"docid": "5b92b3bcd47b2a2a767b8716b34cbaed",
"score": "0.5343134",
"text": "def make_createvideoframeswriter(movieFilePath,\n addtocleanup: true,\n utifiletype: :\"com.apple.quicktime-movie\",\n name: nil,\n pathsubstitutionkey: nil)\n theName = SecureRandom.uuid if name.nil?\n theName = name unless name.nil?\n videoWriterObject = SmigIDHash.make_objectid(objectname: theName,\n objecttype: :videoframeswriter)\n createWriter = CommandModule.make_createvideoframeswriter(movieFilePath,\n utifiletype: utifiletype,\n name: theName,\n pathsubstitutionkey: pathsubstitutionkey)\n self.add_command(createWriter)\n if addtocleanup\n self.add_tocleanupcommands_closeobject(videoWriterObject)\n end\n videoWriterObject\n end",
"title": ""
},
{
"docid": "8c3f4f52d83e2e5ea215d8466951588d",
"score": "0.53160477",
"text": "def dumpData()\n puts \"Frame data dumping starts\"\n deleteRawDataFiles\n dumpFramedata \nend",
"title": ""
},
{
"docid": "fc541903a850da7657747daacb5bc046",
"score": "0.5314555",
"text": "def convert_video_to_png_using_animated()\n Utils.ffmpeg(\n in_f: @source_file_path,\n in_p: [\n '-ss',10, # seek to input position\n '-t',20, # max seconds\n ],\n out_f: @destination_file_path,\n out_p: [\n '-vf','fps=5,scale=120:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse',\n '-loop',0,\n '-f','gif'\n ])\n end",
"title": ""
},
{
"docid": "5c230e5e094277326e3238663fe7bf6d",
"score": "0.53063905",
"text": "def export_to_images\n model = Sketchup.active_model\n view = model.active_view\n # Check if animation record is not empty.\n unless active_data_valid?\n ::UI.messagebox(\"Nothing to export!\")\n return false\n end\n # Display options input box.\n prompts = ['Start Frame', 'End Frame', 'Speed (0.01 - 10000)', 'Reverse', 'Image Type', 'Resolution', 'Anti-alias', 'Compression', 'Transparent Background ', 'Replay Groups', 'Replay Materials', 'Replay Layers', 'Replay Camera', 'Replay Render', 'Replay Shadow']\n yn = 'Yes|No'\n image_types = 'bmp|jpg|png|tif'\n res = 'Model-Inherited|Custom|320x240|640x480|768x576|800x600|1024x768|1280x720|1280x1024|1920x1080'\n compression = '0.0|0.1|0.2|0.3|0.4|0.5|0.6|0.7|0.8|0.9|1.0'\n drop_downs = ['', '', '', yn, image_types, res, yn, compression, yn, yn, yn, yn, yn, yn, yn]\n values = [@start_frame, @end_frame, @image_defaults[:speed], @image_defaults[:reversed], @image_defaults[:image_type], @image_defaults[:resolution], @image_defaults[:antialias], @image_defaults[:compression], @image_defaults[:tbackground], @replay_groups ? 'Yes' : 'No', @replay_materials ? 'Yes' : 'No', @replay_layers ? 'Yes' : 'No', @replay_camera ? 'Yes' : 'No', @replay_render ? 'Yes' : 'No', @replay_shadow ? 'Yes' : 'No']\n results = ::UI.inputbox(prompts, values, drop_downs, 'Export Animation Options')\n return false unless results\n # Display Custom resolution input box if desired.\n if results[5] == 'Custom'\n results2 = ::UI.inputbox(['Width', 'Height'], [800, 600], 'Use Custom Resolution')\n return false unless results2\n w = AMS.clamp(results2[0].to_i, 1, 16000)\n h = AMS.clamp(results2[1].to_i, 1, 16000)\n results[5] = \"#{w}x#{h}\"\n end\n # Select export path\n model_fname = File.basename(model.path, '.skp')\n model_fname = \"msp_anim\" if model_fname.empty?\n script_file = ::UI.savepanel('Choose Export Directory and Name', nil, model_fname)\n return false unless script_file\n fpath = File.dirname(script_file)\n fpath.force_encoding('UTF-8') unless AMS::IS_RUBY_VERSION_18\n fname = File.basename(script_file, '.skp')\n # Preset user data\n sframe = results[0].to_i\n eframe = results[1].to_i\n speed = AMS.clamp(results[2].to_f, 0.01, 10000)\n reversed = results[3] == 'Yes'\n opts = {}\n if results[5] != 'Model-Inherited'\n wh = results[5].split('x')\n opts[:width] = wh[0].to_i\n opts[:height] = wh[1].to_i\n end\n opts[:antialias] = results[6] == 'Yes'\n opts[:compression] = results[7].to_f\n opts[:transparent] = results[8] == 'Yes'\n orig_rep_grp = @replay_groups\n orig_rep_mat = @replay_materials\n orig_rep_lay = @replay_layers\n orig_rep_cam = @replay_camera\n orig_rep_ren = @replay_render\n orig_rep_sha = @replay_shadow\n @replay_groups = results[9] == 'Yes'\n @replay_materials = results[10] == 'Yes'\n @replay_layers = results[11] == 'Yes'\n @replay_camera = results[12] == 'Yes'\n @replay_render = results[13] == 'Yes'\n @replay_shadow = results[14] == 'Yes'\n # Save defaults\n @image_defaults[:speed] = speed.to_s\n @image_defaults[:reversed] = results[3]\n @image_defaults[:image_type] = results[4]\n @image_defaults[:resolution] = results[5]\n @image_defaults[:antialias] = results[6]\n @image_defaults[:compression] = results[7]\n @image_defaults[:tbackground] = results[8]\n # Export animation\n start_time = Time.now\n called_while_active = @active\n start(false) unless called_while_active\n pframe = reversed ? eframe : sframe\n rframe = pframe\n last_frame = nil\n count = 1\n babort = false\n if AMS::IS_PLATFORM_WINDOWS\n msg_caption = \"'#{AMS::Sketchup.get_caption}' - Animation Export\"\n AMS::Sketchup.threaded_messagebox(msg_caption, EXPORT_MESSAGE) { |result|\n babort = true\n }\n end\n while(rframe >= sframe && rframe <= eframe)\n break if babort\n # Export scene\n if rframe != last_frame\n activate_frame(rframe)\n last_frame = rframe\n end\n opts[:filename] = \"#{fpath}/#{fname}#{sprintf(\"%04d\", count)}.#{results[4]}\"\n view.write_image(opts)\n progress = (rframe - sframe) * 100 / (eframe - sframe).to_f\n Sketchup.set_status_text(\"Exporting MSPhysics Replay Animation Progress: #{rframe - sframe} / #{eframe - sframe} -- #{sprintf(\"%.2f\", progress)}%\", SB_PROMPT)\n pframe += reversed ? -speed : speed\n rframe = pframe.round\n count += 1\n end\n if AMS::IS_PLATFORM_WINDOWS\n hwnd = AMS::Sketchup.find_window_by_caption(msg_caption)\n AMS::Window.close(hwnd) if hwnd\n end\n reset unless called_while_active\n # Set original settings\n @replay_groups = orig_rep_grp\n @replay_materials = orig_rep_mat\n @replay_layers = orig_rep_lay\n @replay_camera = orig_rep_cam\n @replay_render = orig_rep_ren\n @replay_shadow = orig_rep_sha\n # Display results\n ::UI.messagebox(\"#{babort ? 'Stopped' : 'Finished'} exporting MSPhysics Replay Animation!\\n\\nExported #{count} frames in #{sprintf(\"%.2f\", Time.now - start_time)} seconds.\\n\\nYou may now dispose of replay data to reduce file size.\\n\\nYou may use Movie Maker, MakeAVI, or a similar tool to combine all images into a video file.\")\n # Return success\n true\n end",
"title": ""
},
{
"docid": "367df3a9e8f678b3227f6164a14e4bb0",
"score": "0.5292819",
"text": "def save_movie_as_mov(file_old, file_new)\n qt = OSA.app('QuickTime Player')\n begin\n qt.activate\n rescue RuntimeError\n system('open -a \"QuickTime Player\"')\n qt.activate\n end\n movie = qt.open(file_old).first\n puts movie.inspect\n movie.save_self_contained file_new\n qt.quit\nend",
"title": ""
},
{
"docid": "3105ed4b6073bb6e7ca82b6fa3a00c86",
"score": "0.5278312",
"text": "def test03()\n importerObjectID = nil\n bitmapObjectID = nil\n begin\n createImporterCommand = CommandModule.make_createimporter($imagefile,\n name: \"test005.test04\")\n importerRef = Smig.perform_command(createImporterCommand).to_i\n importerObjectID = SmigIDHash.make_objectid(objectreference: importerRef)\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n width: 1280, height: 1024, preset: :AlphaPreMulFirstRGB8bpcInt)\n bitmapRef = Smig.perform_command(createBitmapContextCommand).to_i\n bitmapObjectID = SmigIDHash.make_objectid(objectreference: bitmapRef)\n drawImageElement = MICGDrawing::MIDrawImageElement.new\n drawRect = MIShapes.make_rectangle(width: 1280, height: 1024)\n drawImageElement.destinationrectangle = drawRect\n drawImageElement.set_imagefile_imagesource(source_object: importerObjectID)\n drawImageElement.elementdebugname = \"test005.test03.drawimage\"\n drawImageCommand = CommandModule.make_drawelement(bitmapObjectID,\n drawinstructions: drawImageElement)\n Smig.perform_command(drawImageCommand)\n Smig.close_object(importerObjectID) unless importerObjectID.nil?\n Smig.close_object(bitmapObjectID) unless bitmapObjectID.nil?\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \"Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n ensure\n Smig.close_object_nothrow(importerObjectID) unless importerObjectID.nil?\n Smig.close_object_nothrow(bitmapObjectID) unless bitmapObjectID.nil?\n end\nend",
"title": ""
},
{
"docid": "6681c4528ad4d9f4ac70c86d25aac86e",
"score": "0.52663386",
"text": "def test02()\n movieEditorObject = nil\n begin\n theCommands = SmigCommands.new\n cleanupCommands = SmigCommands.new\n # 2.0 Create a movie editor object.\n movieEditorObject = theCommands.make_createmovieeditor(addtocleanup: false)\n\n cleanupCommands.add_tocleanupcommands_closeobject(movieEditorObject)\n # 2.1 Confirm that the number of movie editor objects is 1.\n getNumMovieEditorObjects = CommandModule.make_get_nonobjectproperty(\n property: :numberofobjects,\n type: :movieeditor)\n theCommands.add_command(getNumMovieEditorObjects)\n\n numObjects = Smig.perform_commands(theCommands)\n fail \"Number of movie editor objects should 1\" unless numObjects.eql?(\"1\")\n \n # 2.2 Add a video tracks.\n # Specify the track persistent id.\n theCommands = SmigCommands.new\n targetTrackID = 3\n addVideoTrack = CommandModule.make_createtrackcommand(movieEditorObject,\n mediatype: :vide,\n trackid: targetTrackID)\n theCommands.add_command(addVideoTrack)\n targetTID = MovieTrackIdentifier.make_movietrackid_from_persistenttrackid(\n targetTrackID)\n\n=begin\n # Leave track id unspecified and one will be assigned.\n addVideoTrack2 = CommandModule.make_createtrackcommand(movieEditorObject,\n mediatype: :vide)\n theCommands.add_command(addVideoTrack2)\n=end\n\n # 2.3 Confirm that there is one video tracks.\n getNumVideoTracks = CommandModule.make_get_objectproperty(movieEditorObject,\n property: :numberoftracks)\n getNumVideoTracks.add_option(key: :mediatype, value: :vide)\n theCommands.add_command(getNumVideoTracks)\n \n numTracks = Smig.perform_commands(theCommands)\n fail \"Number of video tracks should be 1 is #{numTracks}\" unless numTracks.eql?(\"1\")\n\n # 2.4 Add a movie segment\n theCommands = SmigCommands.new\n # First, we need to import a movie so that we have content to add.\n sourceMovie = File.join($directory, \"images/testinput-movingimages.mov\")\n movieImporter = theCommands.make_createmovieimporter(sourceMovie,\n addtocleanup: false)\n cleanupCommands.add_tocleanupcommands_closeobject(movieImporter)\n # Then specify that the content is from the first video track of importer\n sourceTrack = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n \n # Set up the insertion time, and the source time range.\n timeZero = MovieTime.make_movietime(timevalue: 0, timescale: 6000)\n duration = MovieTime.make_movietime(timevalue: 12000, timescale: 6000)\n sourceTimeRange = MovieTime.make_movie_timerange(start: timeZero,\n duration: duration)\n insertionTime = MovieTime.make_movietime(timevalue: 0, timescale: 6000)\n insertTrackSegmentCommand = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: targetTID,\n source_object: movieImporter,\n source_track: sourceTrack,\n insertiontime: insertionTime, \n source_timerange: sourceTimeRange)\n\n theCommands.add_command(insertTrackSegmentCommand)\n \n # 2.5 Create the get segment mappings command.\n getSegmentMappingsCommand = CommandModule.make_get_objectproperty(\n movieEditorObject,\n property: :tracksegmentmappings)\n getSegmentMappingsCommand.add_option(key: :track, value: targetTID)\n theCommands.add_command(getSegmentMappingsCommand)\n result = Smig.perform_commands(theCommands)\n expectedResult = '[{\"sourcetimerange\":{\"start\":{\"flags\":1,\"value\":0,'\\\n '\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":12000,\"timescale\"'\\\n ':6000,\"epoch\":0}},\"targettimerange\":{\"start\":{\"flags\":1,\"value\":0,'\\\n '\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":12000,'\\\n '\"timescale\":6000,\"epoch\":0}}}]'\n \n unless expectedResult.eql?(result)\n fail \"1. Segment mapping different from expected #{result}\"\n end\n\n # 2.6 Add an empty segment. This should push original segment later by 2 secs\n theCommands = SmigCommands.new\n emptySegmentTimeRange = MovieTime.make_movie_timerange(start: timeZero,\n duration: duration)\n insertEmptySegmentCommand = CommandModule.make_insertemptysegment(\n movieEditorObject,\n track: targetTID,\n insertiontimerange: emptySegmentTimeRange)\n theCommands.add_command(insertEmptySegmentCommand)\n theCommands.add_command(getSegmentMappingsCommand)\n result = Smig.perform_commands(theCommands)\n expectedResult = '[{\"sourcetimerange\":{\"start\":{\"flags\":1,\"value\":0,'\\\n '\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":12000,'\\\n '\"timescale\":6000,\"epoch\":0}},\"targettimerange\":{\"start\":{\"flags\":1,'\\\n '\"value\":12000,\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":'\\\n '12000,\"timescale\":6000,\"epoch\":0}}}]'\n \n unless expectedResult.eql?(result)\n fail \"2. Segment mapping different from expected #{result}\"\n end\n\n # 2.7 Add a second movie segment.\n theCommands = SmigCommands.new\n timeTwoSecsIn = MovieTime.make_movietime(timevalue: 12000, timescale: 6000)\n duration = MovieTime.make_movietime(timevalue: 12000, timescale: 6000)\n sourceTimeRange = MovieTime.make_movie_timerange(start: timeTwoSecsIn,\n duration: duration)\n insertionTime = timeZero\n insertTrackSegmentCommand = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: targetTID,\n source_object: movieImporter,\n source_track: sourceTrack,\n insertiontime: insertionTime, \n source_timerange: sourceTimeRange)\n\n theCommands.add_command(insertTrackSegmentCommand)\n # 2.8 Add a get segments mapping command.\n theCommands.add_command(getSegmentMappingsCommand)\n result = Smig.perform_commands(theCommands)\n expectedResult = '[{\"sourcetimerange\":{\"start\":{\"flags\":1,\"value\":12000,'\\\n '\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":12000,'\\\n '\"timescale\":6000,\"epoch\":0}},\"targettimerange\":{\"start\":{\"flags\":1,'\\\n '\"value\":0,\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":12000,'\\\n '\"timescale\":6000,\"epoch\":0}}},{\"sourcetimerange\":{\"start\":{\"flags\":1,'\\\n '\"value\":0,\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":12000'\\\n ',\"timescale\":6000,\"epoch\":0}},\"targettimerange\":{\"start\":{\"flags\":1,'\\\n '\"value\":24000,\"timescale\":6000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\"'\\\n ':12000,\"timescale\":6000,\"epoch\":0}}}]'\n unless expectedResult.eql?(result)\n fail \"3. Segment mapping different from expected #{result}\"\n end\n\n # 2.9 Add a single passthru layer instruction to cover length of video track.\n theCommands = SmigCommands.new\n sixSeconds = MovieTime.make_movietime(timevalue: 36000, timescale: 6000)\n\n instructionTimeRange = MovieTime.make_movie_timerange(start: timeZero,\n duration: sixSeconds)\n layerInstructions = VideoLayerInstructions.new\n layerInstructions.add_passthrulayerinstruction(track: targetTID)\n videoInstruction = CommandModule.make_addvideoinstruction(movieEditorObject,\n timerange: instructionTimeRange,\n layerinstructions: layerInstructions)\n theCommands.add_command(videoInstruction)\n # 2.10 Copy the composition map image to the image collection.\n imageIdentifier = SecureRandom.uuid\n addCompositionToImageCollection = CommandModule.make_assignimage_tocollection(\n movieEditorObject,\n identifier: imageIdentifier)\n theCommands.add_command(addCompositionToImageCollection)\n cleanupCommands.add_tocleanupcommands_removeimagefromcollection(imageIdentifier)\n # 2.11 Save the composition map image\n # First create an image exporter object and add it to the cleanup commands.\n compMapFileName = \"compositionmap.jpg\"\n exportPath = File.join(Dir.tmpdir(), compMapFileName)\n # exportPath = File.join($compareImageDir, compMapFileName)\n exporterObject = theCommands.make_createexporter(exportPath,\n export_type: \"public.jpeg\",\n addtocleanup: false)\n cleanupCommands.add_tocleanupcommands_closeobject(exporterObject)\n addImageToExporterCommand = CommandModule.make_addimage_fromimagecollection(\n exporterObject, imageidentifier: imageIdentifier)\n theCommands.add_command(addImageToExporterCommand)\n exportCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportCommand)\n Smig.perform_commands(theCommands)\n # `open #{exportPath}`\n origFile = File.join($compareImageDir, compMapFileName)\n compareResult = AreImageFilesSame(origFile, exportPath, 0)\n unless compareResult\n # 2.12 Report if different.\n fail \"2.12 Different image files: \" + origFile + \" and \" + tempFile\n end\n\n # 2.13 Export the movie composition.\n theCommands.clear\n movieFileName = \"videowithemptysegment.mov\"\n movieExportPath = File.join(Dir.tmpdir(), movieFileName)\n fileType = \"com.apple.quicktime-movie\"\n exportMovieCommand = CommandModule.make_movieeditor_export(movieEditorObject,\n exportpreset: :AVAssetExportPreset1280x720,\n exportfilepath: movieExportPath,\n exportfiletype: fileType)\n theCommands.add_command(exportMovieCommand)\n Smig.perform_commands(theCommands)\n theCommands.clear\n \n # 2.14 Now import the movie so that we can check the video track properties.\n movieImporter2 = theCommands.make_createmovieimporter(movieExportPath,\n addtocleanup: false)\n cleanupCommands.add_tocleanupcommands_closeobject(movieImporter2)\n getMovieTrackPropertiesCommand = CommandModule.make_get_objectproperties(\n movieImporter2)\n theTrack = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n\n getMovieTrackPropertiesCommand.add_option(key: :track, value: theTrack)\n theCommands.add_command(getMovieTrackPropertiesCommand)\n theResult = Smig.perform_commands(theCommands)\n origResult = JSON.parse('{\"naturalsize\":{\"width\":1280,\"height\":720},'\\\n '\"minframeduration\":{\"flags\":1,\"value\":3002,\"timescale\":90000,\"epoch\":0},'\\\n '\"mediatype\":\"vide\",\"timerange\":{\"start\":{\"flags\":1,\"value\":0,\"timescale\":'\\\n '90000,\"epoch\":0},\"duration\":{\"flags\":1,\"value\":540360,\"timescale\":90000'\\\n ',\"epoch\":0}},\"trackid\":1,\"languagecode\":\"und\",\"languagetag\":\"\",'\\\n '\"affinetransform\":{\"m12\":0,\"m21\":0,\"m22\":1,\"tY\":0,\"m11\":1,\"tX\":'\\\n '0},\"requiresframereordering\":true,\"trackenabled\":true,\"framerate\":29.98001}')\n newResult = JSON.parse(theResult)\n # puts \"#{origResult}\"\n # puts \"#{newResult}\"\n unless origResult[\"naturalsize\"][\"width\"].eql?(newResult[\"naturalsize\"][\"width\"]) &&\n origResult[\"timerange\"][\"duration\"][\"value\"].eql?(newResult[\"timerange\"][\"duration\"][\"value\"])\n fail \"2.14 Different track properties: #{theResult}\"\n end\n # puts theResult\n \n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n ensure\n Smig.perform_commands(cleanupCommands)\n FileUtils.rm_f(exportPath) unless exportPath.nil?\n FileUtils.rm_f(movieExportPath) unless movieExportPath.nil?\n # `open #{movieExportPath}` unless movieExportPath.nil?\n end\nend",
"title": ""
},
{
"docid": "d13c7bbe1506b37c34194510c3171d2b",
"score": "0.52612764",
"text": "def extractImages\n cmd = Poplib::Cmd.new(FFMPEG_EXT_CMD_FMT % [@movie_path, @interval.to_f/100.0, @tmpdir])\n puts \" extracting images: %s\" % cmd.cmdstr\n tcmd = \"mp4info %s\" % @movie_path\n begin\n totalf = (`#{tcmd}`.match(/([0-9]+\\.[0-9]+) sec/)[1].to_f)/10\n rescue => e\n puts e.backtrace.join \"\\n\"\n puts \"RESCUING, Carry on my son...\"\n totalf = 1.0\n end\n progthread = Thread.new{\n out = $stdout.clone\n ostr = ''\n cnt = 0\n idx = -2\n while true\n cnt = Dir.entries(@tmpdir).count - 2\n percent = ((cnt.to_f/totalf.to_f)*100).to_i\n bstr = \"\\b\" * ostr.length\n out.print bstr\n perstr = '=' * 50\n (percent == 0) ? x = 0 : x = percent/2\n perstr.insert x, (\"<[%s%%]>\" % percent.to_s)\n if cnt > 0 and idx > 0\n r = cnt.to_f/idx.to_f\n x = ((totalf.to_f/r) - idx.to_f).to_i\n else\n x = 0\n r = 0.0\n end\n ostr = \"%s of %s: [%s] ~%s (%.2f imgs/sec)\" % [cnt, totalf, perstr, Time.at(x).gmtime.strftime('%R:%S'), r] \n out.print ostr\n sleep 1\n idx += 1\n end\n }\n sleep 3\n cmd.runBig\n progthread.kill\n puts \"\\n extraction complete.\"\n end",
"title": ""
},
{
"docid": "d12c020be2e03c0a76afff4e12f5f292",
"score": "0.5224249",
"text": "def process_visuals(movie)\n visuals = movie.visual_sequence.sort\n visuals.each {|visual|\n if(visual.type == \"video\")\n @video_tool.trim_video(movie, visual)\n elsif(visual.type == \"image\")\n @video_tool.create_video_from_image(movie, visual)\n elsif(visual.type == \"blackness\")\n @video_tool.create_black_video(movie, visual)\n end\n }\n sequence = VisualSequence.new\n sequence.visuals = visuals\n movie.visual_sequence = sequence\n end",
"title": ""
},
{
"docid": "937a5ddeca88e738440f31b1003ad9f5",
"score": "0.5204226",
"text": "def convert_frames\n MiniMagick.configure do |config|\n config.validate_on_create = false\n end\n\n Dir[\"#{templates_path}/**/*.psd\"].each do |psd|\n resulting_path = psd.gsub('.psd', '.png')\n next if File.exist?(resulting_path)\n\n UI.important \"Converting PSD file '#{psd}'\"\n image = MiniMagick::Image.open(psd)\n if image\n image.format 'png'\n image.trim\n\n image.write(resulting_path)\n else\n UI.error \"Could not parse PSD file at path '#{psd}'\"\n end\n end\n end",
"title": ""
},
{
"docid": "fca353ce30098374b56e31ea81f3cefc",
"score": "0.51862824",
"text": "def foreground_extraction_png (remake_id, scene_id)\n\t# Fetching the remake for this footage\n\tremakes = settings.db.collection(\"Remakes\")\n\tremake = remakes.find_one(remake_id)\n\tstory = settings.db.collection(\"Stories\").find_one(remake[\"story_id\"])\n\n\tlogger.info \"Running foreground extraction for scene \" + scene_id.to_s + \" for remkae \" + remake_id.to_s\n\n\t# Updating the status of this footage to Processing\n\tresult = remakes.update({_id: remake_id, \"footages.scene_id\" => scene_id}, {\"$set\" => {\"footages.$.status\" => FootageStatus::Processing}})\n\tlogger.info \"Footage status updated to Processing (2) for remake <\" + remake_id.to_s + \">, footage <\" + scene_id.to_s + \">\"\n\t#logger.debug \"DB Result: \" + result.to_s\n\n\t# Creating a new directory for the foreground extraction\n\tforeground_folder = settings.remakes_folder + remake_id.to_s + \"_scene_\" + scene_id.to_s + \"/\"\n\tFileUtils.mkdir foreground_folder\n\n\t# Downloading the raw video from s3\n\traw_video_s3_key = remake[\"footages\"][scene_id - 1][\"raw_video_s3_key\"]\n\traw_video_file_name = File.basename(raw_video_s3_key)\n\traw_video_file_path = foreground_folder + raw_video_file_name\t\n\tdownload_from_s3 raw_video_s3_key, raw_video_file_path\n\n\t# images from the video\n\timages_fodler = foreground_folder + \"Images/\"\n\tffmpeg_command = settings.ffmpeg_path + ' -i \"' + raw_video_file_path + '\" -r 25 -q:v 1 \"' + images_fodler + 'Image-%4d.jpg\"'\n\tlogger.info \"*** Video to images *** \\n\" + ffmpeg_command\n\tFileUtils.mkdir images_fodler\n\tsystem(ffmpeg_command)\n\n\t# foreground extraction algorithm\n\tif remake[\"resolution\"] then\n\t\tcontour_path = story[\"scenes\"][scene_id - 1][\"contours\"][remake[\"resolution\"]][\"contour\"]\n\telse\n\t\tcontour_path = story[\"scenes\"][scene_id - 1][\"contour\"]\n\tend\n\t#roi_path = story[\"scenes\"][scene_id - 1][\"ebox\"]\n\troi_path = settings.roi_path\n\tfirst_image_path = images_fodler + \"Image-0001.jpg\"\n\toutput_folder = File.dirname(raw_video_file_path) + \"/\" + File.basename(raw_video_file_path, \".*\") + \"_Foreground/\"\n\toutput_path = output_folder + \"Output\"\n\talgo_command = settings.algo_path + ' -CA \"' + contour_path + '\" \"' + roi_path + '\" \"' + first_image_path + '\" -png \"' + output_path + '\"'\n\tlogger.info \"*** Running Algo *** \\n\" + algo_command \n\tFileUtils.mkdir output_folder\n\tsystem(algo_command)\n\n\t# pngs to video\n\toutput_file_name = \"foreground_\" + \"scene_\" + scene_id.to_s + \".mov\"\n\toutput_video_path = File.dirname(raw_video_file_path) + \"/\" + output_file_name\n\tpng_convert_command = settings.ffmpeg_path + ' -i \"' + output_path.chomp(File.extname(output_path)) + '-%2d.png\"' + ' -vcodec png \"' + output_video_path + '\"'\n\tlogger.info \"*** png to video *** \\n\" + png_convert_command\n\tsystem(png_convert_command)\n\n\t# Adding audio to video\n\toutput_with_audio_path = File.dirname(raw_video_file_path) + \"/\" + \"audio_foreground_scene\" + scene_id.to_s + \".mov\"\n\tadd_audio_command = settings.ffmpeg_path + ' -i \"' + raw_video_file_path + '\" -i \"' + output_video_path + '\" -c copy -map 0:1 -map 1:0 \"' + output_with_audio_path + '\"'\n\tlogger.info \"*** audio to video *** \\n\" + add_audio_command\n\tsystem(add_audio_command)\n\n\t# upload to s3\n\tprocessed_video_s3_key = remake[\"footages\"][scene_id - 1][\"processed_video_s3_key\"]\n\tupload_to_s3 output_with_audio_path, processed_video_s3_key, :private\n\n\t#remake[\"footages\"][scene_id - 1][:processed] = output_with_audio_path\n\n\t# Updating the status of this footage to Ready\n\tresult = remakes.update({_id: remake_id, \"footages.scene_id\" => scene_id}, {\"$set\" => {\"footages.$.status\" => FootageStatus::Ready}})\n\tlogger.info \"Footage status updated to Ready (3) for remake <\" + remake_id.to_s + \">, footage <\" + scene_id.to_s + \">\"\n\t#logger.debug \"DB Result: \" + result.to_s\n\n\t# Deleting the folder after everything was updated successfully\n\t#FileUtils.remove_dir(foreground_folder)\nend",
"title": ""
},
{
"docid": "e791be508e75a4ae0d0c6e7aa2bdea0a",
"score": "0.516908",
"text": "def nextFrame(view)\n # calculate camera position of current frame\n # eye, target, up = method(@anim.trajectory.to_sym).call(\n # @anim.eye, @anim.target, @anim.up, @anim.params, @ifrm)\n if @ifrm != 0\n # calculate trajectory\n eye, target, up = trajcalc(@anim, @ifrm)\n # check intersection\n return false if intersected?(view.model, view.camera.eye, eye)\n # set new position of camera\n view.camera.set(eye, target, up)\n else\n # initialize camera\n view.camera.set(@anim.eye, @anim.target, @anim.up)\n end\n # write image\n view.write_image(\n File.join(@anim.path, \"%03d.jpg\" % @ifrm),\n IMRESX, IMRESY, ANTIALIAS, IMQUALITY)\n # update frame counter\n @ifrm += 1\n # if reach maximum frame quantity, stop\n return @ifrm < MAXFRAME \n end",
"title": ""
},
{
"docid": "ff42a5dabe9928beadc99b77e813d416",
"score": "0.516436",
"text": "def load_frames\n File.open(RubyCrc::FRAMES_OUT, \"r\") do |f|\n f.each_line do |line|\n @buffered_frames << line.chomp unless line.empty?\n # @buffered_frames << line unless line.empty?\n end\n end\n end",
"title": ""
},
{
"docid": "b285ecb9ada8abdc207fdd4557a73b6b",
"score": "0.5155387",
"text": "def write_timestamp\n\n puts \"Writing timestamps...\"\n\n # Write timestamp output dir\n timestamp_dir = \"#{IMG_DIR}/timestamp\"\n Dir.mkdir(timestamp_dir) unless Dir.exist?(timestamp_dir)\n\n # Get all the screenshots of the URL\n screenshots = Dir.glob(\"#{IMG_DIR}/*.png\").sort\n screenshots_total = screenshots.size\n\n # Iterate over the screenshots\n screenshots.each_with_index do |screenshot, index|\n # Extract date from filename\n date = screenshot.split('_')[1].split('.')[0]\n year = date[0..3]\n month = date[4..5]\n day = date[6..7]\n hour = date[8..9]\n minutes = date[10..11]\n seconds = date[12..13]\n puts \"#{index+1}/#{screenshots_total}: #{day}/#{month}/#{year} - #{hour}:#{minutes}\"\n\n timestamp = \"\\'#{day}/#{month}/#{year}\\'\"\n timestamp_with_hour = \"\\'#{day}/#{month}/#{year} - #{hour}:#{minutes}\\'\"\n\n # Write timestamp and crop image for 720p video\n img = MiniMagick::Image.open(screenshot)\n img.resize \"#{VIDEO_WIDTH}x\"\n img.crop \"0x720+0+0\"\n img.combine_options do |i|\n i.fill \"black\"\n i.stroke \"black\"\n i.strokewidth 1\n # top corner, top top, top-left !?! still have no clue...\n i.draw \"rectangle 1016,632 1232,688\"\n i.gravity \"Northeast\"\n i.fill \"white\"\n i.undercolor \"black\"\n i.stroke \"white\"\n i.strokewidth 1\n i.font \"Courier\"\n i.weight \"bold\"\n i.pointsize 32\n i.strokewidth 2\n i.draw \"text 60,650 #{timestamp}\"\n end\n\n img.write(timestamp_dir + \"/\" + screenshot.split('/')[-1].split('.')[0] + \".png\")\n\n end\n\nend",
"title": ""
},
{
"docid": "6d6f9e47feccc954ec1e6a0136b5d317",
"score": "0.5148932",
"text": "def save_movie \n\t\treturn false unless Movie.file_usable?\n\t\tFile.open(@@filepath,'a') do |file|\n\t\t\tfile.puts \"#{[@name,@genre,@year, @imdb].join(\"\\t\")}\"\n\t\tend\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "f440cf8dce352152dc2f72025e20267e",
"score": "0.51335883",
"text": "def scan_strategy\n `ffmpeg -i #{@video_file} -f image2 -vf fps=fps=1/#{@interval} #{@shot_path}/%05d.png`\n end",
"title": ""
},
{
"docid": "ba27c97c8b6641d236397913339728f6",
"score": "0.51258445",
"text": "def process\n\t\t\textract_relevant_parts_of_video\n\t\t\tcreate_still_images\n\t\t\tcreate_animated_image\n\t\tend",
"title": ""
},
{
"docid": "f9aba5f83bb2a842ef5ae5b999c27cc7",
"score": "0.51075464",
"text": "def frames_to_record(frames)\n FFMpegCommand << \"-dframes #{frames}\"\n end",
"title": ""
},
{
"docid": "b6ec8486e006d47851e94fef39ecb865",
"score": "0.5101085",
"text": "def create_screenshot\n Rails.logger.debug \"Creating video screenshot #{current_path} #{file.inspect} ...\"\n\n cache_stored_file! if !cached?\n\n ffmpeg_bin = Rails.configuration.app['carrierwave']['ffmpeg_bin']\n input_path = current_path\n output_path = input_path.sub(/\\..+$/, '.jpg')\n\n FFMPEG.ffmpeg_binary = ffmpeg_bin\n FFMPEG.logger = Rails.logger\n\n movie = FFMPEG::Movie.new(input_path)\n\n dimension = movie.width > movie.height ? :width : :height\n movie.screenshot(output_path, {resolution: '300,300'}, {preserve_aspect_ratio: dimension})\n\n FileUtils.mv(output_path, input_path)\n\n # Need to change this from video so it gets set properly on S3\n file.content_type = 'image/jpeg'\n\n model.duration = movie.duration.round\n end",
"title": ""
},
{
"docid": "c0f03bae9545d72f6354ebb5916fcf4f",
"score": "0.5088932",
"text": "def preview(url)\n puts \"...in color? (yes/no)\"\n answer = gets.chomp.downcase\n num_frames = @gifm.frames.count\n frames = num_frames.times.map {|f| \"images/frame#{f}.jpg\"}\n if answer == \"yes\"\n frames.cycle.first(num_frames * 2).each do |frame|\n a = AsciiArt.new(frame)\n puts \"\\e[H\\e[2J\"\n puts a.to_ascii_art(color: true,\n width: 70)\n sleep 0.03\n end\n elsif answer == \"no\"\n frames.cycle.first(num_frames * 2).each do |frame|\n a = AsciiArt.new(frame)\n puts a.to_ascii_art\n end\n else\n preview(url)\n end\n delete_frames\n puts \"\\e[H\\e[2J\"\n browser_choice(url)\n end",
"title": ""
},
{
"docid": "24429e7466404f8d1d371bf8992085b3",
"score": "0.5064297",
"text": "def extract_cover!(offset=0.0)\n random_name = (0...8).map { (65 + rand(26)).chr }.join\n tmp_file = \"tmp/#{random_name}.jpg\"\n\n `ffmpeg -itsoffset -#{offset} -i '#{video_file.path}' -vframes 1 -an #{tmp_file}`\n\n # Attach output image as cover image\n File.open(tmp_file) do |f|\n self.cover_image = f\n save\n end\n end",
"title": ""
},
{
"docid": "a842f446453e367762ef045094f152a6",
"score": "0.5051657",
"text": "def png_data(frame)\n File.open(filename(frame), 'rb') { |f| f.read } if renderer.frame_exists?(frame)\n end",
"title": ""
},
{
"docid": "71a8a0331db8a2ab319fccd14a09ce17",
"score": "0.50502986",
"text": "def process_movie(src)\n return if @movie_dir !~ /\\w/\n return if src =~ /\\.nfo$/i\n return if src =~ /\\/subs$/i\n return if src =~ /\\.sample$/i\n return if not File.exists? src\n if $config[\"movies_directory\"][\"process\"] == true\n movie = Movie.new src \n movie.status = handle_movie_directory movie if movie.is_movie?\n end\nend",
"title": ""
},
{
"docid": "4bb90c70caddd08509beb12065a81bec",
"score": "0.5049997",
"text": "def make_videocomposition()\n # Constants\n instructionHash = {}\n begin\n setupCommands = SmigCommands.new\n movieImporter1 = setupCommands.make_createmovieimporter(\"~/DummyMovie.mov\",\n addtocleanup: false, \n pathsubstitutionkey: :movie1path)\n\n movieImporter2 = setupCommands.make_createmovieimporter(\"~/DummyMovie.mov\",\n addtocleanup: false, \n pathsubstitutionkey: :movie2path)\n\n # Create the movie editor where the video composition will happen.\n movieEditorObject = setupCommands.make_createmovieeditor(\n addtocleanup: false)\n\n addVideoTrackCommand = CommandModule.make_createtrackcommand(\n movieEditorObject,\n mediatype: :vide)\n\n # Create two video tracks using the addVideoTrackCommand.\n setupCommands.add_command(addVideoTrackCommand)\n setupCommands.add_command(addVideoTrackCommand)\n\n bitmapSize = MIShapes.make_size(800, 600)\n # Need the bitmap to render the video composition diagram to.\n bitmap = setupCommands.make_createbitmapcontext(\n size: bitmapSize,\n preset: :PlatformDefaultBitmapContext,\n addtocleanup: false,\n profile: :kCGColorSpaceGenericRGB)\n\n processCommands = SmigCommands.new\n processCommands.run_asynchronously = true\n\n finalImageID = SecureRandom.uuid\n\n assignImageToCollection = CommandModule.make_assignimage_tocollection(\n bitmap,\n identifier: finalImageID)\n\n track0 = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide,\n trackindex: 0)\n\n track1 = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide,\n trackindex: 1)\n\n timeZero = MovieTime.make_movietime(timevalue: 0, timescale: 1)\n inputDuration = MovieTime.make_movietime(timevalue: 10, timescale: 1)\n timeRange = MovieTime.make_movie_timerange(start: timeZero,\n duration: inputDuration)\n passThruDuration = MovieTime.make_movietime(timevalue:2, timescale:1)\n firstTansitionStartTime = MovieTime.make_movietime(timevalue:2, timescale:1)\n firstTransitionDuration = MovieTime.make_movietime_fromseconds(\n \"$transdur1\")\n secondPassThruStartTime = MovieTime.make_movietime_fromseconds(\n \"2.0 + $transdur1\")\n secondTransitionStartTime = MovieTime.make_movietime_fromseconds(\n \"4.0 + $transdur1\")\n secondTransitionDuration = MovieTime.make_movietime_fromseconds(\n \"$transdur2\")\n thirdPassThruStartTime = MovieTime.make_movietime_fromseconds(\n \"4.0 + $transdur1 + $transdur2\")\n thirdPassThruDuration = MovieTime.make_movietime_fromseconds(\n \"6.0 - ($transdur1 + $transdur2)\")\n\n # insert first track segment. Full length of first imported movie vid track.\n insertTrackSegmentCommand1 = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: track0,\n source_object: movieImporter1,\n source_track: track0,\n insertiontime: MovieTime.make_movietime(timevalue:0, timescale:1), \n source_timerange: timeRange)\n processCommands.add_command(insertTrackSegmentCommand1)\n \n # insert second track segment.\n insertTrackSegmentCommand2 = CommandModule.make_inserttracksegment(\n movieEditorObject, \n track: track1,\n source_object: movieImporter2,\n source_track: track0,\n insertiontime: MovieTime.make_movietime(timevalue:0, timescale:1), \n source_timerange: timeRange)\n processCommands.add_command(insertTrackSegmentCommand2)\n\n # Now create a pass thru instruction\n passThru1 = VideoLayerInstructions.new\n passThru1.add_passthrulayerinstruction(track: track0)\n passThru1TimeRange = MovieTime.make_movie_timerange(start: timeZero,\n duration: passThruDuration)\n passThru1Command = CommandModule.make_addvideoinstruction(movieEditorObject,\n timerange: passThru1TimeRange,\n layerinstructions: passThru1)\n processCommands.add_command(passThru1Command)\n\n dissolveTimeRange = MovieTime.make_movie_timerange(\n start: firstTansitionStartTime,\n duration: firstTransitionDuration)\n\n # Now create a dissolve ramp layer instruction.\n dissolveRamp = VideoLayerInstructions.new\n dissolveRamp.add_opacityramplayerinstruction(track: track0, \n startopacityvalue: 1.0,\n endopacityvalue: 0.0,\n timerange: dissolveTimeRange)\n dissolveRamp.add_passthrulayerinstruction(track: track1)\n dissolveRampCommand = CommandModule.make_addvideoinstruction(\n movieEditorObject,\n timerange: dissolveTimeRange,\n layerinstructions: dissolveRamp)\n processCommands.add_command(dissolveRampCommand)\n \n # Now create a pass thru instruction\n passThru2 = VideoLayerInstructions.new\n passThru2.add_passthrulayerinstruction(track: track1)\n passThru2TimeRange = MovieTime.make_movie_timerange(\n start: secondPassThruStartTime,\n duration: passThruDuration)\n passThru2Command = CommandModule.make_addvideoinstruction(\n movieEditorObject,\n timerange: passThru2TimeRange,\n layerinstructions: passThru2)\n processCommands.add_command(passThru2Command)\n\n # Now add a transform ramp layer instruction.\n transformRampTimeRange = MovieTime.make_movie_timerange(\n start: secondTransitionStartTime,\n duration: secondTransitionDuration)\n \n startTransform = MITransformations.make_affinetransform()\n endTransform = MITransformations.make_contexttransformation()\n scaleXY = MIShapes.make_point(0.0, 1.0)\n MITransformations.add_scaletransform(endTransform, scaleXY)\n \n transformRamp = VideoLayerInstructions.new\n transformRamp.add_transformramplayerinstruction(track: track1,\n starttransformvalue: startTransform,\n endtransformvalue: endTransform,\n timerange: transformRampTimeRange)\n transformRamp.add_passthrulayerinstruction(track: track0)\n transformRampCommand = CommandModule.make_addvideoinstruction(\n movieEditorObject,\n timerange: transformRampTimeRange,\n layerinstructions: transformRamp)\n processCommands.add_command(transformRampCommand)\n\n # Now create a pass thru instruction\n passThru3 = VideoLayerInstructions.new\n passThru3.add_passthrulayerinstruction(track: track0)\n passThru3TimeRange = MovieTime.make_movie_timerange(\n start: thirdPassThruStartTime,\n duration: thirdPassThruDuration)\n passThru3Command = CommandModule.make_addvideoinstruction(\n movieEditorObject,\n timerange: passThru3TimeRange,\n layerinstructions: passThru3)\n processCommands.add_command(passThru3Command)\n\n # Lets create a composition map image so that we can draw it in drawToView\n imageIdentifier = SecureRandom.uuid\n addCompositionImage = CommandModule.make_assignimage_tocollection(\n movieEditorObject,\n identifier: imageIdentifier)\n processCommands.add_command(addCompositionImage)\n\n # Now lets export the movie. This command may take some time so it is added\n # to process commands.\n exportMovieCommand = CommandModule.make_movieeditor_export(\n movieEditorObject,\n exportpreset: :AVAssetExportPreset1280x720,\n exportfilepath: \"DummyPath.mov\",\n exportfiletype: :'com.apple.quicktime-movie',\n pathsubstitutionkey: :exportfilepath)\n processCommands.add_command(exportMovieCommand)\n\n\n # The process commands are now done.\n # Create finalize commands list. Save the movie, close objects.\n finalizeCommands = SmigCommands.new\n finalizeCommands.add_tocleanupcommands_closeobject(movieImporter1)\n finalizeCommands.add_tocleanupcommands_closeobject(movieImporter2)\n finalizeCommands.add_tocleanupcommands_closeobject(bitmap)\n finalizeCommands.add_tocleanupcommands_closeobject(movieEditorObject)\n finalizeCommands.add_tocleanupcommands_removeimagefromcollection(\n imageIdentifier)\n\n # Need to update this to display a view of the composition which has also \n # been saved and to then overlay drawing of the file path to where the movie\n # is exported to.\n drawToView = MIDrawImageElement.new\n drawToView.set_imagecollection_imagesource(\n identifier: imageIdentifier)\n scaleFactor = 600.0 / 1000.0\n destinationRect = MIShapes.make_rectangle(\n width: \"$width\",\n height: \"$width * #{scaleFactor}\",\n xloc: 0,\n yloc: \"($height - $width * #{scaleFactor}) * 0.5\")\n\n drawToView.destinationrectangle = destinationRect\n\n variables = [\n {\n maxvalue: 2.5,\n variablekey: :transdur1,\n defaultvalue: 1.5,\n minvalue: 0.5\n },\n {\n maxvalue: 2.5,\n variablekey: :transdur2,\n defaultvalue: 1.5,\n minvalue: 0.5\n }\n ]\n\n instructionHash = { setup: setupCommands.commandshash,\n process: processCommands.commandshash,\n finalize: finalizeCommands.commandshash,\n drawinstructions: drawToView.elementhash,\n variables: variables,\n exportfilename: \"VideoCompositionMovie.mov\"}\n end\n instructionHash\nend",
"title": ""
},
{
"docid": "6ed353c653070fd48f38e86a31b2c8dd",
"score": "0.5035737",
"text": "def capture(mode=@mode)\n \n blob = screenshot(mode)\n \n if @file then\n \n File.write @file % @count, blob\n \n end\n\n @count += 1 \n @blob << blob\n\n end",
"title": ""
},
{
"docid": "5fc7284bbf855283acfb7d1103abfe68",
"score": "0.5027261",
"text": "def print_to_file\n\t\t\trequire 'rgl/dot'\n\t\t\tself.write_to_graphic_file(\"jpg\") \n\t\tend",
"title": ""
},
{
"docid": "f3dbbed62e2a0997631c5cf61ef8a894",
"score": "0.50220704",
"text": "def start_movie_recording\n wait_event { |r| r[1]['cameraStatus'] == 'IDLE' }\n startMovieRec\n wait_event { |r| r[1]['cameraStatus'] == 'MovieRecording' }\n log.info 'Started movie recording.'\n end",
"title": ""
},
{
"docid": "0175cfa534ace9c772cf0de99c08f86c",
"score": "0.50193685",
"text": "def read_frame; end",
"title": ""
},
{
"docid": "7b6a5f6b2c3cc03925913ea2cbaaf702",
"score": "0.50178033",
"text": "def movieEvent(m)\n m.read\nend",
"title": ""
},
{
"docid": "3ae2ab9c20b2a0d5513fa8c4b9508f57",
"score": "0.49967474",
"text": "def grabPicture(input_path,output_path,time)\n\t `ffmpeg -ss #{time} -i \"#{input_path}\" -y -f image2 -vcodec mjpeg -vframes 1 \"#{output_path}\"` #mjpeg\nend",
"title": ""
},
{
"docid": "d7b56284f3a48766c91cba8a6e21b039",
"score": "0.49850994",
"text": "def test_pdf_create\n begin\n output_file = \"#{CURRENT_DIR}/test.swf\"\n flash_object = FlashObject.new(PDF_FILE)\n flash_object.jpegquality(80)\n flash_object.save(output_file)\n\n assert(File.exist?(output_file))\n ensure\n File.delete(output_file)\n end\n end",
"title": ""
},
{
"docid": "f3d8721153d85afcb9416068dde2b153",
"score": "0.49776316",
"text": "def run\n #command = \"#{FFMPEG.ffmpeg_binary} -y -i #{Shellwords.escape(@movie.path)} #{@raw_options} #{Shellwords.escape(@output_file)}\"\n command = \"#{FFMPEG.ffmpeg_binary} -f image2 -i #{Shellwords.escape(@imagedirectory)}%d.jpg -sameq -y #{@raw_options} #{Shellwords.escape(@output_file)}\"\n \n FFMPEG.logger.info(\"Running transcoding...\\n#{command}\\n\")\n output = \"\"\n last_output = nil\n Open3.popen3(command) do |stdin, stdout, stderr|\n yield(0) if block_given?\n stderr.each(\"r\") do |line|\n fix_encoding(line)\n output << line\n if line.include?(\"frame=\")\n if line =~ /frame=(\\d+)/\n frame = $1.to_i\n else\n frame = 1\n end\n progress = frame / number_of_frames\n yield(progress) if block_given? \n #output << line\n #if line.include?(\"time=\")\n # if line =~ /time=(\\d+):(\\d+):(\\d+.\\d+)/ # ffmpeg 0.8 and above style\n # time = ($1.to_i * 3600) + ($2.to_i * 60) + $3.to_f\n # elsif line =~ /time=(\\d+.\\d+)/ # ffmpeg 0.7 and below style\n # time = $1.to_f\n # else # better make sure it wont blow up in case of unexpected output\n # time = 0.0\n # end\n # progress = time / 1#@movie.duration\n # yield(progress) if block_given?\n end\n if line =~ /Unsupported codec/\n FFMPEG.logger.error \"Failed encoding...\\nCommand\\n#{command}\\nOutput\\n#{output}\\n\"\n raise \"Failed encoding: #{line}\"\n end\n end\n end\n\n if encoding_succeeded?\n yield(1) if block_given?\n FFMPEG.logger.info \"Transcoding of #{@imagedirectory} to #{@output_file} succeeded\\n\"\n else\n errors = @errors.empty? ? \"\" : \" Errors: #{@errors.join(\", \")}. \"\n FFMPEG.logger.error \"Failed encoding...\\n#{command}\\n\\n#{output}\\n#{errors}\\n\"\n raise \"Failed encoding.#{errors}Full output: #{output}\"\n end\n \n encoded\n end",
"title": ""
},
{
"docid": "c82501f1e933f1087a47c730067d1e0f",
"score": "0.4966049",
"text": "def screencast(duration: 6, scale: 0.75, window: true)\n \n gif_file = @file_out.sub(/\\w+$/,'gif')\n \n EasyImgUtils.new(out: gif_file)\\\n .screencast(duration: duration, scale: scale, window: window)\n EasyVideoUtils.new(gif_file, @file_out).transcode\n \n end",
"title": ""
},
{
"docid": "b4c346e7b9539e4f6824ffa517409f6f",
"score": "0.49639085",
"text": "def render_batch!(frames)\n @frame_filename ||= {}\n\n frame_batch = frames.join(',')\n file_mask = frame_output_filename('%f')\n\n `#{self.class.gnash_binary} -s1 --screenshot=#{frame_batch} --screenshot-file=#{file_mask} -1 -r1 --timeout 200 #{filename} -j #{max_width} -k #{max_height} > /dev/null 2>&1`\n\n success = $?.success?\n\n frames.each do |frame|\n @frame_filename[frame] = success ? file_mask.gsub('%f', frame.to_s) : false\n end\n end",
"title": ""
},
{
"docid": "5329a9bd157d42f2b4d418f93490bc69",
"score": "0.49541983",
"text": "def show_frames\n if allFrames = document.frames\n count = allFrames.length\n puts \"there are #{count} frames\"\n for i in 0..count-1 do \n begin\n fname = allFrames[i.to_s].name.to_s\n puts \"frame index: #{i + 1} name: #{fname}\"\n rescue => e\n puts \"frame index: #{i + 1} --Access Denied--\" if e.to_s.match(/Access is denied/)\n end\n end\n else\n puts \"no frames\"\n end\n end",
"title": ""
},
{
"docid": "a66d78c4cd263b2365b46ac2dc1293c8",
"score": "0.4948753",
"text": "def show_frames\n if allFrames = document.frames\n count = allFrames.length\n puts \"there are #{count} frames\"\n for i in 0..count-1 do \n begin\n fname = allFrames[i.to_s].name.to_s\n puts \"frame index: #{i+1} name: #{fname}\"\n rescue => e\n puts \"frame index: #{i+1} --Access Denied--\" if e.to_s.match(/Access is denied/)\n end\n end\n else\n puts \"no frames\"\n end\n end",
"title": ""
},
{
"docid": "cf34428199b288f0a4af21be1f234ad2",
"score": "0.49464208",
"text": "def process_image\n sleep 4 \n @ffmpeg = IO.popen(\"/usr/local/bin/ffmpeg -f image2pipe -vcodec png -r 4 -i imagepipe.png -metadata title=\\\"Test Video\\\" -pix_fmt yuv420p -threads 4 -y output.mp4 >> encoding.log 2>&1\")\n @ffmpeg_pid = @ffmpeg.pid\n outpipe = open(\"imagepipe.png\", 'w')\n while true \n @buffer.format = 'png'\n @buffer.write(outpipe)\n outpipe.flush\n sleep 0.1\n end\n end",
"title": ""
},
{
"docid": "9d9e2221f29b89969a2824272d648ea9",
"score": "0.49398556",
"text": "def gif(output_name, speed)\n animation = ImageList.new(*Dir[\"#{@sequence_folder}*.png\"].sort_by { |x| x[/\\d+/].to_i })\n animation.ticks_per_second=1000\n puts 'got images'\n animation.delay = speed\n puts 'creating gif'\n animation.write(\"#{@output_folder}#{output_name}.gif\")\n puts 'COMPLETE'\nend",
"title": ""
},
{
"docid": "62c3397a2e18124605fef3ff11204ac7",
"score": "0.4935731",
"text": "def create_video\n puts \"Creating video...\"\n\n # Check if video folder exists\n Dir.mkdir(VIDEO_DIR) unless Dir.exist?(VIDEO_DIR)\n\n # FFMPEG conversion of image sequence into video\n ffmpeg_command = \"ffmpeg -r #{VIDEO_FPS} -pattern_type glob -i \\'#{IMG_DIR}/timestamp/*.png\\' -s hd#{VIDEO_HEIGHT} -vcodec libx264 -crf 18 -preset #{VIDEO_ENCODING_QUALITY} -pix_fmt yuv420p #{VIDEO_DIR}/#{URL_FILENAME}.mp4\"\n system(ffmpeg_command)\n\n puts \"Video created! :)\"\nend",
"title": ""
},
{
"docid": "aff344836a2b7251bb53e21b83c67ec4",
"score": "0.49331492",
"text": "def test_width_persistence\n tested 'too_large rms.jpg'\n\n tested 'too_large spx.jpg'\n assert_includes stderr, 'spx.jpg'\n end",
"title": ""
},
{
"docid": "c52aca89bfcd5232268b52e613df6e77",
"score": "0.4930332",
"text": "def tirarFoto(nome_arquivo,resultado,linguaguem)\n caminho_arquivo = \"results/screenshots/relatorio_#{linguaguem}/test_#{resultado}\"\n foto = \"#{caminho_arquivo}/#{nome_arquivo}.png\"\n page.save_screenshot(foto)\n embed(foto, 'image/png', 'Clique Aqui')\nend",
"title": ""
},
{
"docid": "c0d5c27b1b3d8e6c37d5aa1326270024",
"score": "0.4921465",
"text": "def testProcessingRecording\n execute_Process_WithConf({\n :Recordings => {\n :Tracks => {\n [1] => {\n :Env => :Env1,\n :Processes => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam1'\n }\n ]\n }\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_1, :Cleaned_Env1_1)\n ) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n lWave0FileName = getFileFromGlob('04_Process/Record/Env1.1.04.NoiseGate.0.Test.????????????????????????????????.wav')\n assert_rb_content [\n {\n :InputFileName => '02_Clean/Record/Env1.1.04.NoiseGate.wav',\n :OutputFileName => lWave0FileName,\n :Params => {\n :Param1 => 'TestParam1'\n }\n }\n ], 'Process_Test.rb'\n end\n end",
"title": ""
},
{
"docid": "92c3fa6c2538a1d37f5d72e5883cfd9d",
"score": "0.49109942",
"text": "def process_scene_file(file_io)\n target_filename = scene_target_filename file_io.original_filename\n puts 'Opening file'\n File.open(target_filename, 'wb') do |file|\n file.write(file_io.read)\n end\n target_filename\n end",
"title": ""
},
{
"docid": "3d5296a119c1049dd15cf25be8962702",
"score": "0.49078488",
"text": "def test_game77\r\n rep = ReplayManager.new(@log)\r\n match_info = YAML::load_file(File.dirname(__FILE__) + '/saved_games/s77_gc1_2008_12_29_20_31_27-savedmatch.yaml')\r\n alg_coll = { \"Ospite1\" => nil, \"igor061\" => nil }\r\n # start to play the first smazzata \r\n rep.replay_match(@core, match_info, alg_coll, 0, 1)\r\n #@core.gui_new_segno\r\n # continue with the second\r\n #rep.replaynext_smazzata(@core, match_info, alg_coll, 1)\r\n assert_equal(0, @io_fake.error_count, \"Errors\")\r\n assert_equal(0, @io_fake.warn_count, \"Warnings\")\r\n \r\n end",
"title": ""
},
{
"docid": "9ded909e6e650b75e4331746f77159d1",
"score": "0.4906589",
"text": "def create_frames\n # @type [LiteRGSS::Sprite]\n @black_frame = Sprite.new(@viewport) # Get the Blackn ^^\n # Scene frame\n # @type [LiteRGSS::Sprite]\n @frame = Sprite.new(@viewport).set_bitmap($options.language == 'fr' ? 'team/FrameFR' : 'team/FrameEN', :interface)\n end",
"title": ""
},
{
"docid": "1e6692c7f7eb18572b4a9afb8d28c107",
"score": "0.49023324",
"text": "def detect_bad_timelapse_frames \n\t\n\t#initalize bad frame counter\n\tbad_frames = 0\n\n\tmain_directory = ARGV[0] #timelapse root\n\tdestination_directory = ARGV[1] #Destnation of bad frames\n\ttemp_directory = ARGV[2] #Destination of temp thumbnails\n\n\tpngarray = Dir.glob(\"#{main_directory}**/*.png\") # for all .png files\n\t\n\t#Track progress of frame checking\n\tstatus_bar = ProgressBar.create(:format => '%a |%b>>%i| %p%% %t', :total => pngarray.length)\n\n\t#iterate over each .png image with a string form of the images absolute path\n\tpngarray.each do |temp_string|\n\t\tstatus_bar.increment\n\n\t\t#name of a .png timelapse image\n\t\tstring_array = temp_string.split(\"/\")\n\t\tpngimage = string_array[string_array.length - 1]\n\n\t\t#if our checks detect a bad frame, move it\n\t\tif (is_frame_too_small? temp_string, pngimage) || (is_frame_too_grey? temp_string, pngimage, temp_directory)\n\t\t\tmove_bad_image temp_string, destination_directory\n\t\t\tbad_frames += 1\n\t\tend\n\t\t\n\tend\n\n\tputs \"------------------------------------------\"\n\tputs \" found \" + bad_frames.to_s + \" bad frames.\"\n\tputs \"------------------------------------------\"\nend",
"title": ""
},
{
"docid": "b41174d669f822151d7fc1c6597f457d",
"score": "0.48947388",
"text": "def frames_flip_vertical!(frames)\r\n # Get Frame Height\r\n frame_height = height / frames\r\n # Create A Frame Dummy Bitmap\r\n frame_bitmap = Bitmap.new(width, frame_height)\r\n # Create Rect\r\n rect = Rect.new(0, 0, width, frame_height)\r\n # Do Frames times\r\n frames.times do |i|\r\n # Clear Bitmap\r\n frame_bitmap.clear\r\n # Get Y\r\n y = i * frame_height\r\n # Set Rect.y\r\n rect.y = y\r\n # Draw Piece Of Bitmap onto Dummy\r\n frame_bitmap.blt(0, 0, self, rect)\r\n # Flip Vertically\r\n frame_bitmap.flip_vertical!\r\n # Draw onto Self\r\n blt(0, y, frame_bitmap, frame_bitmap.rect)\r\n end\r\n # Dispose Dummy Bitmap\r\n frame_bitmap.dispose\r\n end",
"title": ""
},
{
"docid": "9feabe8c1aea5f0b0830335bfd41a442",
"score": "0.48897743",
"text": "def export_to_skp\n model = Sketchup.active_model\n view = model.active_view\n # Check if animation record is not empty.\n unless active_data_valid?\n ::UI.messagebox(\"Nothing to export!\")\n return false\n end\n # Display options input box.\n prompts = ['Start Frame', 'End Frame', 'Speed (0.01 - 10000) ', 'Reverse', 'Replay Groups', 'Replay Materials', 'Replay Layers', 'Replay Camera', 'Replay Render', 'Replay Shadow']\n yn = 'Yes|No'\n drop_downs = ['', '', '', yn, yn, yn, yn, yn, yn, yn]\n values = [@start_frame, @end_frame, @skp_defaults[:speed], @skp_defaults[:reversed], @replay_groups ? 'Yes' : 'No', @replay_materials ? 'Yes' : 'No', @replay_layers ? 'Yes' : 'No', @replay_camera ? 'Yes' : 'No', @replay_render ? 'Yes' : 'No', @replay_shadow ? 'Yes' : 'No']\n results = ::UI.inputbox(prompts, values, drop_downs, 'Export Animation Options')\n return false unless results\n # Select export path\n model_fname = File.basename(model.path, '.skp')\n model_fname = \"msp_anim\" if model_fname.empty?\n script_file = ::UI.savepanel('Choose Export Directory and Name', nil, model_fname)\n return false unless script_file\n fpath = File.dirname(script_file)\n fpath.force_encoding('UTF-8') unless AMS::IS_RUBY_VERSION_18\n fname = File.basename(script_file, '.skp')\n # Preset user data\n sframe = results[0].to_i\n eframe = results[1].to_i\n speed = AMS.clamp(results[2].to_f, 0.01, 10000)\n reversed = results[3] == 'Yes'\n orig_rep_grp = @replay_groups\n orig_rep_mat = @replay_materials\n orig_rep_lay = @replay_layers\n orig_rep_cam = @replay_camera\n orig_rep_ren = @replay_render\n orig_rep_sha = @replay_shadow\n @replay_groups = results[4] == 'Yes'\n @replay_materials = results[5] == 'Yes'\n @replay_layers = results[6] == 'Yes'\n @replay_camera = results[7] == 'Yes'\n @replay_render = results[8] == 'Yes'\n @replay_shadow = results[9] == 'Yes'\n # Save skp defaults\n @skp_defaults[:speed] = speed.to_s\n @skp_defaults[:reversed] = results[3]\n # Export animation\n start_time = Time.now\n called_while_active = @active\n begin\n clear_data_from_model(true, false)\n rescue Exception => err\n puts 'Failed to initially clear replay data from model!'\n puts err\n end\n start(false) unless called_while_active\n pframe = reversed ? eframe : sframe\n rframe = pframe\n last_frame = nil\n count = 1\n babort = false\n if AMS::IS_PLATFORM_WINDOWS\n msg_caption = \"'#{AMS::Sketchup.get_caption}' - Animation Export\"\n AMS::Sketchup.threaded_messagebox(msg_caption, EXPORT_MESSAGE) { |result|\n babort = true\n }\n end\n while(rframe >= sframe && rframe <= eframe)\n break if babort\n # Export scene\n if rframe != last_frame\n activate_frame(rframe)\n last_frame = rframe\n end\n full_path = \"#{fpath}/#{fname}#{sprintf(\"%04d\", count)}.skp\"\n if Sketchup.version.to_i < 14\n model.save(full_path)\n else\n if model.path.empty?\n model.save(full_path)\n else\n model.save_copy(full_path)\n end\n end\n progress = (rframe - sframe) * 100 / (eframe - sframe).to_f\n Sketchup.set_status_text(\"Exporting MSPhysics Replay Animation Progress: #{rframe - sframe} / #{eframe - sframe} -- #{sprintf(\"%.2f\", progress)}%\", SB_PROMPT)\n pframe += reversed ? -speed : speed\n rframe = pframe.round\n count += 1\n end\n if AMS::IS_PLATFORM_WINDOWS\n hwnd = AMS::Sketchup.find_window_by_caption(msg_caption)\n AMS::Window.close(hwnd) if hwnd\n end\n reset unless called_while_active\n # Resave data\n begin\n save_data_to_file(true)\n rescue Exception => err\n puts 'Failed to resave replay data to model and file!'\n puts err\n end\n # Set original settings\n @replay_groups = orig_rep_grp\n @replay_materials = orig_rep_mat\n @replay_layers = orig_rep_lay\n @replay_camera = orig_rep_cam\n @replay_render = orig_rep_ren\n @replay_shadow = orig_rep_sha\n # Display results\n ::UI.messagebox(\"#{babort ? 'Stopped' : 'Finished'} exporting MSPhysics Replay Animation!\\n\\nExported #{count} frames in #{sprintf(\"%.2f\", Time.now - start_time)} seconds.\\n\\nYou may now dispose of replay data to reduce file size.\")\n # Return success\n true\n end",
"title": ""
},
{
"docid": "0a364461e8e08beaac1851e4f0426ad0",
"score": "0.48493886",
"text": "def extract\n manipulate! do |img|\n img.frames.second\n end\n end",
"title": ""
},
{
"docid": "113a2bb699e661b968ab38cdf16eccb1",
"score": "0.4849162",
"text": "def create_board_png_file(png_file_path, png_data, size)\n begin\n command = \"#{UBONGO_DRAW} --color-file=#{COLOR_FILE_PATH} \" +\n \"--size=#{size} - #{png_file_path}\"\n file = open(\"| #{command}\", 'w')\n file.write(png_data)\n file.close\n rescue\n return false\n end\n\n return true\nend",
"title": ""
},
{
"docid": "f05ca4a4d5955e06d93dab238ea3401e",
"score": "0.48427942",
"text": "def tutorial9(ctx)\n XImage.load('http://localhost:2060/images/sunset.jpg') do |img|\n ctx.drawImage(img,100,100)\n ctx.beginPath()\n ctx.moveTo(30,96)\n ctx.lineTo(70,66)\n ctx.lineTo(103,76)\n ctx.lineTo(170,15)\n ctx.stroke()\n end\nend",
"title": ""
},
{
"docid": "49e27028802c6de85cbe285f31baa565",
"score": "0.48364553",
"text": "def screen_capture(fileName)\n return $marathon.screenCapture(fileName)\nend",
"title": ""
},
{
"docid": "4f573007d36fd939e4133dc5efa65f64",
"score": "0.48321512",
"text": "def test_bug_games27_211108\r\n rep = ReplayManager.new(@log)\r\n match_info = YAML::load_file(File.dirname(__FILE__) + '/saved_games/s27_gc1_2008_11_21_21_49_29-savedmatch.yaml')\r\n alg_coll = { \"Alex\" => nil, \"igor060\" => nil }\r\n # start to play the first smazzata \r\n rep.replay_match(@core, match_info, alg_coll, 0)\r\n @core.gui_new_segno\r\n # continue with the second\r\n rep.replaynext_smazzata(@core, match_info, alg_coll, 1)\r\n # now build mano info\r\n @io_fake.make_info_mano_onlogs\r\n # check result\r\n # now the error case, a picula was done when the user play 3s\r\n ix_mano = @io_fake.identify_mano('Card _3b played from igor060. Taken: _3s')\r\n res = @io_fake.checkdata_onmano(ix_mano, \"picula\")\r\n @io_fake.display_mano_data(ix_mano)\r\n # correct result is no picula on mano 38\r\n assert_equal(false, res)\r\n end",
"title": ""
},
{
"docid": "53ee891a2f929009c223c1ebe8225409",
"score": "0.48215285",
"text": "def test_media(file_name)\n \"#{Ruby2D.test_media}/#{file_name}\"\nend",
"title": ""
},
{
"docid": "1f2cc0fc6424d8f9d74820b6ccb430af",
"score": "0.48164627",
"text": "def extract_frame_from_raw(frame)\n #@render_frames ||= `#{gnash_binary} #{downloader.filename} -D #{raw_filename} --max-advances #{max_advances} 1 -j 500 -k 500`\n render_frame!(frame)\n\n File.open('rb', raw_filename) do |file|\n file.seek(frame_offset(frame))\n file.read(frame_size)\n end\n end",
"title": ""
},
{
"docid": "c93711483e374206327f03c5f55f3a8a",
"score": "0.48144123",
"text": "def dumpFramedata()\n i=0\n while true\n puts \"Dumping frame data into file framedata#{i}.txt\"\n fork do\n exec(\"adb shell dumpsys gfxinfo #$PROCESS_NAME >framedata#{i}.framedata.txt\")\n exit\n end\n i+=1\n sleep $SlEEP_TIME\n end\nend",
"title": ""
},
{
"docid": "732b01c20579db09bb4900eb1b916d55",
"score": "0.4814324",
"text": "def run_frame(frame); end",
"title": ""
},
{
"docid": "7cbae784bc93c508e0f8a378bb95d897",
"score": "0.48128527",
"text": "def create_frames\r\n\t\tputs a[1][1]\r\n\t\tgame= Array.new(10)\r\n\t\tgame.map! do |item|\r\n\t\t\ti||=0\r\n\t\t\titem = Frame.new(@a[i][0], @a[i][1])\r\n\t\t\t# puts item\r\n\t\t\ti+=1\r\n\t\t\titem\r\n\t\tend\r\n\t\tout_game = game\r\n\t\t# for i in (0..9) do \r\n\t\t# \tputs game[i].first_ball\r\n\t\t# \tputs out_game[i].first_ball\r\n\t\t# end\r\n\t\tgame.each_with_index do|frame, index|\r\n\t\t\tframe.score_keeping(index, out_game, @pre)\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "aaca654584ad32c179282c4c475bb762",
"score": "0.4811939",
"text": "def frames=(_arg0); end",
"title": ""
},
{
"docid": "a7149b54078d097c2433174264d08de9",
"score": "0.48115802",
"text": "def test_bug_22062009\r\n rep = ReplayManager.new(@log)\r\n match_info = YAML::load_file(File.dirname(__FILE__) + '/saved_games/s204_gc1_2009_06_22_21_23_42-savedmatch.yaml')\r\n #p match_info[:giocate][0]\r\n alg_coll = { \"aaaasmile\" => nil, \"jason\" => nil }\r\n # start to play the first smazzata \r\n rep.replay_match(@core, match_info, alg_coll, 0)\r\n @io_fake.make_info_mano_onlogs\r\n ## check result\r\n ## now the error case, terminated game was not found.\r\n ix_mano = @io_fake.identify_mano(\": 31\")\r\n assert_equal(true, ix_mano != -1)\r\n if ix_mano >= 0\r\n \tfound = @io_fake.display_mano_data(ix_mano)\r\n \tassert_equal(true, found)\r\n end\r\n end",
"title": ""
},
{
"docid": "fb7e87fedc78fe3fb8e069a9b2056e38",
"score": "0.48060706",
"text": "def frame_output_filename(frame)\n \"#{Dir.tmpdir}/frame_#{Time.now.to_i}_#{frame}.png\"\n end",
"title": ""
},
{
"docid": "646fec4e6ca0e315117ae9f639b572fa",
"score": "0.48051202",
"text": "def test_advanced\n {\n input: {\n video_size: '640x480',\n show_region: '1'\n },\n output: {\n framerate: 30.0\n },\n loglevel: 'level+debug', # For FFmpeg\n log: test_log_file\n }\nend",
"title": ""
},
{
"docid": "69a9d758485926d72b831d242f8aa3b5",
"score": "0.48042372",
"text": "def test02()\n begin\n tempFile = nil\n baseImageName = \"clipped-dscn0749.jpg\"\n inputImageFile = File.join($directory, \"images/DSCN0749.JPG\")\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n # Create the import image command\n objectName = SecureRandom.uuid\n pathSubstitutionKey = SecureRandom.uuid\n importerObject = theCommands.make_createimporter(\"\",\n name: objectName,\n pathsubstitutionkey: pathSubstitutionKey)\n \n variablesDict = { pathSubstitutionKey => inputImageFile }\n contextName = SecureRandom.uuid\n contextSize = MIShapes.make_size(600, 450)\n contextObject = theCommands.make_createbitmapcontext(size: contextSize,\n name: contextName)\n\n drawImageElement = MIDrawImageElement.new\n drawImageElement.set_imagefile_imagesource(source_object: importerObject,\n imageindex: 0)\n \n drawImageElement.destinationrectangle = MIShapes.make_rectangle(\n size: contextSize)\n radius = 50\n theClip = MIClip.new\n theClip.arrayofpathelements = make_arcpath(contextSize: contextSize,\n radius: radius)\n# The following line is not needed as the non windingrule is default.\n theClip.clippingrule = :nonwindingrule\n# If you want to use the even odd rule for clipping then uncomment following\n# theClip.clippingrule = :evenoddrule\n theClip.startpoint = MIShapes.make_point(2.0 * radius, radius)\n drawImageElement.clip = theClip\n drawElementCommand = CommandModule.make_drawelement(contextObject,\n drawinstructions: drawImageElement)\n theCommands.add_command(drawElementCommand)\n\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n# tempFile = File.join($compareImageDir, baseImageName)\n# exporterObject = theCommands.make_createexporter(tempFile)\n exporterObject = theCommands.make_createexporter(\"\")\n addImageToExporterCommand = CommandModule.make_addimage(exporterObject, \n contextObject, imageindex: 0)\n theCommands.add_command(addImageToExporterCommand)\n exportPathSubKey = SecureRandom.uuid\n assignPathCommand = CommandModule.make_set_object_exportpathproperty(\n exporterObject,\n propertyvalue: nil,\n pathsubstitutionkey: exportPathSubKey)\n theCommands.add_command(assignPathCommand)\n exportCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportCommand)\n variablesDict[exportPathSubKey] = tempFile\n theCommands.variables = variablesDict\n# puts JSON.pretty_generate(theCommands.commandshash)\n Smig.perform_commands(theCommands)\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile)\n # 10. Report if different.\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \"Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n FileUtils.rm_f(tempFile) unless tempFile.nil?\n end\nend",
"title": ""
},
{
"docid": "5360f31114df84669811272081aca68b",
"score": "0.4799166",
"text": "def recorder; end",
"title": ""
},
{
"docid": "ad8297eb00b12abf889add47e9427b10",
"score": "0.4797616",
"text": "def totalFrames; @bitmap.animationFrames; end",
"title": ""
},
{
"docid": "f5a9e05a37e75841c38b942221229519",
"score": "0.47879118",
"text": "def test_should_create_a_single_piece_based\n img_handle = ImageHandler.new\n img_handle.folder_location = \"./puzzle_created/made/\"\n img_handle.source(\"simple_sample.jpg\")\n img_handle.single_piece(0,0)\n assert_equal File.size(\"./puzzle_created/made/simple_sample-0_0.gif\"), File.size(\"./puzzle_created/correct/simple_sample-0_0.gif\")\n end",
"title": ""
},
{
"docid": "8ca54c9c256f58f80f135b3a2092e86b",
"score": "0.47876275",
"text": "def cover\n begin\n\n manipulate! do |frame, index|\n # frame if index.zero?\n frame if (index == 0)\n end\n\n rescue ::Magick::ImageMagickError => e\n raise CarrierWave::ProcessingError, I18n.translate(:\"errors.messages.rmagick_processing_error\", :e => e, :default => I18n.translate(:\"errors.messages.rmagick_processing_error\", :e => e, :locale => :en))\n\n end\n end",
"title": ""
},
{
"docid": "3ecff07630dc3dcb1b5a4c7da61b7b58",
"score": "0.4783719",
"text": "def extract_cover(input, output, duration)\n seek = duration / 2\n Editing::Cmd::ExtractFrame.new(input, output, seek).run!\n raise StandardError, 'unable to create cover' unless File.exists? output\n end",
"title": ""
},
{
"docid": "af65e8bd6adfc4f85204048480d0e4b1",
"score": "0.4782954",
"text": "def show_frame(count)\n\n clear_screen()\n\n if count == 0\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | /|\\\\ \"\n puts \" | / \\\\ \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 1\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | _O_ \"\n puts \" | | \"\n puts \" | / \\\\ \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 2\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | \\\\O/ \"\n puts \" | | \"\n puts \" | / \\\\ \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 3\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | _O_ \"\n puts \" | | \"\n puts \" | / \\\\ \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n end\n\nend",
"title": ""
},
{
"docid": "7a02b5f9fa6d44b2b57cfa3f3c81f647",
"score": "0.47823626",
"text": "def test_part_two\n s = Swarm.new(File.read('input.txt'), true)\n 500.times do |i|\n print \"#{i} of 500 \\r\"\n $stdout.flush\n s.move\n end\n assert_equal 461, s.particles.size\n end",
"title": ""
},
{
"docid": "ca9afb4a3fa0d69c8e27cf2e8b7e53e4",
"score": "0.47768173",
"text": "def test_decode_01\n expected_data = File.read(file_path('dec2.jpg'))\n\n @dec.feed(File.read(file_path('enc2.p1.txt')))\n assert !@dec.done?\n\n @dec.feed(File.read(file_path('enc2.p2.txt')))\n assert @dec.done?\n assert !@dec.errors?\n\n assert_equal 1285118361, @dec.crc32\n\n @sio.rewind\n compare_data expected_data, @sio.read\n end",
"title": ""
},
{
"docid": "64ffccbf0522590811b39a16c87b5797",
"score": "0.47708705",
"text": "def render_frame!(frame)\n @frame_filename ||= {}\n\n unless @frame_filename[frame]\n frame_filename = frame_output_filename(frame)\n\n `#{self.class.gnash_binary} -s1 --screenshot=#{frame} --screenshot-file #{frame_filename} -1 -r1 --timeout 200 #{filename} -j #{max_width} -k #{max_height} > /dev/null 2>&1`\n\n @frame_filename[frame] = $?.success? ? frame_filename : false\n end\n\n @frame_filename[frame]\n end",
"title": ""
},
{
"docid": "bad8a9d90a162a6cf5f960ef839f3e15",
"score": "0.4769151",
"text": "def test_image_insert\n canvas = Gosu::Image.from_blob(3000, 2000)\n stamp = rect_image(1337, 1337)\n 8.times do |i|\n canvas.insert stamp, i * 300, i * 123\n end\n assert_image_matches \"test_image/insert\", canvas, 1.00\n end",
"title": ""
},
{
"docid": "45eb43a72573c43b69e63cf326fb0ffd",
"score": "0.47660047",
"text": "def test_make_preview_image\n recordings = @backend.query_recordings\n \n recording = recordings[0]\n test_image = @backend.preview_image(recording, :secs_in => 1)\n assert test_image.length > 0\n \n # Define an array of the decimal values of the PNG magic number\n png_sig = [137, 80, 78, 71, 13, 10, 26, 10]\n\n # Tested in ruby 1.9.2 returns chr instead of integers. \n # Tested result png for validity.\n\n png_sig.map!{|n| n.chr} if RUBY_VERSION == \"1.9.2\"\n \n test_image_sig = (0..7).collect { |i| test_image[i] }\n \n assert_equal test_image_sig, png_sig\n end",
"title": ""
},
{
"docid": "9951255285b399ea95fc8a4868082e1e",
"score": "0.47647387",
"text": "def create_test_h264(filename = \"#{SecureRandom.uuid}.mp4\", length = 1)\n Open3.capture2(\"ffmpeg -f lavfi -i testsrc=duration=#{length}:size=1280x720:rate=30 -vcodec libx264 -acodec aac /tmp/input/#{filename}\")\n filename\nend",
"title": ""
},
{
"docid": "c3675d927159eb13c8c01e1f9c61cf93",
"score": "0.47638905",
"text": "def show_frame(count)\n\n clear_screen()\n\n if count == 0\n 2.times {puts \" \"}\n puts \" @@@\"\n puts \" @@@\"\n puts \" @@@\"\n puts \" @@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@ @@@@@@@@@@@@@@@@ @@@@@@@@\"\n puts \" @@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@\"\n puts \" @@@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@@\"\n puts \" @@@@@@@@@@ @@@@ @@@@ @@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@\"\n puts \" @@@@@@@@ @@ @@ @@ @@ @@ @@ @@ @ @@@@@@@@\"\n puts \" @@@@@@@ @@@@@@@\"\n puts \" @@@@@@ @@ @@ @@ @@ @@ @@ @ @@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@\"\n 2.times {puts \" \"}\n elsif count == 1\n 2.times {puts \" \"}\n puts \" @@@\"\n puts \" @@@\"\n puts \" @@@\"\n puts \" @@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@ @@@@@@@@@@@@@@@@ @@@@@@@@\"\n puts \" @@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@\"\n puts \" @@@@@@@@@@ @ @@@@@@@@@@@@ @ @@@@@@@@@@\"\n puts \" @@@@@@@@@@ @@@@ @@@@ @@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@\"\n puts \" @@@@@@@@ @@ @@ @@ @@ @@ @@ @@ @ @@@@@@@@\"\n puts \" @@@@@@@ @ @ @ @ @ @ @ @@@@@@@\"\n puts \" @@@@@@ @@ @@ @@ @@ @@ @@ @ @@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts \" @@@@@@@@@@@@@@@@@@@@@@\"\n 2.times {puts \" \"}\n end\n\nend",
"title": ""
},
{
"docid": "336a7b2877535a823c228ecee8e8075a",
"score": "0.4762711",
"text": "def test_performance\n\n Ocarina::DevelopmentProfiler::prof(\"stuff\") do\n @cropper.decipher_board(@network, read_board(\"board5.png\"))\n end\n\n end",
"title": ""
},
{
"docid": "03ccad5a63fb1c4d13cdebf07da13c10",
"score": "0.47583663",
"text": "def frame=(pos); end",
"title": ""
},
{
"docid": "7c320c7cd43da3cff7f16b0578912eb3",
"score": "0.47524586",
"text": "def load_movies(movie_file)\n\t\ti = 0\n\t\tmovie_file.each_line do |el|\n\t\t\tel = el.force_encoding(\"iso-8859-1\").split(\"|\")\n\t\t\t@movies[i] = Movie.new(el)\n\t\t\ti += 1\n\t\tend\n\tend",
"title": ""
}
] |
089e2fdabe31c298e545b080a08f24e3
|
This returns an empty string if can't form a valid absolute url as per the Microdata spec.
|
[
{
"docid": "82b4f0f5d1a95145b354867d9664bffa",
"score": "0.6915993",
"text": "def make_absolute_url(url)\n return url unless URI.parse(url).relative?\n begin\n URI.parse(@page_url).merge(url).to_s\n rescue URI::Error\n url\n end\n end",
"title": ""
}
] |
[
{
"docid": "21d2aaf1ae100cbfdd1f0e472f7c05bd",
"score": "0.75537115",
"text": "def absolute_url(url)\n url.match?(/^http:/) ? url : \"#{url_root}#{url}\"\n end",
"title": ""
},
{
"docid": "01b977be385404558c8cd90aa62360a9",
"score": "0.7473386",
"text": "def absolute_url(url)\n if url && !url.include?(\"http\") \n URI.join(root_url, url)\n else\n url\n end\n end",
"title": ""
},
{
"docid": "60307ea7ed99bc5c64f5a8a3d515a2dc",
"score": "0.73190564",
"text": "def absolutize_url(url)\n URI.join(@request.original_url, url).to_s\n rescue URI::InvalidURIError\n nil\n end",
"title": ""
},
{
"docid": "db6ff00555a15145f42d1eb1d639c948",
"score": "0.72596824",
"text": "def absolute_url\n domain + path\n end",
"title": ""
},
{
"docid": "562536f51cb0f860147d424ed8841bdb",
"score": "0.72350943",
"text": "def make_absolute_url(url)\n return url unless Addressable::URI.parse(url).relative?\n begin\n Addressable::URI.parse(@page_url).merge(url).to_s\n rescue\n url\n end\n end",
"title": ""
},
{
"docid": "a25ecde5c274fad14f50b1d3d1b70a36",
"score": "0.7231484",
"text": "def absolute_url\n return unless fileable?\n Rails.application.routes.default_url_options[:host] ||= \"http://localhost:3000\"\n Rails.application.routes.url_helpers.root_url[0..-2] + file.url\n end",
"title": ""
},
{
"docid": "9dce7ddbd94a4a43848312ad9ff5a510",
"score": "0.71729356",
"text": "def nice_url\n if homepage\n if Addressable::URI.parse(homepage)\n Addressable::URI.parse(homepage).host\n else\n homepage.first(15)\n end\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "9dce7ddbd94a4a43848312ad9ff5a510",
"score": "0.71729356",
"text": "def nice_url\n if homepage\n if Addressable::URI.parse(homepage)\n Addressable::URI.parse(homepage).host\n else\n homepage.first(15)\n end\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "917f08754f8f12fd66891dfc3442b262",
"score": "0.71545625",
"text": "def full_url display_url\n if display_url.blank?\n return nil\n end\n return (display_url[0..6] == \"http://\" or display_url[0..7] == \"https://\") ? display_url : \"http://#{display_url}\"\n end",
"title": ""
},
{
"docid": "90399ed24df69c14c9220a1bdb5041b7",
"score": "0.7139487",
"text": "def absolute_url?(string); end",
"title": ""
},
{
"docid": "ceba78b3a8755ed42d2e22765402135a",
"score": "0.71077085",
"text": "def absolute_url\n File.join(BLOG.url, url)\n end",
"title": ""
},
{
"docid": "2d3fdd80a46e4bca150b6400cbaa6907",
"score": "0.7094286",
"text": "def absolute_url_for(uri, str)\n # TODO: use URI.parse() for better handling?\n return str if str =~ /^[|[:alpha:]]+:\\/\\//\n File.join(((uri.path.empty?) ? uri.to_s : File.dirname(uri.to_s)), \n str)\n end",
"title": ""
},
{
"docid": "2f99fc487bf80868fb907fb00da5b6fc",
"score": "0.705757",
"text": "def absolutify_url(url)\n url =~ /^\\w*\\:/i ? url : File.join(@url,url)\n end",
"title": ""
},
{
"docid": "9f2e1acc4a8bf580ad48c16823d59d7d",
"score": "0.7053725",
"text": "def get_absolute_file_url(url)\n orig_url = url.to_s.strip\n \n url = file_url(orig_url)\n # If a file:// was stripped from the url, this means it will always point\n # to a file\n force_file = (orig_url != url)\n # Indicates wether the base url is a network url or a file/directory\n base_is_net = !base_file_url.is_a?(String)\n # Try to find if we have a \"net\" URL if we aren't sure if this is a file. In\n # case the base url is a network url, we'll always assume that the\n # url is also a net thing. Otherwise we only have a net url if it contains a\n # '://' string\n is_net_url = !force_file && (base_is_net || url.include?('://'))\n # The url is absolute if there is a : character to be found\n \n \n if(is_net_url)\n base_is_net ? join_url(base_file_url, url) : url\n else\n base_is_net ? url : join_files(base_file_url, url)\n end\n end",
"title": ""
},
{
"docid": "2da1a60a1f84f4d6c18ce51c8073ea87",
"score": "0.6970141",
"text": "def absolute_url?(string)\n return unless string\n\n Addressable::URI.parse(string).absolute?\n rescue Addressable::URI::InvalidURIError\n nil\n end",
"title": ""
},
{
"docid": "3b9ad60f12f474f2cb0e2b003b1c6a70",
"score": "0.6970139",
"text": "def full_url\n if website.match(/[A-Za-z]:\\/\\//)\n website\n else\n \"http://#{website}\"\n end\n end",
"title": ""
},
{
"docid": "282721e5bc52bcf26cba3367fee308bd",
"score": "0.69562924",
"text": "def absolute_url(href)\n Addressable::URI.join(self.class::DOMAIN, href).to_s\n end",
"title": ""
},
{
"docid": "6e9e1ef2574ad16895a3c59aded68faa",
"score": "0.69549936",
"text": "def build_as_url\n URI(build_as_string)\n rescue Urb::InvalidUrl => e\n URI('/')\n end",
"title": ""
},
{
"docid": "8be5270e2b15a17eab9984ff32900668",
"score": "0.69300675",
"text": "def absolutize_url(url)\n # file_path = File.expand_path(File.join(working_directory, url))\n # full_path = File.expand_path(File.join(path, url))\n # full_path.gsub(File.expand_path(path), '')\n ('/' + url.split('./').last).gsub(%r(/+), '/')\n end",
"title": ""
},
{
"docid": "92477b84b0c655eb6f737b84cd7f848d",
"score": "0.68770343",
"text": "def normalize_url\n return if self.url.blank?\n normalized = self.url.normalize\n if normalized.blank?\n self.errors.add(:url, \"is invalid\")\n return false\n elsif normalized.match(\"archiveofourown.org/users\")\n self.errors.add(:url, \"cannot be ao3 user\")\n return false\n elsif normalized.match(\"(.*)/collections/(.*)/works/(.*)\")\n normalized = $1 + \"/works/\" + $3\n elsif normalized.match(\"archiveofourown.org/collections\")\n self.errors.add(:url, \"cannot be an ao3 collection\")\n return false\n end\n self.url = normalized\n end",
"title": ""
},
{
"docid": "64c5098e2919ffe2f01c26ee30388dc7",
"score": "0.6845135",
"text": "def absolutify_url(uri)\n if uri =~ /^\\w*\\:/i\n normalize_url(uri)\n else\n Addressable::URI.join(@url, uri).normalize.to_s\n end\n rescue URI::InvalidURIError, Addressable::URI::InvalidURIError => e\n add_fatal_error \"Link parsing exception: #{e.message}\" and nil\n end",
"title": ""
},
{
"docid": "f422a07e0ce1b49a7b43d10f58fe87df",
"score": "0.6838295",
"text": "def relative_url(input); end",
"title": ""
},
{
"docid": "288d55c8023c23f4c1d6db839a51d4f4",
"score": "0.68341285",
"text": "def full_url\n [ self.class.base, normalize_uri ].join('')\n end",
"title": ""
},
{
"docid": "f93b83a65b35dd9b0f16593729382e11",
"score": "0.67757386",
"text": "def absolutize_url(url)\n url =~ /\\Ahttps?/ ? url : \"http://#{url}\"\n end",
"title": ""
},
{
"docid": "11f9a372c297a45e8a2b926c3ddcde7d",
"score": "0.67590845",
"text": "def friendly_url\n uri = URI(url)\n uri.scheme + \"://\" + uri.host\n end",
"title": ""
},
{
"docid": "8150ff1cdb6fa2ce45f5d57d104efcd0",
"score": "0.6757882",
"text": "def absolute_url_from(page_url, current_url)\n return unless eligible_url?(page_url)\n parsed_uri = URI.join(current_url, page_url) rescue return\n return unless parsed_uri.hostname == @base_hostname\n parsed_uri.to_s\n end",
"title": ""
},
{
"docid": "e8eefda9a98c23a448b9d97d4ae2a6fe",
"score": "0.67549664",
"text": "def abs_url(site)\n\t\t\turl = site.config['url']\n\t\t\turl = url[0..-2] if site.config['url'].end_with?(\"/\")\n\t\t\turl + fix_path(site.config['git_to_rss_file_path'])\n\t\tend",
"title": ""
},
{
"docid": "91eb31cf2a436e340ba7939f34aed717",
"score": "0.67367107",
"text": "def absolute_url(*args)\n url_path = args.shift\n if url_path.is_a?(String) && !url_path.start_with?('/')\n url_path = request.env['PATH_INFO'].rpartition('/').first << '/' << url_path\n end\n uri url(url_path, *args), true, false\n end",
"title": ""
},
{
"docid": "ecbbcb8cf7946f226b04fd1cf079f341",
"score": "0.67287296",
"text": "def absolutize_url(url, base_path = '')\n ############# Refactor\n # original_url = url\n #unless original_url[URI::regexp(%w[http https])]\n # protocol = default_url_options[:protocol]\n # protocol = \"http://\" if protocol.blank?\n # protocol+= \"://\" unless protocol.include?(\"://\")\n\n # host = default_url_options[:host]\n\n # [host,protocol].each{|r| original_url.gsub!(r,\"\") }\n # host = protocol+host unless host[URI::regexp(%w[http https])]\n\n # url = URI.join host, base_path, original_url\n #end\n\n #url.to_s\n \n url\n end",
"title": ""
},
{
"docid": "09b0f6d0618a2b6348f49c6129eaa4b9",
"score": "0.67133796",
"text": "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end",
"title": ""
},
{
"docid": "09b0f6d0618a2b6348f49c6129eaa4b9",
"score": "0.67133796",
"text": "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end",
"title": ""
},
{
"docid": "ac942c770fc10e42b53d442f4eb4d3ee",
"score": "0.6686378",
"text": "def absolutify_url(src, base_url, parent_url)\n if src.nil? || src.empty? || src == \"//:\" || src =~ /\\s*http:\\/\\//i\n return src\n end\n \n return \"#{base_url}#{src}\" if src =~ /^\\s*\\//\n return \"#{parent_url}#{src}\" if parent_url\n return src\n end",
"title": ""
},
{
"docid": "b56d84b2d3fc032551512bd633c11960",
"score": "0.66810226",
"text": "def absolute_url?\n (self.include?('://') || self.start_with?('/')) ? true : false\n end",
"title": ""
},
{
"docid": "7908d8f5cd545738b6c3988e9b1e7a75",
"score": "0.6675603",
"text": "def full_url(input)\n url = Ink.site.config['url']\n if url.nil?\n raise IOError.new \"Could not expand url in #{input}: Please add your site's published url to your _config.yml, eg url: http://example.com/\"\n else\n expand_url(input, url)\n end\n end",
"title": ""
},
{
"docid": "416079256bc825221448ce4e8f32e62e",
"score": "0.6672255",
"text": "def absolutify_url(src, base_url, parent_url)\r\n if src.nil? || src.empty? || src == \"//:\" || src =~ /\\s*http:\\/\\//i\r\n return src\r\n end\r\n\r\n return \"#{base_url}#{src}\" if src =~ /^\\s*\\//\r\n return \"#{parent_url}#{src}\" if parent_url\r\n return src\r\n end",
"title": ""
},
{
"docid": "9bee645bb25c8f59914928f5b995ae34",
"score": "0.6670558",
"text": "def absolute_url(request, opts={})\n cdn_url(opts) || (request.protocol + request.host_with_port + public_filename)\n end",
"title": ""
},
{
"docid": "6f7e2342d92f99ce9e827168e78f25d2",
"score": "0.6661615",
"text": "def full_url(url, path)\n if path.start_with?('http')\n path\n else\n url = url[0..1] if url.end_with?('/')\n path = path[1..-1] if path.start_with?('/')\n \"#{url}/#{path}\"\n end\n end",
"title": ""
},
{
"docid": "6c21180773c099334421fd902e8df89b",
"score": "0.6651101",
"text": "def absolute_url\n\t\treturn \"#{$domain}/#{self.photo.url}\"\n\tend",
"title": ""
},
{
"docid": "6f4b5d84da4bbe154507dc6fd29f9719",
"score": "0.66394985",
"text": "def valid_url?\n\t\t# http:// or not http://\n\t\tx = self.long_url.start_with?(\"http://\", \"https://\")\n\t\tif x == false\n\t\t\treturn \"http://\" + self.long_url\n\t\telse\n\t\t\treturn self.long_url\n\t\tend\n\tend",
"title": ""
},
{
"docid": "304cb869985e53b533cba52934aa5f5b",
"score": "0.66387093",
"text": "def normalize_url url\n unless url.match(/https?:\\/\\//)\n url = \"http://#{url}\"\n end\n\n url\n end",
"title": ""
},
{
"docid": "bf13640337da5fdd04a587a898f03722",
"score": "0.66242105",
"text": "def render_url(url)\n url.blank? ? 'link not available' : absolutize_url(url)\n end",
"title": ""
},
{
"docid": "3de921e7f020222b084ed82cbb10ebb1",
"score": "0.66048974",
"text": "def normalise\n Wgit::Url.new(@uri.normalize.to_s)\n end",
"title": ""
},
{
"docid": "fff47d7f66847dc836bece8e283d7e6e",
"score": "0.6591519",
"text": "def url_safe\n URI.parse(url).to_s\n rescue URI::InvalidURIError\n URI.escape url\n end",
"title": ""
},
{
"docid": "f8f9500acb26acb171870fb12ac50131",
"score": "0.657832",
"text": "def external_urlname\n return urlname if urlname =~ /\\A(\\/|[a-z]+:\\/\\/)/\n \"http://#{urlname}\"\n end",
"title": ""
},
{
"docid": "3e51682fd0b7a6aa4596926c089b1914",
"score": "0.65674496",
"text": "def full_url\n if school_site.start_with? 'http://'\n school_site\n else\n \"http://#{school_site}\"\n end\n end",
"title": ""
},
{
"docid": "cbf722caeda6115f0f1b6b41dffa535e",
"score": "0.6566889",
"text": "def absolute_url(*args)\n base_url + url(*args)\n end",
"title": ""
},
{
"docid": "d239879498d964fefa54a0876ae65bbf",
"score": "0.655412",
"text": "def pretty_url\n Iconv.iconv(\"ASCII//IGNORE//TRANSLIT\", \"UTF-8\", self).join.sanitize\n rescue\n self.sanitize\n end",
"title": ""
},
{
"docid": "d1725532020755a8281275d60ff33e1a",
"score": "0.65480864",
"text": "def to_absolute(link)\n return nil if link.nil?\n\n # remove anchor\n link = link.to_s.gsub(/#.*$/,'')\n if Gem::Requirement.new('< 2.5').satisfied_by?(Gem::Version.new(RUBY_VERSION))\n link = URI.encode(URI.decode(link))\n end\n\n relative = URI(link)\n absolute = base ? base.merge(relative) : @url.merge(relative)\n\n absolute.path = '/' if absolute.path.empty?\n\n return absolute\n end",
"title": ""
},
{
"docid": "26680bbe8bb8095522921e8bc4c670ca",
"score": "0.6537167",
"text": "def create_absolute_url_from_base(potential_base, relative_url)\n begin\n\t\t\t#puts \"Determine the absolute URL from potential base #{potential_base} and relative URL #{relative_url}\" if @verbose\n\t\t\tnaked_base = url_2_site(potential_base).strip.chop \n\t\t\tputs \"Found absolute URL: #{naked_base+relative_url}\" if @verbose\n\t\t\treturn naked_base + relative_url\n rescue => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "8f8a4a33bf2c14998bbf387d68bf02cc",
"score": "0.6535366",
"text": "def full_url(input)\n expand_url(input, site_url)\n end",
"title": ""
},
{
"docid": "d172f9fa9eefde82405c434e1d1b56db",
"score": "0.65206796",
"text": "def format_url\n self.url.chomp\n if self.url.match(\"https://\") || self.url.match(\"http://\")\n else self.url = \"http://\" + url\n end\n self.url\n end",
"title": ""
},
{
"docid": "044f8bda35350b20346572daf01125df",
"score": "0.6517275",
"text": "def absolutify url, cd \n url = url.to_s\n # deal w/ bad URLs, already absolute, etc\n begin\n u = URI.parse(url)\n rescue\n # GIGO, no need for alarm\n return url\n end\n\n return url if u.absolute? # http://example.com/about\n c = URI.parse(cd)\n return c.scheme + \"://\" + c.host + url if url.index('/') == 0 # /about\n return cd + url if url.match(/^[a-zA-Z]+/) # about*\n\n # only relative from here on in; ../about, ./about, ../../about\n u_dirs = u.path.split('/')\n c_dirs = c.path.split('/')\n\n # move up the directory until there are no more relative paths\n u.path.split('/').each do |x|\n break unless (x == '' || x == '..' || x == '.')\n u_dirs.shift\n c_dirs.pop unless x == '.'\n end\n return c.scheme + \"://\" + c.host + c_dirs.join('/') + '/' + u_dirs.join('/')\n end",
"title": ""
},
{
"docid": "6c6ab11c884591c9a7a7ad952e7506f3",
"score": "0.65126985",
"text": "def full_url\n\t\tcase typ\n\t\twhen /wikipedia_(..)/\n\t\t\treturn \"http://\"+$~[1]+\".wikipedia.org/wiki/\"+url\n\t\twhen \"gutenberg.org\"\n\t\t\treturn \"http://www.gutenberg.org/author/\"+url\n\t\twhen \"gutenberg.spiegel.de\"\n\t\t\treturn \"http://gutenberg.spiegel.de/autoren/\"+url+\".htm\"\n\t\twhen \"fictionfantasy.de\"\n\t\t\treturn \"http://www.fictionfantasy.de/load.php?name=News&file=article&sid=\"+url\n\t\twhen \"homepage\", \"sonstiges\"\n\t\t\t# return url\n\t\telse\n\t\t\t# return url\n\t\tend\n\t\tif url.starts_with? \"http://\" then\n\t\t\treturn url\n\t\telse\n\t\t\treturn \"http://\"+url\n\t\tend\n\t\t# TODO\n\t\t# dsfdb.org, isfdb.org\n\t\t# perrypedia, perry-rhodan.net link\n\t\t# http://www.nemesisarchiv.de.vu/\n\tend",
"title": ""
},
{
"docid": "8abb08432d258796a2bd6ec7f7ef902f",
"score": "0.651121",
"text": "def sanitize_url(value)\n value = sanitize_string(value)\n value = value.sub('./', '') if value.start_with?('./')\n value\n end",
"title": ""
},
{
"docid": "8f50de52919bab0721644b559cbfa761",
"score": "0.64900166",
"text": "def normalize_url(value)\n svalue = value.to_s\n pref = @req.api_prefix\n suffix = @req.api_suffix\n svalue.match(pref) ? svalue : \"#{pref}/#{svalue}#{suffix}\"\n end",
"title": ""
},
{
"docid": "91b446094ac9299c20857b1c8439cedb",
"score": "0.6489365",
"text": "def slashless_url(url)\n url.chomp('/')\n end",
"title": ""
},
{
"docid": "37c44f2d6b0f6820a77c18f65d23b70d",
"score": "0.6489176",
"text": "def normalize\n Wgit::Url.new(@uri.normalize.to_s)\n end",
"title": ""
},
{
"docid": "cc6eca05807a724ba10cb4e8baf2b3f2",
"score": "0.64889026",
"text": "def formatted_website_url\n first_url = self.webaddr.is_a?(Array) ? self.webaddr.first : self.webaddr\n Addressable::URI.heuristic_parse(first_url).to_s\n end",
"title": ""
},
{
"docid": "5c99e7b19147fd0d61e40984a7067c09",
"score": "0.64833724",
"text": "def clean_url(url)\n begin\n url = Addressable::URI.escape(url)\n url = \"http://#{url}\" if Addressable::URI.parse(url).scheme.nil?\n uri = URI(url)\n host = uri.host.downcase\n\n if host.start_with?('www.')\n host = host[4..-1]\n end\n\n host + uri.path.downcase\n rescue\n logger.debug \"Bad URL encountered in clean_url\"\n url\n end\n end",
"title": ""
},
{
"docid": "a503fa11bc448f09fc6cf6e3d400fe4b",
"score": "0.64807886",
"text": "def _uri(uri, absolute = false, format = \"do\")\n return absolute ? \"#{uri}.#{format}\" : \"#{uri_prefix}#{uri ? uri : ''}.#{format}\"\n end",
"title": ""
},
{
"docid": "7881738623093f6ef16f09405261382f",
"score": "0.6479005",
"text": "def to_relative_url\n to_relative_uri.to_s\n end",
"title": ""
},
{
"docid": "5d04b5cd9265a1693316f89616c16cf4",
"score": "0.64777553",
"text": "def absolute_url(url, options={})\n URL.new(env, url, options).to_absolute\n end",
"title": ""
},
{
"docid": "704c2a45c199c84c6abfd9efed2810f3",
"score": "0.64773786",
"text": "def full_url\n full_domain(:with_protocol => true)\n end",
"title": ""
},
{
"docid": "704c2a45c199c84c6abfd9efed2810f3",
"score": "0.64773786",
"text": "def full_url\n full_domain(:with_protocol => true)\n end",
"title": ""
},
{
"docid": "a2ca6b53643a7a1997fbec339c460eae",
"score": "0.64708585",
"text": "def external_url(url)\n if url.blank?\n ''\n else\n url.match(/^http(s?):\\/\\//) ? url : \"http://#{url}\"\n end\n end",
"title": ""
},
{
"docid": "90e9de54c1a684373f19f8ad00df5c18",
"score": "0.6468999",
"text": "def fullurl\n if Rails.env == 'development'\n 'http://localhost:3000' + object.url.to_s\n else\n 'http://signlab-rails.herokuapp.com' + object.url.to_s\n end\n end",
"title": ""
},
{
"docid": "1757d37314d84fc9079605003d8be765",
"score": "0.64660454",
"text": "def clean_url url\n return url if url.nil?\n url.gsub('%2F', '/').gsub(/^\\/+/, '').gsub('//', '/')\n end",
"title": ""
},
{
"docid": "a7ed77e3565abb95a771ea931b7e214f",
"score": "0.64533895",
"text": "def url\n ''\n end",
"title": ""
},
{
"docid": "99ba905ae11082c836618744a7126567",
"score": "0.6451958",
"text": "def url\n u = read_attribute(:url)\n u !~ /\\Ahttp/i ? \"http://#{u}\" : u\n end",
"title": ""
},
{
"docid": "2fff2256a80fa0081938fcf7b519286b",
"score": "0.644452",
"text": "def absolute_uri_path(path)\n \"#{root_uri}#{path}\"\n end",
"title": ""
},
{
"docid": "e2c4e9e8d5789b45a159d5050c8ecbe8",
"score": "0.6443363",
"text": "def canonical_url\n @canonical_url ||= url_without_params.chomp('/')\n end",
"title": ""
},
{
"docid": "94f8f3b4f56f349a6f5902348d3476eb",
"score": "0.6430366",
"text": "def clean_url\n url = self.original_url\n url = url.gsub(' ', '')\n url = url.strip\n if url !~ REGEX_PROTOCOL\n url = \"http://#{url}\"\n end\n begin\n self.original_url = URI.parse(url).normalize.to_s\n rescue URI::InvalidURIError\n # handle urls that cannot be parsed\n self.original_url = url\n end\n end",
"title": ""
},
{
"docid": "d170b87001ad28d5296b0072b45954ee",
"score": "0.64288616",
"text": "def full_url(path)\n uri = URI.parse path\n uri.scheme, uri.host, uri.port = request.scheme, request.host, (request.port == 80 ? nil : request.port)\n uri.to_s\n end",
"title": ""
},
{
"docid": "5cd1ab077914c68f4429d70b94eb8cbc",
"score": "0.64267415",
"text": "def absolute?\n @uri.absolute?\n end",
"title": ""
},
{
"docid": "51ad76721ac638f41451db7e681c9681",
"score": "0.641972",
"text": "def full_url(path)\n \"#{base_url}#{path}\"\n end",
"title": ""
},
{
"docid": "2b8ea1935faadbd69a32b9f38bcdfad6",
"score": "0.64143604",
"text": "def relative_url(url)\n url.gsub(%r{\\Ahttp://[^/]*}, '')\n end",
"title": ""
},
{
"docid": "89826458319640da62561d2e944d9016",
"score": "0.6412014",
"text": "def url_for(str)\n return str if str =~ /^[|[:alpha:]]+:\\/\\//\n File.join((uri.path.empty?) ? uri.to_s : File.dirname(uri.to_s), str)\n end",
"title": ""
},
{
"docid": "b833ba35b0e4bef27aeb6621f45f640e",
"score": "0.6411115",
"text": "def normalize_url(url)\n Addressable::URI.parse(url).normalize.to_s\n end",
"title": ""
},
{
"docid": "3ad59990e083f172e22773c6df0d79e3",
"score": "0.6404994",
"text": "def absolute_url(url, options={})\n URL.new(env, url, options).to_absolute\n end",
"title": ""
},
{
"docid": "9034b3ea0cd15c9173d253f757e9d97f",
"score": "0.6398986",
"text": "def absolute?; !scheme.nil?; end",
"title": ""
},
{
"docid": "a09627c92912c8643817b0eedfa7514b",
"score": "0.6394776",
"text": "def url\n return @url if @url\n\n url = permalink ?\n if site.config['relative_permalinks']\n File.join(@dir, permalink)\n else\n permalink\n end :\n {\n 'lang' => self.lang,\n 'categories' => self.categories,\n 'basename' => self.basename,\n }.inject(template) { |result, token|\n result.gsub(/:#{token.first}/, token.last)\n }.gsub(/\\/\\//, '/')\n\n # sanitize url\n @url = url.split('/').reject { |part| part =~ /^\\.+$/ }.join('/')\n @url += '/' if url =~ /\\/$/\n @url.gsub!(/\\A([^\\/])/, '/\\1')\n @url\n end",
"title": ""
},
{
"docid": "aef08f77479542fddaebd04f9cf609ff",
"score": "0.63890004",
"text": "def absolute_url(url_or_path, options= {})\n url = url_or_path =~ /^#{base_url}/ ? url_or_path : \"#{base_url}#{url_or_path}\"\n params = options.fetch(:params, {})\n query = params.inject([]) do |rv, param|\n rv.concat((param[1].is_a?(Array) ? param[1] : [param[1]]).map {|v| \"#{uri_escape(param[0])}=#{uri_escape(v)}\"})\n rv\n end\n url += \"?#{query.join('&')}\" if query.any?\n url\n end",
"title": ""
},
{
"docid": "b84f3a03ec0634dfb54e44e4e4186f01",
"score": "0.6382454",
"text": "def to_absolute(link)\n # remove fragment\n link = link.split('#').first if link.index('#')\n url = URI(URI.encode(link))\n raise URI::InvalidURIError unless url.path\n url = @url.merge(url) if url.relative?\n url.path = '/' if url.path.empty?\n url\n end",
"title": ""
},
{
"docid": "4af7faa7910d02beaff9f095ee3eb507",
"score": "0.63725364",
"text": "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end",
"title": ""
},
{
"docid": "4af7faa7910d02beaff9f095ee3eb507",
"score": "0.63725364",
"text": "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end",
"title": ""
},
{
"docid": "2c16519b7e31c6fc2b23fefee8e0bd63",
"score": "0.63489693",
"text": "def is_absolute_part(part)\n part.strip.starts_with?('/') || part.strip.starts_with?('\\\\') ||\n part.strip =~ /^[A-Za-z]:([\\/\\\\])?/\n end",
"title": ""
},
{
"docid": "a95e6bb392fe1b4f15989503067ff9b6",
"score": "0.63463867",
"text": "def absolute_url(url)\n super\n end",
"title": ""
},
{
"docid": "8d45dc0ccea2704c8263ccfeff83340e",
"score": "0.6336805",
"text": "def base_url\n current_base_href = base_href.to_s.strip.empty? ? nil : URL.absolutify(base_href, URL.new(url).root_url)\n current_base_href || url\n end",
"title": ""
},
{
"docid": "17339155e09de41b1811ff9d4b99c0b4",
"score": "0.63340735",
"text": "def human_url\n return data()['project_uri']\n end",
"title": ""
},
{
"docid": "e1c2fb4d72af6f6be4bf64a178ba9987",
"score": "0.632937",
"text": "def urlpath\n path = cleanpath\n path.blank? ? '/root' : '/' + path\n end",
"title": ""
},
{
"docid": "714033da0a8834f45826ee4a254f419f",
"score": "0.63258636",
"text": "def to_s\n url\n end",
"title": ""
},
{
"docid": "8a816669f15584035afda78ec0c80b6c",
"score": "0.63234663",
"text": "def url_with_prefix\n\t\t( url.blank? ) ? '' :\n\t\t\t( url.match(/^http(s)?:\\/\\//) ? url : \"http://#{url}\" )\n\tend",
"title": ""
},
{
"docid": "371c5c44c9c26da43133f5891d0ac089",
"score": "0.6320904",
"text": "def short_url\n return nil if url.nil?\n url.gsub(\"http://\",\"\").gsub(\"www.\", \"\")\n end",
"title": ""
},
{
"docid": "42fb055dbf5e0680908aec3456b839fd",
"score": "0.6313152",
"text": "def to_absolute(link)\n # remove anchor\n link = URI.encode(link.to_s.gsub(/#[a-zA-Z0-9_-]*$/,''))\n\n relative = URI(link)\n absolute = @url.merge(relative)\n\n absolute.path = '/' if absolute.path.empty?\n\n return absolute\n end",
"title": ""
},
{
"docid": "53ad616b94f91a7a96a61402b7f3830d",
"score": "0.6312954",
"text": "def url(p = path)\n \"/\" + relative_path(p).to_s.downcase.gsub(/\\s/, \" \")\n end",
"title": ""
},
{
"docid": "8c8d25c4480585c40998e1ac35ffebd5",
"score": "0.63062686",
"text": "def to_s\n url\n end",
"title": ""
},
{
"docid": "3bb0d97820df7556753e1e9ea24cfe40",
"score": "0.62966377",
"text": "def normalized_permalink_url\n @normalized_permalink_url ||= Addressable::URI.parse(permalink_url).normalize\n end",
"title": ""
},
{
"docid": "9aacaf4c2ed1394be431e3a080efe5d8",
"score": "0.6293518",
"text": "def clean_url\n #use try instead for nil?\n unless self.url.nil?\n parsed_url = URI.parse(self.url).host.sub(/\\Awww\\./, '')\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "bde7fd9ad73a37841882b27ebf2b1799",
"score": "0.6293183",
"text": "def normalize_url(url)\n return nil if url.nil?\n begin\n uri = Addressable::URI.heuristic_parse(url)\n uri.host.present? && /^http(s)?$/.match(uri.scheme) ? uri.to_s : nil\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "f74025b16edb9c3d066ed4b79ef37691",
"score": "0.62873864",
"text": "def valid_url?(url)\n uri = URI.parse(url)\n\n uri.absolute?\n rescue\n false\n end",
"title": ""
}
] |
d66b7f8f471fafbfc33b5ecb7602d4d5
|
PATCH/PUT /patients/1 PATCH/PUT /patients/1.json
|
[
{
"docid": "8a20361957b5f13a9a4c3d638443a92c",
"score": "0.0",
"text": "def update\n @email = current_user.email\n @patient = Patient.find(params[:id])\n @patient_email = @patient.email\n set_category\n if @email == @patient.email || current_user.admin\n respond_to do |format|\n if @patient.update(patient_params)\n if User.find_by_email(@patient_email)\n @user = User.find_by_email(@patient_email)\n @user.skip_reconfirmation!\n @user.update(email: patient_params[:email])\n end\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to @patient, notice: 'You do not have permissions to edit other patients!'}\n format.json { render :show, status: :created, location: @patient }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d5466e81427206f20085bd53c82258c4",
"score": "0.73599654",
"text": "def update\n @patient = Patient.find(params[:id])\n\n if @patient.update(params[:patient])\n head :no_content\n else\n render json: @patient.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "36e5c7594de56e92e3eed7edb8993a93",
"score": "0.7324124",
"text": "def update\n if @patient.update(patient_params)\n head :no_content\n else\n render json: @patient.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f87f59849d64d8db535a98a6aadb8e3e",
"score": "0.72302777",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, :notice => 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @patient.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bb9af17ee1261721b717a78f9ef0ec5",
"score": "0.72193384",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bb9af17ee1261721b717a78f9ef0ec5",
"score": "0.72193384",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bb9af17ee1261721b717a78f9ef0ec5",
"score": "0.72193384",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bb9af17ee1261721b717a78f9ef0ec5",
"score": "0.72193384",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bb9af17ee1261721b717a78f9ef0ec5",
"score": "0.72193384",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b262cdc8b36caf8adce510b206711814",
"score": "0.7200429",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b262cdc8b36caf8adce510b206711814",
"score": "0.7200429",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "142090694b38c379d9de1a9d54f52bc3",
"score": "0.7169589",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to patients_path, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77b8a047c670dfc9d76aa0de7b6cb5bd",
"score": "0.7159422",
"text": "def update\n @patient.update_attributes(params[:patient])\n respond_with(@patient)\n end",
"title": ""
},
{
"docid": "5582452207c359c3b976e0ba3c854043",
"score": "0.71378225",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Данные пациента обновлены.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "882bfb721860c62892e0d7aca8b1f9f9",
"score": "0.71300584",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "882bfb721860c62892e0d7aca8b1f9f9",
"score": "0.71300584",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78da63173319905891ecebbd36c483ff",
"score": "0.7124126",
"text": "def update\r\n @patient = Patient.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @patient.update_attributes(params[:patient])\r\n format.html { redirect_to @patient, notice: 'Patient 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: @patient.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "9a5d7c216190939e461958ab6bbbd04d",
"score": "0.71132267",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to [@user, @patient], notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "339cde2cfd8c9e0b3f104201338f1104",
"score": "0.70992374",
"text": "def update\n \n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27ee39609b9c3749691f6709840e7d9a",
"score": "0.70731217",
"text": "def update\n @patient = Patient.find(params[:userid])\n\n if @patient.update_attributes(params[:patient])\n head :no_content\n else\n render json: @patient.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0954cf3271ccbc29a0085dec6014d654",
"score": "0.70727235",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: t('update_success') }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dd8ede9d69252778603c133c2a2738b",
"score": "0.70531213",
"text": "def update\n respond_to do |format|\n if @patient.update_attributes(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e64e7c8ea4819565d6cae4a134f3bcf",
"score": "0.7036924",
"text": "def refresh_patient\n patient_id = params.require(:patient_id)\n update_npid = params[:update_npid]&.casecmp?('true') || false\n\n patient = service.update_local_patient(Patient.find(patient_id), update_npid: update_npid)\n\n render json: patient\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79289367b5de27edfce72e30a0d8d409",
"score": "0.7030914",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d42b76bfaeee9bc385dd6b9344e8f3ca",
"score": "0.7027199",
"text": "def update\n respond_to do |format|\n if @patient.preprocess_and_update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render json: @patient, status: :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cc88b59799f62e8e62c2df900cb7905",
"score": "0.70038533",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27c242dd763a28d6a0720802ddf4ef94",
"score": "0.6987703",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to dashboard_patients_path, notice: \"Paciente #{@patient.first_name} editado com sucesso!\" }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f440b6d1f03be241da58e1b00f66ecc",
"score": "0.6986099",
"text": "def update\n if request.patch?\n status_unsupported_media_type && return unless content_type_header?('application/json-patch+json')\n\n # Parse in the JSON patch\n patch = Hana::Patch.new(JSON.parse(request.body.string))\n else\n status_unsupported_media_type && return unless content_type_header?('application/fhir+json')\n\n # Parse in the FHIR\n contents = FHIR.from_contents(request.body.string)\n errors = contents&.validate\n status_bad_request(format_fhir_validation_errors(errors)) && return if contents.nil? || !errors.empty?\n end\n\n resource_type = params.permit(:resource_type)[:resource_type]&.downcase\n case resource_type\n when 'patient'\n return if doorkeeper_authorize!(\n :'user/Patient.write',\n :'user/Patient.*',\n :'system/Patient.write',\n :'system/Patient.*'\n )\n\n # Get the patient that needs to be updated\n patient = get_patient(params.permit(:id)[:id])\n status_forbidden && return if patient.nil?\n\n # Get the contents from applying a patch, if needed\n if request.patch? && !patient.nil?\n begin\n contents = apply_patch(patient, patch)\n rescue StandardError => e\n status_bad_request([['Unable to apply patch', e&.message].compact.join(': ')]) && return\n end\n end\n\n # Get patient values before updates occur for later comparison\n patient_before = patient.dup\n\n # Get key value pairs from the update.\n # fhir_map is of the form:\n # { attribute_name: { value: <converted-value>, path: <fhirpath-to-corresponding-fhir-element> } }\n fhir_map = patient_from_fhir(contents, default_patient_jurisdiction_id)\n request_updates = fhir_map.transform_values { |v| v[:value] }\n status_unprocessable_entity(nil, nil, nil) && return if request_updates.nil?\n\n # Assign any remaining updates to the patient\n # NOTE: The patient.update method does not allow a context to be passed, so first we assign the updates, then save\n patient.assign_attributes(request_updates)\n\n # Wrap updates to the Patient, Transfer creation, and History creation in a transaction\n # so that they occur atomically\n ActiveRecord::Base.transaction do\n # Verify that the updated jurisdiction and other updates are valid\n unless jurisdiction_valid_for_update?(patient) && patient.save(context: :api)\n req_json = request.patch? ? patient.as_fhir.to_json : JSON.parse(request.body.string)\n status_unprocessable_entity(patient, fhir_map, req_json) && return\n end\n\n # If the jurisdiction was changed, create a Transfer\n if request_updates&.keys&.include?(:jurisdiction_id) && !request_updates[:jurisdiction_id].nil?\n Transfer.create!(patient: patient, from_jurisdiction: patient_before.jurisdiction, to_jurisdiction: patient.jurisdiction, who: @current_actor)\n end\n\n # Handle creating history items based on all of the updates\n update_all_patient_history(request_updates, patient_before, patient)\n end\n\n status_ok(patient.as_fhir) && return\n when 'relatedperson'\n return if doorkeeper_authorize!(\n :'user/RelatedPerson.write',\n :'user/RelatedPerson.*',\n :'system/RelatedPerson.write',\n :'system/RelatedPerson.*'\n )\n\n # Get the CloseContact that needs to be updated\n close_contact = get_record(CloseContact, params.permit(:id)[:id])\n status_forbidden && return if close_contact.nil?\n\n # Get the contents from applying a patch, if needed\n if request.patch? && !close_contact.nil?\n begin\n contents = apply_patch(close_contact, patch)\n rescue StandardError => e\n status_bad_request([['Unable to apply patch', e&.message].compact.join(': ')]) && return\n end\n end\n\n fhir_map = close_contact_from_fhir(contents)\n request_updates = fhir_map.transform_values { |v| v[:value] }\n status_unprocessable_entity && return if request_updates.nil?\n\n # Assign any remaining updates to the close_contact\n close_contact.assign_attributes(request_updates)\n\n # Wrap updates to the CloseContact and History creation in a transaction\n ActiveRecord::Base.transaction do\n unless referenced_patient_valid_for_client?(close_contact, :patient_id) && close_contact.save(context: :api)\n req_json = request.patch? ? close_contact.as_fhir.to_json : JSON.parse(request.body.string)\n status_unprocessable_entity(close_contact, fhir_map, req_json) && return\n end\n\n Rails.logger.info \"Updated Close Contact (ID: #{close_contact.id}) for Patient with ID: #{close_contact.patient_id}\"\n History.close_contact_edit(patient: close_contact.patient_id,\n created_by: @current_actor_label,\n comment: \"Close contact edited via the API (ID: #{close_contact.id}).\")\n end\n status_ok(close_contact.as_fhir) && return\n when 'immunization'\n return if doorkeeper_authorize!(\n :'user/Immunization.write',\n :'user/Immunization.*',\n :'system/Immunization.write',\n :'system/Immunization.*'\n )\n\n # Get the Vaccine that needs to be updated\n vaccine = get_record(Vaccine, params.permit(:id)[:id])\n status_forbidden && return if vaccine.nil?\n\n # Get the contents from applying a patch, if needed\n if request.patch? && !vaccine.nil?\n begin\n contents = apply_patch(vaccine, patch)\n rescue StandardError => e\n status_bad_request([['Unable to apply patch', e&.message].compact.join(': ')]) && return\n end\n end\n\n fhir_map = vaccine_from_fhir(contents)\n request_updates = fhir_map.transform_values { |v| v[:value] }\n status_unprocessable_entity && return if request_updates.nil?\n\n # Assign any remaining updates to the Vaccine\n vaccine.assign_attributes(request_updates)\n\n # Wrap updates to the Vaccine and History creation in a transaction\n ActiveRecord::Base.transaction do\n unless referenced_patient_valid_for_client?(vaccine, :patient_id) && vaccine.save\n req_json = request.patch? ? vaccine.as_fhir.to_json : JSON.parse(request.body.string)\n status_unprocessable_entity(vaccine, fhir_map, req_json) && return\n end\n\n Rails.logger.info \"Updated Vaccination (ID: #{vaccine.id}) for Patient with ID: #{vaccine.patient_id}\"\n History.vaccination_edit(patient: vaccine.patient_id,\n created_by: @current_actor_label,\n comment: \"Vaccination edited via the API (ID: #{vaccine.id}).\")\n end\n status_ok(vaccine.as_fhir) && return\n else\n status_not_found && return\n end\n rescue JSON::ParserError\n status_bad_request(['Invalid JSON in request body'])\n end",
"title": ""
},
{
"docid": "3c9afb1f29179719fb7a43af2782bb1b",
"score": "0.6966618",
"text": "def update\n if request.patch?\n status_unsupported_media_type && return unless content_type_header?('application/json-patch+json')\n\n # Parse in the JSON patch\n request_body = request.body.read\n patch = Hana::Patch.new(JSON.parse(request_body))\n else\n status_unsupported_media_type && return unless content_type_header?('application/fhir+json')\n\n # Parse in the FHIR\n request_body = request.body.read\n contents = FHIR.from_contents(request_body) if request_body.present?\n errors = contents&.validate\n status_bad_request(format_fhir_validation_errors(errors)) && return if contents.nil? || !errors.empty?\n end\n\n resource_type = params.permit(:resource_type)[:resource_type]&.downcase\n case resource_type\n when 'patient'\n return if doorkeeper_authorize!(*PATIENT_WRITE_SCOPES)\n\n # Get the patient that needs to be updated\n patient = get_patient(params.permit(:id)[:id])\n status_forbidden && return if patient.nil?\n\n # Get the contents from applying a patch, if needed\n contents = apply_patch(patient, patch) if request.patch?\n\n # Get patient values before updates occur for later comparison\n patient_before = patient.dup\n\n # Get key value pairs from the update.\n # fhir_map is of the form:\n # { attribute_name: { value: <converted-value>, path: <fhirpath-to-corresponding-fhir-element> } }\n fhir_map = patient_from_fhir(contents, default_patient_jurisdiction_id)\n request_updates = fhir_map.transform_values { |v| v[:value] }\n status_unprocessable_entity(nil, nil, nil) && return if request_updates.nil?\n\n # Assign any remaining updates to the patient\n # NOTE: The patient.update method does not allow a context to be passed, so first we assign the updates, then save\n patient.assign_attributes(request_updates)\n\n # Wrap updates to the Patient, Transfer creation, and History creation in a transaction\n # so that they occur atomically\n ActiveRecord::Base.transaction do\n # Verify that the updated jurisdiction and other updates are valid\n unless jurisdiction_valid_for_update?(patient) && patient.save(context: :api) && fhir_map.all? { |_k, v| v[:errors].blank? }\n req_json = request.patch? ? patient.as_fhir.to_json : JSON.parse(request_body)\n status_unprocessable_entity(patient, fhir_map, req_json) && return\n end\n\n # If the jurisdiction was changed, create a Transfer\n if request_updates&.keys&.include?(:jurisdiction_id) &&\n !request_updates[:jurisdiction_id].nil? &&\n patient_before.jurisdiction_id != patient.jurisdiction_id\n Transfer.create!(patient: patient, from_jurisdiction: patient_before.jurisdiction, to_jurisdiction: patient.jurisdiction, who: @current_actor)\n end\n\n # Handle creating history items based on all of the updates\n update_all_patient_history(request_updates, patient_before, patient)\n end\n\n status_ok(patient.as_fhir) && return\n when 'relatedperson'\n return if doorkeeper_authorize!(*RELATED_PERSON_WRITE_SCOPES)\n\n # Get the CloseContact that needs to be updated\n close_contact = get_record(CloseContact, params.permit(:id)[:id])\n status_forbidden && return if close_contact.nil?\n\n # Get the contents from applying a patch, if needed\n contents = apply_patch(close_contact, patch) if request.patch?\n\n update_record(*update_model_from_fhir(close_contact, contents, :close_contact_from_fhir), request_body, :close_contact_edit, 'close contact')\n\n status_ok(close_contact.as_fhir) && return\n when 'immunization'\n return if doorkeeper_authorize!(*IMMUNIZATION_WRITE_SCOPES)\n\n # Get the Vaccine that needs to be updated\n vaccine = get_record(Vaccine, params.permit(:id)[:id])\n status_forbidden && return if vaccine.nil?\n\n # Get the contents from applying a patch, if needed\n contents = apply_patch(vaccine, patch) if request.patch?\n\n update_record(*update_model_from_fhir(vaccine, contents, :vaccine_from_fhir), request_body, :vaccination_edit, 'vaccination')\n\n status_ok(vaccine.as_fhir) && return\n when 'observation'\n return if doorkeeper_authorize!(*OBSERVATION_WRITE_SCOPES)\n\n # Get the Lab that needs to be updated\n lab = get_record(Laboratory, params.permit(:id)[:id])\n status_forbidden && return if lab.nil?\n\n # Get the contents from applying a patch, if needed\n contents = apply_patch(lab, patch) if request.patch?\n\n update_record(*update_model_from_fhir(lab, contents, :laboratory_from_fhir), request_body, :lab_result_edit, 'lab result')\n\n status_ok(lab.as_fhir) && return\n else\n status_not_found && return\n end\n rescue JSON::ParserError\n status_bad_request(['Invalid JSON in request body'])\n end",
"title": ""
},
{
"docid": "de54d64c320be56c7fef14e3a5a525de",
"score": "0.69627815",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @patient.update(patient_params)\n\t\t\t\tformat.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @patient }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @patient.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9f40b320bb0820be5fb7ad8c1e3b3777",
"score": "0.6952915",
"text": "def update\n status_unsupported_media_type && return unless content_type_header?\n\n # Parse in the FHIR::Patient\n contents = FHIR.from_contents(request.body.string)\n errors = contents&.validate\n status_bad_request(format_fhir_validation_errors(errors)) && return if contents.nil? || !errors.empty?\n\n resource_type = params.permit(:resource_type)[:resource_type]&.downcase\n case resource_type\n when 'patient'\n return if doorkeeper_authorize!(\n :'user/Patient.write',\n :'user/Patient.*',\n :'system/Patient.write',\n :'system/Patient.*'\n )\n\n updates = Patient.from_fhir(contents, default_patient_jurisdiction_id)\n\n resource = get_patient(params.permit(:id)[:id])\n\n # Grab patient before changes to construct diff\n patient_before = resource.dup\n\n # If \"monitoring\" was set to false for a Patient that was previously being monitored\n if !resource.nil? && resource.monitoring && updates&.key?(:monitoring) && !updates[:monitoring]\n # Add closed_at to updates\n updates[:closed_at] = DateTime.now\n end\n else\n status_not_found && return\n end\n\n status_forbidden && return if resource.nil?\n\n # Try to update the resource\n status_unprocessable_entity && return if updates.nil?\n\n # The resource.update method does not allow a context to be passed, so first we assign the updates, then save\n resource.assign_attributes(updates)\n unless jurisdiction_valid_for_client?(resource) && resource.save(context: :api)\n status_unprocessable_entity(format_model_validation_errors(resource)) && return\n end\n\n if resource_type == 'patient'\n # Update patient history with detailed edit diff\n Patient.detailed_history_edit(patient_before, resource, resource.creator&.email, updates, is_api_edit: true)\n end\n\n status_ok(resource.as_fhir) && return\n rescue StandardError\n render json: operation_outcome_fatal.to_json, status: :internal_server_error\n end",
"title": ""
},
{
"docid": "9801848a09f338d31dd358fad95612ff",
"score": "0.6942266",
"text": "def update\n \t# updating the patient\n \tif @patient.update(patient_params)\n \t\t# response to the JSON\n\t\t\trender json: { success: true,message: \"Patient Successfully Updated.\", response: PatientSerializer.new(@patient).as_json(root: false) },:status=>200\n \treturn\n else\n render :json=> { success: false, message: \"Patient is not available\" },:status=> 404\n \treturn\n end\n end",
"title": ""
},
{
"docid": "2c6600b457103f0bf2c46e713bcd654a",
"score": "0.68887997",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to admin_patient_path(@patient), notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: admin_patient_path(@patient) }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c036f0b28ee0079edd59c29b5afc84d",
"score": "0.68753344",
"text": "def update_patient(patientid:, **params)\n # patientid: ,\n # status: nil, #active, inactive, prospective, deleted\n # firstname: ,\n # lastname: ,\n # sex: ,\n # dob: ,\n # homephone: nil,\n # guarantormiddlename: nil,\n # guarantorlastname: nil,\n # guarantoraddress1: nil,\n # guarantoraddress2: nil,\n # guarantorstate: nil,\n # guarantorzip: nil,\n # guarantordob: nil,\n # guarantoremail: ,\n # guarantorphone: nil,\n # departmentid: ,\n # guarantorfirstname: nil,\n # guarantorcity: nil,\n # middlename: nil,\n # guarantorssn: nil,\n # guarantorrelationshiptopatient: nil,\n # contactname: nil,\n # contactrelationship: nil,\n # contactmobilephone: nil\n\n endpoint = \"patients/#{patientid}\"\n response = @connection.PUT(endpoint, params, common_headers)\n raise \"HTTP error for endpoint #{endpoint} code encountered: #{response.code}\" unless response.code.to_i == 200\n end",
"title": ""
},
{
"docid": "1fec6e28c99b0215a4bf965777bc46f6",
"score": "0.68560815",
"text": "def update\n respond_to do |format|\n @person = @patient.person\n if @person.update(patient_params[:person_attributes])\n if patient_params.present?\n @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f9e704f0f23e3074289ac92a1f81e580",
"score": "0.6811721",
"text": "def update\n patientId=params[:patient_id]\n patientName= params[:patient_name]\n appointment = Appointment.find(params[:id])\n \n case appointment.status\n when 'booked'\n appointment.cancelled!\n when 'available'\n appointment.update(status:1)\n end\n\n render json: appointment\n end",
"title": ""
},
{
"docid": "d0196bd52f516e11eca6037e1d955ab2",
"score": "0.6800073",
"text": "def update\n authorize! :edit, Patient\n respond_to do |format|\n if @patient.update(patient_params)\n # set_form_data(params[:custom_form_ids]) if params[:custom_form_ids]\n format.html { redirect_to patient_path, flash: { success: 'patient was successfully updated.' } }\n format.json { render :show, status: :ok, location: @patient }\n else\n # set_available_custom_forms\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe11bf50a3d9d3eece69bb200dc8991d",
"score": "0.6780705",
"text": "def update\n @patient = Patient.find(params[:id])\n @patient.updated_user = current_user.login_name\n set_patient_session @patient.id, @patient.patient_name\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_back_or_default patient_path(@patient), notice: 'Patient was successfully created.' }\n format.json { head :no_content }\n else\n format.html {\n setup_static_variables\n render action: \"edit\"\n }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7de5e875fa788b25b2c918f1c7d22ace",
"score": "0.67768294",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n @doctors = Docotr.all\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cfe273de9488f6a6df534c11225e250",
"score": "0.6745362",
"text": "def update_patient\n data = get_data\n data.each do |record|\n patient = Patient.find_by_patient_id(record[\"patient_id\"])\n patient.present? ? patient.update(record) : Patient.create(record)\n end\n end",
"title": ""
},
{
"docid": "58202287cfabd4491d8e366b9b3093d1",
"score": "0.6716482",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Paciente actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad892b5aa22c43cbd36f7dbd2444c993",
"score": "0.6706736",
"text": "def update\n patient_params = params[:patient]\n assessment_params = params[:patient].delete(:assessment)\n is_updated = @patient.new_patient_assessment.update_assessment(assessment_params,current_user)\n is_updated = is_updated && @patient.update_attributes(patient_params)\n if is_updated\n @patient.update_values\n end\n respond_to do |format|\n if is_updated\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce7fb20a54c499cb2a6a76eca79e993c",
"score": "0.66969705",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to(@patient, :notice => 'Patient was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @patient.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce7fb20a54c499cb2a6a76eca79e993c",
"score": "0.66969705",
"text": "def update\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to(@patient, :notice => 'Patient was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @patient.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f87d4e46fea4a14dce1ba9487eb34c94",
"score": "0.6663683",
"text": "def update\n respond_to do |format|\n if @patient_info.update(patient_info_params)\n format.html { redirect_to @patient_info, notice: 'Patient info was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient_info }\n else\n format.html { render :edit }\n format.json { render json: @patient_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f87d4e46fea4a14dce1ba9487eb34c94",
"score": "0.6663683",
"text": "def update\n respond_to do |format|\n if @patient_info.update(patient_info_params)\n format.html { redirect_to @patient_info, notice: 'Patient info was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient_info }\n else\n format.html { render :edit }\n format.json { render json: @patient_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f87d4e46fea4a14dce1ba9487eb34c94",
"score": "0.6663683",
"text": "def update\n respond_to do |format|\n if @patient_info.update(patient_info_params)\n format.html { redirect_to @patient_info, notice: 'Patient info was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient_info }\n else\n format.html { render :edit }\n format.json { render json: @patient_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cbf93ea3b74d8f9c763935e49c62b70",
"score": "0.66491514",
"text": "def update\r\n respond_to do |format|\r\n if @patient.update(patient_params)\r\n format.html { redirect_to @patient, notice: 'Datos actualizados con exito.' }\r\n format.json { render :show, status: :ok, location: @patient }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @patient.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "12df9f2f814ea39d04e5648876f2ec14",
"score": "0.66467303",
"text": "def update\n respond_to do |format|\n if @clinic_patient.update(clinic_patient_params)\n format.html { redirect_to @clinic_patient, notice: 'Patient was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @clinic_patient }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clinic_patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0959f2bad86098f8e0a492552768accd",
"score": "0.6599249",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n if @patient.inpatient?\n @patient.map_room_and_bed_to_patient(@patient, params[:room_id], params[:bed_id])\n end\n format.html { redirect_to patients_path, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e00417ac4bca18568b24e8be4342ba99",
"score": "0.65853643",
"text": "def update\n @patient_task = PatientTask.find(params[:id])\n\n respond_to do |format|\n if @patient_task.update_attributes(params[:patient_task])\n format.html { redirect_to @patient_task, notice: 'Patient task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient_task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07bbc634185ce4a3fb1425549f86cbf7",
"score": "0.6557769",
"text": "def update\n return false unless authorize(permissions = [\"edit_patient\"])\n\n @patient = Patient.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n flash.now[:notice] = t(\"patient.messages.update_success\")\n format.html { redirect_to(@patient) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @patient.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f060ec9cf1155b1552a50fb2e9b82ae",
"score": "0.6554377",
"text": "def update\n @patient.specialty_ids = params[:patient][:specialty_ids]\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to root_path, notice: \"Patient was successfully updated.\" }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "dabc1154953eb1a30d47b7e87000255b",
"score": "0.65512973",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n if !user_signed_in?\n format.html { redirect_to root_path }\n else\n flash[:notice] = 'Pacient je bil uspešno posodobljen.'\n if current_user.count_patients == 1\n format.html { redirect_to controller: :patients, action: :edit, id: current_user.find_only_one_patient.id }\n else\n format.html { redirect_to controller: :patients, action: :index }\n end\n end\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9f82d40f643d4450b0da7bffaf1a468",
"score": "0.6551197",
"text": "def update\n @patient = Patient.find(params[:id])\n params[:patient][:admission]=Date.strptime(params[:patient][:admission],'%d/%m/%Y') if params[:patient][:admission]\n params[:patient][:discharge]=Date.strptime(params[:patient][:discharge],'%d/%m/%Y') if params[:patient][:discharge]\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, :notice => 'Patient was successfully updated.' }\n format.json { respond_with_bip(@patient) }\n format.js {render :nothing => true}\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @patient.errors, :status => :unprocessable_entity }\n format.js {render :nothing => true}\n end\n end\n end",
"title": ""
},
{
"docid": "4e61da6571ba1890f39642188fb9a6c8",
"score": "0.6533342",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to distribution_center_patient_path(@distribution_center, @patient), notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html {\n flash.now[:alert] = @patient.errors.full_messages.join(\", \")\n render :edit\n }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a60cbf593fa4572ac7f3e7671b28482e",
"score": "0.6529011",
"text": "def update\n @patient = Patient.find(params[:id])\n \n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n flash[:notice] = \"Patient successfully updated.\"\n if params[:patient][:numberOfTag]\n format.html { render :text => params[:patient][:numberOfTag] }\n format.json { head :ok }\n elsif params[:patient][:color]\n format.html { render :text => params[:patient][:color] }\n format.json { head :ok }\n elsif params[:patient][:sex]\n format.html { render :text => params[:patient][:sex] }\n format.json { head :ok } \n elsif params[:patient][:age]\n format.html { render :text => params[:patient][:age] }\n format.json { head :ok }\n elsif params[:patient][:ageType]\n format.html { render :text => params[:patient][:ageType] }\n format.json { head :ok }\n else params[:patient][:complaint]\n format.html { render :text => params[:patient][:complaint] }\n format.json { head :ok } \n end\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @patient.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08d7a81dcc65bc4505fb3aecedd8efd0",
"score": "0.6525901",
"text": "def update\n respond_to do |format|\n if @inpatient.update(inpatient_params)\n format.html { redirect_to @inpatient, notice: 'Inpatient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @inpatient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cc4e3621f2793d415d34060077b79d4",
"score": "0.65202576",
"text": "def update\n respond_to do |format|\n if @in_patient.update(in_patient_params)\n format.html { redirect_to @in_patient, notice: 'In patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @in_patient }\n else\n format.html { render :edit }\n format.json { render json: @in_patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "799823ccef77b580e1a6e74361c9bfe3",
"score": "0.65176785",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Paciente atualizado com sucesso!' }\n format.js { flash.now[:notice] = 'Paciente atualizado com sucesso!'}\n format.json { render :show, status: :ok, location: @patient }\n else\n format.html { render :edit }\n format.js { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faadcce8bd9aab6f3efbf19683f02faf",
"score": "0.6515993",
"text": "def update\n respond_to do |format|\n if @appointment.update(appointment_params)\n format.html { redirect_to @appointment.patient, notice: 'Appointment was successfully updated.' }\n format.json { render :show, status: :ok, location: @appointment }\n else\n format.html { render :edit }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df142b687916e87743ca611f8f0f709a",
"score": "0.6504901",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n flash[:info] = 'Info was successfully updated!'\n format.html { redirect_to @patient }\n format.json { render :show, status: :ok, locations: @patient }\n else\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5d3959a0d910c54c75bd4390e0bc292",
"score": "0.64927244",
"text": "def update\n @patient = Patient.find(params[:id])\n new_params = {:journal => { patient_id: params[:id], treatment_no: 1 } }\n if params[:commit] == \"Next\"\n redirect_path = new_journal_path(new_params)\n action_path = \"edit\"\n else\n redirect_path = \"/\"\n action_path = \"edit_remission\"\n end\n #@patient.user_id = current_user.id\n #@patient.save\n #params_copy = params\n #params_copy.merge(params_copy){|k, v| v.nil? ? 0 : v}\n\n #gon.patient = params_copy[:patient]\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to redirect_path }\n format.json { head :no_content }\n else\n format.html { render action: action_path }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.6490435",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "90b18c51181e0f055e85a20c33f87c3e",
"score": "0.6482089",
"text": "def update\n @admin_patient = Admin::Patient.find(params[:id])\n\n respond_to do |format|\n if @admin_patient.update_attributes(params[:admin_patient])\n format.html { redirect_to(@admin_patient, :notice => 'Patient was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @admin_patient.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65ca58714a18ee6f2c36a231af37e63e",
"score": "0.64765984",
"text": "def update_patient(patient)\n dde_patient = openmrs_to_dde_patient(patient)\n response, status = dde_client.post('update_person', dde_patient)\n\n raise DDEError, \"Failed to update person in DDE: #{response}\" unless status == 200\n\n patient\n end",
"title": ""
},
{
"docid": "91b6d6942a836477cb93ecb258b0f282",
"score": "0.64114094",
"text": "def update\n respond_to do |format|\n if @patient.update(patient_params)\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient }\n else\n @address = @patient.address\n @diseases = Disease.all\n format.html { render :edit }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd926018dfc168e4998882352b776177",
"score": "0.64026576",
"text": "def update\n @appointment = Appointment.find(params[:id])\n set_doctor_patient\n\n respond_to do |format|\n if @appointment.update_attributes(params[:appointment])\n format.html { redirect_to @appointment, notice: 'Appointment was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c45148afad2454db9656036d44ff3de",
"score": "0.6393541",
"text": "def update\n authorize! :update, Patient\n if @patient.update(patient_params)\n redirect_to @patient, notice: 'Patient was successfully updated.'\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "bde29dd4d08eee82f584d4687def765d",
"score": "0.6388676",
"text": "def update\n respond_to do |format|\n if @appointment.update(appointment_params)\n patient = Patient.find_by_id(@appointment.patient_id)\n if patient.health_insurance != params['patient_health_insurance']\n patient.health_insurance = params['patient_health_insurance']\n end\n if patient.mobile != params['patient_mobile']\n patient.mobile = params['patient_mobile']\n end\n if patient.mobile_work != params['patient_mobile_work']\n patient.mobile_work = params['patient_mobile_work']\n end\n if patient.telephone != params['patient_phone']\n patient.telephone = params['patient_phone']\n end\n if patient.telephone_work != params['patient_phone_work']\n patient.telephone_work = params['patient_phone_work']\n end\n patient.enable_complete_validation=false\n patient.save\n format.html { redirect_to @appointment, notice: 'Consulta atualizada com sucesso' }\n format.js { flash.now[:notice] = 'Consulta atualizada com sucesso'}\n format.json { render :show, status: :ok, location: @appointment }\n else\n format.html { render :edit }\n format.js { render :edit }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ae6b17460ba8c07daf1a237b1b63696",
"score": "0.6355973",
"text": "def update\n \n if @api_v1_person.update(api_v1_person_params) \n render json: @api_v1_person\n else\n render json: @api_v1_person.errors, status: 400\n end\n \n end",
"title": ""
},
{
"docid": "6427057cbe06bf449ced927dfa2f6f67",
"score": "0.6354468",
"text": "def update\n respond_to do |format|\n if @pediatric_patient.update(pediatric_patient_params)\n format.html { redirect_to @pediatric_patient, notice: 'Datos Actualizados con exito.' }\n format.json { render :show, status: :ok, location: @pediatric_patient }\n else\n format.html { render :edit }\n format.json { render json: @pediatric_patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb2f1558b99a47ad7a829c5b5528c488",
"score": "0.63529015",
"text": "def update\n @patient = Patient.find(params[:id])\n @patient.update_attributes(params[:patient])\n @patients = Patient.order(:id).page(params[:page])\n \n respond_to do |format| \n format.js {render :action => :create}\n end \n\n end",
"title": ""
},
{
"docid": "798da2d7dbd73fae4aebbfb04e316db9",
"score": "0.635081",
"text": "def update\n respond_to do |format|\n if @inpatient.update(inpatient_params)\n format.html { redirect_to @inpatient, notice: 'Inpatient was successfully updated.' }\n format.json { render :show, status: :ok, location: @inpatient }\n else\n format.html { render :edit }\n format.json { render json: @inpatient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96fbd5d7a58b08aeb4b4dc88d9a3c53d",
"score": "0.63499147",
"text": "def update\n appointment = Appointment.find(params[:id])\n # appointment.update(appointment_params) may need this later \n if appointment.update(appointment_params)\n render json: appointment, status: 200, location: appointment\n else\n render json: appointment.errors, status: :Error \n end\n end",
"title": ""
},
{
"docid": "84c1ebb1ea128bd11d37c9fb5a07e9d1",
"score": "0.6348152",
"text": "def set_patient\n begin\n @patient = Patient.find(params[:id])\n rescue StandardError => e\n render json: { errors: e.message, status: 412 } \n end\n end",
"title": ""
},
{
"docid": "96b7e10f1515369720c98d4c36acbe00",
"score": "0.6338085",
"text": "def update\n @patient_profile = PatientProfile.find(params[:id])\n\n respond_to do |format|\n if @patient_profile.update_attributes(params[:patient_profile])\n format.html { redirect_to(@patient_profile, :notice => 'Patient profile was successfully updated.') }\n format.json { render :json => [] }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @patient_profile.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @patient_profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.6326646",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "adeabf7633458c7d9d1da73eb26ba304",
"score": "0.6326631",
"text": "def update\n @patient = Patient.find params[:patient_id]\n respond_to do |format|\n if @diagnosis.update(diagnosis_params)\n format.html { redirect_to patient_diagnosis_path(@patient, @diagnosis), notice: 'Diagnosis was successfully updated.' }\n format.json { render :show, status: :ok, location: @diagnosis }\n else\n format.html { render :edit }\n format.json { render json: @diagnosis.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abce1dfbfa7adc8a127622108f732a95",
"score": "0.63149685",
"text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.6313867",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "9969f3bbabcb400237523098e0c7e748",
"score": "0.63002324",
"text": "def update\n if @appointment[:errors].nil?\n @appointment[:appointment].update(new_params)\n render json: @appointment, status: 200\n else\n render json: @appointment, status: 404\n end\n end",
"title": ""
},
{
"docid": "1ea70b5abdabeba4dee35de9b1f0ce11",
"score": "0.6296181",
"text": "def update\n respond_to do |format|\n if @patient_identifier.update(patient_identifier_params)\n format.html { redirect_to @patient_identifier, notice: 'Patient identifier was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient_identifier }\n else\n format.html { render :edit }\n format.json { render json: @patient_identifier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91879bc7811d9af10d3d7cd982b939ff",
"score": "0.62843037",
"text": "def update\n @patient = Patient.find(params[:id])\n @user = @patient.user\n\n\n respond_to do |format|\n if @user.update_without_password(params[:user])\n format.html { redirect_to @patient, notice: t(\"controllers.patient_u\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71afadfa941dc064965138f3e29f37a0",
"score": "0.62812173",
"text": "def update\n residence_id = params[:residence_id]\n @residence = Residence.find(residence_id)\n @appointment = @residence.appointments.find(params[:id])\n @doctor = Doctor.find(@residence.doctor_id)\n\n respond_to do |format|\n if @appointment.update_attributes(params[:appointment])\n format.html { redirect_to @residence, notice: 'Appointment was successfully updated.' }\n format.json { head :no_content }\n else\n flash.now[:error] = \"Could not edit appointment\"\n format.html { render action: \"edit\" }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fd5f00640bdb0c785bcac4689a46f3c",
"score": "0.62658906",
"text": "def patch(data, options={})\n raise NotImplementedError, \"We only patchs to singular resources.\" if count > 1\n first.patch(data, options)\n end",
"title": ""
},
{
"docid": "370cdbeb9f2e4b25fbafea7e9ef71f77",
"score": "0.62600803",
"text": "def update\n respond_to do |format|\n if @patientregist.update(patientregist_params)\n format.html { redirect_to @patientregist, notice: 'Patientregist was successfully updated.' }\n format.json { render :show, status: :ok, location: @patientregist }\n else\n format.html { render :edit }\n format.json { render json: @patientregist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
1440d2d0b6f0e05367f6aad90be576f8
|
For example: if arr is [5, 3, 1, 2, 1], this means you have 5 sandwiches to give out. You can distribute them in the following order to the people: 2, 0, 1, 0. Giving these sandwiches to the people their hunger levels now become: [1, 1, 1, 1]. The difference between each pair of people is now 0, the total is also 0, so your program should return 0. Note: You may not have to give out all, or even any, of your sandwiches to produce a minimized difference. Another example: if arr is [4, 5, 2, 3, 1, 0] then you can distribute the sandwiches in the following order: [3, 0, 1, 0, 0] which makes all the hunger levels the following: [2, 2, 2, 1, 0]. The differences between each pair of people is now: 0, 0, 1, 1 and so your program should return the final minimized difference of 2.
|
[
{
"docid": "74f6bd2d4441cfc1c2eb7817a9b13a20",
"score": "0.7013424",
"text": "def FoodDistribution(arr)\n total_food = arr[0]\n hunger_levels = arr[1..-1]\n \n permutations = (0..total_food).to_a.repeated_permutation(hunger_levels.size).to_a\n permutations = permutations.select { |comb| comb.sum <= total_food }\n \n min_diff = hunger_levels.max - hunger_levels.min\n permutations.each do |sub_arr|\n reduced_vals = hunger_levels.map.with_index do |hunger, idx|\n reduction = hunger - sub_arr[idx]\n break if reduction.negative?\n reduction\n end\n\n unless reduced_vals\n next\n else\n diff = []\n reduced_vals.each_cons(2) { |el1, el2| diff << (el2 - el1).abs }\n diff = diff.sum\n min_diff = diff if diff < min_diff\n end\n end\n min_diff\nend",
"title": ""
}
] |
[
{
"docid": "628ed35c25ae58be0baed78d6153e21e",
"score": "0.7531631",
"text": "def FoodDistribution(arr)\n sandwiches = arr.shift\n until (sandwiches == 0) || (arr.uniq.length == 1)\n hungry_person = 0.upto(arr.length-2).max_by { |i| arr[i] - arr[i+1] }\n sandwiches -= 1; arr[hungry_person] -= 1 \n end\n return 0.upto(arr.length-2).inject(0) { |sum, i| sum += (arr[i] - arr[i+1]) }\nend",
"title": ""
},
{
"docid": "1096bdf2bbc00c0c4db699180128cc75",
"score": "0.69554126",
"text": "def candies(arr)\n sum = 0 # reset the sum\n if arr.length > 1 # if the array contains more than 1 element\n # sum up the elements' differences with the max value\n arr.each { |e| sum += arr[arr.index(arr.max)] - e }\n sum # return the sum\n else # if the array contains 1 or fewer elements\n -1 # return -1\n end\nend",
"title": ""
},
{
"docid": "189db87322c0f1ccb331ff100fbeb3b7",
"score": "0.6629858",
"text": "def profitslow(arr)\n max = 0\n buy = 0\n sell = 0\n len = arr.length\n #improved version of the combination\n arr.each_with_index do |x,i|\n j = i\n while (j < len)\n tmp = arr[j] - arr[i]\n if max < tmp\n max = tmp\n buy = i\n sell = j\n end\n j += 1\n end\n end\n puts arr[sell] - arr[buy]\n return {'buy':buy,'sell':sell}\nend",
"title": ""
},
{
"docid": "00492267ad2757b556e3851edc7ec5a1",
"score": "0.6542171",
"text": "def corgi_golden_age(arr)\n\tstart = 0\n\t\n\tdistance = 0\n\tbest = 0\n\n\twhile distance < arr.length\n\t\tstart = 0 #ADDED\n\t\tfinish = distance + start# ADDED\n\t\twhile finish < arr.length\n\t\t\tsum = 0\n\t\t\tarr[start..finish].each {|e| sum += e}\n\t\t\tif sum > best\n\t\t\t\t#puts sum <- TEST POINT\n\t\t\t\tbest = sum\n\t\t\t\tbest_start = start\n\t\t\t\tbest_finish = finish\n\t\t\tend\n\t\t\tstart += 1\n\t\t\tfinish = distance + start\n\t\tend\n\t\tdistance += 1\n\tend\n\treturn [best_start, best_finish]\nend",
"title": ""
},
{
"docid": "9d708339613491045acff522d30e8155",
"score": "0.6506098",
"text": "def solution(a)\n max_profit_so_far = 0\n max_profit = 0\n\n (1...a.size).each do |i|\n profit = a[i] - a[i - 1]\n max_profit_so_far = [profit, max_profit_so_far + profit].max\n max_profit = [max_profit_so_far, max_profit].max\n end\n\n max_profit\nend",
"title": ""
},
{
"docid": "65673130a863d847af2d6cd0a1ccc122",
"score": "0.648639",
"text": "def solution(a)\n sum_all = a.inject(:+) - a[0]\n sum_small = a[0]\n p = 1\n i = 0\n diff = []\n\n while p < a.length\n diff << (sum_all - sum_small).abs\n sum_all -= a[p]\n i += 1\n sum_small += a[i]\n p += 1\n end\n\n return diff.min\nend",
"title": ""
},
{
"docid": "893611f5434c164d5ef9db399a8b1ed7",
"score": "0.64595795",
"text": "def solution(a)\n total_sum = a.reduce(:+)\n first_sum = a[0]\n second_sum = total_sum - first_sum\n min_diff = (first_sum - second_sum).abs\n\n (1..(a.length-2)).each do |i|\n first_sum += a[i]\n second_sum -= a[i]\n abs_diff = (first_sum - second_sum).abs\n min_diff = abs_diff if abs_diff < min_diff\n end\n\n return min_diff\nend",
"title": ""
},
{
"docid": "6de028205db5f3625f4558e5fbe8b254",
"score": "0.6440593",
"text": "def min_sum(array)\n array.sort!\n (0...array.size/2).map {|i| arr[i] * arr[-i-1]}.sum\nend",
"title": ""
},
{
"docid": "6d008068400b69cf4cbb84f27086e8fe",
"score": "0.6408428",
"text": "def subsums(arr) # => [1, -1, 1, -1, 2] => 2\n max_so_far = arr.min\n max_to_here = 0\n\n arr.each do |el|\n max_to_here += el\n if max_so_far < max_to_here\n max_so_far = max_to_here\n end\n if max_to_here < 0\n max_to_here = 0\n end\n end\n max_so_far\nend",
"title": ""
},
{
"docid": "f2e73830fefa9df9bea43540db367374",
"score": "0.6385596",
"text": "def solution(a)\n first = 0\n second = a.inject(:+)\n (1..a.count - 1).map do |p|\n first += a[p - 1]\n second -= a[p - 1]\n (first - second).abs\n end.min\nend",
"title": ""
},
{
"docid": "7e88104edc4d6983898e9f382ab0a871",
"score": "0.63534665",
"text": "def solution(a)\n result = 0\n min_avg = (a[0] + a[1]) / 2.0\n\n (2..a.size-1).each do |idx|\n tmp_avg_1 = (a[idx-1] + a[idx]) / 2.0\n tmp_avg_2 = (a[idx-2] + a[idx-1] + a[idx]) / 3.0\n\n if tmp_avg_1 < min_avg\n result = idx - 1\n min_avg = tmp_avg_1\n end\n\n if tmp_avg_2 < min_avg\n result = idx - 2\n min_avg = tmp_avg_2\n end\n end\n\n return result\nend",
"title": ""
},
{
"docid": "15275b9348e1a9c0f647e7d12936ce91",
"score": "0.63385797",
"text": "def solution(a)\n result = 0\n prev = 0\n i = 0\n while i < a.length\n diff = a[i] - prev\n if diff > 0\n result += diff\n end\n prev = a[i]\n i += 1 \n end\n return result\nend",
"title": ""
},
{
"docid": "60951d7b76ee0af4813613dfb835a4a1",
"score": "0.63034385",
"text": "def max_diff(arr)\n max = nil\n i = 0\n while i < arr.length\n j = i + 1\n while j < arr.length\n profit = arr[j] - arr[i]\n if max == nil || profit > max\n max = profit\n end\n j += 1\n end\n i += 1\n end\n max\nend",
"title": ""
},
{
"docid": "e20f0ab6e914ac21c104a555dfc8e1ad",
"score": "0.62994266",
"text": "def solution(arr)\n return 1 if arr.empty?\n\n # Ref: https://stackoverflow.com/questions/41449617/why-is-sum-so-much-faster-than-inject/41449844#41449844\n # we arr +1, also the missing element in consideration.\n complete_sum_incl_missing = (arr.size + 1) * (arr.size + 2) / 2\n\n complete_sum_incl_missing - arr.inject(:+)\nend",
"title": ""
},
{
"docid": "d9f4dc31e32a146b09c44f50c1e8fe5d",
"score": "0.62878364",
"text": "def solution(a, s)\nsum_array = []\n a.sort!\n a.each_with_index do |e,i|\n each_array = []\n each_array.push(e)\n j = i + 1\n while(j<a.count)\n \n each_array.push(a[j])\n sum1 = each_array.inject(&:+)\n ave = sum1.to_f/each_array.count\n break if ave > s\n if s == ave\n sum_array.push(each_array) unless each_array.count == a.count\n end\n j+=1\n end\n end\n p sum_array\nend",
"title": ""
},
{
"docid": "8dd91884f891ef8386cb40763ec7432d",
"score": "0.6271212",
"text": "def day_trader(arr)\n max = 0\n result = []\n len=arr.length\n for i in 0..len-2\n for j in i+1..len-1\n if max < (arr[j] - arr[i])\n max= arr[j] -arr[i]\n result[0] = i\n result[1] = j\n end\n end\n end\n return result\nend",
"title": ""
},
{
"docid": "71949d079ad9fdb229ab3c718bfd73b0",
"score": "0.62548584",
"text": "def solution(a)\n max_profit = 0\n (0..a.size - 1).to_a.combination(2).to_a.each do |x|\n profit = a[x.last] - a[x.first]\n max_profit = profit if max_profit < profit\n end\n max_profit\n end",
"title": ""
},
{
"docid": "f54aaff432a2ecfe5981a11258b6eda3",
"score": "0.62524575",
"text": "def max_stock_picker(arr)\n profit = 0\n\n (1...arr.count).each do |idx|\n sum = arr[idx] - arr[idx - 1]\n profit += sum if sum > 0\n end\n\n profit\nend",
"title": ""
},
{
"docid": "ecab2a2c268c84c4e969a6f37cd3fe59",
"score": "0.6241672",
"text": "def water(arr)\n\n total_units = 0\n start_pos = 0\n\n while start_pos < arr.length - 1\n\n current_pos = start_pos\n current_height = arr[start_pos]\n potential_units = 0\n\n while arr.length > i+1 && arr[i+1] < current_height\n potential_units = potential_units + current_height - arr[i+1]\n i+=1\n end\n\n total_units += potential_units if arr.length > i\n\n i+=1\n end\n\n puts total_units\n total_units\n\nend",
"title": ""
},
{
"docid": "76627cb9c1891d7bf95625a22251135f",
"score": "0.6239375",
"text": "def lcs1(arr)\n best_arr = [arr[0]]\n curr_arr = []\n arr.each do |ele|\n curr_arr = curr_arr.push(ele)\n if curr_arr.sum > best_arr.sum\n best_arr = curr_arr.dup\n end\n if curr_arr.sum < 0\n curr_arr = []\n end\n end\n return best_arr.sum\nend",
"title": ""
},
{
"docid": "4ca7ef452851b1b018bb87f88cdbb04c",
"score": "0.6233596",
"text": "def sum_upon_sums(array)\n n = array.size\n total = (n * (n + 1)) / 2\n array.each do |el|\n total -= el\n end\n total\nend",
"title": ""
},
{
"docid": "0cbd1172e68f7579a7a75bc837c508b0",
"score": "0.62130696",
"text": "def calculate_min_difference(arr)\n min = arr[1] - arr[0]\n i = 1\n while i < arr.length\n min = [min, arr[i] - arr[i-1]].min\n i = i + 1\n end\n return min\nend",
"title": ""
},
{
"docid": "cbab7c79eebcc0db0aafa16f3b8c73bd",
"score": "0.62126136",
"text": "def pair_sum(array, target)\n\n return nil if array.size < 2\n\n seen = Set.new()\n output = []\n\n array.each do |num|\n diff = target - num\n\n unless seen.include?(diff)\n seen.add(num)\n else\n output.push([ [num,diff].min, [num,diff].max ])\n end\n end\n\n output.size\nend",
"title": ""
},
{
"docid": "220e2df04407df6495f04993b5787d83",
"score": "0.6211044",
"text": "def sub_sum2(arr)\n current_sum = 0\n biggest_sum = arr.first\n arr.each do |el|\n current_sum += el\n if current_sum > biggest_sum\n biggest_sum = current_sum\n elsif current_sum < 0\n current_sum = 0\n end\n end\n biggest_sum\n\n #no extra arrays\n #only one iteration through array\n #biggest sum variable\n #current_sum\n\nend",
"title": ""
},
{
"docid": "10744c9259954c6bedde02579e6b6692",
"score": "0.6208141",
"text": "def v2(list)\n tally = list[0]\n other_tally = 0\n list.each do |el|\n if other_tally + el >= 0\n other_tally += el\n else\n other_tally = 0\n end\n if tally < other_tally\n tally = other_tally\n end\n end\n tally\nend",
"title": ""
},
{
"docid": "100289d400a52ba794661cbbc1471677",
"score": "0.62071586",
"text": "def sum_upon_sums(array)\n sum = (1..array.length).to_a.inject(:+)\n array.each { |el| sum -= el }\n sum\nend",
"title": ""
},
{
"docid": "59e6c7bb3a09b6c6625376637171e120",
"score": "0.61963433",
"text": "def miniMaxSum(arr)\n my_hash = Hash.new(0)\n (0...arr.size).each do |i|\n my_hash[i] = arr.reject.each_with_index {|_, index| index == i}.sum\n end\n print \"#{my_hash.min_by {|k,v| v}.last} #{my_hash.max_by {|k,v| v}.last}\\n\"\nend",
"title": ""
},
{
"docid": "6e6637d318e56479ef239287377d7001",
"score": "0.61831546",
"text": "def nsquared(arr)\n best = arr[0]\n arr.each do |first_fish|\n arr.each do |second_fish|\n bigger_than_sec = first_fish.length > second_fish.length\n if bigger_than_sec && first_fish.length > best.length\n best = first_fish\n end\n end\n end\n best\nend",
"title": ""
},
{
"docid": "818379470d96fccd762168075724de4f",
"score": "0.61798704",
"text": "def max_2_prefer_short arr\n best_arr, best_sum = [], -1.0/0\n\n (0...arr.size).each do |i|\n (i...arr.size).each do |j|\n sum = arr[i..j].inject { |sum,x| sum+x }\n best_sum, best_arr = sum, arr[i..j] if sum > best_sum or\n (sum == best_sum and\n arr[i..j].size < best_arr.size)\n end\n end\n\n best_arr\nend",
"title": ""
},
{
"docid": "dd57a5274d8a9800f6227e4abdc52f3e",
"score": "0.61707336",
"text": "def find_sum(arr,sum)\n result ={}\n h = Hash[arr.map {|i| [i,i]}]\n arr.each { |l| result[l] = sum-l if h[sum-l] && !result[sum-l] }\n result\nend",
"title": ""
},
{
"docid": "bc05c5a67bd9e54b913b5201743d9b9b",
"score": "0.6158176",
"text": "def array_pair_sum(nums)\n sorted = nums.sort\n i = 0\n sum = 0\n while i < sorted.length\n sum += [sorted[i], sorted[i+1]].min\n i += 2\n end\n sum\nend",
"title": ""
},
{
"docid": "7196b223099d4b1adc741088623f1d74",
"score": "0.61546004",
"text": "def minimum_removals(arr)\n sum = 0\n for i in arr\n sum += i\n end\n sum.even? ? 0 : 1\nend",
"title": ""
},
{
"docid": "4312e5feab5b2f63f4f975950bace25e",
"score": "0.61493635",
"text": "def calculate2(numberArray)\n difference = 0\n numberArray.each do |individual|\n catch(:stop) do\n sorted = individual.sort\n for i in (sorted.length - 1).downto(0)\n for j in 0..sorted.length - 2\n if sorted[i] % sorted[j] == 0 && sorted[i] != sorted[j]\n difference += sorted[i] / sorted[j]\n throw :stop\n end\n end\n end\n end\n end\n puts \"Difference: #{difference}\"\nend",
"title": ""
},
{
"docid": "68f066e3bb0d556df0728122bfdbe926",
"score": "0.6145976",
"text": "def largest_sum_pair(array)\n result = [array[0], array[1]]\n\n (0...array.length - 1).each do |num_1|\n (num_1 + 1...array.length).each do |num_2|\n\n pair_total = array[num_1] + array[num_2]\n if pair_total > result.reduce(0) { |sum, num| sum += num }\n result = [num_1, num_2]\n end\n \n end\n end\n result\nend",
"title": ""
},
{
"docid": "c30ecec77236f8f847aad1bca69919f7",
"score": "0.6144253",
"text": "def solution(a)\n size = a.length\n left_sum = a[0]\n right_sum = a[1..-1].reduce(:+)\n min = (left_sum - right_sum).abs\n i = 1\n\n while true\n break if i == size - 1\n left_sum += a[i]\n right_sum -= a[i]\n min = [(left_sum - right_sum).abs, min].min\n i = i + 1\n end\n\n min\nend",
"title": ""
},
{
"docid": "dba90449f8061ee6cb50939268ccf788",
"score": "0.6142426",
"text": "def solution(a)\n # write your code in Ruby 2.2\n sum = a.reduce(:+)\n\n left = 0\n right = a.reduce(:+)\n \n min_diff = nil\n \n a.each_with_index do |v, i|\n next if i + 1 == a.size\n\n left += v\n right = sum - left\n \n diff = (left - right).abs\n \n if min_diff.nil? || diff < min_diff\n min_diff = diff\n end\n end\n \n min_diff\nend",
"title": ""
},
{
"docid": "e6a15c77fce5ba05c332d83c70c02443",
"score": "0.613812",
"text": "def solution(a)\n sums = prefix_sums(a)\n min = nil\n min_from = nil\n (0..a.count - 2).each { |i|\n (i + 1..[i + 4, a.count - 1].min).each { |j|\n avg = (sums[j + 1] - sums[i]).to_f / (j - i + 1)\n if min\n if avg < min\n min = avg\n min_from = i\n end\n else\n min = avg\n min_from = 0\n end\n }\n }\n min_from\nend",
"title": ""
},
{
"docid": "ef3b794c62d666b322220512f7b8854a",
"score": "0.61353177",
"text": "def sum_lower (array)\n\t#solution 1\n\t# array.sort!\n\t# array[0]+array[1]\n\t\n\t#solution 2\n\t# array.sort[0..1].inject(:+)\n\t#or\n\tarray.sort![0..1].reduce(:+)\n\n\t#solution 3\n\t# array.sort!.first(2).reduce(:+)\nend",
"title": ""
},
{
"docid": "4a510e0581c6b776c783cebf8b6e92ca",
"score": "0.6128583",
"text": "def solution(a)\n a.map! { |i| i.abs }\n max = a.max || 0\n sum = a.reduce(:+) || 0\n\n count = [0] * (max + 1)\n a.each { |i| count[i] += 1 }\n\n dp = [0] + [-1] * sum\n for i in 1..max do\n next if count[i] == 0\n sum.times do |j|\n if dp[j] >= 0\n dp[j] = count[i]\n elsif j >= i and dp[j - i] > 0\n dp[j] = dp[j - i] - 1\n end\n end\n end\n\n result = sum\n (sum / 2 + 1).times do |i|\n result = [result, sum - 2 * i].min if dp[i] >= 0\n end\n return result\nend",
"title": ""
},
{
"docid": "4fab99e68fbe8874c873a7aa13657cc9",
"score": "0.6119622",
"text": "def solution(n, students_array)\n res = 0\n students_array.sort!\n (0...students_array.length).step(2).each do |i|\n res = res + (students_array[i+1]-students_array[i]);\n end\n return res\n end",
"title": ""
},
{
"docid": "4fde173dcf0bb6114d04ae9a56fbf0fe",
"score": "0.61186266",
"text": "def profit(arr)\n profit = 0\n #buy and sell index\n sell = 0\n #set min to first value\n min = arr[0]\n\n arr.each_with_index do |x,i|\n #get min value\n min = x if min > x\n tmp = x - min\n #if difference is greater than previous profit, assign new profit\n if profit < tmp\n #sets sell index and assign new profit\n sell = i\n profit = tmp\n end\n end\n puts profit\n\n #another loop to get the buy index\n buy = 0\n arr.each_with_index do |x,i|\n #if different is equal to profit, then it must be buy index\n buy = i; break if arr[sell] - x == profit\n #i didn't want to use Array.index because it may cause problems with identical values\n end\n return {'buy':buy,'sell':sell}\nend",
"title": ""
},
{
"docid": "a93dc8f53eb14e418d426797498bf514",
"score": "0.61161846",
"text": "def puppy_golden_age array\n res = []\n # store the moving max sum of sub arrays.\n max_sum = 0\n\n for i in (0...array.length)\n for j in (i...array.length)\n # this is the key to reset the sum every iteration in inner loop\n sum = 0\n # arr[2..4] =>[200,-3,1000]\n array[i..j].each do |x|\n sum += x\n end\n if sum > max_sum\n max_sum = sum\n res = [i,j]\n end\n end\n end\n res\nend",
"title": ""
},
{
"docid": "b80eeb544f778048c18e86d4b68b8521",
"score": "0.6110769",
"text": "def absoluteValuesSumMinimization(a)\n a.sort\n a.count.even? ? a[(a.count/2)-1] : a[(a.count/2)]\nend",
"title": ""
},
{
"docid": "4b69f284888afb161a03623048e42e1b",
"score": "0.6103391",
"text": "def maxMin(k, arr)\n arr.sort!\n\n min = Float::INFINITY\n (0..arr.size - k).each do |i|\n current_unfairness = arr[i + k - 1] - arr[i]\n min = [min, current_unfairness].min\n end\n\n min\nend",
"title": ""
},
{
"docid": "19ed0255cee1ca49b344cf5b52a03bfc",
"score": "0.608924",
"text": "def lcs_better(arr)\n best_sum = arr.first\n sum = arr.first\n arr.each do |val|\n sum += val\n best_sum = sum if sum > best_sum\n sum = 0 if sum < 0\n end\n best_sum\nend",
"title": ""
},
{
"docid": "43f19e3b608f98b7eab7f8e6d864c6c2",
"score": "0.6084518",
"text": "def smallest_difference(array)\n array.combination(2).min_by {|a,b| (a-b).abs}.sort\nend",
"title": ""
},
{
"docid": "9bac5bf009718800ff93b533772158ad",
"score": "0.6081748",
"text": "def largest_sum2(arr)\n curr_sum = 0\n curr_best = arr.first\n \n arr.each do |ele|\n curr_sum += ele\n if curr_sum > curr_best\n curr_best = curr_sum\n end\n\n if curr_sum < 0\n curr_sum = 0\n end\n end\n curr_best\nend",
"title": ""
},
{
"docid": "eed5965d7150102a40c79c63b73f7e79",
"score": "0.60730135",
"text": "def solution(a)\n return (a[0] - a[1]).abs if a.size == 2\n\n total_sum = a.reduce(:+)\n result, tmp_l, tmp_r = 1/0.0, 0, total_sum\n\n (1..a.size-1).each do |idx|\n tmp_l += a[idx-1]\n tmp_r -= a[idx-1]\n\n tmp = (tmp_l-tmp_r).abs\n result = tmp if result > tmp\n end\n\n return result\nend",
"title": ""
},
{
"docid": "6d3cbb57d3f20e7629613cff8f3044bb",
"score": "0.6069181",
"text": "def trapped_water(arr, n)\n left = []; right = [];\n\n left[0] = arr[0]\n i = 1\n while(i < n)\n left[i] = [left[i-1], arr[i]].max\n i += 1\n end\n\n right[n-1] = arr[n-1]\n i = n-2\n while(i >= 0)\n right[i] = [right[i+1], arr[i]].max\n i -= 1\n end\n\n i = 0; val = 0\n while(i < n) \n val += [left[i], right[i]].min - arr[i]\n i += 1\n end \n\n puts \"Trapped Water units #{val}\"\nend",
"title": ""
},
{
"docid": "cc07c8e063e1398738f7817085ffb32c",
"score": "0.60664636",
"text": "def sockMerchant(n, ar)\n if (n <= 1 || n > 100) \n return 0\n else\n ar = ar.sort!\n new_arr = []\n ar.map do |num|\n index = (ar.index(num)) + 1 \n if num == ar[index]\n new_arr.push(num)\n end\n end\n new_arr = new_arr.group_by(&:itself)\n result = new_arr.transform_values{ |v| v.size / 2 }.values.reduce(:+)\n if result == nil\n return 0\n else \n return result\n end\n end \nend",
"title": ""
},
{
"docid": "dad21b96c0d93df81a9a62bbd369280f",
"score": "0.6065372",
"text": "def hourglassSum(arr)\n max = -100\n curMax = 0\n a = get_hourglasses(arr)\n a.each do |x|\n curMax = x.inject(0){|sum,x| sum + x }\n max = curMax if curMax > max\n end\n return max\nend",
"title": ""
},
{
"docid": "b81690a3ff4c590b0ad67da69607aeae",
"score": "0.6064422",
"text": "def solve(arr)\n arr.reduce(1){ |combinations, sub_arr| combinations *= sub_arr.uniq.length }\nend",
"title": ""
},
{
"docid": "a196e3b0fedf555e02bc5fb506606f3d",
"score": "0.6064125",
"text": "def max_difference array\n smallest = array[0]\n max_difference = 0\n array.each {\n |element|\n if ((element - smallest) > max_difference)\n max_difference = element - smallest\n end\n if (element < smallest)\n smallest = element\n end\n }\n return max_difference\nend",
"title": ""
},
{
"docid": "92946b9df716e5c3e932f5cf3c513c13",
"score": "0.6055255",
"text": "def solution(a)\n # write your code in Ruby 2.2\n sums = [nil]\n soln = 0\n\n currSum = 0\n a.each do |num,index|\n currSum += num\n sums.push currSum\n if currSum == 0\n soln += 1\n end\n end\n\n for i in (1...a.size) do\n x = a[i-1]\n for j in (i+1...a.size) do\n sums[j] = sums[j] - x\n soln += 1 if sums[j] == 0\n break if soln > 1000000000\n end\n break if soln > 1000000000\n end\n\n #if 0 exists in the array add [index,index]\n idx = a.index(0)\n soln += 1 if !(idx.nil?)\n\n soln > 1000000000 ? -1 : soln\n\nend",
"title": ""
},
{
"docid": "0c76dad22cc92ebe9b4caf733370f039",
"score": "0.6038932",
"text": "def better_lsc(arr)\n max_sum = arr[0] \n curr_sum = arr[0] \n (1...arr.length).each do |i| #O(n)\n ele = arr[i] \n curr_sum += ele\n if curr_sum < 0\n curr_sum = 0 \n else \n if curr_sum > max_sum\n max_sum = curr_sum\n end\n end\n end\n return max_sum\nend",
"title": ""
},
{
"docid": "3d3fcf5f0626dc8b400d01bdb0f75b24",
"score": "0.6038342",
"text": "def findBestDifference(array)\n bigDifference = 0\n indexBuy = 0\n indexSell = 0\n\n array.reverse!\n current = 0\n neighbour = 1\n\n while (current < (array.length - 1)) do #goes backwards in time, checking all possible profits\n while (neighbour < array.length) do\n profit = array[current] - array[neighbour]\n if profit > bigDifference\n bigDifference = profit\n indexSell = 8 - current\n indexBuy = 8 - neighbour\n end\n neighbour += 1 \n end\n current += 1\n neighbour = current +1 #reset neighbour loop\n end\n puts \"The biggest profit to be made is #{bigDifference} by buying on day #{indexBuy} and selling on day #{indexSell}\"\nend",
"title": ""
},
{
"docid": "820f7febdd02371b08b3e6c6604d7be3",
"score": "0.6035593",
"text": "def beautifulTriplets(d, arr)\n sum = 0\n size = arr.count - 1\n (0..size).each do |i|\n (i..size).each do |j|\n (j..size).each do |k|\n sum += 1 if arr[j] - arr[i] == d && arr[k] - arr[j] == d\n end\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "39f37529534bdfa6164aa5fcc8567112",
"score": "0.6017508",
"text": "def trader_du_dimanche(array)\n min_value = [array[0],0] #[value,index]\n max_value = [array[0],0] #[value,index]\n best_price = 0\n puts array[1]\n for i in 1...array.length\n unless array[i+1].nil? \n if min_value[0] > array[i] && best_price < array[i+1] - array[i]\n min_value[0] = array[i]\n min_value[1] = i\n max_value[0] = array[i+1]\n max_value[1] = i + 1\n best_price = max_value[0] - min_value[0]\n end\n if best_price < array[i] - min_value[0]\n max_value[0] = array[i]\n max_value[1] = i\n best_price = max_value[0] - min_value[0]\n end\n end\n end\n puts \"min_value = #{min_value}\"\n puts \"max_value = #{max_value}\"\n puts \"best_price = #{best_price}\"\nend",
"title": ""
},
{
"docid": "dc1e490505fdda78d3f89e713eee63f2",
"score": "0.6014362",
"text": "def check_array_for_sum(arr, goal)\n arr.product(arr).reject{|pair| pair.first == pair.last}.map{ |pair| pair.reduce(0, :+)}.include?(goal)\nend",
"title": ""
},
{
"docid": "d686f634d30529064798ee67a15690a0",
"score": "0.60125834",
"text": "def sub_sum_2(array)\n return nil if array.empty?\n max_so_far = array[0]\n current_sum = 0\n array.each do |el|\n current_sum += el\n max_so_far = current_sum if current_sum > max_so_far\n current_sum = 0 if current_sum < 0\n end\n max_so_far\nend",
"title": ""
},
{
"docid": "f9ce6cb6989e0074d8ffe4f12177d3bc",
"score": "0.6004482",
"text": "def kadane(arr)\n sum = 0 \n master_array = [[0]]\n sub_array = []\n answer = 0 \n \n arr.each do |i|\n # sum of subarray plus new number -symbolizing the new array\n potential_sum = i + sum\n if potential_sum > 0 && potential_sum > add_arr(master_array[0])\n # sum of \n sub_array << i\n\n # is this subarray grater than the one already in the master\n master_array[0] = sub_array\n sum = potential_sum\n answer = potential_sum\n\n p master_array\n p sum\n p sub_array\n p answer\n else\n sum = 0\n sub_array = []\n end\n end\n p master_array[0]\n p answer\nend",
"title": ""
},
{
"docid": "d29ebb56d8ccb0963653b2abc3b12858",
"score": "0.60032207",
"text": "def checkSum(array)\n # variable to hold result\n result = 0\n # get max and min, calculate their difference, and add it to result\n for i in 0...array.length\n lo, hi = array[i][0], array[i][0]\n for j in 0...array[i].length\n if array[i][j] > hi\n hi = array[i][j]\n end\n if array[i][j] < lo\n lo = array[i][j]\n end\n end\n result += (hi - lo)\n end\n return result\nend",
"title": ""
},
{
"docid": "99a759424d050121bd8d1b73ef1c98ce",
"score": "0.6002189",
"text": "def max_difference(ar)\n max_dif = 0\n for i in 0...ar.length \n for j in i...i \n ar[i] - ar[j] = max_dif if ar[i] - ar[j] > max_dif\n end\n end\n \n max_dif\nend",
"title": ""
},
{
"docid": "2515a311ba13d219cf876dac5434645c",
"score": "0.5995353",
"text": "def threesome_adv(input_array)\r\n\tarr = input_array\r\n\tlen = arr.length\r\n\tsum_hash = Hash.new\r\n\r\n\t(0..len-1).each do |index1| # first for loop\r\n\t\t(index1+1..len-1).each do |index2| # second for loop\r\n\t\t\tsumTwoElem = arr[index1] + arr[index2] # sum of 2 array values will be key in hash\r\n\t\t\tif not sum_hash.keys.include?(sumTwoElem) # check for duplicates in hash keys\r\n\t\t\t\tsum_hash[sumTwoElem] = [] # create the key\r\n\t\t\tend\r\n\t\t\tsum_hash[sumTwoElem] << [index1, index2] # append indices\r\n\t\tend\r\n\tend\r\n\r\n\t(0..arr.length-1).each do |index|\r\n\t\tarr_val = arr[index]\r\n\t\t# first if: check if hash contains key that's negative complement of array value\r\n\t\t# second if: check if indices are the same to avoid double use of array value\r\n\t\tif sum_hash.keys.include?(-arr_val) and not sum_hash[-arr_val].include?(index)\r\n\t\t\tputs true\r\n\t\t\treturn\r\n\t\tend\r\n\tend\r\n\tputs false\r\nend",
"title": ""
},
{
"docid": "74ecd6d261ae12ff2f1882f08b535588",
"score": "0.5993849",
"text": "def calc_minimum_deletion(\n array:\n)\n count = 0\n return count if array.length == 1\n # Push the max appearence of the number in the array into count\n array.each { |num| count = array.count(num) if array.count(num) > count }\n # subtract array length from count to get the result\n array.length - count\nend",
"title": ""
},
{
"docid": "6266a129efdd7a28889f1d118ffae395",
"score": "0.59883225",
"text": "def get_greatest_diff(arr)\n\tgreatest_diff = 0\n\tarr.each do |n1|\n\t\tarr.each do |n2|\n\t\t\tdiff = n1 - n2\n\t\t\tif diff > greatest_diff\n\t\t\t\tgreatest_diff = diff\n\t\t\tend\n\t\tend\n\tend\n\tputs greatest_diff\nend",
"title": ""
},
{
"docid": "d0c305316b590020110f7c878c1e8893",
"score": "0.5987356",
"text": "def solution(arr1, arr2)\n arr_sqs = []\n\n arr1.each_with_index do |num, idx|\n difference = num - arr2[idx]\n arr_sqs << difference ** 2\n end\n arr_sqs.sum.to_f / arr1.length\nend",
"title": ""
},
{
"docid": "65fb1c36f51f3c781a7f3bd9ae8c5ac9",
"score": "0.5981373",
"text": "def distance array\n zip(array).map{ |a| a.reduce(:-)**2 }.reduce(:+)\n end",
"title": ""
},
{
"docid": "81b9338f888787f3ab2a37f721df12d5",
"score": "0.5960358",
"text": "def solution(a)\n if a.size <= 2\n return 0\n end\n arr2 = []\n arr3 = []\n i = 1\n j = 0\n while i < a.size do \n arr2[j] = (a[i] + a[i-1]).to_f/2\n j += 1\n i += 1\n end\n i = 2\n j = 0\n while i < a.size do \n arr3[j] = (a[i] + a[i-1] + a[i-2]).to_f/3\n j += 1\n i += 1\n end\n i = 1\n pos = 0\nputs arr2\n min = [arr2[0], arr3[0]].min\n while i < arr2.size do\n if (!arr3[i].nil? && arr3[i] < min) || arr2[i] < min\n pos = i\n\t\t\t\t\t\tmin = !arr3[i].nil? ? [arr3[i], arr2[i]].min : arr2[i]\n end\n i += 1\n end\n return pos\nend",
"title": ""
},
{
"docid": "ad8125abb18eca1b078941fcb4a9c328",
"score": "0.5955449",
"text": "def max_difference(a)\n\n# max and min values are taken from array a\nmx = a.max\nmn = a.min\n\n# If the min number appears before the max then we have the greatest difference\nif a.index(mx)>=a.index(mn)\n return mx-mn;\nend\n\n# duplicate array a twice\nb = a.dup\nc = a.dup\n\n\nb.delete(mx)\nc.delete(mn)\n\nreturn [max_proft(b), max_proft(c)].max\nend",
"title": ""
},
{
"docid": "acb0796ace1de51b5a04ba6a4ecfc4bd",
"score": "0.5949765",
"text": "def diagonalDifference(arr)\n i = arr.length \n diagonal1 = (0...i).collect { |n| arr[n][n] }\n d1_sum= diagonal1.sum\n diagonal2 = (0...i).collect { |n| arr[n][-n-1]}\n d2_sum = diagonal2.sum\n\n if d1_sum >= d2_sum\n d1_sum - d2_sum\n else \n d2_sum - d1_sum\n end \n\nend",
"title": ""
},
{
"docid": "855200a3f2fdbb3076d4891980e921ed",
"score": "0.59495974",
"text": "def miniMaxSum(arr)\n sorted = arr.sort\n small = sorted[0..-2]\n big = sorted[1..-1]\n\n small_sum = small.inject(0){|sum,x| sum + x }\n big_sum = big.inject(0){|sum,x| sum + x }\n\n puts \"#{small_sum} #{big_sum}\"\n\nend",
"title": ""
},
{
"docid": "3c1976af0664d8a8bb63bb93f197ba23",
"score": "0.59450126",
"text": "def ntime(arr)\n best = arr.shift\n arr.each do |fish|\n best = fish if fish.length > best.length\n end\n best\nend",
"title": ""
},
{
"docid": "1ac33c32934b8bed035a83f9bc224b23",
"score": "0.5943522",
"text": "def solve(array)\n result = 0\n counts = [0] * array.size\n\n array.each do |element|\n counts[element] += 1\n end\n\n counts.each do |element|\n if element > (array.size / 2)\n result = counts.index(element)\n break\n end\n end\n result\nend",
"title": ""
},
{
"docid": "00200124ba790b23d9f76a394d106be3",
"score": "0.59434724",
"text": "def diff_zero( nums )\n\n i = 0\n\n from_back_of_array = nums.length() - 1\n\n # puts(\"from_back_of_array #{from_back_of_array}\")\n\n indices = []\n\n up_one = 1\n\n param_length = nums.length() - 1\n\n # puts(\"param_length #{param_length}\")\n\n\n while( nums.length() > i ) # keeps track of the position ( current element )\n\n # puts( \"start\" )\n\n while( param_length != 0 ) # keeps track of the number of elements so to compare with the current element\n\n # puts( \"nums[ from_back_of_array ] #{nums[ from_back_of_array ]}\" )\n\n # puts(\"nums[ from_back_of_array - up_one ] #{nums[ from_back_of_array - up_one ]}\")\n\n # puts(\"from_back_of_array ] - nums[ from_back_of_array - up_one ] #{ nums[ from_back_of_array ] - nums[ from_back_of_array - up_one ] }\")\n\n if( nums[ from_back_of_array ] - nums[ from_back_of_array - up_one ] == 0 )\n\n # Change above \"-\" ( minus ) to \"+\" for sum of two numbers == 0 !!!\n\n indices.unshift( from_back_of_array )\n indices.unshift( from_back_of_array - up_one )\n\n # the indices are put into the array by accending order from left to right\n # via unshift !!!\n\n # puts( indices )\n return indices\n\n else\n\n # puts( \"no zero\" )\n\n up_one += 1\n\n # puts(\"up_one #{up_one} \")\n\n param_length -= 1\n\n # puts(\"param_length #{param_length}\")\n\n end # if\n\n end # while\n\n from_back_of_array -= 1 # since no zero found, then move to the next element on the left from the current\n\n param_length = from_back_of_array # the remaining times to iterate within the smaller while\n\n # puts(\"param_length #{param_length}\")\n\n up_one = 1 # the left element from the current\n\n # puts( \"end\" )\n\n i += 1\n\n end # large - while\n\n return nil\n\nend",
"title": ""
},
{
"docid": "dee56e8be75b72c4d1a08c6458d6a33e",
"score": "0.5941737",
"text": "def hourglassSum(arr)\n res = []\n max = nil\n data = []\n arr.each_with_index do |row, main_index|\n \tnext if main_index > 3\n\n row.each_with_index do |ele, index|\n\n \t\tnext if index > 3\n res << ele\n res << row[index+1]\n res << row[index+2]\n second_row = arr[main_index+1]\n res << second_row[(index + (index+2))/2]\n third_row = arr[main_index+2]\n res << third_row[index]\n res << third_row[index+1]\n res << third_row[index+2]\n\n\t if max.nil? || max < res.inject(:+)\n\t max = res.inject(:+)\n\t end\n\t res =[]\n end\n\n end\n max\nend",
"title": ""
},
{
"docid": "ffd4258e99acea481994e626bfa08d67",
"score": "0.59376234",
"text": "def max_1_first arr\n best_arr, best_sum = [], -1.0/0\n\n (0...arr.size).each do |i|\n (i...arr.size).each do |j|\n sum = arr[i..j].inject { |sum,x| sum+x }\n best_sum, best_arr = sum, arr[i..j] if sum > best_sum\n end\n end\n\n best_arr\nend",
"title": ""
},
{
"docid": "50c5280330f3854a02ad59e7fdd107e6",
"score": "0.59350616",
"text": "def strange_sums(arr)\n count = 0\n\n return 0 if arr.length == 1\n\n arr.each_with_index do |ele_1, idx1|\n arr.each_with_index do |ele_2, idx2|\n if idx2 > idx1\n count += 1 if ele_1 + ele_2 == 0\n end\n end\n end\n count\nend",
"title": ""
},
{
"docid": "e8beb9987c29c38ce5c7025a76f5a822",
"score": "0.5925081",
"text": "def sum_without_bae_v2(array_of_numbers)\n sum = array_of_numbers.sort!.sum\n min = array_of_numbers[0]\n max = array_of_numbers[-1]\n count_max = 0\n count_min = 0\n\n array_of_numbers.each do |a|\n if a == min\n count_min += 1\n elsif a == max\n count_max += 1\n end\n end\n sum = sum - (count_min * min + count_max * max)\nend",
"title": ""
},
{
"docid": "7d6f0feb5a5a2ebc80fdabfa25444448",
"score": "0.59218657",
"text": "def solution(array)\n raise \"Invalid Array\" if !array.is_a?(Array) || array.empty?\n @sol_array = array\n @right_sum = 0\n @left_sum = 0\n @total_sum = 0 \n \n \n for i in 0..@sol_array.length-1 do\n @total_sum+= @sol_array[i]\n end \n\t\n @right_sum = @total_sum\n for i in 0..@sol_array.length-1 do\n @right_sum = @right_sum - @sol_array[i] \n return i if( @right_sum == @left_sum ) \n @left_sum = @left_sum + @sol_array[i]\n end\n \n return -1;\n \n rescue\n return -1\nend",
"title": ""
},
{
"docid": "e76486a5951bcfd2f81a824706a49cf7",
"score": "0.5919951",
"text": "def solution(a)\n return 0 if a.length < 2\n\n max_profit = 0\n min_buying_price = 200001\n local_max_profit = 0\n\n a.each do |elem|\n min_buying_price = [min_buying_price, elem].min\n local_max_profit = elem - min_buying_price\n max_profit = [max_profit, local_max_profit].max\n end\n\n max_profit\nend",
"title": ""
},
{
"docid": "64542bcce8114fe4846d5d0bd1c0b74b",
"score": "0.59184325",
"text": "def max_2_sum arr\n #YOUR CODE HERE\n \tx = -1000;\n if arr.length == 0\n \t\tx = 0\n\n elsif arr.length == 1\n \t\tputs \"arr length is 1\"\n \t\tx = arr[0]\n else \n \tfor i in arr\n \t\tif i >= x\n \t\t\tx = i\n \t\t\tarr.delete_at(arr.index(i))\n \t\tend\n \tend\n \ty = -1000;\n \t \tfor i in arr\n \t\tif (i >= y) \n \t\t\ty = i\n \t\tend\n \tend\n\t\tsum = x + y\t\n end\n\nend",
"title": ""
},
{
"docid": "b956e076feec29fb427e9cf6bb9c893d",
"score": "0.59138477",
"text": "def strange_sums(array)\n count = 0\n array.each_with_index do |ele_1, idx_1|\n array.each_with_index do |ele_2, idx_2|\n if idx_2 > idx_1 && ele_2 + ele_1 == 0\n count += 1\n end\n end\n end\n count\nend",
"title": ""
},
{
"docid": "31f494bbddeaebaa9a03c7809d0bbd77",
"score": "0.591303",
"text": "def solution(a)\n # write your code in Ruby 2.2\n a = a.uniq.select { |i| i if i > 0 }\n return 1 if a.empty?\n\n b = Array(1..a.size)\n res = b - a\n\n if res.empty?\n a.max + 1\n else\n res.min\n end\nend",
"title": ""
},
{
"docid": "31f494bbddeaebaa9a03c7809d0bbd77",
"score": "0.59121156",
"text": "def solution(a)\n # write your code in Ruby 2.2\n a = a.uniq.select { |i| i if i > 0 }\n return 1 if a.empty?\n\n b = Array(1..a.size)\n res = b - a\n\n if res.empty?\n a.max + 1\n else\n res.min\n end\nend",
"title": ""
},
{
"docid": "91fb2f898138462155531aa014ffb645",
"score": "0.59083396",
"text": "def my_min_2(array)\n array.inject(0) do |acc,ele|\n acc > ele ? ele : acc\n end\nend",
"title": ""
},
{
"docid": "7c554526d939bf87ce0d9775a91bd699",
"score": "0.5906681",
"text": "def pair_sum(array, k)\n #for each element in the array, find the target number to sum to k\n pairs = Set.new\n seen = Set.new\n array.each do |el|\n num = k-el\n if seen.include?(num)\n pairs.add([[el, num].min, [el,num].max])\n end\n seen.add(el)\n end\n pairs\nend",
"title": ""
},
{
"docid": "957c3129f4b4111f4d3b86ea507e9e94",
"score": "0.59016615",
"text": "def Superincreasing(arr)\n # ???????????????????????\n arr.reduce(0) {|sum, num| num > sum ? sum += num : (return false)}\n true \nend",
"title": ""
},
{
"docid": "3e9fa4abf51e204d7aad1c4625969312",
"score": "0.589262",
"text": "def best_profit(arr)\n buy_idx, sell_idx, max_profit = 0, 1, 0\n\n while sell_idx < arr.length\n temp = arr[sell_idx] - arr[buy_idx]\n if temp > max_profit\n max_profit = temp\n sell_idx += 1\n else\n buy_idx = sell_idx if arr[sell_idx] < arr[buy_idx]\n sell_idx += 1\n end\n end\n return \"#{buy_idx}, #{sell_idx}, #{max_profit}\"\nend",
"title": ""
},
{
"docid": "93a21dad67a80be55c0c531b68df0c67",
"score": "0.58896834",
"text": "def diff(array1,array2)\r\n diff = 0.0\r\n (0..(array1.size-1)).each do |y|\r\n diff += (array1[y] - array2[y]).abs\r\n end\r\n diffAvg = diff / (array1.size-1)\r\n diffAvg = diff if (array1.size-1) == 0\r\n return diffAvg\r\nend",
"title": ""
},
{
"docid": "93a21dad67a80be55c0c531b68df0c67",
"score": "0.58896834",
"text": "def diff(array1,array2)\r\n diff = 0.0\r\n (0..(array1.size-1)).each do |y|\r\n diff += (array1[y] - array2[y]).abs\r\n end\r\n diffAvg = diff / (array1.size-1)\r\n diffAvg = diff if (array1.size-1) == 0\r\n return diffAvg\r\nend",
"title": ""
},
{
"docid": "93a21dad67a80be55c0c531b68df0c67",
"score": "0.58896834",
"text": "def diff(array1,array2)\r\n diff = 0.0\r\n (0..(array1.size-1)).each do |y|\r\n diff += (array1[y] - array2[y]).abs\r\n end\r\n diffAvg = diff / (array1.size-1)\r\n diffAvg = diff if (array1.size-1) == 0\r\n return diffAvg\r\nend",
"title": ""
},
{
"docid": "93a21dad67a80be55c0c531b68df0c67",
"score": "0.58896834",
"text": "def diff(array1,array2)\r\n diff = 0.0\r\n (0..(array1.size-1)).each do |y|\r\n diff += (array1[y] - array2[y]).abs\r\n end\r\n diffAvg = diff / (array1.size-1)\r\n diffAvg = diff if (array1.size-1) == 0\r\n return diffAvg\r\nend",
"title": ""
},
{
"docid": "93a21dad67a80be55c0c531b68df0c67",
"score": "0.58896834",
"text": "def diff(array1,array2)\r\n diff = 0.0\r\n (0..(array1.size-1)).each do |y|\r\n diff += (array1[y] - array2[y]).abs\r\n end\r\n diffAvg = diff / (array1.size-1)\r\n diffAvg = diff if (array1.size-1) == 0\r\n return diffAvg\r\nend",
"title": ""
},
{
"docid": "d15a30b03ed4dd1fe352d71a8b9a0a72",
"score": "0.588267",
"text": "def kadanes_algorithm(array)\n max_ending_here = array[0]\n max_so_far = array[0]\n\n array.each do |num|\n max_ending_here = Math.max(max_ending_here + num, num)\n max_so_far = Math.max(max_so_far, max_ending_here)\n end\n\n return max_so_far\nend",
"title": ""
},
{
"docid": "23593bf68dbf579ece4473b1b77366b5",
"score": "0.58805054",
"text": "def min_diff(a)\n arr = a.sort\n diff = arr.each_cons(2).map { |x,y| y-x }\n diff_sorted = diff.sort\n diff_sorted.first\nend",
"title": ""
},
{
"docid": "ad669b096dc599b1e05aff9ce9cc6e06",
"score": "0.588029",
"text": "def sum_array(arr)\n return 0 if arr == nil\n arr.length < 3 ? 0 : arr.sort!.inject(0, :+) - arr[0] - arr[-1]\nend",
"title": ""
},
{
"docid": "5fa31432c898a629d0fe43ee49b8c8d0",
"score": "0.5876848",
"text": "def solution(a)\n length = a.length\n i = 0\n a = a.sort\n smalest = 1\n while(i < length-1) do\n current_val = a[i]\n if current_val < 0\n i+=1\n next\n end\n next_val = a[i+1]\n if next_val - current_val > 1\n smalest = current_val + 1\n break\n elsif i == length-2\n smalest = next_val + 1\n break\n end\n i+= 1\n end\n smalest\nend",
"title": ""
},
{
"docid": "0077edce40e59119fde0773607edfb01",
"score": "0.5875921",
"text": "def sub_sum2(arr)\n max = arr[0]\n current_sum = 0\n\n arr.each do |ele|\n current_sum += ele\n if current_sum > max\n max = current_sum\n elsif current_sum < 0\n current_sum = 0\n end\n end\n max \nend",
"title": ""
},
{
"docid": "feb3b581c5023777275b6679e3f8b948",
"score": "0.58713126",
"text": "def max_diff_fast(arr)\n min = arr[0]\n max = nil\n i = 1\n while i < arr.length\n profit = arr[i] - min\n if max == nil || profit > max\n max = profit\n end\n\n if arr[i] < min\n min = arr[i]\n end\n\n i += 1\n end\n\n max\nend",
"title": ""
}
] |
1da5009a9ab819adea80c3b05bb07196
|
initializes the champion id
|
[
{
"docid": "2aa4d91670f55111f734f51d16c1bbde",
"score": "0.6224193",
"text": "def summoner_id(login)\n\t\tchampion= extractJSON(login)\n\t\tid = JSON.parse(champion)[@@champion_name]['id']\n\t\t@@champ_id=id\n\tend",
"title": ""
}
] |
[
{
"docid": "d48b39bfa6bcc4b422f104a825be4716",
"score": "0.71543103",
"text": "def set_champion\n @champion = Champion.find(params[:id])\n end",
"title": ""
},
{
"docid": "09dc5a2edcb4768616a4a2efa92e4c85",
"score": "0.71174586",
"text": "def set_champion\n @champion = Champion.find!(params[:id])\n end",
"title": ""
},
{
"docid": "ff59935bd699b147571cecadca701cbb",
"score": "0.70632267",
"text": "def set_champion\n Champion.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a47c842f8dfa4d940aa562dba8363c0",
"score": "0.7041623",
"text": "def initialize_id\n @id = \"1\"\n end",
"title": ""
},
{
"docid": "4686c138813221a81140016b1bc119ab",
"score": "0.6895602",
"text": "def initialize\n \t\t@player_id = \"Jim\"\n end",
"title": ""
},
{
"docid": "eba861ad12dc551bdc7a7f1d0193731f",
"score": "0.67986584",
"text": "def set_championship\n @championship = Championship.find(params[:id])\n end",
"title": ""
},
{
"docid": "eba861ad12dc551bdc7a7f1d0193731f",
"score": "0.67986584",
"text": "def set_championship\n @championship = Championship.find(params[:id])\n end",
"title": ""
},
{
"docid": "d2448169021ffd15caa02aec419a6520",
"score": "0.6734938",
"text": "def set_user_champion\n @user_champion = UserChampion.find(params[:id])\n end",
"title": ""
},
{
"docid": "7707f4a77d20060d79b3584e212289f4",
"score": "0.66147316",
"text": "def set_championshiptable\n @championshiptable = Championshiptable.find(params[:id])\n end",
"title": ""
},
{
"docid": "6952f999b78ac0f0997740709e7ce8df",
"score": "0.6599649",
"text": "def addChampion(person)\n @champion = person.id\n end",
"title": ""
},
{
"docid": "9a5ba3db0ff9852126bfe4656cbf6205",
"score": "0.65722317",
"text": "def initialize(id)\n self.rank = RANKS[id % 13].to_i\n self.suit = SUITS[id % 4]\n end",
"title": ""
},
{
"docid": "28d4445cefe35da477b896f85cd8a5b5",
"score": "0.6537342",
"text": "def initialize(id)\n self.rank = RANKS[id % 13]\n self.suit = SUITS[id % 4]\n end",
"title": ""
},
{
"docid": "8e1bb5f125d4bb5d816fe66ec0670be8",
"score": "0.65169436",
"text": "def set_champion\n @champion = Champion.find(params[:id]) rescue false\n end",
"title": ""
},
{
"docid": "ffa83610c453ab00e6d3fab1f3d5b754",
"score": "0.6512646",
"text": "def _initialize_id\n @id = parent_hash.sub(/_.*$/,'') + '_' + convert_base(self.class.key[:id].incr.to_i + 1000, 62)\n end",
"title": ""
},
{
"docid": "4d438fbd8bd3db1065e4ee3a3e699189",
"score": "0.6486622",
"text": "def set_champ\n @champ = Champ.find(params[:id])\n end",
"title": ""
},
{
"docid": "d772d6a9fb5a604dd1c5e0c65a4a3346",
"score": "0.640333",
"text": "def initialize(id: , player_number:)\n @id = id\n @player_number = player_number\n end",
"title": ""
},
{
"docid": "c81ce14ed3bef280709bd79ef19fa830",
"score": "0.639556",
"text": "def for_champion(id)\n self.champion_id = id\n yield(self)\n end",
"title": ""
},
{
"docid": "b6568bd6f42d268e6ffa1f55161491a9",
"score": "0.6295128",
"text": "def initialize(id)\n\t\trank_index = id % 13\n\t\tself.rank = RANKS[rank_index]\n\t\tself.suit = SUITS[id % 4]\n\n\t\t# now, determine the value.\n\t\tself.value = \n\t\t\tcase rank_index\n\t\t\twhen 0..8 then rank_index + 2\n\t\t\twhen 9..11 then 10 \t# J, Q, K\n\t\t\telse 11 \t\t\t# Ace \n\t\t\tend\n\tend",
"title": ""
},
{
"docid": "84e7b24775f1e07954526813426feca5",
"score": "0.624663",
"text": "def set_discipline_championship\n @discipline_championship = DisciplineChampionship.find(params[:id])\n end",
"title": ""
},
{
"docid": "f102198a991527e69964ab3af94ff16b",
"score": "0.62298226",
"text": "def initialize_id\n @id ||= root.key[:id].incr.to_s\n end",
"title": ""
},
{
"docid": "c46468980535a21eda0a8d6c22a50e75",
"score": "0.6192206",
"text": "def initialize(id, max_players, num_player)\n @id = id\n @max_players = max_players\n @num_player = num_player\n end",
"title": ""
},
{
"docid": "0565586754b5fe75e951f03f6857a7c2",
"score": "0.6153074",
"text": "def initialize(id)\n @id = id.to_i\n end",
"title": ""
},
{
"docid": "6ac960adc86695ff195de57b7833a581",
"score": "0.61482435",
"text": "def initialize(id = nil)\n @id = id.to_i if (1..@@numcards).include? id.to_i\n @id = (rand @@numcards).floor + 1 if @id.nil?\n set_attrs_from_id\nend",
"title": ""
},
{
"docid": "8ecca996ba9274fe2e085b835c75979d",
"score": "0.61022675",
"text": "def initialize(id); end",
"title": ""
},
{
"docid": "8ecca996ba9274fe2e085b835c75979d",
"score": "0.61022675",
"text": "def initialize(id); end",
"title": ""
},
{
"docid": "e68df728a82bdab84945abe78fa238ff",
"score": "0.61012745",
"text": "def initialize_participants\n\t\t# Use pluck to efficiently return array of all champ ID's\n\t\tavailable_champs = Champ.all.pluck(:id)\n\n\t\t# Remove random champ from available_champs and add that instance to Round.champs relation\n\t\t9.times do\n\t\t\tselected_champ = Champ.find(available_champs.shuffle!.pop)\n\t\t\tself.champs << selected_champ\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f0f6a623d850d01399b33fa6c5bbf7a4",
"score": "0.6059046",
"text": "def initialize(chemblId = nil)\n @chemblId = chemblId\n end",
"title": ""
},
{
"docid": "b1c9e8e4eaaef57e4a7ecf9b0b25852e",
"score": "0.6035414",
"text": "def find_champion\n @champion = Champion.find(params[:champion_id])\n end",
"title": ""
},
{
"docid": "f3abb76f8e59d4a70f9d1fd114bd0a0b",
"score": "0.602396",
"text": "def initialize(id)\n @id = id.to_sym\n initialize_data!\n end",
"title": ""
},
{
"docid": "e486f2ab217e03d15f34d05d276384f7",
"score": "0.601142",
"text": "def init_player\r\n @connection.send_data @id.with_zeros + \"_\" +\r\n @@players.map{|p|[p.id,p.sprite,p.pos.join(\".\")].join(\",\")}.join(\";\")\r\n end",
"title": ""
},
{
"docid": "9e090408a3a8d1f1af988a23f0f64332",
"score": "0.601123",
"text": "def init_deck_id\n path = '/api/deck/new/shuffle/?deck_count=1'\n json_resp = make_API_call(path)\n # getting our deck id from the response hashmap\n deck_id = json_resp['deck_id']\n update_attribute(:deck_id, deck_id)\n end",
"title": ""
},
{
"docid": "05bb11d8e08eb0e71a5881a31ffb78a7",
"score": "0.6005536",
"text": "def set_champ_racer\n @champ_racer = ChampRacer.find(params[:id])\n end",
"title": ""
},
{
"docid": "638dd5bac71266f1709bd1ffbe2fc66d",
"score": "0.59961057",
"text": "def initialize(actor_id)\n super()\n setup(actor_id)\n @last_skill_id = 0\n end",
"title": ""
},
{
"docid": "fd6cef1de1c4120b635c73dd3c54743e",
"score": "0.594007",
"text": "def initialize(player_number)\n\t\t@id = player_number\n\t\t@score = score_template\n\tend",
"title": ""
},
{
"docid": "5ab828cf1d8259727a895e288e68ff0a",
"score": "0.59241563",
"text": "def initialize(id)\n @id = id\n @player = nil\n end",
"title": ""
},
{
"docid": "0bf5406989024a1277423c4993bb3638",
"score": "0.5899903",
"text": "def initialize(*args)\n super(*args)\n self.id = self.id.to_i\n end",
"title": ""
},
{
"docid": "79e19fc79a435f7320bc8d461b370095",
"score": "0.58905846",
"text": "def champion\n champion11\n end",
"title": ""
},
{
"docid": "d5edc3113e2bc1f483a22a88e3aa0099",
"score": "0.58888805",
"text": "def set_chit\n @chit = Chit.find(params[:id])\n end",
"title": ""
},
{
"docid": "16541443bd54f6e0f3a7674d3f14dec2",
"score": "0.5864838",
"text": "def set_champion_positional_stat\n @champion_positional_stat = ChampionPositionalStat.find(params[:id].gsub(/[!@#$%^&*()-=+|;':\",.<>?']/, ''))\n end",
"title": ""
},
{
"docid": "6e542ad7fca95eeff9e0742892554c19",
"score": "0.58630687",
"text": "def initialize(options)\n @id = options['id'].to_i if options['id']\n @member_id = options['member_id'].to_i\n @gym_class_id = options['gym_class_id'].to_i\n end",
"title": ""
},
{
"docid": "0a7d1c589026a2a551e3a7899e051ce3",
"score": "0.58410656",
"text": "def set_summoner_id\n @player.summoner_id ||= @client.summoner.by_name(@player.name).first.id\n end",
"title": ""
},
{
"docid": "105f80cd32e28359d8a26df6148e86ad",
"score": "0.58362985",
"text": "def initialize id\n @id = id\n end",
"title": ""
},
{
"docid": "7c11abce3ad08e4815f84541e5538613",
"score": "0.58350635",
"text": "def champion11\n get(api_url(\"v1.1\", \"champion\"))[\"champions\"].map {|c| Champion.new(c)}\n end",
"title": ""
},
{
"docid": "f95a4224d4a7af60359af7f1074a7c8d",
"score": "0.5826671",
"text": "def set_discipline_championship2\n @discipline_championship2 = DisciplineChampionship2.find(params[:id])\n end",
"title": ""
},
{
"docid": "853ed5f5fa283587bc3401a55c2dd000",
"score": "0.57922786",
"text": "def set_id\n @id = 0 #Normally IDs are generated using packages, like UUID package for example. Never hard-coded.\n end",
"title": ""
},
{
"docid": "7d773a8132e9014581d2ccb413f16781",
"score": "0.5790084",
"text": "def initialize_unique_id_counter\n @next_unique_id = 0\n end",
"title": ""
},
{
"docid": "835213c754c1319db81fe6682a0c1ea3",
"score": "0.5768746",
"text": "def initialize(case_id) \n #TO DO : doit régler sa valeur, ainsi que son numéro de case\n #associe chaque case à sa valeur (en string, voir ci-dessous)\n @value = case_id\n @case_id = case_id\n end",
"title": ""
},
{
"docid": "8652c90720f5c0339e0981080973a5a3",
"score": "0.575791",
"text": "def initialize(challenge_number); end",
"title": ""
},
{
"docid": "673ee0e2d5a85ba73aa5a4376a39ea25",
"score": "0.57558686",
"text": "def initialize\r\n\t@id = Random.rand(1..1000)\r\nend",
"title": ""
},
{
"docid": "defa64b8be9f59c96df7b5da7e3d8720",
"score": "0.575409",
"text": "def initialize(id,name=\"\")\n @id = id\n @color = @@colors[@id-1]\n name.empty? ? (@name = \"Player #{@id}\") : (@name = name)\n end",
"title": ""
},
{
"docid": "044d6fad0234d1b0310ab31a2d02a24b",
"score": "0.57521546",
"text": "def initialize(i=nil)\n @id = Id.new(i)\n end",
"title": ""
},
{
"docid": "17384133e079ca31359af1bbccbb5566",
"score": "0.5748981",
"text": "def initialize(id, name)\n @id_difficulty,@name_difficulty = id, name\n end",
"title": ""
},
{
"docid": "7addfddf2f335d5b64df60127d97883d",
"score": "0.57339233",
"text": "def init_id()\n \n if File.exists?(@id_file)\n id_file = File.open(@id_file, 'r')\n id = id_file.read().chomp().to_i()\n id_file.close\n else\n id = -1\n end\n return id\n \n end",
"title": ""
},
{
"docid": "c4ab7bd606b5eaa2489362847801b5be",
"score": "0.57307106",
"text": "def initialize(options)\n @id = options['id']\n end",
"title": ""
},
{
"docid": "805db138c4dcda6793ac602064187f22",
"score": "0.5729245",
"text": "def initialize(player_id)\n @id = player_id\n \n # Initialize an empty hands array\n @hands = Array.new\n \n @money = 1000\n @total_bets = 0\n end",
"title": ""
},
{
"docid": "7c54962c84617010d7692c9b2462ded9",
"score": "0.5723",
"text": "def initialize(id)\n if id.is_a? Numeric\n @steam_id64 = id\n else\n if id =~ /^STEAM_[0-1]:[0-1]:[0-9]+$/ || id =~ /\\[U:[0-1]:[0-9]+\\]/\n @steam_id64 = SteamId.steam_id_to_community_id id\n else\n @custom_url = id.downcase\n end\n end\n end",
"title": ""
},
{
"docid": "177819c6e0660cc24f7e0b26b5cb0e8c",
"score": "0.57196605",
"text": "def initialize(num, suit) \n\t\t@suit = suit\n\t\t@num = num\n\tend",
"title": ""
},
{
"docid": "3c931c30cfcb0c3cccb42aec46a8aef4",
"score": "0.5716209",
"text": "def initialize(mode, id=\"\")\n #@modes_str = {0 => \"\", 1=>\"D\",2=>\"P\"}\n @mode = mode\n @id = id\n end",
"title": ""
},
{
"docid": "191e054008223fe54cb304de5e608673",
"score": "0.57123685",
"text": "def initialize(num_players)\r\n\t@num_players = num_players\r\n end",
"title": ""
},
{
"docid": "f1beb63f92039eb3157018e17a32205f",
"score": "0.569672",
"text": "def create\n Champion.delete_all\n response = HTTParty.get('https://global.api.pvp.net/api/lol/static-data/na/v1.2/champion?api_key=5e9b0f51-4139-4c8a-bc4d-864cdefae73f')\n champions = response[\"data\"]\n champions.each do |champion|\n champ_hash = champion[1]\n\n @new_champion = Champion.new\n @new_champion.key = champ_hash[\"id\"]\n @new_champion.name = champ_hash[\"key\"]\n @new_champion.title = champ_hash[\"title\"]\n @new_champion.save\n end\n render :json => \"SUCCESS\"\n end",
"title": ""
},
{
"docid": "993653aa0c24411e1b5be5a8d6c18020",
"score": "0.5662707",
"text": "def initialize(index, enemy_id)\n h87spiritol_init(index, enemy_id)\n @spirit_stone_used = false\n end",
"title": ""
},
{
"docid": "f7258fe17edf4de154aab2464ff1dc4f",
"score": "0.56590253",
"text": "def initialize(id, key='')\n @_id = id\n @_key = key\n end",
"title": ""
},
{
"docid": "69c12ac5cc537e49c358cbc45d33eb04",
"score": "0.56491184",
"text": "def set_chuit\n @chuit = Chuit.find(params[:id])\n end",
"title": ""
},
{
"docid": "356375336e8819b76886eeca85a74ac4",
"score": "0.5648528",
"text": "def mch_id=(val)\n self.fields['mch_id'] = val\n end",
"title": ""
},
{
"docid": "2cd2d2a890264d418dafaae207df5b57",
"score": "0.5647413",
"text": "def set_calendar_of_the_championship\n @calendar_of_the_championship = CalendarOfTheChampionship.find(params[:id])\n end",
"title": ""
},
{
"docid": "50f96fdfafbd4989a1b9dca6b13b0bd9",
"score": "0.5646253",
"text": "def initialize(id)\n @cards = []\n\n ranks = [Spade, Heart, Diamond, Club]\n suits = [Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King]\n\n ranks.each do |rank|\n suits.each do |suit|\n @cards << Card.new(rank, suit)\n end\n end\n end",
"title": ""
},
{
"docid": "e08bfcaa01c091dc52f75d663c4d65be",
"score": "0.5644904",
"text": "def initialize\n @blank_id = BlankId.next_id\n end",
"title": ""
},
{
"docid": "ee13f04df8bfd19dfd86f92fea3db771",
"score": "0.5642933",
"text": "def initialize(id)\n @id = id\n end",
"title": ""
},
{
"docid": "9e131a63ffcdf55d9552529acd03bfa7",
"score": "0.56356645",
"text": "def initialize(id)\n @id = id\n @microchips = []\n end",
"title": ""
},
{
"docid": "dc3251aafbb95f929585acab1e51fe55",
"score": "0.5633205",
"text": "def initialize(season, id=nil)\n @season = season\n @id = id\n end",
"title": ""
},
{
"docid": "a396e50df240c6f7f37c066c19b1411c",
"score": "0.5629416",
"text": "def initializer(options={})\n @id = options[:id].to_s\n @name = options[:name]\n end",
"title": ""
},
{
"docid": "d4702c8fd4324af4b265b5a76c667347",
"score": "0.56192154",
"text": "def initialize(suit, value_hash_key)\n @suit = suit\n @value = {\n Two: \"2\",\n Three: \"3\",\n Four: \"4\",\n Five: \"5\",\n Six: \"6\",\n Seven: \"7\",\n Eight: \"8\",\n Nine: \"9\",\n Ten: \"10\",\n Jack: \"10\",\n Queen: \"10\",\n King: \"10\",\n Ace: \"11\"\n }\n @face = value_hash_key\n @value = @value[value_hash_key].to_i\n @card_name = \"#{@face} of #{suit}s\"\n end",
"title": ""
},
{
"docid": "5720e6b3b84df7fabd343d3f5bcc79f1",
"score": "0.56160897",
"text": "def initialize(troop_id)\n super()\n @troop_id = troop_id\n setup\n end",
"title": ""
},
{
"docid": "7db03fa787a055eba31f2244df1cc393",
"score": "0.5610492",
"text": "def initialize\n @id = select_unique_id\n @@ids << @id\n\n super\n end",
"title": ""
},
{
"docid": "f6c51a94f5ffd127b8d0292773732bbf",
"score": "0.56023985",
"text": "def initialize(name, last_name, campus)\n @name = name\n @last_name = last_name\n @campus = campus\n @id = new_id\n end",
"title": ""
},
{
"docid": "36fadaf67b6a0450d387cc6000d0445d",
"score": "0.5599451",
"text": "def initialize()\n\t\t\t\t# @id = id\n\t\t\t\treturn true\n\t\t\tend",
"title": ""
},
{
"docid": "465721d8f0fc4b6e1a70692c1924e69d",
"score": "0.559683",
"text": "def initialize\n @uid = 101\n end",
"title": ""
},
{
"docid": "465721d8f0fc4b6e1a70692c1924e69d",
"score": "0.559683",
"text": "def initialize\n @uid = 101\n end",
"title": ""
},
{
"docid": "c242f3216dc0ed5870846b99c3ad6a80",
"score": "0.5594482",
"text": "def set_chassi\n @chassi = Chassi.find(params[:id])\n end",
"title": ""
},
{
"docid": "33a86d6fa6f6e48ed7f81b4578d8fa42",
"score": "0.5591023",
"text": "def set_chinchilla\n @chinchilla = Chinchilla.find(params[:id])\n end",
"title": ""
},
{
"docid": "85d8679335d07419d8b937cc2b0a0451",
"score": "0.5589765",
"text": "def persist_champion(clnt, data)\n puts \"Persisting champion: #{data['name']}.\"\n our_champ = Champion.create(riot_id: data['id'], name: data['name'], title: data['title'])\n stats = JSON.parse(clnt.get_content(champion_stats_url(data['id'])))['stats']\n ChampionBaseStats.create(\n champion_id: our_champ.id,\n attackrange: stats['attackrange'],\n mpperlevel: stats['mpperlevel'],\n mp: stats['mp'],\n attackdamage: stats['attackdamage'],\n hp: stats['hp'],\n hpperlevel: stats['hpperlevel'],\n attackdamageperlevel: stats['attackdamageperlevel'],\n armor: stats['armor'],\n mpregenperlevel: stats['mpregenperlevel'],\n hpregen: stats['hpregen'],\n critperlevel: stats['critperlevel'],\n spellblockperlevel: stats['spellblockperlevel'],\n mpregen: stats['mpregen'],\n attackspeedperlevel: stats['attackspeedperlevel'],\n spellblock: stats['spellblock'],\n movespeed: stats['movespeed'],\n attackspeedoffset: stats['attackspeedoffset'],\n crit: stats['crit'],\n hpregenperlevel: stats['hpregenperlevel'],\n armorperlevel: stats['armorperlevel']\n )\n end",
"title": ""
},
{
"docid": "cbc21430f21a6cd1895b48851b47e53e",
"score": "0.558015",
"text": "def set_chu\n @chu = Chu.find(params[:id])\n end",
"title": ""
},
{
"docid": "3a7f5faf6fd5c136c01f2fec73305097",
"score": "0.55784154",
"text": "def set_chib\n @chib = Chib.find(params[:id])\n end",
"title": ""
},
{
"docid": "2dc4e3adb3313b6c6df9e9d15031ed3d",
"score": "0.556679",
"text": "def initialize(id)\n\t\t\tsuper\n\t\tend",
"title": ""
},
{
"docid": "d9beebcbe615cca7039548825aa2c4e3",
"score": "0.5561744",
"text": "def set_chruch\n @chruch = Chruch.find(params[:id])\n end",
"title": ""
},
{
"docid": "036d430c36de294e52ef7043a1f9fd31",
"score": "0.55611444",
"text": "def initialize number, suit = nil\n if suit.nil?\n split = number.to_s.split(//)\n @suit, @number = split.pop, split.join\n else\n @suit, @number = suit.to_s, number.to_s\n end\n\n @number_index = self.class.numbers.index(@number)\n end",
"title": ""
},
{
"docid": "cc15adeb77141f42d813a832d6b4db41",
"score": "0.5560991",
"text": "def champions(champion_id = nil)\n url = if champion_id\n \"#{endpoint}/champions/#{champion_id}\"\n else\n \"#{endpoint}/champions\"\n end\n\n conn.get(url)\n end",
"title": ""
},
{
"docid": "81a1371700833a224b7db3a610f8dcc0",
"score": "0.5559231",
"text": "def initialize(suitID, rankID)\n #binding.pry\n if rankID.class != Fixnum && suitID != Fixnum\n #binding.pry\n @rank = rankID\n @suit = suitID\n else\n @rank = ranks(rankID)\n @suit = suits(suitID)\n @drawn = false\n end\n end",
"title": ""
},
{
"docid": "c0460d0b49536021c9c3c57c1a23dceb",
"score": "0.5557496",
"text": "def set_champ_calendare\n @champ_calendare = ChampCalendare.find(params[:id])\n end",
"title": ""
},
{
"docid": "c4084c851c5338ece446287631cde745",
"score": "0.5554855",
"text": "def initialize(trophy_id)\n achievement = trophies[trophy_id]\n @id = trophy_id\n @name = achievement[1]\n @icon = achievement[0]\n @description = achievement[2]\n @reward = achievement[3]\n @hidden = achievement[4]\n @condition = achievement[5]\n @object = 0\n @max_value = 0\n @max_value = achievement[6] if achievement[6]\n @object = achievement[7] if achievement[7]\n get_achievement_state\n end",
"title": ""
},
{
"docid": "32f815469bc8360f3279014b7c5a38be",
"score": "0.5549594",
"text": "def initialize(params={})\n self.guid = params[:id] #store GUID to temporary attribute\n super(params)\n end",
"title": ""
},
{
"docid": "f3d5200566cde5a2f58f76db25fa1775",
"score": "0.5547655",
"text": "def initialize(valeur,id_case)\r\n #doit régler sa valeur, ainsi que son numéro de case\r\n @valeur = valeur\r\n @id_case = id_case\r\n end",
"title": ""
},
{
"docid": "fc19fc82709af15169f96723f5519729",
"score": "0.5543101",
"text": "def set_chuci\n @chuci = Chuci.find(params[:id])\n end",
"title": ""
},
{
"docid": "8141ce656bca23f868f831573c01ae76",
"score": "0.55408823",
"text": "def initialize(id)\n data = GameData::Skill[id]\n @id = data.id\n if @id == 0\n @ppmax = 0\n @pp = 0\n return\n end\n @ppmax = data.pp_max\n @pp = @ppmax\n @used = false\n # Ivar used when move is changed to another move\n @id_bis = id\n @pp_max_bis = nil\n @pp_bis = nil\n # Ivar used when battle change the move info (dynamic power/type/acc)\n @power2 = nil\n @type2 = nil\n @accuracy2 = nil\n end",
"title": ""
},
{
"docid": "3bf30e66d60a079deed5e58162a8e28f",
"score": "0.55404574",
"text": "def initialize(id)\n @id = id\n end",
"title": ""
},
{
"docid": "3bf30e66d60a079deed5e58162a8e28f",
"score": "0.55404574",
"text": "def initialize(id)\n @id = id\n end",
"title": ""
},
{
"docid": "3bf30e66d60a079deed5e58162a8e28f",
"score": "0.55404574",
"text": "def initialize(id)\n @id = id\n end",
"title": ""
},
{
"docid": "3bf30e66d60a079deed5e58162a8e28f",
"score": "0.55404574",
"text": "def initialize(id)\n @id = id\n end",
"title": ""
},
{
"docid": "11cf8c16d18d45a80fa73be9bc05429e",
"score": "0.5540292",
"text": "def initialize(id, initializer)\n @id, @initializer = id, initializer\n end",
"title": ""
},
{
"docid": "3c1d2779f1cf5ed610b81636af7fd3a0",
"score": "0.5536218",
"text": "def initialize\n @id = Time.now.to_i\n end",
"title": ""
}
] |
592937187ec9f83689473b48e8630bff
|
get all filters defined on this table. including generated filters
|
[
{
"docid": "8f5d4748227c0a34ad4f611fcaaecdd2",
"score": "0.7827007",
"text": "def get_filters\n return @filters + get_generated_filters\n end",
"title": ""
}
] |
[
{
"docid": "289b3b0734682c7848fe439bb4e43d0b",
"score": "0.80956376",
"text": "def filters\n columns_for_filter.map { |col| filter_instance( col ) }\n end",
"title": ""
},
{
"docid": "a4af13f9ad363ea37a925c9b2b72f42e",
"score": "0.7829149",
"text": "def get_generated_filters\n filters = []\n @columns.each do |column|\n filters << ::Schema::Mapping::Filter.new(\"#{column.name}_gen_filter_eql\",\n \"{{#{@table_name}.#{column.name}}} = #{::Schema::Mapping::Filter::VARIABLE_REPLACE_STRING}\", self.table_name)\n filters << ::Schema::Mapping::Filter.new(\"#{column.name}_gen_filter_like\",\n \"{{#{@table_name}.#{column.name}}} LIKE #{::Schema::Mapping::Filter::VARIABLE_REPLACE_STRING}\", self.table_name)\n filters << ::Schema::Mapping::Filter.new(\"#{column.name}_gen_filter_lt\",\n \"{{#{@table_name}.#{column.name}}} < #{::Schema::Mapping::Filter::VARIABLE_REPLACE_STRING}\", self.table_name)\n filters << ::Schema::Mapping::Filter.new(\"#{column.name}_gen_filter_gt\",\n \"{{#{@table_name}.#{column.name}}} > #{::Schema::Mapping::Filter::VARIABLE_REPLACE_STRING}\", self.table_name)\n end\n \n @relations.each do |relation|\n filters << ::Schema::Mapping::Filter.new(\"#{relation.name}_exists\",\n \"{{#{relation.to_table}.#{relation.to_model.get_primary_column.name}}} IS NOT NULL\")\n end\n \n return filters\n end",
"title": ""
},
{
"docid": "2e6e5b0f0af8994318fef718d3953aa8",
"score": "0.77420694",
"text": "def filters\n _filters = []\n self.each do |_filter|\n _filters.add(_filter.filters)\n end\n _filters \n end",
"title": ""
},
{
"docid": "5f1b5dd824582b245dc66238fc730d40",
"score": "0.7730102",
"text": "def filters\n Filter.all\n end",
"title": ""
},
{
"docid": "7ce015fda1d180e773a8d868bb1384a5",
"score": "0.76191896",
"text": "def filters\n # make it difficult to mess with the list directly\n @filters.dup\n end",
"title": ""
},
{
"docid": "656e3e62d123f8d16933e24e71ea62da",
"score": "0.75945884",
"text": "def filters\n @filters\n end",
"title": ""
},
{
"docid": "656e3e62d123f8d16933e24e71ea62da",
"score": "0.75945884",
"text": "def filters\n @filters\n end",
"title": ""
},
{
"docid": "656e3e62d123f8d16933e24e71ea62da",
"score": "0.75945884",
"text": "def filters\n @filters\n end",
"title": ""
},
{
"docid": "656e3e62d123f8d16933e24e71ea62da",
"score": "0.75945884",
"text": "def filters\n @filters\n end",
"title": ""
},
{
"docid": "d632648ca13a3d3e9cea4e05f969121d",
"score": "0.7560198",
"text": "def filters\n @filters ||= []\n end",
"title": ""
},
{
"docid": "627143c8d226995b2f21549d2d651fc6",
"score": "0.7557063",
"text": "def filters\n return @filters\n end",
"title": ""
},
{
"docid": "c5df380e675c0f353d3c271c8a5123ba",
"score": "0.75054103",
"text": "def filters\n\t\t\t@filters ||= if parent\n\t\t\t\tparent.filters.dup << filter\n\t\t\telse\n\t\t\t\t[filter]\n\t\t\tend.compact.freeze\n\t\tend",
"title": ""
},
{
"docid": "3ecc3271bb4740cce78072569142487c",
"score": "0.73717594",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "3ecc3271bb4740cce78072569142487c",
"score": "0.73717594",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "ca34999606dc9d5af6be0de62cd5c0a3",
"score": "0.73671824",
"text": "def filters\n @filters ||= []\n end",
"title": ""
},
{
"docid": "ca34999606dc9d5af6be0de62cd5c0a3",
"score": "0.73671824",
"text": "def filters\n @filters ||= []\n end",
"title": ""
},
{
"docid": "7ed7bfe9521e53aae9c62446ab182c09",
"score": "0.73442435",
"text": "def filters\n self.class.filters\n end",
"title": ""
},
{
"docid": "db4cd60b9471989211a745e91b93fd09",
"score": "0.73381734",
"text": "def filters\n self.class.filters.select do |filter|\n filter.enabled?(self)\n end\n end",
"title": ""
},
{
"docid": "ef471a2da0ed51f0fba25b01d9bfad76",
"score": "0.73349786",
"text": "def filters\n if metaclass.method_defined? :_filters\n self._filters\n else\n []\n end\n end",
"title": ""
},
{
"docid": "ea9380847c6cbe76e28db189526a33f1",
"score": "0.72907484",
"text": "def filters\n self.class.filters\n end",
"title": ""
},
{
"docid": "2d682777251526651c92f9e2106154a9",
"score": "0.725629",
"text": "def filters\n if @filters.empty?\n fetch_configuration()\n end\n return @filters\n end",
"title": ""
},
{
"docid": "47014be73334ed5710fd4fcdfc859b5a",
"score": "0.72474444",
"text": "def filters\n filters_store.keys\n end",
"title": ""
},
{
"docid": "40f47b4a6204052d6cc3123b843113d8",
"score": "0.724402",
"text": "def filters\n @filters\n end",
"title": ""
},
{
"docid": "caac3357384713db3c3dd54f0fba9211",
"score": "0.71947175",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "e9ad727840969597ee693cd707379cc6",
"score": "0.71330655",
"text": "def filters\n add_owner\n set_language\n\n @filters ||= (\n visibility_filters +\n work_filters +\n creator_filters +\n collection_filters +\n tag_filters +\n range_filters\n ).flatten.compact\n end",
"title": ""
},
{
"docid": "c1e467d6882a2fabe20b0652ac673134",
"score": "0.7116279",
"text": "def filters\n [@filters].flatten.compact\n end",
"title": ""
},
{
"docid": "9fb907190ce6fa773ca068132153b706",
"score": "0.71013945",
"text": "def table_filters\n <<-HTML if table_builder.filters\n <div class='table-filters'>\n <h3>Filters</h3>\n #{table_builder.filters.map do |filter|\n filter.display\n end.join(\"\\n\")}\n #{table_builder.clear_filter}\n </div>\n HTML\n end",
"title": ""
},
{
"docid": "fc137121741ab2bbe08df6be94daea8f",
"score": "0.70952034",
"text": "def list_filters\n if @filters.empty?\n fetch_configuration()\n end\n return @filters.keys\n end",
"title": ""
},
{
"docid": "8bc1c6539b6c787c3ec97fbbf41548ef",
"score": "0.7072838",
"text": "def list_filters\n {}\n end",
"title": ""
},
{
"docid": "23da000f6665913db1e85304a95a63da",
"score": "0.7069075",
"text": "def filters\n filters_enabled? ? filter_lookup : {}\n end",
"title": ""
},
{
"docid": "5aa111a6cd195caddb80c7829ff3b697",
"score": "0.70332485",
"text": "def filters\n @filters ||= Hash.new { |h, k| h[k] = [] }\n end",
"title": ""
},
{
"docid": "db1eebdda9385be79ecc7acf34329c8b",
"score": "0.70100594",
"text": "def filters\n @filters ||= @params[:f_inclusive]&.deep_dup || {}\n end",
"title": ""
},
{
"docid": "d278244b23344b88f7f0b0010e3d3ccd",
"score": "0.7005447",
"text": "def filter_predicates\n @query.getFilterPredicates\n end",
"title": ""
},
{
"docid": "b5e3cbf19cb00b8a8a7def43791577bf",
"score": "0.6979301",
"text": "def all\n return @filters.keys\n end",
"title": ""
},
{
"docid": "443c53a44544abdc3fae7f5e302ba387",
"score": "0.6951937",
"text": "def build_filters\n\n return unless configurable?\n return if @filters_opted == false\n\n types = {\n 'string' => true,\n 'text' => 'string',\n 'boolean' => true,\n 'date' => true,\n 'date_time' => true,\n 'time' => true,\n }\n selector(ORMUtils.properties(model), @filters_opted, @filters_ignored).\n map { |n, t| types[t] == true ? [n, t] : [n, types[t]] if types[t] }.compact.\n each { |c| filter *c }\n end",
"title": ""
},
{
"docid": "36f97d472ff5cc66e44b0e7771f98ad5",
"score": "0.69288737",
"text": "def filters\n @filters.to_a\n end",
"title": ""
},
{
"docid": "b76c9174831b7a8906186b9266969f61",
"score": "0.6926153",
"text": "def filter_conditions\n if params[:filter]\n generate_filter_conditions\n else\n []\n end\n end",
"title": ""
},
{
"docid": "174b1c73361e6a7bdb3bcedd91865806",
"score": "0.6904032",
"text": "def get_filters\n params_hash = {}\n uri = SERVER + GET_FILTERS_URL\n xml_doc = call_api(uri, params_hash)\n\n\n filters = []\n xml_doc.xpath(\"//filter\").each do |f|\n filter= FilterInfo.new_from_xml(f)\n filters.push filter\n end\n\n return filters\n end",
"title": ""
},
{
"docid": "bf64973e33b4204c9237ffa04e225a0f",
"score": "0.6894839",
"text": "def get_filters\n get_scopes.except(:utf8).except(:search).except(:direction).except(:sort).except(:page)\n end",
"title": ""
},
{
"docid": "b186f254815ba11cf69156887e465ca3",
"score": "0.68914205",
"text": "def model_filters\n GlobalConstant::User.filters\n end",
"title": ""
},
{
"docid": "08155451867cbe51d52ad29b789eea4a",
"score": "0.68799245",
"text": "def filter(params={}, conn=:and)\n return clone(Filter.new(params, conn).filters)\n end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.6874369",
"text": "def filters; end",
"title": ""
},
{
"docid": "eb1b122a90c2de939bd8735aa1d73d32",
"score": "0.6866751",
"text": "def filters\n @filters.dup.freeze\n end",
"title": ""
},
{
"docid": "3216d8756dba6d03af352cc9ec2fd507",
"score": "0.6864165",
"text": "def filters\n Array(@profile[:filters]).each do |filter|\n if respond_to?(\"filter_#{filter}\".intern)\n @form.keys.each do |field|\n # If a key has multiple elements, apply filter to each element\n if Array(@form[field]).length > 1\n @form[field].each_index do |i|\n elem = @form[field][i]\n @form[field][i] = self.send(\"filter_#{filter}\".intern, elem)\n end\n else\n if not @form[field].to_s.empty?\n @form[field] =\n self.send(\"filter_#{filter}\".intern, @form[field].to_s)\n end\n end\n end\n end\n end\n @form\n end",
"title": ""
},
{
"docid": "b564617f8f8b54ebb0e845fd67cb1ba7",
"score": "0.68066835",
"text": "def available_filters\n\t\t\t{}\n\t\tend",
"title": ""
},
{
"docid": "99763a8ec1e9c53d73ee46195ef94f88",
"score": "0.68064743",
"text": "def filter_fields\n fields.each.select(&:show_in_filters)\n end",
"title": ""
},
{
"docid": "479ed99e4226b49d9a433f4cd308644a",
"score": "0.6798004",
"text": "def registered_filters\n # Initialize if it doesn't exist\n @filters ||= {}\n return @filters\n end",
"title": ""
},
{
"docid": "a1a721485215bbd874716661a07d9fd7",
"score": "0.6775686",
"text": "def uhook_filtered_search filters\n []\n end",
"title": ""
},
{
"docid": "b2b7172f417be62e132a79405c17b677",
"score": "0.67706865",
"text": "def sub_filters\n []\n end",
"title": ""
},
{
"docid": "3475b7c2b10c24e8958055625f46f935",
"score": "0.6767144",
"text": "def filters\n @filters ||= {:before => {}, :after => {}}\n end",
"title": ""
},
{
"docid": "eebb7d01c79994302ecd007cfbebffda",
"score": "0.6759867",
"text": "def list_filters() \r\n if (@filters == nil || @filters.empty?)\r\n print \"No filters.\"\r\n return\r\n end\r\n \r\n @filters.each do |k, v|\r\n if (v.respond_to? :name)\r\n name = v.name\r\n else\r\n name = v\r\n end\r\n print \"#{k}: #{name}\\n\"\r\n end\r\n end",
"title": ""
},
{
"docid": "99bbcc6101a9e521313cf04f280f4583",
"score": "0.6746961",
"text": "def potential_filters\n [:date_filter,:classroom_filter, :sort_by]\n end",
"title": ""
},
{
"docid": "725fe7f61811ca6e163129cc1e564055",
"score": "0.6732336",
"text": "def index\n @filters = Filter.all\n end",
"title": ""
},
{
"docid": "725fe7f61811ca6e163129cc1e564055",
"score": "0.6732336",
"text": "def index\n @filters = Filter.all\n end",
"title": ""
},
{
"docid": "eb2996860362f20764d82a1c47575e1a",
"score": "0.67211384",
"text": "def query_filters; end",
"title": ""
},
{
"docid": "b4b49e58a85a086c28d1904c4a201cdd",
"score": "0.6691228",
"text": "def filters\n @filters\nend",
"title": ""
},
{
"docid": "e0e96eaf6082254b6fd6aeb3453d47b6",
"score": "0.6659473",
"text": "def fetch_filters\n query = \"SELECT ?filter ?uuid ?name WHERE {\n ?f a <#{MU_HIERARCHY.Filter}> ;\n <#{MU_CORE.uuid}> ?uuid ;\n <#{MU_HIERARCHY.filter}> ?filter ;\n <#{SKOS.prefLabel}> ?name .\n }\"\n query(query).map do |row|\n FILTERS[row[:uuid].to_s] = {\n filter: row[:filter].to_s,\n name: row[:name].to_s\n }\n end\n end",
"title": ""
},
{
"docid": "40fa3167ad1d71736f4bec4fe6410c58",
"score": "0.6658566",
"text": "def list_filters\n {\n position_code: \"PositionCode eq VALUE\",\n specialty: \"Specialty eq VALUE\",\n id: \"ID eq VALUE\"\n }\n end",
"title": ""
},
{
"docid": "534e358e5140292d5d627811f0684546",
"score": "0.66548187",
"text": "def filter(params = nil)\n Bsm::Constrainable::FilterSet.new self, params\n end",
"title": ""
},
{
"docid": "bc81c05bb49681c4837f490affe0f9bf",
"score": "0.6641017",
"text": "def available_filters\n @available_filters ||= eval_class_filters\n end",
"title": ""
},
{
"docid": "52c6413685e17b0045783358879f6853",
"score": "0.6604791",
"text": "def potential_filters\n [:date_filter, :reward_status_filter, :teachers_filter, :reward_creator_filter, :sort_by]\n end",
"title": ""
},
{
"docid": "9ca8635f8aa312c0a839e6b21f67e2e5",
"score": "0.6587339",
"text": "def available_filters\n unless @available_filters\n initialize_available_filters\n @available_filters.each do |field, options|\n options[:name] ||= l(options[:label] || \"field_#{field}\".gsub(/_id$/, ''))\n end\n end\n @available_filters\n end",
"title": ""
},
{
"docid": "264e9fe1a568a836f5c34d507475575a",
"score": "0.6568618",
"text": "def list_filters\n {\n selection_active: \"SelectionActive eq VALUE\",\n app_no: \"AppNo eq VALUE\"\n }\n end",
"title": ""
},
{
"docid": "d83a6cf7546ae9666670e6bfe5246a66",
"score": "0.6539826",
"text": "def applicable_filters\n fs = []\n #fs << Spree::Core::ProductFilters.taxons_below(self)\n #fs << Spree::Core::ProductFilters.brand_filter if Spree::Core::ProductFilters.respond_to?(:brand_filter)\n #fs << Spree::Core::ProductFilters.selective_brand_filter(self) if Spree::Core::ProductFilters.respond_to?(:selective_brand_filter)\n\n fs << Spree::Core::ProductFilters.sort_scope if Spree::Core::ProductFilters.respond_to?(:sort_scope)\n fs << Spree::Core::ProductFilters.price_range_filter if Spree::Core::ProductFilters.respond_to?(:price_range_filter)\n\n\n Spree::Property.all.each do |p|\n method_any = p.name.downcase + \"_any\"\n if Spree::Core::ProductFilters.respond_to?(\"#{method_any}_filter\")\n fs << Spree::Core::ProductFilters.send(\"#{method_any}_filter\", self)\n end\n end\n fs\n end",
"title": ""
},
{
"docid": "695ae2725c445f668c83b56d2d901a49",
"score": "0.6530719",
"text": "def available_filters\n return @available_filters if @available_filters\n @available_filters = {}\n\n filters.each do |filter|\n if available_facet = search_with_facets.facets[filter.to_s]\n if applied_filters[filter].nil?\n @available_filters[filter] = available_facet['terms'].inject([]) do |data, term|\n data << Request::Search::Filter::Base.init(term, filter)\n end\n end\n end\n end\n\n @available_filters\n end",
"title": ""
},
{
"docid": "6183ce1316462b99d51a5967b8706130",
"score": "0.65252846",
"text": "def filter_list\n @filter_names ||= self.scopes.map{|s| s.first.to_s}\n end",
"title": ""
},
{
"docid": "6175703043edd75b9da5c55a9d63bb03",
"score": "0.6521812",
"text": "def filters\n # For each filter we need a remove link, equal to current URI minus this filter\n # 1. Solr-style filters (multi fq)\n filters = request.multi(\"fq\").map {|fq|\n # FIXME breaks on space, remove gsub with proper parameter shuffling\n # FIXE &fq= (empty => breaks)\n k,v = fq.split(\":\")\n unless k.nil? or v.nil? or k == \"\" or v == \"\"\n remove_href = base.gsub(/&fq=#{fq}/ui, \"\")\n {:filter => k, :value => CGI.unescape(v), :remove_href => remove_href }\n else\n nil\n end\n }.uniq\n\n # filter-*\n filters += request.params.select {|k,v| k =~ /^filter\\-/ }.map {|k,v|\n remove_href = base\n {:filter => k.gsub(/^filter\\-/, \"\"), :value => CGI.unescape(v), :remove_href => remove_href }\n }\n filters\n end",
"title": ""
},
{
"docid": "bc6a3bb4ede90bfed6064cff6cb8b110",
"score": "0.6508053",
"text": "def filtered_from(params)\n scope = self.scoped({})\n return scope unless params.include?(:filter) and params[:filter][self.table_name.to_sym]\n\n options = params[:filter][self.table_name.to_sym]\n method = filter_method_from_options(options)\n terms = filter_terms_from_options(options, method)\n fields = filter_fields_from_options(options)\n scopes = filter_scopes_from_options(options)\n\n return scope if fields.blank? or terms.compact.blank?\n\n conditions = []\n terms.each do |term|\n value = term.downcase\n fields.each { |field| conditions << [\"LOWER(#{table_name}.#{field}) LIKE ?\", \"%#{value}%\"] }\n end\n\n conditions = conditions.compact.unzip\n if conditions.length > 1 && conditions[0] = conditions[0].join((method != :all) ? ' OR ' : ' AND ')\n scope = self.scoped(:conditions => (conditions.empty? ? nil : conditions.flatten))\n end\n ret = scopes.inject(scope) { |acc, scope_and_value|\n acc.send(scope_and_value[0].to_sym, scope_and_value[1])\n }\n ret\n end",
"title": ""
},
{
"docid": "551e64e09ec0cb7ba82df932c970ec1b",
"score": "0.6498085",
"text": "def available_filters\n unless @available_filters\n initialize_available_filters\n @available_filters.to_a.each do |field, options|\n options[:name] ||= I18n.t(\"field_#{field}\".gsub(/_id$/, ''))\n end\n end\n @available_filters\n end",
"title": ""
},
{
"docid": "9bd9e305a11f92e005bade9d99dafe02",
"score": "0.64787424",
"text": "def collection\n return @client.api_helper.collection(\"filters\")\n end",
"title": ""
},
{
"docid": "8c43181ae1c2ff6e4b45e3c448d0bafc",
"score": "0.6463574",
"text": "def where(filters)\n @filters.merge!(filters)\n self\n end",
"title": ""
},
{
"docid": "12ba9f8e51cab5e43bed1383f72f37bb",
"score": "0.64429075",
"text": "def typus_filters\n available_fields = self.model_fields\n return [] unless Typus::Configuration.config[\"#{self.name}\"][\"filters\"]\n fields = Typus::Configuration.config[\"#{self.name}\"][\"filters\"].split(\", \")\n fields_with_type = []\n fields.each do |f|\n available_fields.each do |af|\n @field_type = af[1] if af[0] == f\n end\n fields_with_type << [ f, @field_type ]\n end\n return fields_with_type\n end",
"title": ""
},
{
"docid": "d6542eba4375ee75a955363404bcb178",
"score": "0.6422916",
"text": "def get_filter_sql\n return @filter_composition.get_filter_sql\n end",
"title": ""
},
{
"docid": "fe0c25f88db4650b6b2543d522b4977e",
"score": "0.64225274",
"text": "def potential_filters\n [:date_filter, :sort_by]\n end",
"title": ""
},
{
"docid": "9fa010a6bc82d7a68ec6b087e8c8fdc2",
"score": "0.64167213",
"text": "def filters\n if task_config[\"filters\"].present?\n return task_config[\"filters\"]\n elsif task_config[\"filter_raw\"].present?\n return [task_config[\"filter_raw\"]]\n end\n []\n end",
"title": ""
},
{
"docid": "914d3a4dbf4039f07b7adcf504a1c051",
"score": "0.6404905",
"text": "def all(filters={})\n filters.reverse_merge!(:active_status => 'All')\n [query(self, :query, filters)].flatten\n end",
"title": ""
},
{
"docid": "f07b20e8e9e06db90c442da267d85dd6",
"score": "0.6403663",
"text": "def conditions\n @filter.nil? ? nil : @filter.conditions\n end",
"title": ""
},
{
"docid": "2e596253bef1429f578044da2f3d2a48",
"score": "0.63925916",
"text": "def filters\n @filters ||= EdgeFilters.new(graph, nil)\n end",
"title": ""
},
{
"docid": "68eef48d7495f843d8b3b96d50b063b0",
"score": "0.6368271",
"text": "def applicable_filters\n fs = []\n # fs << ProductFilters.taxons_below(self)\n ## unless it's a root taxon? left open for demo purposes\n\n fs << ProductFilters.price_filter if ProductFilters.respond_to?(:price_filter)\n fs << ProductFilters.brand_filter if ProductFilters.respond_to?(:brand_filter)\n fs\n end",
"title": ""
},
{
"docid": "b87360249f946be07c09900ff13a5020",
"score": "0.63588303",
"text": "def conditions\r\n unless self.empty?\r\n @filters.inject([\"\"]) do |condition,filter|\r\n filter = filter.dup\r\n condition.first << \" AND \" unless condition.first.empty?\r\n condition.first << filter.shift\r\n condition += filter\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "078faffebe3fa04cdee5ad99ea6f589e",
"score": "0.6352254",
"text": "def filter\n available_filters.each { |f| @spots = send(\"filter_by_#{f}\") }\n end",
"title": ""
},
{
"docid": "ddd9d38439ff2f8509e6b22d7f8455f8",
"score": "0.63440245",
"text": "def filter_by_scopes(filtering_params)\n results = self.none # AdtiveRecord::Base monkey patched in ext/base.rb\n filtering_params.each do |key, value|\n results = results.public_send(key, value) if value.present?\n end\n\n results\n end",
"title": ""
},
{
"docid": "2235de21cbf5de86ea8651590a23aa0e",
"score": "0.6339909",
"text": "def filter(filtering_params)\n\t\t\tresults = self.where(nil)\n\t\t\tfiltering_params.each do |key, value|\n\t\t\t\tresults = results.public_send(key, value) if value.present?\n\t\t\tend\n\t\t\tresults\n\t\tend",
"title": ""
},
{
"docid": "c92c3453bddabbe1ff482f3bff38c66d",
"score": "0.6339699",
"text": "def list_filters\n {\n category: \"Category eq VALUE\",\n title: \"Title eq VALUE\"\n }\n end",
"title": ""
},
{
"docid": "fc20fd6ccc913a158917a3bfe0412f69",
"score": "0.6336684",
"text": "def available_filters\n self.available_email_filters.reject{|name| self.date_filter_names.include? name}\n end",
"title": ""
},
{
"docid": "fc20fd6ccc913a158917a3bfe0412f69",
"score": "0.6336684",
"text": "def available_filters\n self.available_email_filters.reject{|name| self.date_filter_names.include? name}\n end",
"title": ""
},
{
"docid": "65d014e4f9926bbd63b55cd93eb48628",
"score": "0.63060033",
"text": "def all_with_filter(table, filter)\n return @conn.exec(\"SELECT * FROM #{table} WHERE #{filter}\").to_a\n end",
"title": ""
},
{
"docid": "3ab07d09fb8f973e418080317e0f2245",
"score": "0.63010967",
"text": "def custom_filters\n self.resource_class::REPORT_FILTER_OPTIONS.select{|filter| self.report_filters.pluck(:filter_name).exclude? filter.param}\n end",
"title": ""
},
{
"docid": "9b106470fffbd9c432bff449e72d15de",
"score": "0.6295632",
"text": "def filters row = nil\n @filters.inject({}) do |filters, filter|\n static_filters, proc = filter\n filters.merge(static_filters) if static_filters.is_a?(Hash)\n if (filter = proc.call(row) rescue nil).is_a?(Hash)\n filters.merge filter\n end\n end\n end",
"title": ""
},
{
"docid": "39c47b0bbdd68aa974e56b5eaea6f75f",
"score": "0.6294272",
"text": "def index\n @filterings = Filtering.all\n end",
"title": ""
},
{
"docid": "a47e9021e3ebcab43e8e1ffb388c1c70",
"score": "0.6289061",
"text": "def filter filter_name, *values\n filters = @filters.dup\n filters << { :name => filter_name, :values => values.flatten }\n collection_with(:filters => filters)\n end",
"title": ""
},
{
"docid": "a47e9021e3ebcab43e8e1ffb388c1c70",
"score": "0.6289061",
"text": "def filter filter_name, *values\n filters = @filters.dup\n filters << { :name => filter_name, :values => values.flatten }\n collection_with(:filters => filters)\n end",
"title": ""
},
{
"docid": "f3b5ff9e7256d7ef52bb59a3e0daf2d1",
"score": "0.6281827",
"text": "def filter(dataset)\n dataset.filter(conditions(filterable_tables(dataset)))\n end",
"title": ""
}
] |
315d408fd81b1df5b392efa0ccdced15
|
displays the chosen reservation asks if the user want to update or cancel the chosen reservation do we want to display the chosen restaurant's more info again? YES Stretch Goal
|
[
{
"docid": "2ff6bd8b84da36d451a7ea1829d3f9ac",
"score": "0.7582741",
"text": "def see_chosen_reservation(choice_id)\n user.reload\n #name of the restaurant they will be dining at \n restaurant_chosen = Reservation.all.find(choice_id).restaurant.name\n restaurant_date = Reservation.all.find(choice_id).date\n restaurant_party_size = Reservation.all.find(choice_id).party_size\n puts \" 🥂 You have a reservation for #{restaurant_party_size} at #{restaurant_chosen} on #{restaurant_date} 🥂\"\n\n prompt.select(\"What would you like to do?\") do |menu|\n menu.choice \"Update Reservation\", -> {update_reservation(choice_id)}\n menu.choice \"Cancel Reservation\", -> { delete_reservation(choice_id) }\n menu.choice \"See all Reservations\", -> { display_user_reservations_helper }\n menu.choice \"Main Menu\", -> {self.main_menu}\n end\n # binding.pry\n end",
"title": ""
}
] |
[
{
"docid": "1711cc71e2f7780034203832d897a901",
"score": "0.7582198",
"text": "def reservation\n opt = @view.reservations\n if opt == \"1\"\n tickets\n elsif opt == \"2\"\n #\n else\n error\n end \n end",
"title": ""
},
{
"docid": "4b454f83aad1493d932258175729260c",
"score": "0.7455654",
"text": "def update_reservation(chosen_reservation_id)\n #code for updating\n prompt.select(\"What would you like to update?\") do |menu|\n menu.choice \"Date\", -> {choose_new_date(chosen_reservation_id)}\n menu.choice \"Party Size\", -> {choose_new_party(chosen_reservation_id)}\n menu.choice \"Back\", -> {self.main_menu}\n end\n end",
"title": ""
},
{
"docid": "433954d89b427baebc0c684b0ee7fc98",
"score": "0.71748596",
"text": "def display_user_reservations_helper\n # self.user <- User who is logged in\n # self.user.restaurants <- All of the restaurants associated with the User\n # self.user.reservations <- All of the reservation instances\n # refer to Eric's video around 1:22:55 for more info on getting specific info out of objects! \n # all_choices = []\n #need to pull up Reservation.all\n #need to .find_by restaurant id && matches the self.user.id\n \n if self.user.reservations.count > 0\n my_rez = self.user.reservations.reservation_id\n # binding.pry\n choice_id = prompt.select(\"What reservation do you want to see?\", my_rez)\n # binding.pry\n see_chosen_reservation(choice_id)\n\n # sleep 5 #after 5 seconds of inactivity\n # self.main_menu #goes back to main menu\n # # self.main_menu <- To take me back to the main_menu\n else \n puts \"You don't have any reservations! Let's dine somewhere\"\n sleep 2\n display_all_restaurants_helper()\n end\n end",
"title": ""
},
{
"docid": "b1b3fef451e8c3fa26648d112fab7e91",
"score": "0.70622146",
"text": "def display_restaurant_info(choice)\n #our choice is only returning the name of the restaurant. not the instance created\n #we are now going to do Restaurant.find_by(name: choice) and save this to a variable\n highlighted_restaurant = Restaurant.find_by(name: choice)\n # binding.pry\n user_num = self.user.id\n # guest_num = self.user.user_id[0]\n # binding.pry\n\n \n\n puts ###############################################################################\n puts \"#{highlighted_restaurant.name}\"\n puts \"#{highlighted_restaurant.stars}\"\n puts ###############################################################################\n puts \"🗽: #{highlighted_restaurant.address}\"\n puts \"🥂: #{highlighted_restaurant.telephone}\"\n puts \"🌃: #{highlighted_restaurant.hours_open}\"\n puts \"🍽: #{highlighted_restaurant.cuisine}\"\n puts \"💸: #{highlighted_restaurant.pricey}\"\n \n\n puts \"❗️😷❗️ Tables available due to COVID-19: #{highlighted_restaurant.seating_capacity} ❗️😷❗️\" \n\n puts #################################################################################\n \n\n prompt.select(\"What would you like to do? \") do |menu|\n menu.choice \"Make a Reservation\", -> {reservation_confirmation(highlighted_restaurant, user_num)}\n menu.choice \"See all Restaurants\", -> {display_all_restaurants_helper}\n menu.choice \"Main Menu\", -> {self.main_menu}\n end\n end",
"title": ""
},
{
"docid": "ec12a67afa0932a48a316a5c9d309f43",
"score": "0.6768124",
"text": "def choose_new_date(chosen_reservation_id)\n new_date = TTY::Prompt.new.ask(\"Which date? *Please note that you can only change this once* =>\")\n #we are looking specifically for this ID, you may have multiple reservations\n my_rez_date = self.user.reservations.find(chosen_reservation_id)\n # binding.pry\n\n\n #How can we restrict a user from only updating something ONE time?\n my_rez_date.update(date: new_date)\n puts #############################################################\n puts \"New date confirmed for #{new_date} 🗓\"\n\n puts \"🦠 Please arrive 15 minutes prior\"\n puts \"🦠 There is a 2 hour window on dining\"\n sleep 8\n self.main_menu\n end",
"title": ""
},
{
"docid": "aa23fb3eb132eda7545ce0b61424294d",
"score": "0.6732306",
"text": "def reserve_room\n check_in = get_date_for(\"check in\", Date.today)\n\n check_out = get_date_for(\"check out\", check_in + 1)\n\n print \"Guest Name: \"\n guest = get_input\n\n print \"Preferred Room (Type N for no preference): \"\n room_number = get_room\n\n res = hotel.make_reservation(guest, check_in, check_out, room_number)\n\n show_table_of_reservations([res.last])\n end",
"title": ""
},
{
"docid": "4285d882d47938e5181d4c0d49e2226f",
"score": "0.6654648",
"text": "def reservation_confirm\n if @size == 1\n \"#{name}, thank you for your reservation. It has been confirmed from #{date_start} until #{date_end}. We look forward to seeing you soon!\"\n else\n \"#{name}, thank you for your reservation. It has been confirmed for #{size} people from #{date_start} until #{date_end}. We look forward to seeing you all soon!\"\n end\n end",
"title": ""
},
{
"docid": "e4d0a1eea8237dfe4242557be1ab95a6",
"score": "0.66028094",
"text": "def edit\n @reservation = Reservation.find(params[:id])\n @restaurants = @reservation.find_by_foursquare\n end",
"title": ""
},
{
"docid": "427cb1ff64c7664b5c701adb93ea3fe2",
"score": "0.6592962",
"text": "def early\n reservation = Reservation.new(user_credentials)\n unless reservation.reservation_with_id(params[:id]).nil?\n @reservation = reservation.reservation_with_id(params[:id])\n \n # Current reservation times\n @start_time_string = Time.at(@reservation[:start_time].to_i).strftime(\"%I:%M %p %d/%m/%Y\")\n @end_time = Time.at(@reservation[:end_time].to_i)\n @end_time_string = @end_time.strftime(\"%I:%M %p %d/%m/%Y\")\n end\n\n form_selection_options\n end",
"title": ""
},
{
"docid": "81edef66decc1fe33ac9692b556c811a",
"score": "0.6558264",
"text": "def booking_info(distance, cab, user)\n puts \"Dear #{user.name}\"\n puts \"You have selected car of #{cab.class} class\"\n puts \"Car no. : #{cab.number_plate}\"\n puts \"Driver name : #{cab.driver}\"\n puts \"Total Fare : #{cab.calculate_fare(distance)} Rs\"\n puts \"Ride Time : #{cab.calculate_time(distance)} Hrs. \\n \"\n puts '1.start ride'\n puts '2.cancel ride'\n choice(1, 2)\n end",
"title": ""
},
{
"docid": "b4f69e349ddaea0fe85b171dc9813605",
"score": "0.6513773",
"text": "def show\n @reservations = Reservation.where(number: params[:id])\n #si el numero de reservacion no contiene reservaciones lo redirige al seat chooser\n if @reservations.count == 0\n redirect_to edit_seat_path\n end\n end",
"title": ""
},
{
"docid": "569963477de3409067848af0d4d100c5",
"score": "0.6487729",
"text": "def hotel_view(hotel)\n waiting=true\n while waiting\n system \"clear\" or system \"cls\"\n puts \"Now Viewing: #{hotel.name}\"\n puts @active_dest.name\n self.hline\n puts \"Rating: #{hotel.rating}/5.0\"\n puts \"Best Price: $#{hotel.best_price}/night (from #{hotel.best_vendor})\"\n puts \"Price Offers:\"\n hotel.other_offers.each do |offer_arr|\n other_vend=offer_arr[0]\n other_price=offer_arr[1]\n puts \"\\t #{other_vend}: #{other_price}/night\"\n end\n puts \"\\n\\n1. Back to (M)ain Menu\"\n puts \"2. Back to All (D)estination Hotels\"\n\n\n\n choice = gets.strip\n\n if choice.downcase==\"m\" || choice.to_i == 1\n self.main_menu\n waiting=false\n elsif choice.downcase==\"d\" || choice.to_i==2\n self.dest_view(@active_dest)\n waiting=false\n else\n puts \"Please select a valid option\"\n sleep(1)\n waiting=true\n end\n end\n end",
"title": ""
},
{
"docid": "2b6dd17089d95150573d1c0a55d33760",
"score": "0.6421124",
"text": "def reservation_summary\n if SchedulingAccessRule.violated_access_rules(current_user).size > 0\n render :text=>''\n return\n end\n @user = current_user\n if instructor? \n @reservations = Reservation.find(:all,:conditions=>[\"instructor_id = ? and reservation_type='booking' and status!='canceled' and time_end>?\",@user.id,Time.new],:order=>'time_start desc') \n else\n @reservations = Reservation.find(:all,:conditions=>[\"created_by = ? and reservation_type='booking' and status!='canceled' and time_end>?\",@user.id,Time.new],:order=>'time_start desc')\n end\n render :partial => 'reservation_summary'\nend",
"title": ""
},
{
"docid": "d8b9669a1862d8bd8aa9bd7c1484aed2",
"score": "0.64068675",
"text": "def show\n @reservation = Reservation.new\n begin\n @current_reservation = Reservation.where(\n itinerary_id: @itinerary.id,\n guest_phone: @user.phone_number,\n status: 1)\n .first\n rescue Exception => e\n puts \"e.message\"\n end\n end",
"title": ""
},
{
"docid": "a3db5687ab85382df752bb02a66ee752",
"score": "0.6406061",
"text": "def show\n @reservation = Reservation.find_by(:id => params[:reservation_id])\n @day = Revervation. params[:day]\n # @bookings = Booking.where(:booking_id => @user.id)\n end",
"title": ""
},
{
"docid": "bfc75f5b9977085edc97fce0ced51c08",
"score": "0.63842726",
"text": "def reservations\n end",
"title": ""
},
{
"docid": "65f3b87afdd91b2d8b185fe693fa04ef",
"score": "0.6369199",
"text": "def show\n\t\t@reservation = Reservation.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "0eb879f52dd27d0f707bd6d3fc416eef",
"score": "0.635949",
"text": "def show\n @restaurant = Restaurant.find(params[:id])\n \n if current_user\n @reservation = @restaurant.reservations.build\n end\n end",
"title": ""
},
{
"docid": "4ff81a40d86735d449479b9930f1c338",
"score": "0.6341121",
"text": "def edit\n\t\t@reservation = Reservation.find_by(id: params[:id]) \n\tend",
"title": ""
},
{
"docid": "0eb768ef8c107d781782d9127080dc38",
"score": "0.63223946",
"text": "def update\n set_reservation\n if !reservation_params[:rendu]\n if reservation_params[:date_fin].to_date > Date.current\n if @reservation.update(reservation_params)\n redirect_to book_reservation_url, notice: 'La réservation a bien été mise à jour.'\n else\n render :edit\n end\n else\n redirect_to edit_book_reservation_path(@book,@reservation), notice: 'Vous ne pouvez pas réserver ce livre pour moins d\\'une journée'\n end\n else\n if @reservation.update(reservation_params)\n redirect_to book_reservation_url, notice: 'La réservation a bien été mise à jour.'\n else\n render :edit\n end\n end\n end",
"title": ""
},
{
"docid": "a4cd98e171a1464ab7b654668f12d0fa",
"score": "0.63163954",
"text": "def edit\r\n @reservation = Reservation.find(params[:id])\r\n\r\n end",
"title": ""
},
{
"docid": "099834fa17e239bec1c3b0adc1cfbd82",
"score": "0.6304507",
"text": "def update\n \n if @reservation.update(reservation_params)\n redirect_to @mentor\n else\n render 'edit'\n end\n \n end",
"title": ""
},
{
"docid": "345f1a815cd7584c5b1b8d024213777c",
"score": "0.63014376",
"text": "def edit\n @reservation = Reservation.find(params[:id])\n @form_id = 'edit-form'\n @location_list = ApplicationHelper::Location.data\n @status_list = ApplicationHelper::ReservationStatus.data\n \n respond_to do |fmt|\n fmt.html { render partial: 'form' }\n fmt.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "3614324030aba6e916107b32b7bc9666",
"score": "0.6296528",
"text": "def update\n @reservation = restaurant.reservations.find(params[:id])\n\n respond_to do |format|\n if @reservation.update_attributes(params[:reservation])\n format.html { redirect_to root_path, notice: \"Reservation updated successfully\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "507d61e957339680e66d3678e3509f9d",
"score": "0.6292778",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to [@restaurant, @table, @reservation], notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e2e448d39481e3025663f409a10ae89",
"score": "0.62820065",
"text": "def update\n if @reservation.update(reservation_params)\n redirect_to time_slot_reservation_path(@time_slot, @reservation), notice: 'Reservation was successfully updated.'\n else\n render :edit \n end\n end",
"title": ""
},
{
"docid": "2f0b16c5a51c9f3dfb26c7e56ddee3f4",
"score": "0.62763023",
"text": "def update\n if @reservation.update(reservation_params)\n redirect_to @reservation\n else\n render :edit \n end\n end",
"title": ""
},
{
"docid": "cbb481e90ba161be60a1d6412eadb89b",
"score": "0.6273068",
"text": "def edit\n #@reservations = Reservation.find_by(params[:id])\n end",
"title": ""
},
{
"docid": "4fedf26ac342d9b9b4789cccf25a7e2b",
"score": "0.62730134",
"text": "def set_reservation\n end",
"title": ""
},
{
"docid": "4e60ce73d718f12b3aad5c578f3039da",
"score": "0.6260081",
"text": "def show\n @reservation = Reservation.find(params[:id])\n end",
"title": ""
},
{
"docid": "4e60ce73d718f12b3aad5c578f3039da",
"score": "0.6260081",
"text": "def show\n @reservation = Reservation.find(params[:id])\n end",
"title": ""
},
{
"docid": "83efb7664d09544747dd9f22a2ab9ba2",
"score": "0.6253896",
"text": "def update\n @reservation = Reservation.find(params[:id])\n if @reservation.update(reservation_params)\n flash[:success] = 'Reservation was successfully updated.'\n redirect_to @reservation\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "1b1c25438e4b69f525a7a0ecf5212bc2",
"score": "0.6247656",
"text": "def show\n @reservation = restaurant.reservations.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "94e001ba73699cbc6298fe5afbc56823",
"score": "0.62296706",
"text": "def confirm\n respond_to do |format|\n if @reservation.update(reservation_params)\n printf (reservation_params[:id])\n format.html {redirect_to @reservation, notice: 'Reservation was successfully updated.'}\n format.json {render :show, status: :ok, location: @reservation}\n else\n format.html {render :edit}\n format.json {render json: @reservation.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "51fea6cb16a65788001d7133594b0f42",
"score": "0.6218843",
"text": "def reserveRoom(bookingEvent, autoSchedule, rooms, schedule, eventSlots, building, room, date, startTime, duration, capacity, computersAvailable, seatingAvailable, seatingType, foodAllowed, priority, roomType)\n\ti = 0\n\t# If we are auto-scheduling this event, we won't take any user parameters (thus we skip the next loop). Events like the opening and closing ceremony are autoschedule.\n\tif autoSchedule == \"T\"\n\t\ti = i + 1\n\tend\n\n\t# If we aren't auto-scheduling this event, loop until the user enters as many parameters for the room as they want.\n\twhile i == 0\n\t\tputs \"\\nSelect a parameter for the room:\\n\"\n\t\tputs \"a - Enter a building\"\n\t\tputs \"b - Enter a room number\"\n\t\tputs \"c - Enter a date for your reservation\"\n\t\tputs \"d - Enter a start time for your reservation\"\n\t\tputs \"e - Enter a duration for your reservation\"\n\t\tputs \"f - Enter a desired capacity for your reserved room\"\n\t\tputs \"g - Mark if computers are necessary\"\n\t\tputs \"h - Enter what seating needs to be available in your reserved room\"\n\t\tputs \"i - Enter the type of seating in your reserved room\"\n\t\tputs \"j - Enter if food needs to be allowed in your reserved room\"\n\t\tputs \"k - Enter priority type for your reserved room\"\n\t\tputs \"l - Enter type of room for your reserved room\"\n\t\tputs \"q - CONTINUE\"\n\t\t\n\t\tprint \"\\nEnter your option: \"\n\t\toption = gets.chomp\n\t\tif option == \"a\"\n\t\t\tprint \"What building? \"\n\t\t\t# Receives user-input for building\n\t\t\tbuilding = gets.chomp\n\t\telsif option == \"b\"\n\t\t\tprint \"What room? \"\n\t\t\t# Receives user-input for room\n\t\t\troom = gets.chomp\n\t\telsif option == \"c\"\n\t\t\tprint \"What date (format \\\"yyyy-mm-dd\\\")? \"\n\t\t\t# Receives user-input for date\n\t\t\tdate = gets.chomp\n\t\telsif option == \"d\"\n\t\t\tprint \"What start time (format \\\"hh:mm AM/PM\\\")? \"\n\t\t\t# Receives user-input for time\n\t\t\tstartTime = gets.chomp\n\t\t\t# Make sure the user entered data is formatted correctly.\n\t\t\tstartTime = startTime.split(/\\W+/)\n\t\t\tstartTime = formatTime(startTime)\n\t\telsif option == \"e\"\n\t\t\tprint \"What duration (format \\\"hh:mm\\\")? \"\n\t\t\t# Receives user-input for duration\n\t\t\tfullDuration = gets.chomp\n\t\t\tdurationSplit = fullDuration.split(\":\")\n\t\t\t# Converts duration to minutes.\n\t\t\tduration = durationSplit[0].to_i*60 + durationSplit[1].to_i\n\t\telsif option == \"f\"\n\t\t\tprint \"What capacity? \"\n\t\t\t# Receives user-input for capacity\n\t\t\tcapacity = gets.chomp\n\t\telsif option == \"g\"\n\t\t\tprint \"Are computers necessary (format \\\"Yes/No\\\")? \"\n\t\t\t# Receives user-input for if computers are available\n\t\t\tcomputersAvailable = gets.chomp\n\t\telsif option == \"h\"\n\t\t\tprint \"What seating is necessary? \"\n\t\t\t# Receives user-input for what seating is necessary\n\t\t\tseatingAvailable = gets.chomp\n\t\telsif option == \"i\"\n\t\t\tprint \"What type of seating? \"\n\t\t\t# Receives user-input for what type of seating\n\t\t\tseatingType = gets.chomp\n\t\telsif option == \"j\"\n\t\t\tprint \"Does food need to be allowed (format \\\"Yes/No\\\")? \"\n\t\t\t# Receives user-input for whether food is allowed in the room\n\t\t\tfoodAllowed = gets.chomp\n\t\telsif option == \"k\"\n\t\t\tprint \"What priority? \"\n\t\t\t# Receives user-input for the room's priority\n\t\t\tpriority = gets.chomp\n\t\telsif option == \"l\"\n\t\t\tprint \"What type of room? \"\n\t\t\t# Receives user-input for the type of room\n\t\t\troomType = gets.chomp\n\t\telsif option == \"q\"\n\t\t\ti = i + 1\n\t\t\t# Leaves the loop with the desired parameters.\n\t\telse\n\t\t\t# A wrong value was entered.\n\t\t\tputs \"\\n>>> Please enter a valid parameter.\"\n\t\t\tputs \"Press any key to continue.\"\n\t\t\tgets.chomp\n\t\tend\n\tend\n\tputs \"Searching for a room...\"\t\n\tvalidRoom = 0\n\tcounter = 0\n\t# Loops until a valid room is found\n\twhile validRoom == 0\n\t\t# Loops through all Schedule objects in the list\n\t\tschedule.each do |scheduleData|\n\t\t\t# Loops through all Room objects in the list\n\t\t\trooms.each do |roomData|\n\t\t\t\t# Checks to see if the object matches the given parameters.\n\t\t\t\tif (scheduleData.building == roomData.building) and (scheduleData.room == roomData.room) and (building == -1 or (scheduleData.building == building and roomData.building == building)) and (room == -1 or (scheduleData.room == room and roomData.room == room)) and (date == -1 or scheduleData.date == date) and (startTime == -1 or scheduleData.time == startTime) and (capacity == -1 or capacity >= roomData.capacity) and (computersAvailable == -1 or roomData.computersAvailable == computersAvailable) and (seatingAvailable == -1 or roomData.seatingAvailable == seatingAvailable) and (seatingType == -1 or roomData.seatingType == seatingType) and (foodAllowed == -1 or roomData.foodAllowed == foodAllowed) and (priority == -1 or roomData.priority == priority) and (roomType == -1 or roomData.roomType == roomType)\n\t\t\t\t\t# Determines the number of hours/intervals that rooms need to be booked for, based on the given duration.\n\t\t\t\t\tdurationIntervals = duration/60\n\t\t\t\t\tdurationIntervals = durationIntervals.abs()-1\n\t\t\t\t\tdurationValid = 1\n\t\t\t\t\t# a represents the index of the data in the list of Schedule objects\n\t\t\t\t\ta = schedule.find_index(scheduleData)\n\t\t\t\t\tfor x in 0..durationIntervals\n\t\t\t\t\t\tif schedule[a+x].available == \"false\"\n\t\t\t\t\t\t\t# One of the time slots in the duration was found to be occupied/available.\n\t\t\t\t\t\t\tdurationValid = 0\n\t\t\t\t\t\t\tif startTime != -1\n\t\t\t\t\t\t\t\t# If the event's time was one of the given parameters, we can increment by one hour to accomodate the unavailable time.\n\t\t\t\t\t\t\t\tstartTime = startTime.split(/\\W+/)\n\t\t\t\t\t\t\t\tstartTime[0] = startTime[0].to_i + 1\n\t\t\t\t\t\t\t\t# Added time might push the time over 12 to 1'o'clock\n\t\t\t\t\t\t\t\tif startTime[0].to_i > 12\n\t\t\t\t\t\t\t\t\tstartTime[0] = 1\n\t\t\t\t\t\t\t\t\tif startTime[2] == \"PM\"\n\t\t\t\t\t\t\t\t\t\tstartTime[2] = \"AM\"\n\t\t\t\t\t\t\t\t\telsif startTime[2] == \"AM\"\n\t\t\t\t\t\t\t\t\t\tstartTime[2] = \"PM\"\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t# Format the time again.\n\t\t\t\t\t\t\t\tstartTime = formatTime(startTime)\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\t\t# If the duration is valid, we can ask the user if they want to book this time.\n\t\t\t\t\tif durationValid == 1\n\t\t\t\t\t\tvalidReply = 1\n\t\t\t\t\t\twhile validReply == 1\n\t\t\t\t\t\t\t# Loop until a valid reply is given to this question.\n\t\t\t\t\t\t\tprint \"How does #{scheduleData.building} #{scheduleData.room} at #{scheduleData.time} on #{scheduleData.date} sound? (Y/N) \"\n\t\t\t\t\t\t\treply = gets.chomp\n\t\t\t\t\t\t\tif reply == \"Y\" or reply == \"y\" or reply == \"yes\" or reply == \"Yes\"\n\t\t\t\t\t\t\t\t# User agreed to the event parameters.\n\t\t\t\t\t\t\t\tvalidRoom = 0\n\t\t\t\t\t\t\t\tvalidReply = 0\n\t\t\t\t\t\t\t\tb = schedule.find_index(scheduleData)\n\t\t\t\t\t\t\t\tfor y in 0..durationIntervals\n\t\t\t\t\t\t\t\t\t# Book the room for all time slots on the interval\n\t\t\t\t\t\t\t\t\teventSlots = slotRoom(bookingEvent, schedule[b+y], eventSlots)\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\treturn eventSlots\n\t\t\t\t\t\t\telsif reply == \"N\" or reply == \"n\" or reply == \"no\" or reply == \"No\"\n\t\t\t\t\t\t\t\t# The user disagreed to the event parameters, find a different Schedule object and time slot.\n\t\t\t\t\t\t\t\tvalidReply = 0\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t# The user didn't enter a valid response.\n\t\t\t\t\t\t\t\tputs \"Please enter a valid reply!\"\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\t\t\tend\n\t\tend\n\t\tcounter = counter + 1\n\t\t# If invalid parameters were entered, the program will continually search through both the lists for a long time. Ask the user to wait for the process to complete, so the loop will end (and not loop indefinitely).\n\t\tif counter == (schedule.length/8) or counter == (schedule.length/4) or counter == (3*schedule.length/8) or counter == (schedule.length/2) or counter == (5*schedule.length/8) or (counter == 3*schedule.length/4) or counter == (7*schedule.length/8)\n\t\t\tputs \"Please wait...\"\n\t\tend\n\t\tif counter == schedule.length\n\t\t\tputs \"No rooms found matching the parameters.\"\n\t\t\tvalidRoom = 1\n\t\tend\n\tend\n\t# Return the list of events (which was changed by the slotRoom() method).\n\treturn eventSlots\nend",
"title": ""
},
{
"docid": "a86b261b7cfc293f6b1462b9cdab04f2",
"score": "0.6184573",
"text": "def new\n @page_title = \"Scheduled Arrivals Selection\"\n @reservation = Reservation.new :startdate => currentDate+1, :enddate => currentDate+1\n end",
"title": ""
},
{
"docid": "2038f895001a5944a199cfa7e2055fe0",
"score": "0.6170403",
"text": "def update\n\t\tparams[:reservation][:person_id] = @current_user.id if @current_user && (!@reservation || !@reservation.person_id)\n\t\t@reservation.show_token = @show.private_registration_token\n\t\trespond_to do |format|\n\t\t\tif @reservation.update_attributes(params[:reservation])\n\t\t\t\tformat.html { redirect_to show_reservation_path(@show, @reservation, :auth_code => @reservation.token), :notice => 'Reservation was successfully updated.' }\n\t\t\telse\n\t\t\t\tflash.now[:error] = \"Sorry, there was a problem with the data you entered. #{@reservation.errors.full_messages.to_sentence}.\"\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9c6ff908b7804509774329515efacccf",
"score": "0.6161313",
"text": "def reservation\n Reservation.find_by(id: reservation_id) if reservation_id.present?\n end",
"title": ""
},
{
"docid": "fb3ba6e7bd68c95edeca481658b014b9",
"score": "0.6151731",
"text": "def reservation_accepted\n if !self.reservation\n errors.add(:reservation_id, \"You must have a reservation\")\n elsif self.reservation.status != \"accepted\"\n errors.add(:reservation_id, \"You can only leave review if your reservation was accepted\")\n elsif self.reservation.checkout > Date.today\n errors.add(:reservation_id, \"You must have already checkout to leave a review\")\n end\n end",
"title": ""
},
{
"docid": "c8e03ad1317ab4e374d4e5c95e4faa1e",
"score": "0.61466455",
"text": "def show\n@reservation = Reservation.first.nil?\n if @reservation\n flash[:notice] = \"Reservation Table Empty\"\n else\n @reservation = Reservation.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "813f619beac32b85c5f8e91f6d51e9d3",
"score": "0.6139446",
"text": "def accept\n @reservation = Reservation.find(params[:id])\n @reservation.status = \"Accepted\"\n # SUBTRACTS NUMBER OF SERVINGS ON RESERVATION FROM THE MEAL POSTING'S SERVINGS\n @reservation.meal_posting.servings = @reservation.meal_posting.servings - @reservation.number_of_people\n if @reservation.meal_posting.servings < 0\n flash[:alert] = \"Not enough servings left of #{@reservation.meal_posting.title}\"\n redirect_to reservations_url\n else\n @reservation.save\n @reservation.meal_posting.save\n redirect_to reservations_url\n end\n end",
"title": ""
},
{
"docid": "928deed00dd059835d8da8f06e36fd74",
"score": "0.6127341",
"text": "def delete_reservation(chosen_reservation_id)\n #code for deleting\n response = prompt.yes?(\"Do you want to cancel this reservation?\") do |q|\n q.suffix \"Y / N\"\n end\n if response == true\n my_rez_delete = self.user.reservations.find(chosen_reservation_id)\n my_rez_delete.destroy\n puts \"Your reservation is cancelled 😭🥺\"\n sleep 5\n self.main_menu\n else\n puts \"Phew! We can't wait to see you! 😅\"\n sleep 5\n self.main_menu\n end\n end",
"title": ""
},
{
"docid": "36391bf3b2c698f6da19973a5d4b2e02",
"score": "0.61265135",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation.reserf, notice: 'Reservation was successfully updated.' }\n else\n @reserf = @reservation.reserf\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "494de3abe63dc6c1e11181b709bff0f9",
"score": "0.6116219",
"text": "def update\n\t\tparams[:reservation][:person_id] = @current_user.id if @current_user && (!@reservation || !@reservation.person_id)\n\t\trespond_to do |format|\n\t\t\tif @reservation.update_attributes(params[:reservation])\n\t\t\t\tformat.html { redirect_to (url_for([@show,@reservation]) + \"?auth_code=#{@reservation.token}\"), :notice => 'Reservation was successfully created.' }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\", :notice => 'Sorry, there was a problem with the data you entered, please try again!' }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3ca6aeae9dd7c47ab19ac171ffcb381e",
"score": "0.6105511",
"text": "def update\n\trespond_to do |format|\n\t if @reservation.update(reservation_params)\n\t\tformat.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n\t\tformat.json { render :show, status: :ok, location: @reservation }\n\t else\n\t\tformat.html { render :edit }\n\t\tformat.json { render json: @reservation.errors, status: :unprocessable_entity }\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "451e83cf2ce35839e2de2b80b6ce5bae",
"score": "0.60933036",
"text": "def create\n @reservation = Reservation.new\n\n @reservation.time = params[:reservation][\"time(4i)\"]\n @reservation.date = params[:reservation][:date]\n @reservation.restaurant_id = params[:reservation][:restaurant_id]\n @reservation.number_of_tables = params[:reservation][:number_of_tables]\n # @restaurant.customer_id = current_customer.id\n # @reservation.restaurant_id = Restaurant.find_by(id: params[:id])\n\n if @reservation.save\n redirect_to reservations_path\n else\n redirect_to restaurant_path(params[:reservation][:restaurant_id])\n end\n\n end",
"title": ""
},
{
"docid": "e0b4066602c11eef326f028c492e7949",
"score": "0.6092567",
"text": "def reserve\n buyerid = @current_user._id\n\n # three parameters : date, hour and a dish id.\n respond_to do |format|\n #Process reservation with three parameters.\n if Reservation.Reserve(params[:date], params[:hour], params[:dishId], buyerid)\n format.html { redirect_to account_page_path, notice: 'Reservation done! Check out reservation category.' }\n else\n flash[:error] = \"A Problem came while updating the reservation\"\n redirect_to dish_show_page_path(params[:dishId]) # halts request cycle\n end\n end\n end",
"title": ""
},
{
"docid": "3656cbe9f778507406265d1bdbf628a4",
"score": "0.6076964",
"text": "def confirmed_reservations\n space_is_available? ? reservations : reservations[ 0, self.seats ]\n end",
"title": ""
},
{
"docid": "9dede8fa7c40d29ae519d099dd2f4be4",
"score": "0.60756916",
"text": "def reservation_error\n @booking.errors.add_to_base('Can\\'t reserve booking.')\n source_page = self.action_name == 'exec_reserve' ? 'reserve' : 'new'\n render source_page\n end",
"title": ""
},
{
"docid": "1a6a1975a29f0a08cb66bfe4b718f979",
"score": "0.6068369",
"text": "def update\n \n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2507634e958b554cb5c7f7d0895978f9",
"score": "0.6065668",
"text": "def show\n @reserve = Reserve.find(params[:id])\n check_can_access?\n\n @information_type = Reserve.get_information_type(@reserve)\n @receipt_library = Library.find(@reserve.receipt_library_id)\n @reserved_count = Reserve.waiting.where(:manifestation_id => @reserve.manifestation_id, :checked_out_at => nil).count\n\n respond_to do |format|\n format.html { render :template => 'opac/reserves/show', :layout => 'opac'} if params[:opac]\n format.html # show.html.erb\n format.json { render :json => @reserve }\n end\n end",
"title": ""
},
{
"docid": "c32faeb4e6eaaddcef3ab52cb0096d72",
"score": "0.6048461",
"text": "def show\n user=User.find(session[:user_id]).id\n @showing_reservation=Reservation.where(\"user_id =?\",user)\n end",
"title": ""
},
{
"docid": "63d2c950aa4dc203d765e9dd85b8105e",
"score": "0.60404253",
"text": "def update\n\t\tif (@reservation.update(reservation_params))\n\t\t\tredirect_to reservation_transactions_path(@reservation)\n\t\telse\n\t\t\trender :edit\n\t\tend\n\tend",
"title": ""
},
{
"docid": "28adc1f3e913c0bebac51095bc99f7b7",
"score": "0.60348654",
"text": "def cancel_reservation\n \n # try to get the profile page for the user\n agent = User.find(user_id).mechanize\n begin\n profile_page = agent.get(\"http://www.opentable.com/myprofile.aspx\")\n rescue Exception => e\n return \"Reservation was not canceled because there was a problem connecting with OpenTable servers. Please try again.\"\n end\n\n # if one or more reservations are listed, find the desired reservation and try to cancel it\n if profile_page.parser.css(\"div.RestaurantName a\").size > 0\n \n # loop through each reservation and save the index of the desired reservation\n index = -1\n profile_page.parser.css(\"div.RestaurantName a\").each_with_index { |x, i| index = i if x.text == self.restaurant.name }\n if index != -1\n \n begin\n cancel_page = agent.get(profile_page.parser.css(\"div.C a\")[index]['href'])\n rescue Exception => e\n return \"Reservation was not canceled because there was a problem connecting with OpenTable servers. Please try again.\"\n end\n \n cancel_form = cancel_page.form('Form1')\n submit_button = cancel_form.button_with(:name => 'btnCancelReso')\n \n begin\n done_page = agent.submit(cancel_form, submit_button)\n rescue Exception => e\n return \"Reservation was not canceled because there was a problem connecting with OpenTable servers. Please try again.\"\n end\n \n self.isReserved = false\n self.save\n reservation_status = \"Reservation was successfully canceled.\"\n end\n \n else\n reservation_status = \"Reservation was not canceled.\"\n end\n \n return reservation_status # return the reservation status\n end",
"title": ""
},
{
"docid": "b514d5b517821af14b9063d556d798a8",
"score": "0.6026657",
"text": "def new_review\n @reservation = Reservation.find_by(id: params[\"id\"])\n @restaurant = Restaurant.find_by(id: @reservation.restaurant_id)\n if session[\"user_id\"].blank?\n redirect_to \"/login\"\n elsif @reservation.user_id != session[\"user_id\"]\n flash[:danger] = \"This reservation does not belong to you!\"\n redirect_to \"/reservations\"\n else\n render 'new_review'\n end\n end",
"title": ""
},
{
"docid": "077e1d5ad76e17cd89ec7889d6ce0abe",
"score": "0.60266554",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation }\n flash[:success]= 'Reservation was successfully updated.'\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fcd97d2ce20b04acb05cea0bc7d4717",
"score": "0.60233897",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5411517fb6b8696679c48513551c6a2",
"score": "0.6021944",
"text": "def choose_new_party(chosen_reservation_id)\n new_party = TTY::Prompt.new.ask(\"How many for dinner? *Please note that you can only change this once* =>\")\n my_rez_party = self.user.reservations.find(chosen_reservation_id)\n # binding.pry\n my_rez_party.update(party_size: new_party)\n puts \"New party size of #{new_party} confirmed! 🌟\"\n sleep 3\n self.main_menu\n end",
"title": ""
},
{
"docid": "c3d2e526bd6189a312e384da0a22f02e",
"score": "0.60169286",
"text": "def new\n @reservation = restaurant.reservations.new\n @check_time_res = restaurant.reservations.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"title": ""
},
{
"docid": "9166183647147a22fcf414f752de14d2",
"score": "0.60114604",
"text": "def show\n\t\t@reservations = Reservation.find_by(id: params[:id]) \n\tend",
"title": ""
},
{
"docid": "22a9a4db82b36e294a82026e62b4888f",
"score": "0.6009716",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to [:reception, @reservation.space.location.org, @reservation.space.location, @reservation], notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: [:reception, @reservation.space.location.org, @reservation.space.location, @reservation] }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b02715f5347b6ce74a890f6f1c41bd8",
"score": "0.6002929",
"text": "def update\n\n puts \"*************** update\"\n\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7473c1409b1f042605cfc01751e0afc",
"score": "0.60005695",
"text": "def dest_view(dest)\n waiting=true\n while waiting\n system \"clear\" or system \"cls\"\n puts \"Showing Hotels for '#{dest.name}' \"\n self.hline\n num_items=dest.hotels.length\n sorted = dest.hotels.sort_by {|hotel| hotel.rating}\n sorted.reverse!\n sorted.each_with_index do |hotel,ind|\n puts \"#{ind+1}. #{hotel.name} (Rating: #{hotel.rating}/5.0)\"\n end\n puts \"#{num_items+1}. Back to Main Menu\"\n\n choice = gets.strip.to_i\n\n if choice.between?(1,num_items)\n hotel=sorted[choice-1]\n hotel_view(hotel)\n waiting=false\n elsif choice==num_items+1\n self.main_menu\n waiting=false\n else\n puts \"Please select a valid option\"\n sleep(1)\n waiting=true\n end\n end\n end",
"title": ""
},
{
"docid": "dcad98a937236fc543d2c00c131a3e14",
"score": "0.59992826",
"text": "def print_reservations(user)\n if user.reservations.count == 0\n puts \"You have no reservations at this time.\" \n return\n end\n user.reservation_list_helper.each{|reservation| p \"Restaurant: #{reservation[0]}, Date: #{reservation[1]}, Guests: #{reservation[2]}\"}\n end",
"title": ""
},
{
"docid": "5cafc91cd61ba8ed48b2a08a5340ac0a",
"score": "0.59984624",
"text": "def preservation\n end",
"title": ""
},
{
"docid": "7cd01f58323acd105f6173f62a9a4eea",
"score": "0.5994018",
"text": "def show\n if current_user.moderator?\n @reservation = Reservation.includes(:listing).find(params[:id])\n elsif params.keys.include? 'user_id'\n @reservation = current_user.get_listings_reservations.includes(:listing).find(params[:id])\n elsif params.keys.include? 'listing_id'\n @reservation = current_user.listings.find(params[:listing_id]).reservations.includes(:listing).find(params[:id])\n else\n @reservation = current_user.reservations.includes(:listing).find(params[:id])\n end\n\n render 'show'\n\n end",
"title": ""
},
{
"docid": "fadfee6fbcf8041bb9f4d2e8b529894f",
"score": "0.59925246",
"text": "def update\n reservation = Reservation.find_by!(id: params[:id])\n if reservation \n reservation.status = params[:status]\n reservation.confirm_date = params[:confirm_date]\n reservation.description = params[:description]\n reservation.user_receive_id = params[:user_receive_id]\n reservation.user_doctor_id = params[:user_doctor_id]\n reservation.appointment_date = params[:appointment_date]\n reservation.save\n render json: reservation, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "331e639ebc9c91316f93f8b10917be98",
"score": "0.59896797",
"text": "def extend\n reservation = Reservation.new(user_credentials)\n unless reservation.reservation_with_id(params[:id]).nil?\n @reservation = reservation.reservation_with_id(params[:id])\n \n # Current reservation times\n @start_time_string = Time.at(@reservation[:start_time].to_i).strftime(\"%I:%M %p %d/%m/%Y\")\n @end_time = Time.at(@reservation[:end_time].to_i)\n end_date = @end_time.to_date\n @end_time_string = @end_time.strftime(\"%I:%M %p %d/%m/%Y\")\n \n form_selection_options\n end\n end",
"title": ""
},
{
"docid": "1071d789eed48f9c5b2fda2fbbad462b",
"score": "0.59841245",
"text": "def set_reservation\n\t @reservation = Reservation.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "7174e96f3e723d832ab64b019ac19757",
"score": "0.5980313",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @reservation.status = 'current'\n @reservation.user_id = @user.id\n @reservation.rental_charge = @reservation.calculate_rental_charge\n @car = @reservation.car\n @car.status = 'reserved'\n respond_to do |format|\n if @reservation.save and @car.save\n format.html { redirect_to admin_reservations_path, notice: 'Reservation was successfully created.' }\n format.json { render :show, status: :created, location: @reservation }\n else\n @cars = Car.where(:status => :available)\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29f059aeb179e2a5e9b4fc4e46f24574",
"score": "0.59778476",
"text": "def create\n @reservation = restaurant.reservations.new(params[:reservation])\n @check_time_res = restaurant.reservations.new\n\n respond_to do |format|\n if @reservation.save\n ReservationsMailer.confirmation(@reservation).deliver\n\n format.html { redirect_to root_path, notice: \"Your reservation was successfully created. Your confirmation number is #{@reservation.id}\" }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66f581ec1be6a41f9b308f442bde16de",
"score": "0.5976581",
"text": "def selected_reservations?\n model_items = ['reservation_new','reservation_list']\n model_items.include?(item_selected)\n end",
"title": ""
},
{
"docid": "187d04235e66492216bfec5c84d3f4cf",
"score": "0.5975352",
"text": "def show\n @user = User.find(@reservation.user_id)\n @schedule = Schedule.find(@reservation.schedule_id)\n @salon = Salon.find(@schedule.salon_id)\n @owner = User.find(@salon.user_id)\n end",
"title": ""
},
{
"docid": "9b45e1ced7dff85cc8fdef7c1ec9fc92",
"score": "0.597495",
"text": "def display_all_restaurants\n user.reload\n system \"clear\"\n OrderHere.header\n # clear previous cart if any\n user.dishes.each {|dish| dish.destroy }\n pick_a_restaurant = prompt.select(\" Please choose a restaurant to start your order\", Restaurant.list)\n @choosen_restaurant = Restaurant.find(pick_a_restaurant)\n #----Dishes for the curent user --------\n system 'clear'\n OrderHere.header\n chosen_dish = prompt.select(\"Choose your dish\" ,Dish.all_dishes )\n #___Create a new Order using the options from the current user ______\n Order.create(user_id: self.user.id, dish_id: chosen_dish, restaurant_id: @choosen_restaurant)\n self.order_menu\n end",
"title": ""
},
{
"docid": "3d7c47359715ebd9ff83e6a44ab61f7c",
"score": "0.5973029",
"text": "def reservation_notification(restaurant, reservation)\n \t#break if restaurant.owner_id.blank?\n \t#binding.pry\n @restaurant = restaurant\n @reservation = reservation\n \t@user = Owner.find_by_id(restaurant.owner_id)\n @url = 'http://www.google.com'\n mail( :to => @user.email,\n :subject => 'New Reservation' )\n end",
"title": ""
},
{
"docid": "090328a983d15c6d8e4af12869cac45d",
"score": "0.5971976",
"text": "def reservation_is_valid\n result = Luvwrapper.view_reservation(self.rcrd_loc, self.first_name, self.last_name)\n \n if result.success?\n itinerary = result.itinerary\n itinerary.destinations.each do |destination|\n destination.segments.each do |s|\n @seg = Segment.new(:origin => s.departing_airport_code,\n :flt_time => s.departing_time,\n :checkin_time => (self.a_list ? s.departing_time - 36.hours : s.departing_time - 24.hours))\n @seg.save\n self.segments << @seg\n end\n end\n return\n else \n errors.add(:rcrd_loc, 'Invalid Confirmation #')\n end\n end",
"title": ""
},
{
"docid": "8b94e05bd026b2e28ca1f3b55c5f77da",
"score": "0.59705424",
"text": "def show\n if user_signed_in?\n @myReservation = Reservation.myRestaurantReservation(current_user.id, @restaurant.id)\n end\n @photos = @restaurant.photos\n @dishes = @restaurant.dishes\n @address = @restaurant.address\n @types = @restaurant.types\n @schedules = @restaurant.schedules\n end",
"title": ""
},
{
"docid": "735d3d0b1aca0a7fbcbc1962f40c3662",
"score": "0.59680194",
"text": "def print_number_reservations(db, details, selected_reservation)\n\tputs \"You have #{selected_reservation.length} #{details[:reservation_type]} reservation(s) to #{details[:modification_type]}.\"\nend",
"title": ""
},
{
"docid": "4f4d56da60019927260523d4d2efdf31",
"score": "0.59599787",
"text": "def show\n\n if current_user.restaurants.nil?\n @msg = \"Please add a restaurant to your profile?\"\n else\n @restaurants = current_user.restaurants\n end\n \n @chosen = Restaurant.joins('INNER JOIN events INNER JOIN restmembers WHERE events.id = restmembers.event_id AND restaurants.id = restmembers.restaurant_id AND events.id = ', params[:id])\n @random_choose = @chosen.order('RANDOM()').first\n @winner = Restaurant.joins('INNER JOIN events WHERE events.event_winner = restaurants.id AND events.id = ', params[:id])\n # @has_picked = Restmember.where('event_id = ', params[:id],'AND user_id = 1').count\n @has_picked = Restmember.where('user_id = ? AND event_id = ?', current_user, params[:id]).count\n\n # @selectmade = Restmember.joins('INNER JOIN events WHERE', current_user == ' restmembers.user_id AND restmembers.event_id = ', params[:id])\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e44776edc6721918bd6d76e9ba40369",
"score": "0.59592074",
"text": "def update\n respond_to do |format|\n if @reservation.update(reservation_params)\n format.html { redirect_to @reservation, notice: 'Reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation }\n else\n format.html { render :edit }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
edb770ff33efe9bf36dc99110f596912
|
From the page 725 true ^ obj > true or false Exclusive Or Returns true if obj is nil or false and returns false otherwise.
|
[
{
"docid": "cbce33b459cd7a9676952a470f6f4e04",
"score": "0.55598015",
"text": "def test_TrueClass_InstanceMethods_ExclusiveOr\n\t\tassert_equal(false, true ^ true)\n\t\tassert_equal(true, true ^ false)\n\t\tassert_equal(true, false ^ true)\n\tend",
"title": ""
}
] |
[
{
"docid": "cc2ccc46520bec811f909821384ceb98",
"score": "0.7359996",
"text": "def not_nil?(obj)\n\t\t!obj.nil?\n\tend",
"title": ""
},
{
"docid": "879ffe042b5f76e5d170826bf9aa950f",
"score": "0.7209034",
"text": "def boolean?(obj)\n obj.instance_of?(FalseClass) or obj.instance_of?(TrueClass)\n end",
"title": ""
},
{
"docid": "30f73a6dcfab97bd94e2aa0420f34ab6",
"score": "0.6516862",
"text": "def ===(obj)\n !test(obj).nil?\n end",
"title": ""
},
{
"docid": "b59ebb4d5aa4e8efc5244a8ae38710bd",
"score": "0.64160836",
"text": "def not_nil?\n !nil?\n end",
"title": ""
},
{
"docid": "b59ebb4d5aa4e8efc5244a8ae38710bd",
"score": "0.64160836",
"text": "def not_nil?\n !nil?\n end",
"title": ""
},
{
"docid": "fd7fbf34b27d1a7fd3dd4032fec5c4eb",
"score": "0.62627304",
"text": "def is_not_null?\n @flags & NOT_NULL_FLAG != 0\n end",
"title": ""
},
{
"docid": "fd7fbf34b27d1a7fd3dd4032fec5c4eb",
"score": "0.62627304",
"text": "def is_not_null?\n @flags & NOT_NULL_FLAG != 0\n end",
"title": ""
},
{
"docid": "24d535f906d9c7e6cb9244be22d95167",
"score": "0.62557924",
"text": "def equals?(obj)\n if obj.nil?\n false\n elsif !obj.instance_of?(self.class)\n false\n elsif equal?(obj)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "4afa11c1068ccb8d60ad330d1338e686",
"score": "0.6236203",
"text": "def non_empty?(obj)\n !(obj.nil? || obj.empty?)\n end",
"title": ""
},
{
"docid": "72bf29c9f24f4c50963495f8779337b0",
"score": "0.62068695",
"text": "def false?\n value.nil? || value == false\n end",
"title": ""
},
{
"docid": "22a771956c5e61ecc193e71718bc8e93",
"score": "0.61527765",
"text": "def true?\n !false?\n end",
"title": ""
},
{
"docid": "59ddcc6d91dc7e68bbd248b9e64f3dfe",
"score": "0.61050767",
"text": "def ==(obj_)\n (self <=> obj_) == 0\n end",
"title": ""
},
{
"docid": "e5d7e1438bfcc74cccc83e74074f1c90",
"score": "0.60962826",
"text": "def !=(obj)\n return false if obj.equal?(self)\n __getobj__ != obj\n end",
"title": ""
},
{
"docid": "22785d625e62d9e37f89beff61c9f658",
"score": "0.6094242",
"text": "def true?(obj)\n if obj.nil?\n raise \"Object is nil. Not a valid boolean value\"\n end\n obj.to_s.downcase == \"true\"\nend",
"title": ""
},
{
"docid": "a3f48ecdb8f3e8e9da061ad648308fcf",
"score": "0.60835",
"text": "def object_blank?(obj)\n obj.respond_to?(:empty?) ? !!obj.empty? : !obj\n end",
"title": ""
},
{
"docid": "ab33e334c0cd6fd641737b17fd8c5e33",
"score": "0.60831046",
"text": "def conditionally_false\n\t\t!self\n\tend",
"title": ""
},
{
"docid": "75c8bf94d722b5a2fd9a9bc3caf1e962",
"score": "0.5997088",
"text": "def true?\n self.eql?(true)\n end",
"title": ""
},
{
"docid": "8275e98e6ff6076c11cd09d7d718664d",
"score": "0.5954828",
"text": "def true?\n\t\t!empty? && any?{|v| v.true? }\n\tend",
"title": ""
},
{
"docid": "f63d0ba1e6929e054f6f606d09ca9ffd",
"score": "0.5954014",
"text": "def not_nil?\n msg = \"#{self} was nil/null\"\n check_if !self.nil?, msg\n end",
"title": ""
},
{
"docid": "84e548c521b897eebcbddc6d04ca7d2d",
"score": "0.59497213",
"text": "def falsy_or_equal? first, second\n (!first && !second) || first == second\n end",
"title": ""
},
{
"docid": "e333de0eafbba616e7e143b7931c54d3",
"score": "0.59345484",
"text": "def to_bool\n\t\tif [FalseClass, NilClass].include? self.class\n\t\t\tself\n\t\telse\n\t\t\ttrue\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2779e82935536148ac019ea8d69dd385",
"score": "0.5902762",
"text": "def not_null?\n IsNotNull.new(self)\n end",
"title": ""
},
{
"docid": "921b5451d9a481ff6ced7201c8d9552f",
"score": "0.5892795",
"text": "def nil_operand?\n left.nil? || right.nil?\n end",
"title": ""
},
{
"docid": "4a9ac1d8d90e6f3ad20cd2ada7fbb9ca",
"score": "0.5808036",
"text": "def null?\n IsNull.new(self)\n end",
"title": ""
},
{
"docid": "6938b46a8f02b58611620b4e795feb30",
"score": "0.58046335",
"text": "def nullary?\n ancestors.include?(Operator::Nullary)\n end",
"title": ""
},
{
"docid": "4af5bf4f560613ef8112440e0ed81bb4",
"score": "0.5797971",
"text": "def true?(obj)\n booleans = { \"true\"=>true, \"1\"=>true, true=>true, 1=>true,\n \"false\"=>false, \"0\"=>false, false=>false, 0=>false}\n booleans.has_key?(obj) ? booleans[obj] : true\nend",
"title": ""
},
{
"docid": "ae09c8bc7cddcef8e024ea6d512f4be2",
"score": "0.5794266",
"text": "def >(other)\n if other.nil?\n return true\n end\n\n [:pm, :notifications, :invitations].each do |prop|\n if send(prop) > other.send(prop) then\n return true\n end\n end\n\n return false\n end",
"title": ""
},
{
"docid": "441c920a99c6b2e14ea8102c059bea2b",
"score": "0.57905006",
"text": "def boolean?\n !to_bool.nil?\n end",
"title": ""
},
{
"docid": "f8f01d9d09e52bd812137cb107f2fdfe",
"score": "0.57864183",
"text": "def none_with_object?(conditions, object)\n conditions.none? { |condition| condition.(object) }\n end",
"title": ""
},
{
"docid": "00646a8738db5676cccb1845fb3742b9",
"score": "0.57696486",
"text": "def has?(obj)\r\n detect { |x| case x when obj then x end }\r\n end",
"title": ""
},
{
"docid": "cf876f23eb33a295d407f5737d0f9c77",
"score": "0.57641476",
"text": "def truthy?\n if respond_to? :blank?\n not blank?\n else\n not nil?\n end\n end",
"title": ""
},
{
"docid": "cf876f23eb33a295d407f5737d0f9c77",
"score": "0.57641476",
"text": "def truthy?\n if respond_to? :blank?\n not blank?\n else\n not nil?\n end\n end",
"title": ""
},
{
"docid": "5b285b9f826a74a131f20f8f00e4da05",
"score": "0.5762723",
"text": "def boolean_value(object)\n\treturn object if object.is_a?(PRBool)\n\treturn PRBool.new(false) if object.is_a?(PRNil)\n\tif object.is_a?(PRNumber) then\n\t\treturn PRBool.new(object._value != 0)\n\tend\n\treturn PRBool.new(true)\nend",
"title": ""
},
{
"docid": "927a59bcba7b91677144e8cd59a20b6e",
"score": "0.5758705",
"text": "def ==(obj)\n return false unless obj.is_a?(self.class)\n fields.each do |tag, _|\n if value_for_tag?(tag)\n return false unless (obj.value_for_tag?(tag) && value_for_tag(tag) == obj.value_for_tag(tag))\n else\n return false if obj.value_for_tag?(tag)\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "02e4731aa812c12538e3040fa5f4d7b5",
"score": "0.5730303",
"text": "def test_NilClass_InstanceMethods_Or\n\t\tassert_equal(false, nil | false)\n\t\tassert_equal(true, nil | 99)\n\tend",
"title": ""
},
{
"docid": "2478616c17b9e755419a48c678b9d435",
"score": "0.57253283",
"text": "def are_nil?(*args)\r\n result = false\r\n args.each do |arg|\r\n result = result || arg == nil\r\n end\r\n result\r\n end",
"title": ""
},
{
"docid": "0bedb779a9e4b4ec6ea3b2d2fd4e8263",
"score": "0.5720687",
"text": "def constant_false_predicate?\n ! (predicate.respond_to?(:call) || constant_true_predicate?)\n end",
"title": ""
},
{
"docid": "0f8b841b475681c8721fbdd67643f82d",
"score": "0.5715974",
"text": "def conditionally_true\n\t\t!!self\n\tend",
"title": ""
},
{
"docid": "cd796e9e56aecb0f64b158849fcc4338",
"score": "0.5708127",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "5792657dce8e3f973234f3a169a77814",
"score": "0.57069045",
"text": "def boolean?\n !@arg[:boolValue].nil?\n end",
"title": ""
},
{
"docid": "bb44a8f2750db7b6c6331b0559934d15",
"score": "0.56850576",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "bb44a8f2750db7b6c6331b0559934d15",
"score": "0.56850576",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "cd4ac87a48b95bf45d952542cbe1fe43",
"score": "0.5684843",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "44271ea0822d0c4b05f35e765e2d75b5",
"score": "0.56840724",
"text": "def to_bool\n !!self\n end",
"title": ""
},
{
"docid": "1eab351ebf82f2fc8b38925471d64b3c",
"score": "0.56803244",
"text": "def obj_exists_and_is_not_type?(obj:, type:)\n obj.nil? ? false : obj != type\n end",
"title": ""
},
{
"docid": "2ad660a549d5630f5da2d4dd8b6ca63a",
"score": "0.5676246",
"text": "def true(_argvs)\n return nil\n end",
"title": ""
},
{
"docid": "69a5a04ede8f19f490c672fcd2f629da",
"score": "0.56525797",
"text": "def may?(*args)\n true\n end",
"title": ""
},
{
"docid": "d944a96d9046c54fed742d1334fd4a1e",
"score": "0.5635885",
"text": "def nil?\n __getobj__.nil?\n end",
"title": ""
},
{
"docid": "be767568bad62ef1e509c38e5bd5628c",
"score": "0.5616057",
"text": "def ok? \n @funct == nil ? (return false) : (return true)\n end",
"title": ""
},
{
"docid": "be4824af06ae27d1e80d97a5ea6bada7",
"score": "0.5614567",
"text": "def boolean?\n is_a?(::TrueClass) || is_a?(::FalseClass)\n end",
"title": ""
},
{
"docid": "11f62bf0073433e455a1956a492f6a01",
"score": "0.56091696",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "11f62bf0073433e455a1956a492f6a01",
"score": "0.56091696",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "b4b5ee503fe00db3fba1a6c2e348ae98",
"score": "0.5606927",
"text": "def nil?\n self == LAZY_VALUE\n end",
"title": ""
},
{
"docid": "204df0991468ee4e2e94590330ef5b0a",
"score": "0.5603393",
"text": "def assert_not_true(obj, opts)\n opts[:backtrace] ||= caller\n IsTrueFailure.assert!(obj, opts)\n end",
"title": ""
},
{
"docid": "33543f0bd5ad6d9854a5432f1f5dd577",
"score": "0.56013",
"text": "def value?\n return !self.flag?\n end",
"title": ""
},
{
"docid": "51ab0c3ffe37a8863a2be0d5b5abd544",
"score": "0.56008816",
"text": "def nil_or_empty?(obj)\n obj.nil? || (obj.respond_to?(:empty?) && obj.empty?)\n end",
"title": ""
},
{
"docid": "72a78eaec2b68972e2b09d2f7904eed8",
"score": "0.5600632",
"text": "def nil?() end",
"title": ""
},
{
"docid": "72a78eaec2b68972e2b09d2f7904eed8",
"score": "0.5600632",
"text": "def nil?() end",
"title": ""
},
{
"docid": "b96c29b4b8dd9dbf115ee9b016383e3d",
"score": "0.55925226",
"text": "def true_or_false?(value)\n case value\n when NilClass then false\n when TrueClass, FalseClass then value\n when String then\n if value =~ /^(false|true)$/i then\n !(value =~ /^true$/i).nil?\n else\n value.to_i != 0\n end\n else\n value.to_i != 0\n end\n end",
"title": ""
},
{
"docid": "3d077a10b43303baea0b9eb2455d1522",
"score": "0.5570859",
"text": "def assert_not_true(obj, opts)\n msg = opts[:message] || \"Expected #{exp} NOT to be true\"\n call = opts[:backtrace] || caller\n fail Assertion.new(msg, call) if TrueClass === act\n end",
"title": ""
},
{
"docid": "b9e5f732431e08e0b446dddaa131e16e",
"score": "0.5568849",
"text": "def convert_nil_to_false\n self.is_admin = false unless self.is_admin == true\n return true\n end",
"title": ""
},
{
"docid": "f158038077bca0224c04bda2352b2543",
"score": "0.556699",
"text": "def nil?\n false\n end",
"title": ""
},
{
"docid": "f158038077bca0224c04bda2352b2543",
"score": "0.556699",
"text": "def nil?\n false\n end",
"title": ""
},
{
"docid": "1e702ff3a212001ad8fd1494fedf280a",
"score": "0.5563636",
"text": "def vacio? ()\n\t if((@tail==nil)&&(@head==nil))\n\t\t return true\n\t else\n\t\t return false\n\t end\n end",
"title": ""
},
{
"docid": "906b16714d88541938b62d5696057121",
"score": "0.5546347",
"text": "def nil?() true; end",
"title": ""
},
{
"docid": "7826c331524f9c4aa5dde7069b975f1e",
"score": "0.5537111",
"text": "def matches? actual\n super\n\n true === actual || false === actual\n end",
"title": ""
},
{
"docid": "e285d8994f6be45777503b26cf0a1965",
"score": "0.5535071",
"text": "def boolean\n any(true, false)\n end",
"title": ""
},
{
"docid": "2a925e4a17097933cdcdc3205b3fe392",
"score": "0.5526031",
"text": "def blank_object?(obj)\n return obj.blank? if obj.respond_to?(:blank?)\n case obj\n when NilClass, FalseClass\n true\n when Numeric, TrueClass\n false\n when String\n obj.strip.empty?\n else\n obj.respond_to?(:empty?) ? obj.empty? : false\n end\n end",
"title": ""
},
{
"docid": "37e6101fb2dcbb098428f86da4eba062",
"score": "0.5518629",
"text": "def blank?(obj)\n obj.respond_to?(:empty?) ? obj.empty? : !obj\n end",
"title": ""
},
{
"docid": "72822b0a7264102814c668dc3b1d0bd7",
"score": "0.5513798",
"text": "def boolean?\n proc do |o|\n o.is_a? String and o.is_b?\n end\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.5513795",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.5513795",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.5513795",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "c2a8bf2472918239887370226c3f818c",
"score": "0.5513795",
"text": "def maybe?\n self.checkState == MAYBE\n end",
"title": ""
},
{
"docid": "f26e6489a21fd16352084f0dfc82e222",
"score": "0.55111325",
"text": "def nearly?(other); end",
"title": ""
},
{
"docid": "dd753fcda47ca2963b720eca3a56bd69",
"score": "0.550606",
"text": "def nil?\r\n false\r\n end",
"title": ""
},
{
"docid": "ab13f97197e60c6ef71802c6205e9bd8",
"score": "0.5503152",
"text": "def false?(val)\n FALSE_VALUES.include? val\n end",
"title": ""
},
{
"docid": "371f370d92f4984bbb6f679c026c80cb",
"score": "0.5494509",
"text": "def true?(obj)\n obj.to_s.downcase == \"true\"\n end",
"title": ""
},
{
"docid": "3be21691165e6c71af055785f2452cc4",
"score": "0.5489907",
"text": "def falsey()\n lambda { |obj| !obj }\nend",
"title": ""
},
{
"docid": "42acc36a729dc57f73e080fe8c39a418",
"score": "0.5482665",
"text": "def =~(obj)\n return false unless self.left.is_a? Number\n if obj.is_a? Prod\n return false unless obj.left.is_a? Number\n return self.right == obj.right\n end \n return self.right == obj \n end",
"title": ""
},
{
"docid": "0da65f74ca24b1f90f447104e9580a56",
"score": "0.5480765",
"text": "def true?(obj)\n [\"true\",\"1\"].include? obj.to_s.downcase\n end",
"title": ""
},
{
"docid": "b4eb7891d5fa300d06e3bef2fb5e8bc4",
"score": "0.54726523",
"text": "def true?\n self == true\n end",
"title": ""
},
{
"docid": "2b511c62888d89cc233335aec5530247",
"score": "0.54719275",
"text": "def user_must_pay?\n !journal&.will_pay? && !institution_will_pay? && !funder_will_pay?\n end",
"title": ""
},
{
"docid": "fb4d78774f052dbe1b534782f99d5db0",
"score": "0.5463084",
"text": "def true_xor_false?\n#\t\tself.include?('true') ^ self.include?('false') ^\n#\t\t\tself.include?(true) ^ self.include?(false)\n\t\tcontains_true = contains_false = false\n\t\teach {|v|\n#\t\t\t( v.to_boolean ) ? contains_true = true : contains_false = true\n\t\t\teval(\"contains_#{v.to_boolean}=true\")\n\t\t}\n\t\tcontains_true ^ contains_false\n\tend",
"title": ""
},
{
"docid": "194612003422b044fbe92c8beec7b863",
"score": "0.54553777",
"text": "def nonpositive?\n return self <= 0\n end",
"title": ""
},
{
"docid": "72ce84d302b052a9408f1e1041755bde",
"score": "0.545298",
"text": "def exists? obj\n not [obj].nil?\n end",
"title": ""
},
{
"docid": "362bd97f788c10906a48a6083e20082c",
"score": "0.54437864",
"text": "def null_object? signature=nil\n null_object_signature == signature\n end",
"title": ""
},
{
"docid": "97df6326c136286370f8af952d77dec3",
"score": "0.54388624",
"text": "def ==(obj)\n self.class == obj.class and self.val == obj.val\n end",
"title": ""
},
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.5431008",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "e2a932f3c6bbb3528291c3502021dfcc",
"score": "0.54283226",
"text": "def to_booly\n unless self.to_booly?\n raise TypeError.new(\"#{self} cannot be converted to TrueClass or FalseClass\")\n end\n\n return true if self == \"true\" || (self.to_f? && self.to_f > 0)\n false\n end",
"title": ""
},
{
"docid": "9c109e511c8b0fe40ae0d942f86e941f",
"score": "0.5426175",
"text": "def nil?\n return true\n end",
"title": ""
},
{
"docid": "5c02088185ddeb98106b9ece9b8469ad",
"score": "0.54250985",
"text": "def xor?(this, that)\n (!this && that) || (this && !that)\nend",
"title": ""
},
{
"docid": "bd61003eb77336fb8f0ad363f82944ee",
"score": "0.5424096",
"text": "def null?\n self == NULL\n end",
"title": ""
},
{
"docid": "5a5312f73fbe94affb14b1a5e85a15cc",
"score": "0.54199827",
"text": "def nil?; false; end",
"title": ""
},
{
"docid": "8fa6e1556793b830baac2e257056823a",
"score": "0.5419877",
"text": "def no? ; false ; end",
"title": ""
},
{
"docid": "2cd6375a4ecce9e24751f07d9d88a64b",
"score": "0.5418108",
"text": "def contains_bits?(obj)\n obj.respond_to?(:contains_bits?) && obj.contains_bits?\n end",
"title": ""
},
{
"docid": "0f883a2d9e175724a89b52c85c5f74e3",
"score": "0.54160196",
"text": "def pure? \r\n\t\tif self.positives == 0 && self.negatives != 0\r\n\t\t\treturn true\r\n\t\telsif self.negatives == 0 && self.positives != 0\r\n\t\t\treturn true\r\n\t\telse return false\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "84e0c8b7dee2fea38ee6e28c7c25d8a0",
"score": "0.5414736",
"text": "def null?\n true\n end",
"title": ""
},
{
"docid": "c6ad7b2a88dcf34bda8ac990de87441a",
"score": "0.5410895",
"text": "def eql?(obj)\n return false unless obj.is_a?(self.class)\n fields.each do |tag, _|\n if value_for_tag?(tag)\n return false unless (obj.value_for_tag?(tag) && value_for_tag(tag).eql?(obj.value_for_tag(tag)))\n else\n return false if obj.value_for_tag?(tag)\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "14e7fc83418ff4231585d639ab05072b",
"score": "0.5399839",
"text": "def i_dont_own?(object)\n if(current_user.present? and object.user.present? and object.user.id.present? and (current_user.id == object.user.id))\n false\n else\n true\n end\n end",
"title": ""
}
] |
487290b6791c646e012c7f7454be1fad
|
Performs deep hash transformation
|
[
{
"docid": "7243ac8b18b8891a77b47993dab272c1",
"score": "0.6053929",
"text": "def deep_hash(hash)\n break_keys(hash).tap do\n hash.each do |key, value|\n hash[key] = deep_hash_value(value)\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b613733a4a1074c87d5ed1fc63e2a052",
"score": "0.69552493",
"text": "def deep_transform &block\n\n\t\tDeepTransform.do_deep_transform_on_hashlike_(self, &block)\n\tend",
"title": ""
},
{
"docid": "08ab24e27eedd9603781514446173100",
"score": "0.679197",
"text": "def deep_merge!(target, hash); end",
"title": ""
},
{
"docid": "08ab24e27eedd9603781514446173100",
"score": "0.679197",
"text": "def deep_merge!(target, hash); end",
"title": ""
},
{
"docid": "968b15ca920ed10267db497ac095e8e8",
"score": "0.67598045",
"text": "def deep_transform_keys(&block); end",
"title": ""
},
{
"docid": "79caf4ec4a15448fbf1ad822a98c038c",
"score": "0.66754055",
"text": "def deep_transform_hashes_of(hash, hash_cache = {})\n new_hash = FlexHash.new(mapping)\n hash.each_pair do |key, val|\n if val.class == Hash\n # only transform a given instance once\n hash_cache[val.object_id] ||= deep_transform_hashes_of(val, hash_cache)\n val = hash_cache[val.object_id]\n end\n new_hash[key] = val\n end\n new_hash\n end",
"title": ""
},
{
"docid": "cf13f551ce64096eefa56ed7b0d78804",
"score": "0.6673171",
"text": "def deep_merge_hashes!(target, overwrite); end",
"title": ""
},
{
"docid": "95d01147445adbc7f5dda74f811ef9c4",
"score": "0.6636927",
"text": "def deep_transform_keys!(&block); end",
"title": ""
},
{
"docid": "2884273c059b30e41542331de5174555",
"score": "0.65421295",
"text": "def dehash(hash, depth); end",
"title": ""
},
{
"docid": "d44b455b6460f4d5dd6033df3dc6b9db",
"score": "0.65137273",
"text": "def deep_merge(source, hash); end",
"title": ""
},
{
"docid": "d44b455b6460f4d5dd6033df3dc6b9db",
"score": "0.65137273",
"text": "def deep_merge(source, hash); end",
"title": ""
},
{
"docid": "92178df47bedd8c391412e56a36ca0e4",
"score": "0.6487294",
"text": "def _hash(obj)\n obj.transform_values { |v| _renc(v) }\n end",
"title": ""
},
{
"docid": "aa2b491dc5a8ad96d4b565f848102d55",
"score": "0.647946",
"text": "def deep_hash\n UniMap.deep_hash( self )\n end",
"title": ""
},
{
"docid": "bdfb047e4aa039ecf7b83c07037e7915",
"score": "0.6265785",
"text": "def deep_transform_keys!(hash, &block)\n _deep_transform_keys_in_object!(hash, &block)\n end",
"title": ""
},
{
"docid": "423cbb2190dd397e5ba06d16286190f7",
"score": "0.6190656",
"text": "def deep_merge_hashes(master_hash, other_hash); end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.61757237",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.61757237",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.61757237",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.61757237",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.61757237",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.61757237",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.61757237",
"text": "def hash() end",
"title": ""
},
{
"docid": "fa79ecee8baf5f7376bf39b8100fad05",
"score": "0.6172356",
"text": "def rehash() end",
"title": ""
},
{
"docid": "5abd599f40137d12c5dd15c3a46cfcd2",
"score": "0.6146463",
"text": "def checksum!\n # Get a deep copy of hash to compare with\n @_original_hash = Marshal.load(Marshal.dump(to_hash))\n # create a copy of basic elements\n base = self.reject { |k,_| ['_id', '_rev', 'couchrest-hash'].include? k.to_s }\n\n result = nil\n\n flatten =\n lambda {|r|\n (recurse = lambda {|v|\n if v.is_a?(Hash) || v.is_a?(CouchRest::Document)\n v.to_a.map{|v| recurse.call(v)}.flatten\n elsif v.is_a?(Array)\n v.flatten.map{|v| recurse.call(v)}\n else\n v.to_s\n end\n }).call(r)\n }\n self['couchrest-hash'] = Digest::MD5.hexdigest(flatten.call(base).sort.join(''))\n end",
"title": ""
},
{
"docid": "feab7a1508544cce70fba6385d3ab968",
"score": "0.60765165",
"text": "def to_deep_hash \n new_array = []\n self.each_index do |index|\n new_array[index] = deeply_to_hash(self[index])\n end\n new_array\n end",
"title": ""
},
{
"docid": "dbafa806502a7a4613b8ab544ffb5b6e",
"score": "0.60671407",
"text": "def _deep_merge(hash, other_hash); end",
"title": ""
},
{
"docid": "3f47bf4d00665ec530f769b22f2afbbc",
"score": "0.6053427",
"text": "def to_hash\n memoize(:to_hash) do\n _process_hashed(structures.inject({}) { |acc, elem| Utils.merge(acc, elem) })\n end\n end",
"title": ""
},
{
"docid": "391bf67ea833c0afcbe086f11b607c16",
"score": "0.60278463",
"text": "def deep_transform_keys(&block)\n _deep_transform_keys_in_object(self, &block)\n end",
"title": ""
},
{
"docid": "391bf67ea833c0afcbe086f11b607c16",
"score": "0.60278463",
"text": "def deep_transform_keys(&block)\n _deep_transform_keys_in_object(self, &block)\n end",
"title": ""
},
{
"docid": "eff2871b58bd3131d0de761400a69b22",
"score": "0.60157776",
"text": "def deep_merge!(*other_hashes, &blk); end",
"title": ""
},
{
"docid": "b79c3e9c8f5f46cf32af8da4db1e9eed",
"score": "0.60041887",
"text": "def hash\n @orig.hash\n end",
"title": ""
},
{
"docid": "b79c3e9c8f5f46cf32af8da4db1e9eed",
"score": "0.60041887",
"text": "def hash\n @orig.hash\n end",
"title": ""
},
{
"docid": "b79c3e9c8f5f46cf32af8da4db1e9eed",
"score": "0.60041887",
"text": "def hash\n @orig.hash\n end",
"title": ""
},
{
"docid": "7c22507363f5b2e1a25141ebd66bbca8",
"score": "0.5997673",
"text": "def hash() source.hash ^ (target.hash+1); end",
"title": ""
},
{
"docid": "7c22507363f5b2e1a25141ebd66bbca8",
"score": "0.5997673",
"text": "def hash() source.hash ^ (target.hash+1); end",
"title": ""
},
{
"docid": "cc7b4b6b27088c24a84ad3099ebac02b",
"score": "0.5951304",
"text": "def hash() source.hash ^ target.hash; end",
"title": ""
},
{
"docid": "9e69a67c1367cfa64029a6d28cf275f8",
"score": "0.59279865",
"text": "def deep_symbolize(hsh, &block)\n hsh.inject({}) do |result, (key, value)|\n # Recursively deep-symbolize subhashes\n value = deep_symbolize(value, &block) if value.is_a? Hash\n # Recursively deep-symbolize subarrays\n value = deep_symbolize_array(value, &block) if value.is_a? Array\n\n # Pre-process the key with a block if it was given\n key = yield key if block_given?\n # Symbolize the key string if it responds to to_sym\n sym_key = key.to_sym rescue key\n\n # write it back into the result and return the updated hash\n result[sym_key] = value\n result\n end\n end",
"title": ""
},
{
"docid": "071ea2ae3ae8d98b35fc481101b2f531",
"score": "0.59275115",
"text": "def deep_merge!(other_hash, &block); end",
"title": ""
},
{
"docid": "2fe66cff14fdabeab11d6f696606a539",
"score": "0.59265137",
"text": "def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"title": ""
},
{
"docid": "c4f3d9d847dcddd0f70c64bb92be8f5d",
"score": "0.592573",
"text": "def hash\n return name.hash ^ direction.hash ^ lhs.hash ^ rhs.hash\n end",
"title": ""
},
{
"docid": "16ed364bc9c24c67553e015819564400",
"score": "0.59142214",
"text": "def symbolize_keys_deep(hash)\n return hash unless hash.is_a?(Hash)\n\n Hash[hash.map do |key, value|\n # if value is array, loop each element and recursively symbolize keys\n if value.is_a? Array\n value = value.map { |element| symbolize_keys_deep(element) }\n # if value is hash, recursively symbolize keys\n elsif value.is_a? Hash\n value = symbolize_keys_deep(value)\n end\n\n [symbolize_key(key), value]\n end]\n end",
"title": ""
},
{
"docid": "19ea138ef4829e63b82df091c9363464",
"score": "0.59075326",
"text": "def deep_copy(hash)\n Marshal.load(Marshal.dump(hash))\n end",
"title": ""
},
{
"docid": "c8c6c65408c9773a2ec1d1ffaff908a7",
"score": "0.5905108",
"text": "def deep_copy_hash hash\n require_that(hash.is_a?(Hash), \"deep_copy_hash requires a hash be specified, got #{hash.class}\")\n Marshal.load Marshal.dump(hash)\n end",
"title": ""
},
{
"docid": "7914dbb62e1d155f75634d7d63b36ab1",
"score": "0.58980536",
"text": "def deep_update(*other_hashes, &blk); end",
"title": ""
},
{
"docid": "42ffe4127c0f964a22ac581622a30413",
"score": "0.5893971",
"text": "def deep_stringify_keys(hash)\n transform_hash(hash, :deep => true) {|hash, key, value|\n hash[key.to_s] = value\n }\n end",
"title": ""
},
{
"docid": "b78a8c3fbbda0dc6b3ed59f810316f24",
"score": "0.588373",
"text": "def hash(*) end",
"title": ""
},
{
"docid": "8ffde88c2accada5ede06a1b6a0b9105",
"score": "0.58819366",
"text": "def deep_transform_keys!(&block)\n _deep_transform_keys_in_object!(self, &block)\n end",
"title": ""
},
{
"docid": "8ffde88c2accada5ede06a1b6a0b9105",
"score": "0.58819366",
"text": "def deep_transform_keys!(&block)\n _deep_transform_keys_in_object!(self, &block)\n end",
"title": ""
},
{
"docid": "8ffde88c2accada5ede06a1b6a0b9105",
"score": "0.58819366",
"text": "def deep_transform_keys!(&block)\n _deep_transform_keys_in_object!(self, &block)\n end",
"title": ""
},
{
"docid": "8ffde88c2accada5ede06a1b6a0b9105",
"score": "0.58819366",
"text": "def deep_transform_keys!(&block)\n _deep_transform_keys_in_object!(self, &block)\n end",
"title": ""
},
{
"docid": "7ae30e8ffd12802e376d3c47877890d4",
"score": "0.5865044",
"text": "def deep_merge(*other_hashes, &blk); end",
"title": ""
},
{
"docid": "35524a3bd7c58e24cd1db549abf661ef",
"score": "0.58612335",
"text": "def symbolize_keys_recursively!(object); end",
"title": ""
},
{
"docid": "89218419bda3cc05165bde14b4ceb466",
"score": "0.5856976",
"text": "def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"title": ""
},
{
"docid": "f7757d634420d15e16f254b68ae11601",
"score": "0.58544177",
"text": "def hash\n simplified.hash\n end",
"title": ""
},
{
"docid": "32d20d3d7c6f7d54494b92fc01aec42c",
"score": "0.5848227",
"text": "def hash\n source.hash ^ target.hash\n end",
"title": ""
},
{
"docid": "c9be9240c7d6c7386ca77f1dac529364",
"score": "0.58274204",
"text": "def hash_hash(h)\n require 'digest/md5'\n Digest::MD5.hexdigest(Marshal::dump(h.sort))\n end",
"title": ""
},
{
"docid": "8c99e2e1f1e0c2c1183e5c4d37b23847",
"score": "0.5802831",
"text": "def hash\n dn.hash\n end",
"title": ""
},
{
"docid": "326aeb0f98c2e71c6191a54843bf3332",
"score": "0.57987994",
"text": "def deep_update(other_hash)\n other_hash = other_hash.to_hash if other_hash.is_a?(DocumentMapper::Base)\n other_hash = other_hash.stringify_keys\n other_hash.each_pair do |k,v|\n k = convert_key(k)\n self[k] = self[k].to_mash if self[k].is_a?(Hash) unless self[k].is_a?(DocumentMapper::Base)\n if self[k].is_a?(Hash) && other_hash[k].is_a?(Hash)\n self[k] = self[k].deep_merge(other_hash[k]).dup\n else\n self.send(k + \"=\", convert_value(other_hash[k],true))\n end\n end\n end",
"title": ""
},
{
"docid": "ff6eb0c39a9a779e849befcba0d96a18",
"score": "0.57888824",
"text": "def normalized_hash\n normalize! unless @normalized\n hashify(:normalized)\n end",
"title": ""
},
{
"docid": "6036fa01ff28481d6ed36679c93d56ad",
"score": "0.5778558",
"text": "def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end",
"title": ""
},
{
"docid": "e8ac5da47f32d33481f4c8b7aad4359f",
"score": "0.5773357",
"text": "def denormalize(hash)\n each_value(hash) do |value|\n value.to_s.unpack('U*').pack('C*')\n end\n end",
"title": ""
},
{
"docid": "e8ac5da47f32d33481f4c8b7aad4359f",
"score": "0.5773357",
"text": "def denormalize(hash)\n each_value(hash) do |value|\n value.to_s.unpack('U*').pack('C*')\n end\n end",
"title": ""
},
{
"docid": "a1bb78bbb1f2403f18b192658059a84e",
"score": "0.57518274",
"text": "def recursive_hash_normalize_keys val\n if val.is_a? Hash\n deep_hash_normalize val\n else\n val\n end\n end",
"title": ""
},
{
"docid": "9ed2b99091fc9cc7dde23c40aad66950",
"score": "0.57517844",
"text": "def hash # Hack for Ruby 1.8.6\n @node.id.hash ^ self.class.hash\n end",
"title": ""
},
{
"docid": "ed81e99b1fb9dd0bdfbee8bf918e513d",
"score": "0.5723548",
"text": "def to_hash() end",
"title": ""
},
{
"docid": "a77f5d3ed6829e4dfe2d3c6e3af7b942",
"score": "0.57130355",
"text": "def hash_hash(h)\n require 'digest/md5'\n\n ordered = h.sort.map { |i| i.class==Hash ? i.sort : i }\n return ordered.to_s\n Digest::MD5.hexdigest(Marshal::dump(ordered))\n end",
"title": ""
},
{
"docid": "cad526517403b688b6ad79cbb4205511",
"score": "0.5710094",
"text": "def calculate_hash!\n entry_hash = to_hash\n entry_hash['description']=nil\n @hash = entry_hash.hash\n end",
"title": ""
},
{
"docid": "242e1b9bc82f259e331d33e229b2d6ab",
"score": "0.57078815",
"text": "def deep_stringify(hsh)\n hsh.each do |key, value|\n if value.kind_of?(Hash)\n deep_stringify(value)\n elsif value.kind_of?(Symbol)\n hsh.delete[key]\n hsh[key.to_s] = value.to_s\n end\n end\n\n hsh\n end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.5699701",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "aae045933f0751f41e1f0cf437489943",
"score": "0.567737",
"text": "def hash\n self.class.hash ^ left.hash ^ right.hash\n end",
"title": ""
},
{
"docid": "5596b671b98d45e6da95fa2d572e37ba",
"score": "0.5675719",
"text": "def deep_transform_keys!(&block)\n _deep_transform_keys_in_object!(self, &block)\n end",
"title": ""
},
{
"docid": "5c0daf751a0b2cfb5ca6aed7d23d1290",
"score": "0.5672435",
"text": "def hash(key); end",
"title": ""
},
{
"docid": "5ffd655bf48444f9af1816804362fe6b",
"score": "0.566971",
"text": "def hash\n model.hash + key.hash\n end",
"title": ""
},
{
"docid": "3c3cf32d3d8944ad78a0aae0f41e0de9",
"score": "0.56420004",
"text": "def recalculate_hash_at(node)\n return node._hash = node.value if node.value\n recalculate_hash_at(node.left) if node.left\n recalculate_hash_at(node.right) if node.right\n node._hash = self.class.hash_children(*node_subhashes(node))\n end",
"title": ""
},
{
"docid": "d5475958ae0d501e0efa4030bd9be92e",
"score": "0.5613592",
"text": "def deep_transform_keys!(&block)\n _deep_transform_keys_in_object!(self, &block)\n end",
"title": ""
},
{
"docid": "d05204e859e6dbd6853daf3a30c744a1",
"score": "0.56013644",
"text": "def deep_munge(hash)\r\nhash.each do |k, v|\r\ncase v\r\nwhen Array\r\nv.grep(Hash) { |x| deep_munge(x) }\r\nv.compact!\r\nhash[k] = nil if v.empty?\r\nwhen Hash\r\ndeep_munge(v)\r\nend\r\nend\r\nhash\r\nend",
"title": ""
},
{
"docid": "d9e2ab74b1f30db5ad7b282990544869",
"score": "0.55964005",
"text": "def hash\n @hash.hash\n end",
"title": ""
},
{
"docid": "aa2be8e4d7810b0b12442043c8e349a7",
"score": "0.55963635",
"text": "def hash\n raw = [name, type, values.join('/')].join(' ')\n Digest::MD5.hexdigest(raw)\n end",
"title": ""
},
{
"docid": "b4f21d306fe4d4791278dc0cb1a6c9d1",
"score": "0.55847955",
"text": "def to_sha(hash)\n # converts a hash to a SHA256\n return Digest::SHA256.hexdigest(JSON.dump(hash))\nend",
"title": ""
},
{
"docid": "26872e049490b44a8c53e982154e1e1c",
"score": "0.5582141",
"text": "def transproc\n Functions[:apply_to_hash, @nested, __hash_function__]\n end",
"title": ""
},
{
"docid": "26872e049490b44a8c53e982154e1e1c",
"score": "0.5582141",
"text": "def transproc\n Functions[:apply_to_hash, @nested, __hash_function__]\n end",
"title": ""
},
{
"docid": "735665e6536052d1db3d89cd608841a8",
"score": "0.55805695",
"text": "def hash\n @real.hash ^ @image.hash\n end",
"title": ""
},
{
"docid": "e588d675794982c1e07d91cda2858653",
"score": "0.5574459",
"text": "def correct_node_hash(node_id)\n SpStore::Crypto.hash_for_tree_node node_id, node_hash(left_child(node_id)),\n node_hash(right_child(node_id))\n end",
"title": ""
},
{
"docid": "437ab5e920e9384f53de90ade0c876a8",
"score": "0.5573129",
"text": "def deep_stringify_keys!(hash)\n deep_transform_keys!(hash){ |key| key.to_s }\n end",
"title": ""
},
{
"docid": "c1bb6819e9e33de9ad31c599e5a29515",
"score": "0.55725527",
"text": "def deep_transform_keys(hash, &block)\n result = {}\n hash.each do |key, value|\n result[yield(key)] = value.is_a?(Hash) ? deep_transform_keys(value, &block) : value\n end if hash\n result\n end",
"title": ""
},
{
"docid": "3dec1bd09706b701e12edfcbfc86e428",
"score": "0.5571665",
"text": "def shallow_update(other_hash); end",
"title": ""
},
{
"docid": "476498054419295f5959e7444e1cc86e",
"score": "0.55424666",
"text": "def to_hash(expand=false)\n hash = {}\n each_pair(expand) do |key, value|\n hash[key] = case value\n when Tree then value.to_hash\n when Array then value\n else to_entry(value)\n end\n end\n hash\n end",
"title": ""
},
{
"docid": "0d90325dff70fd84bfc6bb3fc721bdfb",
"score": "0.55423754",
"text": "def hash\n return super unless has_size?\n\n res = 0\n each do |el|\n res += el.hash\n end\n return res\n end",
"title": ""
},
{
"docid": "d98b392206db1c44af0af09211312282",
"score": "0.5537538",
"text": "def deep_stringify_keys(hash)\n hash.each_with_object({}) do |(key, value), new_hash|\n new_hash[key.to_s] = (value.respond_to?(:to_hash) ? deep_stringify_keys(value) : value)\n end\n end",
"title": ""
},
{
"docid": "af32cacd1bc91e56f54c6c23b4cd1c94",
"score": "0.5533763",
"text": "def hash\n value.hash\n end",
"title": ""
},
{
"docid": "3ab0a79437e9ef45f5fa834c9543e22c",
"score": "0.553046",
"text": "def shallow_merge(other_hash); end",
"title": ""
},
{
"docid": "3ba06f870e8b1959e04f114a554758f1",
"score": "0.5526626",
"text": "def normalize(hash)\n hash.symbolize_keys if hash\n end",
"title": ""
},
{
"docid": "ed9afebfc7d258e7d1ed9ea34e250545",
"score": "0.5523973",
"text": "def build_deep_hash( value, hash, levels )\n\t\tif levels.length == 0\n\t\t\tvalue.untaint\n\t\telsif hash.nil?\n\t\t\t{ levels.first => build_deep_hash(value, nil, levels[1..-1]) }\n\t\telse\n\t\t\thash.update({ levels.first => build_deep_hash(value, hash[levels.first], levels[1..-1]) })\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0d67dfcf870df3c53b140f4ad5094139",
"score": "0.5504853",
"text": "def all_structural_subhashes\n hashes = []\n self.deep_each do |node|\n hashes << node.structural_hash\n end\n hashes\n end",
"title": ""
},
{
"docid": "9750d26113ef96f1753de19b2a0d51b0",
"score": "0.5498546",
"text": "def deep_transform! &block\n\n\t\tdo_deep_transform_on_self_(&block)\n\tend",
"title": ""
},
{
"docid": "703632ca38a114b55a14b4e8822d4ef8",
"score": "0.5498287",
"text": "def hash(hash, &block)\n hash.inject({}) do |result, (key, value)|\n # Recursively deep-symbolize subhashes\n value = _recurse_(value, &block)\n\n # Pre-process the key with a block if it was given\n key = yield key if block_given?\n # Symbolize the key string if it responds to to_sym\n sym_key = key.to_sym rescue key\n\n # write it back into the result and return the updated hash\n result[sym_key] = value\n result\n end\n end",
"title": ""
},
{
"docid": "10a4d17f15330a40289330ed5f8e8c2d",
"score": "0.5495858",
"text": "def deep_stringify_keys(hash)\n hash.inject({}) { |result, (key, value)|\n value = deep_stringify_keys(value) if value.is_a?(Hash)\n result[key.to_s] = value\n result\n }\n end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.54911464",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.54911464",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.54911464",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.54911464",
"text": "def hash; end",
"title": ""
}
] |
4e785e612f72ccd66f18c86d246544a3
|
loads a book for a playdate.
|
[
{
"docid": "a513335c1a648a13af288342754324a1",
"score": "0.61197245",
"text": "def getBook(id)\n @book = Book.find(id)\n if @book.blank?\n return false\n end\n @playdate.book_id = id\n @playdate.save\n end",
"title": ""
}
] |
[
{
"docid": "36af8e7f046e993c991ba8096da1a97c",
"score": "0.6364691",
"text": "def load_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "772f01bff230b04c26f89cdcfbfca073",
"score": "0.57067055",
"text": "def book\n fetch('harry_potter.books')\n end",
"title": ""
},
{
"docid": "14db97ca2136382dbde0938718a602f9",
"score": "0.56459516",
"text": "def retrieve_book\n @book = Book.find(params[:book_id])\n end",
"title": ""
},
{
"docid": "ef09eff2caf81c715d34d25b77438e96",
"score": "0.54928964",
"text": "def fetch_title_marvel(publisher, title, url, date = nil) \n log(\"retrieving title information for [#{title}]\", :debug)\n doc = Hpricot(open(url))\n \n display_description = (doc/\"font[@class=plain_text]\").innerHTML\n\n title = RubyPants.new(title, -1).to_html\n display_name, display_number = title.split('#')\n display_name = check_title(display_name)\n display_number = display_number.split(' ')[0] unless display_number.nil?\n \n new_record = false\n \n if display_number.nil?\n # SoloBook\n model = SoloBook.find_by_name(display_name)\n \n if model.nil?\n model = SoloBook.new(:name => display_name, \n :publisher => publisher)\n new_record = true\n end\n \n else\n # Episode\n series = Series.find_by_name(display_name)\n \n if series.nil?\n # Series doesn't exist, create new Series\n series = Series.create!(:name => display_name, \n :publisher => publisher)\n log(\"created new series [#{display_name}]\", :info)\n model = series.episodes.build({ :number => display_number })\n new_record = true\n else\n # Add episode to existing series\n if series.find_episode(display_number).nil?\n model = series.episodes.build({ :number => display_number })\n new_record = true\n else\n model = series.find_episode(display_number)\n end\n end\n end\n \n display_talent, display_description = display_description.split(\"<strong>THE STORY:</strong>\")\n display_description ||= \"\" # if description was empty make sure it's non-nil\n display_description = display_description.split(\"<strong>PRICE:</strong>\")[0]\n \n model.talent = html2text(display_talent).strip.titleize\n model.description = html2text(display_description).strip\n model.published_on = date\n \n model.save!\n new_record ? log(\"created new book [#{title}]\", :info) : log(\"updated existing book [#{title}]\", :debug)\n \n if model.cover_image.nil?\n # get cover image (if we don't have one already)\n image_element = (doc/\"img\").select { |elem| elem.attributes['src'].match(/thumb/) }\n image_url = nil\n \n unless image_element.empty?\n image_url = image_element[0].attributes['src']\n image_url = \"#{URL_Marvel}#{image_element[0].attributes['src'].gsub('_thumb', '_full')}\" # full size art\n end\n \n get_cover_image(model, image_url)\n end\n \n rescue ActiveRecord::RecordInvalid => e\n log(\"failed to create book [#{title}]\", :info)\n log(\"errors: #{model.errors.full_messages.join(', ')}\", :info)\n return false\n end",
"title": ""
},
{
"docid": "ce88d38498ae2371121d7e36515536f2",
"score": "0.5455909",
"text": "def set_playbook\n @playbook = Playbook.find(params[:id])\n end",
"title": ""
},
{
"docid": "ac3aaddb258c3ff3e838187dc3c453b4",
"score": "0.5436555",
"text": "def load_episode\n\t\t\t@episode = Episode.find(params[:episode_id])\n\t\tend",
"title": ""
},
{
"docid": "752a058a794c5e445c92ec64b208b57d",
"score": "0.53819776",
"text": "def load_chapter\n end",
"title": ""
},
{
"docid": "2f3e556d22a113a81dfa090efff86281",
"score": "0.53445125",
"text": "def set_songbook\n @songbook = Songbook.includes(:songs).find(params[:id])\n end",
"title": ""
},
{
"docid": "6231b0339561d2a02850eff8af603b84",
"score": "0.53236663",
"text": "def load_season(year)\n puts \"Loading the #{year}-#{year.to_i+1} season...\"\n season = NbaAdvancedStats::Season.find_or_create_with_api(year)\n puts \"Data Ready.\"\n self.add_line_break\n self.main_menu(season)\n end",
"title": ""
},
{
"docid": "8f091a6db9d69fdff2f8523d0f526804",
"score": "0.52984685",
"text": "def requesting_playdate\n @playdate ||= Playdate.findActivePlaydate(current_user) \n end",
"title": ""
},
{
"docid": "0348b4120676facf2adc2925848c3a4a",
"score": "0.5287129",
"text": "def set_issue_book_date\n @issue_book_date = IssueBookDate.find(params[:id])\n end",
"title": ""
},
{
"docid": "6aebb61ccc92426744af1ad0c5f115d3",
"score": "0.5246172",
"text": "def load_long_play\n @long_play = LongPlay.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c2b5a082c41c060b6b44f2c3ff00b90",
"score": "0.5245769",
"text": "def set_book\n @book = Book.includes(:courses, :user).find(params[:id])\n end",
"title": ""
},
{
"docid": "c80f0d9d0c11d69aa82c8fe376b72f11",
"score": "0.52091175",
"text": "def find_book\n\t@book = Book.find(params[:id])\nend",
"title": ""
},
{
"docid": "71069b5bbc9f554e5155fc216f2f7006",
"score": "0.5207171",
"text": "def fetch_title_dc(publisher, title, url, date = nil)\n log(\"retrieving title information for [#{title}]\", :debug)\n doc = Hpricot(open(url))\n \n # span.display_talent = \"Written by, Art by... \"\n # span.display_copy = \"A final confrontation pits...\"\n # span.display_data = \"DC Universe | 32pg. | Color | $2.99 US\"\n # span.display_copy = \"On sale June 6, 2007\"\n \n display_talent = ((doc/\"#content-col2\")/\"p:first strong\").innerHTML\n display_copy = (doc/\"#content-col2\").innerHTML\n display_date = ((doc/\"#content-col2\")/\"p:last\").innerHTML\n \n title = RubyPants.new(title, -1).to_html\n display_name, display_number = title.split('#')\n display_name = check_title(display_name)\n display_number = display_number.split(' ')[0] unless display_number.nil?\n \n new_record = false\n \n if display_number.nil?\n # SoloBook\n model = SoloBook.find_by_name(display_name) \n\n if model.nil?\n model = SoloBook.new(:name => display_name, \n :publisher => publisher)\n new_record = true\n end\n \n else\n # Episode\n series = Series.find_by_name(display_name)\n \n if series.nil?\n # Series doesn't exist, create new Series\n series = Series.create!(:name => display_name, \n :publisher => publisher)\n log(\"created new series [#{display_name}]\", :info)\n model = series.episodes.build({ :number => display_number })\n new_record = true\n else\n # Add episode to existing series\n if series.find_episode(display_number).nil?\n model = series.episodes.build({ :number => display_number })\n new_record = true\n else\n model = series.find_episode(display_number)\n end\n end\n end\n \n model.talent = html2text(display_talent)\n model.description = html2text(display_copy)\n model.published_on = Date.parse(display_date.downcase.sub('on sale', '').gsub(/\\s+/, ' ').strip)\n \n model.save!\n new_record ? log(\"created new book [#{title}]\", :info) : log(\"updated existing book [#{title}]\", :debug)\n \n if model.cover_image.nil?\n # get cover image (if we don't have one already)\n image_element = (doc/\"img\").select { |elem| elem.attributes['src'].match(/media\\/product\\/.*180x270.jpg/) }\n image_url = nil\n\n unless image_element.empty?\n image_url = image_element[0].attributes['src']\n image_url = \"#{URL_DC_Media}#{image_url.gsub(/180x270/,'400x600')}\" # full size art\n end\n\n get_cover_image(model, image_url)\n end\n \n rescue ActiveRecord::RecordInvalid => e\n log(\"failed to create or update book [#{title}]\", :info)\n log(\"errors: #{model.errors.full_messages.join(', ')}\", :info)\n return false\n end",
"title": ""
},
{
"docid": "41dbdd0d58e121d8e5f10fde62db969a",
"score": "0.5199119",
"text": "def book\n @book = Book.published.find(params[:id])\n render json: @book\n end",
"title": ""
},
{
"docid": "64de668d6ea1adbf410ce5ac8b795f3e",
"score": "0.5196866",
"text": "def get_book\n @book = Book.where(id: params[:book_id]).first\n end",
"title": ""
},
{
"docid": "851cc3f01012661fc5454c9b7fddc92e",
"score": "0.51260895",
"text": "def loadBooks()\n @@bookid_count+=1\n book1 = Book.new(@@bookid_count, \"Harry Potter\", \"JK Rowling\", \"Bloomsbury\", 2010, 5, 5, 5)\n @@bookid_count+=1\n book2 = Book.new(@@bookid_count, \"The Alchemist\", \"Paulho Coelho\", \"HarperTorch\", 1998, 2, 2, 2)\n @@bookid_count+=1\n book3 = Book.new(@@bookid_count, \"Operating Systems\", \"V.Kumar\", \"Techmax\", 2018, 8, 5, 5)\n @@bookid_count+=1\n book4 = Book.new(@@bookid_count, \"Data Mining\", \"Robert Shaw\", \"O Reilly\", 2016, 8, 5, 5)\n @@bookid_count+=1\n book5 = Book.new(@@bookid_count, \"Machine Learning\", \"Tom Mitchell\", \"O Reilly\", 2016, 3, 2, 2)\n\n @books += [book1, book2, book3, book4, book5]\n end",
"title": ""
},
{
"docid": "b60a3c4dd363f5e8ce725f73fd0739c7",
"score": "0.5122343",
"text": "def record_play(date: Date.today)\n # Find the most recent play bucket and record the play\n play = plays.find_by(bucket: date)\n play = Play.new(episode: self, total: 0, bucket: date) if play.nil?\n play.increment\n\n # Increment the play count cache\n self.play_count += 1\n self.save\n end",
"title": ""
},
{
"docid": "903a75569b14c3b3d49ee0821f68f494",
"score": "0.51086146",
"text": "def load_book_data_from_yml\n\t\t@last_book_id=0\n\t\tyml_book = YAML.load_file 'library_book_data.yml'\n\t\tyml_book.each_key do |key| \n\t\t\t@books.push(Book.new(key.to_i,yml_book[key]['book_name'],yml_book[key]['author_name'],yml_book[key]['issued_to'].to_i))\n\t\t\tif @last_book_id<key.to_i then\n\t\t\t\t@last_book_id=key.to_i\n\t\t\tend\n\t\tend\n\t\t#puts \"#{yml_book.length} Book(s) loaded successfully\"\n\tend",
"title": ""
},
{
"docid": "0dbe44314d2756846c083db667afc594",
"score": "0.5091147",
"text": "def get_book\n @book_series = BookSeries.find(params[:book_series_id])\n @book_series_1 = BookSeries.first\n @collection = @book_series.collections.find(params[:collection_id])\n @book = @collection.books.find(params[:book_id])\n end",
"title": ""
},
{
"docid": "0dbe44314d2756846c083db667afc594",
"score": "0.5091147",
"text": "def get_book\n @book_series = BookSeries.find(params[:book_series_id])\n @book_series_1 = BookSeries.first\n @collection = @book_series.collections.find(params[:collection_id])\n @book = @collection.books.find(params[:book_id])\n end",
"title": ""
},
{
"docid": "046447c59671a92d1b60fc8164bd696a",
"score": "0.50593555",
"text": "def get_book( book_id )\n response = if book_id.to_s.length >= 10\n Amazon::Ecs.item_lookup( book_id, :id_type => 'ISBN', :search_index => 'Books', \n :response_group => 'Large,Reviews,Similarities,AlternateVersions' )\n else\n Amazon::Ecs.item_lookup( book_id, :response_group => 'Large,Reviews,Similarities' )\n end\n response.items.each do |item|\n binding = item.get('ItemAttributes/Binding')\n next if binding.match(/Kindle/i)\n return Book.new( item )\n end\n return nil\n end",
"title": ""
},
{
"docid": "d05a5592eb9683ac64abd3864be56bd6",
"score": "0.50576866",
"text": "def book\n sql = \"SELECT * FROM books WHERE books.id = $1\"\n values = [@book_id]\n book_data = SqlRunner.run(sql, values)\n book = Book.map_items(book_data).first\n return book\n end",
"title": ""
},
{
"docid": "50e4fd424df6199cbc748342fc946a92",
"score": "0.5038298",
"text": "def get_books\n unless self.scraped\n page = Nokogiri::HTML(open(self.url), nil, \"iso-8859-1\")\n item_elements = page.css(\".g-span7when-wide\")\n item_elements.each do |item|\n book_data = {}\n book_data[:title] = item.at_css(\".a-link-normal\").text.strip\n book_data[:author] = item.at_css(\".a-size-small\").text.split(\"by\")[-1].strip\n book_data[:price] = item.at_css(\".a-color-price\").text.strip\n book_data[:price] = \"N/A\" unless book_data[:price].include?(\"$\")\n book_data[:asin] = item.at_css(\".a-link-normal\")[\"href\"].split(\"/\")[2].strip.split(\"?\")[0]\n self.books << Book.new(book_data)\n end\n self.last_scraped = Time.now\n self.scraped = true\n end\n end",
"title": ""
},
{
"docid": "2e5c6d9c69e9218156be0fc72a049b61",
"score": "0.50284725",
"text": "def load_inventory(library, book, stock)\n inventory = Inventory.add_book_to_library(library, book, stock)\n puts \"#{library.name} has a stock of #{stock} of #{book.title}\"\nend",
"title": ""
},
{
"docid": "1cbd13faa0560c4d1019a379dc8a496d",
"score": "0.4997435",
"text": "def book_by_title(title)\n\t\t\tresponse = request('/book/title', :title => title)\n\t\t\tHashie::Mash.new(response['book'])\n\t\tend",
"title": ""
},
{
"docid": "ac1c669612a9e8f902ae65b61a57b64c",
"score": "0.498732",
"text": "def get_book(book_num)\n return @books_list[book_num]\n end",
"title": ""
},
{
"docid": "0bebc4cca536ccf77401412b435917da",
"score": "0.49810958",
"text": "def show\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bebc4cca536ccf77401412b435917da",
"score": "0.49810958",
"text": "def show\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bebc4cca536ccf77401412b435917da",
"score": "0.49810958",
"text": "def show\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bebc4cca536ccf77401412b435917da",
"score": "0.49810958",
"text": "def show\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bebc4cca536ccf77401412b435917da",
"score": "0.49810958",
"text": "def show\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bebc4cca536ccf77401412b435917da",
"score": "0.49810958",
"text": "def show\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bebc4cca536ccf77401412b435917da",
"score": "0.49810958",
"text": "def show\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "f294f2fdfdddba74111a0a6b8be168bc",
"score": "0.49751484",
"text": "def update\n @book_params = params[:book]\n @book = Book.find(params[:id])\n @date = Date.new(@book_params[\"published_date(1i)\"].to_i, @book_params[\"published_date(2i)\"].to_i, @book_params[\"published_date(3i)\"].to_i)\n\n if @book.update(title: @book_params[:title], author: @book_params[:author], genre: @book_params[:genre], price: @book_params[:price], published_date: @date)\n redirect_to root_path, notice: \"The book \\\"#{@book.title}\\\" has been UPDATED!\"\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "a86660014d2096ddc216ce18a7c87c08",
"score": "0.49725553",
"text": "def show\n @library = Library.find(Book.find(params[:id]).library_id)\n end",
"title": ""
},
{
"docid": "be59aa9528a4f0be5bb85b420e1ba9ae",
"score": "0.49639735",
"text": "def load_event\n @event = Event.find(params[:event_id])\n end",
"title": ""
},
{
"docid": "321c32a17e84feece37a323a9315cf98",
"score": "0.49534288",
"text": "def load_event\n @event = Event.find(params[:id])\n end",
"title": ""
},
{
"docid": "136cb3e0ba17f189cb38f71940f8b2fb",
"score": "0.4929934",
"text": "def show\n @book = Book.find params[:id]\n end",
"title": ""
},
{
"docid": "935d8e1d8c0e59a13267c94e114e1449",
"score": "0.49103457",
"text": "def load record\n end",
"title": ""
},
{
"docid": "38df07333d5a37bd45c9a43bc70bcc5d",
"score": "0.49103364",
"text": "def fetch_book_info\n url = \"#{BASE_URL}/#{book_id}\"\n resp = RestClient::Request.execute(url: url, method: \"GET\")\n resp_obj = JSON.parse(resp)\n\n {\n id: book_id,\n title: resp_obj[\"volumeInfo\"][\"title\"],\n author: resp_obj[\"volumeInfo\"][\"authors\"][0],\n image: resp_obj[\"volumeInfo\"][\"imageLinks\"] ? resp_obj[\"volumeInfo\"][\"imageLinks\"][\"thumbnail\"] : DEFAULT_IMAGE\n }\n end",
"title": ""
},
{
"docid": "5effb1cdc8d551ecd549fde04c006b9e",
"score": "0.4909343",
"text": "def current_playdate\n @playdate ||= Playdate.find(session[:playdate])\n end",
"title": ""
},
{
"docid": "03ebf28de8c23911edebc1dd213b18eb",
"score": "0.49079946",
"text": "def show\n @book = Book.find(params[:id])\nend",
"title": ""
},
{
"docid": "f567bf1eb238a3d314418c96cd57e20b",
"score": "0.4905024",
"text": "def order_book(params)\n Client.current.get(\"#{resource_url}/book\", params)\n end",
"title": ""
},
{
"docid": "37f129e626cf1921755bb8c82b9ee35a",
"score": "0.4898079",
"text": "def show\n\t\t@book=Book.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "00189ad5dd2930c7ac9d2c070913a795",
"score": "0.48944828",
"text": "def book(id)\n\t\t\tresponse = request('/book/show', :id => id)\n\t\t\tHashie::Mash.new(response['book'])\n\t\tend",
"title": ""
},
{
"docid": "ea431e25026221e789681a34fd6d1418",
"score": "0.4891993",
"text": "def set_book_contest\n @book_contest = BookContest.find(params[:id])\n end",
"title": ""
},
{
"docid": "ca2c4fd3f83e130a239a5495aaee36df",
"score": "0.48668206",
"text": "def show_search\n @book = BookFinder.search_google_books_by_identifier(params[:identifier]) # Instantiate book instance from Google Books search (by Google identifier)\n end",
"title": ""
},
{
"docid": "0c6b624f129faeaf4e29eb7e6749d4bf",
"score": "0.48639032",
"text": "def set_book\n if params[:id].present?\n @book = Book.find(params[:id])\n else\n @book = Book.find(params[:book_id])\n end\n end",
"title": ""
},
{
"docid": "5b28d92d466b2abb6340af4d3d583d44",
"score": "0.48493886",
"text": "def show\n @death_record_book = DeathRecordBook.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @death_record_book }\n end\n end",
"title": ""
},
{
"docid": "ea9dcc918235c8b3e4c4731876eeb0cf",
"score": "0.48471433",
"text": "def set_book\r\n @book = Book.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "95b0d6ea13b03b4b4767882008834baf",
"score": "0.4845629",
"text": "def show\n @playbooks = Upload.playbooks.find(params[:id])\n respond_with @playbook\n end",
"title": ""
},
{
"docid": "8ced5ebd2244fbb9169320e9b38dccd5",
"score": "0.48429245",
"text": "def show\n @book=Book.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "62f128c158a21877bece5cc8a6697177",
"score": "0.48421028",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "bba0d99e98bc49dc759a6c878ef24107",
"score": "0.48384306",
"text": "def book(params)\n client = jsonrpc(ENDPOINT)\n result = client.invoke(\"PlaceBookingV1\", reservation_details(params))\n\n if result.success?\n parse_book_response(params, result.value)\n else\n result\n end\n end",
"title": ""
},
{
"docid": "72c89b0a6eca6716bac2099b8d0ad650",
"score": "0.48338336",
"text": "def loadDeck(name)\n\n end",
"title": ""
},
{
"docid": "a3beed2aa8969d2778091ca37fe6a906",
"score": "0.48299497",
"text": "def create\n @book_params = params[:book]\n @date = Date.new(@book_params[\"published_date(1i)\"].to_i, @book_params[\"published_date(2i)\"].to_i, @book_params[\"published_date(3i)\"].to_i)\n @book = Book.new(title: @book_params[:title], author: @book_params[:author], genre: @book_params[:genre], price: @book_params[:price], published_date: @date)\n \n if @book.save\n redirect_to root_path, notice: \"The book \\\"#{@book.title}\\\" has been ADDED!\"\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48263246",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8088e5773c7a21af290ce35ce701bc",
"score": "0.48251295",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "aad4cb7ec9bede048fb7b266a36d5f24",
"score": "0.48207173",
"text": "def set_library_book\n @library_book = Library::Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "4501362ca1fc3fe187aed71b4c658e39",
"score": "0.4819605",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "3ff213f4461cea3e4b54e5ee36b43d76",
"score": "0.48159742",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "9def848aa2d95578e23089f50f316a40",
"score": "0.4813174",
"text": "def show\n find_book(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
},
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.47942585",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
}
] |
4c46790e18b5d60110e9cfe056960aa4
|
TODO: Add some error handling if this ever turns up empty
|
[
{
"docid": "bff83a568407bfe0082c6c1181ef5a57",
"score": "0.0",
"text": "def headers\n force_array identifier_request.at_path('OAI_PMH/ListIdentifiers/header')\n end",
"title": ""
}
] |
[
{
"docid": "ac0e88fc911bc2002d3ee51e207b7d52",
"score": "0.57968116",
"text": "def incomplete?; end",
"title": ""
},
{
"docid": "ac0e88fc911bc2002d3ee51e207b7d52",
"score": "0.57968116",
"text": "def incomplete?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "4c04911a988a328b6df02093f999afba",
"score": "0.575387",
"text": "def empty?; end",
"title": ""
},
{
"docid": "225b900c6ccd631b1bd72d049ececa80",
"score": "0.56569",
"text": "def incomplete?; @size.nil? end",
"title": ""
},
{
"docid": "e8f7f08e3dc7d3899735dc70e6a5f94a",
"score": "0.5614162",
"text": "def empty; end",
"title": ""
},
{
"docid": "5928f8efe9c6c2d408ea21a4cdce83ad",
"score": "0.558287",
"text": "def preliminary?; end",
"title": ""
},
{
"docid": "2b967bd1f9db073635f4d79afd5f40a5",
"score": "0.5556569",
"text": "def full?; end",
"title": ""
},
{
"docid": "2b967bd1f9db073635f4d79afd5f40a5",
"score": "0.5556569",
"text": "def full?; end",
"title": ""
},
{
"docid": "2b967bd1f9db073635f4d79afd5f40a5",
"score": "0.5556569",
"text": "def full?; end",
"title": ""
},
{
"docid": "2b967bd1f9db073635f4d79afd5f40a5",
"score": "0.5556569",
"text": "def full?; end",
"title": ""
},
{
"docid": "8b79e8f7bbe83880e51794d26cd62a8f",
"score": "0.5517682",
"text": "def try; end",
"title": ""
},
{
"docid": "b823896426fa9e124bc39ae21f832038",
"score": "0.550451",
"text": "def test_empty\n end",
"title": ""
},
{
"docid": "5203c8ee36b531af183737cf719d07db",
"score": "0.546589",
"text": "def breakable_empty; end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.5453338",
"text": "def apop?; end",
"title": ""
},
{
"docid": "6bc6abe312851bb1dc3ff879db905a61",
"score": "0.5446377",
"text": "def processed?; end",
"title": ""
},
{
"docid": "f0d50116d6d067bd787bf1044910efcb",
"score": "0.54276997",
"text": "def attempt; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.5415802",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.5415802",
"text": "def used; end",
"title": ""
},
{
"docid": "abc1e6e900188ecb8541263ff4688363",
"score": "0.54129857",
"text": "def processing?; end",
"title": ""
},
{
"docid": "abc1e6e900188ecb8541263ff4688363",
"score": "0.54129857",
"text": "def processing?; end",
"title": ""
},
{
"docid": "d882f3a248ba33088a4284a47c263d0d",
"score": "0.5398897",
"text": "def missing?; end",
"title": ""
},
{
"docid": "a104d50f5ce9d61b67bd42985656a052",
"score": "0.5386221",
"text": "def try\n end",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.53812027",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "52c16213f8e3cadbc2ddfcc3747d92f0",
"score": "0.5376983",
"text": "def full; end",
"title": ""
},
{
"docid": "52c16213f8e3cadbc2ddfcc3747d92f0",
"score": "0.5376983",
"text": "def full; end",
"title": ""
},
{
"docid": "52c16213f8e3cadbc2ddfcc3747d92f0",
"score": "0.5376983",
"text": "def full; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5351583",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5351583",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5351583",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5351583",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5351583",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5351583",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "2b303c7c88172b68e39b6061e9d1a315",
"score": "0.53502375",
"text": "def empty?; raise NotImplementedError end",
"title": ""
},
{
"docid": "ea048089798665c72b01898c9a4393b9",
"score": "0.5340144",
"text": "def empty_lookup; end",
"title": ""
},
{
"docid": "ea048089798665c72b01898c9a4393b9",
"score": "0.5340144",
"text": "def empty_lookup; end",
"title": ""
},
{
"docid": "f0e7c8a4f10061cc13cd41c293de5b29",
"score": "0.53335166",
"text": "def process_next_entry; end",
"title": ""
},
{
"docid": "f0e7c8a4f10061cc13cd41c293de5b29",
"score": "0.53335166",
"text": "def process_next_entry; end",
"title": ""
},
{
"docid": "dd1dd04c4c1b82b147d2a90141d99a4f",
"score": "0.5317017",
"text": "def empty()\n \n end",
"title": ""
},
{
"docid": "dd1dd04c4c1b82b147d2a90141d99a4f",
"score": "0.5317017",
"text": "def empty()\n \n end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.53156716",
"text": "def desired; end",
"title": ""
},
{
"docid": "0a50d1e031b3b08b4188c81f9cd2d53c",
"score": "0.5277771",
"text": "def complete?; end",
"title": ""
},
{
"docid": "0a50d1e031b3b08b4188c81f9cd2d53c",
"score": "0.5277771",
"text": "def complete?; end",
"title": ""
},
{
"docid": "0a50d1e031b3b08b4188c81f9cd2d53c",
"score": "0.5277771",
"text": "def complete?; end",
"title": ""
},
{
"docid": "0a50d1e031b3b08b4188c81f9cd2d53c",
"score": "0.5277771",
"text": "def complete?; end",
"title": ""
},
{
"docid": "0a50d1e031b3b08b4188c81f9cd2d53c",
"score": "0.5277771",
"text": "def complete?; end",
"title": ""
},
{
"docid": "a747cf4388fb3d14718cf9dda73c555f",
"score": "0.5276199",
"text": "def initalize; end",
"title": ""
},
{
"docid": "a747cf4388fb3d14718cf9dda73c555f",
"score": "0.5276199",
"text": "def initalize; end",
"title": ""
},
{
"docid": "7d73ca93aed82d814ee3609681895be5",
"score": "0.52626705",
"text": "def missed?; end",
"title": ""
},
{
"docid": "7d73ca93aed82d814ee3609681895be5",
"score": "0.52626705",
"text": "def missed?; end",
"title": ""
},
{
"docid": "7b3a1c0aa81c879518831c23fd95270f",
"score": "0.5259331",
"text": "def remaining; end",
"title": ""
},
{
"docid": "7b3a1c0aa81c879518831c23fd95270f",
"score": "0.5259331",
"text": "def remaining; end",
"title": ""
},
{
"docid": "7b3a1c0aa81c879518831c23fd95270f",
"score": "0.5259331",
"text": "def remaining; end",
"title": ""
},
{
"docid": "57cdeafbae2e3323c479f8429b0a7949",
"score": "0.52527344",
"text": "def is_empty()\n \n end",
"title": ""
},
{
"docid": "2d6a47b0c8094b4cf1f73591c430ec36",
"score": "0.52514523",
"text": "def call_empty\n end",
"title": ""
},
{
"docid": "2fbd1141a5d3803251f00ea5c01e38ba",
"score": "0.525035",
"text": "def extract; end",
"title": ""
},
{
"docid": "2fbd1141a5d3803251f00ea5c01e38ba",
"score": "0.525035",
"text": "def extract; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.52438575",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.52438575",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.52438575",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.52438575",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.52438575",
"text": "def next; end",
"title": ""
},
{
"docid": "6e6891d187cd127b8bc7e632ec0b2d50",
"score": "0.5234663",
"text": "def unitary?; end",
"title": ""
},
{
"docid": "bb2cf20999efd9fcacf7668301ebe565",
"score": "0.5230156",
"text": "def missing; end",
"title": ""
},
{
"docid": "bb2cf20999efd9fcacf7668301ebe565",
"score": "0.5230156",
"text": "def missing; end",
"title": ""
},
{
"docid": "6b6422c281c815fbdef6916b83f80568",
"score": "0.52216023",
"text": "def empty?\n # this method should be overriden\n end",
"title": ""
},
{
"docid": "4789e2fcf6685830fb94ee83c08e82d2",
"score": "0.518396",
"text": "def complete\n return nil\n end",
"title": ""
},
{
"docid": "299f7fdd8a6c0c62123d380469385f79",
"score": "0.5177414",
"text": "def empty?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "a41a4f14b0eb5fb8a09240651f01e8d8",
"score": "0.51663893",
"text": "def empty?; return @results.empty?; end",
"title": ""
},
{
"docid": "a41a4f14b0eb5fb8a09240651f01e8d8",
"score": "0.51663893",
"text": "def empty?; return @results.empty?; end",
"title": ""
}
] |
222fdbc7ca892d2e81dcecc2cf88dbc2
|
Before actually drawing the next step, we need to move to the appropriate location.
|
[
{
"docid": "e5cc1dc2115e9bf20d5b3279ad51d4dc",
"score": "0.0",
"text": "def get_ready_to_draw\n @app.translate(@values[:x], @values[:y])\n sign = (@values[:flip] ? -1 : 1)\n @app.rotate(sign * @values[:rotation])\n end",
"title": ""
}
] |
[
{
"docid": "e0cac8768a74a7b1010b06aee3deb783",
"score": "0.65554607",
"text": "def step\n # Draw everything\n @menu.draw @screen\n end",
"title": ""
},
{
"docid": "226a7ce208a6b819402e7adfcc69b75a",
"score": "0.6385142",
"text": "def move\n if @direction = 1\n let @x = @x - 4\n if @x < 0\n let @x = 0\n end\n call Screen.setColor(false)\n call Screen.drawRectangle((@x + @width) + 1, @y, (@x + @width) + 4, @y + @height)\n call Screen.setColor(true)\n call Screen.drawRectangle(@x, @y, @x + 3, @y + @height)\n else\n let @x = @x + 4\n if (@x + @width) > 511\n let @x = 511 - @width\n end\n call Screen.setColor(false)\n call Screen.drawRectangle(@x - 4, @y, @x - 1, @y + @height)\n call Screen.setColor(true)\n call Screen.drawRectangle((@x + @width) - 3, @y, @x + @width, @y + @height)\n end\n end",
"title": ""
},
{
"docid": "0936f6e35d7d92c68e52004756e7909c",
"score": "0.6370476",
"text": "def take_step\n if @grid[$x][$y] != \"E\"\n @grid[$x][$y] = \"X\"\n else end_reached\n end\n end",
"title": ""
},
{
"docid": "3309837472eb684554d2f367ff119365",
"score": "0.63644606",
"text": "def next_coordinates\n get_direction\n current_position\n next_step\n end",
"title": ""
},
{
"docid": "47182cd96274c0954d0eeb7d613cfe7a",
"score": "0.63176394",
"text": "def go(pt)\n validate_coords(pt)\n add_segment_to_track(self.xy, pt) if self.pen_down?\n self.xy = pt\n end",
"title": ""
},
{
"docid": "c544c6eaf31d7c850748e60b0362dced",
"score": "0.6293902",
"text": "def next_move\n @point.add(next_point)\n end",
"title": ""
},
{
"docid": "8a3bf7eac0a5edebc50e8993188e1449",
"score": "0.6287553",
"text": "def next_step!\n\t\t\tif @player.x <= 0\n\t\t\t\t@player.x = 0\n\t\t\telsif (@player.x + @player.width) >= @width\n\t\t\t\t@player.x = @width - @player.width\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "e69de83f5cc70bf9f9ee22ce4e269509",
"score": "0.62744814",
"text": "def update_position\n # move either ( 0..5 steps ) * multiplier * tracklength / 80.0\n position_increment = @@possible_steps.sample.to_f * multiplier *\n self.racetrack.length / 80.0\n proposed_position = self.position + position_increment\n # check that we have not gone past our finish line... if so we\n # need to stop there (otherwise it looks all uglies)\n if proposed_position + self.length > self.racetrack.length\n self.position = self.racetrack.length - self.length\n else\n self.position = proposed_position\n end\n end",
"title": ""
},
{
"docid": "b5f44a73317f0fbae3f9b81569ffced3",
"score": "0.62604326",
"text": "def moveCallwn\n if @y\n call Screen.setColor(@x)\n call Screen.drawRectangle(@x, @y, @x, @y)\n let @y = @y\n call Screen.setColor(@x)\n call Screen.drawRectangle(@x, @y, @x, @y)\n end\n end",
"title": ""
},
{
"docid": "2f46893bd17fb7fb855f5690f972c3d3",
"score": "0.62558746",
"text": "def do_next\n update_screen(get_step_content(@step + 1, @editor.value, @output.value))\n end",
"title": ""
},
{
"docid": "046550abf75d9cdc10ef5ffa873f82d3",
"score": "0.6251102",
"text": "def next_step!\n cnt = 0\n @cur_piece.move_down!\n unless @cur_piece.can_be_set?\n @cur_piece.move_up!\n new_piece!\n cnt = clear_rows!\n end\n cnt\n end",
"title": ""
},
{
"docid": "1965c64eff48d0429b59bf3ab3e4364b",
"score": "0.62381184",
"text": "def forward(distance) \n `console.log(\"beginning a new path\")`\n self.begin_path # beginpath() and moveTo(@x, @y)\n\n `console.log( \"forward \" + #{distance});`\n a = toRad(@dir)\n @x += distance * Math::cos(a)\n @y += distance * Math::sin(a)\n `console.log(\"going forward to \" + #{@x} + \",\" + #{@y});`\n if @pen\n `console.log( \"lineto\" )`\n `document.getElementById(\"mycanvas\").getContext(\"2d\").lineTo(#{@x}, #{@y});`\n else\n `console.log( \"moveto\" )`\n `document.getElementById(\"mycanvas\").getContext(\"2d\").moveTo(#{@x}, #{@y});`\n end\n # make sure the moveTo followed by stroke() doesn't actually draw a line\n self.draw! # fill(), then stroke()\n\n # TODO: get this to work! maybe need a javascript native sleep\n `setTimeout(function(){}, #{1000 - @speed})`\n self\n end",
"title": ""
},
{
"docid": "f72a294360ccb66912474600709f745c",
"score": "0.62318593",
"text": "def next_step\n calculate_next_generation\n move_to_next_generation\n print \"\\nNEXT GENERATION:\"\n display\n end",
"title": ""
},
{
"docid": "3dc7b8eb8c7980aea504eca3d7cbea43",
"score": "0.6202921",
"text": "def start\n self.current_step = 0\n self\n end",
"title": ""
},
{
"docid": "3dc7b8eb8c7980aea504eca3d7cbea43",
"score": "0.6202921",
"text": "def start\n self.current_step = 0\n self\n end",
"title": ""
},
{
"docid": "3dc7b8eb8c7980aea504eca3d7cbea43",
"score": "0.6202921",
"text": "def start\n self.current_step = 0\n self\n end",
"title": ""
},
{
"docid": "a4073205fe32099a8617f1415a2fd330",
"score": "0.61076725",
"text": "def forward(steps)\n validate_steps(steps)\n normal_radians = to_rad(flip_turtle_and_normal(@heading))\n new_pt = [@xy[0] + steps * cos(normal_radians),\n @xy[1] + steps * sin(normal_radians)]\n\n add_segment_to_track @xy, new_pt if self.pen_down?\n @xy = new_pt\n end",
"title": ""
},
{
"docid": "186739aa5ea4d188878fd0e8fa48a6ae",
"score": "0.61000633",
"text": "def next_step\r\n @step += 1\r\n end",
"title": ""
},
{
"docid": "761bdfe8b410fc46fd64b0c5a5b510c8",
"score": "0.60968226",
"text": "def move\r\n return if not @selected_obj\r\n @state = STATE_MOVING\r\n @obj = @selected_obj\r\n @offset = @obj.center_offset\r\n find_end_points\r\n vec = @end_pt - @start_pt\r\n vec.length = vec.length/2\r\n @pt_to_move = @start_pt + vec\r\n @start_input_point = Sketchup::InputPoint.new(@pt_to_move)\r\nend",
"title": ""
},
{
"docid": "ffdbcc44d47ea4bcbf54e0f909e00744",
"score": "0.6083844",
"text": "def move_to_next_spot\n face = @toy.face\n point_x = @point.x\n point_y = @point.y\n\n case face\n when \"north\"\n point_y += 1\n when \"south\"\n point_y -= 1\n when \"east\"\n point_x += 1\n else\n point_x -= 1\n end\n\n return unless valid_position?(point_x, point_y)\n\n @point.x = point_x\n @point.y = point_y\n end",
"title": ""
},
{
"docid": "6076a6eaeeb48d51ccfbace6547a2865",
"score": "0.60486215",
"text": "def draw\n process_result 0.5\n end",
"title": ""
},
{
"docid": "e8b8103ff2f13ad89a996da4a817781b",
"score": "0.6029493",
"text": "def move(x,y) \n @image = @animation[:walk].next if @animation && x != 0 && !holding_any?(:space, :down)\n \n self.factor_x = self.factor_x.abs if x > 0\n self.factor_x = -self.factor_x.abs if x < 0\n \n self.x += x\n self.x = previous_x if self.outside_window? || game_state.game_object_map.from_game_object(self)\n \n self.y += y\n #self.y = previous_y if block = self.game_state.game_object_map.from_game_object(self)\n if self.y > game_state.floor_y\n land\n self.y = game_state.floor_y \n end\n \n @grabbed_game_objects.each do |game_object|\n game_object.factor_x = self.factor_x\n game_object.x = (self.factor_x > 0) ? self.x+22 : self.x-30\n game_object.y = (@status == :crouch) ? self.y-10 : self.y-22\n end\n \n end",
"title": ""
},
{
"docid": "3e055a138ad8114fcb5f854c5053ecc6",
"score": "0.6029073",
"text": "def update_move\n update_last_coordinate\n super\n move_animation(diff_x, diff_y)\n end",
"title": ""
},
{
"docid": "3e055a138ad8114fcb5f854c5053ecc6",
"score": "0.6029073",
"text": "def update_move\n update_last_coordinate\n super\n move_animation(diff_x, diff_y)\n end",
"title": ""
},
{
"docid": "708132d330efc13737cb8c4df5cd3245",
"score": "0.6023234",
"text": "def move\n surroundings.view\n @x += 1\n @y += 1\n end",
"title": ""
},
{
"docid": "3050125a874dd42ab3ae0b6b38ae3352",
"score": "0.60110736",
"text": "def go_forward\n if plateau.can_go_here(@coordinates.new_step(@orientation.orientation.x_increment, @orientation.orientation.y_increment))\n @coordinates = @coordinates.new_step(@orientation.orientation.x_increment, @orientation.orientation.y_increment)\n end\n end",
"title": ""
},
{
"docid": "a45a018e6dcbb9c8d1e97c9a63d67a66",
"score": "0.5999168",
"text": "def next_step\n reference_step_position(1)\n end",
"title": ""
},
{
"docid": "d1b3620ffff3487f010b432c4eb367cd",
"score": "0.59980345",
"text": "def go(pt)\n validate_point(pt)\n @xy = pt\n @segment << @xy if pen_down?\n end",
"title": ""
},
{
"docid": "abfa928b3e653b1bb57a214ec72bbe69",
"score": "0.599078",
"text": "def show_next_frame\n new_y = src_rect.y + src_rect.height\n src_rect.y = new_y if new_y < bitmap.height\n end",
"title": ""
},
{
"docid": "4611788912467e6d22db57b8b030fd01",
"score": "0.5989747",
"text": "def draw\n @current_pos = @game.draw_piece(@current_block, @current_pos)\n end",
"title": ""
},
{
"docid": "926dfcce551e657e382189a73ebe3ffe",
"score": "0.5980919",
"text": "def step\n choice = random(1)\n\n if choice < 0.4 # a 40% chance of moving to the right\n @x += 1\n elsif choice < 0.6\n @x -= 1\n elsif choice < 0.8\n @y += 1\n else\n @y -= 1\n end\n\n x = constrain @x, 0, (@width - 1)\n y = constrain @y, 0, (@height - 2)\n\n end",
"title": ""
},
{
"docid": "072c3e5db578b9a3a9ae992c94237ed9",
"score": "0.5976791",
"text": "def move_to_position(next_position)\n @first_move = false\n super(next_position)\n end",
"title": ""
},
{
"docid": "8f1f182c070f8078b4c8dacb76cb363d",
"score": "0.59565806",
"text": "def step()\n\t\t(oldX, oldY) = [@x, @y]\n\t\t(@x, @y, @color) = bugStep(self, @bugs)\n\t\t@direction = getDirection(oldX, oldY, @x, @y)\n\tend",
"title": ""
},
{
"docid": "f96d4f0188d49b665f9e78d267f2826a",
"score": "0.5954958",
"text": "def next_generation \n canvas = self.clone\n \n end",
"title": ""
},
{
"docid": "8d48d771a3593efa503e9ed70a843336",
"score": "0.5953838",
"text": "def go_to(point)\n if pen_down?\n @target.draw Ray::Polygon.line(pos, point, @pen_width, @color)\n end\n\n self.pos = point\n end",
"title": ""
},
{
"docid": "a8b1dc97b3ab277b9c73ae2c71007b28",
"score": "0.59421366",
"text": "def make_step()\n @position.accept(self)\n end",
"title": ""
},
{
"docid": "71c6eb6486a4e4fb5345b4f623982ec6",
"score": "0.5927523",
"text": "def next_step\n @step = @step + 1\n end",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.59120953",
"text": "def drawing; end",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.59120953",
"text": "def drawing; end",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.59120953",
"text": "def drawing; end",
"title": ""
},
{
"docid": "58561a01a3184926b000633d2e376ee9",
"score": "0.59120953",
"text": "def drawing; end",
"title": ""
},
{
"docid": "878389834db77e6b4962a4b26e2949e3",
"score": "0.5903725",
"text": "def jumpToLine(line)\n # Make sure the line is in bounds.\n if line == CDK::BOTTOM || line >= @list_size\n # We are moving to the last page.\n @current_top = @list_size - @view_size\n elsif line == TOP || line <= 0\n # We are moving to the top of the page.\n @current_top = 0\n else\n # We are moving in the middle somewhere.\n if @view_size + line < @list_size\n @current_top = line\n else\n @current_top = @list_size - @view_size\n end\n end\n\n # A little sanity check to make sure we don't do something silly\n if @current_top < 0\n @current_top = 0\n end\n\n # Redraw the window.\n self.draw(@box)\n end",
"title": ""
},
{
"docid": "09e7202bf240fc0d501881d03363df2d",
"score": "0.5899553",
"text": "def draw\n @preview_pos = draw_piece(@preview_block, @preview_pos)\n end",
"title": ""
},
{
"docid": "8da673365458911db225884c276be265",
"score": "0.5890403",
"text": "def back(steps)\n validate_steps(steps)\n\n normal_radians = to_rad(flip_turtle_and_normal(@heading))\n new_pt = [@xy[0] - steps * cos(normal_radians),\n @xy[1] - steps * sin(normal_radians)]\n\n if self.pen_down?\n add_segment_to_track @xy, new_pt\n end\n\n @xy = new_pt\n end",
"title": ""
},
{
"docid": "f86fe473635ab519fb36245dbfc0ea12",
"score": "0.58899844",
"text": "def pre_draw(graphics)\n end",
"title": ""
},
{
"docid": "e32f04515192d3eb4cc54d0053f68861",
"score": "0.5875116",
"text": "def advance_step\n @step += 1\n @scheduling.step\n end",
"title": ""
},
{
"docid": "3b7dcf528e4f95cf86f71b543f696545",
"score": "0.5871326",
"text": "def move!\n @point.add!(next_point)\n self\n end",
"title": ""
},
{
"docid": "22b10092b3a67a4ad823d400b0841397",
"score": "0.5857867",
"text": "def pass\n @board.sync_previous_layout\n next_turn\n self\n end",
"title": ""
},
{
"docid": "d05ba307a32978b3ad1843c1b0db6f33",
"score": "0.58393663",
"text": "def log\n @array.each_with_index do |v, i|\n r = @rects[v]\n\n unless r.left == i * @point_width\n r.move(i * @point_width, @height - (v + 1) * @point_height)\n end\n\n unless r.style[:stroke] == black && r.style[:fill] == black\n r.style :stroke => black, :fill => black\n end\n end\n\n # XXX\n #unless @real_line.top == @width - (@line + 1) * @point_width\n # @real_line.move(0, @width - (@line + 1) * @point_width)\n #end\n\n wait\n end",
"title": ""
},
{
"docid": "c2e6d3be5ebd2c578cdfc44d92eabfb7",
"score": "0.5826711",
"text": "def go(pt)\n track << [ @xy, pt ] if pen_down?\n @xy = pt\n end",
"title": ""
},
{
"docid": "29fe371b860f6cd6a297884e7d57b28c",
"score": "0.5823351",
"text": "def next_page\n @page_num += 1\n @lines_left = @height\n end",
"title": ""
},
{
"docid": "b18bae70754a4c940f87948ccb997395",
"score": "0.5814455",
"text": "def advance_step\n @save_state += 1\n end",
"title": ""
},
{
"docid": "61001bc97b6b7766ec8bcbfd56f99a59",
"score": "0.5807597",
"text": "def move\n\t\tif @cardinal_point == 'N' then @y_coordinate = @y_coordinate + 1 #you can also write is as if @cardinal_point == 'N' then @y_coordinate +=1\n\t\telsif @cardinal_point == 'E' then @x_coordinate = @x_coordinate + 1\n\t\telsif @cardinal_point == 'S' then @y_coordinate = @y_coordinate - 1\n\t\telsif @cardinal_point == 'W' then @x_coordinate = @x_coordinate - 1\n\n\t\tend\n\tend",
"title": ""
},
{
"docid": "34f7d579c128f7ac67854620f8fbfc42",
"score": "0.5796462",
"text": "def draw\n @changed = false\n end",
"title": ""
},
{
"docid": "bdfeeeb45a0fca6d32739860c1696e35",
"score": "0.5792025",
"text": "def draw_line_continue(x, y)\n send_command( 0x65, x, y )\n end",
"title": ""
},
{
"docid": "56e3c8f4940fb32d928f08f841033650",
"score": "0.5789832",
"text": "def withdrawl(initial, next_position)\n\n # append the initial position as empty\n affected_pieces = self.paika(initial, next_position)\n # retreive the colour of the piece being moved\n initial_key = array_to_board_key(initial)\n initial_colour = @board_hash[initial_key]\n\n ### Taken from Board.find_direction ###\n # need to find direction of movement as a positive, negative, or zero\n # in order to calculate path of movement\n pos_diff = [\n next_position[0].to_i - initial[0].to_i,\n next_position[1].to_i - initial[1].to_i\n ]\n\n # Need to scale the value down to eliminate extra cases to change. e.g. moving from position 2,2 to 0,0\n move_transformation = []\n move_transformation[0] = pos_diff[0] == 0 ? 0 : pos_diff[0]/pos_diff[0].abs\n move_transformation[1] = pos_diff[1] == 0 ? 0 : pos_diff[1]/pos_diff[1].abs\n\n # invert the move transformation in order to evaluate the opposite direction\n withdrawl_move_transformation = []\n withdrawl_move_transformation[0] = move_transformation[0] * -1\n withdrawl_move_transformation[1] = move_transformation[1] * -1\n\n # apply the transformation as a move\n interim_position = []\n interim_position[0] = initial[0] + withdrawl_move_transformation[0]\n interim_position[1] = initial[1] + withdrawl_move_transformation[1]\n\n # repeat transformation until an empty space or initial_colour is found\n while (@board_hash[array_to_board_key(interim_position)])\n\n # retrieve position from hash\n transformed_state = @board_hash[array_to_board_key(interim_position)]\n # puts(array_to_board_key(interim_position) + \"#{transformed_state}\")\n\n # check transformed positon state\n if transformed_state != initial_colour && transformed_state != :Empty\n\n\n # append position if affected\n affected_piece = [interim_position[0], interim_position[1], :Empty]\n affected_pieces << affected_piece\n else\n # position is not affected and the move can exit\n return affected_pieces\n end\n\n # continue to apply transformation\n interim_position[0] += withdrawl_move_transformation[0]\n interim_position[1] += withdrawl_move_transformation[1]\n end\n\n return affected_pieces\n end",
"title": ""
},
{
"docid": "8003a4ca640b706ec7390b79b3ca9d67",
"score": "0.5787912",
"text": "def update\r\n \r\n # Move the animation forward by fetching the next frame and putting it into @image\r\n # @image is drawn by default by GameObject#draw\r\n @image = @animation[@frame_name].next\r\n \r\n #\r\n # If droid stands still, use the scanning animation\r\n #\r\n @frame_name = :scan if @x == @last_x && @y == @last_y\r\n \r\n @x, @y = @last_x, @last_y if outside_window? # return to previous coordinates if outside window\r\n @last_x, @last_y = @x, @y # save current coordinates for possible use next time\r\n end",
"title": ""
},
{
"docid": "4d625cd6f0665bbf6710c3512c6f5c35",
"score": "0.5773252",
"text": "def plot_step; end",
"title": ""
},
{
"docid": "09099f51eb0775885e298bb72479ab1c",
"score": "0.5760724",
"text": "def update_placement\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n end",
"title": ""
},
{
"docid": "09099f51eb0775885e298bb72479ab1c",
"score": "0.5760724",
"text": "def update_placement\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n end",
"title": ""
},
{
"docid": "48c4704cd78d0089e9eb9067a588a188",
"score": "0.5755268",
"text": "def move\n next_move = Navigator.new(position_x, position_y, direction).get_move_coordinates\n @position_x = next_move[:x]\n @position_y = next_move[:y]\n end",
"title": ""
},
{
"docid": "6a4fd9f6cab8720934eba46473525a75",
"score": "0.57512635",
"text": "def input_next_step_button\n if right_button_clicked?\n state.play = false\n state.anim_steps += 1\n calc\n end\n end",
"title": ""
},
{
"docid": "e8b828f52368a45060a62adc8bdbd39f",
"score": "0.5748799",
"text": "def action_step_foward\n dir = @direction\n @target_x = @actual_x + (dir == 4 ? -64 : dir == 6 ? 64 : 0)\n @target_y = @actual_y + (dir == 8 ? -64 : dir == 2 ? 64 : 0)\n if Battle_Style == 1\n @target_x = @actual_x + (dir == 8 ? -64 : dir == 2 ? 64 : 0)\n @target_y = @actual_y + (dir == 4 ? -64 : dir == 6 ? 64 : 0)\n end\n loop do\n break if not_on_same_place\n end \n end",
"title": ""
},
{
"docid": "e19f9e7dddd390c515761add137ef5c5",
"score": "0.5737169",
"text": "def start_over\n @position =0\n end",
"title": ""
},
{
"docid": "5fe523f14566c8a8b979878e3b59faae",
"score": "0.573524",
"text": "def next_step!\n self.stepper_current_step = self.next_step\n self\n end",
"title": ""
},
{
"docid": "88a414a2f39bacc0f1e6c3f32e8c5a7a",
"score": "0.57291955",
"text": "def next_step\n self.current_step = steps[steps.index(current_step)+1]\n end",
"title": ""
},
{
"docid": "8f73f6b2936d2d833d73bcd8785ef95c",
"score": "0.57224613",
"text": "def draw\n clear\n @current_shape.draw\n end",
"title": ""
},
{
"docid": "5b360a95b1d2aae35f9b90362ad99f55",
"score": "0.5717134",
"text": "def moveUp\n if @y\n call Screen.setColor(@x)\n call Screen.drawRectangle(@x, @y, @x, @y)\n let @y = @y\n call Screen.setColor(@x)\n call Screen.drawRectangle(@x, @y, @x, @y)\n end\n end",
"title": ""
},
{
"docid": "60c78ddb3a418cf04bfcf5ecd0e62144",
"score": "0.5715642",
"text": "def redraw_prestart\n @lines[0] = \"#{(@team.to_s || 'X').rjust(4, '0')} #{label}\".ljust(16)\n @lines[1] = \"MATCH#{@match.to_s.rjust(4, '0')} POS#{@data['start_position']}\" \n end",
"title": ""
},
{
"docid": "16143704521f8b0dceba59ee307bfc68",
"score": "0.57146686",
"text": "def forward len\n raise TypeError, \"Numeric argument expected\" unless len.is_a? Numeric\n x_up = len * Math.cos( self.angle * Math::PI/180.0 )\n y_up = len * Math.sin( self.angle * Math::PI/180.0 )\n self.x += x_up if x_up.abs > Step_Min\n self.y += y_up if y_up.abs > Step_Min \n inside_screen\n save\n end",
"title": ""
},
{
"docid": "d0f4258979009bfafd893dfd649d1153",
"score": "0.5710362",
"text": "def next_position\n\n # change the direction when the number of a half spin\n # has been walked. Also increase the number of steps\n # in the next turn accordingly.\n if @steps_of_half_spin == 0\n @max_steps_in_dir += 1\n @steps_of_half_spin = 2 * @max_steps_in_dir\n @move_right_or_up = !@move_right_or_up\n @steps = 0\n end\n @steps_of_half_spin -= 1\n\n if @move_right_or_up\n if @steps < @max_steps_in_dir\n @x += 1\n @steps += 1\n else\n # up\n @y += 1\n end\n Pos2.new(@x, @y)\n else\n if @steps < @max_steps_in_dir\n # left\n @x -= 1\n @steps += 1\n else\n # down\n @y -= 1\n end\n Pos2.new(@x, @y)\n end\n end",
"title": ""
},
{
"docid": "aa58066da6cd41dedfe4bfdfb44ee3a6",
"score": "0.57074",
"text": "def step\n puts \"#{@y} - #{@x}\"\n case @direction\n when \"down\"\n @y = @y + 1\n when \"up\"\n @y = @y - 1\n when \"left\"\n @x = @x - 1\n when \"right\"\n @x = @x + 1\n end\n puts \"Now #{@y} - #{@x} - #{@maze[@y][@x]}\"\n if @maze[@y][@x] == \"+\"\n if @maze[@y-1] and (@maze[@y-1][@x] == \"|\" or @maze[@y-1][@x] =~ /[A-Z]/) and @direction != \"down\"\n @direction = \"up\"\n elsif @maze[@y+1] and (@maze[@y+1][@x] == \"|\" or @maze[@y+1][@x] =~ /[A-Z]/) and @direction != \"up\"\n @direction = \"down\"\n elsif @maze[@y][@x-1] and (@maze[@y][@x-1] == \"-\" or @maze[@y][@x-1] =~ /[A-Z]/) and @direction != \"right\"\n @direction = \"left\"\n elsif @maze[@y][@x+1] and (@maze[@y][@x+1] == \"-\" or @maze[@y][@x+1] =~ /[A-Z]/) and @direction != \"left\"\n @direction = \"right\"\n end\n end\n if @maze[@y][@x] =~ /[A-Z]/\n @letters = @letters + @maze[@y][@x]\n end\n @step_count = @step_count + 1\n end",
"title": ""
},
{
"docid": "631f333ad07d2bc102535182ee0b758f",
"score": "0.57065886",
"text": "def next_move\n end",
"title": ""
},
{
"docid": "2757107e0a829ca0f1a3b035f2616e07",
"score": "0.5704203",
"text": "def moveTo( x, y )\r\n @currentX = x\r\n @currentY = y\r\n end",
"title": ""
},
{
"docid": "02d049fd52e9e3df7f4d9cdc0a7e3286",
"score": "0.5700975",
"text": "def move\n return unless placed?\n\n next_x = MOVE_DELTAS[@facing.to_sym][:x] + x\n next_y = MOVE_DELTAS[@facing.to_sym][:y] + y\n return unless @table.valid?(next_x, next_y)\n\n @x = next_x\n @y = next_y\n end",
"title": ""
},
{
"docid": "6f3508fa92f589832da2860281cbfcdd",
"score": "0.5699937",
"text": "def move_idle\n\t\t@x += rand(@step_size*2) - @step_size \n\t\t@y += rand(@step_size*2) - @step_size \n\t\t# Keep critters within view\n\t\tkeep_within_viewable\t\n\t\t@angle += (rand(90) * Math::PI/180) - (45 * Math::PI/180)\n\tend",
"title": ""
},
{
"docid": "ed77230732e1747b09d07b67f3f1de0c",
"score": "0.5699165",
"text": "def move_down\n @y += 7 if @y <= 425\n @drawing = false if @y >= 425\n end",
"title": ""
},
{
"docid": "325a9c275d5df4ac0493aa0a6969a612",
"score": "0.56943643",
"text": "def draw!\n end",
"title": ""
},
{
"docid": "f7747545710803e061dbdc8b4a4a602e",
"score": "0.56929547",
"text": "def move\n #get the steps to take according to its direction, Step for x, y is set to 1 as default\n steps = MovingStrategy[@position_info.last.to_sym].zip([Step, Step]).map { |x, y| x * y }\n \n #get the new position by adding the steps on current position\n new_position = @position_info[0..1].zip(steps).map { |x, y| x + y }\n #take the steps if robot is not going to fall down off the table\n inside?(new_position, TableSize) && @position_info[0..1] = new_position \n end",
"title": ""
},
{
"docid": "19c45344b09c07d8f0c0d427176f4d47",
"score": "0.56884855",
"text": "def goto(x, y)\n `document.getElementById(\"mycanvas\").getContext(\"2d\").beginPath();`\n\t\n p = @pen\n @pen = true\n turtlewax_goto(x, y);\n @pen = p\n end",
"title": ""
},
{
"docid": "a1257c5ac63271f1e99dfa7fb44c65eb",
"score": "0.56852883",
"text": "def draw\n @view.draw(0, @y_anchor_pos, 100)\n if (@anchor_reached)\n #@replay.draw\n @return.draw\n end\n end",
"title": ""
},
{
"docid": "bc1852ea5429e3d9a5f440e462bbc495",
"score": "0.56812024",
"text": "def advance\n @linenum += 1\n end",
"title": ""
},
{
"docid": "8fc594335ccc6c8c495ca51a220f0715",
"score": "0.5679414",
"text": "def draw\n self.refresh\n end",
"title": ""
},
{
"docid": "c0514795fd5331399935b74395c78101",
"score": "0.5679152",
"text": "def draw\n\t\t# \n\t\t# Clear the screen.\n\t\t#\n\t\tprint \"\\e[2J\"\n\t\tif not @animate\n\t\t\n\t\t\t#\n\t\t\t# Move to upper left and defer to superclass.\n\t\t\t#\n\t\t\tprint \"\\e[H\"\n\t\t\tsuper()\n\t\t\t\n\t\telse\n\t\t\n\t\t\t#\n\t\t\t# Carve the passages and animate as we go.\n\t\t\t#\n\t\t\tcarve_passages\n\t\tend\n\tend",
"title": ""
},
{
"docid": "93759840184d6b89b50230b42d0037df",
"score": "0.5678989",
"text": "def plotMove (w, x, y)\n w.move 'selected', x - $plot['lastX'], y - $plot['lastY']\n $plot['lastX'] = x\n $plot['lastY'] = y\nend",
"title": ""
},
{
"docid": "939d38c495e99e325c46f37824c552f8",
"score": "0.5674797",
"text": "def goto_start\n @oldindex = @current_index\n @current_index = 0\n @prow = 0\n end",
"title": ""
},
{
"docid": "19b09b54b7164cce8b40fb72d5546d7d",
"score": "0.56728476",
"text": "def goto x, y\n raise TypeError, \"Numeric argument expected\" unless x.is_a? Numeric\n raise TypeError, \"Numeric argument expected\" unless y.is_a? Numeric\n self.x = x\n self.y = y\n inside_screen\n save\n end",
"title": ""
},
{
"docid": "e33c9c5881a6e27696f149785f111e61",
"score": "0.5668754",
"text": "def update\n \n # Move the animation forward by fetching the next frame and putting it into @image\n # @image is drawn by default by GameObject#draw\n @image = @animation[@frame_name]\n \n #\n # If droid stands still, use the scanning animation\n #\n #@frame_name = :scan if @x == @last_x && @y == @last_y\n \n @x, @y = @last_x, @last_y if outside_window? # return to previous coordinates if outside window\n @last_x, @last_y = @x, @y # save current coordinates for possible use next time\n end",
"title": ""
},
{
"docid": "6e5f96bac3e2564adf395e40034b589b",
"score": "0.5664062",
"text": "def update_move\n was_moving = moving?\n update_real_position\n update_slope_offset_y\n # Update the anime_count for the pattern animation\n if @walk_anime\n @anime_count += 1.5\n elsif @step_anime\n @anime_count += 1\n end\n Scheduler::EventTasks.trigger(:end_step, self) if was_moving && !moving?\n end",
"title": ""
},
{
"docid": "0ea427d90443d402773d88d61b220bde",
"score": "0.565973",
"text": "def step\n # Clear the screen.\n @screen.fill( :black )\n\n # Fetch input events, etc. from SDL, and add them to the queue.\n @queue.fetch_sdl_events\n\n # Tick the clock and add the TickEvent to the queue.\n @queue << @clock.tick\n\n # Process all the events on the queue.\n @queue.each do |event|\n handle( event )\n end\n\n # Draw everything\n step_state\n\n # Refresh the screen.\n @screen.update()\n end",
"title": ""
},
{
"docid": "d6ba75613c8843c331f60e072dac8080",
"score": "0.56561804",
"text": "def move_first\n @selected = 0\n @offset = 0\n end",
"title": ""
},
{
"docid": "377efb16b80b8382906b5704be14996f",
"score": "0.56557506",
"text": "def move_to_position(next_position)\n @current_position = next_position\n end",
"title": ""
},
{
"docid": "f92ebdcf2a060637f4ba2b84499febc6",
"score": "0.56529576",
"text": "def post_draw(graphics)\n end",
"title": ""
},
{
"docid": "bbff95cd8825c7172ce9cd7596324768",
"score": "0.56525844",
"text": "def home\n pen_up\n @xy = [0,0]\n @heading = 0\n end",
"title": ""
},
{
"docid": "bd2cd387e968d4565ff7e5162c61561f",
"score": "0.5649145",
"text": "def handle_movement(x, y, target_x, target_y)\n\t\t\t\tif down?\n\t\t\t\t\tif fill_mode?\n\t\t\t\t\t\t@to_be_filled << [target_x, target_y]\n\t\t\t\t\telse\n\t\t\t\t\t\t@shapes << [:draw_line, x, y, color, target_x, target_y, color]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "baf51a8bc5bb5e8f31d7fe3ec04ed3e6",
"score": "0.564857",
"text": "def updatePosition\n @x = PL::sketch.width * @xOffsetPercent\n @y = PL::sketch.height * @yOffsetPercent\n @width = PL::sketch.width * @widthPercent\n @height = PL::sketch.height * @heightPercent\n end",
"title": ""
},
{
"docid": "bb148bc91714e684a78947075863f6f9",
"score": "0.56481117",
"text": "def step()\n @steps += 1\n end",
"title": ""
},
{
"docid": "f568dbb598b99038254263fec0d50daf",
"score": "0.56437796",
"text": "def draw\n end",
"title": ""
},
{
"docid": "f568dbb598b99038254263fec0d50daf",
"score": "0.56437796",
"text": "def draw\n end",
"title": ""
},
{
"docid": "f568dbb598b99038254263fec0d50daf",
"score": "0.56437796",
"text": "def draw\n end",
"title": ""
},
{
"docid": "95fe36c8c4145cbdc31715d3c51b2616",
"score": "0.5635539",
"text": "def advance(roll)\n @current = roll.move_from(current_location)\n end",
"title": ""
}
] |
0b2e087a2b8ceb137171fa38d4a69d2a
|
Execute the actual test
|
[
{
"docid": "2b04bb43812ce701ccef29711b429eb3",
"score": "0.0",
"text": "def run_test\n t = nil\n\n begin\n t = clazz.create\n if t.respond_to? :micron_method= then\n t.micron_method = self # minitest compat shim\n end\n\n time(:setup) { setup(t) }\n\n # run actual test method and measure runtime\n @runtime = Hitimes::Interval.now\n t.send(name)\n @durations[:runtime] = @runtime.stop\n self.passed = true\n\n rescue *PASSTHROUGH_EXCEPTIONS\n @durations[:runtime] = @runtime.stop if @runtime\n raise\n\n rescue Exception => e\n @durations[:runtime] = @runtime.stop if @runtime\n self.passed = false\n self.ex = ExceptionInfo.new(e)\n\n ensure\n self.assertions += t._assertions if not t.nil?\n time(:teardown) {\n teardown(t) if not t.nil?\n }\n @runtime = nil\n end\n end",
"title": ""
}
] |
[
{
"docid": "8ed4d9487da168e3023e8e171ccf922e",
"score": "0.7383376",
"text": "def run_tests\n _run_anything :test\n end",
"title": ""
},
{
"docid": "6ac0f028dc11e1a857038fd8e748bba1",
"score": "0.7220644",
"text": "def test\n raise 'Failing test' if Global.fail\n\n Global.nbr_runs += 1\n end",
"title": ""
},
{
"docid": "e083ec978bc9ecd5d64a735b2e978b04",
"score": "0.70533085",
"text": "def run_test\n status.initialize_run\n\n begin\n run\n rescue Exception => exception\n status.log_exception(exception)\n raise\n ensure\n status.finalize_run\n end\n\n end",
"title": ""
},
{
"docid": "2825f73dc1757f2f2c63b99b2e988f74",
"score": "0.6994699",
"text": "def test\n Command::Database::Test.new(\n *command_params\n ).execute\n rescue => e\n catch_errors(e)\n end",
"title": ""
},
{
"docid": "52f8f79d03390590bd1a539c5b4a529a",
"score": "0.69430685",
"text": "def execute_test(test_id)\n\tparent_test = current_test\n\ttest_params = parent_test.test_params rescue $test_params\n\ttest_items = parent_test.test_items rescue $test_items\n\ttest = $test_suit.load_test(test_id,test_params ,test_items )\n\tset_current_test(test)\n\ttest.run_test\n\ttest.raise_errors(true)\nensure\n\t\tset_current_test(parent_test)\n\t\treturn test.log\nend",
"title": ""
},
{
"docid": "cdea81a161261894cef153b901386560",
"score": "0.68866086",
"text": "def run\n\t\t@reader = Reader.new(nil)\n\t\t@reader.mock_content(File.read('test_cases/test.txt'))\n\t\tdeclare_fields.each do |field|\n\t\t\tputs \"EXECUTING: #{field}\"\n\t\t\tfield.execute(@reader)\n\t\t\tfield.print_results unless field.is_a? Action\n\t\tend\n\tend",
"title": ""
},
{
"docid": "253d347b30ec438b578d6a3a1a2fe81d",
"score": "0.6836812",
"text": "def run\n do_run do\n test_script\n end\n end",
"title": ""
},
{
"docid": "13581ebc8c96ce29b241a4722243f894",
"score": "0.68299073",
"text": "def execute_tests\n instance_exec(&Thread.current[:test_block]) if Thread.current[:test_block]\n end",
"title": ""
},
{
"docid": "5a8d20cfa19c8f0f1093c48065c1412c",
"score": "0.6808072",
"text": "def test\n \n end",
"title": ""
},
{
"docid": "5a8d20cfa19c8f0f1093c48065c1412c",
"score": "0.6808072",
"text": "def test\n \n end",
"title": ""
},
{
"docid": "15550268814070847cf093e150779101",
"score": "0.68000084",
"text": "def run_test_code\n\t\t#@workspace.insert_next(Dungeon_IO.read_dungeon(\"test\"))\n\t\t#@op.on_print(0)\n\t\t#@crawler.start(@workspace.item(0, true))\n\t\t\n\t\t@op.open\n\t\t@op.on_assemble\n\tend",
"title": ""
},
{
"docid": "9a2997653017c82413fad50cfaab7811",
"score": "0.67735374",
"text": "def run\n if beginTest\n puts 'Passed!'\n else\n puts 'Failed!'\n end\n end",
"title": ""
},
{
"docid": "32eb8732389f631650979b5ffdf8ca35",
"score": "0.67656326",
"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": "8d3d419d54e5fe9598c8f359a41b26e4",
"score": "0.6753553",
"text": "def run(test_filename)\n\n end",
"title": ""
},
{
"docid": "8070cf01e82acc4e4d86843e06ba340a",
"score": "0.6729955",
"text": "def run_test\n\t\trun_test(20000)\n\tend",
"title": ""
},
{
"docid": "e275201d88968c6b923d9e5dac1dd22c",
"score": "0.6728595",
"text": "def run_test\n start_test\n end",
"title": ""
},
{
"docid": "a9860ce1239bc13ac1e801a60843b9d8",
"score": "0.6698904",
"text": "def test_command\n end",
"title": ""
},
{
"docid": "0b6b973bb43296fe4ac3422999694a1d",
"score": "0.6672577",
"text": "def run\n test_dir_path = path_to_adjacent_file(@test_directory)\n results_dir_path = create_results_dir('results')\n # We need to run this each time in case test case files have changed or new\n # tests have been added\n find_all_tests(test_dir_path)\n results = run_tests(test_dir_path, results_dir_path)\n show_results(results, results_dir_path)\n end",
"title": ""
},
{
"docid": "24d6e4c0f631bab5a17966782fe34b2b",
"score": "0.6657565",
"text": "def run_test(obj, testset)\n @cfg['testset'] = testset\n test_sets =[]\n run_cases_idx = []\n fp = File.open \"actual_result.json\", 'a'\n result =\"\"\n ##Get methods from test suite class and execute them one by one\n methods = obj.class.instance_methods(false)\n\n methods.each do |method|\n if (method.to_s == \"#{testset}_test\")\n test_sets = obj.send(method)\n\n end\n end\n\n if test_sets ==[] and testset != \"regression\"\n raise StandardError.new(\"Missing testset define for: \\\"#{testset}\\\" in your test suite\")\n end\n #-----------------------------------------------------------------\n # run pre_setup for suite if pre_setup_suite is defined\n #-----------------------------------------------------------------\n setup_teardown_wrap(obj, \"pre_setup_suite\", fp)\n\n methods.each do |method|\n if @aid_methods.include?(method.to_s.downcase)\n next\n else\n begin\n if testset == \"regression\" or test_sets == [\"all\"]\n\n #-----------------------------------------------------------------\n # execute pre setup before each case\n #-----------------------------------------------------------------\n @idx+=1\n if @cfg['run_testcases'].include?(@idx.to_s) or @cfg['run_testcases']==[]\n setup_teardown_wrap(obj, \"pre_setup_case\", fp)\n\n run_cases_idx.push(@idx.to_s)\n #-----------------------------------------------------------------\n # execute method\n #-----------------------------------------------------------------\n @log.info \"************************************************************\"\n @log.info \"idx:#{@idx} #{method}()\"\n puts \"************************************************************\"\n puts \"idx:#{@idx} #{method}()\"\n method_output =obj.send(method)\n result = {\"idx\" => @idx, \"#{method}\" => method_output}\n fp.print result.to_json\n fp.print \"\\n\"\n #-----------------------------------------------------------------\n # execute tear down after each case\n #-----------------------------------------------------------------\n setup_teardown_wrap(obj, \"tear_down_case\", fp)\n else\n next\n end\n\n elsif test_sets.include?(method.to_s)\n @idx+=1\n if @cfg['run_testcases'].include?(@idx.to_s) or @cfg['run_testcases']==[]\n #-----------------------------------------------------------------\n # execute pre setup before each case\n #-----------------------------------------------------------------\n setup_teardown_wrap(obj, \"pre_setup_case\", fp)\n run_cases_idx.push(@idx.to_s)\n #-----------------------------------------------------------------\n # execute method\n #-----------------------------------------------------------------\n @log.info \"************************************************************\"\n @log.info \"idx:#{@idx} #{method}()\"\n puts \"************************************************************\"\n puts \"idx:#{@idx} #{method}()\"\n method_output =obj.send(method)\n result = {\"idx\" => @idx, \"#{method}\" => method_output}\n fp.print result.to_json\n fp.print \"\\n\"\n #-----------------------------------------------------------------\n # execute tear down after each case\n #-----------------------------------------------------------------\n setup_teardown_wrap(obj, \"tear_down_case\", fp)\n else\n next\n end\n else\n next\n end\n\n rescue StandardError => ex\n bt = ex.backtrace.join(\"\\n\")\n @log.error \"Execute method #{method} failed,the error is #{ex} \"\n puts \"Execute method #{method} failed,the error is #{ex} \"\n end\n end\n end\n #-----------------------------------------------------------------\n # run tear down for suite if tear_down suite is defined\n #-----------------------------------------------------------------\n setup_teardown_wrap(obj, \"tear_down_suite\", fp)\n fp.close\n @log.info \"************************************************************\"\n puts \"************************************************************\"\n @log.info \"cases: #{run_cases_idx} were executed\"; puts \"cases: #{run_cases_idx} were executed\" if run_cases_idx!=[]\n end",
"title": ""
},
{
"docid": "3c3205d11937929e52d10463a698f55b",
"score": "0.66405666",
"text": "def executeTestCase (test_case)\n\t# Extract the test case data\n\tcase_id = test_case.elements[\"id\"].text\n\tcase_keyword = test_case.elements[\"keyword\"].text\n\tcase_description = test_case.elements[\"description\"].text\t\n\tcase_test_type = test_case.elements[\"test_type\"].text\n\tcase_parameter_name = test_case.elements[\"parameter_name\"].text\n\t\n\t# Filter based on the type of test\n\tcase case_test_type\n\t\twhen \"get parameter value\"\n\t\t\ttestGenericRead(test_case)\n\t\t\t# Filter based on the parameter name\n\t\t\t#case case_parameter_name\n\t\t\t#\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.SSID\"\n\t\t\t\t#\ttestSSIDRead(test_case)\n\t\t\t#\telse\n\t\t\t\t# Assume the test case is okay and start reading\n\t\t\t\t# Perhaps a function that checks whether the parameter name\n\t\t\t\t# is part of a list of accepted parameters is needed\n\t\t\t\t# For now, call testGenericRead for all parameter names\n\t\t\t#\t\ttestGenericRead(test_case)\n\t\t\t#end\n\t\twhen \"set parameter value\"\n\t\t\tcase case_parameter_name\n\t\t\t\t# Here I am hard coding the values to set based on the paramter name,\n\t\t\t\t# which is not ideal at all\n\t\t\t\t# The values I hard coded here are either based on the current \n\t\t\t\t# values set on my BHR, or some random value. I am not sure \n\t\t\t\t# if they are valid.\n\t\t\t\twhen \"InternetGatewayDevice.DeviceInfo.ProvisioningCode\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"TLCO.GRP2\")\n\t\t\t\twhen \"InternetGatewayDevice.DeviceConfig.PersistentData\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"This is the arbitrary user data that MUST persist across CPE reboots.\")\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.URL\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"https://xatechdm.xdev.motive.com/cwmpWeb/CPEMgt\")\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.Username\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", $bhr_serial)\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.Password\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"actiontec\")\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.PeriodicInformEnable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.PeriodicInformInterval\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"300\")\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.PeriodicInformTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"dateTime\", \"2009-03-11T17:18:09.000Z\")\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.ConnectionRequestUsername\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", $bhr_serial)\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.ConnectionRequestPassword\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"actiontec\")\n\t\t\t\twhen \"InternetGatewayDevice.ManagementServer.UpgradesManaged\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.NTPServer1\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.pool.ntp.org\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.NTPServer2\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"1.pool.ntp.org\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.NTPServer1\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"2.pool.ntp.org\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.LocalTimeZone\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"-08:00\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.LocalTimeZoneName\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Pacific_Time\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.DaylightSavingsUsed\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.DaylightSavingsStart\"\n\t\t\t\t\ttestGenericWrite(test_case, \"dateTime\", \"2009-03-11T08:00:09.000Z\")\n\t\t\t\twhen \"InternetGatewayDevice.Time.DaylightSavingsEnd\"\n\t\t\t\t\ttestGenericWrite(test_case, \"dateTime\", \"2009-11-11T09:00:09.000Z\")\n\t\t\t\twhen \"InternetGatewayDevice.UserInterface.PasswordRequired\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.DefaultConnectionService\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3\")\n\t\t\t\t# You can't seem to set values for these parameters under\n\t\t\t\t# \tInternetGatewayDevice.Layer3Forwarding.Forwarding.1.\n\t\t\t\t# \tInternetGatewayDevice.Layer3Forwarding.Forwarding.2.\n\t\t\t\t# It will result in Motive returning query error and cause test case to fail.\n\t\t\t\t# You have to add an object in order to test SPV on these parameters.\n\t\t\t\t#\tHowever, the program does not automate \"Add Object\" function right now.\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.Type\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Network\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.DestIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"192.168.1.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.DestSubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"255.255.255.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.SourceIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.SourceSubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.GatewayIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.Interface\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"InternetGatewayDevice.LANDevice.1.\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.ForwardingMetric\"\n\t\t\t\t\ttestGenericWrite(test_case, \"int\", \"4\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.1.MTU\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"1500\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.Type\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Network\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.DestIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"10.1.10.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.DestSubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"255.255.255.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.SourceIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.SourceSubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.GatewayIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.Interface\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.ForwardingMetric\"\n\t\t\t\t\ttestGenericWrite(test_case, \"int\", \"3\")\n\t\t\t\twhen \"InternetGatewayDevice.Layer3Forwarding.Forwarding.2.MTU\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"1500\")\n\t\t\t\twhen \"InternetGatewayDevice.LANConfigSecurity.ConfigPassword\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", $bhr_password)\n\t\t\t\twhen \"InternetGatewayDevice.IPPingDiagnostics.DiagnosticsState\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Requested\")\n\t\t\t\twhen \"InternetGatewayDevice.IPPingDiagnostics.Interface\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1\")\n\t\t\t\twhen \"InternetGatewayDevice.IPPingDiagnostics.Host\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"127.1.1.1\")\n\t\t\t\twhen \"InternetGatewayDevice.IPPingDiagnostics.NumberOfRepetitions\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"1\")\n\t\t\t\twhen \"InternetGatewayDevice.IPPingDiagnostics.Timeout\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"100\")\n\t\t\t\twhen \"InternetGatewayDevice.IPPingDiagnostics.DataBlockSize\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"1\")\n\t\t\t\twhen \"InternetGatewayDevice.IPPingDiagnostics.DSCP\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\t\t\t\t\t\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DHCPServerConfigurable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DHCPServerEnable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DHCPRelay\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MinAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"192.168.1.2\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MaxAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"192.168.1.254\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.ReservedAddresses\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"192.168.1.222\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.SubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"255.255.255.0\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DNSServers\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"192.168.1.1\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DomainName\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"home\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPRouters\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"192.168.1.1\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DHCPLeaseTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"int\", \"86400\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.UseAllocatedWAN\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Normal\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.PassthroughLease\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.PassthroughMACAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.AllowedMACAddresses\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"192.168.1.1\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceSubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"255.255.255.0\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceAddressingType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Static\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANEthernetInterfaceConfig.2.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANEthernetInterfaceConfig.2.MACAddressControlEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANEthernetInterfaceConfig.2.MaxBitRate\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Auto\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.LANEthernetInterfaceConfig.2.DuplexMode\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Auto\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.MaxBitRate\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Auto\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.Channel\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.SSID\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Adamo\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.BeaconType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Basic\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.MACAddressControlEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.WEPKeyIndex\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"1\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.KeyPassphrase\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.BasicEncryptionModes\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"WEPEncryption\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.BasicAuthenticationMode\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"None\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.WPAEncryptionModes\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"TKIPEncryption\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.WPAAuthenticationMode\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"PSKAuthentication\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.IEEE11iEncryptionModes\" # GPV failed\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"TKIPEncryption\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.IEEE11iAuthenticationMode\" # GPV failed\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"PSKAuthentication\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.BasicDataTransmitRates\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"6,9,12,18,24,36,48,54\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.OperationalDataTransmitRates\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"6,9,12,18,24,36,48,54\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.InsecureOOBAccessEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.BeaconAdvertisementEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.RadioEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.AutoRateFallBackEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.LocationDescription\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.RegulatoryDomain\" # GPV failed\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"US \")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.DeviceOperationMode\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"InfrastructureAccessPoint\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.DistanceFromRoot\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.PeerBSSID\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.AuthenticationServiceMode\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"None\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.WEPKey.1.WEPKey\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0000000000\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.WEPKey.2.WEPKey\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.WEPKey.3.WEPKey\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.WEPKey.4.WEPKey\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.PreSharedKey.1.PreSharedKey\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.PreSharedKey.1.KeyPassphrase\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.PreSharedKey.1.AssociatedDeviceMACAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANCommonInterfaceConfig.EnabledForInternet\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANCommonInterfaceConfig.EnabledForInternet\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANEthernetInterfaceConfig.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANEthernetInterfaceConfig.MaxBitRate\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Auto\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANEthernetInterfaceConfig.DuplexMode\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Auto\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.ConnectionType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"IP_Routed\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.Name\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Broadband Connection (Ethernet)\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.AutoDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.IdleDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.WarnDisconnectDelay\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.NATEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.AddressingType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"DHCP\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.ExternalIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"173.8.154.236\") # Can only be set if AddressingType is \"Static\"\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.SubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"255.255.255.0\") # Can only be set if AddressingType is \"Static\"\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.DefaultGateway\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"173.8.154.238\") # Can only be set if AddressingType is \"Static\"\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.DNSEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.DNSOverrideAllowed\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.DNSServers\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"68.87.85.98,68.87.69.146\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.MaxMTUSize\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"1500\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.MACAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"00:1f:90:55:af:2a\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.MACAddressOverride\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.ConnectionTrigger\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Manual\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANIPConnection.3.RouteProtocolRx\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Off\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.ConnectionType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"IP_Routed\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.Name\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Broadband Connection (Coax)\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.AutoDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.IdleDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.WarnDisconnectDelay\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.NATEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.AddressingType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"DHCP\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.ExternalIPAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\") # Can only be set if AddressingType is \"Static\"\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.SubnetMask\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\") # Can only be set if AddressingType is \"Static\"\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.DefaultGateway\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"0.0.0.0\") # Can only be set if AddressingType is \"Static\"\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.DNSEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.DNSOverrideAllowed\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.DNSServers\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.MaxMTUSize\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"1500\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.MACAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"00:1f:90:55:af:2b\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.MACAddressOverride\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.ConnectionTrigger\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Manual\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANIPConnection.5.RouteProtocolRx\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Off\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.ConnectionType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"IP_Routed\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.Name\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"WAN PPPoE\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.AutoDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.IdleDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.WarnDisconnectDelay\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.NATEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.Username\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"verizonfios\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.Password\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"verizon\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.MaxMRUSize\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.DNSEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.DNSOverrideAllowed\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.DNSServers\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.MACAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"00:1f:90:55:af:2a\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.MACAddressOverride\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.PPPoEACName\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.PPPoEServiceName\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.ConnectionTrigger\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"AlwaysOn\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.3.WANConnectionDevice.3.WANPPPConnection.8.RouteProtocolRx\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Off\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.Enable\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.ConnectionType\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"IP_Routed\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.Name\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"WAN PPPoE 2\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.AutoDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.IdleDisconnectTime\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.WarnDisconnectDelay\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.NATEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.Username\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"verizonfios\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.Password\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"verizon\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.MaxMRUSize\"\n\t\t\t\t\ttestGenericWrite(test_case, \"unsignedInt\", \"0\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.DNSEnabled\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.DNSOverrideAllowed\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"true\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.DNSServers\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.MACAddress\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"00:1f:90:55:af:2b\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.MACAddressOverride\"\n\t\t\t\t\ttestGenericWrite(test_case, \"boolean\", \"false\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.PPPoEACName\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.PPPoEServiceName\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.ConnectionTrigger\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"AlwaysOn\")\n\t\t\t\twhen \"InternetGatewayDevice.WANDevice.5.WANConnectionDevice.5.WANPPPConnection.9.RouteProtocolRx\"\n\t\t\t\t\ttestGenericWrite(test_case, \"string\", \"Off\")\n\t\t\t\t#when \"InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.SSID\"\n\t\t\t\t#\ttestSSIDWrite(test_case)\n\t\t\t\telse\n\t\t\t\t\t# If the parameter name doesn't match, report error only\n\t\t\t\t\t$debug.log('debug', \"Parameter name is not recognized!\")\n\t\t\t\t\t$testcaseTotalCount-=1\n end\n when \"firmware update\"\n testFirmwareUpdate(test_case)\n\t\telse\n\t\t\t$debug.log('debug', \"Test type is not recognized!\")\n\t\t\t$testcaseTotalCount-=1\n\tend\nend",
"title": ""
},
{
"docid": "ae80653de9350725669dba4d5614eace",
"score": "0.6640564",
"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": "65ae35dde25153811a797a5a08c07fa1",
"score": "0.6636697",
"text": "def execute_test_cases(assignment)\n # Find all results related to test case\n # Test cases are ordered according to test plan order\n results = nil\n SEMAPHORE.synchronize do\n # results = Result.where(:assignment_id => assignment.id).\n # joins('left join assignments on (results.assignment_id = assignments.id)').\n # joins('left join plan_cases on (plan_cases.test_case_id = results.test_case_id AND plan_cases.test_plan_id = assignments.test_plan_id)').\n # order('case_order') \n results = Result.where(:assignment_id => assignment.id).order('id')\n end\n \n results.each do |result|\n # The result from the large query is not editable\n # We create an editable result item\n editable_result = Result.find(result.id)\n SEMAPHORE.synchronize do\n LOGGER.info \"#{Time.now.strftime('%Y-%m-%d_%H:%M:%S')} INFO: Executing test case #{result.test_case.name}\"\n end \n\n # If this is a jMeter test case, use the jmeter code\n if result.test_case.test_type_id == TestType.where(:name => 'jMeter').first.id\n Schedule.jmeter(editable_result)\n # Otherwise run standard automation\n elsif result.test_case.test_type_id == TestType.where(:name => 'Sikuli').first.id\n Schedule.sikuli(editable_result)\n else\n # If there is a script attached, try to run it \n if result.test_case.uploads.first != nil\n # Anything can happen that will cause scripts to fail\n # We capture and mark as failed\n begin\n # Run script and save output to note\n output = `#{result.test_case.uploads.first.upload.path} 2>&1`\n editable_result.note = output\n # If the script exit status is 0 it passes\n if $?.exitstatus == 0\n editable_result.result = \"Passed\"\n # Otherwise it is considered to be a failure\n else\n editable_result.result = \"Failed\"\n end\n # Script unable to run\n rescue\n editable_result.result = \"Failed\"\n editable_result.note = \"Error occurred running script. TestCaseDB caught error.\"\n end\n # No script attached to test case. It is marked as blocked\n else\n editable_result.result = \"Blocked\"\n editable_result.note = \"No scripts attached to test case.\"\n end\n SEMAPHORE.synchronize do\n editable_result.save\n end\n end\n end\nend",
"title": ""
},
{
"docid": "e9748b85ddb9d5afe3a6b48a9795e53c",
"score": "0.6629525",
"text": "def test\n\n end",
"title": ""
},
{
"docid": "30c8c8c3b51b230766c36cf41b51f889",
"score": "0.6622305",
"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": "ab13c3571ba73367ab1ce09ff8394ee1",
"score": "0.66139024",
"text": "def execute_test_action(one_case)\n component = one_case[\"Component\"]\n action = one_case[\"Action\"]\n arguments = one_case[\"ARG\"]\n result = one_case[\"Actual Output\"]\n\n action = action.downcase\n #get element information\n if action =~ /error_message|get_tip|get_status|get_description/\n element = component\n else\n element = @browser.get_element(component)\n end\n\n #call the method for this action\n @keyword.method(\"#{action}\").call(element,arguments,result)\n end",
"title": ""
},
{
"docid": "b80577b5330586771811f4ea4db28591",
"score": "0.66064",
"text": "def run_test\n status.initialize_run\n\n #TODO Formatting/optimization\n begin\n @params = eval(File.read(@params_path)) if File.exists?(@params_path.to_s)\n @status.params = @params\n rescue Exception => exception\n status.log_exception(exception)\n raise \"ERROR: Invalid parameters file: #{@params_path}.\\n\\tMESSAGE: #{exception.message}\"\n ensure\n status.finalize_run\n end\n\n begin\n run\n rescue Exception => exception\n status.log_exception(exception)\n raise\n ensure\n status.finalize_run\n end\n\n end",
"title": ""
},
{
"docid": "b80577b5330586771811f4ea4db28591",
"score": "0.66064",
"text": "def run_test\n status.initialize_run\n\n #TODO Formatting/optimization\n begin\n @params = eval(File.read(@params_path)) if File.exists?(@params_path.to_s)\n @status.params = @params\n rescue Exception => exception\n status.log_exception(exception)\n raise \"ERROR: Invalid parameters file: #{@params_path}.\\n\\tMESSAGE: #{exception.message}\"\n ensure\n status.finalize_run\n end\n\n begin\n run\n rescue Exception => exception\n status.log_exception(exception)\n raise\n ensure\n status.finalize_run\n end\n\n end",
"title": ""
},
{
"docid": "c8e403a7aadd2c1f83a0490fe0364c38",
"score": "0.6604773",
"text": "def run_test(test_script, test)\n test_script.send(test)\n end",
"title": ""
},
{
"docid": "657ca09ded2c7918af57a835c38ccfdb",
"score": "0.65953326",
"text": "def test_ok; end",
"title": ""
},
{
"docid": "657ca09ded2c7918af57a835c38ccfdb",
"score": "0.65953326",
"text": "def test_ok; end",
"title": ""
},
{
"docid": "0d4b620075906cbc657bf6965cdeaf0c",
"score": "0.65934765",
"text": "def test\n end",
"title": ""
},
{
"docid": "0d4b620075906cbc657bf6965cdeaf0c",
"score": "0.65934765",
"text": "def test\n end",
"title": ""
},
{
"docid": "9b346e94bc7319cdd42383fb0f6ee2a6",
"score": "0.6582457",
"text": "def run\n catch(:abort) do\n run_tests\n end\n\n # save_results\n wrap_up\n end",
"title": ""
},
{
"docid": "eb99c2f11cf85b88119415b674c547df",
"score": "0.652534",
"text": "def run_test\n begin\n @value = eval @test\n rescue Exception => exc\n # TODO: something sensible when tests aren't valid\n @value = false\n end\n end",
"title": ""
},
{
"docid": "dbe21000a414f92c1bb3b09297b3aafc",
"score": "0.6512435",
"text": "def run\n\n vars = {\"pbehave\" => @pbehave}\n vars[\"screenshots\"] = true if @step_screenshots\n\n path = \"test/run\"\n path = \"try_it_now/run\" if login_name == \"try_it_now\"\n response = api_request path, vars\n\n @test_id = response[\"test_run_test_id\"]\n end",
"title": ""
},
{
"docid": "f0fbb19b868b7d40482caee9e270611b",
"score": "0.6505347",
"text": "def test_run_finished; end",
"title": ""
},
{
"docid": "52061e9b4fafb88357e15348342bc07c",
"score": "0.6505304",
"text": "def test_compare\n runtest('case1')\n end",
"title": ""
},
{
"docid": "0c1db937a7fd5d0966a9d9f32ffa45d8",
"score": "0.650361",
"text": "def run\n status('- %d @ runtime: %s', tests.length, runtime)\n tests.each do |test|\n puts(\" - #{test.identification}\")\n end\n puts('Test Output:')\n puts(object.output)\n end",
"title": ""
},
{
"docid": "f2672d22e3ca3520332cfd6332d2ba30",
"score": "0.64758277",
"text": "def test_case_finished; end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6460782",
"text": "def tests; end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6460782",
"text": "def tests; end",
"title": ""
},
{
"docid": "27de98cb7dbacfcfa1259bd9073539b1",
"score": "0.6460694",
"text": "def run_test\n logger.info(\"Starting stress test run\")\n\n # Create the pre-defined \"info\" actions\n FactInst_Inf.create_predefs\n\n # Get hold of the URL for the target AC\n target = @config[:target_AC]\n\n ## puts\n ## puts \"Cmdline: #{ARGV.inspect}\"\n ## puts \"Config : #{@config.inspect}\"\n ## puts\n\n # Load all definitions (given by config file and command line)\n @config['def_dirs' ].each { |d| load_def_dir(d) } if @config['def_dirs' ]\n @config['def_files'].each { |f| load_def_file(f) } if @config['def_files']\n\n ## puts \"AppDefs 1: #{$app_defs.inspect}\"\n ## puts \"DevDefs 1: #{$dev_defs.inspect}\"\n ## puts \"UseDefs 1: #{$use_defs.inspect}\"\n ## puts \"ScnDefs 1: #{$scn_defs.inspect}\"\n ## puts \"MixDefs 1: #{$mix_defs.inspect}\"\n ## puts\n\n # Verify that the data looks reasonable and hook up refs\n $app_defs.each { |x,y| TestDef_App.find_inst(x).check_def() }\n $dev_defs.each { |x,y| TestDef_Dev.find_inst(x).check_def() }\n $use_defs.each { |x,y| TestDef_Use.find_inst(x).check_def() }\n $scn_defs.each { |x,y| TestDef_Scn.find_inst(x).check_def() }\n $mix_defs.each { |x,y| TestDef_Mix.find_inst(x).check_def() }\n $inf_defs.each { |x,y| TestDef_Inf.find_inst(x).check_def() }\n\n ## puts \"AppDefs 2: #{$app_defs.inspect}\"\n ## puts \"DevDefs 2: #{$dev_defs.inspect}\"\n ## puts \"UseDefs 2: #{$use_defs.inspect}\"\n ## puts \"ScnDefs 2: #{$scn_defs.inspect}\"\n ## puts \"MixDefs 2: #{$mix_defs.inspect}\"\n ## puts\n\n # Create an instance of the executor class\n @executor = STAC::StressTestExec.new(config, logger, target)\n\n # Enable tracing if desired\n #@executor.trace = $verbose ? true : false\n\n # Do a quick sanity check on the target URL (unless this is a dry run)\n if not @config['dry_run_plan']\n turl = \"http://\" + target\n if verify_target_URL(turl)\n puts \"Please check your target URL and Cloud Foundry setup\"\n exit 1\n end\n\n # Make sure we can login using the supplied creds\n au = @config['ac_admin_user']\n ap = @config['ac_admin_pass']\n\n begin\n begin\n @executor.register_internal(turl, au, ap)\n rescue\n end\n atok = @executor.login_internal(turl, au, ap)\n rescue => e\n if not e.kind_of? RuntimeError or e.to_s != \"login failed\"\n puts \"ERROR: Exception from login: #{e.to_s}\"\n end\n puts \"ERROR: could not login as admin user \\'#{au}\\', please check the creds\"\n exit 1\n end\n\n # Create the basic authorization header\n auth = { 'AUTHORIZATION' => atok.to_s }\n\n # Verify that we can create a user, then login and and proxy that user\n test_user = (@config['unique_stacid'] || \"\") + \"ac-test-probe-user@vmware.com\"\n test_pass = \"random\"\n have_user = false\n\n begin\n # Create a user account with a name that hopefully is unique to us\n begin\n @executor.register_internal(turl, test_user, test_pass)\n rescue => e\n @logger.error(\"Could not register a test user, please check remote admin: #{e.inspect}\")\n exit 1\n end\n\n # Make sure we delete this user no matter what happens below\n have_user = true\n\n # Login the user we just created\n begin\n @executor.login_internal(turl, test_user, test_pass)\n rescue => e\n @logger.error(\"Could not login a test user, please check remote admin: #{e.inspect}\")\n exit 1\n end\n\n # Create an auth header with the user as being proxied\n aprx = auth.dup\n aprx['PROXY-USER'] = test_user\n\n # Try to do something (anything) with the user proxied\n begin\n alst = @executor.get_apps_internal(turl + \"/apps\", aprx)\n # get_apps_internal() returns an array when things work correctly\n throw \"bad response\" unless alst and alst.kind_of? Array\n rescue => e\n @logger.error(\"Could not proxy a test user, please make sure #{au} is an admin: #{e.inspect}\")\n exit 1\n end\n\n # Done with the test user - the 'ensure' clause below will clean up\n ensure\n begin\n @executor.delete_user_internal(turl, test_user, auth) if have_user\n rescue => e\n puts \"WARNING: could not delete test user account #{test_user} - #{e.inspect}\"\n end\n end\n end\n\n # Figure out which test mix we're supposed to run\n test = @config['what_to_run']\n if test\n # Lookup the test(s) in the table\n tdef = []\n test.each do |key,val|\n tchk = $mix_defs[key]\n if not tchk\n puts \"ERROR: The specified test mix \\'#{test}\\' is not defined\"\n exit\n end\n tdef << tchk\n end\n else\n # No test specified - if there is exactly one test defined, use it\n if $mix_defs.length != 1\n puts \"ERROR: please select a test mix to run via command-line options;\"\n puts \" here are the available test mixes that have been defined:\"\n puts\n $mix_defs.each do |id,df|\n puts \" #{id}\"\n end\n exit\n end\n tdef = [ $mix_defs[0] ]\n end\n\n # Figure out the base URI for apps\n ha = target.split('.')\n ha.shift\n @apps_uri = ha.join('.')\n\n # Initialize the global test state / environment\n global_state = {\n :target_AC => target,\n :apps_URI => @apps_uri,\n :time_scaling => @config['time_scaling'] ? @config['time_scaling'] : 1\n }\n\n @max_clock = 0\n\n # Compute an estimate of the total number of users / scenarios; also,\n # equalize scenario running times (if enabled).\n #\n # We do this in two passes - the first pass computes the duration of\n # the longest-running scenario, and the second pass then stretches\n # any scenarios that are too short to match the longest one.\n max_sctm = 0\n tot_usrs = 0\n tot_scns = 0\n 2.times do |pass|\n tot_usrs = tot_scns = 0\n tdef.each do |mdef|\n mdef.mixes.each do |userset|\n uc = userset[:count]\n userset[:mix].each do |mixdef|\n # Add to the running user / scenario totals\n frac = mixdef[:frac] ? mixdef[:frac].to_i : 100\n scns = mixdef[:scns]\n tot_scns += scns.length * (uc * frac / 100)\n\n # That's all unless we're equalizing\n next unless @config['equalize_sctm']\n\n # Check all the scenario durations\n scns.each do |scn|\n scen = scn[:scen]\n sctm = scen.tot_time\n\n # Don't bother to scale infinity\n next if sctm == INFINITY\n\n # In the first pass we simply compute the max duration\n if pass == 0\n max_sctm = sctm if max_sctm < sctm\n else\n # Second pass: stretch scenario if appropriate\n scen.stretch_time(max_sctm) if sctm < max_sctm\n end\n end\n end\n tot_usrs += uc\n end\n end\n\n @logger.debug(\"Longest scenario is #{max_sctm} seconds\") if pass == 0\n\n # Don't bother with a second pass if we're not equalizing\n break unless @config['equalize_sctm']\n end\n\n @logger.info(\"Test defines #{tot_usrs} users and #{tot_scns} user/scenario combos\")\n puts(\"Test defines #{tot_usrs} users and #{tot_scns} user/scenario combos\")\n\n # We'll set the following flag if we have any infinite scenarios\n @have_inf = false\n\n # Generate action sequences for each test mix we're supposed to run\n usrs = 0\n tdef.each_with_index do |mdef, mnum|\n logger.debug(\"Starting test mix \\'#{mdef.id}\\' from #{mdef.srcf}\")\n\n # Make a unique copy of the test state / environment\n state = global_state.dup\n state[:test_mix_num] = mnum\n state[:test_mix_def] = mdef\n\n logger.debug(\" [#{STAC::act_prefix(0, state)}] >>vmc target #{target}\")\n\n # For each user set, invoke their mixes\n ucnt = 0\n mdef.mixes.each_with_index do |userset, usernum|\n # Make a unique copy of the state for this userset\n ustat = state.dup\n ustat[:user_set_num] = usernum\n ustat[:user_set_def] = userset\n\n run_user_set(ustat, tot_usrs, tot_scns, userset, ucnt)\n\n ucnt += userset[:count]\n usrs += userset[:count]\n end\n\n logger.debug(\"Finished test mix \\'#{mdef.id}\\'\")\n end\n\n # If at least one scenario is infinite, we better have a time limit\n if @have_inf and not @config['max_runtime']\n puts \"ERROR: infinite scenarios present and no time limit set\" ; exit\n end\n\n # At this point all the action queues should be filled and ready\n queue = ActionQueue.merge_queues\n\n # Get the health reporting subsystem started, if desired\n if @config['health_intvl'] > 0 and @config['nats_server'] and not @config['dry_run_plan']\n @nats_inited = false\n @components = {}\n Thread.new do\n nats = @config['nats_server']\n nats = \"nats://\" + nats unless nats[0, 7] == \"nats://\"\n begin\n logger.info(\"Logging into NATS server \\'#{nats}\\'\")\n NATS.start(:uri => nats) do\n # Tell the main thread that we're connected now\n @nats_inited = true\n\n # Watch for new components\n NATS.subscribe('vcap.component.announce') do |msg|\n component_discover(msg)\n end\n\n # Keep endpoint around for subsequent pings\n inbox = NATS.create_inbox\n NATS.subscribe(inbox) { |msg| component_discover(msg) }\n\n # Ping for status/discovery immediately and then at timer ticks\n ping = proc { NATS.publish('vcap.component.discover', '', inbox) }\n ping.call\n EM.add_periodic_timer(30) { ping.call }\n\n EM.add_timer(@config['health_intvl']) do\n components_poll\n EM.add_periodic_timer(@config['health_intvl']) { components_poll }\n end\n end\n rescue => e\n puts \"FATAL: could not connect to NATS server #{nats} -- #{e.inspect}\"\n exit!\n end\n end\n # Wait for NATS to get connected before proceeding\n while not @nats_inited; sleep(0.1) ; end\n end\n\n logger.info(\"Estimated ending clock: #{@max_clock} sec\")\n puts(\"Estimated ending clock: #{@max_clock} sec\")\n\n # Ready to start executing the actions in the queue\n begin\n @executor.execute_plan(queue, @config['dry_run_plan'],\n usrs,\n StressTestRunner.max_unique_index)\n rescue => e\n logger.error(\"Plan execution threw #{e.inspect}\\n#{e.backtrace.join(\"\\n\")}\")\n end\n\n logger.info(\"STAC test run ended (#{usrs} total devs)\")\n exit\n end",
"title": ""
},
{
"docid": "b0949eb509652f5ccc581d9beb5e8a53",
"score": "0.64597476",
"text": "def test_run\n obj = MockCommandObject.new\n assert_equal(:not_executed, obj.status)\n obj.run\n assert(obj.executed?)\n assert(obj.run?)\n assert_equal(:success, obj.status)\n end",
"title": ""
},
{
"docid": "a9f4c2a19b80ba89e2afaa1cdd14095b",
"score": "0.64551926",
"text": "def test_case; end",
"title": ""
},
{
"docid": "a9f4c2a19b80ba89e2afaa1cdd14095b",
"score": "0.64551926",
"text": "def test_case; end",
"title": ""
},
{
"docid": "83cd2d0166b4208153845ff365ca35d8",
"score": "0.6448767",
"text": "def handle(filename)\n \n \n puts \"=> #{self.class} running test for #{filename}\" if Bolt.verbose?\n \n if reload(filename)\n test_files = translate(filename) \n return if test_files == []\n \n puts \"==== #{self.class} running: #{ test_files.join(', ')} ====\"\n \n run(test_files)\n \n puts \"==== #{self.class} completed run ====\"\n end\n end",
"title": ""
},
{
"docid": "13c3a09954f837711ecb5be05379a05d",
"score": "0.64399606",
"text": "def run_test(cycles) \n @connection.run_test(cycles)\n end",
"title": ""
},
{
"docid": "66d4d24b74a58c6ee7908977c66843c7",
"score": "0.64325917",
"text": "def execute(src_code, input)\n client = IdeoneClient.new(APP_CONFIG['ideone']['user'], APP_CONFIG['ideone']['password'])\n begin\n link = client.run_code(src_code, input)\n results = client.get_code_results(link)\n rescue => e \n Rails.logger.error(\"Couldn't reach the IDEClient to perform a unit test. Returning {} as the result.\")\n Rails.logger.error(e.message)\n {}\n end\n end",
"title": ""
},
{
"docid": "9cb53983e8b4c8a5ffaf76cb204157d4",
"score": "0.6430105",
"text": "def run_test(test)\n path, _, _ = test\n adapter = Adapters::Adapter.for(path)\n adapter.run_test(test)\n end",
"title": ""
},
{
"docid": "759adb30b328ec7ff70c6d0110b62d9f",
"score": "0.642794",
"text": "def test\n\t\tputs 'TEST'\n\tend",
"title": ""
},
{
"docid": "21fd98d4ae42d5038c06b804b8435d78",
"score": "0.6425605",
"text": "def run\n ok\n end",
"title": ""
},
{
"docid": "21fd98d4ae42d5038c06b804b8435d78",
"score": "0.6425605",
"text": "def run\n ok\n end",
"title": ""
},
{
"docid": "21f3ab5304735fac1b5ee717ee4e068c",
"score": "0.64237946",
"text": "def test_test\n end",
"title": ""
},
{
"docid": "9c245fa9aac3be5a9aba915319f2ff47",
"score": "0.64161915",
"text": "def run\n log.info \"Running test #{test_name}\"\n unless skip_build\n setup_results_dir\n build\n end\n Dir.chdir(test_file.dirname) do\n system(\n { \"AYTESTS_WORK_DIR\" => work_dir.to_s, \"AYTESTS_PROVIDER\" => provider.to_s },\n \"rspec #{test_file.basename}\"\n )\n end\n end",
"title": ""
},
{
"docid": "e53ae4d24027e2eda64d280b1de19b29",
"score": "0.64100444",
"text": "def set_testresult\n\n end",
"title": ""
},
{
"docid": "396dbb411604be19502a73a605ca22e1",
"score": "0.6406435",
"text": "def run_script\n puts `#{@test_file}`\n $CHILD_STATUS.exitstatus.nonzero? ? 'failure' : 'success'\n end",
"title": ""
},
{
"docid": "8c57500e04f8365278f59e771433b778",
"score": "0.63911",
"text": "def run_tests(resolver)\n @logger.update line_item(resolver.class.demodulized_name, resolver.current_branch,'TESTING','0','-')\n \n resolver.class.before_filters(:test).each{|p| p.call}\n resolver.test!{|pct| \n @logger.update line_item(resolver.class.demodulized_name, resolver.current_branch,'TESTING',pct.to_s,'-')\n }\n resolver.class.after_filters(:test).each{|p| p.call}\n end",
"title": ""
},
{
"docid": "1c95c490a893caaaf40e9b856ac246ec",
"score": "0.63595706",
"text": "def execute_internal(result)\n result.info(TEST_INFO_STRING) \n result.debug(TEST_DEBUG_STRING)\n ActionCommand.execute_child(self, HelloWorldCommand, result, 1, name: 'Chris') \n result[:test_out] = TEST_OUTPUT\n end",
"title": ""
},
{
"docid": "1bdc0d7c25d9186a24d46646c7490b0d",
"score": "0.6358904",
"text": "def run_test(test_object, cmd=nil)\n # @uri, @runOptions, @runId, @runCount\n ENV[\"AUTOTEST\"] = \"1\" if $stdout.tty?\n trap_interrupt\n @results = nil\n\n temp_file = Tempfile.new('test_run')\n #Pass in dat_pages config object?\n # id used for screen shots\n # this is leveraged by the cucumber hooks to record the presents of screen shots\n screen_shot_id = \"#{test_object.screenShotId}-#{test_object.runCount}\"\n\n if cmd.nil?\n _options = ''\n\n begin #TODO: need to rewrite this to be more useful\n test_object.runOptions.each do |option|\n _options += \" #{option}\" unless option.start_with?('.')\n end\n\n rescue => e\n puts 'there was an error'\n puts e\n puts e.backtrace\n end unless test_object.runOptions.nil?\n\n @io = Object::IO.popen(\"bundle exec cucumber #{test_object.uri} #{_options} -f json --out #{temp_file.path} SCREEN_SHOT_ID=#{screen_shot_id}\")\n Process.wait2(@io.pid)\n @results = process_temp_file(temp_file)\n else\n #TODO - this is setup for allowing the user to pass in a command to run. This allows someone to use something like thor to parameterize tasks\n #and run them in dat_sauce. The problem here is that this implementation is calling a parameter specific to thor. This should probably\n #be pushed into custom definable tasks similar to the Cucumber::Rake::Task that cucumber has implemented for rake.\n #I am doing it like this for the moment to save on time and will come back to re-implement this correctly at a later date.\n @io = Object::IO.popen(\"#{cmd} --file #{test_object.uri} --output_type json --output_file #{temp_file.path}\")\n\n begin\n Process.wait2(@io.pid)\n rescue\n nil\n end\n @results = process_temp_file temp_file\n end\n\n if @results.empty? && @stopped\n @results = {'message' => 'stopped', 'status' =>'stopped'}\n elsif @results.empty? && !@stopped\n @results = {'test' =>test_object.uri, 'message' => \"unknown error. Output: #{@results}\", 'status'=>'failed'}\n else\n begin\n @results = JSON.parse(@results)\n rescue JSON::ParserError\n @results = {'test'=>test_object.uri, 'message' => \"JSON parse error. Output: #{@results}\", 'status'=>'failed'}\n end\n end\n @results\n end",
"title": ""
},
{
"docid": "1068832c8229c37488788b46a0871f26",
"score": "0.6346774",
"text": "def testing\n end",
"title": ""
},
{
"docid": "4b29fbc54d4f7408b4f328350fc9e00d",
"score": "0.6332914",
"text": "def test_should_do_stuff\n\t\t\n\tend",
"title": ""
},
{
"docid": "12f4a4da326bfdca0bc73f1066f9089c",
"score": "0.6322025",
"text": "def test(args)\n @commands << \"test #{args}\"\n end",
"title": ""
},
{
"docid": "58bf7e46f83cf786d48d8dc159a477ad",
"score": "0.6312366",
"text": "def evaluate_test(step)\n advise!(:before_test, step)\n begin\n advise!(:test, step) # name ?\n evaluate_matchers(step)\n evaluate_example(step)\n rescue *FORCED_EXCEPTIONS\n raise\n rescue SystemExit # TODO: why pass on SystemExit ?\n advise!(:pass, step)\n #rescue Assertion => exception\n # advise!(:fail, step, exception)\n rescue Exception => exception\n if exception.assertion?\n advise!(:fail, step, exception)\n else\n advise!(:error, step, exception)\n end\n else\n advise!(:pass, step)\n ensure\n advise!(:after_test, step)\n end\n end",
"title": ""
},
{
"docid": "2adf879f56fd71c81d677989bbc0beb4",
"score": "0.63102806",
"text": "def testTest\n execTest('Libraries/Basic', [ '-n' ], 'ReleaseInfo_Test.rb') do |iReleaseDir, iReleaseInfo|\n checkReleaseInfo(iReleaseDir, iReleaseInfo)\n checkReleaseNotes(iReleaseDir, iReleaseInfo)\n assert(File.exists?(\"#{iReleaseDir}/Release/MainLib.rb\"))\n assert(File.exists?(\"#{iReleaseDir}/Release/Test.rb\"))\n end\n end",
"title": ""
},
{
"docid": "e271ccebc44357caab0efe59d1b052f4",
"score": "0.6308849",
"text": "def run_test()\n begin\n\n rescue\n # `$!' has the last exception object\n print \"Error! : \" + $!.message + \"\\n\"\n print \"--- Backtrace ---\\n\"\n $!.backtrace.each do |tracemes|\n print tracemes + \"\\n\"\n end\n end\n end",
"title": ""
},
{
"docid": "d138925310c4c23ac56a4699ab1aec8f",
"score": "0.6307254",
"text": "def run(tests, dependencies)\n raise 'Not implemented'\n end",
"title": ""
},
{
"docid": "14f09e5812975f51f172980fcb51ace0",
"score": "0.6304967",
"text": "def run_interactive_tests\n run_tests('test/system')\n end",
"title": ""
},
{
"docid": "b444d3b124e95f28fe687b808563adc4",
"score": "0.63022393",
"text": "def run_fe_tests\n end",
"title": ""
},
{
"docid": "f311f458488fe72a875a01fdb96476e7",
"score": "0.63007647",
"text": "def test\n install_gems\n run_before_scripts\n run_scripts\n\n fail 'Some tests failed!' unless @passed\n\n puts 'All tests passed!'\n end",
"title": ""
},
{
"docid": "3f280c87fe3f8e9fdf293a6a5315df33",
"score": "0.62976205",
"text": "def test_step; end",
"title": ""
},
{
"docid": "3f280c87fe3f8e9fdf293a6a5315df33",
"score": "0.62976205",
"text": "def test_step; end",
"title": ""
},
{
"docid": "3f280c87fe3f8e9fdf293a6a5315df33",
"score": "0.62976205",
"text": "def test_step; end",
"title": ""
},
{
"docid": "3f280c87fe3f8e9fdf293a6a5315df33",
"score": "0.62976205",
"text": "def test_step; end",
"title": ""
},
{
"docid": "1430a7bc203e759dfa1797ac52267981",
"score": "0.6294191",
"text": "def test(command)\n run(command, :test => true)\n end",
"title": ""
},
{
"docid": "b16738224a01149876e65234c9a9204a",
"score": "0.62910205",
"text": "def run\n tests.each do |test|\n test.run\n Reporter.print_single_test_result(test)\n end\n end",
"title": ""
},
{
"docid": "dd825adc26182072111cd16c5f10ba6e",
"score": "0.6289997",
"text": "def test_053\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Task setting page\n open(\"/task/add_task2/#{@@pu.id}/#{@@pj.id}\")\n wait_for_page_to_load \"30000\"\n\n #Execution setting tab\n click $xpath[\"misc\"][\"execution_setting_tab\"]\n sleep 4\n # The setup information of contents QAC++ of a total of five text area is replaced.\n select \"tool_name\", \"label=qacpp\"\n assert !60.times{ break if (\"qacpp \" + _(\"setting\") == get_text(\"target_tool\") rescue false); sleep 1 }\n assert_equal @@pj.analyze_configs[1].make_options||'', get_value(\"make_options\")\n assert_equal @@pj.analyze_configs[1].environment_variables||'', get_value(\"environment_variables\")\n assert_equal @@pj.analyze_configs[1].header_file_at_analyze||'', get_value(\"header_file_at_analyze\")\n assert_equal @@pj.analyze_configs[1].analyze_tool_config||'', get_value(\"analyze_tool_config\")\n assert_equal @@pj.analyze_configs[1].others||'', get_value(\"others\")\n sleep 4\n\n\n #logout\n logout\n\n end",
"title": ""
},
{
"docid": "c966ad5aa43c5de2633e5e3695c0d066",
"score": "0.62874824",
"text": "def perform_tests(&block)\n suite = self\n @model.exec {\n suite.tests.each do |ident|\n t = suite.test(ident)\n yield t\n end\n }\n end",
"title": ""
},
{
"docid": "5760ab1e509d9ed154237cb14db3d358",
"score": "0.62874013",
"text": "def test_0000_Search_Prep\n \n sTestCase_Name = \"test_0000_Search_Prep\"\n puts2(\"\\nStarting Testcase: #{sTestCase_Name}\")\n \n \n begin\n \n # Minimize the Ruby Console window\n minimize_ruby_console()\n \n # Only run this if no other logger has been started\n if($logger.class == NilClass)\n # Create a Global logger object for use by all tests launched from this testsuite\n $logger = capture_results()\n end\n \n # Only run this if no other test has previously displayed the Test environment information\n if($bDisplayTestEnv.class == NilClass)\n \n # Set the global flag so other tests won't display this info\n $bDisplayTestEnv = true\n \n # Display information on the test tools\n display_ruby_env()\n display_watir_env()\n display_watirworks_env()\n \n # TODO - Remove or replace\n # Display information on the browser executing the test\n #display_browser_env()\n \n if(is_win?)\n puts2(\"Registered IE version: \" + get_registered_ie_version)\n puts2(\"Registered Firefox version: \" + get_registered_firefox_version)\n end\n \n end\n \n # Only run this if no other test has read in the Common data from the workbooks\n if($hWorkbook_Data.class == NilClass)\n \n sWorkbook_Name = \"../examples/search/data/RunControl_Data.xls\"\n aSpreadsheet_List = [\"Environment\", \"Urls\", \"SearchTerms\", \"RunControl\"]\n \n # TODO - Replace with parse_workbook\n # Read the Test control workbook into a Hash of -Sheet Arrays of - Column data Hashes of - STRING of data\n $hWorkbook_Data = parse_workbook(sWorkbook_Name, aSpreadsheet_List)\n #$hWorkbook_Data = parse_workbook_xls(sWorkbook_Name, aSpreadsheet_List)\n \n # Split the Workbook Hash of - Sheet Arrays of- Column data Hashes - into separate Arrays by Sheet\n $aSpreadsheet_ENV = $hWorkbook_Data[\"Environment\"]\n $aSpreadsheet_URL = $hWorkbook_Data[\"Urls\"]\n $aSpreadsheet_TERMS = $hWorkbook_Data[\"SearchTerms\"]\n $aSpreadsheet_CONTROL = $hWorkbook_Data[\"RunControl\"]\n \n # Find the setting of the Environment to run the test within\n #\n # Pull the Hashed Column data from the Sheet Array\n $aSpreadsheet_ENV.each do | hRow_ofData |\n # Parse the Environment setting from the \"ENV\" column within the first row of data on the spreadsheet\n $sExecution_Env = hRow_ofData[\"ENV\"]\n puts2(\"Running from the environment - #{$sExecution_Env}\")\n end # Find the setting of the Environment to run the test within\n \n # Find the Row of data matching the Execution Environment (The Row data is in a HASH)\n $aSpreadsheet_URL.each do | hRow_ofData |\n # Find the row by looking under the \"ENV\" Column for a setting matches the execution environment setting\n if(hRow_ofData[\"ENV\"] == $sExecution_Env)\n # Get the Url setting in the matching row from the Column ACCESS_URL\n $sAccessURL = hRow_ofData[\"ACCESS_URL\"]\n end\n end # Find the Row of data matching the Execution Environment\n \n end # Only run this if no other test has read in the Common data from the workbooks\n \n rescue => e\n \n puts2(\"*** ERROR Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\n \n raise(\"*** TESTCASE - #{sTestCase_Name}\")\n \n ensure\n \n end\n end",
"title": ""
},
{
"docid": "0dd0f7830a9a0b1151fa537122eeb7bf",
"score": "0.628666",
"text": "def test_051\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Task setting page\n open(\"/task/add_task2/#{@@pu.id}/#{@@pj.id}\")\n wait_for_page_to_load \"30000\"\n\n #Execution setting tab\n click $xpath[\"misc\"][\"execution_setting_tab\"]\n sleep 4\n # The message which tells renewal of an execution setup is displayed on the screen upper left.\n type \"make_options\", \"options\"\n #Click save a setup button\n click $xpath[\"misc\"][\"save_a_setup_button\"]\n sleep 4\n assert get_text(\"log_contents\").include?(_(\"Execution setting was updated.\"))\n\n\n\n #logout\n logout\n\n end",
"title": ""
},
{
"docid": "110585d53036a8fd33d558ea200e6d23",
"score": "0.62854445",
"text": "def run\n test_code_dir = File.join(CODE_DIR, id)\n result_dir = File.join(RESULT_DIR, \"#{id}\")\n\n Dir.mkdir(result_dir) unless File.exist?(result_dir)\n $log_file = File.join(result_dir,\n \"#{Time.now.strftime(\"%Y%m%d\")}.log\")\n\n file = File.new($log_file, \"w\") || File.open($log_file, \"w+\")\n file.puts(\"#\" * 80)\n file.puts(\"# Test suite: %-55s #\" % id)\n file.puts(\"# Test item: %-55s #\" % description)\n file.puts(\"# Total test cases: %-55s #\" % size)\n file.puts(\"# Test date: %-55s #\" % Time.now.strftime(\"%Y-%m-%d\"))\n file.puts(\"#\" * 80)\n file.close\n\n Dir.glob(File.join(test_code_dir,\"test_#{id.downcase}*.rb\")) do |f|\n require f if f != \"test_#{id.downcase}_setup.rb\"\n end\n end",
"title": ""
},
{
"docid": "fb67f65da35c9aa2735571d0b7cc4063",
"score": "0.6282675",
"text": "def test\n Bird.dostuff\n ok \"running main\"\n end",
"title": ""
},
{
"docid": "479f77ca3be18f5e1fd4be6dbff61abf",
"score": "0.6276027",
"text": "def run_test\n logger.info(\"Starting stress test run\")\n\n # Create the pre-defined \"info\" actions\n #FactInst_Inf.create_predefs\n\n # Get hold of the URL for the target AC\n target = @config[:target_AC]\n\n ## puts\n ## puts \"Cmdline: #{ARGV.inspect}\"\n ## puts \"Config : #{@config.inspect}\"\n ## puts\n\n # Load all definitions (given by config file and command line)\n #@config['def_dirs' ].each { |d| load_def_dir(d) } if @config['def_dirs' ]\n #@config['def_files'].each { |f| load_def_file(f) } if @config['def_files']\n \n @config['def_dirs3' ].each { |d| load_def_dir_new(d) } if @config['def_dirs3' ]\n\n ## puts \"AppDefs 1: #{$app_defs.inspect}\"\n ## puts \"DevDefs 1: #{$dev_defs.inspect}\"\n ## puts \"UseDefs 1: #{$usr_defs.inspect}\"\n ## puts \"ScnDefs 1: #{$scn_defs.inspect}\"\n ## puts \"MixDefs 1: #{$mix_defs.inspect}\"\n ## puts\n\n # Verify that the data looks reasonable and hook up refs\n # Actually, y = TestDef_App.find_inst(x) # Add by Jacky\n #$app_defs.each { |x,y| TestDef_App.find_inst(x).makeup_def() }\n #$dev_defs.each { |x,y| TestDef_Dev.find_inst(x).makeup_def() }\n #$usr_defs.each { |x,y| TestDef_Usr.find_inst(x).makeup_def() }\n #$scn_defs.each { |x,y| TestDef_Scn.find_inst(x).makeup_def() }\n #$mix_defs.each { |x,y| TestDef_Mix.find_inst(x).makeup_def() }\n #$inf_defs.each { |x,y| TestDef_Inf.find_inst(x).makeup_def() }\n\n ## puts \"AppDefs 2: #{$app_defs.inspect}\"\n ## puts \"DevDefs 2: #{$dev_defs.inspect}\"\n ## puts \"UseDefs 2: #{$usr_defs.inspect}\"\n ## puts \"ScnDefs 2: #{$scn_defs.inspect}\"\n ## puts \"MixDefs 2: #{$mix_defs.inspect}\"\n ## puts\n\n # Create an instance of the executor class\n @executor = StressTestExec.new(config, logger, target)\n\n # Enable tracing if desired\n #@executor.trace = $verbose ? true : false\n\n # Do a quick sanity check on the target URL (unless this is a dry run)\n if not @config['dry_run_plan'] and not @config['http_url']\n turl = \"http://\" + target\n if verify_target_URL(turl)\n puts \"Please check your target URL and Cloud Foundry setup\"\n exit 1\n end\n\n # Make sure we can login using the supplied creds\n au = @config['ac_admin_user']\n ap = @config['ac_admin_pass']\n\n begin\n begin\n @executor.register_internal(turl, au, ap)\n rescue\n end\n atok = @executor.login_internal(turl, au, ap)\n rescue => e\n if not e.kind_of? RuntimeError or e.to_s != \"login failed\"\n puts \"ERROR: Exception from login: #{e.to_s}\"\n end\n puts \"ERROR: could not login as admin user \\'#{au}\\', please check the creds\"\n exit 1\n end\n\n # Create the basic authorization header\n auth = { 'AUTHORIZATION' => atok.to_s }\n\n # Verify that we can create a user, then login and and proxy that user\n test_user = (@config['unique_stacid'] || \"\") + \"ac-test-probe-user@vmware.com\"\n test_pass = \"random\"\n have_user = false\n\n begin\n # Create a user account with a name that hopefully is unique to us\n begin\n @executor.register_internal(turl, test_user, test_pass)\n rescue => e\n @logger.error(\"Could not register a test user, please check remote admin: #{e.inspect}\")\n exit 1\n end\n\n # Make sure we delete this user no matter what happens below\n have_user = true\n\n # Login the user we just created\n begin\n @executor.login_internal(turl, test_user, test_pass)\n rescue => e\n @logger.error(\"Could not login a test user, please check remote admin: #{e.inspect}\")\n exit 1\n end\n\n # Create an auth header with the user as being proxied\n aprx = auth.dup\n aprx['PROXY-USER'] = test_user\n\n # Try to do something (anything) with the user proxied\n begin\n alst = @executor.get_apps_internal(turl + \"/apps\", aprx)\n # get_apps_internal() returns an array when things work correctly\n throw \"bad response\" unless alst and alst.kind_of? Array\n rescue => e\n @logger.error(\"Could not proxy a test user, please make sure #{au} is an admin: #{e.inspect}\")\n exit 1\n end\n\n # Done with the test user - the 'ensure' clause below will clean up\n ensure\n begin\n @executor.delete_user_internal(turl, test_user, auth) if have_user\n rescue => e\n puts \"WARNING: could not delete test user account #{test_user} - #{e.inspect}\"\n end\n end\n end\n\n # Figure out which test mix we're supposed to run\n if @config['http_url']\n ActionQueueManager.assemble_action_queue(:stac_mix_simple_http_load)\n else\n #ActionQueueManager.assemble_action_queue(@config['what_to_run'])\n ActionQueueManager.assemble_action_queue(:stac_mix_simple_sinatra)\n end\n PriorityQueueManager.prioritize(ActionQueueManager.get_queue)\n @executor.simulate\n exit\n end",
"title": ""
},
{
"docid": "ec92cf298996eceef513951cd6938ea2",
"score": "0.6266043",
"text": "def test_ok\n assert true\n end",
"title": ""
},
{
"docid": "71ef4c638071749f14e8c18c1f0d02b0",
"score": "0.625988",
"text": "def test!(*args)\n context.test *args\n end",
"title": ""
},
{
"docid": "a37a3e8a174053c350332cefa4252a36",
"score": "0.6252224",
"text": "def test_001\n assert true\n end",
"title": ""
},
{
"docid": "3c13da7bea6fb71dbd8c80542b62abe2",
"score": "0.6251871",
"text": "def run(result)\r\n return if @method_name.to_s == \"default_test\"\r\n\r\n if using_mocha = respond_to?(:mocha_verify)\r\n assertion_counter_klass = if defined?(Mocha::TestCaseAdapter::AssertionCounter)\r\n Mocha::TestCaseAdapter::AssertionCounter\r\n else\r\n Mocha::Integration::TestUnit::AssertionCounter\r\n end\r\n assertion_counter = assertion_counter_klass.new(result)\r\n end\r\n\r\n yield(Test::Unit::TestCase::STARTED, name)\r\n @_result = result\r\n begin\r\n begin\r\n run_callbacks :setup\r\n setup\r\n __send__(@method_name)\r\n mocha_verify(assertion_counter) if using_mocha\r\n rescue Mocha::ExpectationError => e\r\n add_failure(e.message, e.backtrace)\r\n rescue Test::Unit::AssertionFailedError => e\r\n add_failure(e.message, e.backtrace)\r\n rescue Exception => e\r\n raise if PASSTHROUGH_EXCEPTIONS.include?(e.class)\r\n add_error(e)\r\n ensure\r\n begin\r\n teardown\r\n run_callbacks :teardown, :enumerator => :reverse_each\r\n rescue Test::Unit::AssertionFailedError => e\r\n add_failure(e.message, e.backtrace)\r\n rescue Exception => e\r\n raise if PASSTHROUGH_EXCEPTIONS.include?(e.class)\r\n add_error(e)\r\n end\r\n end\r\n ensure\r\n mocha_teardown if using_mocha\r\n end\r\n result.add_run\r\n yield(Test::Unit::TestCase::FINISHED, name)\r\n end",
"title": ""
},
{
"docid": "38f5bbd5626f16bc887b9b045d7504d8",
"score": "0.625015",
"text": "def test(*args)\n run!(:test, *args).success?\n end",
"title": ""
},
{
"docid": "38f5bbd5626f16bc887b9b045d7504d8",
"score": "0.625015",
"text": "def test(*args)\n run!(:test, *args).success?\n end",
"title": ""
},
{
"docid": "effaab967886d0edf96ff934fc3e51d1",
"score": "0.62479913",
"text": "def run_test(params)\n runner = get_runner(params)\n code = get_code_to_test(params)\n\n begin\n myfile = File.new('tmp_control.rb', 'w')\n myfile.puts(code)\n myfile.close\n runner.add_target('tmp_control.rb', 'new test suite')\n runner.run\n File.delete('tmp_control.rb')\n return runner.report\n rescue ArgumentError, RuntimeError, Train::UserError => e\n return 'ERROR: ' + e.message\n rescue StandardError => e\n return 'ERROR: ' + e.message\n end\n end",
"title": ""
},
{
"docid": "90cd64acb8244aa5b83bbd78285f5983",
"score": "0.62474346",
"text": "def test_case_run(args)\n return unless Inspector.site_selected?(@site, @console)\n return if Inspector.running_any?(@testers, @console)\n\n tcr = TestCaseRunner.new(@site, @console, @path_to, @site_mutex, @thread_manager)\n\n return unless tcr.select_test_case(args)\n\n return unless tcr.select_host\n\n return unless tcr.select_port_no\n\n return unless tcr.continue?\n\n tcr.run\n rescue Interrupt\n nil\n end",
"title": ""
},
{
"docid": "b18a1e60f10bfa30e8a7debd6f8abd8c",
"score": "0.6246018",
"text": "def testing\n\tend",
"title": ""
},
{
"docid": "06343c933fc2ca247bb64e167d2f090a",
"score": "0.6245165",
"text": "def execute(command, params={})\n @executor.execute(command, @testcase, params)\n end",
"title": ""
},
{
"docid": "f33aca67862d97a204ac3613d8770513",
"score": "0.6244106",
"text": "def run\n @feedback.pre_tests(self)\n @results = ciat_files.\n map { |ciat_file| create_test(ciat_file) }.\n map { |test| test.run }\n @feedback.post_tests(self)\n @results\n end",
"title": ""
},
{
"docid": "18b39c478bf14f970353f379b84a9470",
"score": "0.62441015",
"text": "def test_055\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Task setting page\n open(\"/task/add_task2/#{@@pu.id}/#{@@pj.id}\")\n wait_for_page_to_load \"30000\"\n\n #Execution setting tab\n click $xpath[\"misc\"][\"execution_setting_tab\"]\n sleep 4\n select \"tool_name\", \"label=qacpp\"\n sleep 4\n # The message which tells renewal of an execution setup is displayed on the screen upper left.\n type \"make_options\", \"options\"\n #Click save a setup button\n click $xpath[\"misc\"][\"save_a_setup_button\"]\n sleep 4\n assert get_text(\"log_contents\").include?(_(\"Execution setting was updated.\"))\n\n\n #logout\n logout\n\n end",
"title": ""
},
{
"docid": "ebca4b592d20977dedcd732e5e9760eb",
"score": "0.62356764",
"text": "def runTests(runAll, toRun)\r\n\t\tif @successfulLogin\r\n\t\t\tbegin\r\n\t\t\t\t@sfMeta.runTests(runAll, toRun, @sfApex.endpoint_url)\r\n\t\t\trescue Exception => exception\r\n\t\t\t\tlogException('runTests(' + runAll + ')', exception.message, exception.backtrace)\r\n\t\t\t\traise\t\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "607d23f7e5a35f0a4547cdd20864b062",
"score": "0.6234807",
"text": "def finish_test(test)\n end",
"title": ""
},
{
"docid": "68814b59bfd98d046ca0b1e6698009fb",
"score": "0.6220295",
"text": "def test_run_machine_classifier \n @processor.runMachineClassifier(@processor.accountList[0].user,\"project1/test/resources/data/other\") \n end",
"title": ""
},
{
"docid": "df5e7b88b33b694775bd86694369bedc",
"score": "0.62185913",
"text": "def testWithTest\n execTest('Libraries/Basic', [ '-n' ], 'ReleaseInfo_Test.rb') do |iReleaseDir, iReleaseInfo|\n checkReleaseInfo(iReleaseDir, iReleaseInfo)\n checkReleaseNotes(iReleaseDir, iReleaseInfo)\n assert(File.exists?(\"#{iReleaseDir}/Release/MainLib.rb\"))\n assert(File.exists?(\"#{iReleaseDir}/Release/Test.rb\"))\n end\n end",
"title": ""
},
{
"docid": "bacf3c803d14001c50defa02bb6d56e3",
"score": "0.62179387",
"text": "def run_test(test, result)\n test.run result do |type, name|\n case type\n when Test::Unit::TestCase::STARTED\n @num_failures = result.failure_count\n @num_errors = result.error_count\n when Test::Unit::TestCase::FINISHED\n if result.failure_count == @num_failures && result.error_count == @num_errors\n out name, success_color\n elsif result.error_count > @num_errors\n out name, error_color\n else\n out name, fail_color\n end\n end\n end\n end",
"title": ""
},
{
"docid": "fc841d34379fb54fb013478d120c27f9",
"score": "0.6213436",
"text": "def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # The master registered\n assert is_text_present(\"PJ: SamplePJ1\")\n click $xpath[\"task\"][\"master_control\"]\n assert !60.times{ break if (is_text_present(_(\"Master Administration\")) rescue false); sleep 1 }\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n\n # the existing task is diverted\n @@task = Task.find_by_pj_id(@@pj.id)\n click \"//tr[@id='task_id#{@@task.id}']\"\n assert !60.times{ break if (is_text_present(_(\"Action\")) rescue false); sleep 1 }\n sleep 5\n #The details of arbitrary tasks are expressed as an analysis task management page,\n #and it moves to the registration page of an analysis task from a reuse button.\n click $xpath[\"task\"][\"add_task\"]\n wait_for_text_present(_(\"Select Analysis Tools and Rule Level\"))\n # logout\n logout\n\n end",
"title": ""
},
{
"docid": "a29c18f7e5bf36b8dfb8ec2e56c7793e",
"score": "0.62122285",
"text": "def run(result)\n return if @method_name.to_s == \"default_test\"\n\n @_result = result\n @internal_data.test_started\n\n mocha_counter = retrieve_mocha_counter(self, result)\n yield(Test::Unit::TestCase::STARTED, name)\n yield(Test::Unit::TestCase::STARTED_OBJECT, self)\n\n begin\n begin\n run_callbacks :setup do\n setup\n __send__(@method_name)\n mocha_verify(mocha_counter) if mocha_counter\n end\n rescue Mocha::ExpectationError => e\n add_failure(e.message, e.backtrace)\n rescue Test::Unit::AssertionFailedError => e\n add_failure(e.message, e.backtrace)\n rescue Exception => e\n raise if ::ActiveSupport::Testing::SetupAndTeardown::ForClassicTestUnit::PASSTHROUGH_EXCEPTIONS.include?(e.class)\n add_error(e)\n ensure\n begin\n teardown\n run_callbacks :teardown\n rescue Mocha::ExpectationError => e\n add_failure(e.message, e.backtrace)\n rescue Test::Unit::AssertionFailedError => e\n add_failure(e.message, e.backtrace)\n rescue Exception => e\n raise if ::ActiveSupport::Testing::SetupAndTeardown::ForClassicTestUnit::PASSTHROUGH_EXCEPTIONS.include?(e.class)\n add_error(e)\n end\n end\n ensure\n mocha_teardown if mocha_counter\n end\n\n result.add_run\n @internal_data.test_finished\n\n yield(Test::Unit::TestCase::FINISHED, name)\n yield(Test::Unit::TestCase::FINISHED_OBJECT, self)\n end",
"title": ""
}
] |
d28b8afa78bde8bfbdfc0c7037eed9f4
|
gets list of achievement group IDs if no ID provided gets info for achievement group if provided ID
|
[
{
"docid": "9d7210401076ff83602a241f9becf784",
"score": "0.7709296",
"text": "def achievement_groups(id=nil)\n get_response(\"/v2/achievements/groups#{Utils.format_id(id)}\")\n end",
"title": ""
}
] |
[
{
"docid": "b27ef1926c8b030b7e31b51c70a4902a",
"score": "0.6715679",
"text": "def get_group_ids\n end",
"title": ""
},
{
"docid": "8193936344836f38a4820297f573acf1",
"score": "0.6635815",
"text": "def groups_list_id(options)\n request method: :get,\n url: @base_url + 'components/groups/' + options['id'].to_s\n end",
"title": ""
},
{
"docid": "5422f4098b879f40d8d4ab9bb12c9581",
"score": "0.66212636",
"text": "def get_group_by_id(id)\n $r.hgetall(\"group:#{id}\")\n end",
"title": ""
},
{
"docid": "4957c47566ac20f92b614cc8a9b3a425",
"score": "0.6438017",
"text": "def rbac_user_get_group_ids\n case @edit[:new][:group]\n when 'null', nil\n []\n when String\n @edit[:new][:group].split(',').delete_if(&:blank?).map(&:to_i).sort\n when Array\n @edit[:new][:group].map(&:to_i).sort\n end\n end",
"title": ""
},
{
"docid": "a823f065e23b65891239d869655d5de2",
"score": "0.6211732",
"text": "def group_gids\n groups.map(&:gid)\n end",
"title": ""
},
{
"docid": "a823f065e23b65891239d869655d5de2",
"score": "0.6211732",
"text": "def group_gids\n groups.map(&:gid)\n end",
"title": ""
},
{
"docid": "02fe748b4141cafe7e2ea5100d823f77",
"score": "0.6206261",
"text": "def groups\n group_ids.split(',').map do |gid|\n Ecore::Group.find(@user_id, :id => gid).receive\n end\n end",
"title": ""
},
{
"docid": "4b5e5963ac3a1f3d0dda212f563c0a71",
"score": "0.6182595",
"text": "def group_ids\n @client.listAllGroups[:groupIDs]\n end",
"title": ""
},
{
"docid": "b3a22fde0e136e52c5d202d5ea5985b2",
"score": "0.61809015",
"text": "def get_group_id\n groupname = String.new\n \n if @options[:dg]\n groupname = @options[:dn]\n elsif @options[:ag]\n groupname = @options[:an]\n else\n groupname = @options[:ng]\n end\n \n self.get_groups.each do |g|\n if groupname.strip.eql?(g['name'])\n return g['id']\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "c4e7ccb6437de7f26b4c0109e137d287",
"score": "0.61684966",
"text": "def get_groups\n `id -G #{name}`.split(' ').map {|g| Group.new(g.to_i)}\n end",
"title": ""
},
{
"docid": "a9eb9e88f02d8badb1808191518eb2bf",
"score": "0.61673224",
"text": "def group_ids\n groups.pluck(:id)\n end",
"title": ""
},
{
"docid": "c42e77c023bd0dc233a7cced242b681c",
"score": "0.6151213",
"text": "def groups\n @groups || fetch_groups\n end",
"title": ""
},
{
"docid": "6518f170445f626a28ddc5356bb271c9",
"score": "0.6114837",
"text": "def id_and_group_ids\n ((@group_ids && !@group_ids.empty?) ? \"#{@id},#{@group_ids}\" : @id)\n end",
"title": ""
},
{
"docid": "3676f8b776d2534b5132441a6a0465c6",
"score": "0.6078804",
"text": "def get_group_users(id)\n endpoint = '/groups'\n user_query = '?include=users'\n url = self.base_url.to_s + endpoint.to_s + \"/\" + id.to_s + self.format.to_s + user_query\n self.get_data(url)\n end",
"title": ""
},
{
"docid": "c17556237eeff29abb2ab7a137c1293e",
"score": "0.6075318",
"text": "def retrieve_groups(myapps,user)\n begin\n myapps.retrieve_groups(user).map { |list| list.group_id }\n rescue GDataError => e\n [\"Error: #{e.reason}\"]\n end\nend",
"title": ""
},
{
"docid": "34fd3f9415c2f2e7eccb71f092fee84e",
"score": "0.6041316",
"text": "def get_members_groups(id)\n get(\"/members/#{id}/groups\")\n end",
"title": ""
},
{
"docid": "4e12305a052051cd2b0d9e53a757b360",
"score": "0.60376745",
"text": "def group_leaders_by_group_id\n group_leaders = sf.client.query(\"SELECT Id, Email, FirstName, LastName, Group_Leader_del__c, SWC_User_ID__c, Group_del__r.SWC_Group_ID__c,\n Group_del__c FROM Contact WHERE Group_Leader_del__c = True AND SWC_User_ID__c <> null AND Group_del__c <> null AND Group_del__r.SWC_Group_ID__c = null\")\n\n leaders_by_group = group_leaders.each_with_object({}) do |leader, map|\n if leader&.Group_del__c.present? && leader.SWC_User_ID__c.present?\n map[leader.Group_del__c] = leader\n end\n end\n\n leaders_by_group\n end",
"title": ""
},
{
"docid": "04805c173c8d7d347cc00dae0f470086",
"score": "0.6015559",
"text": "def groups\n r = Skype.send_ :command => \"search groups hardwired\", :script_name => \"\"\n r.gsub!(/^\\D+/, \"\")\n group_ids = r.split \", \"\n groups = []\n group_ids.each do |id|\n groups << Group.new(id, Group.get_type(id))\n end\n groups\n end",
"title": ""
},
{
"docid": "55a3f3bb2e6ac7a072c7bdd91a3209e2",
"score": "0.60072666",
"text": "def get_group_by_id(id)\n endpoint = '/groups'\n url = self.base_url.to_s + endpoint.to_s + \"/\" + id.to_s + self.format.to_s\n response = self.get_data(url)\n end",
"title": ""
},
{
"docid": "306c4584b3957f7accbc7faeb089089d",
"score": "0.6004726",
"text": "def group(id)\n get(\"/groups/#{id}\")\n end",
"title": ""
},
{
"docid": "b6894ac3defd43d70730c4c1a31abb3c",
"score": "0.5988557",
"text": "def get_group_list(opts={})\n querymsg = JSON.parse(@authmsg.to_json)\n querymsg[:detail] = 1\n querymsg[:adom] = opts[:adom] ? opts[:adom] : 'root'\n\n begin\n exec_soap_query(:get_group_list,querymsg,:get_group_list_response,:group_detail)\n rescue Exception => e\n fmg_rescue(e)\n return e\n end\n end",
"title": ""
},
{
"docid": "50d0e9c58d3fda33b248d118dd7ccea8",
"score": "0.59803003",
"text": "def get_groups\n groups\n end",
"title": ""
},
{
"docid": "d18112ad9f83d35a8a9391313775a3c6",
"score": "0.5957354",
"text": "def groups_id_get_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GroupsApi.groups_id_get ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling GroupsApi.groups_id_get\"\n end\n # resource path\n local_var_path = '/groups/{id}'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BrainPortalSession']\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 => 'Group')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupsApi#groups_id_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0f4b5ec0386b9d52ad0ad2e3c67b3dcb",
"score": "0.5953892",
"text": "def fetch_groups_list(achievements_enabled)\n @groups_points = @course.groups.ordered_by_experience_points.take(display_user_count)\n @groups_count = achievements_enabled &&\n @course.groups.ordered_by_average_achievement_count.take(display_user_count)\n end",
"title": ""
},
{
"docid": "ae66cc010df26574da02298726df4898",
"score": "0.59527016",
"text": "def get_group(opts={})\n querymsg = JSON.parse(@authmsg.to_json)\n querymsg[:adom] = opts[:adom] ? opts[:adom] : 'root'\n\n begin\n if opts[:name] || opts[:groupid]\n querymsg[:names] = opts[:name] if opts[:name]\n querymsg[:grp_ids] = opts[:grp_id] if opts[:grp_id]\n else\n raise ArgumentError.new('Must provide required arguments for method-> :name OR :grp_id')\n end\n exec_soap_query(:get_groups,querymsg,:get_groups_response,:group_detail)\n rescue Exception => e\n fmg_rescue(e)\n return e\n end\n end",
"title": ""
},
{
"docid": "5681e4bf0b9bab590604b6923e311156",
"score": "0.5927993",
"text": "def groups_for_user(user, options=nil)\ngroups = Group.joins(:user_groups).where(\"user_groups.user_id = ? OR groups.user_id = ?\", user.id, user.id).distinct.order(\"lower(groups.name)\")\n\nopts = []\ngroups.each do|g|\n if options and options[:ids]\n opts.push(g.id)\n else\n opts.push([g.name, g.id])\n end\nend\n\nopts\nend",
"title": ""
},
{
"docid": "a50e37263919d938ced3090e9a987146",
"score": "0.59136665",
"text": "def groups\n result = get(\"groups\")\n end",
"title": ""
},
{
"docid": "5347120e64fa4d9fa1b2d624af043b45",
"score": "0.59119785",
"text": "def discover_groups(id)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"id=#{id}\",\n \"\" ] if blacklight_access_controls_ability_debug_verbose\n doc = permissions_doc(id)\n return [] if doc.nil?\n dg = read_groups(id) | (doc[self.class.discover_group_field] || [])\n Rails.logger.debug(\"[CANCAN] discover_groups: #{dg.inspect}\") if blacklight_access_controls_ability_debug_verbose\n dg\n end",
"title": ""
},
{
"docid": "57264dc461496b551795178d848c396d",
"score": "0.5905933",
"text": "def item_ids\n group? ? group_ids_for(group) : []\n end",
"title": ""
},
{
"docid": "5c44cf654480f45afb86722c6da88f54",
"score": "0.5904709",
"text": "def find_groups(id)\n MiqGroup.non_tenant_groups.find(id)\n end",
"title": ""
},
{
"docid": "6695971a2144854dd3d62291ddc5180a",
"score": "0.5896362",
"text": "def get_groups_id_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GroupsApi.get_groups_id ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling GroupsApi.get_groups_id\"\n end\n # resource path\n local_var_path = '/groups/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Group' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupsApi#get_groups_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "903f9188e0843aff14c7d1a8e42c10c1",
"score": "0.58881205",
"text": "def get_groups(conn, config, userid, entry, options)\n primary_gid_number = entry[ config.gidnumber_attribute ]\n group_filter = Net::LDAP::Filter.eq( config.gidnumber_attribute, primary_gid_number )\n guids = [ ]\n nested = [ ]\n conn.search(:base => config.groupbase, :filter => group_filter) do |entry|\n guid = entry[ config.guid_attribute ].first\n guids.push guid\n gid = entry.cn.first\n @primary_group = LDAPGroup.new(entry.dn, gid, \n entry[ config.gidnumber_attribute ].first)\n @groups[gid.downcase] = @primary_group\n entry[ config.nestedgroup_attribute ].each do |guid|\n nested.push guid unless nested.include? guid\n end\n end\n if options[:member_groups] || options[:nested_groups]\n member_filter = Net::LDAP::Filter.eq( config.groupmember_attribute, userid )\n conn.search(:base => config.groupbase, :filter => member_filter) do |entry|\n guid = entry[ config.guid_attribute ].first\n guids.push guid\n gid = entry.cn.first\n @groups[gid.downcase] = LDAPGroup.new(entry.dn, gid, \n entry[ config.gidnumber_attribute ].first, false, false)\n entry[ config.nestedgroup_attribute ].each do |guid|\n nested.push guid unless nested.include? guid\n end\n end\n if options[:nested_groups]\n while nested.size > 0 do\n search_guids = nested.dup\n nested = [ ]\n nested_filter = nil\n search_guids.each do |guid|\n guid_filter = Net::LDAP::Filter.eq( config.guid_attribute, guid )\n nested_filter = nested_filter.nil? ? guid_filter : (nested_filter | guid_filter)\n end\n conn.search(:base => config.groupbase, :filter => nested_filter) do |entry|\n guid = entry[ config.guid_attribute ].first\n if !guids.include?(guid)\n guids.push guid\n gid = entry.cn.first\n @groups[gid.downcase] = LDAPGroup.new(entry.dn, gid, \n entry[ config.gidnumber_attribute ].first, false, true)\n entry[ config.nestedgroup_attribute ].each do |guid|\n nested.push guid unless nested.include? guid\n end\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d1c1959d6d66c1b855db0be36623f36b",
"score": "0.58794314",
"text": "def that_i_manage\n group_list = Array.new\n get_groups.each do |g|\n group_list << g if g[:owner] == User.current.login\n end\n group_list\n end",
"title": ""
},
{
"docid": "ff43bf8f46062253ed9217b2b0d83d54",
"score": "0.58792764",
"text": "def fetch_groups\n groups_data = WebApi.json 'ISteamUser', 'GetUserGroupList', 1, steamid: steam_id64\n\n @groups = []\n groups_data[:response][:groups].each do |group_data|\n @groups << SteamGroup.new(group_data[:gid].to_i, false)\n end\n\n @groups\n end",
"title": ""
},
{
"docid": "0f1285746adf9f3a301172f87d9a118a",
"score": "0.5877971",
"text": "def group_ids\n res = JSON.parse(@api.groups.body)['response']\n ids = res.collect {|r| r['id'].to_i }\n end",
"title": ""
},
{
"docid": "71f2572b284134e9668af8a81d65cbea",
"score": "0.5872196",
"text": "def do_list_groups()\n \"Some groups: \" + Group.primary_group_abbrevs\n end",
"title": ""
},
{
"docid": "584fc326af7b12a5bf2447061dd516c0",
"score": "0.58682466",
"text": "def group(id)\n get \"/groups/#{id}\"\n end",
"title": ""
},
{
"docid": "0f92f9c94bb236804d1cf3ddccad35b0",
"score": "0.5867896",
"text": "def group_by_id\n @profile = Group.find(params[:id])\n raise \"No Group found\" if @profile.nil?\n end",
"title": ""
},
{
"docid": "4ce6c63dc5adf06b23cf7f2297b0ecc6",
"score": "0.5849814",
"text": "def fetch_groups; end",
"title": ""
},
{
"docid": "c7b6bada37148f5b8bb7d7d6067e0e81",
"score": "0.58416444",
"text": "def group(id, options = {})\n get(\"/groups/#{url_encode id}\", query: options)\n end",
"title": ""
},
{
"docid": "ef4ee76c854d60b3ec98d7ef2f47265f",
"score": "0.5840489",
"text": "def group_find(options = {})\n id = options[:id] || false\n name = options[:name] || false\n desc = options[:desc] || false\n groups = []\n \n Nokogiri::Slop(send(render(:group)))\n .exacttarget\n .system\n .list\n .groups.each do |group|\n (next if group.groupID.content != id.to_s) if id\n (next if !group.groupName.content.include? name.to_s) if name\n (next if !group.description.content.include? desc.to_s) if desc\n \n group.instance_eval do\n groups << {\n :id => groupID.content,\n :name => groupName.content,\n :desc => description.content\n }\n end\n end\n groups\n end",
"title": ""
},
{
"docid": "aa1ea81d1523e12f6b501b2fce7038c7",
"score": "0.58190614",
"text": "def load_ldap_gids\n all_gids = []\n group_filter = Net::LDAP::Filter.eq(\"objectclass\", \"group\")\n\n @ldap.search(:base => @root, :filter => group_filter) do |entry|\n begin\n gid = entry.gidNumber.pop.to_i\n all_gids.push gid\n rescue NoMethodError\n end\n end\n\n all_gids\n end",
"title": ""
},
{
"docid": "97a503464ef264eb3bda13f96a5c0c92",
"score": "0.5814432",
"text": "def getGroups\n\treturn_result = []\n\tgroups = $gm.get(\"groups\", @token)['response']\n\tgroups.each do | group |\n\t if !group['image_url'].nil?\n\t image = group['image_url'] + '.avatar'\n\t hash = { 'name' => group['name'], 'group_id' => group['group_id'], 'image' => image }\n\t return_result.push(hash)\n\t end\n\tend\n\treturn return_result\n end",
"title": ""
},
{
"docid": "22a2bebe07b53badcc1ddf3930688bc7",
"score": "0.5811193",
"text": "def read_groups(id)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"id=#{id}\",\n \"\" ] if blacklight_access_controls_ability_debug_verbose\n doc = permissions_doc(id)\n return [] if doc.nil?\n rg = download_groups(id) | Array(doc[self.class.read_group_field])\n Rails.logger.debug(\"[CANCAN] read_groups: #{rg.inspect}\") if blacklight_access_controls_ability_debug_verbose\n rg\n end",
"title": ""
},
{
"docid": "2c165de6fae9e16872fe618a96e6aff0",
"score": "0.5798451",
"text": "def _get_group(group)\n @data[group] ||= []\n return @data[group]\n end",
"title": ""
},
{
"docid": "986b9d9cbc31b7b1359698e2aaa02642",
"score": "0.579518",
"text": "def get_group_info(group_id)\n if group_id.integer?\n RestClient.get \"https://#{@username}:#{@password}@convore.com/api/groups/#{group_id}.json\"\n end\n end",
"title": ""
},
{
"docid": "4f07ac4e1be5b5cd523115226894c89b",
"score": "0.5775148",
"text": "def current_user_groups\n user_group_ids\n @group_ids.collect do |id|\n Group.all.find_by_id(id)\n end\n end",
"title": ""
},
{
"docid": "24e6abcc6cb92c4c8556e93c612ed1df",
"score": "0.577509",
"text": "def groups\n response = @api.request(:get, \"users/#{@userid}/groups\")\n parse_with_meta(response, \"//data/groups/element\")\n end",
"title": ""
},
{
"docid": "97eb5aac4539525f84b93b2d8e97ccab",
"score": "0.5770746",
"text": "def groups\n\n\t\tif params[:id]\n\n\t\t\trender :json => User.find(params[:id]).groups\n\n\t\telse\n\n\t\t\trender :json => current_user.groups\n\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "aad9a3cb5d5cb07ec64f619772d07294",
"score": "0.5770693",
"text": "def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end",
"title": ""
},
{
"docid": "bcae6c0a57c2d99e442977ad489b316f",
"score": "0.5762208",
"text": "def groups\n @groups ||= get_groups\n end",
"title": ""
},
{
"docid": "9d1b3acbe0b7e523ed81b18dfe664c2e",
"score": "0.574032",
"text": "def get_group_by_id(id)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/groups/#{id}\"))\n end",
"title": ""
},
{
"docid": "9d1b3acbe0b7e523ed81b18dfe664c2e",
"score": "0.574032",
"text": "def get_group_by_id(id)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/groups/#{id}\"))\n end",
"title": ""
},
{
"docid": "9d1b3acbe0b7e523ed81b18dfe664c2e",
"score": "0.574032",
"text": "def get_group_by_id(id)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/groups/#{id}\"))\n end",
"title": ""
},
{
"docid": "ae53eb9257c8571c1440f77debfeba33",
"score": "0.5727255",
"text": "def ids_for(id)\n if TESTS[id]\n [id]\n elsif GROUPS.key?(id)\n GROUPS[id]\n else\n abort \"Can't resolve IDs for: #{id.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "d82fe5b39e6dca094313bb799a311320",
"score": "0.572657",
"text": "def groups\n weakref(:groups) do\n Group.list(\"memberUid=#{name}\")\n end\n end",
"title": ""
},
{
"docid": "d0058539cf74bfd5cccddbb49095f847",
"score": "0.5725555",
"text": "def groups\n fetch('music.hiphop.groups')\n end",
"title": ""
},
{
"docid": "8ce97e4a238ad52061874c5468bd0f17",
"score": "0.57059604",
"text": "def groups options ={}\n perform_get_with_object(\"/users/#{get_id}/groups\", options, Vimeo::Entities::Group)\n end",
"title": ""
},
{
"docid": "ad4ee9d4e24a67b53cce628951a03cb4",
"score": "0.5688533",
"text": "def groups\n list.groups\n end",
"title": ""
},
{
"docid": "96f4b589d37e797a937c4bd4c6e1d093",
"score": "0.5688375",
"text": "def get_acting_group( agi )\n Group.find( agi == 0 ? p_group_id : c_group_id )\n end",
"title": ""
},
{
"docid": "43f029bca800fc50a82c6c81cf2b411d",
"score": "0.5688333",
"text": "def groups(fb_workplace_id)\n # get_community_path(\"groups\").map{|m| Hashie::Mash.new(m)} rescue nil\n # user = user_from_email(user_email)\n users_managed_groups(fb_workplace_id)\n\n end",
"title": ""
},
{
"docid": "150ed9128338ffdb40bc5ec1a58c4e83",
"score": "0.56850713",
"text": "def cache_all_group_ids(trace: false)\n @group_id_map = {}\n @dbx_info.groups_list(trace: trace) do |gf|\n @group_id_map[gf['group_name']] = gf['group_id']\n end\nend",
"title": ""
},
{
"docid": "39fc7af85a7cd76cfa30bc768f776815",
"score": "0.56802154",
"text": "def get_user_groups_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.get_user_groups ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling UsersApi.get_user_groups\"\n end\n # resource path\n local_var_path = '/users/{id}/groups'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-Embarcadero-Application-Id'] = opts[:'x_embarcadero_application_id'] if !opts[:'x_embarcadero_application_id'].nil?\n header_params[:'X-Embarcadero-App-Secret'] = opts[:'x_embarcadero_app_secret'] if !opts[:'x_embarcadero_app_secret'].nil?\n header_params[:'X-Embarcadero-Master-Secret'] = opts[:'x_embarcadero_master_secret'] if !opts[:'x_embarcadero_master_secret'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<GroupName>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#get_user_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "11da738844aaa92c73be91e95ebf4862",
"score": "0.5662552",
"text": "def list_with_http_info(account_id, options = DocuSign_eSign::ListOptions.default)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SigningGroupsApi.list ...\"\n end\n # verify the required parameter 'account_id' is set\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling SigningGroupsApi.list\" if account_id.nil?\n # resource path\n local_var_path = \"/v2.1/accounts/{accountId}/signing_groups\".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'group_type'] = options.group_type if !options.group_type.nil?\n query_params[:'include_users'] = options.include_users if !options.include_users.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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SigningGroupInformation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SigningGroupsApi#list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c0abca3be528ae58c008a2ee9b0375b3",
"score": "0.56582034",
"text": "def groups\n Log.add_info(request, '') # Not to show passwords.\n\n ary = []\n groups = Group.where(nil).to_a\n unless groups.nil?\n groups_cache = {}\n group_obj_cache = Group.build_cache(groups)\n groups.each do |group|\n ary << group.id.to_s + ':' + Group.get_path(group.id, groups_cache, group_obj_cache)\n end\n end\n\n render(:text => ary.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "910438f20012aef224e9fd850b9e3f69",
"score": "0.5655544",
"text": "def get_members_of(group_id, options = {})\n options[:extra] = \"/#{group_id}/member\"\n get_groups options\n end",
"title": ""
},
{
"docid": "1663a8f7a2018a3a17417cf0eb447ceb",
"score": "0.56380653",
"text": "def daw_group_ids\n groups = daw_session_data['allGroups']\n raise RuntimeError.new 'To use group methods, allGroups should be in Rdaw::DAW_FUNC' unless groups\n groups.split(';').reject(&:empty?).map(&:to_i)\n end",
"title": ""
},
{
"docid": "9ec278d946a4a08d671dbb866559feaa",
"score": "0.56364805",
"text": "def get_groups\n endpoint = '/groups'\n url = self.base_url.to_s + endpoint.to_s + self.format.to_s\n self.get_data(url)\n end",
"title": ""
},
{
"docid": "94db551823f27221e6e8f66ee9ea6d64",
"score": "0.563211",
"text": "def _add_i2g(gid, iid)\n ary = @group[gid][:member] ||= []\n ary << iid unless ary.include?(iid)\n ary\nend",
"title": ""
},
{
"docid": "c449413110964807364c22a01ac02ab9",
"score": "0.5631125",
"text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "e747cdcab4d0ab62707ca84a905da6e2",
"score": "0.56228673",
"text": "def groups opts = {}\n get :group, opts\n end",
"title": ""
},
{
"docid": "c6daeb0bf946dc585e63045d8999f658",
"score": "0.56193185",
"text": "def find_in_users_groups(id)\n g = Group.find(id)\n return g if current_user.groups.include? g\n end",
"title": ""
},
{
"docid": "aaa323b3678e818f5d9369bee1612e4d",
"score": "0.56185675",
"text": "def groups\n db = SQLite3::Database.open('db/db.sqlite')\n groups = []\n for i in db.execute('SELECT * FROM groups WHERE id IN (SELECT group_id FROM memberships WHERE user_id IS ?)', @id)\n groups << Group.new( {id: i[0], name: i[1]})\n end\n return groups\n end",
"title": ""
},
{
"docid": "40158a306d172d148ad8c9b38846e2eb",
"score": "0.5615626",
"text": "def retrieve_groups()\n start.uri('/api/group')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "96712de57f1defda5c8e1bfdc28e9b91",
"score": "0.5612699",
"text": "def list_groups_with_http_info(account_id, options = DocuSign_eSign::ListGroupsOptions.default)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GroupsApi.list_groups ...\"\n end\n # verify the required parameter 'account_id' is set\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling GroupsApi.list_groups\" if account_id.nil?\n # resource path\n local_var_path = \"/v2.1/accounts/{accountId}/groups\".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'count'] = options.count if !options.count.nil?\n query_params[:'group_type'] = options.group_type if !options.group_type.nil?\n query_params[:'include_usercount'] = options.include_usercount if !options.include_usercount.nil?\n query_params[:'search_text'] = options.search_text if !options.search_text.nil?\n query_params[:'start_position'] = options.start_position if !options.start_position.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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GroupInformation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupsApi#list_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b4d88317019174d83d75deb8b104973b",
"score": "0.5610731",
"text": "def group_data\n return [] if complete_group_data.length == 1\n\n complete_group_data\n end",
"title": ""
},
{
"docid": "31f93099cc6f6ec9107939499983e345",
"score": "0.5604911",
"text": "def get_group_user_ids_by_group_id(id)\n result = self.get_group_users(id)\n result[\"group\"].select{|values| values[\"users\"]}[\"users\"].map{|v| v[\"id\"]}\n end",
"title": ""
},
{
"docid": "28944b4d0c54ef1368e56746f113f4b1",
"score": "0.55983293",
"text": "def group_ids_by_name\n groups = Assignment.find(params[:assignment_id])\n .groups\n reversed = Hash[groups.map { |g| [g.group_name, g.id] }]\n respond_to do |format|\n format.xml do\n render xml: reversed.to_xml(root: 'groups', skip_types: 'true')\n end\n format.json do\n render json: reversed.to_json\n end\n end\n end",
"title": ""
},
{
"docid": "28944b4d0c54ef1368e56746f113f4b1",
"score": "0.55983293",
"text": "def group_ids_by_name\n groups = Assignment.find(params[:assignment_id])\n .groups\n reversed = Hash[groups.map { |g| [g.group_name, g.id] }]\n respond_to do |format|\n format.xml do\n render xml: reversed.to_xml(root: 'groups', skip_types: 'true')\n end\n format.json do\n render json: reversed.to_json\n end\n end\n end",
"title": ""
},
{
"docid": "ec181168a85856b6b990dfb1474c3e3d",
"score": "0.55965877",
"text": "def get_user_groups(bearer) \n return get_info(bearer, \"my/groups\")\n end",
"title": ""
},
{
"docid": "43819dd4e3c1bc455a9eb9ec57204a10",
"score": "0.5589033",
"text": "def groups\n @groups ||= []\n end",
"title": ""
},
{
"docid": "43819dd4e3c1bc455a9eb9ec57204a10",
"score": "0.5589033",
"text": "def groups\n @groups ||= []\n end",
"title": ""
},
{
"docid": "43819dd4e3c1bc455a9eb9ec57204a10",
"score": "0.5589033",
"text": "def groups\n @groups ||= []\n end",
"title": ""
},
{
"docid": "e0babe3ada436fac2532da5b81a284a6",
"score": "0.5586146",
"text": "def group_ids\n @attributes[:group_ids]\n end",
"title": ""
},
{
"docid": "e0babe3ada436fac2532da5b81a284a6",
"score": "0.5586146",
"text": "def group_ids\n @attributes[:group_ids]\n end",
"title": ""
},
{
"docid": "5fb5ffcc66a123f8249bee03de2fc58e",
"score": "0.5584299",
"text": "def achievement_info(id)\n get_response(\"/v2/achievements#{Utils.format_id(id)}\")\n end",
"title": ""
},
{
"docid": "fc39c6ee0fe553fbc09f29139973b9d8",
"score": "0.5577654",
"text": "def usergroups_group_id_get_with_http_info(group_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProductsApi.usergroups_group_id_get ...'\n end\n # verify the required parameter 'group_id' is set\n if @api_client.config.client_side_validation && group_id.nil?\n fail ArgumentError, \"Missing the required parameter 'group_id' when calling ProductsApi.usergroups_group_id_get\"\n end\n # resource path\n local_var_path = '/usergroups/{group_id}'.sub('{' + 'group_id' + '}', group_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', 'text/plain'])\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 => 'UserGroup')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProductsApi#usergroups_group_id_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "74f50154fc060195502bdbffc2fcb959",
"score": "0.5575263",
"text": "def find_by_group(group)\n res = []\n @items.each_pair do |jid,item|\n res.push(item) if item.groups.include?(group)\n res.push(item) if item.groups == [] and group.nil?\n end\n res\n end",
"title": ""
},
{
"docid": "35f31b3b311587b19725bc1749f5f0e6",
"score": "0.55700964",
"text": "def groups\n Group.all( {:customer_id => id} )\n end",
"title": ""
},
{
"docid": "0a6ea808a4b132046d558304d72a9d79",
"score": "0.5567801",
"text": "def get_user_groups\n path = self.api_root + \"/api/groups\"\n process_firecloud_request(:get, path)\n end",
"title": ""
},
{
"docid": "7435387db6cb090eec53a30ae6388d3b",
"score": "0.5564681",
"text": "def get_group_leaders\n @group_leaders = User.find(:all, :joins => [:team_registrations], :conditions => \"event_id = #{Event.active_event.id}\", :order => \"first_name,last_name\").map { |user| [user.fullname, user.id] }\n @group_leaders = @group_leaders.uniq.sort_by { |user| user[0].downcase }\n @group_leaders.insert(0, ['- Select -', ''])\n @group_leaders.push(['Staff', -4])\n @group_leaders.push(['Official', -5])\n @group_leaders.push(['Volunteer', -6])\n @group_leaders.push(['Representative', -7])\n @group_leaders.push(['My group leader is not listed.', -1])\n @group_leaders.push(['I don\\'t know who my group leader is.', -2])\n @group_leaders.push(['I don\\'t have a group leader.', -3])\n logger.info(@group_leaders.inspect)\n end",
"title": ""
},
{
"docid": "0ff9e882d4517ae312decba8ce090266",
"score": "0.55595416",
"text": "def groups\n @groups = groups_get if reset_groups?\n @groups\n end",
"title": ""
},
{
"docid": "8887cd06899c924cbabd6bc3355b68f8",
"score": "0.5549101",
"text": "def lender_groups(library_id)\n # Find distinct transactions\n all_groups = Illiad::Group.select(\n :group_name\n ).distinct.where(\n institution_id: library_id\n )\n groups = []\n all_groups.each do |group|\n groups.append(group.group_name)\n end\n # Adding special case for group by to nil\n return groups.sort.append(nil)\n end",
"title": ""
},
{
"docid": "b8e7bb5badcd530806808e11edaa47ad",
"score": "0.55411094",
"text": "def info(uuid)\n get(uri: \"/groups/#{uuid}/\")\n end",
"title": ""
},
{
"docid": "c0ff56c6aa8ef3636e725d6eedde4cf9",
"score": "0.5540025",
"text": "def instructor_group(id, options = {})\n get \"instructor_groups/#{id}\", options\n end",
"title": ""
},
{
"docid": "593b4478e9c81788c21ac66b1cb56000",
"score": "0.5538801",
"text": "def show\n @currentGroup = Group.find(params[:id])\n @groupOwner = User.find(@currentGroup.owner_id)\n @groupOwnerName = @groupOwner.first_name + \" \" + @groupOwner.last_name\n @currentUser = getCurrentUser\n #get the group id\n #get the user_id that match with that group\n #add it to a list\n @group_users = @currentGroup.users \n end",
"title": ""
},
{
"docid": "256b8f1cb56c6027bdd5d80637be3142",
"score": "0.553778",
"text": "def parse_fetch_group(data)\n if data\n group_id = parse_group(data)\n raise BadRequestError, \"Missing Group identifier href, id or description\" if group_id.nil?\n resource_search(group_id, :groups)\n end\n end",
"title": ""
},
{
"docid": "92ccf51a86339461c93b5ae061e883d4",
"score": "0.55361813",
"text": "def groups\n if (groups_last_update.blank? || ((Time.now-groups_last_update) > 24*60*60 ))\n return groups!\n end\n return self.group_list.split(\";?;\")\n end",
"title": ""
},
{
"docid": "68cd7398cb64d0d782a242d8b0c8ebcc",
"score": "0.55308324",
"text": "def get_groups\n begin\n groups = @puppetclassify.groups.get_groups\n rescue Exception => e\n puts e.message\n end\n return groups unless groups.nil?\n end",
"title": ""
},
{
"docid": "2d47275aa163b4169a0305e332664581",
"score": "0.5527674",
"text": "def group_list(user_id, sort='my_activity')\n data = request('/group/list', :id => user_id, :sort => sort)\n Hashie::Mash.new(data['groups']['list'])\n end",
"title": ""
}
] |
d6250a4d43d749ecc45383ef66e4b3e7
|
1 set action team members via JSON import file for use with import tool
|
[
{
"docid": "7afd7c49288cdd6a851433e317a3ac57",
"score": "0.6795388",
"text": "def set_action_team_members\n action_members = action_team_members\n # Use all groups.. some 'action teams' in old community will be admin groups in new community\n swc_action_teams = api.call(endpoint: 'groups')\n team_names = swc_action_teams.each_with_object({}) { |team, map| map[team['name']] = team['id']; }\n # TODO: limit by SWC ID present?\n # sf_community_users = sf.client.query(\"SELECT Id, FirstName, LastName, Email, SWC_User_ID__c, CCL_Community_Username__c FROM Contact WHERE CCL_Community_Username__c <> '' AND SWC_User_ID__c <> 0\")\n # user_logins = sf_community_users.each_with_object({}) { |user, map| map[user.CCL_Community_Username__c] = user; }\n update = action_members.each_with_object([]) do |member, updates|\n # this will create a user if we don't filter SF users by those with SWC ID\n username = member['user_login']\n # action_team = CGI.escape(member['group_name'])\n team_id = get_team_id(team_names, member)\n next unless user_map.include?(username) && team_id.present?\n\n sf_user = user_map[username]\n updates << { '*_email_address': sf_user.Email.to_s.gsub('+', '%2B'), '*_username': sf_user.FirstName + ' ' + sf_user.LastName,\n '*_first_name': sf_user.FirstName, '*_last_name': sf_user.LastName, 'o_groups': team_id }\n end\n # can do multiple of the same user\n File.open(ACTION_TEAM_MEMBERS, 'w') { |f| f.puts(update.to_json) }\n end",
"title": ""
}
] |
[
{
"docid": "7e6de7ae60ea099beae150933d406517",
"score": "0.6314659",
"text": "def import_team_members(row_hash)\n row_hash[:teammembers].each_with_index do |teammate, _index|\n user = User.find_by(name: teammate.to_s)\n if user.nil?\n raise ImportError, \"The user '#{teammate}' was not found. <a href='/users/new'>Create</a> this user?\"\n else\n add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?\n end\n end\n end",
"title": ""
},
{
"docid": "428cfa7846e3e54dcf6cbc333048751e",
"score": "0.61453676",
"text": "def store_all_team_member\n all_team.map { |item| item['id'] }.each do |id|\n `curl -o #{id}_members.json -H #{TOKEN} #{EP}teams/#{id}/members`\n `mv *.json ./temp/`\n end\nend",
"title": ""
},
{
"docid": "9b18cabf73b17e9dded9f730ffc23a29",
"score": "0.60975385",
"text": "def import_project_users\n data = process_json(startup_roles_url)\n\n data['startup_roles'].each do |role|\n external_id = role['tagged']['id']\n member = User.find_by(:external_id => external_id.to_s)\n project.memberships.create({\n :creator => project.user,\n :user => member\n }) if member && member != project.user\n end\n end",
"title": ""
},
{
"docid": "352d636531d0c7a4155ec44ab268dfdd",
"score": "0.5813297",
"text": "def import_cities_from_file\n cities = JSON.parse File.read(\"#{PATH}/db/cities_pop.json\")\n cities.each do |city|\n import city\n end\nend",
"title": ""
},
{
"docid": "5f0d9d81bc701c8bc9d99fe1e3797879",
"score": "0.5658605",
"text": "def importFile file_name\r\n File.open(file_name, \"r\") do |file|\r\n while (line = file.gets)\r\n @users << User.new(line.chomp.split(','))\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "1cd7f586943a5db13f67d2a9a5a187b9",
"score": "0.5653454",
"text": "def import\n begin\n Member.import(params[:file])\n redirect_to root_url, notice: \"Members imported.\"\n rescue\n redirect_to root_url, notice: \"Invalid file format.\"\n end\n end",
"title": ""
},
{
"docid": "aef88b3c146c69f5843db94c1b9ece1b",
"score": "0.5638268",
"text": "def import(week = GameWeek.current.week)\n importing(week) do\n client = Scout::Client.new\n \n updated_teams = client.teams\n \n lookup = all.inject({}) do |id_to_team, team|\n id_to_team[team.yahoo_key] = team\n id_to_team\n end\n \n teams_to_save = updated_teams.map do |updated_team|\n if existing_team = lookup[updated_team.team_key]\n existing_team.attributes = Team.attributes_from_payload(updated_team)\n if existing_team.changed?\n existing_team\n else\n nil\n end\n else\n Team.from_payload(updated_team)\n end\n end.compact\n\n import_log \"teams_to_save: #{teams_to_save.size}\"\n teams_to_save.each(&:save)\n end\n end",
"title": ""
},
{
"docid": "091f947fd156fd389d0a2176449e14fc",
"score": "0.56168365",
"text": "def bulk_import\n params.delete(:group_id) if params[:group_id]\n members = params[:members].try(:values)\n return render(json: {error: \"No members sumbitted\"}, status: :unprocessable_entity) unless members\n\n rendered_rows = []\n error_rows = []\n members.each do |member_params|\n member_params[:time_zone] = @group.time_zone\n @member = create_member_and_membership(member_params)\n if @member\n rendered_rows << render_to_string(partial: \"members/row\", locals: { member: @member })\n else\n error_rows << member_params\n end\n end\n\n if rendered_rows.count > 0\n status = :ok\n # TODO: internationalize\n alert_type = \"success\"\n bold_message = \"Awesome!\"\n plural_members = ActionController::Base.helpers.pluralize(rendered_rows.count, \"member\", \"members\")\n message = \"You imported #{plural_members}\"\n locals = { alert_type: alert_type, bold_message: bold_message, message: message }\n alert = render_to_string(partial: \"bootstrap/dismissable_alert\", locals: locals)\n else\n status = :unprocessable_entity\n alert_type = \"error\"\n alert = nil\n end\n\n\n return render(json: { rendered_rows: rendered_rows, error_rows: error_rows, alert: alert}, status: status)\n end",
"title": ""
},
{
"docid": "350d9aa40ed6a7df8b99b4471af8772f",
"score": "0.5583509",
"text": "def import\n # initialize\n file = params[:csv_upload] # the file item\n if file\n user_type = params[:user_type]\n overwrite = (params[:overwrite] == '1') # update existing users?\n filepath = file.tempfile.path # the rails CSV class needs a filepath\n\n imported_users = csv_import(filepath)\n end\n\n # check if input file is valid and return appropriate error message if not\n return unless valid_input_file?(imported_users, file)\n # create the users and exit\n @hash_of_statuses = import_users(imported_users, overwrite, user_type)\n render 'imported'\n end",
"title": ""
},
{
"docid": "f828318fc7c46bc0db08358963c11119",
"score": "0.5542254",
"text": "def import_users(data)\n bulk_import('users', data, Teamweek::Api::User)\n end",
"title": ""
},
{
"docid": "dca02ba534f63e51bfbe126985978361",
"score": "0.5535184",
"text": "def seed_sf_challonge\n File.open(\"lib/assets/tournament.json\", 'r') do |f|\n f.each_line.with_index do |line, i|\n puts i + 1 #keep track file running when seeding data\n players_hash = {}\n tournament_object = JSON.parse(line)['tournament']\n date = tournament_object['started_at'].split('T')[0]\n\n tournament_object['participants'].each do |participant|\n id = participant['participant']['id']\n player_name = remove_player_tag(participant['participant']['name'])\n\n players_hash[id] = player_name\n end\n\n tournament_object['matches'].each do |match|\n player_1 = players_hash[match['match']['player1_id']]\n player_2 = players_hash[match['match']['player2_id']]\n game = tournament_object['game_name']\n score = match['match']['scores_csv']\n winner_id = players_hash[match['match']['winner_id']]\n\n seed_data(player_1, player_2, winner_id, score, game, date)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "3d597a89a5bc0df97488a9e33e012cdd",
"score": "0.54899985",
"text": "def import\n # initialize\n file = params[:csv_upload] # the file object\n if file\n user_type = params[:user_type]\n overwrite = (params[:overwrite] == '1') # update existing users?\n filepath = file.tempfile.path # the rails CSV class needs a filepath\n\n imported_users = csv_import(filepath)\n end\n\n # check if input file is valid and return appropriate error message if not\n if valid_input_file?(imported_users, file)\n # create the users and exit\n @hash_of_statuses = import_users(imported_users, overwrite, user_type)\n render 'imported'\n end\n end",
"title": ""
},
{
"docid": "ffaf0f7c83a6c5a5032c513ff225497c",
"score": "0.54829085",
"text": "def by_fixture_parser\n by_fixture_data = []\n target_dir = by_fixture_dir\n Dir.foreach(target_dir) do |file|\n next if file == '.' or file == '..'\n json_file = File.open(target_dir + file)\n parsed_file = JSON.parse(File.read(json_file))\n lineup_values = parsed_file[\"api\"][\"lineUps\"]\n lineup_values.each do |value|\n value[1][:fixture_id] = file.split(\"_\").first.to_i\n value[1][:team_name] = value[0]\n by_fixture_data.push(value[1].deep_symbolize_keys!)\n end\n end\n\n by_fixture_data\n end",
"title": ""
},
{
"docid": "0259aa549d3b4ef791823c7bbca99f00",
"score": "0.5469914",
"text": "def run_import_player(player, team_id)\n # run profile import\n imported_profile = run_import_profile(player[:profile])\n # run roster import\n imported_roster = run_import_roster(player[:roster], team_id, imported_profile.id)\n # run ratings import\n imported_ratings = run_import_ratings(player[:rating],imported_profile.id)\n end",
"title": ""
},
{
"docid": "cb5cdfc444f6ab58cc17848631160557",
"score": "0.5468871",
"text": "def seed_sf_smashgg\n url_start = 'https://api.smash.gg/phase_group/'\n url_end = '?expand[]=sets'\n File.open(\"lib/assets/tournament_smashgg_sf.json\", 'r') do |f|\n f.each_line.with_index do |line, i|\n puts i + 1 #keep track file running when seeding data\n tournament_object = JSON.parse(line)['entities']\n players_hash = {}\n game_name = tournament_object['event'][0]['name'].split('Singles').map(&:strip).first\n date = (Time.at(tournament_object['tournament']['startAt'])).to_s.split(' ')[0]\n\n tournament_object['entrants'].each do |player|\n id = player['id']\n player_name = remove_player_tag(player['name'])\n\n players_hash[id] = player_name\n end\n\n phase_group_id = tournament_object['groups'][0]['id']\n url = url_start + phase_group_id.to_s + url_end\n response = JSON.parse(RestClient.get(url))\n\n response['entities']['sets'].each_with_index do |set, i|\n next unless set['entrant2Id']\n next unless set['entrant1Id']\n player_1 = players_hash[set['entrant1Id']]\n player_2 = players_hash[set['entrant2Id']]\n score = set['entrant1Score'].to_s + '-' + set['entrant2Score'].to_s\n winner = players_hash[set['winnerId']]\n seed_data(player_1, player_2, winner, score, game_name, date)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "0fd55d64baee4ce5d7d767fa3ac30cfe",
"score": "0.5460614",
"text": "def load_users\n user_file = File.read('./db/users.json')\n user_data = JSON.parse(user_file)\n\n sorted_user_data = user_data.sort {|a,b| a[\"id\"] <=> b[\"id\"]}\n\n users = sorted_user_data.each_with_index { |user, index| \n first_name, last_name = user[\"name\"].split(\" \", 2)\n\n User.create!(first_name: first_name, last_name: last_name, avatar_url: user[\"avatar\"], occupation: user[\"occupation\"])\n # p user[\"id\"] == index + 1 # simple test to ensure the source data did not skip user id's\n }\nend",
"title": ""
},
{
"docid": "36b0acbc947e84881c2cd1a7dae7afcb",
"score": "0.54543304",
"text": "def import!\n raise NoImportFile if @file.nil?\n raise EmptyImportFile if @file.size == 0\n \n FCSV.parse(@file, :headers => @options[:headers]) do |row|\n begin\n member = create_member_from_csv(row)\n\n next if member.nil?\n\n if member.valid?\n @valid_members << member\n else\n @invalid_members << member\n end\n rescue InvalidRow => e\n # do nothing for now, since we don't have a name or email at this point it would be hard to display a\n # meaningful error message.\n end\n end\n\n if @options[:destroy]\n\n # removed = previous - current (eg. anything in previous not present in current)\n # We may have some valid IDs in invalid members that were simply not updated because of some invalid data, so we\n # pull in those IDs as well.\n current_org_ids = (@valid_members + @invalid_members).collect{|o| o.id}.compact\n existing_org_ids = @association.organization_ids\n removed_org_ids = existing_org_ids - current_org_ids\n removed_orgs = @association.organizations.find(removed_org_ids)\n\n removed_orgs.each do |org|\n @association.remove_member(org) \n @deleted_members << org\n end\n end\n \n raise MalformedCSV if self.malformed?\n end",
"title": ""
},
{
"docid": "95c72a1c71e4d5c618f043e94600627a",
"score": "0.5431857",
"text": "def update_users_db\n response = @harvest.request \"/people\", :get\n people = Hash.new\n JSON.parse(response.body).each do |p|\n people[p[\"user\"][\"id\"]] = \"#{p[\"user\"][\"first_name\"]} #{p[\"user\"][\"last_name\"]}\"\n end\n File.open('users.yml', 'w') { |f| f.write people.to_yaml } \n end",
"title": ""
},
{
"docid": "b086e0b663ce779f2b30093250aa6883",
"score": "0.54277635",
"text": "def import\n entries = YAML.safe_load(File.read(file))\n\n entries.each_pair do |key, hash|\n eve_agent = Eve::Agent.find_or_initialize_by(id: key)\n\n eve_agent.assign_attributes(agent_type_id: hash[\"agentTypeID\"],\n corporation_id: hash[\"corporationID\"],\n division_id: hash[\"divisionID\"],\n is_locator: hash[\"isLocator\"],\n level: hash[\"level\"],\n location_id: hash[\"locationID\"],\n quality: hash[\"quality\"])\n\n eve_agent.save!\n end\n end",
"title": ""
},
{
"docid": "a9c7c2cacde495d44d724984bdfd4f1c",
"score": "0.5404165",
"text": "def import_users(request)\n start.uri('/api/user/import')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "7619a09edd1a51d24029d1ad8727ce6a",
"score": "0.53956187",
"text": "def run_import_team(team, division_id)\n # get the team if it exists in the database\n import_team = Team.where(:teamsnap_id => team[:teamsnap_id]).first\n if import_team.nil?\n import_team = Team.new\n end\n\n import_team.name = team[:name]\n import_team.teamsnap_id = team[:teamsnap_id]\n import_team.division_id = division_id\n if !import_team.valid?\n error = Hash.new\n error[:type] = \"Team #{team[:name]}\"\n error[:errors] = import_team.errors?\n @errors.push(error)\n ap \"______ TEAM #{team[:name]} IS NOT VALID TO SAVE _____\"\n return\n end\n import_team.save\n import_team\n end",
"title": ""
},
{
"docid": "eef19181d67b798a6ff13b95ef856a9d",
"score": "0.53922534",
"text": "def import_users(request)\n start.uri('/api/user/import')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "016a7806b92ba567d36f8f54217fe364",
"score": "0.5365243",
"text": "def read_mentor(file, mentors)\n id = File.basename(file).split('.')[0]\n member = ASF::Person[id] # We want to return nil if id not found\n if member\n begin\n mentors[id] = JSON.parse(File.read(file))\n mentors[id][MentorFormat::PUBLICNAME] = member.public_name()\n rescue StandardError => e\n mentors[id] = { MentorFormat::ERRORS => \"ERROR:read_mentor() #{e.message} #{e.backtrace[0]} from #{file}\"}\n end\n else\n mentors[id] = { MentorFormat::ERRORS => \"ERROR:ASF::Person.find(#{id}) returned nil from #{file}\"}\n end\nend",
"title": ""
},
{
"docid": "fba0b4245faf6e591a203de5c8aa2a8e",
"score": "0.53268385",
"text": "def user_import(params = {})\n RuleInfo.each do |e|\n multiple_battle_import(params.merge(gtype: e.swars_real_key))\n end\n end",
"title": ""
},
{
"docid": "4a6dd8c290e6c20486571be68acd030e",
"score": "0.5323284",
"text": "def create_team()\n begin\n bodyParams = {\n 'public': true,\n 'name': \"Ruby Team\",\n # Add internal members using their extension ids\n # Get your user extension id by calling the /restapi/v1.0/account/~/extension endpoint!\n 'members': [{ 'id': \"590490017\"}, { 'id': \"595861017\"}],\n # You can also add members using their email address, especially for guest members who are not under your account company.\n # 'members': [{'email': \"member.1@gmail.com\"}, { 'email': \"member.2@gmail.com\"}, {'id': \"[extensionId]\"}],\n 'description': \"Let's talk about Ruby\"\n }\n endpoint = \"/team-messaging/v1/teams\"\n resp = $platform.post(endpoint, payload: bodyParams)\n puts resp.body\n rescue StandardError => e\n puts (e)\n end\nend",
"title": ""
},
{
"docid": "caa136382217274fa92d5762a7b3eafa",
"score": "0.53113765",
"text": "def create\n @course = Course.find(params[:course_id])\n @assignment = Assignment.find(params[:assignment_id])\n # Every upload is a complete team designations\n @assignment.memberships(true).each do |membership|\n if !membership.destroy\n puts \"Not destroyed: \" + membership.inspect\n end\n end\n params[:response][:teams].split(\"\\r\\n\" ).each{ |line|\n add_teammate(line.split(',').map{|s| clean_csv_item(s)})\n }\n\n @course.get_real_students.each do |student|\n if !@assignment.memberships(true).any?{|membership| membership.user_id == student.id }\n multi_flash(:notice, 'Student(s) without a team: ', student.email)\n end\n end\n\n\n respond_to do |format|\n format.html { redirect_to course_assignment_memberships_path(@course,@assignment) }\n format.json { render json: @membership, status: :created, location: @membership }\n end\n end",
"title": ""
},
{
"docid": "c71ff9c07dd55d256583cbad3efc72ff",
"score": "0.52930087",
"text": "def add_to_team_and_org(team_name, username, org)\n\n team_id = if team_id.nil?\n create_team(org, team_name, org)\n else\n get_team_id(team_name, org)\n end\n\n # Add username to team_id\n # Slightly different than adding them as a member.\n # If the username includes \",\"s, split it because it's a full list!\n username.split(\",\").each do |name|\n @client.add_team_membership(team_id, name)\n puts \"#{name} added to #{team_name}.\"\n end\n\nend",
"title": ""
},
{
"docid": "ffdd8e56abaec8134b18363a8dd76df9",
"score": "0.52639854",
"text": "def invite_resource\n super do |u|\n assign_teams(u)\n end\n end",
"title": ""
},
{
"docid": "84d268d12f4c942d3dcba397cd52421d",
"score": "0.52575904",
"text": "def set_review_team\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n @members = []\n Role.get_open_reviewer_roles.each do |role|\n entry_user = @board_design_entry.board_design_entry_users.detect{ |eu| eu.role_id == role.id }\n @members << { :role => role,\n :member_list => role.active_users,\n :member_id => entry_user ? entry_user.user_id : 0,\n :required => !entry_user || (entry_user && entry_user.required?) }\n end\n @back_action = 'set_management_team',\n @next_action = 'view_attachments'\n\n render(:action => \"set_team\")\n end",
"title": ""
},
{
"docid": "27953f8aea5b1295718dc7253faaf6ec",
"score": "0.52434766",
"text": "def load_users_from_movielens\n File.open(ML_USERS_FILE).each do |line|\n id = line.split(ML_ITEM_SEPARATOR)[0].to_i\n @users[id] = Recommendation::User.new(id, \"U-#{id}\")\n end\n end",
"title": ""
},
{
"docid": "6ac5dcfb985c3c70cb5116c7f1db3b27",
"score": "0.5240208",
"text": "def import \n row_id = Fixture.import(params[:file])\n @g = (params[:game])\n game = @g[\"game_id\"]\n Fixture.updaterow(row_id, game)\n redirect_to fixtures_path, notice: \"Matches imported.\"\n end",
"title": ""
},
{
"docid": "b100fc398d501ce6022c4c4be0e1edfa",
"score": "0.5239416",
"text": "def update\n @team = Team.find(params[:id])\n\n params[:team][:players_names].split(\", \").each do |p|\n @team.players << Player.find_by_username(p.scan(/\\((.*?)\\)/))\n end\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, :notice => 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5cc271178dcb57944c5936d20d124d33",
"score": "0.52231765",
"text": "def imported_members(import_id)\n get(\"/members/imports/#{import_id}/members\")\n end",
"title": ""
},
{
"docid": "d1112ccef0be7fc0ae80efe6eb415718",
"score": "0.52165645",
"text": "def set_team_member\n \n board_design_entry = BoardDesignEntry.find(params[:bde_id])\n role = Role.find(params[:role_id])\n member_id = params[:user_id].to_i\n required = params[:req].to_i\n entry_user = board_design_entry.board_design_entry_users.detect {\n |eu| eu.role_id == role.id }\n\n if entry_user\n # change assignment\n entry_user.user_id = member_id\n entry_user.required = required\n entry_user.save\n else\n # create assignment\n entry_user = BoardDesignEntryUser.new\n entry_user.role_id = role.id\n entry_user.user_id = member_id\n entry_user.required = required\n entry_user.board_design_entry_id = board_design_entry.id\n entry_user.save\n end\n \n render(:nothing => true)\n \n end",
"title": ""
},
{
"docid": "f06e6d99d2b98c40b7152071abeede4f",
"score": "0.5207737",
"text": "def by_team\n by_team_data = []\n target_dir = by_team_dir\n Dir.foreach(target_dir) do |file|\n next if file == '.' or file == '..'\n json_file = File.open(target_dir + file)\n parsed_file = JSON.parse(File.read(json_file))\n fixture_values = parsed_file[\"api\"][\"fixtures\"].values\n fixture_values.each { |v| by_team_data.push(v.deep_symbolize_keys!)}\n end\n\n by_team_data\n end",
"title": ""
},
{
"docid": "969375b2399c2323ecbe355777b5e546",
"score": "0.52052206",
"text": "def load_tournaments(filename)\n json_string = File.open(filename).read\n questions = JSON.parse(json_string)\n\n ActiveRecord::Base.transaction do\n questions.each do |q|\n tournament = q[\"Tournament\"]\n year = q[\"Year\"].to_i\n if !Tournament.exists?(name: \"#{year} #{tournament}\")\n Tournament.create(name: \"#{year} #{tournament}\", year: year, difficulty: 5)\n puts \"Creating tournament: #{year} #{tournament}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ddea0bba25934ac9cfa55f18b09b95c1",
"score": "0.52049327",
"text": "def set_team\n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n @management_title = \"Management Team\"\n @review_title = \"Review Team\"\n\n @members = []\n Role.get_open_reviewer_roles.each do |role|\n entry_user = @board_design_entry.board_design_entry_users.detect{ |eu| eu.role_id == role.id }\n @members << { :role => role,\n :member_list => role.active_users,\n :member_id => entry_user ? entry_user.user_id : 0,\n :required => !entry_user || (entry_user && entry_user.required?) }\n end\n\n @management_members = []\n Role.get_open_manager_reviewer_roles.each do |role|\n entry_user = @board_design_entry.board_design_entry_users.detect{ |eu| eu.role_id == role.id }\n @management_members << { :role => role,\n :member_list => role.active_users,\n :member_id => entry_user ? entry_user.user_id : 0,\n :required => !entry_user || (entry_user && entry_user.required?) }\n end\n\n @back_action = 'edit_entry'\n @next_action = 'view_attachments'\n\n render(:action => \"set_team\")\n\n end",
"title": ""
},
{
"docid": "3f18f85b8f163bbeeb317ecad1681943",
"score": "0.51884973",
"text": "def putMemberInitials(memberId, value)\n\n\thash = Hash.new\n\thash[:value] = value\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/members/\"+memberId+\"/initials\", hash \n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "e97de500b26098daed80279f874ebb78",
"score": "0.51882565",
"text": "def process_file (filename)\n\n @log.info \"CustomRole file: \" + filename\n if File.exists?('updated.json')\n @log.error \"updated.json already exists\"\n exit 1\n end\n if File.exists?(filename)\n File.readlines(filename).each do |line|\n begin\n json = JSON.parse(line)\n rescue Exception => e\n @log.error \"Unable to parse line as json: \" + line\n e.backtrace.each { |trace_line| @log.error trace_line }\n next\n end\n body = json[\"body\"]\n roles = body[\"roles\"]\n\n roles.each do |role|\n if role[\"groupTitle\"] == 'IT Administrator'\n new_rights = Array.new\n new_rights = role[\"rights\"]\n if !new_rights.include?('APP_AUTHORIZE')\n new_rights.push('APP_AUTHORIZE')\n role[\"rights\"] = new_rights\n end\n end\n end\n body[\"roles\"] = roles\n File.open('updated.json', 'a') do |file|\n file.puts(json.to_json)\n end\n end\n end\n FileUtils.mv('updated.json', filename) if File.exist?('updated.json')\n\nend",
"title": ""
},
{
"docid": "529d2f842eaf95d3a887b4c1bcdaafb6",
"score": "0.5174532",
"text": "def import\n if (params[:file])\n\n flash[:notice] = Member.import(params[:file])\n else\n flash[:error] = \"Valitse ensin tiedosto\"\n end\n\n redirect_to members_path\n end",
"title": ""
},
{
"docid": "cfb7c82a818f90d1253281a39db1f92e",
"score": "0.5172628",
"text": "def import()\r\n\t\tprint \"Enter name of file to import (ex. '15.csv'): \"\r\n\t\tfilepath = gets.chomp()\r\n\t\tset = Set.inputFile(\"files/#{filepath}\") #read the csv file line-by-line and creates a new set for the subscribers\r\n\t\tif set == 0\r\n\t\t\tputs \"Maybe you forgot the .csv, or it just doesn't exist\"\r\n\t\telse\r\n\t\t\tavailable_set_list[filepath] = set\t #add the set read from the csv to the list of available sets\r\n\t\tend\r\n\t\tmainmenu() #bring up the main menu again\r\n\tend",
"title": ""
},
{
"docid": "89e9e70b2722859d8a376b56e0ef2531",
"score": "0.51665074",
"text": "def member_imports\n imports = params[:imports].nil? ? [] : params[:imports]\n head :ok, format: :json if imports.empty?\n begin\n imports.each do |import|\n doc = Document.new file: Base64.decode64(import[:file])\n doc.save_or_get\n type = import[:type]&.downcase&.to_sym\n\n if type == :dv\n import = Import.create(document_id: doc.id, import_type: 'ImportJob::DV', dataset_id: params[:id], state: :pending)\n ImportJob::DV.perform_async(doc.id, {object: params[:id], import_id: import.id})\n elsif type == :topicv\n import = Import.create(document_id: doc.id, import_type: 'ImportJob::TopicV', dataset_id: params[:id], state: :pending)\n ImportJob::TopicV.perform_async(doc.id, {object: params[:id], import_id: import.id})\n end\n end\n head :ok, format: :json\n rescue => e\n render json: {message: e}, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "9dd218dedade536b3f44a32d91fda278",
"score": "0.5159331",
"text": "def set_api_v1_team_member\n @api_v1_team_member = Api::V1::TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "9668d2740e15576141c3d6bea4182d3f",
"score": "0.5154247",
"text": "def import_users(users_file, connection_id)\n fail Auth0::InvalidParameter, 'Must specify a valid file' if users_file.to_s.empty?\n fail Auth0::InvalidParameter, 'Must specify a connection_id' if connection_id.to_s.empty?\n request_params = {\n users: users_file,\n connection_id: connection_id\n }\n path = \"#{jobs_path}/users-imports\"\n post_file(path, request_params)\n end",
"title": ""
},
{
"docid": "0895b86fca214b708983441a88561028",
"score": "0.5151397",
"text": "def set_management_team\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n @title = \"Management Team\"\n @members = []\n Role.get_open_manager_reviewer_roles.each do |role|\n entry_user = @board_design_entry.board_design_entry_users.detect{ |eu| eu.role_id == role.id }\n @members << { :role => role,\n :member_list => role.active_users,\n :member_id => entry_user ? entry_user.user_id : 0,\n :required => !entry_user || (entry_user && entry_user.required?) }\n end\n\n @back_action = 'edit_entry'\n @next_action = 'set_review_team'\n\n render(:action => \"set_team\")\n\n end",
"title": ""
},
{
"docid": "a3ffdfdf6768bbc237f6bd6038f09b5f",
"score": "0.5144001",
"text": "def import_group_members(starting_index, row)\n index = starting_index\n while index < row.length\n user = User.find_by_name(row[index].to_s.strip)\n if user.nil?\n raise ImportError, \"The user \\\"\" + row[index].to_s.strip + \"\\\" was not found. <a href='/users/new'>Create</a> this user?\"\n else\n if GroupsUser.where([\"group_id =? and user_id =?\", id, user.id]).first.nil?\n add_member(user, nil)\n end\n end\n index += 1\n end\n end",
"title": ""
},
{
"docid": "ae080a52bb7e875a44104907c70677a8",
"score": "0.5129967",
"text": "def setData(fileName)\n file = open(fileName)\n json = file.read\n parsed = JSON.parse(json)\n end",
"title": ""
},
{
"docid": "422e03eab69cea2c3d2aceab3cfbdbc7",
"score": "0.51255786",
"text": "def member_imports\n imports = params[:imports].nil? ? [] : params[:imports]\n head :ok, format: :json if imports.empty?\n #\n # binding.pry\n # 1\n begin\n imports.each do |import|\n doc = Document.new(file: Base64.decode64(import[:file]), item: @object)\n doc.save_or_get\n\n type = import[:type]&.downcase&.to_sym\n import = Import.create(document_id: doc.id, import_type: @@map[type], instrument_id: params[:id], state: :pending)\n @@map[type].perform_async(doc.id, {object: params[:id], import_id: import.id})\n end\n head :ok, format: :json\n rescue => e\n render json: {message: e}, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "b78fa52b1997a6fe4c3ef259d3cdf681",
"score": "0.5124322",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "b78fa52b1997a6fe4c3ef259d3cdf681",
"score": "0.5124322",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d218b5ae939108d58f2398660de66eb",
"score": "0.51227945",
"text": "def create_teams\n @transform['teams'].each do |tobj|\n team = team_class.create(title: tobj['title'], color: tobj['color'], team_set_id: @new_team_set.id, authable: @space)\n team.thinkspace_common_users << user_class.where(id: tobj['user_ids'])\n delta_team = @delta[:teams].find { |t| t[:id] == tobj['id']}\n delta_team[:new_id] = team.id\n end\n end",
"title": ""
},
{
"docid": "9d6e1e5f538f484e7bb7bead996e501e",
"score": "0.5121096",
"text": "def set_group_members\n group_leaders_id = \"1767\"\n regional_coord_id = \"946\"\n #users from sf w swc\n group_members = sf.client.query(\"SELECT Id, Email, FirstName, LastName, Group_Leader_del__c, SWC_User_ID__c, Group_del__r.SWC_Group_ID__c,\n Group_del__c, Is_Regional_Coordinator__c FROM Contact WHERE SWC_User_ID__c <> null AND Group_del__c <> null AND Group_del__r.SWC_Group_ID__c <> null\")\n\n update = group_members.each_with_object([]) do |contact, updates|\n # this will create a user if we don't filter SF users by those with SWC ID\n next unless contact&.Group_del__r&.SWC_Group_ID__c.present? \n\n group_ids = [contact.Group_del__r.SWC_Group_ID__c.to_i.to_s]\n group_ids << group_leaders_id if contact.Group_Leader_del__c\n group_ids << regional_coord_id if contact.Is_Regional_Coordinator__c\n\n updates << { '*_email_address': contact.Email.to_s.gsub('+', '%2B'), '*_username': contact.FirstName + ' ' + contact.LastName,\n '*_first_name': contact.FirstName, '*_last_name': contact.LastName, \n 'o_groups': group_ids.join(',') }\n end\n # can do multiple of the same user\n File.open(GROUP_MEMBERS, 'w') { |f| f.puts(update.to_json) }\n end",
"title": ""
},
{
"docid": "7e6aa94e5b533bc930bb70b6b5c775b7",
"score": "0.5113892",
"text": "def team_member_params\n params.require(:team_member).permit(:name, :position, :achievement, :image)\n # params.require(:template).permit(:title, :body, :icon, :color, groups_attributes: [:id, :name])\n end",
"title": ""
},
{
"docid": "6fff3f807d607da40f414e437baca572",
"score": "0.5101541",
"text": "def import_file(file_name)\n members = []\n headers = nil\n table = FasterCSV.read(file_name)\n table.each do |row|\n if headers.nil?\n headers = row\n else\n member = Member.new\n headers.each do |header|\n header = from_responsys_field(header)\n value = row.shift\n member.send(\"#{header}=\", value) if member.respond_to?(\"#{header}=\")\n end\n members << member\n end\n end\n members\n end",
"title": ""
},
{
"docid": "9ddec5d60529821b9c8769f5e273a5e7",
"score": "0.50990176",
"text": "def initial_import(user, username, projectname, group)\n if group.nil?\n group = @user.wrapper_group\n end\n # set import status\n project = GithubRepo.find_by(github_user: username, project_name: projectname, group_id: group.id)\n\n if project.imported.nil? || !project.imported\n\n\n project.imported = 1\n\n\n # encounter stop\n if Encounter.last\n Encounter.last.close\n end\n\n # new encounter\n import_campaign = Campaign.create({name: projectname,\n description: \"Imported Project for #{projectname}\",\n group_id: @user.wrapper_group.id,\n vcs: true\n })\n project.campaign_id = import_campaign.id\n project.save\n\n\n create_round(import_campaign, action_name, import_campaign)\n\n # import commits & issues\n list_commits user, username, projectname, Encounter.last, import_campaign\n list_issues username, projectname, Encounter.last, import_campaign\n\n\n end\n\n\n end",
"title": ""
},
{
"docid": "37272c7d43dffbb5be9f6ea80c40a785",
"score": "0.5096476",
"text": "def import_lead\n end",
"title": ""
},
{
"docid": "6de33ff9046241481fe9975bff9f5330",
"score": "0.50928736",
"text": "def import file_path, allow_creation = false\n raise IOError, \"File not found: #{file_path}\" unless File.exist? file_path\n\n import_data = {}\n File.open(file_path, 'r') do |f|\n # Read array of stage hashes\n # FIXME is this REALLY an array?\n import_data = YAML.load(f)\n end\n\n existing_stages = list\n\n import_data.each do |name, data|\n if existing_stages.include? name\n update name, data\n else\n if allow_creation\n create data\n else\n puts \"Stage '#{name}' does not exist. Skipping import.\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "20ff443f1e2943636ea0dfcca20d3089",
"score": "0.5092865",
"text": "def set_teammember\n @teammember = Teammember.find(params[:id])\n end",
"title": ""
},
{
"docid": "d024a397a4e873f073f512b56ee6333d",
"score": "0.50775075",
"text": "def load_users_from_movielens\n File.open(ML_USERS_FILE).each do |line|\n id = line.split(ML_PRODUCT_SEPARATOR)[0].to_i\n @users[id] = Recommendation::User.new(id, \"U-#{id}\")\n end\n end",
"title": ""
},
{
"docid": "0ceddfddca35c443d414683b0ae85205",
"score": "0.5076602",
"text": "def load_from_file(filename)\n puts \"LOAD MATCH #{filename}\"\n properties = JSON.parse(File.read(filename),{:symbolize_names => true})\n puts \"LOAD - Properties: #{properties.inspect}\"\n\n # Assign the properties\n PROPERTIES.each do |property|\n self.send \"#{property}=\", properties[property]\n end\n puts \"LOAD - Players: #{players.inspect}\"\n rescue => e\n raise ArgumentError, \"Failed to load existing item: #{e.message}\"\n end",
"title": ""
},
{
"docid": "a10917e2b0507989396309f2ac7f3a42",
"score": "0.50580364",
"text": "def run_import\n\tif [BASECAMP_ACCOUNT, BASECAMP_USERNAME, BASECAMP_PASSWORD, CODEBASE_USERNAME, CODEBASE_API_KEY].any? { |c| c.empty? }\n\t\tputs \"Please edit the script to include your Codebase and Basecamp credentials\"\n\t\texit 1\n\tend\n\n\t## Build a user mapping BASECAMP_ID => CODEBASE_ID\n\tcodebase_users = codebase_request('/users')\n\tbasecamp_users = basecamp_request('/people.json')\n\n\tunless codebase_users && basecamp_users\n\t\tputs \"Could not fetch user lists. Are your credentials on the level?\"\n\t\texit\n\tend\n\n\tuser_map = basecamp_users.inject(Hash.new) do |memo, basecamp_user| \n\t\t# Find a user in Codebase with the same email address\n\t\tcodebase_user = codebase_users.select {|user| user[\"user\"][\"email_address\"] == basecamp_user[\"email_address\"] }.first\n\t\tmemo[basecamp_user[\"id\"]] = codebase_user[\"user\"][\"id\"] if codebase_user\n\t\tmemo\n\tend\n\n\tbasecamp_projects = basecamp_request('/projects.json')\n\treturn unless basecamp_projects\n\n\tbasecamp_projects.each do |basecamp_project|\n\t\t# Create the project in codebase\n\t\tcodebase_project = codebase_request(\"/create_project\", :post, {'project' => {'name' => basecamp_project[\"name\"]}})\n\t\treturn unless codebase_project\n\n\t\tdiscussions_page = 1\n\t\tbegin\n\t\t\tbasecamp_topicables = basecamp_request(\"/projects/#{basecamp_project[\"id\"]}/topics.json?page=#{discussions_page}\").select{|topic| topic[\"topicable\"][\"type\"] == \"Message\"}\n\t\t\treturn unless basecamp_topicables\n\n\t\t\tbasecamp_topicables.each do |basecamp_topicable|\n\t\t\t\tbasecamp_discussion = basecamp_request(\"/projects/#{basecamp_project[\"id\"]}/messages/#{basecamp_topicable[\"topicable\"][\"id\"]}.json\")\n\n\t\t\t\tcodebase_payload = {:discussion => {:subject => basecamp_discussion[\"subject\"], :content => DownmarkIt.to_markdown(basecamp_discussion[\"content\"]),\n\t\t\t\t\t:created_at => basecamp_discussion[\"created_at\"], :updated_at => basecamp_discussion[\"updated_at\"] }}\n\t\t\t\tif codebase_user_id = user_map[basecamp_discussion[\"creator\"][\"id\"]]\n\t\t\t\t\tcodebase_payload[:discussion][:user_id] = codebase_user_id\n\t\t\t\telse\n\t\t\t\t\tcodebase_actor_name = basecamp_discussion[\"creator\"][\"name\"]\n\t\t\t\t\tcodebase_payload[:discussion_post][:author_name] = codebase_actor_name\n\t\t\t\t\tcodebase_payload[:discussion_post][:author_email] = \"\"\n\t\t\t\tend\n\t\t\t\tcodebase_discussion = codebase_request(\"/#{codebase_project[\"project\"][\"permalink\"]}/discussions\", :post, codebase_payload)\n\n\t\t\t\tbasecamp_discussion[\"comments\"].each do |basecamp_update|\n\n\t\t\t\t\tcodebase_payload = {:discussion_post => {:content => DownmarkIt.to_markdown(basecamp_update[\"content\"]), \n\t\t\t\t\t\t:created_at => basecamp_update[\"created_at\"], :updated_at => basecamp_update[:updated_at]}}\n\t\t\t\t\tif codebase_user_id = user_map[basecamp_update[\"creator\"][\"id\"]] \n\t\t\t\t\t\tcodebase_payload[:discussion_post][:user_id] = codebase_user_id\n\t\t\t\t\telse\n\t\t\t\t\t\tcodebase_actor_name = basecamp_update[\"creator\"][\"name\"]\n\t\t\t\t\t\tcodebase_payload[:discussion_post][:author_name] = codebase_actor_name\n\t\t\t\t\t\tcodebase_payload[:discussion_post][:author_email] = \"\"\n\t\t\t\t\tend\n\n\t\t\t\t\tcodebase_update = codebase_request(\"/#{codebase_project[\"project\"][\"permalink\"]}/discussions/#{codebase_discussion[\"discussion\"][\"permalink\"]}/posts\", :post, codebase_payload)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tdiscussions_page += 1\n\t\tend while basecamp_topicables.length > 0\n\tend\nend",
"title": ""
},
{
"docid": "979f87933edb3a9f14513e0119721e6b",
"score": "0.50528634",
"text": "def import_parties(file)\n @parties = File.open( file, \"r\" ) { |f| JSON.load( f )}[\"party\"] rescue nil\n @party_index = {}\n return unless @parties\n bar = ProgressBar.create(:title => \"Indexing Parties\", :starting_at => 0, :total => @parties.count)\n @parties.each do |p| \n id = p[\"id\"]\n @party_index[id] = p\n bar.increment\n end\n end",
"title": ""
},
{
"docid": "6c233ed9b6f2618a126cfaf57ea34384",
"score": "0.5051141",
"text": "def load_data(set, file)\n\t\tusers_hash = set[:users]\n\t\tmovies_hash = set[:movies]\n\t\tdata = open(file)\n\t\tdata.each_line do |line|\n\t\t\tprocess_line(line, users_hash, movies_hash)\n\t\tend\n\t\tdata.close\n\tend",
"title": ""
},
{
"docid": "abb3cc655e39bf9562abac483ea59aad",
"score": "0.50495803",
"text": "def import(update_membership, year = nil)\n ActiveSupport::Notifications.instrument(\n \"import.people_file.racing_on_rails\", update_membership: update_membership, import_file: import_file, rows: table.rows.size\n ) do\n @update_membership = update_membership\n\n @has_print_column = table.columns.any? do |column|\n column.key == :print_card\n end\n\n year = year.to_i if year\n assign_member_from_imported_people year\n\n boolean_attributes = Person.columns.select { |c| c.type == :boolean }.map(&:name)\n\n Person.transaction do\n table.rows.map(&:to_hash).each do |row|\n row[:updater] = import_file\n logger.debug(row.inspect) if logger.debug?\n next if blank_name?(row)\n\n row.each do |key, value|\n row[key] = false if key.to_s.in?(boolean_attributes) && value.blank?\n end\n\n combine_categories row\n delete_blank_categories row\n delete_bad_date_of_birth row\n\n people = find_people(row)\n\n row[:member_to] = @member_to_for_imported_people if @update_membership\n\n if people.empty?\n create_person row, year\n elsif people.size == 1\n update_person row, people.first, year\n else\n create_duplicate row, year, people\n end\n end\n end\n end\n [@created, @updated]\n end",
"title": ""
},
{
"docid": "c1b05a962144c3a4638bdb3f0957b7a6",
"score": "0.5048109",
"text": "def create_team_member\n clinics = params[:clinics].split(\", \")\n\n team_member = User.create(\n email: params[:email],\n first_name: params[:first_name],\n last_name: params[:last_name],\n user: params[:user],\n status: \"Active\",\n role: params[:role]\n )\n\n clinics.each do |clinic|\n Clinic.find(clinic).users << team_member\n end\n\n render json: team_member, include: ['clinics']\n end",
"title": ""
},
{
"docid": "a7eafb0124d04cfd6fd70d3365f9c032",
"score": "0.5042401",
"text": "def setup_battle_test_members\r\n $data_system.test_battlers.each do |battler|\r\n actor = $game_actors[battler.actor_id]\r\n actor.change_level(battler.level, false)\r\n actor.init_equips(battler.equips)\r\n actor.recover_all\r\n add_actor(actor.id)\r\n end\r\n end",
"title": ""
},
{
"docid": "34bc3d2430fd4389bcf7fa49b35fe9d4",
"score": "0.5034926",
"text": "def import \n row_id = Fixture.import(params[:file])\n @g = (params[:game])\n game = @g[\"game_id\"]\n Fixture.updaterow(row_id, game)\n redirect_to fixtures_path, notice: \"Fixtures imported.\"\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "157f735ac682cc9d77eaa52eb7764c73",
"score": "0.50346494",
"text": "def set_team_member\n @team_member = TeamMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "b982ff141423b6d1e56b90b7e3fb1807",
"score": "0.5019466",
"text": "def import\n case params[:commit]\n when \"Cancel\"\n session[:people_file_path] = nil\n redirect_to(action: \"index\")\n\n when \"Import\"\n ActiveSupport::Notifications.instrument \"import.people.admin.racing_on_rails\", people_file_path: session[:people_file_path]\n\n Duplicate.delete_all\n path = session[:people_file_path]\n if path.blank?\n flash[:warn] = \"No import file\"\n return redirect_to(admin_people_path)\n end\n\n people_file = PeopleFile.new(path)\n people_file.import(params[:update_membership], params[:year])\n flash[:notice] = \"Imported #{pluralize(people_file.created, 'new person')} and updated #{pluralize(people_file.updated, 'existing person')}\"\n session[:people_file_path] = nil\n if people_file.duplicates.empty?\n redirect_to admin_people_path\n else\n flash[:warn] = \"Some names in the import file already exist more than once. Match with an existing person or create a new person with the same name.\"\n redirect_to duplicates_admin_people_path\n end\n expire_cache\n\n else\n raise \"Expected 'Import' or 'Cancel'\"\n end\n end",
"title": ""
},
{
"docid": "22524336ae66b9c22c288c236f60752a",
"score": "0.50186926",
"text": "def import_all\n catch(:exit) do\n @users.each_with_index do |user, i|\n catch(:next_user) do\n say \"\"\n say \"==== USER #{i + 1} / #{@users.length} ================================\"\n say \"User: #{user.first_name} #{user.last_name}\"\n say \"Email: #{user.email}\"\n say \"Role: #{user.role}\"\n say \"Site Access: #{user.site_access}\"\n\n # Initial check that the spreadsheet row is valid\n exit_if_user_invalid(user) unless user.valid?\n\n # Find the custom role that the user should be assigned (e.g. \"VITA Staff\").\n zendesk_role = find_zendesk_role(SPREADSHEET_ROLE_TO_ZENDESK_ROLE[user.role])\n\n # Find (or create) an array of groups that the user should belong to.\n zendesk_groups = find_or_create_zendesk_groups(user.site_access.split(/,|\\n/))\n zendesk_groups.push(intake_views_group)\n\n # We now have all the dependent objects. Find (or create) the user.\n zendesk_user = find_or_create_user(user, zendesk_role)\n\n # After the user is created, we can create the groups\n add_and_remove_user_groups(zendesk_user, zendesk_groups)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3cc56020cf81d487ef041cfc191696a4",
"score": "0.5013968",
"text": "def addUsersToTeam\n #@team = Team.find(params[:id])\n @team = current_user.currentGame().teams.find(params[:id])\n #puts \"HELLO?\"\n params.each do |key,value|\n if (splitKey = key.split(\" \"))[0] == \"USERID\"\n #puts \"----------- USER #{splitKey[1]}\"\n @team.users << User.find(splitKey[1.to_i])\n end\n\n #Rails.logger.warn \"Param #{key}: #{value}\"\n end\n if @team.save\n redirect_to @team, notice: 'Players successfully added to team'\n else\n redirect_to @team, error: 'Couldn\\'t add players to team'\n end\n end",
"title": ""
},
{
"docid": "e6f4178a1e904a4023ca50610d6c382e",
"score": "0.5011076",
"text": "def load_team(data)\n team = Team.where(:sport_id => sport.id, :league_id => league.id, :name => data['name'], :abbreviation => data['abbreviation'], :location => data['location']).first_or_create\n team.update_attributes(:color => data['color'], :conference_id => data['conference_id'], :division_id => data['division_id'],\n :source_id => data['id'],\n :source => 'api.espn.com')\n\n end",
"title": ""
},
{
"docid": "70f17187f40d788ea6b71bf767b1aa57",
"score": "0.5006814",
"text": "def allocate_members\r\n @tl = User.find(params[:tl])\r\n selected_processors = params[:users_to_assign]\r\n selected_processors = selected_processors.delete_if {|k, v| v==\"0\"}\r\n selected_processors.each {|k, v| u = User.find(k); u.teamleader = @tl; u.save }\r\n redirect_to :action => 'assign_members', :id => @tl\r\n end",
"title": ""
},
{
"docid": "7aa8bebee90a0ca5584c5264504992ba",
"score": "0.49987528",
"text": "def update_existing_team_members_profile\n cache_all_team_members(trace: TRACE)\n\n # These entries don't have all their fields set, so were manually entered.\n # Adding an @aucklanduni user manually, when they already exist with their staff email, will log an exception.\n @partial_entries.each do |v|\n puts \"Notice: Manually updating user profile for #{v['email']} from UoA LDAP\"\n begin\n update_team_users_profiles(email: v['email'])\n rescue StandardError => e\n warn \"Error: #{e}\"\n end\n end\n\n # Reload the team members, if we modified any of them.\n cache_all_team_members(trace: TRACE) if @partial_entries.length != 0\nend",
"title": ""
},
{
"docid": "be942bac50a27f3d1c2f009e61f8a5fc",
"score": "0.4982506",
"text": "def index_member\n @users = Team.find(params[:team_id]).users\n end",
"title": ""
},
{
"docid": "6a0844f207deef8c8c7e0b745de50ec5",
"score": "0.4978952",
"text": "def load_players(from_file)\n File.readlines(from_file).each do |line|\n add_player(Player.from_csv(line))\n end\nend",
"title": ""
},
{
"docid": "7924c357520b809e1ebdf984bbb33af4",
"score": "0.49746978",
"text": "def import_feature_set(file_id, owner_type, owner_sentera_id)\n puts 'Use file'\n\n gql = <<~GQL\n mutation ImportFeatureSet(\n $geometry_file_key: FileKey\n $name: String!\n $owner_sentera_id: ID!\n $owner_type: FeatureSetOwnerType!\n $type: FeatureSetType!\n ) {\n import_feature_set(\n geometry_file_key: $geometry_file_key\n name: $name\n owner_sentera_id: $owner_sentera_id\n owner_type: $owner_type\n type: $type\n ) {\n status\n }\n }\n GQL\n\n variables = {\n geometry_file_key: file_id,\n name: 'Test Feature Set',\n owner_sentera_id: owner_sentera_id,\n owner_type: owner_type,\n type: 'UNKNOWN'\n }\n\n response = make_graphql_request(gql, variables)\n json = JSON.parse(response.body)\n json.dig('data', 'import_feature_set')\nend",
"title": ""
},
{
"docid": "935d0145a0ffdd23b9fb1fa06bb85310",
"score": "0.49732655",
"text": "def process_team(event, msg)\n members = msg[2]\n team_size = msg[3].to_i\n\n players = members.split(',')\n\n event.respond team_gen(players, team_size)\nend",
"title": ""
},
{
"docid": "1de5044883725fa47b62b598b88e1b0d",
"score": "0.49699074",
"text": "def load(filename = nil)\n delim = /\\s*;\\s*/ # The delimiter for email and role lists\n enum = Aspire::Enumerator::ReportEnumerator.new(filename).enumerator\n enum.each do |row|\n # Construct a JSON data structure for the user\n uri = row[3]\n data = csv_to_json_api(row, email_delim: delim, role_delim: delim)\n csv_to_json_other(row, data)\n # Store the JSON data in the lookup table\n store[uri] = data\n end\n end",
"title": ""
},
{
"docid": "0ab6d591be5439c267d7b80a66b1d987",
"score": "0.49698663",
"text": "def generate_team_backup\n csvRows = get_csv_file('teams.csv')\n csvRows.each do |row|\n team = Team.new(\n :id => row[:teamid],\n :division_id => row[:divid],\n :long_name => row[:longname],\n :stat_loss => row[:statlosses],\n :stat_win => row[:statwins],\n :stat_play => row[:statplayed],\n :stat_pt_allowed => row[:statptsallowed],\n :stat_pt_scored => row[:statptsscored],\n :stat_tie => row[:statties],\n :description => row[:teamdesc],\n :name => row[:teamname],\n :win_perc => row[:statwinsperc],\n :stat_games_back => row[:statgamesback],\n :date_created => row[:datecreated],\n :date_updated => row[:dateupdated],\n :created_user_id => row[:bycreated],\n :updated_user_id => row[:byupdated]\n )\n team.save\n end\nend",
"title": ""
},
{
"docid": "221c3c7ccea3f4a9f2906091b9d00cd4",
"score": "0.49672762",
"text": "def set_team_member\n @team_member = TeamMember.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "ee40c95d79ecf1fb9d36d1df0784ff04",
"score": "0.49655342",
"text": "def perform(bulk_action_id, params)\n super\n\n csv = CSV.parse(params[:csv_file], headers: true)\n with_csv_items(csv, name: \"Embargo\") do |cocina_object, csv_row, success, failure|\n return failure.call(\"Not authorized\") unless ability.can?(:update, cocina_object)\n\n cocina_object = open_new_version_if_needed(cocina_object, \"Manage embargo\")\n update_embargo(cocina_object, csv_row)\n .either(\n ->(_val) { success.call(\"Embargo updated\") },\n ->(error) { failure.call(error) }\n )\n end\n end",
"title": ""
},
{
"docid": "5f609a25ea9f8896da58f6fac13c99f7",
"score": "0.49584582",
"text": "def set_team_member\n @team_member = TeamMember.where(:user_id => params[:user_id], :team_id => params[:team_id]).first\n end",
"title": ""
},
{
"docid": "50277f8aee54685ab4c82f37f7cb5744",
"score": "0.49515745",
"text": "def update_users\n records = JSON.parse(params[:cohort][:cohort_users_json])\n\n keys = [:email]\n fields = [:name,:github_id]\n\n keys = keys.map(&:to_s)\n fields = fields.map(&:to_s)\n\n records.each do |record|\n finder = record.slice(*keys)\n user = User.find_or_initialize_by(finder)\n user.attributes = record.slice(*fields)\n user.save\n\n CohortUser.find_or_create_by(:user_id => user.id, :cohort_id => cohort.id)\n end\n\n redirect_to url_for([\"admin\",cohort])\n end",
"title": ""
},
{
"docid": "9a76105b7fc253d03e7ad463aaace63f",
"score": "0.49500173",
"text": "def import\n isvalid = true;\n count = 0;\n errors = \"\"\n file_name = \"\"\n if params[:file] != nil\n if params[:file].path.include? \".csv\"\n file_name = CSV.open(params[:file].path, encoding: 'iso-8859-1:utf-8', :col_sep => ';') { |csv| csv.first }\n if file_name.to_s == '[\"charity_name\", \"award_reference_number\", \"award_title\", \"award_start_date\", \"award_end_date\", \"award_value\", \"host_institution\", \"pi_first_name\", \"pi_surname\", \"award_abstract\", \"award_summary\", \"research_reference_number\", \"amrc_grant_type\", \"animal_protection\", \"animal_species_used\", \"animal_genetic_modification\", \"organisational_code_1\", \"organisational_code_2\", \"organisational_code_3\", \"organisational_code_4\", \"funder_comments\"]'\n CSV.foreach(params[:file].path, encoding: 'iso-8859-1:utf-8', headers: true, :col_sep => ';') do |row|\n gd = GrantsData.new(row.to_hash.merge(userID: current_user.id))\n if !gd.valid?\n isvalid = false\n messages = gd.errors.full_messages\n messages.each do |e|\n errors = errors + e\n end\n break\n else\n isvalid = true\n gd.save\n count = count + 1\n end\n end\n if isvalid == true\n flash[:success] = \"Successfully added \" + count.to_s + \" rows of grants data.\"\n flash[:warning] = \"don't display\"\n flash[:danger] = \"don't display\"\n\n else\n flash[:warning] = \"Successfully added \" + count.to_s + \" rows of grants data. Row \" + (count+1).to_s + \" invalid\"\n flash[:danger] = errors\n flash[:success] = \"don't display\"\n end\nelse\n flash[:danger] = \"Please ensure column names on csv are correct, if you need an example download the template file\"\nend\nelse\n flash[:danger] = \"Sorry file uploaded must be a csv\"\nend\nelse\n flash[:danger] = \"Please attatch file\"\n\nend\n render action: \"grant_data\"\nend",
"title": ""
},
{
"docid": "4d5a38a91997f9c0055e2766e303ceaa",
"score": "0.49479514",
"text": "def import_from_file(file, row)\n row = sample_from_fixture(file, row)\n post_json \"/records\", {:data => row}\n end",
"title": ""
},
{
"docid": "670c0e22b70c8484a6af58eaa471252d",
"score": "0.4943886",
"text": "def seed_teams\n response = HTTParty.get('https://fantasy.premierleague.com/api/bootstrap-static/')\n response.parsed_response\n if response.nil?\n puts 'error seeding teams'\n else\n Team.destroy_all\n response['teams'].each do |team|\n Team.create(name: (team['name']).to_s, code: (team['code']).to_s)\n end\n end\nend",
"title": ""
},
{
"docid": "0d9e776b69545982b279df5f9ee41ff9",
"score": "0.49400553",
"text": "def import_users(users_file, connection_id, options = {})\n raise Auth0::InvalidParameter, 'Must specify a valid file' if users_file.to_s.empty?\n raise Auth0::InvalidParameter, 'Must specify a connection_id' if connection_id.to_s.empty?\n\n request_params = {\n users: users_file,\n connection_id: connection_id,\n upsert: options.fetch(:upsert, false),\n external_id: options.fetch(:external_id, nil),\n send_completion_email: options.fetch(:send_completion_email, true)\n }\n path = \"#{jobs_path}/users-imports\"\n post_file(path, request_params)\n end",
"title": ""
},
{
"docid": "139e0327ce28995c1ef2a6be394b3325",
"score": "0.49393663",
"text": "def add_users_ids_to_team(users_ids, access_role)\n UsersProject.bulk_import(self, users_ids, access_role)\n end",
"title": ""
},
{
"docid": "6148d779b60bffcbbe7629d2ec1d7771",
"score": "0.49373242",
"text": "def get_all_members\n\n request = Slack.users_list\n raw_members = request[\"members\"]\n all_members = []\n\n raw_members.each { |member|\n\n profile = member[\"profile\"]\n\n member_obj = {\n \"username\" => member[\"name\"],\n \"user_id\" => member[\"id\"],\n \"name\" => profile[\"real_name\"],\n \"email\" => profile[\"email\"]\n }\n\n all_members.push(member_obj)\n }\n\n # save data to DB\n\nend",
"title": ""
},
{
"docid": "4298b23a0498f13aa096a2b23523f3b0",
"score": "0.493484",
"text": "def run!\n start_time = Time.now\n if from_file?\n raise \"Import from file failed: file does not exits or wrong path #{self.file}\" unless File.exists?(self.file)\n #TODO: use a stream enabled parser for large files\n objects = JSON.parse(File.read(self.file))\n self.count = objects.empty? ? 0 : objects.size\n if self.count\n self.persiste!(objects)\n self.last_imported_ts = objects.last['created']\n end\n else\n self.token ||= self.user.token\n objects = self.get_from_stripe\n self.count = objects.count ? objects.data.size : 0\n if objects.count > 0\n self.persiste!(objects)\n self.last_imported_ts = objects.data.last.created\n end\n end\n self.time = (start_time-Time.now).to_i\n self.status = :succeeded\n self.save\n end",
"title": ""
},
{
"docid": "cecf31a7edd80cfcc806e1d208402258",
"score": "0.49330348",
"text": "def run_import_profile(profile)\n ap \"importing #{profile}\"\n # check to see if the player profile exists, otherwise import it\n import_profile = Hash.new\n profile[:emails].each do |player_email|\n import_profile = Profile.where(\"lower(email) = LOWER('#{player_email}')\").first\n if !import_profile.nil?\n break\n end\n end\n if profile[:emails].blank?\n profile[:emails].push(\"#{profile[:first_name]}#{profile[:last_name]}@teamsnap.com\")\n end\n # this player doesn't exist create a new profile\n # Set the profile as the first email from the list\n if import_profile.blank?\n import_profile = Profile.new\n import_profile.email = profile[:emails].first\n end\n\n\n # try to find a profile with at least one of the email addresses\n import_profile.first_name = profile[:first_name]\n import_profile.last_name = profile[:last_name]\n if import_profile.first_name.blank?\n import_profile.first_name = 'importedPlayer*'\n end\n\n if import_profile.last_name.blank?\n import_profile.last_name = 'importedPlayer*'\n end\n import_profile.gender = profile[:gender]\n import_profile.shirt_size = profile[:shirt_size]\n import_profile.is_pickup_player = profile[:is_pickup_player]\n import_profile.emergency_contact_name = profile[:emergency_contact_name]\n import_profile.emergency_contact_relationship = profile[:emergency_contact_relationship]\n import_profile.emergency_contact_phone = profile[:emergency_contact_phone]\n import_profile.dob = profile[:dob]\n import_profile.address = profile[:address]\n import_profile.address2 = profile[:address2]\n import_profile.city = profile[:city]\n import_profile.state = profile[:state]\n import_profile.zip = profile[:zip]\n random_string = (0...8).map { (65 + rand(26)).chr }.join\n import_profile.password = random_string\n\n if !import_profile.valid?\n error = Hash.new\n error[:type] = \"profile #{import_profile.first_name} #{import_profile.last_name} #{import_profile.email}\"\n error[:errors] = import_profile.errors\n @errors.push(error)\n ap \"---------Couldn't save profile #{import_profile.first_name} #{import_profile.last_name} #{import_profile.email} ----------\"\n ap import_profile.errors\n end\n import_profile.save\n import_profile\n end",
"title": ""
},
{
"docid": "084a88fc28fdaee4c956dee6d1540280",
"score": "0.49320537",
"text": "def add_users_ids_to_team(users_ids, access_role)\n UsersProject.bulk_import(self, users_ids, access_role)\n self.update_repository\n end",
"title": ""
}
] |
c330c1d32efb5312fdde8562eb1e0623
|
if the number is divisible by 2 the value should be one more than the key if the number is divisible by 7 the value should be one less than the key if the number is divisible by 2 and 7 the value should be the key multiplied by 2 otherwise the value should be the same number as the key
|
[
{
"docid": "a1f3f30a885d0e4e62048eb0e120f5f5",
"score": "0.66861016",
"text": "def my_method\n hash = Hash.new\n (1..50).each do |number|\n if number %2 == 0 && number %7 == 0\n hash[number] = number * 2\n elsif number %7 == 0\n hash[number] = number - 1\n elsif number %2 == 0\n hash[number] = number + 1\n else\n hash[number] = number\n end\n end\nputs \"********\"\nputs hash\nend",
"title": ""
}
] |
[
{
"docid": "76366648646d40daf088de21c45bba6e",
"score": "0.6574985",
"text": "def map_keys(num)\n return 0 if num <= 0\n\n num % MAX_VALUE\nend",
"title": ""
},
{
"docid": "0f18f84cb98fdac2f5dd83828c352907",
"score": "0.61288255",
"text": "def key_for_min_value(hash)\n check_key = nil #empty variables to store hash as iterated\n check_value = nil\n hash.each do |name, quantity| #for each key/value pair\n if check_value == nil || quantity < check_value #if the check_value is empty or the current value is less than the check_value\n check_value = quantity #set the check_value equal to the current value\n check_key = name #and the check_key equal to the current name\n end\n end\n check_key #iterates through all key/value pairs and only stores them if they're less than what is already stored.\nend",
"title": ""
},
{
"docid": "db9c082fb3588ed3a1f34428ec8740ee",
"score": "0.61162317",
"text": "def featured(n)\n quotient = n / 7\n if quotient.even?\n seven_multiple = (quotient + 1) * 7\n else\n seven_multiple = (quotient + 2) * 7\n end\n \n loop do\n break if seven_multiple.digits.reverse.uniq.join.to_i == seven_multiple\n seven_multiple += 14\n return \"There is no possible number that fulfills those requirements.\" if seven_multiple.digits.size > 10\n end\n \n seven_multiple\nend",
"title": ""
},
{
"docid": "0308c39e3da1ffb9bab95074c2cadea5",
"score": "0.60911876",
"text": "def calculate_value(number, multiple_text_hash = {:Fizz => 3 , :Buzz => 5 })\n output = ''\n multiple_text_hash.each {|key, value| output += key.to_s if number % value == 0}\n output.empty? ? number : output\nend",
"title": ""
},
{
"docid": "3b47349262a1e49c81b12779df536ed4",
"score": "0.6085263",
"text": "def h(k, m=5)\n k % m\n end",
"title": ""
},
{
"docid": "fa5be35c3840680a326d0b73cca09661",
"score": "0.6060761",
"text": "def bakery_num(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n food_qty = my_list[fav_food]\n fav_qty = 0\n second_fav_qty = 0\n third_fav_qty = 0\n\n \n raise ArgumentError.new(\"You can't make that food\") unless my_list.include?(fav_food)\n \n if num_of_people % food_qty == 0 \n num_of_food = num_of_people / food_qty \n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n \n else\n while num_of_people > 0\n \n max_value = my_list.keep_if {|k, v| k != fav_food}.values.max\n min_value = my_list.keep_if {|k, v| k != fav_food}.values.min\n \n if num_of_people / food_qty > 0 \n fav_qty = num_of_people / food_qty\n num_of_people = num_of_people % food_qty\n \n elsif num_of_people / max_value > 0 \n second_fav_qty = num_of_people / max_value\n num_of_people = num_of_people % max_value\n \n else \n third_fav_qty = num_of_people\n num_of_people = 0\n end\n end\n return \"You need to make #{fav_qty} #{fav_food}(s), #{second_fav_qty} #{my_list.key(max_value)}(s), and #{third_fav_qty} #{my_list.key(min_value)}(s).\"\n end\n\nend",
"title": ""
},
{
"docid": "1357a8d3b0133582dd7d90802c350a0e",
"score": "0.604965",
"text": "def h(k, m=5)\n k % m\nend",
"title": ""
},
{
"docid": "2bef0ee434697187281752ac8b7c5345",
"score": "0.6035147",
"text": "def operation_DCLXVI_integer_satani\n num = gets.chomp\n int = num.to_i\n\n array = [1, 5, 10, 50, 100, 500, 1000]\n\n hash = { 1 => \"I\", 5 => 'V', 10 => 'X', 50 => 'L', 100 => 'C', 500 => 'D', 1000 => 'M'}\n\n while array != []\n lastno = array.pop.to_i\n x = (int / lastno)\n print hash[lastno] * x # select and print the appropriate key from the hash, the number of times specified by 'multiple'\n int -= x * lastno\n end\nend",
"title": ""
},
{
"docid": "5b2686a4e3ebc89188af6dd5a2f6f4e2",
"score": "0.59937453",
"text": "def featured(number)\n seven_multiple = 7\n count = 0\n\n loop do\n seven_multiple += 7\n count += 1\n break if seven_multiple.odd? && seven_multiple > number && \n seven_multiple.to_s.chars.uniq.size == seven_multiple.to_s.size\n end\n\n if number < 9_999_999_999\n seven_multiple\n else\n puts \"There is no possible number that fulfills those requirements\"\n end\nend",
"title": ""
},
{
"docid": "6caa1bf04f1863ba0c866ed0dc65e1b4",
"score": "0.5963512",
"text": "def key_for_min_value(n)\n max = 1000000\n answer = nil\n n.each do |k,v|\n if v < max\n max = v\n answer = k\n end\n\n\n\n\n end\n answer\nend",
"title": ""
},
{
"docid": "b307eb71bf0894adf8b02e4f227ec0cb",
"score": "0.59390736",
"text": "def floor(key)\n end",
"title": ""
},
{
"docid": "bb2d9ba4b3d627ebf81641a0bd27211b",
"score": "0.5927958",
"text": "def fizzbuzz number\n #if number == 15 then return \"fuzzbuzz\" end\n val = \"\"\n NumDict.keys.each { |k| if number % k == 0 then val += NumDict[k] end}\n if val == \"\" then val = number end\n return val\nend",
"title": ""
},
{
"docid": "26aa5669ec5e87787c1158e62eaae46b",
"score": "0.5922015",
"text": "def mmul(k,u)\n u - (u%k)\nend",
"title": ""
},
{
"docid": "d0267bc73c114b8bb01da3c3dd73e13b",
"score": "0.5921183",
"text": "def keep_num_less5(ha,num)\r\n\tnew_hash = Hash.new(0)\r\n\t\r\n\tha.each do |x|\r\n\t\tif x[1] < num\r\n\t\tnew_hash[x[0]]=x[1] \r\n\t\tend\r\n\tend\r\n\r\np ha.replace( new_hash)\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "14b1d694222f6e94d7e6a7a7cb9f4c75",
"score": "0.59112144",
"text": "def f(v)\n if v % 2 == 0 && v % 7 != 0\n v + 1\n elsif v % 7 == 0 && v % 2 != 0\n v - 1\n elsif v % 2 == 0 && v % 7 == 0\n v * 2\n else\n v\n end\nend",
"title": ""
},
{
"docid": "7a16e63c6ea0a6e994e213b1f4c8aaf1",
"score": "0.58923084",
"text": "def key_for_min_value(hash)\n hash.each do |name, num|\n if num == 1 || num == 10 \n return name\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "ea19c607f7c85b73437b573ac27240dd",
"score": "0.5873691",
"text": "def modulo( value )\n return ((value - self.min)%self.size + self.min)\n end",
"title": ""
},
{
"docid": "e09a69e2587c17c99580cb96572cb542",
"score": "0.5866728",
"text": "def key_for_min_value(name_hash)\n smol = 10 \n smol_key = nil \n name_hash.each do |key, value|\n if value <= smol\n smol = value\n smol_key = key \n end\n end\n smol_key\nend",
"title": ""
},
{
"docid": "eb61a0401ec363265b9ed7c0cec6a111",
"score": "0.58645",
"text": "def hash_val(num)\r\n num % 65_536\r\n end",
"title": ""
},
{
"docid": "aa8396c3d6582e5d093dd07be89e84dc",
"score": "0.5863753",
"text": "def is_good a\n b = a ; n = 0; i = 0;\n ar_hash = {0 => 0, 1 => 1, 8 => 8, 2 => 5, 5 => 2, 6 => 9, 9 => 6}\n\n loop do\n break if b == 0\n k = b%10\n if ar_hash[k] != nil\n n += ar_hash[k] * 10 ** i\n else\n return false\n end\n b = b/10\n i += 1\n end\n\n if n - a != 0\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "c4e35b8aa3dda4faa3a0dd0b1bf4e845",
"score": "0.58429134",
"text": "def s2n?(arr, num)\n h = Hash.new\n arr.each { |val| return true if h.key? val ; h[num-val] = val }\n result = false\nend",
"title": ""
},
{
"docid": "30066fd3795c63f7cf6689e3916d1df1",
"score": "0.5825961",
"text": "def division_h(k, m)\n k % m\nend",
"title": ""
},
{
"docid": "8a5a6158440c6829b1f9d24daf9069fc",
"score": "0.5812257",
"text": "def next_value_to_try(previous_val, tried_values)\n next_val = previous_val + 2\n if !Prime.prime?(next_val)\n next_value_to_try(next_val, tried_values)\n elsif tried_values.include?(next_val.to_s.split('').sort.join.to_i)\n next_value_to_try(next_val, tried_values)\n elsif next_val % 5 == 0\n # if next_val % 5 == 0\n next_value_to_try(next_val, tried_values)\n else\n next_val\n end\nend",
"title": ""
},
{
"docid": "629750175374a3c7006ebd53580cf40a",
"score": "0.58090293",
"text": "def key_for_min_value(name_hash)\n new_num = nil\n new_key = nil\n name_hash.each do |key, value|\n if new_num == nil || value < new_num\n new_num = value\n new_key = key\n end\n puts new_num\n puts new_key\n end\nnew_key\n \n end",
"title": ""
},
{
"docid": "aa76d0780676d03382fe1adddbf5b8de",
"score": "0.5807344",
"text": "def key_for_min_value(name_hash)\n minimum_value = 550\n name_value = nil\n \n name_hash.each do |name, number|\n if minimum_value > number \n minimum_value = number\n name_value = name\n end\n end\n \n name_value\nend",
"title": ""
},
{
"docid": "e8c0443c20f9ebe8bf0dd059c941881e",
"score": "0.5807021",
"text": "def room?(num)\n divisor_sum = 0\n # The values aren't used. \n subsets = {0 => true}\n for d in 1..(num/2)\n next unless num % d == 0\n divisor_sum += d\n subsets.keys.each do |s|\n return false if s + d == num\n # This is the reason why we couldn't use arrays.\n # array.each and modifying array inside the block won't work.\n # However, iterating over hash keys and modifying hash works.\n subsets[s + d] = true\n end\n end\n divisor_sum > num\nend",
"title": ""
},
{
"docid": "344e84d2a25a3c64bddf3f593b266d06",
"score": "0.579842",
"text": "def extinct_2000(hsh1)\n hsh_2000 = {}\n hsh1.each do |k, v|\n if v < 2000\n hsh_2000[k] = v\n end\n end\n hsh_2000\nend",
"title": ""
},
{
"docid": "772f2f686ee7111f1098f62aded8d6f6",
"score": "0.579706",
"text": "def is_happy(n)\n return false if n < 1\n hash = {}\n loop do\n return false if hash.key?(n)\n return true if n == 1\n hash[n] = 1\n n = n.digits.sum { |dig| dig**2 }\n end\nend",
"title": ""
},
{
"docid": "91d31eb92684ad0de2552345d65e2466",
"score": "0.57916886",
"text": "def key_for_min_value(name_hash)\n\n\tvalue_checker = 0\n\tkey_checker = \"\"\n\tcounter = 0\n\n\n\tif name_hash.empty?\n return nil\n\tend\n\n\tname_hash.each do |key, value|\n \n\n if value_checker == 0 && counter == 0\n \tvalue_checker = value\n \tkey_checker = key\n\n end\n\n if value < value_checker \n\n \tvalue_checker = value\n \tkey_checker = key\n \tcounter += 1\n\n\tend\n\nend\n\nkey_checker\n\nend",
"title": ""
},
{
"docid": "2eb23164b51597dfe62b0e69e91dd73a",
"score": "0.57891804",
"text": "def key_for_min_value(name_hash)\n value = 0 \n key = nil\n name_hash.each do|name, number|\n if \n # i = 1, i ++\n value < number && number < number + i\n return name_hash[name]\n elsif \n return key\n #binding.pry \n end \n end\n end",
"title": ""
},
{
"docid": "d37df90b5dd8428c1ec4dad287dd3676",
"score": "0.57873684",
"text": "def key_for_min_value(merchandise)\n\nitem = nil\ndollars = nil\n\nmerchandise.each do |key,value|\nif dollars == nil\n item = key\n dollars = value\nend\nif value < dollars\n dollars = value\n item = key\nend\nend\n \nitem\n\nend",
"title": ""
},
{
"docid": "2d02c97195dd4c65890a5bf73a5eaaac",
"score": "0.5772781",
"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": "96d5142c92b9de3f81f6a6e1855d478a",
"score": "0.57579255",
"text": "def test_eql\n hsh = {}\n 0.upto(9){|n| hsh[n] = PowerOfThree.new(n)}\n assert(hsh.include?(5))\n assert(hsh.has_key?(5))\n assert(hsh.has_value?(PowerOfThree.new(5)))\n hsh = {}\n 0.upto(9){|n| hsh[PowerOfThree.new(n)] = n}\n assert(hsh.include?(PowerOfThree.new(5)))\n assert(hsh.has_key?(PowerOfThree.new(5)))\n assert(hsh.has_value?(5))\n\n end",
"title": ""
},
{
"docid": "894df9aae7bdbba8aef87573439edd92",
"score": "0.5751768",
"text": "def solution3(a,b,k)\n divisable_check = (a..b).to_a\n divisable = divisable_check.count{|x|x%k==0}\n return divisable\nend",
"title": ""
},
{
"docid": "9c3a45133a04786654d8f03a25f64453",
"score": "0.57486486",
"text": "def convert_to_roman(num)\n\n roman_numerals = {\n 1000 => 'M',\n 900 => 'CM',\n 500 => 'D',\n 400 => 'CD',\n 100 => 'C',\n 90 => 'XC',\n 50 => 'L',\n 40 => 'XL',\n 10 => 'X',\n 9 => 'IX',\n 5 => 'V',\n 4 => 'IV',\n 1 => 'I',\n }\n\n result = \"\"\n\n # check each key against num\n # if num greater than key value\n # add key value to empty string\n # minus the key from the num\n # loop through again\n\n # standard solution without divmod :(\n roman_numerals.keys.each do |key|\n p \"is #{num} greater than or equal to #{key}?\"\n if num >= key\n p \"yes - adding #{roman_numerals[key]}\"\n result << roman_numerals[key]\n num = num - key\n\n nested loop to continue looking at this key\n if (num >= key)\n p \"is #{num} greater than or equal to #{key}?\"\n result << roman_numerals[key]\n num = num - key\n end\n\n else\n p \"no\"\n end\n end\n\n return result\nend",
"title": ""
},
{
"docid": "efed225e026d4f71d5283eaeb1551cd8",
"score": "0.57422596",
"text": "def key_for_min_value(name_hash)\nx=1000\nname_hash.each do |key, value|\nif value < x\n x=value\n end\nend\n name_hash.key(x)\n end",
"title": ""
},
{
"docid": "1b6866ea5eeaec9a4f6bcbd7e76c161e",
"score": "0.57364124",
"text": "def multiple_of_7?(num)\n num % 7 == 0\nend",
"title": ""
},
{
"docid": "c5fef2d176260e8aef75621242ece93c",
"score": "0.5731909",
"text": "def ceiling(key)\n end",
"title": ""
},
{
"docid": "4069c6d82ad580f82cc3296c0ae5fbad",
"score": "0.57279265",
"text": "def key_for_min_value(name_hash)\n name_hash.collect do |key, value|\n if value < 2 \n return key\n end\n end\n name_hash.collect do |name, num|\n if num == 10\n return name\n end\n end\n name_hash = {}\n return nil\nend",
"title": ""
},
{
"docid": "5b63ae5bd9290939f785a13ad0936ee1",
"score": "0.57163364",
"text": "def bakery_num_old(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n pie_qty = 0\n cake_qty = 0\n cookie_qty = 0\n \n has_fave = false\n\n my_list.each_key do |k|\n if k == fav_food\n has_fave = true\n fav_food = k\n end\n end\n \n if has_fave == false\n raise ArgumentError.new(\"You can't make that food\")\n else\n fav_food_qty = my_list.values_at(fav_food)[0] # my_list[fav_food]\n if num_of_people % fav_food_qty == 0\n num_of_food = num_of_people / fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n else num_of_people % fav_food_qty != 0 #remove this code\n while num_of_people > 0\n if num_of_people / my_list[\"pie\"] > 0\n pie_qty = num_of_people / my_list[\"pie\"]\n num_of_people = num_of_people % my_list[\"pie\"]\n elsif num_of_people / my_list[\"cake\"] > 0\n cake_qty = num_of_people / my_list[\"cake\"]\n num_of_people = num_of_people % my_list[\"cake\"]\n else\n cookie_qty = num_of_people\n num_of_people = 0\n end\n end\n return \"You need to make #{pie_qty} pie(s), #{cake_qty} cake(s), and #{cookie_qty} cookie(s).\"\n end\n end\nend",
"title": ""
},
{
"docid": "78346ca197bf155251a75a59e75b2b9e",
"score": "0.57149816",
"text": "def key_for_min_value(starbucks)\n starbucks = {:tall => 5, :grande => 6, :venti => 8}\nend",
"title": ""
},
{
"docid": "8f6e38cddad286ab6da97ba555d1a785",
"score": "0.57066846",
"text": "def problem(arr, k)\n answer = false\n numberlist = {} # the hash to store number\n for i in arr # loop only once\n if numberlist[k-i] #check if the number is in the hash if so we found the answer\n answer = true\n puts i, k-i\n else #if not place the number in the hashlist\n numberlist[i] = true\n end\n end\n answer\nend",
"title": ""
},
{
"docid": "f590293b3e870e93af674e64b5bccaed",
"score": "0.57020754",
"text": "def key_for_min_value(name_hash)\n smallest_number = \"\"\n new_value = 10000000000000\n key_house = nil\n name_hash.each do |key, value|\n if new_value > value\n smallest_number = value\n new_value = smallest_number\n key_house = key\n end\n end\n key_house\nend",
"title": ""
},
{
"docid": "e5b4aa2a83f2917fb13722535db5cc2e",
"score": "0.56948656",
"text": "def key_for_min_value(name_hash)\n#if lowestNumber isn't is lower than the lowest number given, enter more 9s :^)\n lowestNumber = 999999999999999999999999999999999999999999999999999999999999999\n lowestName = nil\n name_hash.collect do |name, number|\n if number < lowestNumber\n lowestNumber = number\n lowestName = name\n end\nend\nlowestName\nend",
"title": ""
},
{
"docid": "9a53a4d8b7d84d60290c226489e0ed2d",
"score": "0.568891",
"text": "def key_for_min_value(list)\n testcase = 999\nlist.each do |x,y|\n if y < testcase\n testcase = y\n end\nend\nresult = list.key(testcase)\nresult\nend",
"title": ""
},
{
"docid": "7f58968f1f50990fdbcfb2f8741c7100",
"score": "0.56883323",
"text": "def key_for_min_value(name_hash)\narr = []\nnumber = 999999999999999999999\nword = ''\n\nif name_hash.empty?\n return nil\nelse\n\nname_hash.each do |key, value|\n if value < number\n number = value\n word = key\nend\nend\nend\nword\nend",
"title": ""
},
{
"docid": "62eb05bb50b3b5aa0ba7c93262b4655d",
"score": "0.56837595",
"text": "def bakery_num(num_of_people, fav_food) \n my_list = {\"pie\" => [8,0], \"cake\" => [6,0], \"cookie\" => [1,0]} \n raise ArgumentError.new(\"You can't make that food\") unless my_list.has_key?(fav_food)\n \n my_list[fav_food][1] = num_of_people / my_list[fav_food][0]\n num_of_people = num_of_people % my_list[fav_food][0]\n\n if num_of_people == 0\n \"You need to make #{my_list[fav_food][1]} #{fav_food}(s).\" \n else\n my_list.select {|key, value| key != fav_food}.each { |key, value|\n value[1] = num_of_people / value[0]\n num_of_people = num_of_people % value[0]\n }\n \"You need to make #{my_list[\"pie\"][1]} pie(s), #{my_list[\"cake\"][1]} cake(s), and #{my_list[\"cookie\"][1]} cookie(s).\"\n end\nend",
"title": ""
},
{
"docid": "271e218206b7c2eaa844d9537f5c13d1",
"score": "0.5672273",
"text": "def bakery_num(num_of_people, fav_food) \n my_list = {\"pie\" => [8,0], \"cake\" => [6,0], \"cookie\" => [1,0]} \n raise ArgumentError.new(\"You can't make that food\") unless my_list.has_key?(fav_food)\n \n my_list[fav_food][1] = num_of_people / my_list[fav_food][0]\n num_of_people = num_of_people % my_list[fav_food][0]\n\n if num_of_people == 0\n \"You need to make #{my_list[fav_food][1]} #{fav_food}(s).\" \n else\n my_list.select {|key, value| key != fav_food}.each { |key, value|\n value[1] = num_of_people / value[0]\n num_of_people = num_of_people % value[0]\n }\n \"You need to make #{my_list[\"pie\"][1]} pie(s), #{my_list[\"cake\"][1]} cake(s), and #{my_list[\"cookie\"][1]} cookie(s).\"\n end\nend",
"title": ""
},
{
"docid": "ff491bb858336e4d3dc03d3f582f26bf",
"score": "0.5670067",
"text": "def featured(num)\n loop do\n num += 1\n break if num.odd? && (num % 7).zero?\n end\n loop do\n return num if num.digits == num.digits.uniq\n if num > 9_999_999_999\n puts \"There is no possible number that fulfills requirements.\"\n return\n end\n num += 14\n end\nend",
"title": ""
},
{
"docid": "f7db41a1cd50a93ab7a3e5aa0633e7ed",
"score": "0.5666154",
"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": "2b6553defa4a46e758c9c7e80bc4b1bc",
"score": "0.5665331",
"text": "def key_for_min_value(name_hash)\n key1 = nil\n num1 = \"\"\n name_hash.each do |name, number|\n if num1 == \"\" || number < num1\n key1 = name\n num1 = number \n end\n end\n key1\nend",
"title": ""
},
{
"docid": "c8d9235466e8505036c6cb73e9509670",
"score": "0.56567574",
"text": "def key_for_min_value(name_hash)\n holder_value = 10000\n holder_key = nil\n name_hash.each do |key, value|\n if value < holder_value\n holder_value = value\n puts holder_value\n holder_key = key\n end\n end\n holder_key\nend",
"title": ""
},
{
"docid": "448fa01ad9c3c7c1c1ce4c3ee8cfc054",
"score": "0.56558204",
"text": "def get_less_than_twenty (number)\n return $numbers[:small][number]\nend",
"title": ""
},
{
"docid": "3b5884c1febb35e110b38dde8b059804",
"score": "0.5654216",
"text": "def calculate n=@value_2\n \n nn = n\n\n loop do \n\n found = true\n \n @value_1.upto(@value_2) do |i|\n unless nn % i == 0\n nn += 1\n found = false\n break\n end\n end \n\n break if found\n \n end\n \n nn\n \n end",
"title": ""
},
{
"docid": "dff34c4fb5cddffd2ccbfc75d6aa782c",
"score": "0.5649601",
"text": "def mutliple_of_7?(num)\n num % 7 == 0 \nend",
"title": ""
},
{
"docid": "a29331e10fa3c60b513cb5154829f992",
"score": "0.5648178",
"text": "def key_for_min_value(name_hash)\nv=999\nk=nil\nname_hash.each do |key,value|\n if value<v\n p v\n v=value\n k=key\n end\nend\nk\nend",
"title": ""
},
{
"docid": "95e0ae81765e3528a43e690d429dceae",
"score": "0.5646473",
"text": "def key_for_min_value(name_hash)\n thing = nil\n if name_hash.size !=0\n val = name_hash.first[1]\n name_hash.each do |name, number|\n if val == number || val > number\n thing = name\n val = number\n end\n end\n end\n thing\n \nend",
"title": ""
},
{
"docid": "aca8537da078818e6c652c2c157ed3d8",
"score": "0.56450814",
"text": "def key_for_min_value(name_hash)\n \n \n\n i = 0\n n = 0 \n theKey = nil \n \n name_hash.each do |key, val|\n if i == 0 \n n = val\n theKey = key \n i += 1 \n elsif val < n \n n = val \n theKey = key \n end \n end \n theKey \nend",
"title": ""
},
{
"docid": "a99de31611fc1ad1a227ecc6a9cf205f",
"score": "0.5639291",
"text": "def updateKey\n \tif @player.score < 500\n\t @key = 100\n\tend\n\tif @player.score > 500 and @player.score < 1000\n\t @key = 500\n\tend\n\tif @player.score > 1000 and @player.score < 1500\n\t @key = 1000\n\tend\n\tif @player.score > 1500 and @player.score < 2000\n\t @key = 1500\n\tend\n\tif @player.score > 2000 and @player.score < 3000\n\t @key = 2000\n\tend\n\tif @player.score > 3000\n\t @key = 3000\n\tend\n end",
"title": ""
},
{
"docid": "dfcfbc72cb63ac1cba3cbfc1cae88fac",
"score": "0.5636033",
"text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n unless arr.length > 1\n return false\n end\n h=Hash.new\n arr.each{|a|\n if h.key? a \n return true else h[n-a] = n end}\n return false\nend",
"title": ""
},
{
"docid": "d0a40599f56b566744edd0443756a922",
"score": "0.5619629",
"text": "def key_for_min_value(name_hash)\n empty_hash=nil\n name_hash.collect do |name,value|\n if value <= 1\n return name\n elsif value ==10\n return name\n end\n end\n empty_hash\nend",
"title": ""
},
{
"docid": "4a43cdc79c04f955ca6e484aa2f238ae",
"score": "0.5608322",
"text": "def sum_to_n? arr, n\n # YOUR CODE HERE\n unless arr.length > 1\n return false\n end\n h=Hash.new\n arr.each{|a|\n if h.key? a \n return true else h[n-a] = n end}\n return false\nend",
"title": ""
},
{
"docid": "b4717aaa6d441ec26e3d68b53b5233e5",
"score": "0.5605071",
"text": "def key_for_min_value(name_hash)\ni = 1\nanswer_key = nil\nmin_value = 0\nname_hash.each do |key, value|\n#binding.pry\n if name_hash.empty?\n answer_key = nil\n elsif i == 1\n min_value=value\n answer_key = key\n i = 2\n elsif value <= min_value\n min_value = value\n answer_key = key\n end #if\n #binding.pry\n #i += 1\n end #do\nreturn answer_key\nend",
"title": ""
},
{
"docid": "10b8dba6e2bf86aed53cb408fb5d7900",
"score": "0.56031936",
"text": "def evens_and_odds(numbers)\n hash = {even: 0, odd: 0}\n numbers.each do |n|\n n % 2 == 0 ? hash[:even] +=1 : hash[:odd] +=1 \n end\n hash\nend",
"title": ""
},
{
"docid": "1b12eb5c6cf4784cc0b5088966dc369e",
"score": "0.5600268",
"text": "def key_for_min_value(name_hash)\n small_num=\"\"\n key_for_number=\"\"\n if name_hash=={}\n return nil\n\n\n else\n name_hash.each do |key,number|\n if small_num==\"\"||number<small_num\n small_num=number\n key_for_number=key\n end\n end\n return key_for_number\n\n end\n\nend",
"title": ""
},
{
"docid": "ea85676f0a30f5a2cdc4fa57c871b9bc",
"score": "0.55992234",
"text": "def key_for_min_value(name_hash)\n minvee = 100 \n kookoo = nil \n name_hash.each do |key,val| \n if val < minvee \n minvee = val \n kookoo = key \n end \n end \n puts kookoo\n kookoo \nend",
"title": ""
},
{
"docid": "55518050fa0f65d68dff5606a7790baa",
"score": "0.5598569",
"text": "def good_two_sum?(arr, target)\r\n hash = Hash.new() #make a new hash check with TA if we want a value\r\n arr.each_with_index do |num, idx| # O(n)\r\n if hash.has_key?(target-num) #check if the hash contains the target number minus the current number return true\r\n return hash[target-num]\r\n else\r\n hash[num] = true #if it doesnt have that number add current number to the keys of the hash and add 1\r\n end\r\n end\r\n false\r\nend",
"title": ""
},
{
"docid": "8d1a3cbe6f21b1f86017d7aca34c2cb0",
"score": "0.5595625",
"text": "def bakery_num(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n # pie_qty = 0\n # cake_qty = 0\n # cookie_qty = 0\n \n has_fave = false\n\n# Check if fav_food == k\n my_list.each_key { |k| has_fave = true if k == fav_food }\n\n# IF has_fave is not there, raise error\n# IF has_fave is passed on, then run rest of code\n\n raise ArgumentError.new(\"You can't make that food\") if has_fave == false\n\n # if has_fave == false\n # raise ArgumentError.new(\"You can't make that food\")\n # else\n\n fav_food_qty = my_list[fav_food]\n \n # if num of ppl is a multiple of the qty value\n # return quantity of fav food needed\n \n if num_of_people % fav_food_qty == 0\n num_of_food = num_of_people / fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n \n else # num_of_people % fav_food_qty != 0\n while num_of_people > 0\n \n quant = {}\n my_list.each do |k,v| \n quant[k] = num_of_people / v\n num_of_people = num_of_people % v\n end\n \n # if num_of_people / my_list[\"pie\"] > 0\n # pie_qty = num_of_people / my_list[\"pie\"]\n # num_of_people = num_of_people % my_list[\"pie\"]\n \n # elsif num_of_people / my_list[\"cake\"] > 0\n # cake_qty = num_of_people / my_list[\"cake\"]\n # num_of_people = num_of_people % my_list[\"cake\"]\n \n # else\n # cookie_qty = num_of_people\n # num_of_people = 0\n # end\n \n end\n return \"You need to make #{quant['pie']} pie(s), #{quant['cake']} cake(s), and #{quant['cookie']} cookie(s).\"\n end\n\n # end\nend",
"title": ""
},
{
"docid": "306b221152502c8b91fed16771f63da9",
"score": "0.5593585",
"text": "def ventas(ventas)\n nuevo_ventas = {}\n ventas.each do |k,v|\n if v < 70000\n nuevo_ventas[k] = v\n end\n end\n puts nuevo_ventas\nend",
"title": ""
},
{
"docid": "90ef5b93c7623f247da784ab82bfb368",
"score": "0.5591857",
"text": "def featured2(number)\n number += 1 until number.odd? && number % 7 == 0\n\n loop do\n digits = number.to_s.chars\n if digits.uniq == digits\n return number\n end\n number += 14\n end\n 'No possible number that fulfills those requirements'\nend",
"title": ""
},
{
"docid": "2bcbe185568fe46aacadd83c68745a51",
"score": "0.5577957",
"text": "def kaprekar_number?(number)\n\tcount = number.to_s.size\n\tpow = (number**2).to_s\n\tfirst_haft = pow[(pow.length-count)..(pow.length-1)]\n\tsecond_haft = pow[0...(pow.length-(count))]\n\tnumber == first_haft.to_i + second_haft.to_i\nend",
"title": ""
},
{
"docid": "ca6f576964e9168f875f1cf92ae85fa2",
"score": "0.5563581",
"text": "def bakery_num(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n food_list = {\"pie\"=> 0,\"cake\"=> 0, \"cookie\" => 0}\n\n if my_list.has_key?(fav_food)\n if num_of_people % my_list[fav_food] == 0\n return \"You need to make #{num_of_people / my_list[fav_food]} #{fav_food}(s).\"\n else\n food_list[fav_food] = num_of_people / my_list[fav_food]\n num_of_people = num_of_people % my_list[fav_food]\n \n my_list.each do |k,v| \n food_list[k] += num_of_people / v\n num_of_people = num_of_people % v\n end\n return \"You need to make #{food_list['pie']} pie(s), #{food_list['cake']} cake(s), and #{food_list['cookie']} cookie(s).\"\n end\n else\n raise ArgumentError.new(\"You can't make that food\") #Raise error if favorite food not found\n end\nend",
"title": ""
},
{
"docid": "749ca5229b6c274a897ffcf7091b3f6a",
"score": "0.55625844",
"text": "def key_for_min_value(values) #{:blake => 500, :ashley => 2, :adam => 1}\n min_value = nil\n key_min = nil\n values.each do |key, number|\n if key_min == nil\n min_value = number\n key_min = key\n elsif number < min_value\n min_value = number\n key_min = key\n end\n end\n return key_min\nend",
"title": ""
},
{
"docid": "17ec0fbd6109c61c3128e238450c5e18",
"score": "0.5560195",
"text": "def index(key, size)\n return key.sum % size \n end",
"title": ""
},
{
"docid": "c4d4a1dd83b03202575e349193f6d062",
"score": "0.55562925",
"text": "def addDivisible (div, message)\n # If the number is divisible by 5 and 3 return FizzBuzz\n @dictionary.merge!(div => message)\n end",
"title": ""
},
{
"docid": "c3a49ace26303bf07b01dbc7d9465e79",
"score": "0.55543953",
"text": "def find_goldbach(num)\n i = 4\n increment = 2\n if num < i\n puts \"Please input number more than 4.\"\n return \n end\n if num % 2 == 1\n puts \"Please input even number.\"\n end\n dict_class = {}\n plus_list = []\n while i <= num\n if i == 4\n dict_class[num] = [[2, 2]]\n else\n plus_list = []\n tmp = i - 1\n a_num = 3\n b_num = i - 3\n if(is_prime(a_num) and is_prime(b_num))\n plus_list += [[a_num, b_num]]\n end\n a_num = 5\n b_num = i - 5\n while a_num < tmp\n if(is_prime(a_num) and is_prime(b_num))\n plus_list += [[a_num, b_num]]\n end\n a_num += increment\n b_num -= increment\n increment = 6 - increment\n end\n dict_class[i] = plus_list\n end\n i += 2\n end\n return dict_class\nend",
"title": ""
},
{
"docid": "9beb9e8fd32cc6044ebb56d4b6b853ad",
"score": "0.5548471",
"text": "def workbook(_n, k, arr)\n page = 0\n special = 0\n book = {}\n 0.upto(arr.length - 1) do |i|\n page = page + 1\n 1.upto(arr[i]) do |j|\n special = special + 1 if page == j\n page = page + 1 if j % k == 0 && j != arr[i]\n end\n end\n special\nend",
"title": ""
},
{
"docid": "354e13cc605c00f018e944ae77c8dd46",
"score": "0.55471396",
"text": "def key_for_min_value(name_hash)\n key = nil\n value = nil\n name_hash.each do |name, number|\n if value == nil || number < value\n value = number\n key = name\n end\n end\n key\nend",
"title": ""
},
{
"docid": "64ba6324dc7d42edf26abf37eb71e298",
"score": "0.55471325",
"text": "def key_for_min_value(name_hash)\n key_with_min_value = nil\n value_with_lowest_number = nil\n\n\nname_hash.each do |name , value|\n if value_with_lowest_number == nil || value < value_with_lowest_number\n \tvalue_with_lowest_number = value\n \tkey_with_min_value = name\n end\nend\nkey_with_min_value\n\n\t\t\n\n\n\n\nend",
"title": ""
},
{
"docid": "f81417609e7991d8b23957c655c3d3d4",
"score": "0.55433697",
"text": "def key_for_min_value(name_hash)\n i = 999\n j = {}\n\n if name_hash == j\n return nil\n end\n\n name_hash.each do |key, value|\n if value < i\n i = value\n j = key\n end\n end\n j\nend",
"title": ""
},
{
"docid": "ad5b3801ef0a573658be3172d74349f8",
"score": "0.55404615",
"text": "def key_for_min_value(name_hash)\n b={}\n i=1000\n name_hash.each do |key, value|\n if value<i #comparing if first value is less than variable i which is 1000\n i=value #setting variable i to the value, so it can compare with the value in next iteration\nend\n\n\n end #ends the do block\n\nname_hash.key(i) #gets the key associated with the value found out in the do block above, returns nil if no value found\n\nend",
"title": ""
},
{
"docid": "16e1e1c980ffe1dcfcc27fe6eab04fdc",
"score": "0.55392694",
"text": "def featured(number)\n number += 1\n\n loop do\n remainder = number % 7\n digits = number.to_s.chars # Note: number.digits :: [Int]\n\n return nil if digits.size > 10\n return number if remainder.zero? && number.odd? && digits.uniq == digits\n\n number += 7 - remainder\n end\nend",
"title": ""
},
{
"docid": "7435ceb8432ebd0c69caeb6bc7040e26",
"score": "0.5535536",
"text": "def via_power_check(k)\n r = 0\n while r < k\n r += 1\n next if k % r != 1\n return r if r == k-1\n p = (BigDecimal.new(\"10\").power(r) - 1)/k.to_f\n return r if p == p.to_i\n end\n end",
"title": ""
},
{
"docid": "487dcc58dd72833a72940acf3d075449",
"score": "0.5533984",
"text": "def key_for_min_value(name_hash)\n if name_hash.length == 0\n return nil\n else\n key,value = name_hash.first\n name_hash.each do |name,worth|\n if worth < value\n key = name\n end\n end\n key\nend\n\nend",
"title": ""
},
{
"docid": "dfafd45ee291f0e63ce8e4e1c0e10426",
"score": "0.5533939",
"text": "def fizbuzz(hash={}, number=0)\n str = hash.map { |key, value| value.to_s if number % key == 0 }.compact.join('')\n str.empty? ? number : str\nend",
"title": ""
},
{
"docid": "906eedd0baa7b826467db354b23f152b",
"score": "0.55314535",
"text": "def featured(number)\n if number >= 9999999999\n puts \"There is no possible number that fulfils these requirements\"\n return\n end\n\n number += 1\n while number % 7 != 0 || number.even? || number.to_s.split(//).uniq.count != number.to_s.split(//).count\n number += 1\n end\n number\nend",
"title": ""
},
{
"docid": "192d80295268720f15c831090e464010",
"score": "0.55235857",
"text": "def kaprekar?(k)\n no_of_digits = k.to_s.size\n square = (k ** 2).to_s \n second_half = square[-no_of_digits..-1]\n # condition ? if met do this : else command goes here\n first_half = square.size.even? ? square[0..no_of_digits-1] : square[0..no_of_digits-2]\n k == first_half.to_i + second_half.to_i\nend",
"title": ""
},
{
"docid": "13999b97edbfac8d9dae10b4ceac25eb",
"score": "0.5522906",
"text": "def kidmod10(base)\n weighted_sum = calculate_weighted_sum(base, [1, 2])\n mod10_remainder(weighted_sum)\n end",
"title": ""
},
{
"docid": "29de8ae08bb0a25e3434e3d7ec87a927",
"score": "0.5521464",
"text": "def evens_and_odds(numbers)\n hash = {even: 0, odd: 0}\n numbers.each{|el| if el % 2 == 0 then hash[:even] += 1 else hash[:odd] += 1 end}\n hash\nend",
"title": ""
},
{
"docid": "d651b714cb2ad37e6bdb5381fc749aa9",
"score": "0.5520331",
"text": "def key_for_min_value(hash)\n low = 1000000000000\n name = \"hi\"\n if hash.empty?; name = nil else \n end\n hash.each do |key,val|\n if low > val\n low = val\n name =key\n end\n end\n name\nend",
"title": ""
},
{
"docid": "3fc9bdf3de43c725ab0f079c8e7243d7",
"score": "0.551569",
"text": "def algo_1(t)\n n, k, a = t[:n], t[:k], t[:a]\n\n resp = a.combination(k).inject(0){|m, e| m + e.max} % MOD\n return resp\n end",
"title": ""
},
{
"docid": "9adf4cac5c438f507ac5b1b49556f4c6",
"score": "0.55140585",
"text": "def has_groups_size_x(deck)\n return false if deck.length < 2\n deck_hash = {}\n \n deck.each do |n|\n deck_hash[n] = deck_hash[n] ? deck_hash[n] + 1 : 1\n end\n \n least_val = nil\n \n deck_hash.each do |key, val|\n return false if val == 1\n least_val = val if least_val.nil? || val < least_val\n end\n \n lcd = 2\n \n until lcd > least_val\n all_pass = true\n deck_hash.each do |key, val|\n if val % lcd != 0\n lcd += 1\n all_pass = false\n break\n end\n end\n return true if all_pass\n end\n false\nend",
"title": ""
},
{
"docid": "7ee5fd2476a5849fea0a1060e17c6a4c",
"score": "0.55128026",
"text": "def key_for_min_value(name_hash)\n hashKey = 100000\n something = nil\n key_array = name_hash.collect do |starter, pack|\n pack\n end\n key_array.each do |item|\n if hashKey > item\n hashKey = item \n end\n end\n name_hash.index(hashKey)\n \nend",
"title": ""
},
{
"docid": "7ac84713f9a0c2b68735acbf6052fccd",
"score": "0.55114317",
"text": "def remove_num_less5(ha,num)\r\n\tnew_hash = Hash.new(0)\r\n\tha.each do |x|\r\n\t\tif x[1] > num\r\n\t\tnew_hash[x[0]]=x[1]\r\n\t\tend\r\n\tend\r\n\r\np new_hash\r\nend",
"title": ""
},
{
"docid": "104d6303b0743bc2166ec46c6af88d4e",
"score": "0.5509003",
"text": "def key_for_min_value(name_hash)\n compare_value=100\n winning_key= nil\n name_hash.each do |key, value|\n if value<compare_value\n compare_value=value\n winning_key=key\n end\n end\n return winning_key\nend",
"title": ""
},
{
"docid": "d58cf6eefe09366329de36d89b2558bc",
"score": "0.55078083",
"text": "def staircase(number, hash={})\n\tvalues = [] ; keys = []\n\t\n\tx = 1\n\twhile x <= number\n\t\tkeys << x if x.odd?\n\t\tx += 1\n\tend\n\t# or just :\n\t# 1.upto number do |x| ; keys << x if x.odd? ; end\n\n\tkeys.each do |key|\n\t\ty = 1\n\t\tvalues = []\n\t\twhile y < key\n\t\t\tvalues << y if y.even?\n\t\t\ty += 1\n\t\tend\n\t\thash[key] = values\n\tend\n\t\t\n\thash\nend",
"title": ""
},
{
"docid": "9a956d9ad947cf9ff6952c3d0ee8cec0",
"score": "0.5506148",
"text": "def key_for_min_value(name_hash)\n if name_hash == {}\n nil\n else\n\n final = \"\"\n finalNum = 1.0/0\nname_hash.each do |name, num|\n\n if num < finalNum\n finalNum = num\n final = name\n end\nend\nfinal\nend\n\nend",
"title": ""
},
{
"docid": "e1ffeca3e70c1cb6ff6b8815e1b3e51b",
"score": "0.55017304",
"text": "def gifts(number)\n result = []\n to_return = []\n if GIFTS[number] == nil\n while number > 0 do\n result << GIFTS.keys.select {|k| k <= number}.max\n number -= result [-1]\n end\n result.each do |num|\n to_return << GIFTS[num]\n end\n else\n to_return << GIFTS[number]\n end\n to_return.sort\nend",
"title": ""
},
{
"docid": "e0c5798b7a9b9859c59fa117c69661e7",
"score": "0.55006045",
"text": "def key_for_min_value(name_hash)\nif name_hash.empty?\n return nil\nend\nb = name_hash.first[1]\na = :key\n\nname_hash.each do |key, value|\nif value <= b\nb = value\na = key\nend\nend\na\n\nend",
"title": ""
},
{
"docid": "1874b47da19e3b98032d848ca918ed8a",
"score": "0.54999346",
"text": "def calc(x)\n (2 ** x + 1) % (10 ** 9 + 7)\nend",
"title": ""
}
] |
a2099a77c85e91272ae2f9e35b937953
|
Only allow a trusted parameter "white list" through.
|
[
{
"docid": "eb4e89e3c374790dde4557c1422ba3d4",
"score": "0.0",
"text": "def treatment_note_params\n params.require(:treatment_note).permit(:appointment, :practitioner, :text)\n end",
"title": ""
}
] |
[
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.71213365",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70527846",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6947171",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6901663",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.67342883",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6717481",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.668679",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.667654",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6660948",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.655484",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "7ac5f60df8240f27d24d1e305f0e5acb",
"score": "0.6525947",
"text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.64567953",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.64502525",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6450165",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.6446098",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6433068",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.64118934",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.64118934",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.63903046",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.6379847",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.6379847",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.63736796",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.63605297",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6353668",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6283826",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.6277936",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.62436706",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.6226217",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.62238735",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.6222201",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.6208754",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "ff55cf04e6038378f431391ce6314e27",
"score": "0.62079734",
"text": "def additional_permitted_params\n []\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.61760926",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "0d980fc60b69d03c48270d2cd44e279f",
"score": "0.6171337",
"text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6166829",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.61594605",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.61429733",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.6134288",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.61210173",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "76d85c76686ef87239ba8207d6d631e4",
"score": "0.6106998",
"text": "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6097591",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "2b19f8222e09c2518b0d19b4bf1f69d3",
"score": "0.6074265",
"text": "def list_params\n params.permit(:list_name)\n end",
"title": ""
},
{
"docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3",
"score": "0.6053252",
"text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"title": ""
},
{
"docid": "4f20d784611d82c07d49cf1cf0d6cb7e",
"score": "0.6039525",
"text": "def all_params; end",
"title": ""
},
{
"docid": "5a96718b851794fc3e4409f6270f18fa",
"score": "0.60342395",
"text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"title": ""
},
{
"docid": "ff7bc2f09784ed0b4563cfc89b19831d",
"score": "0.6030413",
"text": "def source_params\n params.require(:source).permit(all_allowed_params)\n end",
"title": ""
},
{
"docid": "6c615e4d8eed17e54fc23adca0027043",
"score": "0.6017866",
"text": "def user_params\n end",
"title": ""
},
{
"docid": "2032edd5ab9475d59be84bdf5595f23a",
"score": "0.60174304",
"text": "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60172004",
"text": "def params; end",
"title": ""
},
{
"docid": "c59ec134c641678085e086ab2a66a95f",
"score": "0.60154676",
"text": "def permitted_params\n @wfd_edit_parameters\n end",
"title": ""
},
{
"docid": "a8faf8deb0b4ac1bcdd8164744985176",
"score": "0.60037804",
"text": "def user_params\r\n end",
"title": ""
},
{
"docid": "b98f58d2b73eac4825675c97acd39470",
"score": "0.6003128",
"text": "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.5999996",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.5994808",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.59938943",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.5992965",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "e4c37054b31112a727e3816e94f7be8a",
"score": "0.59828913",
"text": "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.5982352",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.59762347",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "4d77abbae6d3557081c88dad60c735d0",
"score": "0.5973914",
"text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"title": ""
},
{
"docid": "55d8ddbada3cd083b5328c1b41694282",
"score": "0.5968744",
"text": "def params_permit\n params.permit(:id)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.5964729",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.5963057",
"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.5963057",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "4e758c3a3572d7cdd76c8e68fed567e0",
"score": "0.5956878",
"text": "def filter_params\n params.permit(*resource_filter_permitted_params)\n end",
"title": ""
},
{
"docid": "b48f61fbb31be4114df234fa7b166587",
"score": "0.5950747",
"text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"title": ""
},
{
"docid": "3154b9c9e3cd7f0b297f900f73df5d83",
"score": "0.5950746",
"text": "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end",
"title": ""
},
{
"docid": "c4802950f28649fdaed7f35882118f20",
"score": "0.5946173",
"text": "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5d64cb26ce1e82126dd5ec44e905341c",
"score": "0.59427863",
"text": "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.59293395",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "da4f66ce4e8c9997953249c3ff03114e",
"score": "0.5928864",
"text": "def argument_params\n params.require(:argument).permit(:name)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5925602",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.5923773",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "be01bb66d94aef3c355e139205253351",
"score": "0.5918309",
"text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.5915812",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "eb5b91d56901f0f20f58d574d155c0e6",
"score": "0.59130466",
"text": "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"title": ""
},
{
"docid": "d6bf948034a6c8adc660df172dd7ec6e",
"score": "0.59129673",
"text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"title": ""
},
{
"docid": "c6a96927a6fdc0d2db944c79d520cd99",
"score": "0.5907004",
"text": "def parameters\n nil\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.59047765",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "a743e25503f1cc85a98a35edce120055",
"score": "0.590452",
"text": "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end",
"title": ""
},
{
"docid": "533048be574efe2ed1b3c3c83a25d689",
"score": "0.59017384",
"text": "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end",
"title": ""
},
{
"docid": "02a61b27f286a50802d652930fee6782",
"score": "0.5899288",
"text": "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"title": ""
},
{
"docid": "238705c4afebc0ee201cc51adddec10a",
"score": "0.58962125",
"text": "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.58959764",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5893933",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
}
] |
5d79b9718f771f611f56e5f78f303957
|
Can call this to log off.
|
[
{
"docid": "e3b2b3ab00499b6aaa0a008c3fc17d7c",
"score": "0.0",
"text": "def de_authenticate( cgi )\n\t\tCGI::Session.new(cgi).delete\n\tend",
"title": ""
}
] |
[
{
"docid": "c9dcf90fc26a280bd3b47135a4124f60",
"score": "0.78711474",
"text": "def log_out\n forget(current_user)\n end",
"title": ""
},
{
"docid": "48804afcfc3fcc25555e99c3224fc326",
"score": "0.7862049",
"text": "def log_out\n forget(current_user)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "4f2b5295c4b1f924ca90f89499c78688",
"score": "0.77182794",
"text": "def logoff\n begin\n @browser.form(:name, 'logoffForm').submit\n rescue\n raise \"Can't log off: not logged in yet!\"\n end\n end",
"title": ""
},
{
"docid": "50ae5a839bd3c187e6a513235383a0de",
"score": "0.7671137",
"text": "def log_out\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "6561cfd371ef2d8f39ce64f804929f46",
"score": "0.75853324",
"text": "def logout\n logoff\n end",
"title": ""
},
{
"docid": "1813b5248a97b04a94ff600239ac9265",
"score": "0.7569844",
"text": "def log_off_user\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "bb0a6f115c9ea96264dbdee002cc6bb1",
"score": "0.7553939",
"text": "def log_out\n \n session.delete(:user_id)\n @user_active = nil\n end",
"title": ""
},
{
"docid": "1a7d7c597a52f3b5aaec26768e34f46d",
"score": "0.74726033",
"text": "def log_out\n reset_session\n @current_user = nil\n end",
"title": ""
},
{
"docid": "ff3dc8fc1d2a1b5e997933723dc7d275",
"score": "0.7464371",
"text": "def logs_out\n\t\tforget(current_user)\n\t\tsession.delete[:user_id]\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "3f7081e8216cba1d5833b63eb27bef8b",
"score": "0.7463647",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "3f7081e8216cba1d5833b63eb27bef8b",
"score": "0.7463647",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "3f7081e8216cba1d5833b63eb27bef8b",
"score": "0.7463647",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "3f7081e8216cba1d5833b63eb27bef8b",
"score": "0.7463647",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "3f7081e8216cba1d5833b63eb27bef8b",
"score": "0.7463647",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "3f7081e8216cba1d5833b63eb27bef8b",
"score": "0.7463647",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "3f7081e8216cba1d5833b63eb27bef8b",
"score": "0.7463647",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "d1f1fbd688a60d51ea7dda6209fdb5d8",
"score": "0.7462848",
"text": "def log_out\n self.forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3327b405915572e9d834db1e12d0a61c",
"score": "0.7450487",
"text": "def log_out\n forget current_user\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.7430254",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "215b7dbf3327ea8a0139f0da7857e49b",
"score": "0.74293053",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "ae585c294b27effb9f6531cd54fba968",
"score": "0.7428685",
"text": "def log_out\n forget(current_user)\n reset_session\n @current_user = nil\n end",
"title": ""
},
{
"docid": "ae585c294b27effb9f6531cd54fba968",
"score": "0.7428685",
"text": "def log_out\n forget(current_user)\n reset_session\n @current_user = nil\n end",
"title": ""
},
{
"docid": "1780aac518647a3b116f10cf7d0152a3",
"score": "0.7403194",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\t\t\n\tend",
"title": ""
},
{
"docid": "dd124552b505e6b1b8daa1163b1500c2",
"score": "0.74002147",
"text": "def log_out\n\t forget(current_user)\n\t session.delete(:user_id)\n\t @current_user = nil\n\tend",
"title": ""
},
{
"docid": "b09f950b5cf16b1c3c88ad5d5cb54735",
"score": "0.739541",
"text": "def log_out\n forget current_user\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "e60ec60610a36bbce8c8581336a94990",
"score": "0.73919356",
"text": "def log_out\n forget(current_user) #calls the forget method to forget user (session) when logging out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "c14cd1c8909cdfbc279f1f5da9a8e9f5",
"score": "0.7389141",
"text": "def log_out_user\n reset_session\n end",
"title": ""
},
{
"docid": "98caa1ae1b86dec7cd12ad9178ad2120",
"score": "0.7379542",
"text": "def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:stakeholder_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "7d1e6f6e0ba4007b4f43c316b8e92c04",
"score": "0.73791367",
"text": "def log_out\n session.delete(:user_id)\n session.delete(:user_role)\n session.delete(:forwarding_url)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "059c91198b586bb62fd65b6d94afd72d",
"score": "0.7375995",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0def81ea421f7bae9c8ece9b122a7e30",
"score": "0.7364977",
"text": "def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user=nil\n\tend",
"title": ""
},
{
"docid": "eec1e2bd1b9988d00a1c860bdef0ec32",
"score": "0.7355977",
"text": "def log_out\n forget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "6c7f2de2bd5a10443638c6832a29b64d",
"score": "0.73519385",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "6c7f2de2bd5a10443638c6832a29b64d",
"score": "0.73519385",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "6c7f2de2bd5a10443638c6832a29b64d",
"score": "0.73519385",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "6c7f2de2bd5a10443638c6832a29b64d",
"score": "0.73519385",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "6c7f2de2bd5a10443638c6832a29b64d",
"score": "0.73519385",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "39f3d2b8054068934f8ad50af057a95f",
"score": "0.73453593",
"text": "def log_out\n session.delete(:user_id)\n Current.user = nil\n end",
"title": ""
},
{
"docid": "e53b71cbd2f10fd10c519991ea7eafb5",
"score": "0.733949",
"text": "def log_out\n session.delete(:user_id)\n session.delete(:vendortype)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "016c7c355b6b06ad344bc07d84eba937",
"score": "0.73343116",
"text": "def log_out\r\n forget(current_user)\r\n session.delete(:user_id)\r\n @current_user = nil\r\n end",
"title": ""
},
{
"docid": "336ca07ad8a91b7a39360d3d8a3e7962",
"score": "0.73247695",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n\tend",
"title": ""
},
{
"docid": "fa83ef7f3954e7a1b0acdcf176c8b010",
"score": "0.73191667",
"text": "def log_out\n session.destroy\n @current_user = nil\n end",
"title": ""
},
{
"docid": "815bd8405fefbf8437302771c2c3fac4",
"score": "0.73135835",
"text": "def log_out\n\tforget(current_user)\n\tsession.delete(:user_id)\n\t@current_user = nil\nend",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.731127",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "9dca63bb8d369fdfecd6e965d0f8cb6a",
"score": "0.73110336",
"text": "def log_out\n forget( current_user )\n session.delete( :user_id )\n @current_user = nil\n end",
"title": ""
},
{
"docid": "b3d22d5ef45606d82c9251d7487d7d96",
"score": "0.7311003",
"text": "def auth_logout\n session.delete(:logged_in)\n session.delete(:username)\n end",
"title": ""
},
{
"docid": "503e96fc0b1520c75725c5e72762bf08",
"score": "0.73014593",
"text": "def log_out\n\t\t# Forget the current user when they logout by calling the forget helper above\n\t\tforget(current_user)\n\t\t# Delete the user id from the session\n\t\tsession.delete(:user_id)\n\t\t# Set the current user to nil\n\t\t@current_user = nil\n\tend",
"title": ""
},
{
"docid": "0b81055488e42729c95032543f6d762c",
"score": "0.7296909",
"text": "def log_out\n session.delete(:user_id)\n @the_current_user = nil\n end",
"title": ""
},
{
"docid": "8df7b722b74b8d2590cd1a55dd0a0966",
"score": "0.7290202",
"text": "def log_out\n \tforget(current_user)\t#forget(user) in helper.\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "a96cce7f50eecbfa86a00848c56ad3ab",
"score": "0.72792286",
"text": "def log_out\n forget(@current_user)\n session[:user_id] = nil\n @current_user = nil\n end",
"title": ""
},
{
"docid": "db7a2f7d8c949cee4bacc13a70bad19e",
"score": "0.72776943",
"text": "def log_out\n reset_session\n if @current_user\n @current_user = nil\n elsif @current_host\n @current_host = nil\n elsif @current_admin\n @current_admin = nil\n end\n end",
"title": ""
},
{
"docid": "ed4a733fefebb602ff27aa452921b6b5",
"score": "0.72750986",
"text": "def log_out\r\n session.delete(:user_id)\r\n @current_user = nil\r\n end",
"title": ""
},
{
"docid": "8fd4831c0aca50446a838bfcc5d2f007",
"score": "0.7270896",
"text": "def log_out\n # forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "a455ebd396ffab922da392e2f249eb46",
"score": "0.7254452",
"text": "def unlogged; end",
"title": ""
},
{
"docid": "91eab02cd53239f600c8219a194ea10a",
"score": "0.7249528",
"text": "def log_out\n session.delete(:muser_id)\n @current_muser = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.7245979",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
}
] |
a2099a77c85e91272ae2f9e35b937953
|
Only allow a trusted parameter "white list" through.
|
[
{
"docid": "1fd63944925e1812c49f0f6fd139f65e",
"score": "0.0",
"text": "def note_params\n params.require(:note).permit(:content, :date)\n end",
"title": ""
}
] |
[
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.69483954",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6902367",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6733912",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6717838",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6687021",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6676254",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.66612333",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6555296",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "7ac5f60df8240f27d24d1e305f0e5acb",
"score": "0.6527056",
"text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.6456324",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6450841",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.6450127",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.6447226",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6434961",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.64121825",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.64121825",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.63913447",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.63804525",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.63804525",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6373396",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.6360051",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6355191",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.62856233",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.627813",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.62451434",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.6228103",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6224965",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.6222941",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.6210244",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "ff55cf04e6038378f431391ce6314e27",
"score": "0.62077755",
"text": "def additional_permitted_params\n []\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.61762565",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "0d980fc60b69d03c48270d2cd44e279f",
"score": "0.61711127",
"text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6168448",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.6160164",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.61446255",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.6134175",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6120522",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "76d85c76686ef87239ba8207d6d631e4",
"score": "0.6106709",
"text": "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.60981655",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "2b19f8222e09c2518b0d19b4bf1f69d3",
"score": "0.6076113",
"text": "def list_params\n params.permit(:list_name)\n end",
"title": ""
},
{
"docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3",
"score": "0.60534036",
"text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"title": ""
},
{
"docid": "4f20d784611d82c07d49cf1cf0d6cb7e",
"score": "0.60410434",
"text": "def all_params; end",
"title": ""
},
{
"docid": "5a96718b851794fc3e4409f6270f18fa",
"score": "0.6034582",
"text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"title": ""
},
{
"docid": "ff7bc2f09784ed0b4563cfc89b19831d",
"score": "0.6029977",
"text": "def source_params\n params.require(:source).permit(all_allowed_params)\n end",
"title": ""
},
{
"docid": "6c615e4d8eed17e54fc23adca0027043",
"score": "0.6019861",
"text": "def user_params\n end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "2032edd5ab9475d59be84bdf5595f23a",
"score": "0.60184896",
"text": "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end",
"title": ""
},
{
"docid": "c59ec134c641678085e086ab2a66a95f",
"score": "0.60157263",
"text": "def permitted_params\n @wfd_edit_parameters\n end",
"title": ""
},
{
"docid": "a8faf8deb0b4ac1bcdd8164744985176",
"score": "0.6005857",
"text": "def user_params\r\n end",
"title": ""
},
{
"docid": "b98f58d2b73eac4825675c97acd39470",
"score": "0.6003803",
"text": "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.60012573",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.59955895",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.5994598",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.5993604",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "e4c37054b31112a727e3816e94f7be8a",
"score": "0.5983824",
"text": "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.5983166",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5977431",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "4d77abbae6d3557081c88dad60c735d0",
"score": "0.597591",
"text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"title": ""
},
{
"docid": "55d8ddbada3cd083b5328c1b41694282",
"score": "0.5968824",
"text": "def params_permit\n params.permit(:id)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.5965953",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.59647584",
"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.59647584",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "4e758c3a3572d7cdd76c8e68fed567e0",
"score": "0.59566855",
"text": "def filter_params\n params.permit(*resource_filter_permitted_params)\n end",
"title": ""
},
{
"docid": "3154b9c9e3cd7f0b297f900f73df5d83",
"score": "0.59506303",
"text": "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end",
"title": ""
},
{
"docid": "b48f61fbb31be4114df234fa7b166587",
"score": "0.5950375",
"text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"title": ""
},
{
"docid": "c4802950f28649fdaed7f35882118f20",
"score": "0.59485626",
"text": "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5d64cb26ce1e82126dd5ec44e905341c",
"score": "0.59440875",
"text": "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.5930872",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "da4f66ce4e8c9997953249c3ff03114e",
"score": "0.5930206",
"text": "def argument_params\n params.require(:argument).permit(:name)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5925668",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.59235454",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "be01bb66d94aef3c355e139205253351",
"score": "0.5917905",
"text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.59164816",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "d6bf948034a6c8adc660df172dd7ec6e",
"score": "0.5913821",
"text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"title": ""
},
{
"docid": "eb5b91d56901f0f20f58d574d155c0e6",
"score": "0.59128743",
"text": "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"title": ""
},
{
"docid": "c6a96927a6fdc0d2db944c79d520cd99",
"score": "0.5906617",
"text": "def parameters\n nil\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.59053683",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "a743e25503f1cc85a98a35edce120055",
"score": "0.59052664",
"text": "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end",
"title": ""
},
{
"docid": "533048be574efe2ed1b3c3c83a25d689",
"score": "0.5901591",
"text": "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end",
"title": ""
},
{
"docid": "02a61b27f286a50802d652930fee6782",
"score": "0.58987755",
"text": "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.5897456",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "238705c4afebc0ee201cc51adddec10a",
"score": "0.58970183",
"text": "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.58942604",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
}
] |
95d020d2ab693b6eae74af70bbe61265
|
GET /news_posts GET /news_posts.json
|
[
{
"docid": "406f6f54b6347b936428439cb11f7860",
"score": "0.7045713",
"text": "def index\n @news_posts = NewsPost.all\n end",
"title": ""
}
] |
[
{
"docid": "a028a0acd19d41dad7fe4ac7b2a3add5",
"score": "0.8040115",
"text": "def index\n news_url = 'https://newsapi.org/v1/articles?source=espn&sortBy=top&apiKey=c29ea55f52bb4f5fb9ab4663c37c9401'\n\n response = HTTParty.get(news_url)\n\n # render json: response\n @news_data = response\n @all_posts = current_user.posts\n @new_post = current_user.posts.new\n end",
"title": ""
},
{
"docid": "ad0bef7f61ae2451b93c6a1d2a4e1eb2",
"score": "0.7938461",
"text": "def index\n\n news_url = 'https://newsapi.org/v1/articles?source=engadget&sortBy=top&apiKey=1eff6268512d43ff87125794dccec730'\n\n response = HTTParty.get(news_url)\n\n # render json: response\n\n @news = response\n\n # render json: current_user.posts\n\n @all_posts = current_user.posts\n @new_post = current_user.posts.new\n\n # render json: current_user.name\n end",
"title": ""
},
{
"docid": "21e458a2098d5c15a074166bb27f863c",
"score": "0.7866996",
"text": "def index\n # render json: current_user.posts\n news_url = 'https://newsapi.org/v1/articles?source=talksport&sortBy=top&apiKey=5cfef96295754722970178955f8adcfd'\n response = HTTParty.get(news_url)\n # render json: response\n\n @news_data = response\n @all_posts = current_user.posts\n @new_post = current_user.posts.new\n end",
"title": ""
},
{
"docid": "9a1e315b217e4310187cd5f05aa6173b",
"score": "0.77882904",
"text": "def index\n news_url = 'https://newsapi.org/v1/articles?source=bloomberg&sortBy=top&apiKey=632f013c674c447090449ec693e2eb98'\n\n response = HTTParty.get(news_url)\n @news_data = response\n #render json: response\n @all_posts = current_user.posts\n @new_post = current_user.posts.new #tag new post to current user, create a spare new in case user creates a new post\n end",
"title": ""
},
{
"docid": "0c81004e7816b695fcad35cf496c7bf0",
"score": "0.71595436",
"text": "def index\n @news = News.all.order('postdate desc, posttime desc')\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @news.limit(100), status: :ok }\n end\n end",
"title": ""
},
{
"docid": "bb3cc782129b3bc7964b07ec7a6dbafe",
"score": "0.71176",
"text": "def index\n @newsfeed = Newsfeed.new\n @newsfeeds = Newsfeed.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "fb578f587fdfe1b0a8d3ac27001f9611",
"score": "0.70626885",
"text": "def index\n render json: @posts\n end",
"title": ""
},
{
"docid": "edd7ba9766c5a97dc99627879c5a83c9",
"score": "0.6998246",
"text": "def getNews\n request \"/Notification/getNews.json\"\n end",
"title": ""
},
{
"docid": "7bd0d5b45b91ee7dd926adc55d50c1fd",
"score": "0.6971946",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "913518b9aead595e83647412ae8a16dc",
"score": "0.69668597",
"text": "def show\n @news_post = @course.news_posts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news_post }\n end\n end",
"title": ""
},
{
"docid": "40105d2445086579339aaedafb0046f2",
"score": "0.6945674",
"text": "def index\n @news = News.order('id desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "b21a49bc45e943c3e120db3af2d4c152",
"score": "0.6934201",
"text": "def index\n news_url = 'https://newsapi.org/v1/articles?source=breitbart-news&sortBy=top&apiKey=51ff5e30d47f4063a25ca7f3c3cba6a8'\n response = HTTParty.get(news_url)\n @news_data = response\n\n q = params[:q]\n photo_url=\n \"https://pixabay.com/api/?key=6144418-f9b2e4313d5eeb7cd0f166436&q=#{q}&image_type=photo\"\n response = HTTParty.get(photo_url)\n @photodata = response\n\n @allposts = current_user.posts\n @new_post = Post.new\n end",
"title": ""
},
{
"docid": "6cf3f2b7086042ee851c9b61bd7a09be",
"score": "0.6914775",
"text": "def show\n @News = News.find(params[:id])\n\n render json: @News\n end",
"title": ""
},
{
"docid": "bba61f133c8b9d02f85e905957864d07",
"score": "0.6894696",
"text": "def index\n @news_posts = NewsPost.page(params[:page])\n end",
"title": ""
},
{
"docid": "9ff0a70166fdb8bc37a5dd0346569b0d",
"score": "0.68744993",
"text": "def index\n \t@posts = Blog.where(published: true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "7ff9ac314a019191c1e08f616dae7916",
"score": "0.68551266",
"text": "def index\n @news = News.sorted\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "d1633c25ad1f0ced0110047b6d1e28eb",
"score": "0.6841076",
"text": "def index\n @posts = @topic.posts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "57e76e937d0145d85be69732163bf5b7",
"score": "0.6835391",
"text": "def show\n @news = News.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "57e76e937d0145d85be69732163bf5b7",
"score": "0.6835391",
"text": "def show\n @news = News.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68319005",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68307745",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68307745",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68307745",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68307745",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68307745",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68307745",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "16fafe049f31b4e784227f1e7ab0fbdb",
"score": "0.68307745",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "2def0157e575563fd1f9e8b8705a9445",
"score": "0.6825401",
"text": "def index\n @news_article = NewsArticle.order(\"id ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news_article }\n end\n end",
"title": ""
},
{
"docid": "1d94dc162e9948920325d3f512844346",
"score": "0.68072385",
"text": "def index\n @news = News.recent.with_translations(I18n.locale).paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "91caa1f52b116f662f920b7a0fcaef43",
"score": "0.6805381",
"text": "def index\n #@posts = list_posts\n @posts = Post.all\n #render json: {posts: @posts}\n \n end",
"title": ""
},
{
"docid": "f2522daa26243ffa98375225ef582787",
"score": "0.6791256",
"text": "def index\n posts = Post.all\n render json: posts\n end",
"title": ""
},
{
"docid": "840e7c27bcef9da7684f414e946b1397",
"score": "0.67905354",
"text": "def index\n @posts = Post.order('created_at DESC').page(params[:page]).per(10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "9e4bfaa87507d05255fbaeadc1ecb1d6",
"score": "0.6779541",
"text": "def index\n @posts = Post.all\n render json: @posts\n end",
"title": ""
},
{
"docid": "e732c729d91c0c1c2965f1f688905fef",
"score": "0.67642206",
"text": "def index\n @posts = Post.all\n\n render json: @posts\n end",
"title": ""
},
{
"docid": "e732c729d91c0c1c2965f1f688905fef",
"score": "0.67642206",
"text": "def index\n @posts = Post.all\n\n render json: @posts\n end",
"title": ""
},
{
"docid": "c76855d845dad16316d7722c8f2c9241",
"score": "0.6763298",
"text": "def index\n @posts = Post.all\n \n render json: @posts\n end",
"title": ""
},
{
"docid": "12bb4c6f70647249e7eb56d2da9af91a",
"score": "0.675497",
"text": "def index\n @posts = Post.all\n render json: @posts, status: 200\n end",
"title": ""
},
{
"docid": "e528b11a5817aefe746f1e4864ae92ab",
"score": "0.67285204",
"text": "def posts(status=:published)\n params = {status: status} #converted to strings\n JSON.parse((connection.get do |req|\n req.params = params\n req.url (endpoint(:get_posts))\n req.headers = session_headers\n end).body)\n end",
"title": ""
},
{
"docid": "b83055214202c3ec4cc3f1406a188254",
"score": "0.67137694",
"text": "def view\n newsfeed = Newsfeed.new current_user\n\n respond_to do |format|\n format.html { render locals: { newsfeed: newsfeed } }\n format.json { render json: newsfeed.posts }\n end\n end",
"title": ""
},
{
"docid": "dddf9c87bd53432d2c3942a9ddd36221",
"score": "0.670658",
"text": "def index\n if params[:set_locale]\n redirect_to news_path(locale: params[:set_locale])\n else\n\n @news = News.paginate page: params[:page], order: 'created_at desc',\n per_page: 5\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end\n end",
"title": ""
},
{
"docid": "4cba223702a5d529c490625b46aadddd",
"score": "0.6702597",
"text": "def index\n if params[:site] && !Site.find(params[:site].to_i).nil?\n @site = Site.find(params[:site].to_i)\n @posts = @site.posts.order(\"created_at DESC\").where(postable_type: \"News\")\n else\n @posts = @company.posts.order(\"created_at DESC\").where(postable_type: \"News\")\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "c371bfadb4ec4bb575458bd7c93c740a",
"score": "0.66995126",
"text": "def index\n\t\t\t@posts = Post.all\n\n\t\t respond_to do |format|\n\t\t format.html\n\t\t format.json { render json: @posts }\n\t\t end\n end",
"title": ""
},
{
"docid": "2ca86ba133c8f05a764364590c4af5cd",
"score": "0.6691241",
"text": "def index\n @posts = @society.posts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "34c75e798288f9760be81d9194556401",
"score": "0.66892815",
"text": "def show\n @news_feed = NewsFeed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news_feed }\n end\n end",
"title": ""
},
{
"docid": "977f0313ccaea1382a9b6e1724cf3248",
"score": "0.6686622",
"text": "def index\n @posts = nil\n\n if !params[:topic_id].nil?\n @posts = Topic.find(params[:topic_id]).posts\n elsif !params[:user_id].nil?\n @posts = User.find(params[:user_id]).posts\n end\n\n @posts = @posts.order(created_at: :desc).page(params[:page]).per(10) \n render json: PostSerializer.new(@posts).serialized_json\n end",
"title": ""
},
{
"docid": "4b6881aab1862625d181035b78720bb9",
"score": "0.66864616",
"text": "def index\n @news = News.find(params[:news_id])\n @comments = @news.comments\n render(\n json: ActiveModel::ArraySerializer.new(\n @comments,\n each_serializer: CommentSerializer\n )\n )\n end",
"title": ""
},
{
"docid": "cc90c219d9f38c5ef773734974fbe4c1",
"score": "0.668367",
"text": "def index\n @posts = Post.all[0..200]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "f4ac54765953d5edf4bb13a1779f72d1",
"score": "0.6671742",
"text": "def index\n @news_posts = NewsPost.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news_posts }\n end\n end",
"title": ""
},
{
"docid": "af6de11c87ca6f9e7c81b02523539b57",
"score": "0.6668748",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "aa4257c08b0461ed4c316a034ce23cc0",
"score": "0.66637444",
"text": "def get_posts\n url = 'https://www.fimfiction.net/api/v2/blog-posts?'\n url << Fimfiction::Utils.query_builder(@filters) unless @filters.length == 0\n url << \"fields[blog_post]=#{Fimfiction::Utils.query_builder(@attributes)}\" unless @attributes.length == 0\n begin\n request = RestClient::Request.execute(method: :get, url: url, headers: {Authorization: 'Bearer '+@token}, :user_agent => \"gem-Fimfiction by Vertex - https://github.com/IAmVertex/gem-fimfiction\")\n return JSON.parse(request)\n rescue RestClient::ExceptionWithResponse => e\n err_response = JSON.parse(e.response)\n raise Fimfiction::Error.check(err_response[\"errors\"][0][\"code\"]), err_response[\"errors\"][0][\"title\"]\n end\n end",
"title": ""
},
{
"docid": "e06cdfdba53fa451ced6b37edb108470",
"score": "0.66628826",
"text": "def blog_posts\n @page = 'blog_posts'\n @blog_post_topics = BlogPostTopic.find(:all)\n respond_to do |format|\n format.html {\n @blog_posts = BlogPost.find(:all, :order => 'created_at DESC')\n }\n format.json {}\n end\n end",
"title": ""
},
{
"docid": "9fb53af70942fe0c974d4b2a927559b1",
"score": "0.662509",
"text": "def index\n posts = Post.all\n # send posts as json\n render json: posts\n end",
"title": ""
},
{
"docid": "aba6eaa3df93690bce78e7cb71915745",
"score": "0.6616969",
"text": "def index\n @news_items = NewsItem.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news_items }\n end\n end",
"title": ""
},
{
"docid": "4325ee38a0d19a0afa0ce121c7e0b630",
"score": "0.6611654",
"text": "def index\n @posts = Post.order(\"created_at desc\").paginate(page: params[:page], per_page: 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "a5ff1806f0bdf4d09d67c5e51db925a7",
"score": "0.6610688",
"text": "def show\n @news_article = NewsArticle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news_article }\n end\n end",
"title": ""
},
{
"docid": "3c8f4600800ccf91f365a57dbc4d2273",
"score": "0.6606053",
"text": "def posts\n #Telling the method to get posts.json\n self.class.get('/posts.json')\n end",
"title": ""
},
{
"docid": "3c8f4600800ccf91f365a57dbc4d2273",
"score": "0.6606053",
"text": "def posts\n #Telling the method to get posts.json\n self.class.get('/posts.json')\n end",
"title": ""
},
{
"docid": "221eee20077260db35081540bb4ec812",
"score": "0.6602805",
"text": "def index\n @posts = Post.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "8c1d217540d9f415aa2d8f424460d222",
"score": "0.6597099",
"text": "def news\n ctx = Sequent::Context.init()\n unless params[:slug].nil?\n ctx['post'] = Post.find_by_slug(params[:slug]).to_liquid\n ctx['mode'] = 'single'\n else\n ctx['posts'] = Post.find(:all, :order=>'created_on DESC').map &:to_liquid\n ctx['mode'] = 'list'\n end\n render_theme_template('news', ctx)\n end",
"title": ""
},
{
"docid": "adc2c20331ca82ca6c642909beffd70d",
"score": "0.65903825",
"text": "def index\n canonical_url(\"/posts\")\n @posts = Post.all\n\n respond_with(@posts)\n end",
"title": ""
},
{
"docid": "4bfcab2b6da325a4e5b62dce2f1b53e0",
"score": "0.65863633",
"text": "def index\n @blog_posts = BlogPost.all\n\n render json: @blog_posts\n end",
"title": ""
},
{
"docid": "8150ff0b8d418a0877e1a80d25b0171f",
"score": "0.6580371",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "8150ff0b8d418a0877e1a80d25b0171f",
"score": "0.6580371",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "8150ff0b8d418a0877e1a80d25b0171f",
"score": "0.6580371",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "8150ff0b8d418a0877e1a80d25b0171f",
"score": "0.6580371",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "8150ff0b8d418a0877e1a80d25b0171f",
"score": "0.6580371",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "8150ff0b8d418a0877e1a80d25b0171f",
"score": "0.6580371",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "4e694f9f0a0313f64d4c0582953f2972",
"score": "0.657954",
"text": "def show\r\n @posts = Post.find(:all)\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @posts }\r\n end\r\n end",
"title": ""
},
{
"docid": "7904517f2bf263b86af645e85a5c2201",
"score": "0.65682817",
"text": "def index\n\t\trespond_with @news_items = NewsItem.all\n\tend",
"title": ""
},
{
"docid": "9ddd9346264c2f642ba4c15dfb6d697e",
"score": "0.65682214",
"text": "def index\n @posts = Post.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "0163bd7f2ddf3c20ebe11e74234817b7",
"score": "0.6567768",
"text": "def news\n @heading = \"Popular News\"\n @stories = Story.find_all_by_media(\"news\")\n\n respond_to do |format|\n format.html { render :action => \"index\" }\n format.xml { render :xml => @stories }\n end\n end",
"title": ""
},
{
"docid": "8a2481f05bc5451c2ccb3722118a5efc",
"score": "0.65608394",
"text": "def index\n @posts = Post.paginate(:page => params[:page], :per_page =>10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "d77c82adaa2e2cb8f86cc6b6ee4835d3",
"score": "0.65577406",
"text": "def index\n @posts = access_token.get(\"/posts/get_posts/\").parsed.map{|p| Post.new(p)}\n end",
"title": ""
},
{
"docid": "84a25839e52e98062a34db7beeff05d5",
"score": "0.65539145",
"text": "def index\n posts = paginate Post.public, per_page: 20\n render json: posts, :root => \"posts\", adapter: :json\n end",
"title": ""
},
{
"docid": "7fa1eb31e267ba56ac5899e59b25de78",
"score": "0.6553392",
"text": "def new\n @newsfeeds = Newsfeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newsfeeds }\n end\n end",
"title": ""
},
{
"docid": "b07319ec09915764633db02e44945fe4",
"score": "0.65491784",
"text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "b07319ec09915764633db02e44945fe4",
"score": "0.65491784",
"text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "b07319ec09915764633db02e44945fe4",
"score": "0.65491784",
"text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "b07319ec09915764633db02e44945fe4",
"score": "0.65491784",
"text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "b07319ec09915764633db02e44945fe4",
"score": "0.65491784",
"text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "b07319ec09915764633db02e44945fe4",
"score": "0.65491784",
"text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "9916cbd5c11403990c12061094dc177a",
"score": "0.65456396",
"text": "def index\n @news = News.paginate(:page => params[:page]).order('id DESC')\n @title = \"Новости\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "4bea3fad241674fe409ec74d7195ce2f",
"score": "0.65421724",
"text": "def show\n @round_news = RoundNews.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round_news }\n end\n end",
"title": ""
},
{
"docid": "b44653ed808719a0663b8bf8b8409cfc",
"score": "0.6529685",
"text": "def index\n# @newsitems = Newsitem.where(:agreed => true).order('created_at desc').paginate(:page => params[:page], :per_page => 10) # paginated which limits it to 10?\n @newsitems = Newsitem.where(:agreed => true).order('created_at desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @newsitems.map { |newsitem| newsitem.as_json(include: {user: {only: :name}}, methods: [:articlephoto_url_normal, :articlephoto_url_carrousel, :comment_count]) } }\n\n end\n end",
"title": ""
},
{
"docid": "61de67a2f7efbe81b3ab85d22da19421",
"score": "0.6518969",
"text": "def show_all_posts\n feed_urls = Feed.all.collect(&:feed_url)\n @posts = fetch_all_feeds_posts(feed_urls)\n\n respond_to do |format|\n format.html\n format.json { render json: @feeds }\n end\n end",
"title": ""
},
{
"docid": "b6b8667391addb7d82a12dd70447ba94",
"score": "0.65164185",
"text": "def index\n begin \n respond_to do |format|\n @posts = Post.page(current_page).per(default_page_size).includes(:user, comments: :user).order(created_at: :desc)\n format.json { render json: @posts }\n end\n rescue => e\n format.json { render json: [] }\n end\n end",
"title": ""
},
{
"docid": "d89b7edc386dee47b3216df4fb1b1d16",
"score": "0.6514124",
"text": "def index\n @posts = @tournament.posts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "509c7eaa0659ea9887bae86db7ebdd78",
"score": "0.6509416",
"text": "def show\n @news = News.find(params[:id])\n @title = @news.title\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news }\n end\n end",
"title": ""
},
{
"docid": "c987be95cd8d2b324e41ac101a5cb95b",
"score": "0.65066785",
"text": "def index\n @posts = Post.order(\"updated_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "330b2ce987a343d95ce831ff267f4167",
"score": "0.6505882",
"text": "def index\n\t\t@posts = Post.all\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @posts }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cb1b3e7b684e6cd6097b7299d5f00f0d",
"score": "0.6497855",
"text": "def show\n @bollywood_news = BollywoodNews.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bollywood_news }\n end\n end",
"title": ""
},
{
"docid": "77622d7a963f65e2cec36dca21a6a180",
"score": "0.64945287",
"text": "def get_news\n @content = URI.parse(\"http://content.guardianapis.com/search?order-by=newest&api-key=#{ENV['GUARDIAN_CONTENT_API_KEY']}\")\n http = Net::HTTP.new(@content.host, @content.port)\n request = Net::HTTP::Get.new(@content.request_uri)\n response = http.request(request)\n json = JSON.parse(response.body)\n headlines = []\n test = false\n if json && json[\"response\"] && json[\"response\"][\"results\"]\n json[\"response\"][\"results\"].each do |thing|\n if thing[\"type\"] == \"article\"\n article_hash = {headline_text: thing[\"webTitle\"], url: thing[\"webUrl\"]}\n headlines << article_hash\n end\n end\n else\n headlines << {headline_text: \"Sorry, we could not find any stories\", url: \"#\"}\n end\n headlines\n end",
"title": ""
},
{
"docid": "eff732c373e020bfd9111a2ebe73d1d7",
"score": "0.6488242",
"text": "def new\n @news_feed = NewsFeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_feed }\n end\n end",
"title": ""
},
{
"docid": "0d974e68b1faa607713396de0bf692fb",
"score": "0.6477105",
"text": "def index\n\t @posts = list_posts\n end",
"title": ""
},
{
"docid": "8597894e3350791c2f885d6a57c440fd",
"score": "0.64751714",
"text": "def index\n @posts = Post.all\n render json: {\n status: 'SUCCESS',\n data: @posts,\n }, status: :ok\n end",
"title": ""
},
{
"docid": "d2ed04fd7878a0e9effabb4fc48fab92",
"score": "0.64686143",
"text": "def index\r\n @posts = Post.all.order('created_at DESC')\r\n\r\n render json: @posts, status: :ok\r\n end",
"title": ""
},
{
"docid": "26608c694104a870bb8f1da34f6ce7b8",
"score": "0.64681655",
"text": "def index\n @posts = Post.all\n @posts = Post.paginate(:page => params[:page], :per_page => 10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end",
"title": ""
},
{
"docid": "719aff2734d1b46ba771693e16501d1a",
"score": "0.6428402",
"text": "def show\n @tnews = Tnews.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tnews }\n end\n end",
"title": ""
},
{
"docid": "20456795403c5e7a21193c140d05d723",
"score": "0.6414726",
"text": "def show\n @admin_news = Admin::News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_news }\n end\n end",
"title": ""
},
{
"docid": "48fb8f79079e098947c323cb3434f925",
"score": "0.6413646",
"text": "def index\n response.headers['X-Total-Count'] = @posts.count.to_s\n @posts = @posts.page(params[:page]) if params[:page].present?\n @posts = @posts.per(params[:per]) if params[:per].present?\n\n render json: @posts\n end",
"title": ""
}
] |
1eea1e790a3ba2f0b35253ef6d6db14e
|
cutoff created orders + new subscriptions created orders
|
[
{
"docid": "9aa69fe346afd68ba3624275773c51df",
"score": "0.6597091",
"text": "def group_orders\n orders.or(cutoff.orders.where(created_at: 1.week.ago(completed_at)..completed_at))\n end",
"title": ""
}
] |
[
{
"docid": "d4c42d39786d619d2444aa8df6ebaddc",
"score": "0.6228929",
"text": "def create_order_without_notifications\n create_order_and_subscriptions\n end",
"title": ""
},
{
"docid": "5baf40c0acd0ebf57608702d250b6b64",
"score": "0.59130263",
"text": "def get_retroactive_subcount(orders)\n sorted_orders = orders.sort{ |order| Time.parse(order['created_at']).to_i }\n retroactive_cutoff = Time.parse('2017-04-01T00:00:00-00:00').to_i\n\n order_count = 0\n\n sorted_orders.each do |order|\n next if !order['confirmed'] || order['financial_status'] != 'paid'\n order_time = Time.parse(order['created_at']).to_i\n if order_time < retroactive_cutoff && order_count < 3\n order_count += sub_order_count(order_count, order)\n elsif order_time >= retroactive_cutoff\n order_count += sub_order_count(order_count, order)\n end\n end\n\n # should be at least three orders, for a user\n # to get invites.\n invites = 0\n if order_count >= 2\n invites = order_count\n end\n return invites\nend",
"title": ""
},
{
"docid": "90cc10e31613f69c9144d6acee0a873b",
"score": "0.573869",
"text": "def clean_orders\n Ccorder.delete_all([\"ordertype = 'unspecified' AND date_added < ?\", Time.now - 12.hours])\n end",
"title": ""
},
{
"docid": "80ba5300c6052c74e81b7c808e08fa22",
"score": "0.56515586",
"text": "def ordersInterval(bot, mongo)\n\n mongo[:orders].find({:finishedAt => {'$lte' => Time.now}}).each do |order|\n\n # call function if it exists\n if respond_to?(\"order_\"+order[:type].to_s, :include_private)\n send(\"order_\"+order[:type].to_s, bot, order, mongo)\n end\n\n # delete order\n mongo[:orders].delete_one(:_id => order[:_id])\n end\nend",
"title": ""
},
{
"docid": "453d1bd33110084e4270bf802bfb1ad0",
"score": "0.56393176",
"text": "def handle_past_orders\n remove_all_empty_orders\n remove_timeout_orders\n end",
"title": ""
},
{
"docid": "d3ada2929defd30212443292bec12f99",
"score": "0.5623882",
"text": "def unprocessed_orders\n # get all unfulfilled orders\n my_shopify_orders = ShopifyOrder\n .where('created_at BETWEEN ? AND ?', Time.zone.local(2017, 12, 27, 0, 0), Time.current)\n .where('json_array_length(fulfillments) = 0')\n\n puts \"** Number of orders to fulfill: #{my_shopify_orders.length} **\"\n puts \"*************\"\n\n my_shopify_orders\nend",
"title": ""
},
{
"docid": "517cd488bc248ab9d486073838af74a9",
"score": "0.56194645",
"text": "def placed_orders\n orders.where('checkout_date IS NOT NULL')\n end",
"title": ""
},
{
"docid": "517cd488bc248ab9d486073838af74a9",
"score": "0.56194645",
"text": "def placed_orders\n orders.where('checkout_date IS NOT NULL')\n end",
"title": ""
},
{
"docid": "bdb1208710bb36765408d20426845010",
"score": "0.5616355",
"text": "def create_two_orders_with_different_users\n order = Order.new\n order.order_status_id = 1\n order.pickup_date = Date.today\n order.order_date = Date.today\n order.user_id = users(:user).id\n order_product = order.order_products.new\n order_product.product_id = products(:whiskey).id\n order_product.quantity = 1\n order.save\n order = Order.new\n order.order_status_id = 1\n order.pickup_date = Date.today\n order.order_date = Date.today\n order.user_id = users(:admin).id\n order_product = order.order_products.new\n order_product.product_id = products(:whiskey).id\n order_product.quantity = 1\n order.save\n end",
"title": ""
},
{
"docid": "a21f2d1b9ee2c86b41bad454c09353e2",
"score": "0.5597607",
"text": "def create_subscriptions\n products.each do |product|\n subscriptions << Subscription.new(organization:,\n product:,\n user:,\n start_on: Time.zone.today)\n end\n end",
"title": ""
},
{
"docid": "5d3136a7680b351b9e51ab50ae240cfe",
"score": "0.55912584",
"text": "def after_create(order)\n order.promotions.each do |p|\n if p.application_limit? and p.orders.count >= p.application_limit\n p.update_attribute(:active, false)\n end\n\n if p.unique_code_based?\n code = PromotionCode.where(:code => order.promo_code).first\n code.redeem!(order) if code\n end\n end\n end",
"title": ""
},
{
"docid": "415cbf7c80809d5bc966f2f9eea5e4ae",
"score": "0.5533543",
"text": "def orders; end",
"title": ""
},
{
"docid": "415cbf7c80809d5bc966f2f9eea5e4ae",
"score": "0.5533543",
"text": "def orders; end",
"title": ""
},
{
"docid": "415cbf7c80809d5bc966f2f9eea5e4ae",
"score": "0.5533543",
"text": "def orders; end",
"title": ""
},
{
"docid": "415cbf7c80809d5bc966f2f9eea5e4ae",
"score": "0.5533543",
"text": "def orders; end",
"title": ""
},
{
"docid": "e9d134f002f26b3622527b2b16d5409f",
"score": "0.55121136",
"text": "def other_orders\n item.orders.where('id != ?', id || -1)\n end",
"title": ""
},
{
"docid": "3947627e0d44e94f24ac7242895f8f57",
"score": "0.5494621",
"text": "def myorders\n @orders = current_user.orders.where(delivered_at: nil)\n end",
"title": ""
},
{
"docid": "41bd22b11b8c8399a6eedda20a84e1c7",
"score": "0.54814386",
"text": "def get_eligible\n yesterday = DateTime.now - 1\n orders = ShopifyAPI::Order.all\n # Orders which have been fulfilled recently.\n orders.select do |order|\n order.fulfillment_status && \n order.fulfillments &&\n order.financial_status == \"paid\" &&\n order.fulfillments.first.status == \"success\" && \n order.fulfillments.first.updated_at < yesterday && \n order.fulfillments.first.updated_at >= @start_date &&\n no_discount_code?(order.note)\n end\nend",
"title": ""
},
{
"docid": "d859fe624f75dc60fa068a65ed771478",
"score": "0.5477139",
"text": "def on_new_filled_orders(new_filled_orders)\n\t\tend",
"title": ""
},
{
"docid": "ea194af057510cf9e60556ec810b6b7e",
"score": "0.5456545",
"text": "def get_eligible\n yesterday = DateTime.now - 1\n orders = ShopifyAPI::Order.all\n # Orders which have been fulfilled recently.\n orders.select do |order|\n order.fulfillment_status && \n order.fulfillments &&\n order.financial_status == \"paid\" &&\n order.fulfillments.first.status == \"success\" && \n order.fulfillments.first.updated_at < yesterday && \n order.fulfillments.first.updated_at >= @start_date &&\n has_discount_code?(order.note)\n end\nend",
"title": ""
},
{
"docid": "02f7c7a56b9327f3ab628126d19fafe1",
"score": "0.5454573",
"text": "def delivered_orders\n self.orders.where(\"status = 'Delivered'\")\n end",
"title": ""
},
{
"docid": "94a0a3fe4e52f1e65d4f3986022bde8d",
"score": "0.54406744",
"text": "def add_custom_subscription(params, order)\n # Check to see that order number has not already been used\n existing_subscription = self.subscriptions.where(order_number: order.order_number).first\n if existing_subscription\n return existing_subscription\n end\n\n base_time = Time.now.utc\n\n # If renewal or upgrade and the currnet subscription hasn't expired, prolong.\n if order['renewal'] == true or order['upgrade'] == true then\n if self.current_subscription and self.current_subscription.expires_at > base_time then\n base_time = self.current_subscription.expires_at\n end\n end\n\n if params[:periodicity] == 'days' then\n expires_at = base_time + params[:duration].days\n else\n expires_at = base_time + params[:duration].years\n end\n\n subscription = self.subscriptions.create!(\n order_id: order.id,\n order_number: order['order_number'],\n base_price: params[:base_price],\n renewal_price: params[:renewal_price],\n name: params[:name],\n duration: params[:duration],\n periodicity: params[:periodicity],\n kind: params[:kind],\n promotion_code: order['promotion_code'],\n currency: order['currency'],\n renewal: order['renewal'],\n upgrade: order['upgrade'],\n active: false,\n expires_at: expires_at\n )\n\n self.listings.update(open_past_listing: false)\n return subscription\n end",
"title": ""
},
{
"docid": "285f9965c9707be20400ab0a61f5961e",
"score": "0.5433747",
"text": "def accepted_orders\n render json: OrderItem.find_sold_by_customer(current_customer, Order::STATE_ACCEPTED).where(created_at: @range_time).unscope(:order).group_by_day('order_items.created_at').sum(:price)\n end",
"title": ""
},
{
"docid": "9a511c0298948e7615fb7ba11999b66d",
"score": "0.5414249",
"text": "def active_subscriptions\n #self.user_subscriptions.includes([:subscription, :orders]).where('spree_orders.delivery_date > ? and user_subscriptions.status = ? ', Time.now, \"active\").uniq\n self.user_subscriptions.includes([:subscription, :orders]).where('spree_orders.state = ? and user_subscriptions.status = ? ', \"confirm\", \"active\").uniq\n end",
"title": ""
},
{
"docid": "adabf0062708be0468b9e70e3eadce77",
"score": "0.5380732",
"text": "def fetch_active_subscriptions\n\n permited_status = ['confirm','placed', 'paused']\n active_subscriptions= self.user_subscriptions.includes(:orders).where('spree_orders.state in (?)',permited_status)\n result = []\n\n active_subscriptions.each do |sub|\n unpermited_order_statuses = ['canceled', 'complete']\n first_order = sub.orders.where('state not in (?)', unpermited_order_statuses).first\n\n result.push({\n id: sub.id,\n type: sub.subscription.subscription_type,\n #:delivery_date => sub.orders.where(state: \"confirm\").first.delivery_date.strftime(\"%B %d, %Y\"),\n delivery_date: first_order.delivery_date.strftime(\"%B %d, %Y\"),\n status: sub.status,\n #:status => first_order.state,\n is_blocked: sub.is_blocked\n })\n end\n result #return the final active subscription_orders result.\n end",
"title": ""
},
{
"docid": "ba498ddcbecabe46214c1bd635a3811b",
"score": "0.53763694",
"text": "def subscription_order_received\n @invoice = Invoice.find_by( order_id: params['orderid'] )\n @subscription = @invoice.subscription\n @anonymous_user = @subscription.anonymous\n\n # If Subscription doesn't exist, should redirect to 404\n if @invoice && @subscription\n @invoice, @subscription = compare_internal_invoice_status( @invoice )\n\n # Anonymous Users\n if @anonymous_user #TODO Filter out expired subscription\n user = User.find_by(email: @subscription.email)\n @temp_password = SecureRandom.hex(10)\n user.password = @temp_password\n user.save!\n #TODO Maybe limit the number of times this occurs\n end\n else\n render status: 404\n end\n end",
"title": ""
},
{
"docid": "82d993d5b86e1803106be52bbbc21997",
"score": "0.5367187",
"text": "def shutterfly_job_uncommon_orders\n #find all the orders that came from the shutterfly_job\n if shutterfly_affiliate_order?\n job = self.job.shutterfly_job\n orders = []\n job.shutterfly_job_suborders.each do |sub|\n orders << sub.order\n end\n orders\n else\n orders = []\n end\n orders\n end",
"title": ""
},
{
"docid": "bc9262ab47025282d45b6f19fed23800",
"score": "0.5366397",
"text": "def boring\n create_orders\n place_orders\n EventMachine::Timer.new 4, proc { cancel_orders(@orders.select { |_,o| o[\"long_term\"].nil? }) }\n end",
"title": ""
},
{
"docid": "361a8f67cfb94ea9b1af30e8f40afc10",
"score": "0.53600174",
"text": "def after_create\n self.gateway.increment_order_counter!(:new) if StraightServer::Config.count_orders\n end",
"title": ""
},
{
"docid": "a1473cfbadaf1ba21c4b89d9370e4fba",
"score": "0.53552836",
"text": "def expensive_orders_count\n self.orders.count { |order| order.total > 10000 }\nend",
"title": ""
},
{
"docid": "b848c01f72484baff186e8f4801eb534",
"score": "0.5343913",
"text": "def purchases\n @orders = Order.all.where(buyer: current_user).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "b848c01f72484baff186e8f4801eb534",
"score": "0.5343913",
"text": "def purchases\n @orders = Order.all.where(buyer: current_user).order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "b7e11f3c25e78bb972ca8731a617afc3",
"score": "0.53362185",
"text": "def live_orders() orders.select {|o| o.live_university_at?} end",
"title": ""
},
{
"docid": "0360b040169a5e08136e4dfb5a04b914",
"score": "0.5318964",
"text": "def index\n # should show all past and present orders\n orders = current_customer.orders.where(\"created_at > ?\", Time.current - 2.days ).order(created_at: :desc)\n unless orders.nil?\n @orders = orders.map do |order|\n order.destroy! if is_dropped_order?(order)\n order.archived! if can_archive_order?(order)\n order\n end\n @can_create_new_order = session.has_key?(:restaurant)\n end\n end",
"title": ""
},
{
"docid": "8f928b0615781edbcf5ba926a361748c",
"score": "0.5304131",
"text": "def completed_orders\n self.orders.where('\n paid_on IS NOT NULL AND \n generated_at IS NOT NULL AND \n filename IS NOT NULL AND \n reorder_id IS NULL AND\n order_bw_pages IS NOT NULL AND\n order_color_pages IS NOT NULL AND\n order_shipping_cost IS NOT NULL AND\n order_printing_cost IS NOT NULL\n ').order(\"generated_at DESC\")\n end",
"title": ""
},
{
"docid": "895769626828aa19042648f35ea16e2b",
"score": "0.5297565",
"text": "def pending_client_po\n @quotes = Quote.pending_client_order\n @quotes = filter_quotes_by_params(params).decorate\n end",
"title": ""
},
{
"docid": "0df86ecb7f75b3ad171ceb24ac5a8866",
"score": "0.5288911",
"text": "def active_orders\n @active_orders\n end",
"title": ""
},
{
"docid": "33b3b54c7779c1e933cd84b4e347f181",
"score": "0.52806604",
"text": "def recent\n @orders = Order.where(\"date > ?\", 1.week.ago)\nend",
"title": ""
},
{
"docid": "8165a3e1db126c4ececd802d3b2eef2e",
"score": "0.5269699",
"text": "def order_create\n self.update_attendees\n self.remove_slots\n end",
"title": ""
},
{
"docid": "6acf7dc0670f804b87ad8555f20edb7c",
"score": "0.52649456",
"text": "def new_vs_reccuring_customers\n sql=\"SELECT date_part('year',o.created_at) AS year, date_part('month',o.created_at) AS month,COUNT(DISTINCT o.customer_id) AS total,COUNT(CASE WHEN o.created_at = oo.min_created THEN o.customer_id END) AS new_customer_count,COUNT(DISTINCT o.customer_id)-COUNT(CASE WHEN o.created_at = oo.min_created THEN o.customer_id END) AS reccuring_customer_count\n FROM orders o JOIN\n (SELECT customer_id, MIN(created_at) AS min_created\n FROM orders\n GROUP BY customer_id\n ) oo\n ON o.customer_id = oo.customer_id\n GROUP BY date_part('year',o.created_at), date_part('month',o.created_at)\n ORDER BY date_part('year',o.created_at), date_part('month',o.created_at)\"\n self.find_by_sql(sql)\n end",
"title": ""
},
{
"docid": "186f37d24a09b3481f018add26d2ec38",
"score": "0.5263816",
"text": "def filter(market, timestamp, from, to, limit, order) \n trades = with_currency(market).order(order)\n trades = trades.limit(limit) if limit.present?\n trades = trades.where('created_at <= ?', timestamp) if timestamp.present?\n trades = trades.where('id > ?', from) if from.present?\n trades = trades.where('id < ?', to) if to.present?\n #Cointrade coin alteracao para implementacao de bitvalor sellside e buyside desfeito\n #if originator == 'buyside'\n # trades = trades.where('ask_id < bid_id') if originator.present?\n #elsif originator == 'sellside'\n # trades = trades.where('ask_id > bid_id') if originator.present?\n #end \n #Cointrade fim da alteracao\n\n #Cointrade - nova alteracao sell e buy side\n trades.each do |trade|\n trade.side = trade.ask_id < trade.bid_id ? 'buy' : 'sell'\n end \n #Cointrade - fim alteracao \n\n trades\n end",
"title": ""
},
{
"docid": "6f8fc6f6c94614cebc29c8a3485ba357",
"score": "0.5263584",
"text": "def after_create\n super\n OrderVersions.(self) unless self.order\n refresh\n end",
"title": ""
},
{
"docid": "6f8fc6f6c94614cebc29c8a3485ba357",
"score": "0.5263584",
"text": "def after_create\n super\n OrderVersions.(self) unless self.order\n refresh\n end",
"title": ""
},
{
"docid": "4f9becc684c967feb59de7abf9034e98",
"score": "0.52587813",
"text": "def limit_buy_order(account:, venue:, stock:, price:, qty:)\n generic_order(account, venue, stock, price, qty, 'buy', 'limit')\nend",
"title": ""
},
{
"docid": "a74ea5e2c9f979d519dc4d279472710f",
"score": "0.5257928",
"text": "def periods # needs list of periods for all subscriptions\n \n end",
"title": ""
},
{
"docid": "5319c580aafffd1832ce99d2b692170b",
"score": "0.52505153",
"text": "def create_autodelivery_order\n if @order.completed?\n\n #@order.create_subscriptions\n\n\n #if og_autoship.to_i==1\n if Spree::Promotion::Rules::Autodelivery.new.eligible?(@order) && !!@order.user # if this order is ready to signup\n merchant_id= Spree::OrdergrooveConfiguration.account[\"#{@order.store.code}\"][\"og_merchant_id\"]\n hashkey= Spree::OrdergrooveConfiguration.account[\"#{@order.store.code}\"][\"og_hashkey\"]\n og_subscription_url= Spree::OrdergrooveConfiguration.account[\"#{@order.store.code}\"][\"og_subscription_url_#{ENV[\"RAILS_ENV\"]}\"]\n og_offer_id= Spree::OrdergrooveConfiguration.account[\"#{@order.store.code}\"][\"og_offer_id\"]\n\n rc4=RC4.new(hashkey)\n Rails.logger.error(\"*\" * 50)\n Rails.logger.error(\"Order: \" + @order.number + \" subscribed to auto delivery, post to order groove now\")\n Rails.logger.error(\"*\" * 50)\n #encode the subscription\n subscription={:offer_id =>og_offer_id, :session_id=>cookies[:og_session_id]||\"\", :order_number =>@order.number}\n billing_address=@order.bill_address\n customer={:id=> @order.user_id.to_s, :first_name=>(billing_address.firstname), :last_name=>(billing_address.lastname), :email=>@order.email}\n customer[:billing_address]={:first_name=>(billing_address.firstname), :last_name=>(billing_address.lastname),:company_name=>\"\",:address=>(billing_address.address1),\n :address2=>(billing_address.address2||''),:city=>(billing_address.city),:state=>(billing_address.state_id==nil ? (!!billing_address.state_name ? billing_address.state_name : '') : Spree::State.find(billing_address.state_id).abbr),:zip_code=>billing_address.zipcode,:phone=>billing_address.phone,\n :fax=>\"\",:country_code=>Spree::Country.find(billing_address.country_id).iso}\n billing_address=@order.ship_address\n customer[:shipping_address]={:first_name=>(billing_address.firstname), :last_name=>(billing_address.lastname),:company_name=>\"\",:address=>(billing_address.address1),\n :address2=>(billing_address.address2||''),:city=>(billing_address.city),:state=>(billing_address.state_id==nil ? (!!billing_address.state_name ? billing_address.state_name : '') : Spree::State.find(billing_address.state_id).abbr),:zip_code=>billing_address.zipcode,:phone=>billing_address.phone,\n :fax=>\"\",:country_code=>Spree::Country.find(billing_address.country_id).iso}\n\n payment={:cc_holder=>Base64.encode64(rc4.encrypt(billing_address.firstname + ' ' + billing_address.lastname)).chomp, :cc_type=>'visa',:cc_number=> session[:cc].chomp(),:cc_exp_date=>Base64.encode64(rc4.encrypt(((@order.payments.last.source[:month].to_i<10 ? '0' : '') + @order.payments.last.source[:month].to_s + '/' + @order.payments.last.source[:year].to_s))).chomp }\n\n customer[:payment] =payment\n subscription[:customer] =customer\n\n subscriptions=[]\n @order.line_items.select{|l| l.auto_delivery}.each do |line_item|\n subscriptions << {:product_id => line_item.variant_id,\n :qty =>line_item.quantity,\n :frequency => line_item.frequency.gsub('_2',''),\n :period=>\"week\" }\n\n # post only one product one time\n #byebug\n begin\n subscription[:offer_id] =line_item.adjustments.eligible.select{|a| a.label.include? 'Auto'}.first.source.promotion.description\n subscription[:subscriptions] =subscriptions\n post_subscription subscription\n rescue\n subscriptions=[]\n end\n subscriptions=[]\n\n end\n\n #subscription[:subscriptions] =subscriptions\n\n session[:cc] = ''\n\n\n #post_subscription subscription\n end\n end\n end",
"title": ""
},
{
"docid": "d85eb8c788bdec02f3403629459d202b",
"score": "0.5241338",
"text": "def orders_with_items() orders.select {|o| o.line_items_unshipped_and_uncancelled.any? } end",
"title": ""
},
{
"docid": "ee9d2783699a3e8515d9fbe1e569f87b",
"score": "0.52344334",
"text": "def set_order\n @order = current_store.orders.unscope(where: :cancelled_at).find(params[:id])\n end",
"title": ""
},
{
"docid": "e26fff9e64496121184257354e21291e",
"score": "0.5234389",
"text": "def copies_arrive()\n before = Time.now\n purchase_delay = (self.vendor.andand.vendor_mood.andand.moodText == \"hostile\") ? VENDOR_ORDER_DELAY_HOSTILE : VENDOR_ORDER_DELAY_FRIENDLY\n copies_arrive = []\n\n # build an array of arrival delays of copies we already own (0 for instock, etc.)\n #\n copies = Copy.find(:all, :conditions => \"status = 1 and product_id = #{self.product_id}\", :include => :line_items)\n copies.each { |cc| copies_arrive.push(cc.due_back()) }\n\n # ...then add to that array the arrival delays of copies we've purchased\n #\n vendor_orders_considered = 0\n vendor_orders_total = quant_ordered\n self.vendor_order_logs.reject{|x| x.quant < 0}.sort{ |a,b| b.orderDate <=> a.orderDate}.each do |vol|\n break if (vendor_orders_considered >= vendor_orders_total)\n arrivalDelay = vol.orderDate + purchase_delay - Date.today()\n # what do we do for things that should have already arrived?\n # we could say \"if they're not here today, assume it's going to take another week\".\n # ...BUT there is a problem w that: depending on what we set our pain threshold at,\n # that extra week could cause us to conclude \"hey, it's quicker to just order new copies\n # than to wait for the ones we already ordered...so order some more!\".\n # This would be THE WRONG THING.\n # Thus: 1) CODE: set the expected arrival time of overdue items as \"today\"\n # 2) PROCESS: be vigilant of overdue shipments (Suz and\n # XYZ get daily emails). Read these emails, and make\n # sure to kill off orders that aren't being filled by\n # vendors, etc. Then The Right Thing will happen.\n if (arrivalDelay < 0) then arrivalDelay = 0 end\n vol.quant.times do\n copies_arrive.push(arrivalDelay)\n end\n vendor_orders_considered += vol.quant\n end\n copies_arrive = copies_arrive.reject{|x| nil == x}.sort\n copies_arrive\n end",
"title": ""
},
{
"docid": "2a53d7f3f394782c342e9f526579f9c1",
"score": "0.52332085",
"text": "def remove_old_orders\n\t\tstale_order_ids = $redis.zrangebyscore(ORDERS_SORTED_SET,(Time.now.to_i - DEFAULT_STORAGE_TIME_FOR_ORDERS_IN_SECONDS*2).to_s, (Time.now.to_i - DEFAULT_STORAGE_TIME_FOR_ORDERS_IN_SECONDS))\n\t\t$redis.pipelined do \n\t\t\tstale_order_ids.each do |order_id|\n\t\t\t\tremove_order(order_id)\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "88c3db776700d2d4b08e23756c3e36d3",
"score": "0.5231483",
"text": "def order_notification\n end",
"title": ""
},
{
"docid": "47b86451050e8df859315a090564fb29",
"score": "0.52300835",
"text": "def buy_more\n @order = Order.new(:express_token => params[:token], :payment_method => \"paypal\")\n @user = User.find_by_payment_token(@order.express_token)\n @order.price = (@user.temp_buy_more.to_f).to_s\n logger.debug \"=========>Amount billed for purchase===>\" + @order.price\n @order.save\n @user.orders << @order\n\n respond_to do |format|\n if @order.purchase\n logger.debug \"======>successful purchase\"\n if @user\n #activate new subscriptions\n @user.subscriptions.where(:buy_more => true).each do |s|\n s.subscription_message_fill\n s.enqueue_first_job\n\n #to save from deletion when future subscriptions payment fails\n s.update :buy_more => false\n end\n format.html { redirect_to buy_more_user_path(:id => @user.uuid), notice: 'Thanks for the purchase. Your SMS Subscription has been activated.' }\n else\n logger.debug \"==========> can't find user based on token\"\n flash[:error] = \"Payment failed\"\n format.html { redirect_to buy_more_user_path(:id => @user.uuid) }\n end\n else\n logger.debug \"======>failed purchase\"\n #all subscriptions in buy more deleted\n @user.subscriptions(:buy_more => true).destroy_all\n flash[:error] = \"Payment failed\"\n format.html { redirect_to buy_more_user_path(:id => @user.uuid) }\n end\n end\n\n end",
"title": ""
},
{
"docid": "b9cbe33af2dd47ab08b12f2fd58fd5a7",
"score": "0.52133554",
"text": "def make_purchase_order\n filter_matching_vendor\n @pr_items = PurchaseRequisitionItem.where(:status => PurchaseRequisitionItem::APPROVED).group_by(&:trade_company_id)\n end",
"title": ""
},
{
"docid": "0077f8ccb294c9a66034b6fa6ef2c267",
"score": "0.5211467",
"text": "def validate_subscription\n # TODO: refactorizar esto con : through para acceder directo a .product :yondri\n if user_products.count == 0\n update_column(:member, 0)\n else\n user_products.where('status = 1').each do |user_product|\n if user_product.feature == 'subscription'\n if user_product.end_date && user_product.end_date.past?\n user_product.update_column(:status, 0)\n update_column(:member, 0)\n \"expired - user_id: #{id} - #{user_product.end_date}\"\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0b7c35c7342d932553ca06535e46b8d2",
"score": "0.520751",
"text": "def prune_old_unpaid_purchase_records(user)\n user.sales.each do |sale|\n age_of_sale = ( (Time.now - sale.created_at) / 24 / 60 / 60 )\n sale.delete if (!sale.receipt_confirmed and !@sale.technically_paid?) and age_of_sale > 7.0\n end\n end",
"title": ""
},
{
"docid": "a315997e18606da8e4e46ddcfbf9005c",
"score": "0.52053446",
"text": "def all_subscriptions\n #enable this one for the previous conditonal update of resume/pause functionality.\n #self.user_subscriptions.includes([:subscription, :orders]).where('user_subscriptions.status = ?', \"active\").uniq.order(:subscription_id)\n\n permited_status = ['confirm', 'placed']\n self.user_subscriptions.includes([:subscription, :orders]).where('spree_orders.state in (?)', permited_status).uniq.order(:subscription_id)\n end",
"title": ""
},
{
"docid": "526f64aead1234f818eeffc3ccbf5c0a",
"score": "0.51987815",
"text": "def new_order\n is_signed_in ? order2 : order1\nend",
"title": ""
},
{
"docid": "ab9b9e0bef50f48eb9b78566c2046d47",
"score": "0.51973844",
"text": "def range\n if valid_date_ranges?\n filtered_orders = Spree::Order.filter_on_delivery_date(@start_date, @end_date) if filter_on_delivery_date?\n filtered_orders = Spree::Order.filter_on_order_date(@start_date, @end_date) if filter_on_order_date?\n else\n filtered_orders = Spree::Order.get_all_orders\n end\n\n #@orders = filtered_orders.page(params[:page]).per(params[:per_page] || Spree::Config[:orders_per_page])\n #@search = Spree::Order.accessible_by(current_ability, :index).ransack(params[:q])\n\n @search = filtered_orders.ransack(params[:q])\n @orders = @search.result(distinct: true).page(params[:page]).per(params[:per_page] || Spree::Config[:orders_per_page])\n\n end",
"title": ""
},
{
"docid": "581cf9ecf5bdbb1235d40404cea210b2",
"score": "0.51957214",
"text": "def index\n authorize Order\n @orders = policy_scope(Order).sort{|o1, o2| o2.created_at <=> o1.created_at}\n end",
"title": ""
},
{
"docid": "7a8d0f9873b546dfc28331ed288adb57",
"score": "0.51956743",
"text": "def cart_orders\n orders.unpaid.order_by(u_at: :desc)\n end",
"title": ""
},
{
"docid": "0ed216a3f6eee72f5763e9f18a42b800",
"score": "0.5191373",
"text": "def used_subscriptions # TODO: include periods\r\n self.subscriptions.inject(0) { |memo,sub| sub.copies_used + memo; }\r\n end",
"title": ""
},
{
"docid": "2a7b722ac9ef2de8fbc63caf462eac32",
"score": "0.5191191",
"text": "def refresh_purchase_orders\n cant = PurchaseOrder.all.count\n refreshed = false\n\n #PurchaseOrder.all.each do |po|\n #id_cloud = po.id_cloud\n #cloud_po = Sales.get_purchase_order(id_cloud)\n #if cloud_po == nil\n #puts po.id_cloud\n #puts \"nil\"\n #po.destroy!\n #end\n #end\n\n\n PurchaseOrder.where(\"group_number != -1\").each do |po| #where(owner: true)\n id_cloud = po.id_cloud\n cloud_po = Sales.get_purchase_order(id_cloud)\n\n if cloud_po == nil\n puts po.id_cloud\n puts \"nil\"\n po.destroy!\n else\n\n if po.owner != true and po.team_id_cloud != cloud_po[\"cliente\"]\n po.team_id_cloud = cloud_po[\"cliente\"]\n po.save!\n supp = Supplier.get_by_id_cloud(cloud_po['cliente'])\n if supp\n po.group_number = supp.id\n po.save!\n end\n refreshed = true\n end\n\n if po.owner != true\n\n if cloud_po[\"estado\"] != po.state\n po.state = cloud_po[\"estado\"]\n po.save!\n refreshed = true\n puts \"Modifico State: #{po.state}\"\n end\n\n end\n\n if po.owner == true\n\n if po.team_id_cloud != cloud_po[\"proveedor\"]\n po.team_id_cloud = cloud_po[\"proveedor\"]\n po.save!\n supp = Supplier.get_by_id_cloud(cloud_po['proveedor'])\n if supp\n po.group_number = supp.id\n po.save!\n end\n refreshed = true\n end\n\n puts \"Local: #{po.state} - Nube: #{cloud_po[\"estado\"]}\"\n if po.state != cloud_po[\"estado\"]\n po.state = cloud_po[\"estado\"]\n po.save!\n refreshed = true\n puts \"Modifico State: #{po.state}\"\n end\n\n puts \"Q local: #{po.quantity_done} -- Q nube: #{cloud_po[\"cantidadDespachada\"]}\"\n\n if po.quantity_done != cloud_po[\"cantidadDespachada\"]\n po.quantity_done = cloud_po[\"cantidadDespachada\"]\n po.save!\n refreshed = true\n end\n\n end\n\n if po.true_quantity_done != cloud_po[\"cantidadDespachada\"]\n po.true_quantity_done = cloud_po[\"cantidadDespachada\"]\n po.save!\n refreshed = true\n end\n\n end\n\n\n end\n\n PurchaseOrder.where(\"group_number == -1\").each do |po|\n id_cloud = po.id_cloud\n cloud_po = Sales.get_purchase_order(id_cloud)\n puts \"sfpt - Local: #{po.state} - Nube: #{cloud_po[\"estado\"]}\"\n if po.state != cloud_po[\"estado\"]\n po.state = cloud_po[\"estado\"]\n po.save!\n refreshed = true\n puts \"Modifico State: #{po.state}\"\n end\n\n if po.true_quantity_done != cloud_po[\"cantidadDespachada\"]\n po.true_quantity_done = cloud_po[\"cantidadDespachada\"]\n po.save!\n refreshed = true\n end\n\n end\n\n json_response({resp: \"Todo estaba OK\", cantidad_oc: cant }) and return if !refreshed\n json_response({response: \"Actualizado\"})\n end",
"title": ""
},
{
"docid": "52211f67b96500fb524323fa159c8c6e",
"score": "0.51833063",
"text": "def sales_post_production_orders\n self.post_production_orders.where(:case => POST_PRODUCTION_ORDER[:sales_order] )\n end",
"title": ""
},
{
"docid": "0c171d40efbc077c5d16b66eb10dbf9b",
"score": "0.5182723",
"text": "def test_order_subscriptions\n order = FactoryGirl.build(:subscription_test)\n order.order_transactions << FactoryGirl.build(:authorization_for_subscription)\n\n credit_card = credit_card(:number => '1')\n\n assert_difference 'order.order_transactions.count' do\n capture = order.create_subscription(credit_card)\n assert order.paid?\n assert capture.success?\n end\n end",
"title": ""
},
{
"docid": "a5d290c56041597d2acbecd34179c6ba",
"score": "0.5179335",
"text": "def create_fake_order()\n \n \n if product.inventory_ordered.nil?\n product.inventory_ordered = InventoryOrdered.new(:quant_dvd => 0)\n product.inventory_ordered.save\n end\n \n product.inventory_ordered.quant_dvd = 1\n orderdate = Date.today - 7\n product.save\n vol = VendorOrderLog.find(:all, :conditions => \"product_id = #{product.product_id} AND orderDate = '#{orderdate}' AND quant > 0\")[0]\n if (vol.nil?) \n vol = VendorOrderLog.new(:product_id => product.product_id, :orderDate => orderdate, :purchaser_id=> Purchaser.find_by_name_first(\"smartflix\").andand.id) \n end\n # quant is positive, bc the number on order has increased\n vol.quant += 1\n vol.save\n \n \n end",
"title": ""
},
{
"docid": "a6b1730c8775254fdcf6947fd0dd9492",
"score": "0.5174715",
"text": "def univ_orders_live()\n Order.for_cust(self).for_univ_any.select{ |o| o.live}\n end",
"title": ""
},
{
"docid": "3d562bc6437468fbc32d2adb7edad097",
"score": "0.5172715",
"text": "def schedule_order(order)\n # No scheduled orders yet.\n end",
"title": ""
},
{
"docid": "5ee88cc05fce5974286666e21a62729c",
"score": "0.51701206",
"text": "def sales\n @orders = Order.all.where(seller: current_user).order(\"created_at DESC\") \n end",
"title": ""
},
{
"docid": "05da8ca56d09ec29cf9fdbec127d2425",
"score": "0.51663244",
"text": "def set_purchase_orders\n purchase_order_ids = Invoice.select(:purchase_order_id).map(&:purchase_order_id)\n @purchase_orders = PurchaseOrder.where.not(id: purchase_order_ids)\n end",
"title": ""
},
{
"docid": "329261e52f50ff9414a5bd2ca3eecbbb",
"score": "0.5165456",
"text": "def other_orders_filter(order)\n\t\t\t{\n\t\t\t\tnested: {\n\t \tpath: \"employees\",\n\t \tquery: {\n\t \t\tbool: {\n\t \t\t\tmust: [\n\t \t\t\t\t{\n\t \t\t\t\t\tnested: {\n\t\t\t\t \tpath: \"employees.bookings\",\n\t\t\t\t \tquery: {\n\t\t\t\t\t bool: {\n\t\t\t\t\t \tmust_not: [\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \tterm: {\n\t\t\t\t\t\t\t \"employees.bookings.order_id\".to_sym => {\n\t\t\t\t\t\t\t value: order.id.to_s\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t \t} \n\t\t\t\t\t\t }\n\t\t\t\t\t \t]\n\t\t\t\t\t }\n\t\t\t\t \t}\n\t\t\t\t }\n\t \t\t\t\t}\n\n\t \t\t\t]\n\t \t\t}\n\t \n\t \t}\n\t \t}\n \t}\n\t\tend",
"title": ""
},
{
"docid": "e55631aad122b1e6976f3ce728afa7d8",
"score": "0.5161017",
"text": "def create_invoices\n \n self.calculate_date_started_full if self.date_started_full.nil?\n \n interval = case self.subscription.interval\n when Subscription::INTERVAL_MONTHLY then 1.month\n when Subscription::INTERVAL_YEARLY then 1.year\n end\n sc = self.subscription.site.store_config\n v = self.subscription.variant\n unit_price = v.clearance && v.clearance_price ? v.clearance_price : (v.on_sale? ? v.sale_price : v.price)\n \n # Special case if the subscription starts on specific day\n if self.subscription.start_on_day && (Date.today > self.date_started_full)\n li = self.line_items.where(\"date_starts = ? date_ends = ?\", self.date_started, self.date_started_full - 1.day).first\n if li.nil?\n prorated_unit_price = unit_price + 0.00 \n if self.subscription.prorate \n prorated_unit_price = case self.subscription.prorate_method\n when Subscription::PRORATE_METHOD_FLAT then self.subscription.prorate_flat_amount\n when Subscription::PRORATE_METHOD_PERCENTAGE then unit_price * ((self.date_started_full - self.date_started).to_f / ((self.date_started_full + interval) - self.date_started_full).to_f)\n when Subscription::PRORATE_METHOD_CUSTOM then self.subscription.custom_prorate(self) \n end\n end \n invoice = Caboose::Invoice.create( \n :site_id => self.subscription.site_id,\n :status => Caboose::Invoice::STATUS_PENDING,\n :financial_status => Caboose::Invoice::STATUS_PENDING,\n :date_created => DateTime.now, \n :payment_terms => sc.default_payment_terms,\n :invoice_number => sc.next_invoice_number\n ) \n LineItem.create(\n :invoice_id => invoice.id,\n :variant_id => v.id,\n :quantity => 1,\n :unit_price => prorated_unit_price,\n :subtotal => prorated_unit_price,\n :status => 'pending',\n :user_subscription_id => self.id, \n :date_starts => d,\n :date_ends => d + interval - 1.day\n )\n invoice.calculate\n invoice.save \n end\n end \n\n d2 = self.date_started_full + 1.day - 1.day\n while d2 <= Date.today do\n d2 = d2 + interval\n end\n d = self.date_started + 1.day - 1.day\n while d <= d2 do\n # See if an invoice has already been created for today \n li = self.line_items.where(\"date_starts = ? AND date_ends = ?\", d, d + interval - 1.day).first\n if li.nil?\n invoice = Caboose::Invoice.create( \n :site_id => self.subscription.site_id,\n :customer_id => self.user_id,\n :status => Caboose::Invoice::STATUS_PENDING,\n :financial_status => Caboose::Invoice::STATUS_PENDING,\n :date_created => DateTime.now, \n :payment_terms => sc.default_payment_terms,\n :invoice_number => sc.next_invoice_number\n ) \n LineItem.create(\n :invoice_id => invoice.id,\n :variant_id => v.id,\n :quantity => 1,\n :unit_price => unit_price,\n :subtotal => unit_price,\n :status => 'pending',\n :user_subscription_id => self.id, \n :date_starts => d,\n :date_ends => d + interval - 1.day\n )\n invoice.calculate\n invoice.save \n end\n d = d + interval\n end \n return true \n end",
"title": ""
},
{
"docid": "cb7fb88b59b11dd6764a880a32abccf5",
"score": "0.5144098",
"text": "def all_orders\n sql_query = \"SELECT * FROM orders WHERE\n line_items @> '[{\\\"subscription_id\\\": #{subscription_id}}]';\"\n return Order.find_by_sql(sql_query)\n end",
"title": ""
},
{
"docid": "4bb9f5516e67846d6a72418799bfe608",
"score": "0.51437587",
"text": "def reactive_not_on_art_ever(ids)\n @orders = Order.find_by_sql(\"SELECT DISTINCT v1.person_id FROM\n (SELECT person_id FROM obs LEFT OUTER JOIN patient ON patient.patient_id = obs.person_id \\\n WHERE concept_id = (SELECT concept_id FROM concept_name \\\n WHERE name = 'ON ART') AND value_coded IN (SELECT concept_id FROM concept_name \\\n WHERE name = 'NO') AND patient.voided = 0 AND \\\n DATE_FORMAT(patient.date_created, '%Y-%m-%d') <= '\" + @end_date + \"') AS v1,\n (SELECT person_id FROM obs LEFT OUTER JOIN patient ON patient.patient_id = obs.person_id \\\n WHERE value_coded = (SELECT concept_id FROM concept_name \\\n WHERE name = 'POSITIVE') AND patient.voided = 0 AND patient.patient_id IN (#{ids}) AND \\\n DATE_FORMAT(patient.date_created, '%Y-%m-%d') <= '\" + @end_date + \"') AS v2 WHERE v1.person_id = v2.person_id\").length rescue 0\n end",
"title": ""
},
{
"docid": "d56adb2983d3bea0b66effe5114fe327",
"score": "0.51405674",
"text": "def requests\n self.orders.where('order_status = ?', 'requested')\n end",
"title": ""
},
{
"docid": "98da3f1078d769d8d70ed62b0f243965",
"score": "0.513729",
"text": "def closed_orders\n authorize! :read, @orders \n @orders = Order.where(:open => false)\n end",
"title": ""
},
{
"docid": "e7d1c506e0656ce7730a5087aff6f9a2",
"score": "0.5133348",
"text": "def execute\n orders_within_range = super\n orders_within_range.map(&:amount).inject(0, &:+)\n end",
"title": ""
},
{
"docid": "6fa307424090805b34dee4c1f2001702",
"score": "0.5128804",
"text": "def orders_unique\n driver_order_times.map{|dto| dto.order}.uniq\n end",
"title": ""
},
{
"docid": "6fa307424090805b34dee4c1f2001702",
"score": "0.5128804",
"text": "def orders_unique\n driver_order_times.map{|dto| dto.order}.uniq\n end",
"title": ""
},
{
"docid": "a30f9962a123169de777f6fdc79e349b",
"score": "0.51281583",
"text": "def create_order\n create_order_and_subscriptions.tap do |order|\n send_notifications_for_successful_order if order.present?\n end\n end",
"title": ""
},
{
"docid": "6b7b20133ab535f488a19131abdcde08",
"score": "0.5118183",
"text": "def myorders\n \n end",
"title": ""
},
{
"docid": "c3b7f742328f2963f9585afd06d7f3b8",
"score": "0.5114802",
"text": "def todays_production\n authorize! :read, @orders \n @orders = Order.where(\"DATE(delivery_date) = ?\", Date.today + 1.day)\n end",
"title": ""
},
{
"docid": "0668769d731fbc59d3d86187bf3638ee",
"score": "0.51135504",
"text": "def remove_proper_orders\n stmt = <<~SQL\n DELETE FROM orders WHERE DATE(date_created) <= DATE('#{@date}') AND creator IN (#{@users}) AND patient_id NOT IN (#{@patients})\n LIMIT 1000\n SQL\n central_remove(stm: stmt, msg: 'Removing orders that were migrated properly')\n end",
"title": ""
},
{
"docid": "3b7b0b18a04beb81edab37d2a4e6c55d",
"score": "0.5107181",
"text": "def prepare_new_order\n @order = Order.recently_created.find_by(id: order_params[:id])\n # @order = Order.new(order_params)\n # @order.user_id = current_user.id\n @product = Product.find(@order.product_id)\n @order.price_cents = @product.price_cents\n end",
"title": ""
},
{
"docid": "4b9d93c1f1b8a4440ea1c7adc8285dbc",
"score": "0.51068646",
"text": "def pending_objects\n Order.where(\"shipped_at IS NOT NULL AND invoice_sent_at IS NULL\")\n end",
"title": ""
},
{
"docid": "bbb7f952bc34597f69584bb727f97594",
"score": "0.5101214",
"text": "def create\n restaurant_id = params.fetch(:id)\n order_data= params.fetch('order')\n order = Order.new(restaurant_id: restaurant_id)\n order.items_orders << order_items\n order.description = order_data['description']\n order.status = 0\n order.meal = order_data['meal']\n order.owner = current_user\n invited_users =[]\n\n #this sql shoud be optmized\n if (params.has_key?('groups'))\n invited_groups = []\n invited_groups << Group.find_by_name(params.fetch('groups'))\n invited_groups.each do |group|\n invited_users += group.users;\n end\n end\n\n if (params.has_key?('users'))\n invited_users << User.find_by_name(params.fetch('users'))\n end\n invited_users.delete(current_user)\n invited_users.uniq!\n order.users << invited_users\n\n if order.save\n Notification.create(order, :create, current_user, invited_users)\n flash[:notice] = \"Order successfully created\"\n redirect_to :back\n else\n flash[:notice] = \"Order error\"\n redirect_to :back\n end\n end",
"title": ""
},
{
"docid": "497ced255b65de5fa049dafbff6f4343",
"score": "0.5099211",
"text": "def update_post_delivery_statistics\n # sales return and delivery lost will be created on their own class\n # with logic to trigger the ProductionOrder => for lost delivery\n # for sales return, there are 2 possibility => PostProductionOrder or ProductionOrder. \n \n self.fulfilled_order = self.delivery_entries.where(\n :is_confirmed => true, \n :is_finalized => true \n ).sum(\"quantity_confirmed\")\n \n self.save \n end",
"title": ""
},
{
"docid": "025dfafa792edfbd7c040b086dc36deb",
"score": "0.5094499",
"text": "def orders\n #user_orders = Order.where(email: email)#.where.not(status: \"pending\")\n user_orders = Order.where([\"email = ? and status != ?\", email, \"pending\"])\n return user_orders\n end",
"title": ""
},
{
"docid": "0f0732c04d6db08400ae88bcf294008b",
"score": "0.50872445",
"text": "def orders\n @orders ||= OrderProxy.new(self)\n end",
"title": ""
},
{
"docid": "c9777939dae819e9a7f9e694c2b41910",
"score": "0.5086855",
"text": "def test_that_we_dont_report_oos_for_todays_orders \n setup\n \n input = { \n :cust1 => {\n :sf_order => { :orderDate => Date.today,\n :server_name => \"smartflix\",\n :paid => true,\n :lis => [ {:name => \"smart10\", :inStock => false},\n {:name => \"smart11\", :inStock => false},\n {:name => \"smart12\", :inStock => false} ]\n }\n },\n :cust2 => {\n :sf_order => { :orderDate => Date.today,\n :server_name => \"smartflix\",\n :paid => true,\n :lis => [ {:name => \"smart99\", :inStock => true} ]\n }\n }\n }\n\n # orders placed today should not report OOS\n #\n build_fake(input)\n PotentialShipment.destroy_all\n PotentialItem.destroy_all\n new_shipments = Shipping.create_list\n Shipping.save_to_db(new_shipments)\n\n actual = Shipping.unshippable_oos_mention\n expected = [ ]\n assert_equal(expected.to_set, actual.to_set)\n\n # orders placed yesterday SHOULD report OOS\n #\n # (we can delete and recreate the potential shipments here if we\n # want, it won't make a difference)\n\n Date.force_today(Date.today + 1)\n\n actual = Shipping.unshippable_oos_mention\n\n expected = [txt2cust(:cust1).orders.first ]\n assert_equal(expected.to_set, actual.to_set)\n\n\n\n Date.force_today(nil)\n\n end",
"title": ""
},
{
"docid": "8d5b5595ac8aec50323b7ef08799b31a",
"score": "0.5079015",
"text": "def news\n subscriptions = self.subscriptions.reject { |subscription| subscription.new_messages_count == 0 }\n end",
"title": ""
},
{
"docid": "8d5b5595ac8aec50323b7ef08799b31a",
"score": "0.5079015",
"text": "def news\n subscriptions = self.subscriptions.reject { |subscription| subscription.new_messages_count == 0 }\n end",
"title": ""
},
{
"docid": "6f279e1430aa80b6271b46d46a4e9b7d",
"score": "0.50772166",
"text": "def subscribe_for_next_two_months\n create_next_order(SECOND_DELIVERY_DAYS.days.from_now)\n create_next_order(THIRD_DELIVERY_DAYS.days.from_now)\n end",
"title": ""
},
{
"docid": "ef1ec762d0555ea3e8318aa4f91b0a4e",
"score": "0.50744003",
"text": "def index\n\n if params.present?\n # Test condition here to find interval scope\n # if 'to' and 'from' present,\n # Call the interval scope with:\n # Order.interval('from_datetime_obj: 2015-07-09', 'to_datetime_obj: 2015-07-09')\n #\n\n if params[:to].present? && params[:from].present?\n if params.has_key?(:page)\n @orders = Order.filter(params.slice(:customer_id, :order_date, :user_id, :account_manager_id)).interval(params[:to], params[:from]).page params[:page]\n else\n @orders = Order.filter(params.slice(:customer_id, :order_date, :user_id, :account_manager_id)).interval(params[:to], params[:from])\n end\n # @order_count = Order.filter(params.slice(:customer_id, :order_date, :user_id, :account_manager_id)).interval(params[:to], params[:from]).count\n @order_count = @orders.count\n else\n\n # Initialize order_count to later use it to paginate\n @order_count = Order.filter(params.slice(:customer_id, :order_date, :user_id, :account_manager_id, :currency_id)).count\n\n if params.has_key?(:page)\n # Only allow a trusted parameter \"white list\" through.\n @orders = Order.filter(params.slice(:customer_id, :order_date, :user_id, :account_manager_id, :currency_id)).order(created_at: :DESC).page params[:page]\n else\n @orders = Order.filter(params.slice(:customer_id, :order_date, :user_id, :account_manager_id, :currency_id)).order(created_at: :DESC)\n end\n\n end\n\n\n # Custom Pagination\n # @per_page = 10\n # if params.has_key?(:page)\n # total_records = Order.count\n # else\n # total_records = @orders.count\n # end\n\n\n # Reverse custom pagination code to testfix pagination bug\n # Special Custom Pagination for models with query params\n @per_page = 10\n if params.has_key?(:order_date) ||\n params.has_key?(:user_id) ||\n params.has_key?(:account_manager_id) ||\n params.has_key?(:customer_id) ||\n params.has_key?(:currency_id)\n\n total_records = @order_count\n else\n total_records = Order.count\n end\n\n # @orders = Order.all.page params[:page]\n\n if (total_records % @per_page) == 0\n total_pages = total_records/@per_page\n else\n total_pages = (total_records/@per_page) + 1\n end\n @meta = { total_pages: total_pages, total_records: total_records }\n # end\n\n\n else\n @orders = Order.all.order(created_at: :DESC)\n @per_page = 10\n total_records = Order.count\n if (total_records % @per_page) == 0\n total_pages = total_records/@per_page\n else\n total_pages = (total_records/@per_page) + 1\n end\n @meta = { total_pages: total_pages, total_records: total_records }\n end\n\n # # Custom Pagination\n # @per_page = 10\n # total_records = @orders.count\n # @orders = Order.all.page params[:page]\n\n # if (total_records % @per_page) == 0\n # total_pages = total_records/@per_page\n # else\n # total_pages = (total_records/@per_page) + 1\n # end\n # @meta = { total_pages: total_pages, total_records: total_records }\n\n # Don't forget to set per_page in the model model:\n # per_page: 10\n\n # Finally, render pretty json lol\n render json: @orders, meta: @meta, status: :ok\n end",
"title": ""
},
{
"docid": "0f51795802f6776b17995ab3f70445a0",
"score": "0.50719976",
"text": "def re_create_sales_ppo\n order_id = self.id\n #order_id = self.order_id\n #create sales ppo for each order line\n order_master = OrderMaster.find(order_id)\n if order_master.medium.blank?\n # remove_from_sales_ppo order_id\n return puts \"Not a HBN Order, skipped!\" #.colorize(:blue)\n end\n if order_master.medium.media_group_id != 10000\n remove_from_sales_ppo order_id\n return puts \"Not a HBN Order, skipped!\" #.colorize(:red)\n end\n # .where('ORDER_STATUS_MASTER_ID > 10002')\n if order_master.order_status_master_id < 10001\n remove_from_sales_ppo order_id\n return puts \"Not a processed order, skipped!\" #.colorize(:red)\n end\n\n campaign_playlist_id = order_master.campaign_playlist_id || nil if order_master.campaign_playlist_id.present?\n campaign_id = order_master.campaign_playlist.campaignid || nil if order_master.campaign_playlist\n if campaign_playlist_id.present?\n puts \"Found campaign playlist #{campaign_playlist_id} and update this for order #{order_id} IN PPO\" #.colorize(:blue)\n else\n remove_from_sales_ppo order_id\n return puts \"No campaign playlist found in PPO\" #.colorize(:red)\n\n end\n campaign_name = CampaignPlaylist.find(campaign_playlist_id).name || \" \" if order_master.campaign_playlist_id.present?\n order_pieces = order_master.pieces || 0 if order_master.pieces.present?\n if order_master.promotion.present?\n if order_master.promotion.promo_cost.present?\n total_promotion_cost = order_master.promotion.promo_cost || 0 if order_master.promotion.promo_cost.present?\n per_order_promo_cost = (total_promotion_cost / order_pieces) if order_pieces.present?\n end\n end\n\n order_lines = OrderLine.where(orderid: order_id)\n time_of_order = order_master.orderdate.strftime('%Y-%b-%d %H:%M:%S')\n puts \"Found #{order_lines.count()} orders, now checking if they are in PPO!\" #.colorize(:blue)\n order_lines.each do |ordln|\n #add or update ppo details\n if SalesPpo.where(:order_line_id=> ordln.id).present?\n @sale_ppo = SalesPpo.where(:order_line_id=> ordln.id).first\n\n @sale_ppo.update(campaign_playlist_id: campaign_playlist_id,\n name: campaign_name,\n campaign_id: campaign_id,\n :product_master_id => ordln.product_master_id,\n product_variant_id: ordln.productvariant_id,\n product_list_id: ordln.product_list_id,\n prod: (ordln.product_list.extproductcode || nil if ordln.product_list.present?),\n :start_time => time_of_order,\n :order_id => ordln.orderid,\n :order_line_id=> ordln.id,\n :product_cost => ordln.productcost,\n :pieces => ordln.pieces,\n :revenue => ordln.productrevenue,\n :transfer_order_revenue => ordln.transfer_order_revenue,\n :transfer_order_dealer_price => ordln.transfer_order_dealer_price,\n :damages => ordln.productcost * 0.10,\n :returns => ordln.refund,\n :commission_cost => ordln.variable_media_commission,\n :commission_on_order => ordln.fixed_media_commission,\n :promotion_cost=> per_order_promo_cost,\n :gross_sales => ordln.gross_sales,\n :net_sale => ordln.net_sales,\n :external_order_no => order_master.external_order_no,\n :order_status_id => order_master.order_status_master_id,\n :order_pincode => order_master.pincode,\n :media_id => order_master.media_id,\n :promo_cost_total => total_promotion_cost,\n :dnis => order_master.calledno,\n :city => order_master.city,\n :state => order_master.customer_address.state,\n :mobile_no => order_master.mobile,\n :shipping_cost => ordln.product_postage)\n\n puts \"Updated existing Sales PPO with id #{@sale_ppo.id} created on #{@sale_ppo.created_at.strftime(\"%d-%b-%y %H:%M\")} for order id #{order_master.id}\" #.colorize(:light_yellow).colorize( :background => :black)\n end\n end\nend",
"title": ""
},
{
"docid": "1c5549bb44e61a030a746d2212409a85",
"score": "0.5069826",
"text": "def get_orders(date_from, date_to)\n raise 'To be implemented by descendants'\n end",
"title": ""
},
{
"docid": "b62e478cd5d62060c085ce21bad4ac33",
"score": "0.5068024",
"text": "def non_reactive_ever(ids)\n @orders = Order.find_by_sql(\"SELECT DISTINCT person_id FROM obs LEFT OUTER JOIN patient ON patient.patient_id = obs.person_id \\\n WHERE value_coded = \\\n (SELECT concept_id FROM concept_name WHERE name = 'NEGATIVE') and concept_id = \\\n (SELECT concept_id FROM concept_name WHERE name = 'HIV STATUS') AND \\\n DATEDIFF(NOW(), obs_datetime)/365 < 1 AND patient.voided = 0 AND \\\n DATE_FORMAT(patient.date_created, '%Y-%m-%d') <= '\" + @end_date + \"' AND patient.patient_id IN (#{ids})\").length rescue 0\n end",
"title": ""
},
{
"docid": "e73a6497e375a7c0a0e4f4b53eaf1e01",
"score": "0.5062645",
"text": "def mark_falses\n my_orders = Order.all\n total = 0\n charge_ids=[]\n # adds charge ids to array for processesing\n my_orders.each do |order|\n if order.line_items[0]['subscription_id'] == nil\n puts \"CHECK THIS ID: #{order.line_items}\"\n total += 1\n else\n order.has_sub_id = false\n order.save!\n charge_ids << order.charge_id if !charge_ids.include?(order.charge_id)\n end\n end\n puts \"total orders without subs: #{Order.all.count - total}/#{Order.all.count}\"\n puts charge_ids.count\n end",
"title": ""
},
{
"docid": "629f39c9782f597c850bfef9db2d987b",
"score": "0.5057121",
"text": "def create\n @subscription = Spree::Subscription.where(:id => params[:subscription_id], :user_id => spree_current_user.id).first\n order = current_order(create_order_if_necessary: true)\n variant = Spree::Variant.find(params[:variant_id])\n quantity = params[:quantity].to_i\n options = params[:options] || {}\n\n order.contents.add(variant, quantity, options)\n\n Rails.logger.debug(puts order.contents.inspect)\n\n if params[:product_id]\n add_subscription params[:product_id], params[:subscriptions][:interval_id]\n end\n\n if params[:variant_id]\n add_subscription params[:variant_id], params[:subscriptions][:interval_id]\n end\n\n params[:products].each do |product_id,variant_id|\n add_subscription variant_id, params[:subscriptions][:interval_id]\n end if params[:products]\n\n params[:variants].each do |variant_id, quantity|\n add_subscription variant_id, params[:subscriptions][:interval_id]\n end if params[:variants]\n\n # need to update the order so its total is accurate\n current_order.updater.update\n\n original_line_item = current_order.line_items.where(:variant_id => variant.id).first\n\n if original_line_item.try(:parts) && original_line_item.part_line_items.present?\n new_line_item = Spree::LineItem.new(original_line_item.attributes.merge({:id => nil, :updated_at => nil, :created_at => nil , :quantity => quantity, :subscription_id => @subscription.id}))\n else\n new_line_item_attributes = original_line_item.attributes.merge({ :id => nil, :updated_at => nil, :created_at => nil, :quantity => quantity, :subscription_id => @subscription.id})\n new_line_item_attributes[:variant_id] = variant.id if variant.id.present?\n new_line_item = Spree::LineItem.new(new_line_item_attributes)\n new_line_item\n end\n new_line_item.order = nil\n new_line_item.order_id = nil\n\n begin\n Spree::LineItem.skip_callback(:create, :after, :update_tax_charge)\n Spree::LineItem.skip_callback(:save, :after, :update_inventory)\n Spree::LineItem.skip_callback(:save, :after, :update_adjustments)\n new_line_item.save(validate: false)\n if original_line_item.try(:parts) && original_line_item.part_line_items.present?\n populate_part_line_items(new_line_item, new_line_item.variant.product.assemblies_parts, new_line_item.variant.product.assemblies_parts.first.id => variant.id)\n new_line_item.save(validate: false)\n end\n ensure\n Spree::LineItem.set_callback(:create, :after, :update_tax_charge)\n Spree::LineItem.set_callback(:save, :after, :update_inventory)\n Spree::LineItem.set_callback(:save, :after, :update_adjustments)\n end\n\n order.contents.remove(variant, quantity)\n redirect_to subscriptions_path\n end",
"title": ""
},
{
"docid": "94df741b695a2c0ccc4361ac4e7c5914",
"score": "0.50570065",
"text": "def sync days_ago=1\n\n #For performance, only update trips in the future\n options = {\n start: (Time.current - days_ago.day).iso8601[0...-6]\n }\n\n (arrayify(fetch_customer_orders(options).try(:with_indifferent_access).try(:[], :orders).try(:[], :order))).each do |order|\n occ_trip_from_ecolane_trip order\n end\n\n # For trips that are round trips, make sure that they point to each other.\n link_trips\n\n end",
"title": ""
},
{
"docid": "b0a415fe21268b7284508415966d245d",
"score": "0.50556314",
"text": "def index\n @orders = if current_user.admin?\n Order.where(reviewed: false)\n else\n Order.where(user_id: current_user.id, reviewed: false)\n end\n @history = if current_user.admin?\n Order.where(reviewed: true).sort_by {|u| [u.updated_at].max}\n else\n Order.where(user_id: current_user.id, reviewed: true).sort_by {|u| [u.updated_at].max}\n end\n authorize @orders, policy_class: OrderPolicy\n authorize @history, policy_class: OrderPolicy\n end",
"title": ""
}
] |
f9888f33d76534ff7ce5172869d7eb32
|
PUT /records/1 PUT /records/1.xml
|
[
{
"docid": "d93879837c3e2e0a9f0eda187d13c123",
"score": "0.0",
"text": "def update\n set_target_time\n respond_to do |format|\n if @me.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to records_path }\n format.js\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "c2c0b673628fdc28b181d18c0afd2d5b",
"score": "0.68003535",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"title": ""
},
{
"docid": "e631b376ae2ccb776680432bf94b01cc",
"score": "0.61626524",
"text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"title": ""
},
{
"docid": "ce8f372167bc139eb18b988da9b21ffd",
"score": "0.5995586",
"text": "def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end",
"title": ""
},
{
"docid": "7a098a6882fad73e5dd5479fe32ae2d2",
"score": "0.59484136",
"text": "def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "449cdda4653268c4848b78501cf3817e",
"score": "0.58851457",
"text": "def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"title": ""
},
{
"docid": "ae5fb82effc733bee8eb354853d40308",
"score": "0.57934904",
"text": "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.5740081",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "40912d8d306b994ab26a285469cb1815",
"score": "0.57323223",
"text": "def update\n @name_record = @domain.name_records.get!(params[:id])\n\n respond_to do |format|\n if @name_record.update(params[:name_record])\n flash[:notice] = t('name_records.update.notice')\n format.html { redirect_to(name_records_path) }\n format.xml { head :ok }\n else\n flash[:alert] = t('name_records.update.alert')\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @name_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b6d2caf16df8ec2bde906b6db5502c9",
"score": "0.5699264",
"text": "def update\n record = InvoiceLineItem.find(params[:id])\n print record.to_json\n record.update_attributes(params[:record]) \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "4c6059272baabee2212510e015eb7d8d",
"score": "0.5624156",
"text": "def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"title": ""
},
{
"docid": "420d1884b1aee72c02c89ecb90fc3d81",
"score": "0.56030655",
"text": "def update_field(key,field,value)\n request :put, \"#{path_prefix}records/#{ue key}?field=#{ue field}\",\n :body => value,\n :content_type => \"application/octet-stream\"\n end",
"title": ""
},
{
"docid": "eb485fe05a4e000b7cd4c5626e707aa2",
"score": "0.5593674",
"text": "def update_record(http, ref)\n json = %|{\n \"kind\": \"Article\",\n \"title\": \"Sample\",\n \"text\": \"Updated text.\"\n}|\n resp = http.send_request('POST', \"/v1/Article/#{ref}\", json, { 'Content-Type' => 'application/json' })\n # Response should be an OK with a JSON body.\n assert_equal(Net::HTTPOK, resp.class, 'response not an OK')\n reply = Oj.strict_load(resp.body, symbol_keys: true)\n\n # Make sure the message has the correct fields and values.\n assert_equal(0, reply[:code], 'update reply.code should be 0 meaning no error')\n updated = reply[:updated]\n assert_equal(1, updated.length, 'update reply.updated should contain exactly one member')\n ref = updated[0]\n refute_equal(nil, ref, 'update reply record reference can not be nil')\n refute_equal(0, ref, 'update reply record reference can not be 0')\n ref\n end",
"title": ""
},
{
"docid": "a70b38822316c4fd08954faf1d936290",
"score": "0.5566006",
"text": "def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"title": ""
},
{
"docid": "4a442d9a53fcc74c34cfbf9a5bcaf559",
"score": "0.55548763",
"text": "def update \t\n record = AssetType.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "c0821477305ada74676796bbc07e08aa",
"score": "0.55181307",
"text": "def handle_put_request\n @request.records.each do |record|\n file = DataFile.storing(@request.uuid, record.time)\n file << record\n file.close\n end\n\n send_data [@request.record_count].pack('L')\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.5517423",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.5456576",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "cac6508611bb14388fe2c4f437acdf09",
"score": "0.5451399",
"text": "def update\n @xml_sample = XmlSample.find(params[:id])\n \n respond_to do |format|\n format.html do\n @xml_sample = XmlSample.update_attributes(params[:xml_sample])\n if @xml_sample.save\n return redirect_to @xml_sample, notice: 'Xml sample was successfully updated.'\n else\n return render action: \"new\"\n end\n end\n format.xml do\n rexml = REXML::Document.new(params[\"xml\"])\n attr = Hash.from_xml(rexml.to_s)\n if @xml_sample.update_attributes(attr[\"xmlsample\"])\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n else\n xml = {msg: \"failed\", status: \"NG\"}.to_xml\n end\n return render xml: xml\n end\n end\n end",
"title": ""
},
{
"docid": "9a049830409b7730b3e115f4b04f2c7c",
"score": "0.5449469",
"text": "def update\n @record = Record.find(params[:id])\n\n respond_to do |format|\n if @record.update_attributes(params[:record])\n format.html { redirect_to @record, :notice => 'Record was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40699211101cb854dc146d565d75cf9f",
"score": "0.5422232",
"text": "def update_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n\n respond_to do |format|\n if @entry_instrument.update_attributes(params[:entry_instrument])\n flash[:notice] = 'EntryInstrument was successfully updated.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_instrument.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c2d5a47f28efab19a6adcc87242cafd",
"score": "0.54205316",
"text": "def update\n @record = Record.find(params[:id])\n\n respond_to do |format|\n if @record.update_attributes(params[:record])\n format.html { redirect_to @record, notice: 'Record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a9898f04da5bcdc9c01c8c367231ef6",
"score": "0.54083",
"text": "def update\n @record = Umbra::Record.find(params[:id])\n\n flash[:notice] = t(\"records.update_success\") if @record.update_attributes(record_params)\n respond_with(@record)\n end",
"title": ""
},
{
"docid": "ffd573d0f087682b9e1d6f53d6c79c80",
"score": "0.54040504",
"text": "def update\n record = TaxRule.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "bbda864ca1edffbb1c3a92c8f7bf7f3a",
"score": "0.53932303",
"text": "def update\n record = Asset.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "dc24c5696cc8328617981820ac4edb16",
"score": "0.5379547",
"text": "def update\n @file_record = FileRecord.find(params[:id])\n\n respond_to do |format|\n if @file_record.update_attributes(params[:file_record])\n format.html { redirect_to @file_record, notice: 'File record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @file_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe2a0e0ebaafeeb29a99a865a9a8cd81",
"score": "0.5379406",
"text": "def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "0f96cb66d38607fe28866c2b118cee74",
"score": "0.5368972",
"text": "def update\n @record = Record.find(params[:id])\n if @record.update(record_params)\n render json: {message: \"Record updated\"}, status: :ok\n else\n render json: {error: \"Unable to update the record\"}, status: :400\n end\n end",
"title": ""
},
{
"docid": "026c509ebca0be0197b085608df37f0e",
"score": "0.5368503",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to api_v1_records_url(access_token: params[:access_token]), notice: '更新しました' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd36d891c8fb17571358914c4c54edea",
"score": "0.5364537",
"text": "def update\n @input_record = InputRecord.find(params[:id])\n\n respond_to do |format|\n if @input_record.update_attributes(params[:input_record])\n format.html { redirect_to(@input_record, :notice => 'Input record was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @input_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f201145e53905399a8555ad503ddd784",
"score": "0.5351337",
"text": "def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end",
"title": ""
},
{
"docid": "b0915df4ff74e4c38f03ce17986a8140",
"score": "0.534789",
"text": "def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2484b90d4ead2bbb85e8d1bd475f0580",
"score": "0.53352845",
"text": "def update\n respond_to do |format|\n if @record.update_attributes(params[:record])\n format.html { redirect_to @record, notice: 'Record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "406d7a12782de6e27792fcf2817379fe",
"score": "0.53270745",
"text": "def batch_update\n @records = record_class.update(record_batch_params.keys, record_batch_params.values)\n\n respond_to do |format|\n if @records.all?(&:valid?)\n format.html { redirect_to url_for(action: 'index'), notice: \"#{record_class.model_name.plural.humanize} were successfully updated.\" }\n format.json { render :index, status: :ok }\n else\n format.html { render :batch_edit }\n format.json { render json: @records.map(&:errors), status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7340a129bd89925ddea22ed7ed9d8a23",
"score": "0.53218836",
"text": "def update\n respond_to do |format|\n @record.user_email = current_user.email\n if @record.update(record_params)\n add_to_solr(@record)\n #format.html {redirect_to @record, notice: 'Record was successfully updated.'}\n format.html {redirect_to :controller => 'catalog', action: \"show\", id: @record.id}\n format.json {render :show, status: :ok, location: @record}\n else\n format.html {render :edit}\n format.json {render json: @record.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "6ffcf5a2a5e875e0caaf3299b834b5c1",
"score": "0.5310946",
"text": "def update\n @record = Asset.find(params[:id])\n @record.update_attributes(params[:@record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "5fd8ab1dbfd6aa78b2ae4a3f19b653d2",
"score": "0.5304398",
"text": "def create\n @<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])\n\n respond_to do |format|\n if @<%= file_name %>.save\n flash[:notice] = '<%= class_name %> was successfully created.'\n format.html { redirect_to(@<%= file_name %>) }\n format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }\n end\n end\n end\n\n # PUT /<%= table_name %>/1\n # PUT /<%= table_name %>/1.xml\n def update\n @<%= file_name %> = <%= class_name %>.find(params[:id])\n\n respond_to do |format|\n if @<%= file_name %>.update_attributes(params[:<%= file_name %>])\n flash[:notice] = '<%= class_name %> was successfully updated.'\n format.html { redirect_to(@<%= file_name %>) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }\n end\n end\n end\n\n # DELETE /<%= table_name %>/1\n # DELETE /<%= table_name %>/1.xml\n def destroy\n @<%= file_name %> = <%= class_name %>.find(params[:id])\n @<%= file_name %>.destroy\n\n respond_to do |format|\n format.html { redirect_to(<%= table_name %>_url) }\n format.xml { head :ok }\n end\n end\n\n # PUT /<%= table_name %>/1/audit\n # PUT /<%= table_name %>/1.xml/audit\n def audit\n @<%= file_name %> = <%= class_name %>.find(params[:id])\n @formlog = Formlog.new(params[:formlog])\n @auditflows_form = flow_get_auditflows_form(@formlog) # 获得表单-审核流程对应,没有对应(自检)时获得新的对应(未存入数据库)\n if @auditflows_form.auditflows_flownode || flow_is_need_action_on_flow(@<%= file_name %>, params[:button_name])\n # 设定审核操作相关值\n @formlog, @auditflows_form, @<%= file_name %> = flow_set_rec_log_and_status(@formlog, @auditflows_form, @<%= file_name %>)\n else # 审核流程已经结束\n flash[:notice] = \"审核流程已结束,请勿重复操作!\"\n render :action => \"show\"\n return\n end\n\n respond_to do |format|\n begin\n <%= class_name %>.transaction do\n @formlog.save!\n @auditflows_form.save!\n @<%= file_name %>.save!\n flash[:notice] = '审核完成.'\n format.html { redirect_to(@<%= file_name %>) }\n format.xml { render :xml => @formlog, :status => :created, :location => @formlog }\n end\n rescue\n format.html { render :action => \"audit_self\" }\n format.xml { render :xml => @formlog.errors, :status => :unprocessable_entity }\n end\n end\n end\n\n # get /<%= table_name %>/1/audit_self\n def audit_self\n @<%= file_name %> = <%= class_name %>.find(params[:id])\n @button_name, @button_name_cn = params[:button_name], params[:button_name_cn]\n if not flow_is_need_action_on_flow(@<%= file_name %>, @button_name) # 是否为当前要操作的节点\n flash[:notice] = '操作流程不允许'\n render :action => \"show\"\n return\n end\n @formlog = flow_get_new_formlog(@<%= file_name %>)\n end\n\nend",
"title": ""
},
{
"docid": "7e420a59d43d234fa42d88749be02bb6",
"score": "0.52953637",
"text": "def record(record)\n @db.save_doc(record)\n end",
"title": ""
},
{
"docid": "d7486519211f5b79b55feae4e101b734",
"score": "0.5268987",
"text": "def update_document index, id, document\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/#{id}/_update\")\n req = Net::HTTP::Post.new(uri)\n req.body = { \"doc\": document }.to_json\n run(uri, req)\n end",
"title": ""
},
{
"docid": "09a4230b416a4e6294dd0c40b4bb419c",
"score": "0.52615505",
"text": "def update_all records\n array = []\n records.each do |id, r|\n params = {}\n r.each do |k, v|\n params[k] = {value: v}\n end\n array.push({\n id: id,\n record: params\n })\n end\n puts \"update #{array.count} records...\"\n while array.present?\n a100 = array.shift(100)\n @api.records.update(@app_id, a100)\n end\n {}\n end",
"title": ""
},
{
"docid": "af2b4f0cb890b7b7ed3cd8261d02d56a",
"score": "0.52501094",
"text": "def update\n @list_record = ListRecord.find(params[:id])\n\n respond_to do |format|\n if @list_record.update_attributes(params[:list_record])\n format.html { redirect_to(@list_record, :notice => 'List record was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e5c888ead70ae35f38138478a9c91a5",
"score": "0.52367246",
"text": "def update\n @record = Location.find(params[:id])\n @record.update_attributes(params[:location]) \n respond_to do |format|\n# format.html\n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.5236249",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "e271b77fd557e13f99fcefae0cc97ae6",
"score": "0.5231723",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to @record, notice: \"#{record_class.model_name.singular.humanize} was successfully updated.\" }\n format.json { render :show, status: :ok, location: @record }\n else\n format.html { render :edit }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "263be37b2f6b1323bfdf9ac5f4b4dbcb",
"score": "0.52238816",
"text": "def update\n respond_to do |format|\n if @document.update_attributes(params[:document])\n save_log({ :action => 'EDIT', :document => { :before => @old_document, :after => @document}})\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "583c66c312da549535e2caff0b8f9693",
"score": "0.5217689",
"text": "def create\n @<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])\n\n respond_to do |format|\n if @<%= file_name %>.save\n flash[:notice] = '<%= class_name %> was successfully created.'\n format.html { redirect_to(@<%= file_name %>) }\n format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }\n end\n end\n end\n\n # PUT /<%= table_name %>/1\n # PUT /<%= table_name %>/1.xml\n def update\n @<%= file_name %> = <%= class_name %>.find(params[:id])\n\n respond_to do |format|\n if @<%= file_name %>.update_attributes(params[:<%= file_name %>])\n flash[:notice] = '<%= class_name %> was successfully updated.'\n format.html { redirect_to(@<%= file_name %>) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c24d1e0c86556c88abf258fdbde3ef39",
"score": "0.5211946",
"text": "def update_metadata(params)\n @client.put(metadata_path, nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "0e0832db59a23c2e4243d9a5444a2157",
"score": "0.52045965",
"text": "def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ede4b6b2dc8e72d2da1ed0752590fa04",
"score": "0.52007675",
"text": "def update\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.save!\n\n respond_to do |format|\n if @config_xml.update_attributes(params[:config_xml])\n flash[:notice] = 'ConfigXml was successfully updated.'\n format.html { redirect_to(@config_xml) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @config_xml.errors, :status => :unprocessable_entity }\n end\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"title": ""
},
{
"docid": "c710df28dde231461d93471d1468fcaf",
"score": "0.5200364",
"text": "def update\n @reqinfo = Reqinfo.find(params[:id])\n\n respond_to do |format|\n if @reqinfo.update_attributes(params[:reqinfo])\n flash[:notice] = 'Reqinfo was successfully updated.'\n format.html { redirect_to(@reqinfo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reqinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fa3af0b0c0332f8519d16cf37d3e73c",
"score": "0.5182899",
"text": "def update(opts = {})\n raise \"No data arguments in request\" if opts[:data] == nil\n opts = filter_unsupported_options :ext_update, opts\n records = opts[:data]\n updated = []\n\n if(records.kind_of? Array)\n records.each do |r|\n begin\n @response.add_data(update_record r, opts)\n updated.push r[\"id\"]\n rescue\n @response.add_message \"Warning : Could not update record with id #{r[\"id\"]}. #{$!}\"\n raise\n end\n end\n else\n r = records \n begin\n @response.add_data(update_record r, opts)\n updated.push r[\"id\"]\n rescue\n @response.add_message \"Warning : Could not update record with id #{r[\"id\"]}. #{$!}\\r\\n\"\n end\n end\n\n if updated.length > 0\n @response.add_message \"Successfully updated #{updated.length} records with id : \" + updated.join(', ')\n success = true\n else\n @response.add_message \"No record updated.\"\n success = false\n end\n\n @response.success = success \n @response.to_hash\n end",
"title": ""
},
{
"docid": "e1bd694154ca30e0d591e31070cd4c99",
"score": "0.5179793",
"text": "def update\n @doc = Doc.find(params[:id])\n \n respond_to do |format|\n if @doc.update_attributes(params[:doc])\n save_object_relationship\n format.html { redirect_to(@doc, :notice => 'Doc was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f286eb04272fbb8b0284cd4bf670390d",
"score": "0.51751596",
"text": "def store(path, record)\n # Sanitize path\n path = \"#{Paths::VFS}/#{path}\" unless path.start_with?(Paths::VFS)\n path = sanitize_path(path)\n\n @api.post(path, :body => record)\n end",
"title": ""
},
{
"docid": "80b7e88ef291af030857b2f644cf4ffd",
"score": "0.5173103",
"text": "def putRecord(pub, oapID, toPut)\n\n # Figure out the URL to send it to\n uri = URI(\"#{$elementsAPI}/publication/records/c-inst-1/#{CGI.escape(oapID)}\")\n\n # Log what we're about to put.\n $transLog.write(\"\\n---------------------------------------------------------------\\n\")\n $transLog.write(\"\\nPUT #{uri}\\n\\n\")\n $transLog.write(toPut)\n $transLog.flush\n\n if $testMode\n puts \"(test mode: skipping real put)\"\n return true, true, nil\n end\n\n # And put it\n req = Net::HTTP::Put.new(uri)\n req['Content-Type'] = 'text/xml'\n req.basic_auth $apiCred[0], $apiCred[1]\n req.body = toPut\n (1..10).each { |tryNumber|\n puts \" Putting record.\"\n res = $elementsAPIConn.request(req)\n\n # Log the response\n $transLog.write(\"\\nResponse:\\n\")\n $transLog.write(\"#{res} code=#{res.code} message=#{res.message.inspect}\\n\")\n $transLog.write(\"#{res.body.start_with?('<?xml') ? Nokogiri::XML(res.body, &:noblanks).to_xml : res.body}\\n\")\n\n # HTTPConflict and HTTPGatewayTimeOut happen occasionally, and are likely transitory\n if res.is_a?(Net::HTTPConflict) || res.is_a?(Net::HTTPGatewayTimeOut)\n puts \" Note: failed due to #{res} (likely a transitory concurrency issue).\"\n if tryNumber < 20\n puts \" Will retry after a 30-second pause.\"\n sleep 30\n next\n else\n puts \" Out of retries. Aborting.\"\n end \n end\n\n # Fail if the PUT failed\n res.is_a?(Net::HTTPSuccess) or raise(\"Error: put failed: #{res}\")\n\n # Parse the result and record the associated Elements publication ID\n putResult = Nokogiri::XML(res.body, &:noblanks)\n putResult.remove_namespaces!\n pubID = putResult.at(\"entry/object[@category='publication']\")['id']\n db_execute(\"INSERT OR REPLACE INTO pubs (pub_id, oap_id) VALUES (?, ?)\", [pubID, oapID])\n\n # We want to know if Elements created a new record or joined to an existing one. We can tell\n # by checking if there are any other sources.\n obj = putResult.at(\"entry/object[@category='publication']\")\n otherRecords = obj.xpath(\"records/record[@format='native']\").select { |el| el['source-name'] != 'c-inst-1' }\n sources = otherRecords.map { |el| el['source-name'] }\n isJoinedRecord = !sources.empty?\n\n # Also we're curious if the joined record would meet our joining criteria. For that we need\n # to parse the metadata from the first record.\n isElemCompat = false\n elemItem = nil\n if isJoinedRecord\n # Pick scopus and crossref over other kinds of records, if available\n native = obj.at(\"records/record[@format='native'][source-name='scopus']\")\n native or native = obj.at(\"records/record[@format='native'][source-name='crossref']\")\n native or native = otherRecords[0]\n elemItem = elemNativeToRawItem(native.at('native'), $typeIdToName[obj.attr('type-id').to_i], 0)\n isElemCompat = isCompatible(pub.items, elemItem)\n end\n\n # And we're done.\n return isJoinedRecord, isElemCompat, elemItem\n }\n\nend",
"title": ""
},
{
"docid": "7d523857695200c79fd1e2bc47053d41",
"score": "0.51619774",
"text": "def update\n @new_employee_request = NewEmployeeRequest.find(params[:id])\n\n respond_to do |format|\n if @new_employee_request.update_attributes(params[:new_employee_request])\n format.html { redirect_to(@new_employee_request, :notice => 'New employee request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @new_employee_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d12114a52cbb39bc16cc72be9c043f",
"score": "0.51587266",
"text": "def put_document index, id, document\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/#{id}\")\n req = Net::HTTP::Put.new(uri)\n req.body = document.to_json\n run(uri, req)\n end",
"title": ""
},
{
"docid": "212e973c6071b681501f8d73c8b4559b",
"score": "0.5142963",
"text": "def puts_to(path,params,opts={},&block) #:nodoc: \n crud_to(:put,path,params,opts,&block)\n end",
"title": ""
},
{
"docid": "98ffa158acbf02cbf2dc20af8c117e34",
"score": "0.5142939",
"text": "def update\n put :update\n end",
"title": ""
},
{
"docid": "ad94b12a2b42f00883261c4b71a9763a",
"score": "0.5141306",
"text": "def put( doc, opts = {} )\n response = http_action :put, doc, opts.merge( :doc => doc )\n doc['_id'], doc['_rev'] = response['id'], response['rev'] if doc.kind_of? Hash\n response\n end",
"title": ""
},
{
"docid": "4bb141c2d7004230aac92bb0e166c567",
"score": "0.5136844",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to records_url, notice: '更新しました' }\n format.json { render :show, status: :ok, location: @record }\n else\n format.html { render :edit }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb9a3b119ff41daf1aafc62d732c5795",
"score": "0.51296616",
"text": "def update\n @doc = Doc.find(params[:id])\n\n respond_to do |format|\n if @doc.update_attributes(params[:doc])\n format.html { redirect_to(@doc, :notice => 'Doc was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8298ca0e5d4c1741528da1381799dafc",
"score": "0.51292336",
"text": "def update(record)\n result = self.class.put(worksheet_url + \"/\" + record.id,\n :body => { \"fields\" => record.fields_for_update }.to_json,\n :headers => { \"Content-type\" => \"application/json\" }).parsed_response\n if result.present? && result[\"id\"].present?\n record.override_attributes!(result_attributes(result))\n record\n else # failed\n false\n end\n end",
"title": ""
},
{
"docid": "101fdcef3a0ca8da26c1ae88d6ecf7e7",
"score": "0.5127592",
"text": "def update_records(range = nil)\n find(:all).each do |record|\n record.update_record\n end\n end",
"title": ""
},
{
"docid": "2a2db5cf1cb8e3b72e76dce278ec5444",
"score": "0.5125154",
"text": "def reindex(*entries)\n list = Upload.get_relation(*entries).to_a\n result = ingest_api.put_records(*list)\n result.exec_report.error_messages.each { |e| $stderr.puts e }.blank?\n end",
"title": ""
},
{
"docid": "02f76927c2192e21d4128ffb2698a6ba",
"score": "0.51239306",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to @record, notice: 'Record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47bc4b03cec9f96c94a8a59f53bcc543",
"score": "0.5116192",
"text": "def update\n @record = find_record\n\n respond_to do |format|\n if @record.update_attributes(params[:record])\n format.html { redirect_to [@record.patient, @record],\n notice: 'Record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'show' }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64c7de436cc2d0aff0b2fbf45c280b93",
"score": "0.5111401",
"text": "def update\n @recording = Recording.find(params[:id])\n\n respond_to do |format|\n if @recording.update_attributes(params[:recording])\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "900de5cf8a27ca909693eb70fe36c801",
"score": "0.5108849",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to @record, notice: 'Record was successfully updated.' }\n format.json { render :show, status: :ok, location: @record }\n else\n format.html { render :edit }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "900de5cf8a27ca909693eb70fe36c801",
"score": "0.5108849",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to @record, notice: 'Record was successfully updated.' }\n format.json { render :show, status: :ok, location: @record }\n else\n format.html { render :edit }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "900de5cf8a27ca909693eb70fe36c801",
"score": "0.5108849",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to @record, notice: 'Record was successfully updated.' }\n format.json { render :show, status: :ok, location: @record }\n else\n format.html { render :edit }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "900de5cf8a27ca909693eb70fe36c801",
"score": "0.5108849",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n format.html { redirect_to @record, notice: 'Record was successfully updated.' }\n format.json { render :show, status: :ok, location: @record }\n else\n format.html { render :edit }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "822ee5edee10e54d77d441560168408c",
"score": "0.51077616",
"text": "def update\n respond_to do |format|\n if @dataset.update_attributes(params[:dataset])\n format.html { redirect_to(@dataset, :notice => 'Dataset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @dataset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a14a2e54ea4151a2afdf3915e5abf751",
"score": "0.5105735",
"text": "def update\n document = Document.find(params[:id])\n document.update!(update_params)\n render json: {}\n end",
"title": ""
},
{
"docid": "8bd429e91f9feec07cf789def9075614",
"score": "0.51015526",
"text": "def update\n respond_to do |format|\n if @file_record.update(file_record_params)\n format.html { redirect_to @file_record, notice: \"File record was successfully updated.\" }\n format.json { render :show, status: :ok, location: @file_record }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @file_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d447580a3d2a16354cf20c9e254cea8f",
"score": "0.50971967",
"text": "def update\n @document = Document.find(:first, :conditions => [\"id = ?\", params[:id]])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "55d8f5ce0c1bbde6bed12d451667dab8",
"score": "0.5090995",
"text": "def update\n respond_to do |format|\n if @record.update(record_params)\n\n # save any new record attachments the user wants to associate with this record\n RecordAttachment.where(cas_user_name: session[:cas_user]).where(\"record_id IS?\", nil).update_all(:record_id => @record.id)\n\n flash[:success] = \"<strong>Confirmation</strong>\".html_safe + \n \": Record successfully updated.\"\n format.html { redirect_to @record }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @record.errors, \n status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43a01044d3530f9fe050483527018038",
"score": "0.5087033",
"text": "def update\n respond_to do |format|\n if @file_record.update(file_record_params)\n format.html { redirect_to @file_record, notice: 'File record was successfully updated.' }\n format.json { render :show, status: :ok, location: @file_record }\n else\n format.html { render :edit }\n format.json { render json: @file_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12bbad04a8c6e10ba240594ed4352fd7",
"score": "0.50860345",
"text": "def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end",
"title": ""
},
{
"docid": "2ba2d6d766eaec2ef666f84eeb142c60",
"score": "0.50836647",
"text": "def update\n connection.put(element_path, to_xml)\n end",
"title": ""
},
{
"docid": "5c77920270e0d1ee1abf8aaa030d9f33",
"score": "0.5075212",
"text": "def update\n Neo4j::Transaction.run do\n @q_resource = QResource.find(params[:id])\n @q_resource.update_attributes!(params[:q_resource])\n respond_to do |format|\n if @q_resource.update_attributes(params[:q_resource])\n format.html { redirect_to @q_resource, :notice => 'Q resource was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @q_resource.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0b83121fe2bfbe8cd2f5018131db981c",
"score": "0.5074399",
"text": "def update\n save_doc\n end",
"title": ""
},
{
"docid": "3fd158351f2fe9454af849e460d3fb7a",
"score": "0.50665426",
"text": "def update\n @monitor_record = MonitorRecord.find(params[:id])\n\n respond_to do |format|\n if @monitor_record.update_attributes(params[:monitor_record])\n flash[:notice] = 'MonitorRecord was successfully updated.'\n format.html { redirect_to(@monitor_record) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @monitor_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4840dd2894546f708a87e11b0b2786c1",
"score": "0.50653696",
"text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to(@document, :notice => 'Document was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6048733fc2dbcef769f727561305ecd",
"score": "0.5061853",
"text": "def save\n @client.patch(@endpoint, :content=>@changed)\n return nil\n end",
"title": ""
},
{
"docid": "aebcae9391ba412d54762c0b83f983c1",
"score": "0.506178",
"text": "def update_recording(record_id, meta)\n meta[:recordID] = record_id\n bbb_server.send_api_request(\"updateRecordings\", meta)\n end",
"title": ""
},
{
"docid": "5c3e04a513c62c0db4565a22dcd40df3",
"score": "0.50614715",
"text": "def save!\n @record = fetch_xml\n save_debates\n end",
"title": ""
},
{
"docid": "60ce7da661a269f6b3645037f7e576bf",
"score": "0.5058733",
"text": "def test_update\n\n doc_one = document_types(:doc_one)\n document_type = DocumentType.find(doc_one.id)\n document_type.name = 'Test'\n\n get(:update, { :document_type => document_type.attributes }, cathy_admin_session)\n assert_equal('Update recorded', flash['notice'])\n assert_equal('Test', document_type.name)\n assert_redirected_to(:action => 'edit', :id => document_type.id)\n \n end",
"title": ""
},
{
"docid": "a9b7e4604d06dcf5376b08cfef408b40",
"score": "0.5056193",
"text": "def update\n @docent = Docent.find(params[:id])\n\n respond_to do |format|\n if @docent.update_attributes(params[:docent])\n format.html { redirect_to(@docent, :notice => 'Docent was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @docent.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9de1e40d7eaa4f2d3f26e9cbe7c35aeb",
"score": "0.5056107",
"text": "def update\n enforce_permissions!('update', params[:id])\n\n param = params[:xml].presence || params[:metadata_file].presence\n\n if param\n xml_ds = XmlDatastream.new\n xml_ds.load_xml(param)\n else\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n redirect_to controller: 'catalog', action: 'show', id: params[:id]\n return\n end\n\n @object = retrieve_object!(params[:id])\n @errors = nil\n\n unless can? :update, @object\n raise Hydra::AccessDenied.new(t('dri.flash.alert.edit_permission'), :edit, '')\n end\n\n @object.update_metadata xml_ds.xml\n if @object.valid?\n checksum_metadata(@object)\n warn_if_has_duplicates(@object)\n\n begin\n raise DRI::Exceptions::InternalError unless @object.attached_files[:descMetadata].save\n rescue RuntimeError => e\n logger.error \"Could not save descMetadata for object #{@object.id}: #{e.message}\"\n raise DRI::Exceptions::InternalError\n end\n\n begin\n raise DRI::Exceptions::InternalError unless @object.save\n\n version_and_record_committer(@object, current_user)\n flash[:notice] = t('dri.flash.notice.metadata_updated')\n rescue RuntimeError => e\n logger.error \"Could not save object #{@object.id}: #{e.message}\"\n raise DRI::Exceptions::InternalError\n end\n else\n flash[:alert] = t('dri.flash.alert.invalid_object', error: @object.errors.full_messages.inspect)\n @errors = @object.errors.full_messages.inspect\n end\n\n @object.object_version ||= '1'\n @object.increment_version\n\n begin\n raise DRI::Exceptions::InternalError unless @object.save\n\n # Do the preservation actions\n preservation = Preservation::Preservator.new(@object)\n preservation.preserve(false, false, ['descMetadata','properties'])\n\n version_and_record_committer(@object, current_user)\n flash[:notice] = t('dri.flash.notice.metadata_updated')\n rescue RuntimeError => e\n logger.error \"Could not save object #{@object.id}: #{e.message}\"\n raise DRI::Exceptions::InternalError\n end\n\n respond_to do |format|\n format.html { redirect_to controller: 'my_collections', action: 'show', id: params[:id] }\n format.json { render json: @object }\n format.text do\n response = if @errors\n t('dri.flash.alert.invalid_object', error: @errors)\n else\n t('dri.flash.notice.metadata_updated')\n end\n\n render text: response\n end\n end\n end",
"title": ""
},
{
"docid": "1a9f82185ff71da59e4a99317e576308",
"score": "0.5055341",
"text": "def update\n @status_record = StatusRecord.find(params[:id])\n\n respond_to do |format|\n if @status_record.update_attributes(params[:status_record])\n format.html { redirect_to @status_record, notice: 'Status record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90a0293ab95a6f2962308b88d2452a7f",
"score": "0.50540084",
"text": "def update\n @serialize = Serialize.find(params[:id])\n\n respond_to do |format|\n if @serialize.update_attributes(params[:serialize])\n flash[:notice] = 'Serialize was successfully updated.'\n format.html { redirect_to(serializes_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @serialize.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "747fdc61174cd877ba0456f338ac6884",
"score": "0.5052333",
"text": "def update\n fn = params[:id].gsub('DOTDOT','.').gsub('SLASHSLASH','/')\n File.open(fn,'w+') { |f| \n f.puts params[:content]\n }\n respond_to do |format|\n format.json { render json: { success: true} }\n end\n end",
"title": ""
},
{
"docid": "2ec925b55a53eaf58b8db860a8eab3e6",
"score": "0.50507534",
"text": "def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "98f1a7d2b91a9965379af41a901552f0",
"score": "0.50492793",
"text": "def add_to_index(records, **opt)\n fields = records.map(&:emma_metadata)\n $stderr.puts \"=== STEP #{__method__} | #{Emma::ThreadMethods.thread_name} | #{records.size} recs = #{records.map { |r| manifest_item_id(r) }} | #{fields.size} fields = #{fields.inspect.truncate(1024)}\" # TODO: testing - remove\n result = ingest_api.put_records(*fields)\n remaining, failure = process_ingest_errors(result, *records)\n\n opt[:success] = 'indexed' # TODO: I18n\n opt[:meth] = __method__\n opt[:initial] = { failure: failure }\n\n now = DateTime.now\n run_step(remaining, **opt) do |_id, rec|\n rec.update_columns(last_indexed: now)\n end\n end",
"title": ""
},
{
"docid": "cb39068d3b2145433506451eaaf5c620",
"score": "0.50404984",
"text": "def save\n r = self.class.put(\"/domains/#{@@parent_id}/records/#{self.id}\", :query => { \"record[name]\" => self.name,\n \"record[ttl]\" => self.ttl,\n \"record[content]\" => self.content,\n \"record[prio]\" => self.prio,\n \"record[type]\" => self.type })\n r[\"errors\"] and raise StandardError, r[\"errors\"][\"error\"].to_a.join(\", \")\n if r.code == 200\n self.class.find(self.id)\n else\n raise StandardError, 'Could not update the record'\n end\n end",
"title": ""
},
{
"docid": "0fe5947d2bd91f5322b66e7b1064a61e",
"score": "0.5033151",
"text": "def put(path = '/files/', params = {})\n request :put, path, params\n end",
"title": ""
},
{
"docid": "9d0bc3a176634b250a3abf2151c8ded6",
"score": "0.5029468",
"text": "def update\n @dataset = Dataset.find(params[:id])\n\n respond_to do |format|\n if @dataset.update_attributes(params[:dataset])\n format.html { redirect_to(@dataset, :notice => 'Dataset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @dataset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21c1ee1de0e343512014e708a46bef14",
"score": "0.50278705",
"text": "def updateX\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to(@server, :notice => 'Server was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33a3d20c18dfb2f7eef45f1d14b77717",
"score": "0.50234336",
"text": "def update\n @fax_document = FaxDocument.find(params[:id])\n \n respond_to do |format|\n if @fax_document.update_attributes(params[:fax_document])\n format.html { redirect_to(@fax_document, :notice => t(:fax_document_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fax_document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54f95a361000b6219275e377b8bf4555",
"score": "0.5020791",
"text": "def update options={}\n client.put(\"/#{id}\", options)\n end",
"title": ""
},
{
"docid": "f5abc97dc01e98587b311491997ca472",
"score": "0.5018945",
"text": "def update\n respond_to do |wants|\n if @document.update_attributes(params[:document])\n flash[:notice] = 'Document was successfully updated.'\n wants.html { redirect_to(@document) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0116e532480bccbccdf20b1f2e4cde7",
"score": "0.50188357",
"text": "def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
7f6feb5672d1e3dc792613c1e8d5fed8
|
Makes sure the supplied value is a valid RFC2616 date. If we would just use strtotime to get a valid timestamp, we have no way of checking if a user just supplied the word 'now' for the date header. This function also makes sure the Date header is within 15 minutes of the operating system date, to prevent replay attacks.
|
[
{
"docid": "3910c20a242f59b5472c3d215dc0516d",
"score": "0.8306628",
"text": "def validate_rfc2616_date(date_header)\n date = Tilia::Http::Util.parse_http_date(date_header)\n\n # Unknown format\n unless date\n @error_code = ERR_INVALIDDATEFORMAT\n return false\n end\n\n min = Time.zone.now - 15.minutes\n max = Time.zone.now + 15.minutes\n\n # We allow 15 minutes around the current date/time\n if date > max || date < min\n @error_code = ERR_REQUESTTIMESKEWED\n return false\n end\n\n date\n end",
"title": ""
}
] |
[
{
"docid": "6b3334e8ec4753f0103b132b9b684efa",
"score": "0.62432635",
"text": "def is_correct_date param_date\n parts = param_date.split(\"-\")\n time = Time.utc(parts[0], parts[1], parts[2])\n if time.midnight < Time.now.midnight + 1.day\n return true\n end\n rescue\n NIL\n end",
"title": ""
},
{
"docid": "f4c383bbb9ffe670077f18b3f787b49d",
"score": "0.6174523",
"text": "def check_timestamp\n @oauth_date = Time.at(params[:oauth_timestamp].to_i).to_datetime unless params[:oauth_timestamp].blank?\n \n if @oauth_date && @oauth_date > (Time.now - 90.minutes).to_datetime\n @valid = true\n else\n @valid = false\n end\n end",
"title": ""
},
{
"docid": "b9e6c1713bd26e7e7606a31298e6ea8d",
"score": "0.6007103",
"text": "def validate_value_date_time(value)\n begin\n DateTime.rfc3339(value)\n rescue ArgumentError\n raise SwaggerInvalidException.new(\"Value [#{name}] should be a date time but is [#{value}]\")\n end\n end",
"title": ""
},
{
"docid": "9c26bef81069245a44443a5bdeb83fac",
"score": "0.593606",
"text": "def validate_param_value_date_time(value)\n begin\n DateTime.rfc3339(value)\n rescue ArgumentError\n raise SwaggerInvalidException.new(\"Parameter [#{name}] should be a date time but is [#{value}]\")\n end\n end",
"title": ""
},
{
"docid": "b56bccf4cedaba75c390d735ef540d0d",
"score": "0.5931924",
"text": "def validate_datetime(value)\n DateTime.rfc3339(value)\n rescue ArgumentError => e\n raise ValidationError, e.message\n end",
"title": ""
},
{
"docid": "099b2910107f8417ee897939e2ed162e",
"score": "0.5924927",
"text": "def date?(value)\n return false unless value.is_a?(String)\n value =~ /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z/\n end",
"title": ""
},
{
"docid": "a88db180c8544c493d1aa07e597c848e",
"score": "0.58969265",
"text": "def validate_date\n date = \"#{match_params[\"match_time(3i)\"]}-#{match_params[\"match_time(2i)\"]}-#{match_params[\"match_time(1i)\"]}\"\n time = \"#{match_params[\"match_time(4i)\"]}:#{match_params[\"match_time(5i)\"]}\"\n begin\n DateTime.parse(\"#{date} #{time}\")\n return true\n rescue => e\n @match.errors.add(:match_time, :invalid_date_time)\n return false\n end\n end",
"title": ""
},
{
"docid": "be8ae7080c72bdf92568442ad52b73ea",
"score": "0.58843184",
"text": "def test_rfc1123_date_time()\n # Parameters for the API call\n datetime = DateTimeHelper.from_rfc1123('Sun, 06 Nov 1994 08:49:37 GMT')\n\n # Perform the API call through the SDK function\n result = @controller.rfc1123_date_time(datetime)\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": "eea8406d386793b02d116c1d78c9b789",
"score": "0.5841972",
"text": "def test_rfc3339_date_time()\n # Parameters for the API call\n datetime = DateTimeHelper.from_rfc3339('1994-02-13T14:01:54.9571247Z')\n\n # Perform the API call through the SDK function\n result = @controller.rfc3339_date_time(datetime)\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": "fd31ef12001b3bc7df66a8bd5e89255c",
"score": "0.58304304",
"text": "def verify_date_time_field_format(field:, thrift_object: request, path_prefix: 'request')\n Time.parse(thrift_object.public_send(field))\n rescue ArgumentError\n raise ThriftDefs::ExceptionTypes::ArgumentException,\n message: \"#{field} was not a valid Date or DateTime\",\n path: \"#{path_prefix}.#{field}\",\n code: ThriftDefs::ExceptionTypes::ArgumentExceptionCode::INVALID\n end",
"title": ""
},
{
"docid": "4f62f103a774ab647f6a4a12c73ee483",
"score": "0.58286047",
"text": "def ensure_date(dat)\n case dat\n when String\n ::Date.parse(dat)\n when Date, DateTime\n dat\n when Time\n dat.to_date\n else\n raise ArgumentError, 'requires String, Date, DateTime, or Time'\n end\n end",
"title": ""
},
{
"docid": "8e690fbd7aef8c344b0e7f41e8bfd0dd",
"score": "0.5776718",
"text": "def parse_date(date_string)\n time = Time.rfc2822(date_string)\n rescue => e\n raise InvalidDate\n end",
"title": ""
},
{
"docid": "c5b67adc49c85860e97d5f081301b65e",
"score": "0.5763405",
"text": "def check_reservation_date_time(stamp)\n method = \"checkReservationDateTime&stamp=\" + stamp.to_s\n post_request(method)\n end",
"title": ""
},
{
"docid": "c5b67adc49c85860e97d5f081301b65e",
"score": "0.5763405",
"text": "def check_reservation_date_time(stamp)\n method = \"checkReservationDateTime&stamp=\" + stamp.to_s\n post_request(method)\n end",
"title": ""
},
{
"docid": "075e2e188638d6af1ef94207a8bc9d5c",
"score": "0.57511514",
"text": "def warn_invalid_date; end",
"title": ""
},
{
"docid": "4f62ff02a681acdc3353159d45f29d24",
"score": "0.57295114",
"text": "def validate_date(date)\n begin\n date = Date.parse(date)\n raise if date > Date.today\n rescue\n raise ApplicationController::InvalidDateError.new('invalid date')\n end\n date\n end",
"title": ""
},
{
"docid": "2c88c1b1b651c9bf0c3c7f83771c8ab8",
"score": "0.56793445",
"text": "def in_time_window?\n @@time_window = 4 if @@time_window < 4\n minutes = (@@time_window / 2).floor\n ts = Chronic.parse @http_headers[@@header_timestamp]\n before = Time.now.utc - 60*minutes\n after = Time.now.utc + 60*minutes\n if ts.nil?\n @errors << \"timestamp was in an invalid format; should be YYYY-MM-DD HH:MM:SS UTC\"\n return false\n end\n ts > before && ts < after\n end",
"title": ""
},
{
"docid": "300d0664904cd817b5504f091fcd0871",
"score": "0.56522703",
"text": "def check_date_input(date)\n Eventkalender::Parser.date(date)\n end",
"title": ""
},
{
"docid": "c7b36dd135f7a1f1d980296557ccfb21",
"score": "0.5640812",
"text": "def safe_date(value:)\n return nil unless value.is_a?(String)\n\n Time.parse(value).utc\n rescue ArgumentError\n value.to_s\n end",
"title": ""
},
{
"docid": "c7b36dd135f7a1f1d980296557ccfb21",
"score": "0.5640812",
"text": "def safe_date(value:)\n return nil unless value.is_a?(String)\n\n Time.parse(value).utc\n rescue ArgumentError\n value.to_s\n end",
"title": ""
},
{
"docid": "ff3fa1f538fe7516a30bf41895d032fa",
"score": "0.56078327",
"text": "def valid(context,input)\n # check for empty\n if input.nil? or input.empty?\n if @allow_nil\n return nil\n end\n user = \"#{context}: Input date required\"\n log = \"Input date required: context=#{context}, input=#{input}\"\n raise Owasp::Esapi::ValidationException.new(user,log,context)\n end\n # clean the input\n clean = @encoder.canonicalize(input)\n begin\n return DateTime.strptime(clean,@format).to_time\n rescue ArgumentError => failed\n user=\"#{context}: Input date required\"\n log=\"Input date required: context=#{context}, input=#{input}\"\n raise Owasp::Esapi::ValidationException.new(user,log,context)\n end\n end",
"title": ""
},
{
"docid": "80da0b11802d58fd9bfaffd6d4baa4a8",
"score": "0.56067985",
"text": "def get_author_date(str_date)\r\n /([0-9]{4})-([0-9]{2})-([0-9]{2})/ =~ str_date\r\n date = Time.new($1, $2, $3, 9, 0, 0, '+02:00') # Create time out of date string, 9 'o clock Amsterdam time\r\n\r\n if date < Time.at(0)\r\n # puts 'WARNING: Date was before epoch (1-1-1970)'\r\n Time.at(0).iso8601(0)\r\n else\r\n date.iso8601(0)\r\n end\r\n end",
"title": ""
},
{
"docid": "8c28e2f7aeca920c0f1e0cd479bbeca1",
"score": "0.5590235",
"text": "def valid_date?(object)\n unless !object || object.to_s.empty? || epoch.nil?\n Time.parse(object.to_s).utc.between?(epoch.utc, (Date.today + 1).to_time.utc - 0.000001)\n else false\n end\n end",
"title": ""
},
{
"docid": "da0ae3c5a500e6239f29f56e5aa83141",
"score": "0.55868757",
"text": "def valid_date_format?(test_date)\r\n date_arr = test_date.split(\"-\")\r\n #check for non numeric values\r\n date_arr.each do |d|\r\n if d =~ /\\D/\r\n return false\r\n end\r\n end\r\n \r\n #confirm that each date parameter has been sent\r\n if date_arr.length != 3\r\n return false\r\n else\r\n date_arr.map! {|d| d.to_i }\r\n end\r\n \r\n year, month, day = date_arr\r\n \r\n #Test that numeric values are valid. The Time class\r\n #will be able to validate the values.\r\n begin\r\n check_date = Time.local(year,month,day)\r\n rescue\r\n return false\r\n else\r\n return true\r\n end\r\n \r\nend",
"title": ""
},
{
"docid": "bee478460386f5570aff847e23ddcfc9",
"score": "0.5578598",
"text": "def seems_a_date?(value)\n Date.strptime(value.to_s, date_format)\n rescue ArgumentError => ex\n nil\n end",
"title": ""
},
{
"docid": "768dd43bb3b0f6107b838140776a1386",
"score": "0.55748975",
"text": "def assert_valid_date( opentox_object, max_time=600 )\n \n raise \"no opentox object\" unless opentox_object.class.to_s.split(\"::\").first==\"OpenTox\"\n assert opentox_object.metadata.is_a?(Hash)\n assert opentox_object.metadata[DC.date].to_s.length>0,\"date not set for \"+opentox_object.uri.to_s+\", is metadata loaded? (use find)\"\n time = Time.parse(opentox_object.metadata[DC.date])\n assert time!=nil\n=begin \n assert time<Time.new,\"date of \"+opentox_object.uri.to_s+\" is in the future: \"+time.to_s\n assert time>Time.new-(10*60),opentox_object.uri.to_s+\" took longer than 10 minutes \"+time.to_s\n=end\n end",
"title": ""
},
{
"docid": "d109e1882b246c9028e9814e4052f52e",
"score": "0.5557237",
"text": "def validate_date_format(date)\n chk_date=\"\"\n if (date =~ /\\d{4}-\\d{2}-\\d{2}T\\d{2}\\:\\d{2}\\:\\d{2}Z/)\n chk_date = date\n elsif (date =~ /\\d{4}-\\d{2}-\\d{2}/)\n d = date.scan(/\\d{4}-\\d{2}-\\d{2}/)\n chk_date = \"#{d}T00:00:00Z\"\n end\n\n return chk_date\n\nend",
"title": ""
},
{
"docid": "e3c43f158eb77747399094d0d483e9b2",
"score": "0.5554481",
"text": "def date\n @date ||=\n if date = headers['Date']\n Time.httpdate(date)\n else\n headers['Date'] = now.httpdate unless headers.frozen?\n now\n end\n end",
"title": ""
},
{
"docid": "ddf74c0c5c8e92b29b39f78933da812a",
"score": "0.5551438",
"text": "def ensure_datetime(date)\n return date if date.is_a? DateTime\n\n # rubocop:disable Style/GuardClause, Style/DateTime\n if date.is_a? String\n month, day, year = date.split(%r{[/-]}).map(&:to_i)\n DateTime.new(year, month, day)\n end\n # rubocop:enable Style/GuardClause, Style/DateTime\n end",
"title": ""
},
{
"docid": "5594e9d07065521308dce39e11f6018d",
"score": "0.55234396",
"text": "def valid_date?(date_str)\n date = Date.strptime(date_str, '%Y-%m-%d')\n date >= Date.today\n rescue StandardError => e\n false\n end",
"title": ""
},
{
"docid": "70c1071dd5263aa5250fc7906d0833b5",
"score": "0.55111",
"text": "def check_date date, seconds\n (Time.now.to_i - date) <= seconds\n end",
"title": ""
},
{
"docid": "2697cb0f7b83634fe570df14c64ee8a8",
"score": "0.55091226",
"text": "def sanitize_date(date)\n time = date.to_time\n\n ::Time.new(time.year, time.month, time.day, time.hour, time.min, time.sec, time.utc_offset)\n end",
"title": ""
},
{
"docid": "7f4b10297247a1629595df3f1062524d",
"score": "0.55017376",
"text": "def Date(placeholder = nil)\n return Time.parse(@vars[:Date]) rescue (placeholder)? @@BAD_TIME : \"\"\nend",
"title": ""
},
{
"docid": "36c950c48aee52d50e80dba072dd4760",
"score": "0.5500356",
"text": "def sanitize_date(date)\n time = date.to_time\n\n ::Time.new(time.year, time.month, time.day, time.hour, time.min, time.sec, time.utc_offset)\n end",
"title": ""
},
{
"docid": "56501a2c08c3c93707e219a2f31a7db9",
"score": "0.5482743",
"text": "def strptime(str, format, now = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "56501a2c08c3c93707e219a2f31a7db9",
"score": "0.5482743",
"text": "def strptime(str, format, now = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "56501a2c08c3c93707e219a2f31a7db9",
"score": "0.5482743",
"text": "def strptime(str, format, now = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "8b0897636160ed46eb57969a37ead63e",
"score": "0.5477372",
"text": "def valid_date?(date)\n if date =~ /^\\d{4}-\\d{2}-\\d{2}$/\n begin\n Date.parse(date)\n true\n rescue ArgumentError => e\n false\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "d1f79ee6811caed8147af74b8ada01fe",
"score": "0.54668444",
"text": "def registration_date_is_valid?\n \treturn true if self.registration_deadline.nil? || self.registration_deadline.empty?\n begin\n USDateParse(self.registration_deadline)\n rescue\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "21b10e8d19389d77fd2e3cf23259e8cd",
"score": "0.5457809",
"text": "def real_date?(date)\n Date.valid_date? *date.split('-').map(&:to_i)\n end",
"title": ""
},
{
"docid": "b6b83b8868e4f8bbfa8b2caef073116f",
"score": "0.5452035",
"text": "def out_of_date?(stamp); end",
"title": ""
},
{
"docid": "5fa9644fb0f64135cc1f2ac0b24ec752",
"score": "0.54506683",
"text": "def safe_date(maybedate)\n begin\n parsed_date = Date.parse(maybedate)\n rescue ArgumentError\n return nil\n end\n parsed_date\nend",
"title": ""
},
{
"docid": "9d37fc1a8f45389d03aa7450322ebb1c",
"score": "0.54483813",
"text": "def validate_date!\n \n end",
"title": ""
},
{
"docid": "e4d680f8125677aec8366e2340886a47",
"score": "0.54374135",
"text": "def valid_datetime_string?(datetime_string)\n regexp = /^(19|20)\\d\\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ((([01]\\d|2[0-3]):)([0-5]\\d):)([0-5]\\d)$/\n valid_date = true\n\n if regexp.match(datetime_string)\n begin\n Time.parse(datetime_string)\n rescue ArgumentError\n valid_date = false\n end\n else\n valid_date = false\n end\n return valid_date\n end",
"title": ""
},
{
"docid": "eb6afb526d610b9dc836695e16f59973",
"score": "0.54295725",
"text": "def validate_date(date_input)\n begin\n Date.parse(date_input)\n rescue ArgumentError\n return false\n end\nend",
"title": ""
},
{
"docid": "25bc3da5e938ca99079956b34fab7255",
"score": "0.54251146",
"text": "def valid_date(s)\n s.match(/\\d\\d?\\/\\d\\d?\\/\\d{4}/)\n end",
"title": ""
},
{
"docid": "5ffec9f6654b5231de069883bfbac08b",
"score": "0.54205525",
"text": "def before_deadline\n return Date.today < Date.strptime(User::APPLICATION_DEADLINE, \"%m/%d/%Y\")\n end",
"title": ""
},
{
"docid": "2898b93831315042478f8ca3f3a78cf5",
"score": "0.5410387",
"text": "def renew_date_is_valid_datetime\n # binding.pry\n \n unless DateTime.parse(self.renew_date)\n binding.pry\n end\n end",
"title": ""
},
{
"docid": "3b7b894c3bb3f804ce7bf94137d2abff",
"score": "0.5409162",
"text": "def verify_reservation_is_in_future\n unless Date.today < date\n self.errors[:date] << 'must be in future. No time travel allowed!'\n end\n end",
"title": ""
},
{
"docid": "9ac760fc88415ed929b800d48709cba9",
"score": "0.54060453",
"text": "def check_date(date)\n\t\tbegin\n \t\t\tDate.parse(date)\n\t\trescue\n \t\t\tputs \"Error: Wrong Date Format\"\n\t\t\tdisplay_guide\n\t\tend\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "3563ae1b9808fbdba4feae5598881739",
"score": "0.540227",
"text": "def parse_invalid_date(value)\n return unless value\n\n parts = value.to_s.split(\"/\")\n return unless parts.size == 3\n\n month = parts[0].to_i\n day = parts[1].to_i\n year = parts[2].to_i\n return unless month >= 1 && month <= 12 && day >= 1 && day <= 31\n\n year = add_century_to(year)\n\n Date.new(year, month, day)\n end",
"title": ""
},
{
"docid": "ac0ec6b1bb3fadceec2ae714306f62bf",
"score": "0.5399246",
"text": "def valid_date? str\n begin #Date.parse is a lenient parser, hence using it with a regular expression to enforce the format\n result = str.match($date_regex) && Date.parse(str)\n rescue ArgumentError => e\n return false\n else\n return result\n end\nend",
"title": ""
},
{
"docid": "3a5e6a9225364b7d79ac54fa8431bd79",
"score": "0.5396714",
"text": "def date(s)\n begin\n DateTime.parse(clean(s)).iso8601()\n rescue\n Utils.vewarnx(2, \"#{s} is unparsable; date is set to current\")\n DateTime.now().iso8601()\n end\n end",
"title": ""
},
{
"docid": "b977dcaa962f5278984ac6b3e9f08ecb",
"score": "0.5388174",
"text": "def valid_lottery_date\n \treturn true if self.lottery_deadline.nil? || self.lottery_deadline.empty?\n begin\n USDateParse(self.lottery_deadline)\n rescue\n errors.add(:lottery_deadline, 'invalid.')\n end\n end",
"title": ""
},
{
"docid": "326b33628acc7948303c7f3c8aa12d01",
"score": "0.5381238",
"text": "def valid_date?(string_date)\n if string_date.length == 10\n condition_1 = string_date[0...2].is_i?\n condition_2 = string_date[2] == '/'\n condition_3 = string_date[3...5].is_i?\n condition_4 = string_date[5] == '/'\n condition_5 = string_date[6...10].is_i?\n if condition_1 && condition_2 && condition_3 && condition_4 && condition_5\n month = string_date[0...2].to_i\n day = string_date[3...5].to_i\n year = string_date[6...10].to_i\n if Date.valid_date?(year, month, day)\n if Date.new(year, month, day) > Date.today()\n return true\n end\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "687f648dee46bd20be91a4b4bf98c859",
"score": "0.5368461",
"text": "def is_date(value)\n value != '' && value != '1900-01-01 00:00:00' && value != '0000-00-00 00:00:00' && value != '1901-12-13 00:00:00' && value != '1969-12-31 00:00:00'\n end",
"title": ""
},
{
"docid": "00c4443bc152c979db189d70d542e6e7",
"score": "0.53634685",
"text": "def validate_token_time(time)\n if time.utc < Time.now.utc\n raise ArgumentError, 'token_expiration date invalid'\n end\n end",
"title": ""
},
{
"docid": "00c4443bc152c979db189d70d542e6e7",
"score": "0.53634685",
"text": "def validate_token_time(time)\n if time.utc < Time.now.utc\n raise ArgumentError, 'token_expiration date invalid'\n end\n end",
"title": ""
},
{
"docid": "ee85026ab311cef85da9efed693377d1",
"score": "0.5361878",
"text": "def verify_timestamp(stamp)\n begin\n if !(stamp[/^\\d{1,2}\\/\\d{1,2}\\/\\d{4} \\d{1,2}:\\d{1,2}:\\d{1,2} [AP]M\\z/])\n FORMAT.warning('Invalid format of timestamp example: 06/07/2016 5:30:23 AM')\n raise TimeStampFormatError\n else\n stamp\n end\n rescue TimeStampFormatError\n timestamp\n end\nend",
"title": ""
},
{
"docid": "eb1edfd1416cd15919c70fd3397225a3",
"score": "0.5358499",
"text": "def rss_date(date_time)\n CGI.rfc1123_date(date_time) \n end",
"title": ""
},
{
"docid": "60aec14f02ec78fd772d24c6c402932f",
"score": "0.5354522",
"text": "def date_validator(length, datetime_obj)\n dt = DateTime.parse(datetime_obj)\n if DateTime.now().mjd - dt.mjd > length\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "8c8a4541b0ff2df258e87b33f1f0c724",
"score": "0.53534174",
"text": "def date_time\n now = ::Time.zone.now\n\n tz_format = now.utc_offset == 0 ? 'Z' : '%z'\n now_parts = DateTimeParser.parse_v_card_date_time(now.strftime('%Y%m%dT%H%M%S' + tz_format))\n date_parts = DateTimeParser.parse_v_card_date_time(value)\n\n # This sets all the missing parts to the current date/time.\n # So if the year was missing for a birthday, we're making it 'this\n # year'.\n date_parts.each do |k, v|\n date_parts[k] = now_parts[k] unless v\n end\n\n # Now follows a ruby Hack\n date_parts['timezone'] = '+0000' if date_parts['timezone'] == 'Z'\n done = false\n datetime = nil\n\n ActiveSupport::TimeZone.all.each do |tz|\n datetime = tz.parse(\"#{date_parts['year']}-#{date_parts['month']}-#{date_parts['date']} #{date_parts['hour']}:#{date_parts['minute']}:#{date_parts['second']}\")\n\n next unless datetime.strftime('%z') == date_parts['timezone']\n\n done = true\n break\n end\n\n fail 'could not load correct time zone' unless done\n # End ruby hack\n\n datetime.freeze\n datetime\n end",
"title": ""
},
{
"docid": "8b01af0fa16465edf54969d8ca67cda3",
"score": "0.53515655",
"text": "def valid_date?(string)\n Date.parse(string)\n end",
"title": ""
},
{
"docid": "0e0eaab7b7ee681d7b253b89f2f8639c",
"score": "0.5344305",
"text": "def validate_date?(date) #a method to validate date. Being used in multiple places\n date_format = '%m-%d-%Y'\n DateTime.strptime(date, date_format)\n true\n rescue ArgumentError #exception handling to avoid stop in execution of code\n false\n end",
"title": ""
},
{
"docid": "fc080adee7edfab1dc2387a831ae4719",
"score": "0.53364587",
"text": "def renew_date_is_valid_datetime\n\n # TODO Should validate that the renew_date column is a valid DateTime. See subscription_spec.rb for more tips \n\n end",
"title": ""
},
{
"docid": "a5112e4b58651ec7c652af2268efc035",
"score": "0.533626",
"text": "def expiry_as_of_now\n super && Time.parse(super)\n end",
"title": ""
},
{
"docid": "3a5000283da054ca7b847297efb5d812",
"score": "0.53359324",
"text": "def format_date \n begin\n if !self.unformatted_validated_date.blank?\n self.validated_date = Date.strptime(self.unformatted_validated_date, \"%m/%d/%Y\").to_time(:utc)\n end\n rescue\n errors.add :base, \"Invalid Date\"\n return false\n end\n end",
"title": ""
},
{
"docid": "12b78bf3b8884154d56386b2a2bf0862",
"score": "0.5321443",
"text": "def check_deadline\n\t if self.deadline < Time.now\n\t \terrors.add(:deadline, \"should be valid date\")\n end\n\tend",
"title": ""
},
{
"docid": "24f350c5dd9bc023f13b757d1bc68472",
"score": "0.53086996",
"text": "def valid_date?(date)\n begin\n Time.parse(date)\n rescue ArgumentError, TypeError\n puts \"Invalid station opening date: \\\"#{date}\\\". Skipping this data row.\"\n return false\n end\n\n true\n end",
"title": ""
},
{
"docid": "d4a098ec68d5de6d07169b5b638c8f2a",
"score": "0.5303315",
"text": "def SAExpirationDate # rubocop:disable Style/MethodName\n Time.strptime(@attrs[:SAExpirationDate], '%m/%d/%Y %l:%M %p').utc unless @attrs[:SAExpirationDate].nil?\n end",
"title": ""
},
{
"docid": "9aed92252bcbc644d07b4ed73f1760ef",
"score": "0.5299197",
"text": "def validate_published_on\n date_parts = [year, month, day].reject(&:blank?)\n published_on = Date.new(*date_parts)\n if published_on > Time.zone.now.to_date\n errors.add :published_on, \"is a date in the future\"\n elsif published_on < Date.new(1650)\n errors.add :published_on, \"is before 1650\"\n else\n write_attribute(:published_on, published_on)\n end\n rescue ArgumentError\n errors.add :published_on, \"is not a valid date\"\n end",
"title": ""
},
{
"docid": "8423fb0995460d5af4c5766fa3ce9a2d",
"score": "0.52949655",
"text": "def is_valid_datetime(datestring)\n datestring = datestring.to_s.strip\n datestring.match(PATTERN) && DateTime.parse(datestring)\n rescue ArgumentError\n nil\n end",
"title": ""
},
{
"docid": "b2362549880b9aec04334716770bea72",
"score": "0.5293716",
"text": "def validate_body(body)\n if body[\"project\"].nil?\n raise IOError, \"Missing project name\"\n end\n if body[\"date\"].nil?\n now = Time.now\n body[\"date\"] = DateTime.new(now.year, now.month, now.day, 0, 0, 0, now.zone).iso8601\n end\n return body\nend",
"title": ""
},
{
"docid": "08a82eaacc89fff677d2855ef701812f",
"score": "0.5287886",
"text": "def validate_date( date )\n return Time.now.strftime( '%Y-%m-%d' ) if date.nil?\n dt = convert_date( date )\n return Time.now.strftime( '%Y-%m-%d' ) if dt.nil?\n return dt.strftime( '%Y-%m-%d' )\n end",
"title": ""
},
{
"docid": "eae794f40bd16a34ce5a014cd26f3f8f",
"score": "0.5284348",
"text": "def check_date_encoding(date_value, encoding)\n date = date_value.to_s.strip\n case encoding\n when 'w3cdtf'\n return true if date.match(/^[\\d]{4}$/)\n return true if date.match(/^[\\d]{4}-[\\d]{2}$/)\n return true if date.match(/^[\\d]{4}-[\\d]{2}-[\\d]{2}$/)\n when 'edtf'\n return true if date.match(/^-?[\\d]{4}$/)\n when 'marc'\n return true if date.match(/^[\\du]{4}$/)\n return true if date.match(/^[\\d]{1,3}$/)\n return true if date.match(/^[\\d]{6}$/)\n end\n if ['w3cdtf', 'edtf', 'marc'].include?(encoding)\n return FALSE\n else\n return TRUE\n end\nend",
"title": ""
},
{
"docid": "19923a7dea2b78a9a181b7e3e284f314",
"score": "0.52842826",
"text": "def set_date_header\n response.date = Time.now if response.respond_to?(:date) and not response.date?\n end",
"title": ""
},
{
"docid": "8daddba4fce7bd7b47ccdba29deb16bc",
"score": "0.5282614",
"text": "def date_parsable?(date)\n return !is_a_number?(date)\n end",
"title": ""
},
{
"docid": "f13d0244ce4bf7a97e7492a40eb5a1c6",
"score": "0.5282006",
"text": "def valid_time_or_date?(value)\n value.is_a?(Time) || value.is_a?(Date) || value.is_a?(ActiveSupport::TimeWithZone)\n end",
"title": ""
},
{
"docid": "c140a4a1a168b4daf9df05fa6a2fda9d",
"score": "0.5280469",
"text": "def valid_date\n validation = date.to_time\n if validation.past?\n errors.add(:restaurant_id, 'Reservation MUST be an Upcoming Date')\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "cceaca542e9555ec536dbf9285cee29c",
"score": "0.527541",
"text": "def valid_time?(send_time, offset)\n offset = offset.insert(3, \":\") # Convert to proper format for #localtime()\n\n now = (Time.now.localtime(offset) + 15).to_s\n send_time > now\nend",
"title": ""
},
{
"docid": "20a1f90985d188aee821460bfff06338",
"score": "0.52688974",
"text": "def if_modified_since\n value = @rack_env.fetch(IF_MODIFIED_SINCE) { return }\n begin\n Time.httpdate(value)\n rescue ArgumentError\n nil\n end\n end",
"title": ""
},
{
"docid": "a5284d845b29b26576a2458b37133c2c",
"score": "0.5268465",
"text": "def date\n date = self.header('date')\n return nil unless date\n SMail::MIME::Date.parse(date)\n #(year, month, day, hour, minute, second, timezone, weekday) = ParseDate.parsedate(date)\n #Time.gm(second, minute, hour, day, month, year, weekday, nil, nil, timezone)\n end",
"title": ""
},
{
"docid": "c2575c6716de22ebb5b520d2bd84a0b0",
"score": "0.526239",
"text": "def datecheck\n if date.present? && date < Date.current\n errors.add(:date, \"must be in the future\")\n end\n end",
"title": ""
},
{
"docid": "102ff5d74eb9b1a6a6abaf71f91111e2",
"score": "0.5258597",
"text": "def test_jwt_valid_time\n Time.parse(ENV!['TEST_FIREBASE_JWT_VALID_DATETIME'])\n end",
"title": ""
},
{
"docid": "82dd36e1a5d31acfffc7c4830b41958a",
"score": "0.52542484",
"text": "def valid_date?(string)\n raise_invalid_date_range if %r{(\\d{4}/\\d{2}/\\d{2})}.match(string).blank?\n\n Date.strptime(string, '%Y/%m/%d')\n rescue ArgumentError\n raise_invalid_date_range\n end",
"title": ""
},
{
"docid": "0c51db9a383808bdcad4133ec21625e0",
"score": "0.5253894",
"text": "def test_unix_date_time()\n # Parameters for the API call\n datetime = DateTimeHelper.from_unix(1484719381)\n\n # Perform the API call through the SDK function\n result = @controller.unix_date_time(datetime)\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": "1cf77f9801da6a5d2bab1e617bcea45b",
"score": "0.52526706",
"text": "def check_date_format(date)\n begin\n Date.strptime(date, '%Y%m%d')\n rescue\n @error = \"Invalid date.\"\n raise @error\n end\n end",
"title": ""
},
{
"docid": "52689d65cf820f538bf2a69a5d12fc91",
"score": "0.5246473",
"text": "def parse_date(val); end",
"title": ""
},
{
"docid": "d47c8ec468c1dda3bcbbd06b657ed8a9",
"score": "0.52419746",
"text": "def fecha_valida(fecha)\n begin\n Date.parse(fecha)\n return true\n rescue\n return false\n end\n end",
"title": ""
},
{
"docid": "339c3b9fbd9dddebfd9eea635cd5a9e4",
"score": "0.5240927",
"text": "def validate_date\n if self.duration.nil? || self.duration_string\n if self.duration_string.match(/^\\d{2}\\.\\d{2}\\.\\d{4}$/)\n self.duration = Date.strptime self.duration_string, '%d.%m.%Y'\n\n unless self.duration > DateTime.now.to_date\n errors.add(:duration_string, I18n.t('mongoid.errors.models.challenge.attributes.duration_string.not_in_future'))\n end\n else\n errors.add(:duration_string, I18n.t('mongoid.errors.models.challenge.attributes.duration_string.invalid'))\n end\n end\n end",
"title": ""
},
{
"docid": "5b538e38e2e918da771087a8a11ee5b9",
"score": "0.5238282",
"text": "def warn_invalid_date=(_arg0); end",
"title": ""
},
{
"docid": "7481b4b020c86e58c90ddcbdc237d948",
"score": "0.5217521",
"text": "def parse_czdatetime(str)\n str=~/^\\s*((\\d+)\\s*\\.\\s*(\\d+)\\s*\\.(\\s*(\\d+))?)?(\\s+(\\d+)\\s*:\\s*(\\d+)(\\s*:\\s*(\\d+))?)?\\s*$/\n now = Time.now\n raise ArgumentError.new(\"parse_czdatetime: bad input: #{str}\") if !$1\n day = $2 || now.day\n month = $3 || now.month\n year = $5 || now.year\n if $6\n hour = $7\n min = $8\n sec = $10\n else\n hour = 0\n min = 0\n sec = 0\n end\n Time.local(year.to_i,month.to_i,day.to_i,hour.to_i,min.to_i,sec.to_i)\n end",
"title": ""
},
{
"docid": "d66cec14719ac09585ffe3ea077dcbc0",
"score": "0.5215565",
"text": "def valid_date_format?\n if deadline.nil?\n errors.add(:deadline, \"is invalid\")\n end\n end",
"title": ""
},
{
"docid": "3177616c99caefdad19a5da025c162ac",
"score": "0.5215386",
"text": "def valid?(value)\n whitelisted_value?(value) || value.is_a?(Time) || value.is_a?(Date)\n end",
"title": ""
},
{
"docid": "eb14fe7330d1309d3d28e51a136d407c",
"score": "0.52128166",
"text": "def test_get_1123_date_time()\n\n # Perform the API call through the SDK function\n result = @controller.get_1123_date_time()\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 assert_equal('Sun, 06 Nov 1994 08:49:37 GMT', @response_catcher.response.raw_body)\n end",
"title": ""
},
{
"docid": "69f24cc2d103668fa6eca1f97fc501e3",
"score": "0.5211658",
"text": "def start_date_cannot_be_in_the_past\n if start_time && start_time < DateTime.now + (15.minutes)\n errors.add(:start_time, 'Booking must start at least 15 minutes from present time')\n end\n end",
"title": ""
},
{
"docid": "cf10dce875c47914598f00747c3f95ad",
"score": "0.5211224",
"text": "def verify_authorization_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input))\n end",
"title": ""
},
{
"docid": "df017611ba7efb4e1adb688d0840c231",
"score": "0.5210038",
"text": "def rfc2109(time); end",
"title": ""
},
{
"docid": "df017611ba7efb4e1adb688d0840c231",
"score": "0.5210038",
"text": "def rfc2109(time); end",
"title": ""
},
{
"docid": "df017611ba7efb4e1adb688d0840c231",
"score": "0.5210038",
"text": "def rfc2109(time); end",
"title": ""
}
] |
5720d9aca611d44f93943a6d28980d6a
|
Sets the current tabulation of the document.
|
[
{
"docid": "0fb80e9012ffa4f30b7ae6baa1844d23",
"score": "0.68919307",
"text": "def tabulation=(val)\n val = val - @real_tabs\n @tabulation = val > -1 ? val : 0\n end",
"title": ""
}
] |
[
{
"docid": "da351c383cd7b8d7fd31d2a20e88cb64",
"score": "0.6504025",
"text": "def tabulation\n @real_tabs + @tabulation\n end",
"title": ""
},
{
"docid": "836874e5bac6472a7dae04eb4ffcbb6a",
"score": "0.6385778",
"text": "def set_tab\n TABSTOPS << x\n TABSTOPS.sort!\n configure(tabs: TABSTOPS)\n end",
"title": ""
},
{
"docid": "2a1d42fa8f0e95bd60ad47d67e38b342",
"score": "0.6178809",
"text": "def tab_up(i = 1)\n haml_buffer.tabulation += i\n end",
"title": ""
},
{
"docid": "214a99dcf7a885db250a76afe15e44e3",
"score": "0.61594903",
"text": "def set_current_tab t\n return if @current_tab == t\n @current_tab = t\n goto_component @components[t]\n @tab_changed = true\n @repaint_required = true\n self\n end",
"title": ""
},
{
"docid": "c9ca5906115ee67280e0daddfd7ae465",
"score": "0.6129789",
"text": "def autotab\n @current_tab ||= 0\n @current_tab += 1\n end",
"title": ""
},
{
"docid": "c91a3ed40409110731c7d74e22dea385",
"score": "0.60748255",
"text": "def tab\n set_column(get_column + 1)\n end",
"title": ""
},
{
"docid": "0dd5671b0596cdb41aedd9446dac4ce4",
"score": "0.60214514",
"text": "def tabs=(value)\n @tabs = value\n end",
"title": ""
},
{
"docid": "bffd6161af408c4dad7b1a72ab847d92",
"score": "0.60183156",
"text": "def tabstop=(t)\n @tabstop = posint(t)\n end",
"title": ""
},
{
"docid": "323e0e9bfee7112c998d7c9d3c44ecfd",
"score": "0.597314",
"text": "def with_tabs(i)\n old_tabs = haml_buffer.tabulation\n haml_buffer.tabulation = i\n yield\n ensure\n haml_buffer.tabulation = old_tabs\n end",
"title": ""
},
{
"docid": "e5839fccab2c21f34cdf8e3b1dfa4160",
"score": "0.5837189",
"text": "def set_tab(tab_type, tab_name)\n tab = \"#{tab_type}_tab_#{tab_name}\"\n @major_tab = tab\n end",
"title": ""
},
{
"docid": "35c131f41caa7e9d29013c4a89312440",
"score": "0.5750736",
"text": "def tab\n self << \"\\t\"\n end",
"title": ""
},
{
"docid": "8d71f0aa392a9bf715f168eef7c565bc",
"score": "0.5730276",
"text": "def tab() 0 end",
"title": ""
},
{
"docid": "27797b5d1fbff60e6e333d52c4098520",
"score": "0.5655375",
"text": "def tab_down(i = 1)\n haml_buffer.tabulation -= i\n end",
"title": ""
},
{
"docid": "5594243d58ea2a379a8e3ddecb2f2232",
"score": "0.5635788",
"text": "def set_Table(value)\n set_input(\"Table\", value)\n end",
"title": ""
},
{
"docid": "2964ac891c1c4645f62e4b1b06719489",
"score": "0.56292725",
"text": "def set_tab_color(color)\n color = Colors.new.get_color(color)\n color = 0 if color == 0x7FFF # Default color.\n @tab_color = color\n end",
"title": ""
},
{
"docid": "0c2a5ca1fc0ef83279d6c3bd19db803a",
"score": "0.55899996",
"text": "def setCurrentTable(tableName)\n die(\"setCurrentTable: table '#{tableName}' does not exist\") unless (@tables.has_key?(tableName))\n @currentTableName=tableName\n tell(\"setCurrentTable: setting #{tableName} as current table\")\n end",
"title": ""
},
{
"docid": "8236c99025e61a223f208c13ed957af3",
"score": "0.5571729",
"text": "def set_indent(indent = 1)\n @indent = indent\n end",
"title": ""
},
{
"docid": "4761e93ddc0061ef071630377d0da983",
"score": "0.55160403",
"text": "def tab(cx=@cursor.x)\n\t\t\ttabsize - cx % tabsize\n\t\tend",
"title": ""
},
{
"docid": "100d7f13fe69b271d27e7e193a0b46f2",
"score": "0.5500367",
"text": "def set_tabulator\n @tabulator = Tabulator.find(params[:id])\n end",
"title": ""
},
{
"docid": "8367da32a6544c95b1eb4d4635dc2d77",
"score": "0.5483232",
"text": "def tabs(count)\n tabs = count + @tabulation\n ' ' * tabs\n @@tab_cache[tabs] ||= ' ' * tabs\n end",
"title": ""
},
{
"docid": "16188827950046af7aa75f8e3601a4fb",
"score": "0.5475352",
"text": "def set_tab\r\n @active_tab = 'products'\r\n end",
"title": ""
},
{
"docid": "16188827950046af7aa75f8e3601a4fb",
"score": "0.5475352",
"text": "def set_tab\r\n @active_tab = 'products'\r\n end",
"title": ""
},
{
"docid": "7397bf7c4a046958aca76fe087a29e46",
"score": "0.5470939",
"text": "def set_tab\n @active_tab = 'products'\n end",
"title": ""
},
{
"docid": "973451182572be6bfa60f911ea77aaa8",
"score": "0.5465563",
"text": "def set_tab_color(color)\n put_deprecate_message(\"#{self}.set_tab_color\")\n self.tab_color = color\n end",
"title": ""
},
{
"docid": "973451182572be6bfa60f911ea77aaa8",
"score": "0.5465563",
"text": "def set_tab_color(color)\n put_deprecate_message(\"#{self}.set_tab_color\")\n self.tab_color = color\n end",
"title": ""
},
{
"docid": "0a6b1b4e5c801476c17413a8fb177783",
"score": "0.5441069",
"text": "def tab\n self.store(CommandNode.new(self, '\\tab', nil, false))\n nil\n end",
"title": ""
},
{
"docid": "5c452cea8b3df057774977148f6d2ff5",
"score": "0.5438966",
"text": "def adjust_tabs(tab_change)\n @real_tabs += tab_change\n end",
"title": ""
},
{
"docid": "12f8225fde158586ae3d6d58004a1949",
"score": "0.5419624",
"text": "def tabs(tab_stops)\n @options[:tabs] = tab_stops\n end",
"title": ""
},
{
"docid": "1ef5aab8010f15dfdc97f7a84c78522e",
"score": "0.5368536",
"text": "def tab(tab_name)\n @options[:tab] = tab_name\n end",
"title": ""
},
{
"docid": "34f0a048c4d98f157568dbf469674418",
"score": "0.53276443",
"text": "def set_tab\n @tab=\"food_categories\"\n end",
"title": ""
},
{
"docid": "63870efc6586873c538ad60e1c4d886b",
"score": "0.5315213",
"text": "def set_tab_state\n set_state current_tab: params[:current_tab]\n end",
"title": ""
},
{
"docid": "20cdd31ceaa2a1f1b61e8603f6634a91",
"score": "0.530028",
"text": "def update\n # TODO: Tab\n @previous_tab_index = @current_tab_index\n @current_tab_index = get_current_tab_index\n\n # TODO: Tab location\n\n # Scroll position\n @previous_scroll_position = @current_scroll_position\n @current_scroll_position = get_scroll_position\n\n nil\n end",
"title": ""
},
{
"docid": "a015be462713168e53372b8c0e53cae1",
"score": "0.52883613",
"text": "def tab=(t)\r\n if [:details, :prices].include?(t)\r\n @tab = t\r\n else\r\n @tab = nil\r\n end\r\n end",
"title": ""
},
{
"docid": "6b58522ee89690401dcb23286470c4a3",
"score": "0.5246249",
"text": "def set(margins); end",
"title": ""
},
{
"docid": "4715e57f04f5ae2cf7a4660591e180fd",
"score": "0.5236335",
"text": "def setPageMark()\n @intmrk[@page] = @pagelen[@page]\n setContentMark()\n end",
"title": ""
},
{
"docid": "149678ed3a6d13cd632b60c085333457",
"score": "0.52246726",
"text": "def tabs(count = 0)\n tabs = [count + @tabulation, 0].max\n @@tab_cache[tabs] ||= ' ' * tabs\n end",
"title": ""
},
{
"docid": "be5b73d50954889ed36ee5cce4827f94",
"score": "0.52135336",
"text": "def autotab\n @autotab ||= 0\n @autotab += 1\n end",
"title": ""
},
{
"docid": "276f99399281edee2a4dda4b3312d362",
"score": "0.52003276",
"text": "def set_tab_set_header(header)\n if @tab_sets and @tab_sets.last\n @tab_sets.last.first = header\n else\n raise(RuntimeError, 'You forgot to call new_tab_set().')\n end\n end",
"title": ""
},
{
"docid": "276f99399281edee2a4dda4b3312d362",
"score": "0.52003276",
"text": "def set_tab_set_header(header)\n if @tab_sets and @tab_sets.last\n @tab_sets.last.first = header\n else\n raise(RuntimeError, 'You forgot to call new_tab_set().')\n end\n end",
"title": ""
},
{
"docid": "ef9dd62fc3d2b4dd4c011a97167a9d4d",
"score": "0.51917475",
"text": "def setup_document(_)\n pdf = super\n @toc_page_number = pdf.outline.page_number\n pdf.start_new_page\n pdf\n end",
"title": ""
},
{
"docid": "b7e83db5c1809548ff88e97d4fe3fdc3",
"score": "0.51593757",
"text": "def make_space_after\n subsequent_tabs.each do |tab|\n tab.order = tab.order + 1\n tab.save\n end\n end",
"title": ""
},
{
"docid": "c579e7126e7edcc1782d3bac35ce99f1",
"score": "0.5133055",
"text": "def tabs=(_arg0); end",
"title": ""
},
{
"docid": "c579e7126e7edcc1782d3bac35ce99f1",
"score": "0.5133055",
"text": "def tabs=(_arg0); end",
"title": ""
},
{
"docid": "c579e7126e7edcc1782d3bac35ce99f1",
"score": "0.5133055",
"text": "def tabs=(_arg0); end",
"title": ""
},
{
"docid": "c579e7126e7edcc1782d3bac35ce99f1",
"score": "0.5133055",
"text": "def tabs=(_arg0); end",
"title": ""
},
{
"docid": "fd5d9674684acace0fb4aaa4ee4946b7",
"score": "0.51313204",
"text": "def before_outline_table(outline_table)\n @current_table = @examples[:rows]\n end",
"title": ""
},
{
"docid": "fd5d9674684acace0fb4aaa4ee4946b7",
"score": "0.51313204",
"text": "def before_outline_table(outline_table)\n @current_table = @examples[:rows]\n end",
"title": ""
},
{
"docid": "a045af8607549c3e0b8ff22c22e85a0d",
"score": "0.512696",
"text": "def start\n @tab= [[1,2,3], [4,5,6], [7,8,9]]\n @selected= []\n showtable\n get_x\n get_o\n get_x\n get_o\n get_x\n get_o\n get_x\n get_o\n get_x\n end",
"title": ""
},
{
"docid": "2ef5a168f9c7191612a8c8a69e2ec21f",
"score": "0.5125141",
"text": "def tab_size; end",
"title": ""
},
{
"docid": "94b72feed9e2da823eafc54dc38a09e5",
"score": "0.51123405",
"text": "def set_current_table table_name\n die \"table '#{table_name}' does not exist\" unless @tables.has_key? table_name\n @current_table_name = table_name\n end",
"title": ""
},
{
"docid": "94b72feed9e2da823eafc54dc38a09e5",
"score": "0.51123405",
"text": "def set_current_table table_name\n die \"table '#{table_name}' does not exist\" unless @tables.has_key? table_name\n @current_table_name = table_name\n end",
"title": ""
},
{
"docid": "0de65c1327d4208a9beae2aa7797f918",
"score": "0.51064277",
"text": "def tab\n require 'parsers/abstract/tab_parser'\n add_parser(TabParser.new)\n end",
"title": ""
},
{
"docid": "41775c089d7e75881bfe3085f5c5d62a",
"score": "0.50876004",
"text": "def tabs; end",
"title": ""
},
{
"docid": "41775c089d7e75881bfe3085f5c5d62a",
"score": "0.50876004",
"text": "def tabs; end",
"title": ""
},
{
"docid": "41775c089d7e75881bfe3085f5c5d62a",
"score": "0.50876004",
"text": "def tabs; end",
"title": ""
},
{
"docid": "41775c089d7e75881bfe3085f5c5d62a",
"score": "0.50876004",
"text": "def tabs; end",
"title": ""
},
{
"docid": "71c5875a1060afe2304379594e47d916",
"score": "0.5078868",
"text": "def set_tab\n @tab = Tab.find(params[:id])\n end",
"title": ""
},
{
"docid": "71c5875a1060afe2304379594e47d916",
"score": "0.5078868",
"text": "def set_tab\n @tab = Tab.find(params[:id])\n end",
"title": ""
},
{
"docid": "71c5875a1060afe2304379594e47d916",
"score": "0.5078868",
"text": "def set_tab\n @tab = Tab.find(params[:id])\n end",
"title": ""
},
{
"docid": "71c5875a1060afe2304379594e47d916",
"score": "0.5078868",
"text": "def set_tab\n @tab = Tab.find(params[:id])\n end",
"title": ""
},
{
"docid": "8e86a5adc960467d3bc54c38d1babbf5",
"score": "0.50677407",
"text": "def reset_tab_completion\n end",
"title": ""
},
{
"docid": "225bf688006293c405291c89e2cf78a4",
"score": "0.50508624",
"text": "def idt(tabs=0)\n @indent + (TAB * tabs)\n end",
"title": ""
},
{
"docid": "62ecac92479c65f1120051cc1c7eaed1",
"score": "0.5047997",
"text": "def tabulate(tabs)\n ' ' * TAB_SIZE * tabs\n end",
"title": ""
},
{
"docid": "94b99080cf65c4a99f6ec153b399ce6d",
"score": "0.5044121",
"text": "def set_Indent(value)\n set_input(\"Indent\", value)\n end",
"title": ""
},
{
"docid": "94b99080cf65c4a99f6ec153b399ce6d",
"score": "0.5044121",
"text": "def set_Indent(value)\n set_input(\"Indent\", value)\n end",
"title": ""
},
{
"docid": "f27267ad1f2fe9ff6e3f68c9abc05787",
"score": "0.5019242",
"text": "def set_table(index, value)\n within_fieldset(NEXT_ROUND_FORM) do\n find(:xpath, \"(.//input)[#{index+1}]\").set(value)\n end\n self\n end",
"title": ""
},
{
"docid": "cbfa6991a78f791a8651011e0c3a212c",
"score": "0.5008361",
"text": "def setPage(pnum, resetmargins=false)\n if pnum == @page\n return\n end\n if (pnum > 0) and (pnum <= @numpages)\n @state = 2\n # save current graphic settings\n # gvars = getGraphicVars()\n oldpage = @page\n @page = pnum\n @w_pt = @pagedim[@page]['w']\n @h_pt = @pagedim[@page]['h']\n @w = @pagedim[@page]['wk']\n @h = @pagedim[@page]['hk']\n @t_margin = @pagedim[@page]['tm']\n @b_margin = @pagedim[@page]['bm']\n @original_l_margin = @pagedim[@page]['olm']\n @original_r_margin = @pagedim[@page]['orm']\n @auto_page_break = @pagedim[@page]['pb']\n @cur_orientation = @pagedim[@page]['or']\n SetAutoPageBreak(@auto_page_break, @b_margin)\n # restore graphic settings\n # setGraphicVars(gvars)\n if resetmargins\n @l_margin = @pagedim[@page]['olm']\n @r_margin = @pagedim[@page]['orm']\n SetY(@t_margin)\n else\n # account for booklet mode\n if @pagedim[@page]['olm'] != @pagedim[oldpage]['olm']\n deltam = @pagedim[@page]['olm'] - @pagedim[@page]['orm']\n @l_margin += deltam\n @r_margin -= deltam\n end\n end\n else\n Error('Wrong page number on setPage() function.')\n end\n end",
"title": ""
},
{
"docid": "782e0eae519cacc8bb6ddc97ee8d2555",
"score": "0.5005395",
"text": "def utworz_tablice!(n, m)\n @tab = utworz_tablice n, m\n end",
"title": ""
},
{
"docid": "0de29aa35cc5ec9d24e577b86f36924e",
"score": "0.5000531",
"text": "def set_table(t)\n @table = t\n end",
"title": ""
},
{
"docid": "45d08e7f87c1b19ac0f5b59a2ab37cee",
"score": "0.49892837",
"text": "def set_tabinf\n @tabinf = Tabinf.find(params[:id])\n end",
"title": ""
},
{
"docid": "03028355ff6896b36509965a8e057d68",
"score": "0.49880582",
"text": "def indent_reset\n\t\t\t\t@indent_level = 0\n\t\t\tend",
"title": ""
},
{
"docid": "184a14d39909dee4e0d359829af294c6",
"score": "0.49841508",
"text": "def settable\n @settable ||= %i[text_field file_field textarea checkbox select_list]\n end",
"title": ""
},
{
"docid": "184a14d39909dee4e0d359829af294c6",
"score": "0.49841508",
"text": "def settable\n @settable ||= %i[text_field file_field textarea checkbox select_list]\n end",
"title": ""
},
{
"docid": "3ac528dc9ded30ec35508057b98c888e",
"score": "0.4942755",
"text": "def reset_tab_completion(tab_complete_proc = nil)\n ::Readline.basic_word_break_characters = \"\\x00\"\n ::Readline.completion_proc = tab_complete_proc || @rl_saved_proc\n end",
"title": ""
},
{
"docid": "42977dc53568fdf202f4c9ae8835abc5",
"score": "0.49295047",
"text": "def table=(array)\n unless @active_shape.hastable == 0\n array.each_with_index do |row_array, row_no|\n if @active_shape.table.rows.count > row_no\n row_array.each_with_index do |value, col_no|\n if @active_shape.table.columns.count > col_no\n @active_shape.table.cell(1 + row_no, 1 + col_no).shape.textframe.textrange.text = value unless value.nil?\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f5f2f663a86e4c3aaa717665592a14d8",
"score": "0.49205273",
"text": "def set_starting_state\n @source = Jaccess[@head.table]\n @list.each(&:reset)\n end",
"title": ""
},
{
"docid": "e48825ffdb6a881359914102afe8656b",
"score": "0.49111336",
"text": "def select\n\n# T the tab width to get rampangle V tabs\n# a = rampangle in radians\n# th = (100-td/100) real tab height percent\n# O = MT * (100-td/100)\n# A = O / tan(a)\n# T = A * 2 + bitdiam\n\n# height offset o = tan(a) * bit/2\n# new tab depth = 100 - (((th * mt) + o) / mt * 100)\n# new tab width = T + bitdiam\n msg = ''\n a = PhlatScript.torad(PhlatScript.rampangle.to_f)\n msg += \"a in radians #{a}\\n\"\n th = (100-PhlatScript.tabDepth.to_f) / 100 # tab thickness percent\n msg += \"th = #{th}\\n\"\n o = PhlatScript.materialThickness.to_f * th # physical tab thickness\n msg += \"phys tab o = #{o.to_mm}\\n\"\n aa = o / Math::tan(a)\n msg += \"aa = #{aa.to_mm}\\n\"\n t = aa * 2 + PhlatScript.bitDiameter\n msg += \"t = #{t.to_mm}\\n\"\n ho = Math::tan(a) * (PhlatScript.bitDiameter/2)\n msg += \"height adjust ho = #{ho.to_mm}\\n\"\n newdepth = 100 - ((o + ho) / PhlatScript.materialThickness * 100)\n newwidth = t \n msg += \"new depth = #{newdepth}\\nnewwidth=#{newwidth.to_mm}\"\n PhlatScript.tabDepth = newdepth.round\n PhlatScript.tabWidth = newwidth\n# UI.messagebox(msg,MB_MULTILINE)\n end",
"title": ""
},
{
"docid": "ed7f79b547c38251eef023f6b7460c42",
"score": "0.49044213",
"text": "def tab\r\n end",
"title": ""
},
{
"docid": "c88441cbf489a3450bc8f9c5bcebf271",
"score": "0.49032605",
"text": "def set_current_file(file)\n @current_file = file\n @tokens_per_line = Hash.new(0)\n @files[@current_file] = @tokens_per_line\n end",
"title": ""
},
{
"docid": "825309d1020b819711713692c7258aa3",
"score": "0.48989415",
"text": "def set_current_file(file)\n @current_file = file\n @tokens_per_line = Hash.new(0)\n @files[@current_file] = @tokens_per_line\n end",
"title": ""
},
{
"docid": "825309d1020b819711713692c7258aa3",
"score": "0.48989415",
"text": "def set_current_file(file)\n @current_file = file\n @tokens_per_line = Hash.new(0)\n @files[@current_file] = @tokens_per_line\n end",
"title": ""
},
{
"docid": "3c092902d4cb604e136b09588264e57c",
"score": "0.48979938",
"text": "def tabto(n)\n if self =~ /^( *)\\S/\n indent(n - $1.length)\n else\n self\n end\n end",
"title": ""
},
{
"docid": "62f291eeb2dbcc963de6868fa824f3ce",
"score": "0.4892628",
"text": "def reset_indent; end",
"title": ""
},
{
"docid": "253c87bbddf91ffe85cf0fad177019a4",
"score": "0.4882244",
"text": "def rulerNewTab(c,x,y)\n v = $demo_rulerInfo\n c.addtag_withtag('active', rulerMkTab(c,x,y))\n c.addtag_withtag('tab', 'active')\n v.x = x\n v.y = y\n rulerMoveTab(c,x,y)\nend",
"title": ""
},
{
"docid": "09ded85fe14b889544a62dc8161e1610",
"score": "0.48663157",
"text": "def detab( tabwidth=TabWidth )\r\n\t\tcopy = self.dup\r\n\t\tcopy.detab!( tabwidth )\r\n\t\treturn copy\r\n\tend",
"title": ""
},
{
"docid": "00afdefc0df1c9e720d478fc355984fc",
"score": "0.48447803",
"text": "def switch_tab\n @shortcut_tab = !@shortcut_tab\n update_scroll_arrows\n call_handler(:switch_tab)\n refresh\n end",
"title": ""
},
{
"docid": "3592f1c1bd1ada56f1b475b5f7d6e4fa",
"score": "0.4841833",
"text": "def insert_tab(event)\n insert(cursor, \"\\t\")\n end",
"title": ""
},
{
"docid": "0ae8181ebec4dd2c8f2e9a6c4473be85",
"score": "0.48350972",
"text": "def tabto(n)\n if self =~ /^( *)\\S/\n indent(n - $1.length)\n else\n self\n end\n end",
"title": ""
},
{
"docid": "0ae8181ebec4dd2c8f2e9a6c4473be85",
"score": "0.48350972",
"text": "def tabto(n)\n if self =~ /^( *)\\S/\n indent(n - $1.length)\n else\n self\n end\n end",
"title": ""
},
{
"docid": "e1aa66276e306ee415abc66ccd4c78c7",
"score": "0.48238093",
"text": "def mtab\n @mtab ||= {}\n end",
"title": ""
},
{
"docid": "f64c3e873322d3c76d06e48b2b94cc27",
"score": "0.48213992",
"text": "def mtab\n @mtab ||= {}\n end",
"title": ""
},
{
"docid": "34721ae1ce98505e5cb70a8254588470",
"score": "0.4813212",
"text": "def tabs(count)\n return \"\\t\"*count\n end",
"title": ""
},
{
"docid": "11847bb31f36c1baf11eb3b8c825f6ab",
"score": "0.4802618",
"text": "def set_table(table)\n @table = table\n @table.table_schema.fields.each do |field|\n (@inputs + @outputs + @values).each do |item|\n if field.name == item.name\n item.pos = field.pos\n item.type = @table.types[field.type]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3bc6ec180d405ddfa2f1e68d2b05bc33",
"score": "0.48013175",
"text": "def clear_all_tabs\n TABSTOPS.clear\n configure(tabs: 8)\n end",
"title": ""
},
{
"docid": "7421a108ae3c0f684e283ff11ce8985d",
"score": "0.47982168",
"text": "def set_logical_page_size( width, height)\n raise IllegalStateException if @state != S_START_\n @document_size = [width,height]\n end",
"title": ""
},
{
"docid": "30debf42cdf84d4f371b528b14ca8c64",
"score": "0.4791295",
"text": "def detab!( tabwidth=TabWidth )\r\n\t\tnewstr = self.split( /\\n/ ).collect {|line|\r\n\t\t\tline.gsub( /(.*?)\\t/ ) do\r\n\t\t\t\t$1 + ' ' * (tabwidth - $1.length % tabwidth)\r\n\t\t\tend\r\n\t\t}.join(\"\\n\")\r\n\t\tself.replace( newstr )\r\n\tend",
"title": ""
},
{
"docid": "a72a1eb8e7b9ca0f88358650c5142175",
"score": "0.47879782",
"text": "def ftab; end",
"title": ""
},
{
"docid": "65a39e4a0b9ed0fd5b4ff8e0463cceb1",
"score": "0.47839382",
"text": "def expand_tab\n gsub(/\\t/, \" \")\n end",
"title": ""
},
{
"docid": "09a6ca2a24def421fe2071168612b821",
"score": "0.47831842",
"text": "def indent=(value)\n @indent = value\n end",
"title": ""
}
] |
9ab13488bd765abbecadaf387ebb3c73
|
When we are sideloading associations, we can more easily track what has been serialized, so that we avoid infinite recursion / serialization.
|
[
{
"docid": "28a91f5e0aaeacd9a4ebabcc5b87ec2c",
"score": "0.0",
"text": "def initialize(*args)\n @serialized = {}\n\n super(*args)\n end",
"title": ""
}
] |
[
{
"docid": "c6feb74983615179545edb8bba3d8172",
"score": "0.66295105",
"text": "def preload_associations!\n # The only way we can preload associations is if object is a\n # ActiveRecord::Relation and has not been loaded.\n if object.respond_to?(:loaded?) && !object.loaded?\n serializer = options[:each_serializer] ||\n options[:serializer] ||\n object.klass.active_model_serializer\n if serializer\n includes_options = serializer.includes_for(object.klass)\n @object = object.includes(includes_options)\n end\n end\n end",
"title": ""
},
{
"docid": "1f2fc9e55962e11a51819a11e8d2c52a",
"score": "0.6501272",
"text": "def include_associations!\r\n associations = self.class.totem_associations.keys\r\n return if associations.blank?\r\n associations.each do |association_name|\r\n next if serializer_options.remove_association?(self, association_name)\r\n next if serializer_options.skip_collect_association?(association_name)\r\n include! association_name, include: serializer_options.include_association?(self, association_name)\r\n end\r\n end",
"title": ""
},
{
"docid": "48111b3678f781741c4a5761b8cfd415",
"score": "0.64122427",
"text": "def eager_load_associations\n nil\n end",
"title": ""
},
{
"docid": "1b647e112f8e59986117f76eab4db01a",
"score": "0.6382233",
"text": "def load_associations\n hash() # loads all\n end",
"title": ""
},
{
"docid": "e9a8e07dc80b1aabca99952980bca6b7",
"score": "0.63525",
"text": "def prepare_eager_load(a, reflections, eager_assoc)\n res = super\n \n reflections.each do |r|\n res[r[:eager_loader]][:association] = r[:name]\n end\n\n res\n end",
"title": ""
},
{
"docid": "ab647a8d08ef8c27009e55704e4abb6d",
"score": "0.6311744",
"text": "def serialized_associated_objects\n associated_objects.map do |klass, set|\n if configuration.embed_associated_objects.include?(klass)\n [klass, set.map{ |ident| serialization_for_identifier(ident, nested: true) }]\n else\n [klass, set.to_a]\n end\n end.to_h\n end",
"title": ""
},
{
"docid": "6f425c042bdded760d53654df6a571d3",
"score": "0.62739533",
"text": "def load_associated_records\n array = @owner.class.session.connection.get_relationships(@owner.class._module.name, @owner.id, @association.to_s)\n @loaded = true\n # we use original to track the state of the collection at start\n @collection = Array.wrap(array).dup\n @original = Array.wrap(array).freeze\n end",
"title": ""
},
{
"docid": "37c14d1df423b203e13e7333dc4eccee",
"score": "0.62557966",
"text": "def perform_eager_load(loader, eo)\n db.with_comments(:model=>model, :method_type=>:association_eager_load, :method=>nil, :association=>eo[:association]) do\n super\n end\n end",
"title": ""
},
{
"docid": "1d1a144ba0a766dc3723a5e6017a7e66",
"score": "0.6239686",
"text": "def use_check_for_associations\n\n # Activate checking for associations\n self.class_eval do\n alias_method :old_serialize_associations, :serialize_associations\n\n private\n \n def serialize_associations(include_associations, options, props)\n check_for_associations(include_associations, options)\n old_serialize_associations(include_associations, options, props)\n end\n\n # Utility method that returns array of all loaded association name symbols. It is included if\n # ClassMappings.check_for_case is true.\n def check_for_associations(include_associations, options)\n return if (reflections = self.class.reflections).empty?\n include_associations ||= []\n\n # Add any association instances not in include_associations. Optional approach is to get all reflection\n # names and merge them with include_associations, but I suspect this is faster.\n reflections.each do |reflection|\n name = reflection[0]\n include_associations << name if self.instance_variable_get(\"@#{name}\") && !include_associations.include?(name)\n end\n include_associations = nil if include_associations.empty?\n end\n end\n end",
"title": ""
},
{
"docid": "58fe61ded9901d3b0483baf7559e6c94",
"score": "0.61436605",
"text": "def use_mapped_active_record_serialization\n self.class_eval do\n alias_method :old_check_for_associations, :check_for_associations\n alias_method :old_serialize_mapped_properties, :serialize_mapped_properties\n\n private\n\n def check_for_associations(include_associations, options)\n if options[:rubyamf_ignore_check_for_associations]\n options.delete(:rubyamf_ignore_check_for_associations) # Only relevant to the current instance\n return\n end\n old_check_for_associations(include_associations, options)\n end\n\n # Updates included associations from the map\n def serialize_mapped_properties(map, local_options, include_associations, options)\n\n # Add any associations from mapping. Ignore if asscociations included in original options.\n if include_associations.nil? && map[:include]\n include_associations = map[:include]\n options[:rubyamf_ignore_check_for_associations] = true # Flag so we don't check for associations if they are mapped\n end\n old_serialize_mapped_properties(map, local_options, include_associations, options)\n end\n end\n end",
"title": ""
},
{
"docid": "edbb4ca38ce7da1a70abf3855ca6bad2",
"score": "0.61343235",
"text": "def cached_association; end",
"title": ""
},
{
"docid": "edbb4ca38ce7da1a70abf3855ca6bad2",
"score": "0.61343235",
"text": "def cached_association; end",
"title": ""
},
{
"docid": "f213ba5d74c313ca65171a881ef67187",
"score": "0.61048436",
"text": "def post_load(all_records)\n eager_graph_build_associations(all_records) if @opts[:eager_graph]\n eager_load(all_records) if @opts[:eager]\n end",
"title": ""
},
{
"docid": "42838a92a66a0e31418507be32b26344",
"score": "0.60123646",
"text": "def preload_association_data\n @associations.each do |assoc|\n # Get the model that this association references.\n reflection = @klass.reflect_on_association(assoc[:name])\n # Determine which key-value pairs should be preloaded.\n values = @source_data.map{ |key, datum| datum[assoc[:source_key]] }\n # Load the data, keyed by the local primary key\n assoc[:data] = reflection.klass \\\n .where(assoc[:primary_key] => values) \\\n .select(assoc[:primary_key], reflection.klass.primary_key) \\\n .index_by(&assoc[:primary_key])\n end\n end",
"title": ""
},
{
"docid": "43d80fbbb2056942e350174d8c6e5bab",
"score": "0.6006277",
"text": "def eager_load; end",
"title": ""
},
{
"docid": "43d80fbbb2056942e350174d8c6e5bab",
"score": "0.6006277",
"text": "def eager_load; end",
"title": ""
},
{
"docid": "afa82b693cbcc26f6897deb38909946c",
"score": "0.60037154",
"text": "def use_active_record_serialization\n\n # Activate checking for associations\n self.class_eval do\n\n # Only ActiveRecords have associations, so we add functionality to serialize associations\n def to_amf options=nil\n options ||= {}\n\n # Remove associations so that we can call to_amf on them seperately\n include_associations = options.delete(:include) unless options.empty?\n\n # Create props hash and serialize relations if supported method available. Pass in include associations\n # to pick up included associations.\n props, include_associations = serialize_properties(options, include_associations)\n\n # Serialize associations separately\n serialize_associations(include_associations, options, props)\n\n Rails3AMF::IntermediateModel.new(self, props)\n end\n\n # Serializes associations separately\n def serialize_associations(include_associations, options, props)\n if include_associations\n options[:include] = include_associations\n send(:serializable_add_includes, options) do |association, records, opts|\n props[association] = records.is_a?(Enumerable) ? records.map { |r| r.to_amf(opts) } : records.to_amf(opts) # Need dup in case association key is frozen.\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1586e299dad7e909a12d989c6c807f94",
"score": "0.59990644",
"text": "def eager_loading?; end",
"title": ""
},
{
"docid": "0043679781bbadfb829b673cdfe6d43e",
"score": "0.59818906",
"text": "def preload(associations)\n @relation = @relation.preload(associations)\n end",
"title": ""
},
{
"docid": "d6e404f2616969efcaa511ab8102c8c8",
"score": "0.59683675",
"text": "def eager_load!; end",
"title": ""
},
{
"docid": "d6e404f2616969efcaa511ab8102c8c8",
"score": "0.59683675",
"text": "def eager_load!; end",
"title": ""
},
{
"docid": "931f643aa16ecbb84dc6f4265b1ff1c4",
"score": "0.59456027",
"text": "def around_save_collection_association; end",
"title": ""
},
{
"docid": "1478f6b6c93d58798b7eadfe7a414ff4",
"score": "0.5881557",
"text": "def load_collection\n parent.send(collection_name).includes(eager_load_associations)\n end",
"title": ""
},
{
"docid": "3f190822b0cc296c7cd17a37f0b82220",
"score": "0.5852254",
"text": "def prefetch_associations(includes, records); end",
"title": ""
},
{
"docid": "3f190822b0cc296c7cd17a37f0b82220",
"score": "0.5852254",
"text": "def prefetch_associations(includes, records); end",
"title": ""
},
{
"docid": "79c3b97c04d3da3c82701435101be6fe",
"score": "0.58516556",
"text": "def relationship_serializer(name)\n nil\n end",
"title": ""
},
{
"docid": "65aeccd4ddd6c97307f7d8c23b80cf2f",
"score": "0.5843094",
"text": "def reload_uncached_association\n case self\n when Fields::Data\n self.custom_field.reload_uncached_association if self.custom_field.loaded?\n\n CustomField.find(self.custom_field_id).reload_uncached_association\\\n else\n #~ ToDo: Call reloads for the remaining field types\n end\n\n self.fields.each{|f| f.reload_uncached_association } if self.fields.loaded?\n\n self.role_fields.reload if self.role_fields.loaded?\n self.user_fields.reload if self.user_fields.loaded?\n self.field_filters.reload if self.field_filters.loaded?\n end",
"title": ""
},
{
"docid": "71772b841e4cbe81dcda647f7a353816",
"score": "0.5840353",
"text": "def recover_with_associations!\n self.recover!\n self.newly_undeleted = true\n self.retrievable_associates.each { |other| other.recover_with_associations! }\n end",
"title": ""
},
{
"docid": "7e87397b43f33bc9f568c59379b6f4de",
"score": "0.58205146",
"text": "def preload_this_assoc?(association)\n if @result_set_size <= 1\n false\n else\n association.accessed_via.size > @result_set_size / 4\n end\n end",
"title": ""
},
{
"docid": "1d8491abe69f6a2cb441699cb1b56f0a",
"score": "0.58189505",
"text": "def when_loaded?(name)\n represented.respond_to?(:association) && represented.association(name).loaded?\n end",
"title": ""
},
{
"docid": "fddca6b868c28186af6773cddf32e89a",
"score": "0.5810352",
"text": "def loaded?\n @association.loaded?\n end",
"title": ""
},
{
"docid": "8872fb96678dd7a1391a3d4d798381f5",
"score": "0.5809231",
"text": "def force_all_associations_loaded\n assocs = self._associations.keys\n r = assocs.map {|a| {a => object.association(a).loaded? } rescue nil }\n not_loaded = r.reject(&:nil?).select {|k| k.values.first==false }\n raise \"#{self.class} does not have all associations loaded. Missing: #{not_loaded}\" unless not_loaded.empty?\n end",
"title": ""
},
{
"docid": "7b8057501ad7ce71f7a823d3451bf7fe",
"score": "0.57922053",
"text": "def eager_load(a)\n return if a.empty?\n # Current model class\n model = @opts[:models][nil]\n # All associations to eager load\n eager_assoc = @opts[:eager]\n # Key is foreign/primary key name symbol\n # Value is hash with keys being foreign/primary key values (generally integers)\n # and values being an array of current model objects with that\n # specific foreign/primary key\n key_hash = {}\n # array of attribute_values keys to monitor\n keys = []\n # Reflections for all associations to eager load\n reflections = eager_assoc.keys.collect{|assoc| model.association_reflection(assoc)}\n\n # Populate keys to monitor\n reflections.each do |reflection|\n key = reflection[:type] == :many_to_one ? reflection[:key] : model.primary_key\n next if key_hash[key]\n key_hash[key] = {}\n keys << key\n end\n \n # Associate each object with every key being monitored\n a.each do |r|\n keys.each do |key|\n ((key_hash[key][r[key]] ||= []) << r) if r[key]\n end\n end\n \n # Iterate through eager associations and assign instance variables\n # for the association for all model objects\n reflections.each do |reflection|\n assoc_class = reflection.associated_class\n assoc_name = reflection[:name]\n assoc_iv = :\"@#{assoc_name}\"\n # Proc for setting cascaded eager loading\n assoc_block = Proc.new do |d|\n if order = reflection[:order]\n d = d.order(*order)\n end\n if c = eager_assoc[assoc_name]\n d = d.eager(c)\n end\n if c = reflection[:eager]\n d = d.eager(c)\n end\n if b = reflection[:eager_block]\n d = b.call(d)\n end\n d\n end\n case rtype = reflection[:type]\n when :many_to_one\n key = reflection[:key]\n h = key_hash[key]\n keys = h.keys\n # No records have the foreign key set for this association, so skip it\n next unless keys.length > 0\n # Set the instance variable to null by default, so records that\n # don't have a associated records will cache the negative lookup.\n a.each do |object|\n object.instance_variable_set(assoc_iv, :null)\n end\n assoc_block.call(assoc_class.select(*reflection.select).filter(assoc_class.primary_key=>keys)).all do |assoc_object|\n next unless objects = h[assoc_object.pk]\n objects.each do |object|\n object.instance_variable_set(assoc_iv, assoc_object)\n end\n end\n when :one_to_many, :many_to_many\n h = key_hash[model.primary_key]\n ds = if rtype == :one_to_many\n fkey = reflection[:key]\n reciprocal = reflection.reciprocal\n assoc_class.select(*reflection.select).filter(fkey=>h.keys)\n else\n fkey = reflection[:left_key_alias]\n assoc_class.select(*(Array(reflection.select)+Array(reflection[:left_key_select]))).inner_join(reflection[:join_table], [[reflection[:right_key], reflection.associated_primary_key], [reflection[:left_key], h.keys]])\n end\n h.values.each do |object_array|\n object_array.each do |object|\n object.instance_variable_set(assoc_iv, [])\n end\n end\n assoc_block.call(ds).all do |assoc_object|\n fk = if rtype == :many_to_many\n assoc_object.values.delete(fkey)\n else\n assoc_object[fkey]\n end\n next unless objects = h[fk]\n objects.each do |object|\n object.instance_variable_get(assoc_iv) << assoc_object\n assoc_object.instance_variable_set(reciprocal, object) if reciprocal\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "55ef85cb2ce9d3865d73001193bf1cd6",
"score": "0.5779288",
"text": "def cached_relationships\n reflect_on_all_associations.map(&:name).each do |r_name|\n end\n end",
"title": ""
},
{
"docid": "631b233bd06f40d2d034424d257dc9df",
"score": "0.5762486",
"text": "def eager_load_exclusions; end",
"title": ""
},
{
"docid": "081353face92f558a9d75153b4761975",
"score": "0.57410365",
"text": "def _reflect_on_association(*args)\n _load_schema_associations_associations\n super\n end",
"title": ""
},
{
"docid": "c38b7d1050a0a2baf77bb52944e93fe5",
"score": "0.574002",
"text": "def loaded?\n @association.loaded?\n end",
"title": ""
},
{
"docid": "c38b7d1050a0a2baf77bb52944e93fe5",
"score": "0.574002",
"text": "def loaded?\n @association.loaded?\n end",
"title": ""
},
{
"docid": "c91f5139f2fe553079e079f4261df71b",
"score": "0.5734989",
"text": "def associations\n serializer._associations.keys.map(&:to_s).map(&:pluralize)\n end",
"title": ""
},
{
"docid": "88b5526ebe1d73c52a06fecc66572e19",
"score": "0.572934",
"text": "def preload_has_many_association(records, reflection, preload_options={})\n #raise \"Updated version of rails, please check that the patch in StrategicEagerLoading::ActiveRecordIncludeBugfixes is still correct\" unless Rails.version == \"2.3.8\" || Rails.env == 'production'\n\n return if records.first.send(reflection.name).loaded?\n options = reflection.options\n\n primary_key_name = reflection.through_reflection_primary_key_name\n id_to_record_map, ids = construct_id_map(records, primary_key_name || reflection.options[:primary_key])\n records.each {|record| record.send(reflection.name).loaded}\n\n if options[:through]\n through_records = preload_through_records(records, reflection, options[:through])\n through_reflection = reflections[options[:through]]\n unless through_records.empty?\n source = reflection.source_reflection.name\n through_records.first.class.preload_associations(through_records, source, options)\n through_records.each do |through_record|\n through_record_id = through_record[reflection.through_reflection_primary_key].to_s\n #MY CHANGES\n loaded_records = through_record.send(source)\n # depending on the source associations type, the loaded records might be a single record or a set. add_preloaded_records_to_collection will accept either.\n loaded_records = loaded_records.nil? ? [] : [loaded_records].flatten.compact\n #END OF MY CHANGES\n add_preloaded_records_to_collection(id_to_record_map[through_record_id], reflection.name, loaded_records)\n end\n end\n\n else\n set_association_collection_records(id_to_record_map, reflection.name, find_associated_records(ids, reflection, preload_options),\n reflection.primary_key_name)\n end\n end",
"title": ""
},
{
"docid": "207f8f4513ab88f0189b05e9758300c7",
"score": "0.5724609",
"text": "def eager_load_associations\n [:author]\n end",
"title": ""
},
{
"docid": "0f0b32b5698ccfdd2e8b8342587239a6",
"score": "0.5723784",
"text": "def serialize_references\n return nil if self.check_if_autosynced_references\n\n assocs = self.class.autosynced_references\n assocs.each do |assoc|\n assoc_class = assoc.to_s.camelize.singularize.constantize\n syncable = self.class.syncable?\n\n existing_assocs = self.send(assoc) || []\n existing_assocs = [existing_assocs] unless existing_assocs.is_a?(Array)\n\n if syncable\n self[assoc] = {\n :updated_at => 0,\n :created_at => 0,\n :value => [],\n }\n else\n self[assoc] = []\n end\n\n existing_assocs.each do |elem|\n elem = elem.serialize_references if defined? elem.serialize_references\n elem.strip_blacklisted_fields\n\n if syncable\n self[assoc][:value].push elem\n\n if elem[:updated_at].to_i > self[assoc][:updated_at]\n self[assoc][:updated_at] = elem[:updated_at].to_i\n end\n\n self[assoc][:created_at] = elem[:created_at].to_i if self[assoc][:created_at] == 0\n if elem[:created_at].to_i < self[assoc][:created_at]\n self[assoc][:created_at] = elem[:created_at].to_i\n end\n else\n self[assoc].push elem\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "e6cf3d106e92a2e0a147247f2714d935",
"score": "0.57066983",
"text": "def load_resources\n end_of_association_chain\n end",
"title": ""
},
{
"docid": "da95c03493b4fc3181c135a63386427e",
"score": "0.5699767",
"text": "def save!\n\n @id ||= redis_db.incr(\"#{table_name}:counter\")\n\n redis_fields.each do |field|\n redis_db.set \"#{table_name}:#{id}:#{field}\", self.send(field)\n end\n\n redis_belongs.each do |parent_name|\n parent = self.send(parent_name)\n if parent\n redis_db.set \"#{table_name}:#{id}:#{parent_name}_id\", parent.id\n association_collection = parent.send(self.class.name.pluralize.downcase)\n association_collection << self\n parent.save!\n end\n end\n end",
"title": ""
},
{
"docid": "1189aec5be7176188d891f79ef2f5d1e",
"score": "0.56963825",
"text": "def cache_has_many(association, embed: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1189aec5be7176188d891f79ef2f5d1e",
"score": "0.56963825",
"text": "def cache_has_many(association, embed: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "a571aeb1caa3aa389e99ffb4e2727f92",
"score": "0.569476",
"text": "def reflect_on_all_autosave_associations; end",
"title": ""
},
{
"docid": "9c5ba91242e8fe455764b219f7cc8ab4",
"score": "0.5688174",
"text": "def dont_load_foreign_key_associations!\n @load_foreign_key_associations = false\n end",
"title": ""
},
{
"docid": "583fe3db02ca2183eaccbdeec7255eb6",
"score": "0.5675702",
"text": "def _load_associated_objects(opts, dynamic_opts=OPTS)\n db.with_comments(:model=>model, :method_type=>:association_load, :association=>opts[:name]) do\n super\n end\n end",
"title": ""
},
{
"docid": "28162d03eea099085b9bb821432657db",
"score": "0.5671627",
"text": "def associations\n @associations ||= self.class.associations || {}\n end",
"title": ""
},
{
"docid": "157916e0d52a8400263b931ac7259110",
"score": "0.56702644",
"text": "def process_relations\n # TODO\n end",
"title": ""
},
{
"docid": "b1a3bc668f61b245e6ccd2ea975669c9",
"score": "0.5668024",
"text": "def eager_load_all; end",
"title": ""
},
{
"docid": "8205b30255a5c22cb282edde25b5b13f",
"score": "0.56540895",
"text": "def association_proxy_cache\n {}\n end",
"title": ""
},
{
"docid": "88687e8abdbf78e64c5e4dc651cfa6c0",
"score": "0.5648027",
"text": "def after_save\n super\n @original_deserialized_values.clear if @original_deserialized_values\n end",
"title": ""
},
{
"docid": "2b048aa8956f091034f52d2cef3fd2f1",
"score": "0.56419474",
"text": "def before_eager_load(&block); end",
"title": ""
},
{
"docid": "36e3447f8b54f14e544ef9b18d2821b2",
"score": "0.56305695",
"text": "def final_serialize_attrs\n if being_included?\n self.class.include_attrs | serialize_attrs\n else\n self.class.default_attrs | serialize_attrs\n end\n end",
"title": ""
},
{
"docid": "65d16449ad322eb7f71eaa0b4a6e4c53",
"score": "0.56182534",
"text": "def save\n @associations.values.each { |a| a._save }\n end",
"title": ""
},
{
"docid": "4d8d0d23ec8bc6bf9d2d64ba95447c29",
"score": "0.5617058",
"text": "def eager_load!\n super\n ActiveFedora::Scoping.eager_load!\n ActiveFedora::Aggregation.eager_load!\n ActiveFedora::Associations.eager_load!\n ActiveFedora::Attributes.eager_load!\n ActiveFedora::AttributeMethods.eager_load!\n ActiveFedora::Indexers.eager_load!\n ActiveFedora::Indexing.eager_load!\n ActiveFedora::Orders.eager_load!\n end",
"title": ""
},
{
"docid": "f1043f2692900ff18e1bb39cd29da694",
"score": "0.5609277",
"text": "def association_serializer_for(name)\n model_class_name = self.name.to_s.demodulize.classify.gsub(/Serializer$/, '')\n model_class = model_class_name.safe_constantize\n\n association_class_name = model_class.try(:reflect_on_association, name)&.class_name\n\n return nil unless association_class_name\n\n serializer_for(association_class_name)\n end",
"title": ""
},
{
"docid": "f1043f2692900ff18e1bb39cd29da694",
"score": "0.5609277",
"text": "def association_serializer_for(name)\n model_class_name = self.name.to_s.demodulize.classify.gsub(/Serializer$/, '')\n model_class = model_class_name.safe_constantize\n\n association_class_name = model_class.try(:reflect_on_association, name)&.class_name\n\n return nil unless association_class_name\n\n serializer_for(association_class_name)\n end",
"title": ""
},
{
"docid": "e93907c69dc2f64153a851430d4b7e93",
"score": "0.5607219",
"text": "def exposed_associations\n []\n end",
"title": ""
},
{
"docid": "0535d87ca40baebca190ac8447ad013a",
"score": "0.55921584",
"text": "def sideloading\n self.class.sideloading\n end",
"title": ""
},
{
"docid": "3b8fa38b3b761f686d3ab834610cea07",
"score": "0.55796933",
"text": "def associations; self.class.class_eval(\"@@associations\") end",
"title": ""
},
{
"docid": "3b8fa38b3b761f686d3ab834610cea07",
"score": "0.55796933",
"text": "def associations; self.class.class_eval(\"@@associations\") end",
"title": ""
},
{
"docid": "75f6274b2a8868983b782601676540ea",
"score": "0.55777466",
"text": "def associated()\n merge(associated: 'true')\n end",
"title": ""
},
{
"docid": "20d338dd7c8351882a06e7d416a8fb6d",
"score": "0.5570712",
"text": "def load_associated_collections # :nodoc:\n collection.try(:load_associated_collections)\n end",
"title": ""
},
{
"docid": "d5c0f6af0214f5ac7c23f5054fe8d5ba",
"score": "0.5570596",
"text": "def associations; end",
"title": ""
},
{
"docid": "7b0171888cde1956bfedb67d06096567",
"score": "0.55691636",
"text": "def preloadable_association?( association )\n @klass.preloadable_associations.include?( association.to_sym )\n end",
"title": ""
},
{
"docid": "d5188a68ecb53f107467a92033a59412",
"score": "0.5568132",
"text": "def eagerly_load!\n # Do nothing by default\n end",
"title": ""
},
{
"docid": "8b0a4f8f69bcca8e25755e80c90331bf",
"score": "0.55494255",
"text": "def stale_state\n if through_reflection.belongs_to?\n owner[through_reflection.foreign_key] && owner[through_reflection.foreign_key].to_s\n end\n end",
"title": ""
},
{
"docid": "ac5a0cacae2d4908b82034e64a9d93be",
"score": "0.554915",
"text": "def load_associations\n @dependencies = @product.dependencies.order(:name)\n @dependents = @product.dependents.order(:name)\n @portfolios = @product.portfolios.order(:name).uniq\n @product_groups = @product.product_groups.includes(:group).order(\"groups.name\")\n @product_services = @product.product_services.includes(:service).order(\"services.name\")\n @employee_products = @product.employee_products.joins(:employee).where(\n :fiscal_year_id => @year.id).includes(:employee).order(:last_name, :first_name)\n end",
"title": ""
},
{
"docid": "55f71a275e58251ec0d2ad8e3bab0e5c",
"score": "0.55442715",
"text": "def load_associations(results, prefetchs)\n p_queries = prefetch_queries prefetchs, results\n a_queries = association_queries results\n objects = Tire.multi (p_queries+a_queries)\n prefetch_results prefetchs, results, objects[0...p_queries.size]\n association_results results, objects[p_queries.size..-1] \n end",
"title": ""
},
{
"docid": "62f869d3290a09d03ad38ba02a624fdf",
"score": "0.5536769",
"text": "def remember_association(node)\n (node.body.grep_nodes(:message => :belongs_to) + node.body.grep_nodes(:message => :has_one)).collect do |body_node|\n class_name = node.subject.to_s.underscore\n @associations[class_name] ||= []\n @associations[class_name] << body_node.arguments[1].to_s\n end\n end",
"title": ""
},
{
"docid": "64af68de673101e4578f482c032518c8",
"score": "0.553466",
"text": "def stale_state\n if through_reflection.belongs_to?\n Array(through_reflection.foreign_key).filter_map do |foreign_key_column|\n owner[foreign_key_column] && owner[foreign_key_column].to_s\n end.presence\n end\n end",
"title": ""
},
{
"docid": "2423ba271598ab15b33bf5cdd0a5da0d",
"score": "0.5512071",
"text": "def associated_records\n super || []\n end",
"title": ""
},
{
"docid": "8d1520a68ac505f6436f95e239921106",
"score": "0.55069435",
"text": "def save_belongs_to_association(reflection); end",
"title": ""
},
{
"docid": "d3a0ea43eee7532b761dbbe1f661bb63",
"score": "0.5504393",
"text": "def _associated_object_loader(opts, dynamic_opts)\n return if dynamic_opts[:eager]\n super\n end",
"title": ""
},
{
"docid": "59c5524b4e30ed78da5e7b9ab48687cb",
"score": "0.5503975",
"text": "def preload_for_elastic_index\n if self.class.respond_to?(:load_for_index)\n self.class.preload_associations(self,\n self.class.load_for_index.values[:includes])\n end\n end",
"title": ""
},
{
"docid": "2c0651c17984c3fc1f1d5ce9fd406ab4",
"score": "0.5503466",
"text": "def marshal_dump\n [_added, _loaded, _unloaded, @executed]\n end",
"title": ""
},
{
"docid": "3958a2c96f889170e51eccf459b420eb",
"score": "0.5503281",
"text": "def associations\n @associations ||= {}\n end",
"title": ""
},
{
"docid": "3fa2bf75d73bd27bc9b407dc0823bd8d",
"score": "0.54996115",
"text": "def association!( association )\n Mtx.synchronize do\n associations << association if preloadable_association?( association )\n end\n end",
"title": ""
},
{
"docid": "9dff31eaf9dfcedf3906f42663160182",
"score": "0.5487356",
"text": "def save_collection_association(reflection)\n# if association = association_instance_get(reflection.name)\n if target = @loaded_associations[reflection.name] #TODO use a real Association wrapper\n association = OpenStruct.new(target: target)\n autosave = reflection.options[:autosave]\n\n if records = associated_records_to_validate_or_save(association, @new_record_before_save, autosave)\n # NOTE saving the object with its nested associations will properly destroy records in OpenERP\n # no need to do it now like in ActiveRecord\n records.each do |record|\n next if record.destroyed?\n\n saved = true\n\n if autosave != false && (@new_record_before_save || record.new_record?)\n if autosave\n# saved = association.insert_record(record, false)\n record.run_callbacks(:save) { false }\n record.run_callbacks(:create) { false }\n# else\n# association.insert_record(record) unless reflection.nested?\n end\n elsif autosave\n record.run_callbacks(:save) {false}\n record.run_callbacks(:update) {false}\n# saved = record.save(:validate => false)\n end\n\n end\n end\n # reconstruct the scope now that we know the owner's id\n# association.reset_scope if association.respond_to?(:reset_scope)\n end\n end",
"title": ""
},
{
"docid": "793f2f6a4659a033b037a98f961f8353",
"score": "0.54832464",
"text": "def associations\n data.associations\n end",
"title": ""
},
{
"docid": "71b6d595e6c664649268db9b57b29912",
"score": "0.548112",
"text": "def serialisable_relations\n\n (\n self.class.reflect_on_all_associations( :has_one ) + self.class.reflect_on_all_associations( :belongs_to )\n ).map{ |r| r.name }\n\n end",
"title": ""
},
{
"docid": "8cf3ee08aca4ca42b2dc8bb4f6c49fa4",
"score": "0.547845",
"text": "def load_all_lazy_relationships(serializer_instance, level = NESTING_START_LEVEL)\n return if level >= LAZY_NESTING_LEVELS\n return unless serializer_instance.object\n\n return unless lazy_relationships\n\n lazy_relationships.each_value do |lrm|\n load_lazy_relationship(lrm, serializer_instance, level)\n end\n end",
"title": ""
},
{
"docid": "4ea028d5c94b851bdeb03ca7c46b634c",
"score": "0.5473707",
"text": "def associations_for_cloning\n []\n end",
"title": ""
},
{
"docid": "c2a2f02d8bd83dc0ea7032f1435085d0",
"score": "0.54729015",
"text": "def monitor_association\n super\n end",
"title": ""
},
{
"docid": "c2a2f02d8bd83dc0ea7032f1435085d0",
"score": "0.54729015",
"text": "def monitor_association\n super\n end",
"title": ""
},
{
"docid": "c2a2f02d8bd83dc0ea7032f1435085d0",
"score": "0.54729015",
"text": "def monitor_association\n super\n end",
"title": ""
},
{
"docid": "c2a2f02d8bd83dc0ea7032f1435085d0",
"score": "0.54729015",
"text": "def monitor_association\n super\n end",
"title": ""
},
{
"docid": "c2a2f02d8bd83dc0ea7032f1435085d0",
"score": "0.54729015",
"text": "def monitor_association\n super\n end",
"title": ""
},
{
"docid": "c2a2f02d8bd83dc0ea7032f1435085d0",
"score": "0.54729015",
"text": "def monitor_association\n super\n end",
"title": ""
},
{
"docid": "6cd56e9be6397b9a23ff28844a5c43cc",
"score": "0.54618144",
"text": "def begin_of_association_chain\n nil\n end",
"title": ""
},
{
"docid": "21a1a3be4b74c58fd6ffc5e99007f8c7",
"score": "0.5460474",
"text": "def marshal_load(data)\n @_base, @_target, @_association = data\n extend_proxy(_association.extension) if _association.extension\n end",
"title": ""
},
{
"docid": "37951207013cb70f5945db7b387aeba1",
"score": "0.5458758",
"text": "def cache_has_one(association, embed:); end",
"title": ""
},
{
"docid": "37951207013cb70f5945db7b387aeba1",
"score": "0.5458758",
"text": "def cache_has_one(association, embed:); end",
"title": ""
},
{
"docid": "7369c2c6f680edaa98de824b733217a3",
"score": "0.5458305",
"text": "def association_reflections\n @association_reflections ||= {}\n end",
"title": ""
},
{
"docid": "7369c2c6f680edaa98de824b733217a3",
"score": "0.5458305",
"text": "def association_reflections\n @association_reflections ||= {}\n end",
"title": ""
},
{
"docid": "ecb8d591a3a05f91ace9adc1c8716220",
"score": "0.54575956",
"text": "def load\n need_context = !loaded?\n result = super\n if need_context\n Context.register(\n records: ar_lazy_preload_records,\n association_tree: lazy_preload_values,\n auto_preload: preloads_associations_lazily?\n )\n end\n result\n end",
"title": ""
},
{
"docid": "3c4c59407bdc5304976717f1ed2e0fe1",
"score": "0.5455405",
"text": "def save_collection_association(reflection); end",
"title": ""
},
{
"docid": "807d3e6ba90349a70aa27faedb4b8848",
"score": "0.5454858",
"text": "def parent_has_been_saved!\n reload_raw_data\n proxy_targets_update_hash.clear\n end",
"title": ""
}
] |
2d61547559fe42c8d8c3264c4830122c
|
Loops until an interesting md5 hash is found
|
[
{
"docid": "069dc2a83e2ed31a68ed645e2976aff3",
"score": "0.7187936",
"text": "def next_interesting\n loop_until(->(hash) { /^0{5}/ =~ hash }) do\n @hasher.call(\"#{@id}#{@i += 1}\")\n end\n end",
"title": ""
}
] |
[
{
"docid": "4bc628ea5d4a504efd46e0791e641a3f",
"score": "0.7677803",
"text": "def unmd5(hash)\n # search one: lowercase search\n lower = \"a\"\n # search two: ascii brute force\n gen = all_ascii\n \n loop {\n break lower if md5(lower) == hash\n lower.next!\n \n cur = gen.next\n break cur if md5(cur) == hash\n }\nend",
"title": ""
},
{
"docid": "623e5c4e27e53be149f676582aa3bacd",
"score": "0.6906262",
"text": "def md5onlinenet_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n agent = Mechanize.new\n begin\n agent.user_agent = $config['HTTP']['HTTP_USER_AGENT']\n if $config['HTTP']['PROXY']\n if $config['HTTP']['PROXY_AUTH']\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i, user=$config['HTTP']['PROXY_USER'], pass=$config['HTTP']['PROXY_PASS'])\n else\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n end\n end\n # Fill out form and run search for hash\n page = agent.get('http://md5online.net') # Get page\n search_form = page.form_with(:action => 'http://md5online.net/') # find form to fill out\n search_form.pass = hash_to_find # set hash to find value\n page = agent.submit(search_form, search_form.buttons.first) # submit form and return new page\n if page.body =~ /<center><p>md5 :<b>#{hash_to_find}<\\/b> <br>pass : <b>(.+)<\\/b><\\/p><\\/table>/\n plain_jane = $1.to_s.strip.chomp\n if verbose\n print_good(\"Match Found: md5online.net\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{plain_jane}\".white\n end\n return plain_jane\n end\n rescue OpenSSL::SSL::SSLError,Errno::ETIMEDOUT,Net::HTTP::Persistent::Error,NoMethodError,Zlib::DataError,Mechanize::ResponseCodeError => e\n print_error(\"Problem Communicating with: md5online.net\") if verbose\n return nil\n end\n print_error(\"No Results from: md5online.net\") if verbose\n return nil\n else\n print_error(\"#{@hash_type} not supported for: md5online.net\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "8db14eddf326e74d7d64776ea083d3c9",
"score": "0.665079",
"text": "def md5comcn_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n agent = Mechanize.new\n begin\n agent.user_agent = $config['HTTP']['HTTP_USER_AGENT']\n if $config['HTTP']['PROXY']\n if $config['HTTP']['PROXY_AUTH']\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i, user=$config['HTTP']['PROXY_USER'], pass=$config['HTTP']['PROXY_PASS'])\n else\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n end\n end\n # Find form, enter hash, run search...\n page = agent.get('http://md5.com.cn/')\n search_form = page.form_with( :action => '/md5reverse' )\n search_form.md = hash_to_find\n button = search_form.button_with( :name => 'submit' )\n page = agent.submit(search_form, button) # submit form and return new page\n if page.body =~ /<label class=\"res count label b\">Md5:<\\/label>\\s+<span class=\"res green\">#{hash_to_find}\\s+<!--#{hash_to_find}-->.+<\\/span><br\\/>\\s+<label class=\"res count label\">Result:<\\/label>\\s+<span class=\"res green\">(.+)<\\/span>/\n plain_jane = $1.strip.chomp\n if verbose\n print_good(\"Match Found: md5.com.cn\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{plain_jane}\".white\n end\n return plain_jane\n end\n rescue OpenSSL::SSL::SSLError,Errno::ETIMEDOUT,Net::HTTP::Persistent::Error,NoMethodError,Zlib::DataError,Mechanize::ResponseCodeError => e\n print_error(\"Problem Communicating with: md5.com.cn\") if verbose\n return nil\n end\n print_error(\"No Results from: md5.com.cn\") if verbose\n return nil\n else\n print_error(\"#{@hash_type} not supported for: md5.com.cn\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "9a4ccac4e8a2a18a95f16bdd496c9df0",
"score": "0.6582728",
"text": "def md5onlineorg_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n agent = Mechanize.new\n begin\n agent.user_agent = $config['HTTP']['HTTP_USER_AGENT']\n if $config['HTTP']['PROXY']\n if $config['HTTP']['PROXY_AUTH']\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i, user=$config['HTTP']['PROXY_USER'], pass=$config['HTTP']['PROXY_PASS'])\n else\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n end\n end\n # Fill out form and run search for hash\n page = agent.get('http://md5online.org') # Get page\n search_form = page.forms.first # find form to fill out\n search_form.md5 = hash_to_find # set hash to find value\n page = agent.submit(search_form, search_form.buttons.first) # submit form and return new page\n if page.body =~ /<span class=\"result\" .+>Found : <b>(.+)<\\/b><\\/span>.+\\(hash = #{hash_to_find }\\)<\\/span>/\n plain_jane = $1.to_s.strip.chomp\n if verbose\n print_good(\"Match Found: md5online.org\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{plain_jane}\".white\n end\n return plain_jane\n end\n rescue OpenSSL::SSL::SSLError,Errno::ETIMEDOUT,Net::HTTP::Persistent::Error,NoMethodError,Zlib::DataError,Mechanize::ResponseCodeError => e\n print_error(\"Problem Communicating with: md5online.org\") if verbose\n return nil\n end\n print_error(\"No Results from: md5online.org\") if verbose\n return nil\n else\n print_error(\"#{@hash_type} not supported for: md5online.net\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "7a03ad1d06da1611b8b510d8c0ef8624",
"score": "0.6292192",
"text": "def generate_hash_string#:doc:\n return true unless self.hash_string.nil?\n begin\n self.hash_string = Digest::MD5.hexdigest(Time.now.to_f.to_s)\n end while self.class.find_by_hash_string(self.hash_string)\n end",
"title": ""
},
{
"docid": "cd6aa56c271730df6cd0d9bddd0c24d5",
"score": "0.6282664",
"text": "def cram_md5_challenge; end",
"title": ""
},
{
"docid": "3f8d1fcb4a080a2817ce71cb4b81467d",
"score": "0.6267536",
"text": "def netmd5crack_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n res = @http.get(\"http://www.netmd5crack.com/cgi-bin/Crack.py?InputHash=#{hash_to_find}\")\n if res[0] =~ /<tr><td class=\"border\">[a-fA-F\\d]{32}<\\/td><td class=\"border\">(.+)<\\/td><\\/tr><\\/table>/\n plain_jane = $1.to_s.strip.chomp\n if plain_jane =~ /Sorry, we don't have that hash in our database/\n print_error(\"No Results from: netmd5crack.com\") if verbose\n return nil\n end\n if verbose\n print_good(\"Match Found: netmd5crack.com\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{plain_jane}\".white\n end\n return plain_jane\n else\n print_error(\"No Results from: netmd5crack.com\") if verbose\n return nil\n end\n else\n print_error(\"#{@hash_type} not supported for: netmd5crack.com\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "5114179a741e15f47c7d01c765eb0b0f",
"score": "0.62647176",
"text": "def verify_md5_hash?(url, expected_hash, secret_key)\n url_no_hash = \"#{url[ 0..-33 ]}#{secret_key}\"\n actual_hash = Digest::MD5.hexdigest(url_no_hash)\n\n return (expected_hash == actual_hash)\n end",
"title": ""
},
{
"docid": "5fdd79fc023e3946efd5206639f24756",
"score": "0.6195335",
"text": "def digestmd5(file2md5)\n if not ::File.exists?(file2md5)\n raise \"File #{file2md5} does not exists!\"\n else\n require 'digest/md5'\n chksum = nil\n chksum = Digest::MD5.hexdigest(::File.open(file2md5, 'rb') { |f| f.read })\n return chksum\n end\n end",
"title": ""
},
{
"docid": "50709e372f97b60885bc958bf2e0766d",
"score": "0.6134381",
"text": "def noisette_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n agent = Mechanize.new\n begin\n agent.user_agent = $config['HTTP']['HTTP_USER_AGENT']\n if $config['HTTP']['PROXY']\n if $config['HTTP']['PROXY_AUTH']\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i, user=$config['HTTP']['PROXY_USER'], pass=$config['HTTP']['PROXY_PASS'])\n else\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n end\n end\n # Find form, enter hash, run search...\n page = agent.get('http://md5.noisette.ch/index.php')\n search_form = page.forms.first\n search_form.hash = hash_to_find\n page = agent.submit(search_form, search_form.buttons.first) # submit form and return new page\n if not page.body =~ /<div class=\"error\">No corresponding md5 found for \"#{hash_to_find}\"<\\/div>/\n plain_jane = page.forms[1].fields[0].value\n if verbose\n print_good(\"Match Found: md5.noisette.ch\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{plain_jane}\".white\n end\n return plain_jane\n end\n rescue OpenSSL::SSL::SSLError,Errno::ETIMEDOUT,Net::HTTP::Persistent::Error,NoMethodError,Zlib::DataError,Mechanize::ResponseCodeError => e\n print_error(\"Problem Communicating with: md5.noisette.ch\") if verbose\n return nil\n end\n print_error(\"No Results from: md5.noisette.ch\") if verbose\n return nil\n else\n print_error(\"#{@hash_type} not supported for: md5.noisette.ch\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "4a93f9cb11b47ccb4c06972b51767362",
"score": "0.6132961",
"text": "def fetch_md5\n # Create a hash digest for the current file.\n digest = Digest::MD5.new\n File.open(@path, 'r') do |handle|\n while buffer = handle.read(1024)\n digest << buffer\n end\n end\n digest\n end",
"title": ""
},
{
"docid": "fb7ac66277927a4b08f4f88abe138e63",
"score": "0.6122775",
"text": "def quick_verify\n cached_md5 == remote_md5 and remote_md5 == md5\n end",
"title": ""
},
{
"docid": "6fc63e2d6db0295d4096b0813f8c55ae",
"score": "0.61169213",
"text": "def myaddr_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n agent = Mechanize.new\n begin\n agent.user_agent = $config['HTTP']['HTTP_USER_AGENT']\n if $config['HTTP']['PROXY']\n if $config['HTTP']['PROXY_AUTH']\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i, user=$config['HTTP']['PROXY_USER'], pass=$config['HTTP']['PROXY_PASS'])\n else\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n end\n end\n # Find form, enter hash, run search...\n page = agent.get('http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php')\n search_form = page.form_with(:name => 'f1') # our form\n search_form.md5 = hash_to_find # set hash in form field value\n page = agent.submit(search_form, search_form.buttons.first) # submit form and return new page\n # Check for match found to requesting hash\n checking_hash = /<div class='white_bg_title'><span class='middle_title'>MD5 hash<\\/span>: #{hash_to_find}<\\/div>\\s<br>/\n bad_news = /<div class='error_title'>Hash \"#{hash_to_find}\" not found in database<\\/div>/\n if page.body =~ checking_hash and not page.body =~ bad_news\n if page.body =~ /\\s<div class='white_bg_title'><span class='middle_title'>Hashed string<\\/span>: (.+)<\\/div>/\n plain_jane = $1.to_s.strip.chomp\n if verbose\n print_good(\"Match Found: md5.my-addr.com\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{plain_jane}\".white\n end\n return plain_jane\n end\n end\n rescue OpenSSL::SSL::SSLError,Errno::ETIMEDOUT,Net::HTTP::Persistent::Error,NoMethodError,Zlib::DataError,Mechanize::ResponseCodeError => e\n print_error(\"Problem Communicating with: md5.my-addr.com\") if verbose\n return nil\n end\n print_error(\"No Results from: md5.my-addr.com\") if verbose\n return nil\n else\n print_error(\"#{@hash_type} not supported for: md5.my-addr.com\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "634f8dbc93fc2d46fa4821e4f6a99cbf",
"score": "0.6021174",
"text": "def needs_md5sums\n false\n end",
"title": ""
},
{
"docid": "22a18e1f599c73b088b1b5775fbdf0f8",
"score": "0.5984059",
"text": "def validateMD5Hash(data, hash)\n\t\tnewhash = self.createMD5Hash(data)\n\t\tif newhash == hash\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f34a8658181170da242a8bd27da241b2",
"score": "0.5969473",
"text": "def validate_image_md5sum\n result = true\n if upload_md5sum.present? && save_to_temp_file\n sum = File.open(upload_temp_file) do |f|\n Digest::MD5.hexdigest(f.read)\n end\n if sum == upload_md5sum\n result = true\n else\n errors.add(:image, :validate_image_md5_mismatch.\n t(actual: sum.split.first, expect: upload_md5sum))\n result = false\n end\n end\n result\n end",
"title": ""
},
{
"docid": "cfbfaec8f6c49d8097e6b90563a72393",
"score": "0.59376323",
"text": "def md5?; @md5; end",
"title": ""
},
{
"docid": "89b551901caf91e33327b4f70404c24f",
"score": "0.5913046",
"text": "def file_remote_digestmd5(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::MD5.hexdigest(data)\n end\n return chksum\n end",
"title": ""
},
{
"docid": "97de9627cd56687232694bdc2d9f36ab",
"score": "0.5898007",
"text": "def lookup_local(md5_hash)\n # TODO: Implement local rainbow table lookup\n end",
"title": ""
},
{
"docid": "974da63f1039323c6260cb092f6426a4",
"score": "0.5828522",
"text": "def digest_md5(*files)\n files.flatten.collect { |file| \n File.exists?(file) ? Digest::MD5.hexdigest(File.read(file)) : nil\n }\n end",
"title": ""
},
{
"docid": "761081ed85fb4994e48a83772a721596",
"score": "0.57830125",
"text": "def lookup_remote(md5_hash)\n unhash_data = Scrubyt::Extractor.define do\n fetch \"http://gdataonline.com/qkhash.php?mode=txt&hash=#{md5_hash}\"\n unhash \"//table/tr[2]/td[2]/b\"\n end\n \n doc = Nokogiri::HTML.parse(unhash_data.to_xml)\n doc.xpath('//root/unhash').text.strip rescue nil\n end",
"title": ""
},
{
"docid": "c0e6f82bbf5dfeb6af5ac004bfebf734",
"score": "0.5778007",
"text": "def myers_md5_implementation\n return <<'JS'\n// Joseph Myers' implementation of MD5 in JS\n// http://www.myersdaily.org/joseph/javascript/md5-text.html\nfunction md5cycle(x, k) {\nvar a = x[0], b = x[1], c = x[2], d = x[3];\n\na = ff(a, b, c, d, k[0], 7, -680876936);\nd = ff(d, a, b, c, k[1], 12, -389564586);\nc = ff(c, d, a, b, k[2], 17, 606105819);\nb = ff(b, c, d, a, k[3], 22, -1044525330);\na = ff(a, b, c, d, k[4], 7, -176418897);\nd = ff(d, a, b, c, k[5], 12, 1200080426);\nc = ff(c, d, a, b, k[6], 17, -1473231341);\nb = ff(b, c, d, a, k[7], 22, -45705983);\na = ff(a, b, c, d, k[8], 7, 1770035416);\nd = ff(d, a, b, c, k[9], 12, -1958414417);\nc = ff(c, d, a, b, k[10], 17, -42063);\nb = ff(b, c, d, a, k[11], 22, -1990404162);\na = ff(a, b, c, d, k[12], 7, 1804603682);\nd = ff(d, a, b, c, k[13], 12, -40341101);\nc = ff(c, d, a, b, k[14], 17, -1502002290);\nb = ff(b, c, d, a, k[15], 22, 1236535329);\n\na = gg(a, b, c, d, k[1], 5, -165796510);\nd = gg(d, a, b, c, k[6], 9, -1069501632);\nc = gg(c, d, a, b, k[11], 14, 643717713);\nb = gg(b, c, d, a, k[0], 20, -373897302);\na = gg(a, b, c, d, k[5], 5, -701558691);\nd = gg(d, a, b, c, k[10], 9, 38016083);\nc = gg(c, d, a, b, k[15], 14, -660478335);\nb = gg(b, c, d, a, k[4], 20, -405537848);\na = gg(a, b, c, d, k[9], 5, 568446438);\nd = gg(d, a, b, c, k[14], 9, -1019803690);\nc = gg(c, d, a, b, k[3], 14, -187363961);\nb = gg(b, c, d, a, k[8], 20, 1163531501);\na = gg(a, b, c, d, k[13], 5, -1444681467);\nd = gg(d, a, b, c, k[2], 9, -51403784);\nc = gg(c, d, a, b, k[7], 14, 1735328473);\nb = gg(b, c, d, a, k[12], 20, -1926607734);\n\na = hh(a, b, c, d, k[5], 4, -378558);\nd = hh(d, a, b, c, k[8], 11, -2022574463);\nc = hh(c, d, a, b, k[11], 16, 1839030562);\nb = hh(b, c, d, a, k[14], 23, -35309556);\na = hh(a, b, c, d, k[1], 4, -1530992060);\nd = hh(d, a, b, c, k[4], 11, 1272893353);\nc = hh(c, d, a, b, k[7], 16, -155497632);\nb = hh(b, c, d, a, k[10], 23, -1094730640);\na = hh(a, b, c, d, k[13], 4, 681279174);\nd = hh(d, a, b, c, k[0], 11, -358537222);\nc = hh(c, d, a, b, k[3], 16, -722521979);\nb = hh(b, c, d, a, k[6], 23, 76029189);\na = hh(a, b, c, d, k[9], 4, -640364487);\nd = hh(d, a, b, c, k[12], 11, -421815835);\nc = hh(c, d, a, b, k[15], 16, 530742520);\nb = hh(b, c, d, a, k[2], 23, -995338651);\n\na = ii(a, b, c, d, k[0], 6, -198630844);\nd = ii(d, a, b, c, k[7], 10, 1126891415);\nc = ii(c, d, a, b, k[14], 15, -1416354905);\nb = ii(b, c, d, a, k[5], 21, -57434055);\na = ii(a, b, c, d, k[12], 6, 1700485571);\nd = ii(d, a, b, c, k[3], 10, -1894986606);\nc = ii(c, d, a, b, k[10], 15, -1051523);\nb = ii(b, c, d, a, k[1], 21, -2054922799);\na = ii(a, b, c, d, k[8], 6, 1873313359);\nd = ii(d, a, b, c, k[15], 10, -30611744);\nc = ii(c, d, a, b, k[6], 15, -1560198380);\nb = ii(b, c, d, a, k[13], 21, 1309151649);\na = ii(a, b, c, d, k[4], 6, -145523070);\nd = ii(d, a, b, c, k[11], 10, -1120210379);\nc = ii(c, d, a, b, k[2], 15, 718787259);\nb = ii(b, c, d, a, k[9], 21, -343485551);\n\nx[0] = add32(a, x[0]);\nx[1] = add32(b, x[1]);\nx[2] = add32(c, x[2]);\nx[3] = add32(d, x[3]);\n}\n\nfunction cmn(q, a, b, x, s, t) {\na = add32(add32(a, q), add32(x, t));\nreturn add32((a << s) | (a >>> (32 - s)), b);\n}\n\nfunction ff(a, b, c, d, x, s, t) {\nreturn cmn((b & c) | ((~b) & d), a, b, x, s, t);\n}\n\nfunction gg(a, b, c, d, x, s, t) {\nreturn cmn((b & d) | (c & (~d)), a, b, x, s, t);\n}\n\nfunction hh(a, b, c, d, x, s, t) {\nreturn cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction ii(a, b, c, d, x, s, t) {\nreturn cmn(c ^ (b | (~d)), a, b, x, s, t);\n}\n\nfunction md51(s) {\ntxt = '';\nvar n = s.length,\nstate = [1732584193, -271733879, -1732584194, 271733878], i;\nfor (i=64; i<=s.length; i+=64) {\nmd5cycle(state, md5blk(s.substring(i-64, i)));\n}\ns = s.substring(i-64);\nvar tail = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];\nfor (i=0; i<s.length; i++)\ntail[i>>2] |= s.charCodeAt(i) << ((i%4) << 3);\ntail[i>>2] |= 0x80 << ((i%4) << 3);\nif (i > 55) {\nmd5cycle(state, tail);\nfor (i=0; i<16; i++) tail[i] = 0;\n}\ntail[14] = n*8;\nmd5cycle(state, tail);\nreturn state;\n}\n\n/* there needs to be support for Unicode here,\n * unless we pretend that we can redefine the MD-5\n * algorithm for multi-byte characters (perhaps\n * by adding every four 16-bit characters and\n * shortening the sum to 32 bits). Otherwise\n * I suggest performing MD-5 as if every character\n * was two bytes--e.g., 0040 0025 = @%--but then\n * how will an ordinary MD-5 sum be matched?\n * There is no way to standardize text to something\n * like UTF-8 before transformation; speed cost is\n * utterly prohibitive. The JavaScript standard\n * itself needs to look at this: it should start\n * providing access to strings as preformed UTF-8\n * 8-bit unsigned value arrays.\n */\nfunction md5blk(s) { /* I figured global was faster. */\nvar md5blks = [], i; /* Andy King said do it this way. */\nfor (i=0; i<64; i+=4) {\nmd5blks[i>>2] = s.charCodeAt(i)\n+ (s.charCodeAt(i+1) << 8)\n+ (s.charCodeAt(i+2) << 16)\n+ (s.charCodeAt(i+3) << 24);\n}\nreturn md5blks;\n}\n\nvar hex_chr = '0123456789abcdef'.split('');\n\nfunction rhex(n)\n{\nvar s='', j=0;\nfor(; j<4; j++)\ns += hex_chr[(n >> (j * 8 + 4)) & 0x0F]\n+ hex_chr[(n >> (j * 8)) & 0x0F];\nreturn s;\n}\n\nfunction hex(x) {\nfor (var i=0; i<x.length; i++)\nx[i] = rhex(x[i]);\nreturn x.join('');\n}\n\nfunction md5(s) {\nreturn hex(md51(s));\n}\n\n/* this function is much faster,\nso if possible we use it. Some IEs\nare the only ones I know of that\nneed the idiotic second function,\ngenerated by an if clause. */\n\nfunction add32(a, b) {\nreturn (a + b) & 0xFFFFFFFF;\n}\n\nif (md5('hello') != '5d41402abc4b2a76b9719d911017c592') {\nfunction add32(x, y) {\nvar lsw = (x & 0xFFFF) + (y & 0xFFFF),\nmsw = (x >> 16) + (y >> 16) + (lsw >> 16);\nreturn (msw << 16) | (lsw & 0xFFFF);\n}\n}\nJS\nend",
"title": ""
},
{
"docid": "05289dec936c1b7bd9db115e082e0dc8",
"score": "0.5747714",
"text": "def md5\n @md5 ||= digest(path, :md5)\n end",
"title": ""
},
{
"docid": "80ea6e0fa097b0c4a22540f3f7f500bc",
"score": "0.5739441",
"text": "def get_md5sum(file)\n get_sum(file, 'md5')\n end",
"title": ""
},
{
"docid": "845733567de813c161f62eae0baa4eb8",
"score": "0.5700601",
"text": "def process_line(password)\n md5 = Digest::MD5.hexdigest(password.chop!)\n if $encoded.include? md5 then $digest[md5] = password end\nend",
"title": ""
},
{
"docid": "6331dd09618f608aef895c9b583ff96e",
"score": "0.57002586",
"text": "def gromweb_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n res = @http.get(\"http://md5.gromweb.com/query/#{hash_to_find}\")\n if not res[0].nil? and res[0].strip.chomp != ''\n if verbose\n print_good(\"Match Found: md5.gromweb.com\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{res[0].strip.chomp}\".white\n end\n return res[0]\n else\n print_error(\"No Results from: md5.gromweb.com\") if verbose\n return nil\n end\n else\n print_error(\"#{@hash_type} not supported for: md5.gromweb.com\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "d4637b71cf79ee63a3a20c57dc718d29",
"score": "0.5686413",
"text": "def darkbyte_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5'\n res = @http.get(\"http://md5.darkbyte.ru/api.php?q=#{hash_to_find}\")\n if not res[0].nil? and res[0].strip.chomp != ''\n if verbose\n print_good(\"Match Found: md5.darkbyte.ru\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{res[0].strip.chomp}\".white\n end\n return res[0]\n else\n print_error(\"No Results from: md5.darkbyte.ru\") if verbose\n return nil\n end\n else\n print_error(\"#{@hash_type} not supported for: md5.darkbyte.ru\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "ac94d0eac97db9e1e81b4ef5ec337ddd",
"score": "0.56635207",
"text": "def verifyMD5sum\n\n oldMD5sum = ''\n \n self.audioMD5sum if ! @audioMD5sum # compute MD5sum if it's not computed yet\n\n base = @basename.sub( /(.)\\.[^.]+$/ , '\\1') # remove suffix from audio-file\n base += '.md5' # add new suffix .md5\n md5name = File.join(@dirname,base)\n \n # if a MD5-file doesn't exist, we should create one and return TRUE ...\n if File.exists?(md5name)\n File.open( md5name ,\"r\") { |f| \n oldname,oldMD5sum = f.readline.split # read old MD5-sum\n }\n else\n oldMD5sum = self.writeMD5sum # create MD5-file and return true..\n end\n @audioMD5sum == oldMD5sum\n \n end",
"title": ""
},
{
"docid": "85d49c9409c23432140d9f7d6ff06ae5",
"score": "0.5662279",
"text": "def md5sum(path)\n digest, buf = Digest::MD5.new, \"\"\n File.open(path) do |f|\n while f.read(4096, buf)\n digest.update(buf)\n end\n end\n digest.hexdigest\n end",
"title": ""
},
{
"docid": "b2f7b89f50cd245e724da3041d209d0b",
"score": "0.5657507",
"text": "def md5_sum(key)\n md5 = Digest::MD5.new\n buffer = ''\n with_input_io(key) do |io|\n while io.read(65536, buffer)\n md5 << buffer\n end\n end\n md5.base64digest\n end",
"title": ""
},
{
"docid": "f60ffb34feba6e149e5670da38db33b1",
"score": "0.564629",
"text": "def find_hash(possible_words, known_anagram, known_md5s, start, n = 3)\n cpus = Parallel.processor_count\n puts \"Total number of iteration: #{possible_words.length**n}\"\n puts \"You got #{cpus} cores\"\n\n hash_table = get_hash_table(known_anagram)\n known_hash = get_hash(known_anagram, hash_table)\n\n Parallel.map(possible_words, in_processes: cpus) do |w1|\n possible_words.each do |w2|\n possible_words.each do |w3|\n # Print every ten million iteration\n phrase = \"#{w1} #{w2} #{w3}\"\n\n # Allow only equal size phrases\n next unless phrase.length == known_anagram.length\n\n # Allow only equal hash phrases\n hash = get_hash(phrase, hash_table)\n next unless hash == known_hash\n\n # All only equal md5 phrases\n md5 = Digest::MD5.hexdigest phrase\n next unless known_md5s.include?(md5)\n\n puts \"#{phrase} #{md5} (#{Time.now - start}s)\"\n end\n end\n end\nend",
"title": ""
},
{
"docid": "bf62c3942cf6ee6de3f7a37ca70261ab",
"score": "0.5639859",
"text": "def total_hash_search(hash_to_find=@hash_to_find, stop_on_success=@sos, verbose=true)\n matches={}\n while(true)\n case @hash_type\n when 'MD4'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'MD5'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n\n result = darkbyte_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.darkbyte.ru', result)\n break if stop_on_success\n end\n\n result = gromweb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.gromweb.com', result)\n break if stop_on_success\n end\n\n result = md5comcn_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.com.cn', result)\n break if stop_on_success\n end\n\n result = md5onlinenet_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5online.net', result)\n break if stop_on_success\n end\n\n result = md5onlineorg_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5online.org', result)\n break if stop_on_success\n end\n\n result = myaddr_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.my-addr.com', result)\n break if stop_on_success\n end\n\n result = noisette_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.noisette.ch', result)\n break if stop_on_success\n end\n\n result = netmd5crack_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('netmd5crack.com', result)\n break if stop_on_success\n end\n\n result = sans_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('isc.sans.edu', result)\n break if stop_on_success\n end\n\n result = stringfunction_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('stringfunction.com', result)\n break if stop_on_success\n end\n when 'LM'\n result = it64_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('rainbowtables.it64.com', result)\n break if stop_on_success\n end\n\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'NTLM'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'LM:NTLM'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'MYSQL'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'SHA1'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n\n result = sans_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('isc.sans.edu', result)\n break if stop_on_success\n end\n\n result = stringfunction_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('stringfunction.com', result)\n break if stop_on_success\n end\n end\n break # tried all sites by now...\n end\n return matches\n end",
"title": ""
},
{
"docid": "a245390d813830f3add4a110c5226273",
"score": "0.5629231",
"text": "def find_checksum_by_digest(digest)\n checksum = nil\n checksums.each do |cs|\n if cs.digest == digest\n checksum = cs\n break\n end\n end\n checksum\n end",
"title": ""
},
{
"docid": "7f648f1717b1d78915f262bad1b2838d",
"score": "0.55897814",
"text": "def guess_digest\n matches = dest_glob\n return unless matches.length == 1\n\n # Start and finish of the destination image's hash value\n finish = -name_right.length\n start = finish - 6\n\n # The source image keeps track of this guess, so we hand it off:\n @source.digest_guess = matches.first[start...finish]\n end",
"title": ""
},
{
"docid": "932a983a8a81880f9c36e398eb58a6c8",
"score": "0.5586369",
"text": "def check_hash=(flag)\r\n @conf[:use_md5_digest] = flag\r\n end",
"title": ""
},
{
"docid": "285e580eeb31704dc1215ed9f2a999aa",
"score": "0.5552899",
"text": "def mutate_md5(cell)\n cell ? Digest::MD5.base64digest(cell) : cell\n end",
"title": ""
},
{
"docid": "b3b98dfc0072f602c33a61457e19bd52",
"score": "0.5507236",
"text": "def hash_this(word)\n\t\tdigest = Digest::MD5.hexdigest(word) # get the hex version of the MD5 for the specified string\n\t\tdigest[@offset, @digits].to_i(16) % @max_value # offset it using the initial seed value and get a subset of the md5. then modulo it to get the bit array location\n\tend",
"title": ""
},
{
"docid": "41d91429cdc62220b547078b4e59362d",
"score": "0.55028147",
"text": "def md5(handle, offset, length, quick_hash)\n send_request(FXP_EXTENDED, :string, \"md5-hash-handle\", :int64, offset, :int64, length, :string, quick_hash)\n end",
"title": ""
},
{
"docid": "8bb4425f0d5fc98ccc8c22c4c7baf840",
"score": "0.5467566",
"text": "def already_digested?(name)\n return name =~ /-([0-9a-zA-Z]{7,128})\\.digested/\n end",
"title": ""
},
{
"docid": "3a8b55405d63196d3d21c47e72be2c80",
"score": "0.54611105",
"text": "def md5_hash(data)\n md5 = Digest::MD5.new\n md5 << data\n md5.hexdigest\n end",
"title": ""
},
{
"docid": "0f48f1a357aa690a395014f8f745a8ee",
"score": "0.5458338",
"text": "def createMD5Hash(data)\n\t\treturn Digest::MD5.digest(data)\n\tend",
"title": ""
},
{
"docid": "545466fe9c94a5a29454396a50400e9b",
"score": "0.5455476",
"text": "def file_outdated?(path, expected_md5sum)\n return true unless File.exist?(path)\n\n md5 = Digest::MD5.new\n File.open(path, \"r\") do |file|\n while (chunk = file.read(1024))\n md5.update chunk\n end\n end\n md5.to_s != expected_md5sum\n end",
"title": ""
},
{
"docid": "99275350554b9f4ffe1ef3ae3bab42f6",
"score": "0.5449912",
"text": "def crack index\n\thash = $hashes[index]\n\tfound = false\n\t#try to load the dictionary file\n\tif File.exist? 'dictionary.txt'\n\t\tdictionary = File.open 'dictionary.txt'\n\telse\n\t\tputs 'Could not find dictionary.txt! Aborting.'\n\t\treturn\n\tend\n\n\tstart = Time.now\n\t#check the hash we are on against hashes of passwords from the dictionary until we find a match.\n\tdictionary.each_line do |line|\n\t\tline.chomp!\n\t\tif (Digest::MD5.hexdigest line).eql? hash\n\t\t\tfinish = Time.now\n\t\t\tputs \"\\nHash: #{hash}\"\n\t\t\tputs \"Password discovered in #{finish - start} seconds.\"\n\t\t\tputs \"Password: #{line}\"\n\t\t\tfound = true\n\t\t\tbreak\n\t\tend\n\tend\n\t#when we get here, we've either found a match or exhausted all our options.\n\t#print the disappointment if no match was found.\n\tunless found\n\t\tfinish = Time.now\n\t\tputs \"\\nHash: #{hash}\"\n\t\tputs \"#{finish - start} seconds have elapsed.\"\n\t\tputs 'The password could not be found.'\n\tend\nend",
"title": ""
},
{
"docid": "299026eac56779225ab4861cdc316a19",
"score": "0.5443935",
"text": "def to_md5(pass)\r\n return Digest::MD5.hexdigest(pass)\r\nend",
"title": ""
},
{
"docid": "7bc509398ee0f2b149d6dc3c77655743",
"score": "0.5421794",
"text": "def md5_list\n @list + '_MD5'\n end",
"title": ""
},
{
"docid": "fa475a54e1a64229c1ac948501e86cd6",
"score": "0.54184973",
"text": "def get_md5(fname)\n Digest::MD5.hexdigest(File.read(fname))\nend",
"title": ""
},
{
"docid": "bac29f31ed90ad4364ad8cb213edd132",
"score": "0.53967905",
"text": "def verify_fifth_pipeset(param, block)\n return 1 unless param =~ /^[a-f0-9]{1,4}$/\n\n # remove last pipeset\n block = block.split('|')\n block.pop\n block = block.join('|')\n\n # counter for sum\n counter = 0\n # Unpack each character via U* (string_to_hash.unpack('U*')), thus converting them to its UTF-8 value\n block = block.unpack('U*')\n # For each value in the string, x, perform the following calculation ((x**3000) + (x**x) - (3**x)) * (7**x) and\n # store that value\n # Sum up all of those values\n block.each do |val|\n temp = ((val**3000) + (val**val) - (3**val)) * (7**val)\n counter += temp\n end\n\n # Determine that value modulo 65536\n mod = counter % 65_536\n\n # Return the resulting value as a string version of the number in base-16 (hexadecimal)\n result = mod.to_s(16) #=> \"a\"\n result = result.delete('\\n')\n param = param.gsub(\"\\n\",\"\")\n\n # check this hash against the hash given in the block\n return 2 if param == result\n\n 3\n end",
"title": ""
},
{
"docid": "f164058c74efb0eab713b3b06f3175c6",
"score": "0.5390341",
"text": "def md5\n @gapi[\"md5Hash\"]\n end",
"title": ""
},
{
"docid": "b902f749a626c273be6244847d807e47",
"score": "0.5382699",
"text": "def md5 hash\n\t\treturn Digest::MD5.hexdigest(hash.to_s).to_s\n\tend",
"title": ""
},
{
"docid": "0df4b251478567a36f996407a91aab97",
"score": "0.53684664",
"text": "def fetch(tarball, url, md5)\n if !File.exist?(tarball)\n puts \"fetching from #{url}\"\n puts \"progress messages should appear...\"\n perms = $platform == \"Windows\" ? \"wb\" : \"w\"\n totalSize = 0\n lastPercent = 0\n interval = 5\n f = File.new(tarball, perms)\n f.write(open(url,\n :content_length_proc => lambda {|t|\n if (t && t > 0)\n totalSize = t\n STDOUT.printf(\"expect %d bytes, percent downloaded: \",\n totalSize)\n STDOUT.flush\n else \n STDOUT.print(\"unknown size to download: \")\n end\n },\n :progress_proc => lambda {|s|\n if (totalSize > 0)\n percent = ((s.to_f / totalSize) * 100).to_i\n if (percent/interval > lastPercent/interval)\n lastPercent = percent\n STDOUT.printf(\"%d \", percent)\n STDOUT.printf(\"\\n\") if (percent == 100)\n end\n else\n STDOUT.printf(\".\")\n end\n STDOUT.flush\n }).read)\n f.close()\n s = File.size(tarball)\n if (s == 0 || (totalSize > 0 && s != totalSize))\n puts \"download failed\"\n FileUtils.rm_f(tarball)\n exit 1\n end\n\n # now let's check the md5 sum\n calculated_md5 = Digest::MD5.hexdigest(File.open(tarball, \"rb\") {\n |f| f.read\n })\n if calculated_md5 != md5\n puts \"md5 mismatch, tarball is bogus, delete and retry\"\n puts \"(got #{calculated_md5}, wanted #{md5})\"\n exit 1\n else\n puts \"md5 validated! (#{calculated_md5} == #{md5})\"\n end\n end\nend",
"title": ""
},
{
"docid": "102132bb9e6bbde16031f4884deceb62",
"score": "0.53665775",
"text": "def md5_check(file_path, file_md5)\n m = Digest::MD5.file(file_path)\n return true if m.hexdigest == file_md5\n false\n end",
"title": ""
},
{
"docid": "754fb53c87c27e0748cda1d5efb72926",
"score": "0.5364631",
"text": "def upstream_md5=( checksum )\n @digest = Crate::Digest.md5( checksum )\n end",
"title": ""
},
{
"docid": "3adbec47a1d911e42f5fd1d552f49441",
"score": "0.5362941",
"text": "def get_file_hash(fullPath)\n contents = File.read(fullPath)\n fileHash = Digest::MD5.hexdigest(contents)\n return fileHash\nend",
"title": ""
},
{
"docid": "e8614cab6725c39ebcb6b47cd677a81d",
"score": "0.5361134",
"text": "def to_md5(pass)\n return Digest::MD5.hexdigest(pass)\nend",
"title": ""
},
{
"docid": "f2ccfade6bfc0e84c9fbb5deef2a77bf",
"score": "0.5350493",
"text": "def check_digests(streamer_response:, file_model:)\n out = streamer_response\n upload = file_model\n if out[:response].nil? || out[:response][:checksum].nil?\n raise FileError, \"Error streaming file to Zenodo. No md5 digest returned:\\n#{out[:response]}\\nFile:#{upload.inspect}\"\n end\n\n if out[:response][:checksum] != \"md5:#{out[:digests]['md5']}\"\n raise FileError, \"Error MD5 digest doesn't match zenodo:\\nResponse: #{out[:response][:checksum]}\\nCalculated: md5:#{out[:digests]['md5']}\"\n end\n\n return unless upload.digest_type.present? && upload.digest.present? && out[:digests][upload.digest_type] != upload.digest\n\n raise FileError, \"Error #{upload.digest_type} digest doesn't match database value:\\nCalculated:#{out[:digests][upload.digest_type]}\\n\" \\\n \"Database: #{upload.digest}\"\n end",
"title": ""
},
{
"docid": "15c34be60c729a874e77f0fbc19a06d0",
"score": "0.5349192",
"text": "def generate_md5(hash, keys)\n data = keys.map{|key|\n extract_key(hash, key)\n }\n Digest::MD5.hexdigest( keys_flat data )\n end",
"title": ""
},
{
"docid": "b4c099986ac7225043b5f7b677579c2f",
"score": "0.5338288",
"text": "def hash\n Digest::MD5.hexdigest(abs_filepath)[0..5]\n end",
"title": ""
},
{
"docid": "17a2067d0303090a163fcf3caaf66790",
"score": "0.5332188",
"text": "def md5_sum(file_name)\n dst_path = \"#{self.path}#{file_name}\"\n cmd = self.class.curr_host == host ?\n \"find #{dst_path.shellescape} -type f -exec md5sum {} \\\\; | awk '{print $1}' | sort | md5sum\" :\n \"ssh -q -oBatchMode=yes -oStrictHostKeyChecking=no #{self.host} \\\"find #{dst_path.shellescape} -type f -exec md5sum {} \\\\; | awk '{print \\\\$1}' | sort | md5sum\\\"\"\n r = `#{cmd} 2>&1`\n raise r if $?.exitstatus != 0\n r.to_s[0..31]\n end",
"title": ""
},
{
"docid": "17a2067d0303090a163fcf3caaf66790",
"score": "0.5332188",
"text": "def md5_sum(file_name)\n dst_path = \"#{self.path}#{file_name}\"\n cmd = self.class.curr_host == host ?\n \"find #{dst_path.shellescape} -type f -exec md5sum {} \\\\; | awk '{print $1}' | sort | md5sum\" :\n \"ssh -q -oBatchMode=yes -oStrictHostKeyChecking=no #{self.host} \\\"find #{dst_path.shellescape} -type f -exec md5sum {} \\\\; | awk '{print \\\\$1}' | sort | md5sum\\\"\"\n r = `#{cmd} 2>&1`\n raise r if $?.exitstatus != 0\n r.to_s[0..31]\n end",
"title": ""
},
{
"docid": "4a996a08c92886aea8de632ab02a6f06",
"score": "0.53265834",
"text": "def send_hashes(event)\n levels = MappackLevel.where('mappack_id > 0')\n count = levels.count\n res = levels.each_with_index.select{ |l, i|\n dbg(\"Hashing level #{i} / #{count}...\", newline: false, pad: true)\n !l.compare_hashes\n }.map{ |map, i| map.name }\n event << \"There are #{res.size} levels with differing hashes:\"\n res.size <= 20 ? event << format_block(res.join(\"\\n\")) : send_file(event, res.join(\"\\n\"))\nrescue => e\n lex(e, \"Error getting hash discrepancies.\", event: event)\nend",
"title": ""
},
{
"docid": "03972cc4d9da63e8fc1b5e080d3906f1",
"score": "0.5323097",
"text": "def md5sum\n @md5sum ||= Digest::MD5.hexdigest(self.to_checksum_string)\n end",
"title": ""
},
{
"docid": "ef1c8b5dcc211c73bb41550a5744bcea",
"score": "0.53196836",
"text": "def md5(string)\n\tDigest::MD5.hexdigest(string)\nend",
"title": ""
},
{
"docid": "776ff4db9f38ed4c982baaf37b94d2ca",
"score": "0.53186494",
"text": "def bear_digests()\n @stomach.empty?()\n end",
"title": ""
},
{
"docid": "95e7a1e0b01239293160de111d41a383",
"score": "0.53166926",
"text": "def find_password(string, count, add_function, initial_collection, initial_counter = 0)\n digester = lazy_room_digester(string, initial_counter)\n result = initial_collection\n while result.size < count\n digest = digester.first\n if digest.slice(0,5) == \"00000\"\n result = add_function.call(result, digest)\n end\n digester = digester.rest\n end\n result\nend",
"title": ""
},
{
"docid": "f98cbda0bd10a6336cde7a40a2f1a6c5",
"score": "0.5313668",
"text": "def stringfunction_hash_search(hash_to_find=@hash_to_find, verbose=true)\n if @hash_type == 'MD5' or @hash_type == 'SHA1'\n agent = Mechanize.new\n begin\n agent.user_agent = $config['HTTP']['HTTP_USER_AGENT']\n if $config['HTTP']['PROXY']\n if $config['HTTP']['PROXY_AUTH']\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i, user=$config['HTTP']['PROXY_USER'], pass=$config['HTTP']['PROXY_PASS'])\n else\n agent.set_proxy($config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n end\n end\n found=false\n # Find form, enter hash, run search...\n if @hash_type == 'SHA1'\n page = agent.get('http://www.stringfunction.com/sha1-decrypter.html')\n search_form = page.form_with( :action => \"./sha1-decrypter.html\" )\n search_form.string = hash_to_find\n else\n page = agent.get('http://www.stringfunction.com/md5-decrypter.html')\n search_form = page.form_with( :action => \"./md5-decrypter.html\" )\n search_form.string_md5 = hash_to_find\n end\n button = search_form.button_with(:value=>'Decrypt')\n page = agent.submit(search_form, button) # submit form and return new page\n if @hash_type == 'SHA1'\n if page.body =~ /<textarea class=\"textarea-input-tool-b\" rows=\"10\" cols=\"50\" name=\"result\">(.+)\\s+<\\/textarea>/\n plain_jane = $1.strip.chomp\n found=true\n end\n else\n if page.body =~ /<textarea class=\"textarea-input-tool-b\" rows=\"10\" cols=\"50\" name=\"result\" .+\">(.+)<\\/textarea>/\n plain_jane = $1.strip.chomp\n found=true\n end\n end\n if found\n if verbose\n print_good(\"Match Found: stringfunction.com\")\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Hash: #{hash_to_find}\".white\n puts \" [\".light_green + \"+\".white + \"] \".light_green + \"Plain-Text: #{plain_jane}\".white\n end\n return plain_jane\n end\n rescue OpenSSL::SSL::SSLError,Errno::ETIMEDOUT,Net::HTTP::Persistent::Error,NoMethodError,Zlib::DataError,Mechanize::ResponseCodeError => e\n print_error(\"Problem Communicating with: stringfunction.com\") if verbose\n return nil\n end\n print_error(\"No Results from: stringfunction.com\") if verbose\n return nil\n else\n print_error(\"#{@hash_type} not supported for: stringfunction.com\") if verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "98e06422db28f597bb2113d61c83abe8",
"score": "0.5288836",
"text": "def verify_hash_action_notify( file )\n hash = @hasher.generate_hash( file )\n res = @dbase.search_hashes( file ) \n\n unless hash.to_s.eql?( res[\"hash\"] ) \n \n puts \"Host:\\t\\t#{res[\"host\"]}\"\n puts \"File:\\t\\t#{file}\"\n puts \"Database date:\\t#{res[\"date\"]}\"\n puts \"Current date:\\t#{Time.now}\"\n puts \"Old hash:\\t#{res[\"algo\"]},\\t#{res[\"hash\"]}\"\n puts \"New hash:\\t#{@hasher.algo},\\t#{hash.to_s}\"\n puts \"\"\n \n end\nend",
"title": ""
},
{
"docid": "5c699d8b5dd5d34b6b32ba4c01a1c27e",
"score": "0.52585894",
"text": "def _hash_digest(key)\n m = Digest::MD5.new\n m.update(key)\n\n # No need to ord each item since ordinary array access\n # of a string in Ruby converts to ordinal value\n return m.digest\n end",
"title": ""
},
{
"docid": "8431f71ea0fb8a673e9deba0b53b5c60",
"score": "0.52509266",
"text": "def find_nonce(blob)\r\n $status = \"Mining Started\"\r\n puts \"Mining Started\".blue\r\n start_time = Time.now\r\n nonce = \"0\"\r\n loop do\r\n nonce = rand(0..9999999999).to_s\r\n hash = Digest::SHA256.new.hexdigest(blob + nonce)\r\n break if (hash.start_with?(\"0\" * NONCE_ZEROES))\r\n end\r\n end_time = Time.now\r\n $status = \"Mining Ends in #{end_time - start_time} seconds\"\r\n puts \"Mining Ends in #{end_time - start_time} seconds\".blue\r\n return nonce\r\nend",
"title": ""
},
{
"docid": "1b927e87a8e02ff993b2df111f11b360",
"score": "0.5236475",
"text": "def md5_of_body\n data[:md5_of_body]\n end",
"title": ""
},
{
"docid": "386a148d86638d52801f824b3be69382",
"score": "0.5236361",
"text": "def md5; Digest::MD5.file(fname).hexdigest; end",
"title": ""
},
{
"docid": "6af4d8738bdf40e32a6872140bc6e2f1",
"score": "0.5226977",
"text": "def _md5(str)\n js_context.call('newrank_md5', str, bare: true)\n end",
"title": ""
},
{
"docid": "622014d92907a74203987c22be74e97e",
"score": "0.5226255",
"text": "def digest\n Digest::MD5.file(file).hexdigest\n end",
"title": ""
},
{
"docid": "90863d0debac66ccf2aaa959b84d42a5",
"score": "0.52260727",
"text": "def exists?\n @redis.sismember md5_list, @md5_sum\n end",
"title": ""
},
{
"docid": "fc5be37a9b1843e4067dc4b2aec42ee7",
"score": "0.5221266",
"text": "def findSmallHash(f)\r\n return Digest::SHA1.file(f).hexdigest()\r\nend",
"title": ""
},
{
"docid": "3dd2307928b736568949149956c4b68c",
"score": "0.5215336",
"text": "def challenge5(s, k)\n Utils::HexString.from_bytes(CryptUtil.xor(s.bytes, k))\n end",
"title": ""
},
{
"docid": "bccce22a2cec72c2871fb240fb6b5ed3",
"score": "0.5214262",
"text": "def find_loop_size(public_key)\n value = 1\n (1..).find do |loop_size|\n value = value * 7 % 20_201_227\n value == public_key\n end\nend",
"title": ""
},
{
"docid": "eee75ee0d9a4281d6cf4236f60c32c6d",
"score": "0.5212081",
"text": "def step_5\n\t\t@keystream_num_array.each_with_index do |num, index|\n\t\t\tsum = num + @message_num_array[index]\n\t\t\tif sum > 26\n\t\t\t\tsum -= 26\n\t\t\tend\n\t\t\t@summed << sum\n\t\tend\n\t\t@summed\n\tend",
"title": ""
},
{
"docid": "14faddafde19fc94509f79128378e842",
"score": "0.5192361",
"text": "def check_message_id_md5\n return true if message_id.blank?\n\n self.message_id_md5 = Digest::MD5.hexdigest(message_id.to_s)\n end",
"title": ""
},
{
"docid": "cc2e49c3e73f7a09b1e03dfe48995c46",
"score": "0.5189769",
"text": "def md5 path\n return unless File.file?(path)\n self.md5s[path] ||= Digest::MD5.file(path).hexdigest[0...8]\n end",
"title": ""
},
{
"docid": "7e55cdb300171b688437913d69320af2",
"score": "0.51827115",
"text": "def for?(data)\n @id == DigestGenerator.digest(data)\n end",
"title": ""
},
{
"docid": "828c374515e14211f6d381a59aad1ee6",
"score": "0.51817006",
"text": "def digest\n Digest::MD5.digest(blob)\n end",
"title": ""
},
{
"docid": "030d6560cb08e0e197910ba7b1a3697a",
"score": "0.51777816",
"text": "def collision_attack(bit_size, set_index = 0)\n # randomize the set of preimages to make each trial different\n digests = Array.new(SHUFFLED_RAND_STRINGS[set_index].size)\n found = false\n used_digests=0\n # for every new digest computed, compare it against the list of known digests to find a match\n SHUFFLED_RAND_STRINGS[set_index].each_with_index do |rstring1, index1|\n digests[index1] = create_digest(rstring1, bit_size)\n used_digests += 1\n # the '-1' prevents the digest from being compared with itself\n (index1-1).times.each do |index2|\n if digests[index1] == digests[index2] then\n found = true\n break\n end\n end\n break if found\n end\n raise \"no collision found\" if !found\n used_digests\nend",
"title": ""
},
{
"docid": "f7ddd4f71f6b2937d804d471d7768846",
"score": "0.517127",
"text": "def check_for_correct_output\n\t\tif Digest::MD5.hexdigest(File.read(OUTFILE)) == CORRECT_MD5\n\t\t\tputs 'Output is correct!'\n\t\telse\n\t\t\tputs 'Output is incorrect. Continue debugging.'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b048dd364c34f928d08c321a23eeb964",
"score": "0.5139599",
"text": "def capable_cram_md5_auth?; end",
"title": ""
},
{
"docid": "26eb8e30a434dc9fc32025b8bed8fa9d",
"score": "0.51368725",
"text": "def ssh_md5sum_file(file)\n df = \"\"\n Net::SSH.start(@ip, \"pipeline\") do |ssh|\n df = ssh.exec! \"md5sum #{file}\"\n end\n df\n end",
"title": ""
},
{
"docid": "8f6eed81043b80f65bd7761891705aaf",
"score": "0.51289546",
"text": "def hash_file(name, length)\n pieces = String.new\n file = ::File.open(name, 'r')\n pieces << Digest::SHA1.digest(file.read(length)) until file.eof?\n file.close\n pieces\n end",
"title": ""
},
{
"docid": "8cb558fe026869682c09cbf56865639f",
"score": "0.5122931",
"text": "def chkall\n (1..@@pow2_N).to_a.each do |i|\n h = sha32b(\"#{i}\")\n @allhash[h] = 0 if !@allhash[h]\n @allhash[h] += 1\n end\n @allhash.size\n end",
"title": ""
},
{
"docid": "f3779f8d1cd1ec974803016e7ba552a3",
"score": "0.5115578",
"text": "def uri_to_md5 (uri)\n Digest::MD5.hexdigest(uri.to_s)\n end",
"title": ""
},
{
"docid": "3aefe29cbcd83bdefc20414d5573a4b9",
"score": "0.5108751",
"text": "def verify_hash\r\n raise \"Line #{total_block_number}: hash was incorrectly calculated\" unless @current_hash == @computed_hash\r\n\r\n true\r\n end",
"title": ""
},
{
"docid": "e69509bdaf74e35a4d4e973190b308ec",
"score": "0.51003075",
"text": "def load_checksums(dobj)\n log ' - load_checksums()'\n dobj.object_files.each { |file| file.provider_md5 = file.md5 }\n end",
"title": ""
},
{
"docid": "be03ac87e33619fec6977e106c9dcbd6",
"score": "0.5097725",
"text": "def find_if_changed(record)\n id, md5sum = id_and_md5sum_for(record)\n return false if md5sum == record.md5sum\n find(id)\n end",
"title": ""
},
{
"docid": "a89b3b3b6aab8bccb30535e89e87bd0a",
"score": "0.50923544",
"text": "def has_checksum?(digest)\n find_checksum_by_digest(digest).nil? == false\n end",
"title": ""
},
{
"docid": "a2b6569ee704df243f6062d424687c2b",
"score": "0.50923455",
"text": "def hashes_match?\n ar = @ar.clone\n\n digest_value = ar.at_css(\n 'xmlns|DigestValue',\n 'xmlns' => 'http://www.w3.org/2000/09/xmldsig#'\n ).content.strip\n\n ar.at_css(\n \"xmlns|Signature\",\n 'xmlns' => 'http://www.w3.org/2000/09/xmldsig#'\n ).remove\n\n actual_digest = calculate_digest(ar)\n\n if digest_value == actual_digest\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "382bc5056f67ff488d0d25f832dbb508",
"score": "0.5091293",
"text": "def fifth_anagram?(str, str2)\n return false unless str.length == str2.length\n str_hash = hash_creator(str)\n\n str_hash.each do |k,v|\n return false unless str.include?(k)\n if str2.count(k) != v\n return false\n end\n end\n\n true\nend",
"title": ""
},
{
"docid": "5a6403dfeba5694ffd726540b601cfc7",
"score": "0.509058",
"text": "def verify_prev_hash_match(maps)\n # special case for first line\n return false if maps[0][:id].to_i != 0\n\n # now start at the 1st line\n (1...maps.length).each do |i|\n prev_hash = maps[i][:prev_hash]\n curr_hash = maps[i - 1][:hash]\n # check that they match\n if prev_hash != curr_hash\n puts \"Line #{i}: Previous hash was #{prev_hash}, should be #{curr_hash}.\\nBLOCKCHAIN INVALID\"\n return false\n end\n # check that the length of each is not more than 4\n if prev_hash.length > 4\n puts \"Line #{i}: Previous hash #{prev_hash} is too long.\\nBLOCKCHAIN INVALID\"\n return false\n end\n if curr_hash.length > 4\n puts \"Line #{i}: Current hash #{curr_hash} is too long.\\nBLOCKCHAIN INVALID\"\n return false\n end\n # check the formatting of the hash\n prev_hash.delete!('abcdef0123456789')\n curr_hash.delete!('abcdef0123456789')\n unless prev_hash.empty?\n puts \"Line #{i}: Previous hash #{prev_hash} contains invalid characters.\\nBLOCKCHAIN INVALID\"\n return false\n end\n unless curr_hash.empty?\n puts \"Line #{i}: Current hash #{curr_hash} contains invalid characters.\\nBLOCKCHAIN INVALID\"\n return false\n end\n end\n\n # If nothing wrong, return true\n true\nend",
"title": ""
},
{
"docid": "114ad70aaf1b8e3ded473d2a54ab6a5a",
"score": "0.50812215",
"text": "def calculate_checksum(file)\n @lookup_checksums[file] = Digest::MD5.hexdigest(File.read(file, mode: \"rb\")) rescue \"\"\n end",
"title": ""
},
{
"docid": "5b3c224348b1f179a53a2d4797749570",
"score": "0.50782835",
"text": "def find_duplicates(hash, i = 0, largest_duplicates = [[], []])\n # Array of files with same size. Will return [key, value]\n files_with_same_size_1 = hash.max_by(i+2){|key, value| value.length }[i]\n files_with_same_size_2 = hash.max_by(i+2){|key, value| value.length }[i+1]\n\n # Array of files with identical MD5. Quite enough to search for identical files\n files_with_same_hash = ArrayToMD5(files_with_same_size_1).max_by{|key, value| value.length }\n\n if largest_duplicates[1].length < files_with_same_hash[1].length\n largest_duplicates = files_with_same_hash\n end\n\n if largest_duplicates[1].length > files_with_same_size_2[1].length\n return largest_duplicates\n else\n find_duplicates(hash, i+1, largest_duplicates)\n end\nend",
"title": ""
},
{
"docid": "0b4385842a345971e11cf4506abc577c",
"score": "0.5076795",
"text": "def solve_block(input, target, mode)\n nonce = 0\n solved = false\n hash = \"\"\n loop do\n input_with_nonce = input + nonce.to_s\n hash = get_hash(input_with_nonce)\n nonce = nonce + 1\n\n if (mode == \"zero\") then\n if (hash.start_with?(target)) then\n solved = true\n end\n else\n if (hash.hex < target) then\n solved = true\n end\n end\n\n if (solved) then\n return [hash, nonce]\n end\n end\nend",
"title": ""
},
{
"docid": "da0d1ff6419946aa80cccfa33d48447d",
"score": "0.50729585",
"text": "def digest(data); end",
"title": ""
},
{
"docid": "e4a024117edffd78323ff5e4d5607281",
"score": "0.50720143",
"text": "def md5sum\n Digest::MD5.hexdigest(self)\n end",
"title": ""
}
] |
927af8dd2a5bef52a69c0f873dbbbdff
|
array of all parent commits source://git//lib/git/object.rb189
|
[
{
"docid": "92256b3e26786ebd333c3c8a3780d295",
"score": "0.0",
"text": "def parents; end",
"title": ""
}
] |
[
{
"docid": "940cb9fa0b8fb48ca4bd17206e3ad3da",
"score": "0.7883378",
"text": "def parents\n check_commit\n @parents ||= @parent_data.map{ |sha| TinyGit::Object::Commit.new(@base, sha) } \n end",
"title": ""
},
{
"docid": "172f613790b2a42eac7813dcb88ef6d6",
"score": "0.7360672",
"text": "def parents\n @parents ||= begin\n arr = [@options[:parent] || @wiki.repo.commit(@wiki.ref)]\n arr.flatten!\n arr.compact!\n arr\n end\n end",
"title": ""
},
{
"docid": "bf459ec8a99261c5a4540f36d1b25b3e",
"score": "0.7310947",
"text": "def get_commit_parents(commit_hash)\n out = `git show #{commit_hash} --format=\"%P\" --no-patch`.strip\n parents = out.strip.split(' ')\n return parents\nend",
"title": ""
},
{
"docid": "3c9b2b607594b5ebcf2a2facb03a6b5f",
"score": "0.69711095",
"text": "def commits\n head.and_ancestors.order(n: :asc)\n end",
"title": ""
},
{
"docid": "ebfdd3f4d9d15737ac976840447b35a4",
"score": "0.6966324",
"text": "def ancestors(commit, seen)\n worklist = [commit]\n worklist.each do |cm|\n if not seen.include?(cm.sha)\n seen.add(cm.sha)\n print $headnm, \": \", cm, \" --> \", seen.length(), \"\\n\" if DEBUG\n cm.parents.each do |parent| \n worklist << parent\n end\n end\n end\n seen\nend",
"title": ""
},
{
"docid": "007923272fbd8aec5491db46f8e66a61",
"score": "0.687982",
"text": "def walk_parents(index, count)\n enumerator = Commit::Enumerator.new self\n index.times { enumerator.next } \n commits = []\n count.times do\n break unless commit = enumerator.next\n commits << commit\n end\n commits\n end",
"title": ""
},
{
"docid": "7ae9186bff6cb56985ca897430a028b4",
"score": "0.6864449",
"text": "def walk_parents(index, count)\n enumerator = Commit::Enumerator.new self\n index.times { enumerator.next }\n commits = []\n count.times do\n break unless commit = enumerator.next\n commits << commit\n end\n commits\n end",
"title": ""
},
{
"docid": "d788c23590a3501783d275dbdc2cb99e",
"score": "0.68360525",
"text": "def resolve_parents()\n @commits.each_value do |commit|\n commit.parents.keys.each do |parent_hash|\n c = @commits.fetch(parent_hash)\n commit.set_parent(c) # Link the commit object to its parent\n end\n end\n end",
"title": ""
},
{
"docid": "5a6e3397055dcce2b9aa2401713d79ec",
"score": "0.6773888",
"text": "def commit_entries(owner, repo ,shas)\n shas.reduce([]) { |acc, x|\n a = mongo['commits'].find_one({:sha => x})\n\n if a.nil?\n a = github_commit(owner, repo, x)\n end\n\n acc << a unless a.nil? or a.empty?\n acc\n }.select { |c| c['parents'] }\n end",
"title": ""
},
{
"docid": "0b302b8a0432222355b15efcd1c5fcc1",
"score": "0.66834426",
"text": "def commits\n @commits ||= _collect(:commit, 'repos.commits.all')\n end",
"title": ""
},
{
"docid": "ed19db0d62fe84882f7ac52e8d4c2a2d",
"score": "0.66796356",
"text": "def list commits\n \n end",
"title": ""
},
{
"docid": "37f86cc5ac846bd9e1113226c06f14e3",
"score": "0.6624926",
"text": "def commit_entries(owner, repo, shas)\n shas.reduce([]) { |acc, x|\n a = mongo['commits'].find({:sha => x}).limit(1).first\n\n if a.nil?\n a = github_commit(owner, repo, x)\n end\n\n acc << a unless a.nil? or a.empty?\n acc\n }.select { |c| c['parents'] }\n end",
"title": ""
},
{
"docid": "c25b988859a4a8534b21b36c4313df13",
"score": "0.6624815",
"text": "def parents(obj)\n result = []\n cursor = obj\n while (cursor = cursor.parent)\n result << cursor\n end\n result\n end",
"title": ""
},
{
"docid": "d8e2c8137e3f84891a7cd320974f5d66",
"score": "0.6620877",
"text": "def commits\n allow_quarantine = true\n\n newrevs = @changes.map do |change|\n oldrev = change[:oldrev]\n newrev = change[:newrev]\n\n next if blank_rev?(newrev)\n\n # In case any of the old revisions is blank, then we cannot reliably\n # detect which commits are new for a given change when enumerating\n # objects via the object quarantine directory given that the client\n # may have pushed too many commits, and we don't know when to\n # terminate the walk. We thus fall back to using `git rev-list --not\n # --all`, which is a lot less efficient but at least can only ever\n # returns commits which really are new.\n allow_quarantine = false if allow_quarantine && blank_rev?(oldrev)\n\n newrev\n end.compact\n\n return [] if newrevs.empty?\n\n @commits ||= project.repository.new_commits(newrevs, allow_quarantine: allow_quarantine)\n end",
"title": ""
},
{
"docid": "01101853c2e41621c1096dd1b6158d73",
"score": "0.65746355",
"text": "def all_commits\n # ac = []\n # self.each do |commits|\n # ac += commits\n # end\n # ac\n @commits\n end",
"title": ""
},
{
"docid": "ce15b7efe9ba0e41d551a371a384ef2b",
"score": "0.65461016",
"text": "def git_object_ids__HEAD\n [\n \"HEAD~0\", # first object id ...\n ]\n end",
"title": ""
},
{
"docid": "5b5ad9baa8958d5fc9548802dac913f7",
"score": "0.65460783",
"text": "def inception_branches\n commit = current_branch.commit\n\n # Look through the parent history of this branch\n while true\n matching_branches = long_running_branches.select { |branch| commit.id == branch.commit.id }\n return matching_branches unless matching_branches.empty?\n commit = commit.parents.first\n end\n []\n end",
"title": ""
},
{
"docid": "e4718dd165a5118b7b8de8dba33ef623",
"score": "0.6529955",
"text": "def repo_committers\n committers = `git shortlog -sn`.split(/\\n/)\n @repo_committers = committers.values_at(0..2)\n end",
"title": ""
},
{
"docid": "5898f40f0a3f163c21d897b41515c71d",
"score": "0.65296197",
"text": "def related_reviewed_objects commits\n @all_commits.keep_if do |commit|\n commits.index(commit.to_s)\n end\n end",
"title": ""
},
{
"docid": "5898f40f0a3f163c21d897b41515c71d",
"score": "0.65296197",
"text": "def related_reviewed_objects commits\n @all_commits.keep_if do |commit|\n commits.index(commit.to_s)\n end\n end",
"title": ""
},
{
"docid": "350fe00d158774f716fc8f824210b2cb",
"score": "0.64741445",
"text": "def heads_parents\n heads_parents_log = GitViz::GitCommands::git :log, @ref, \"--pretty=format:\\\"<%h><%p>\\\"\"\n heads_parents = heads_parents_log.map{|line| line.scan(/^<(.*?)><(.*?)>/).flatten}\n heads_parents = heads_parents.map{|head, parents| [head, parents.split(' ')]}\n heads_parents = heads_parents.first(limit) if limit\n heads_parents\n end",
"title": ""
},
{
"docid": "3a8c8900fb23afa18d347c3890caff92",
"score": "0.64633864",
"text": "def to_ary\n [@commit, @parent, @tree, @date, @author, @email, @summary, @message, @files]\n end",
"title": ""
},
{
"docid": "ada4f3a7b1ab74e1df99d55228da5353",
"score": "0.64558643",
"text": "def commits\n repo.commits\n end",
"title": ""
},
{
"docid": "038498c7e9258d4503cb5b76a33e948a",
"score": "0.64500535",
"text": "def parents\n @parents ||= begin\n parents = []\n \n nodes.each_value do |node|\n if node.current? && node.children.include?(sha)\n parents << node.sha\n end\n end if current?\n \n parents\n end\n end",
"title": ""
},
{
"docid": "3a233bfe0f7f2c64a701e1bbe9fbb3d0",
"score": "0.6439024",
"text": "def commits(repo)\n repo.rels[:commits].get.data\n end",
"title": ""
},
{
"docid": "ca8b85af89eb545cde7e761fa4f89f70",
"score": "0.6422347",
"text": "def related_reviewed_objects arr\n @all_commits.keep_if do |commit|\n arr.index(commit.to_s)\n end\n end",
"title": ""
},
{
"docid": "ca8b85af89eb545cde7e761fa4f89f70",
"score": "0.6422347",
"text": "def related_reviewed_objects arr\n @all_commits.keep_if do |commit|\n arr.index(commit.to_s)\n end\n end",
"title": ""
},
{
"docid": "91d470a982901e5320524abbd32b99a5",
"score": "0.6405632",
"text": "def commits_added(git_refs)\n new_commits = []\n\n # Topological-sorting DFS for discovering new commits. \n visited = Set.new # Git ids for visited commits.\n stack = [] # DFS stack state. Each node is a [commit, parent_number].\n git_refs.each do |git_ref|\n next if visited.include? git_ref.commit.id\n visited << git_ref.commit.id\n next if self.commits.where(:gitid => git_ref.commit.id).first\n stack << [git_ref.commit, -1] \n \n until stack.empty?\n stack.last[1] += 1 \n git_commit, parent_number = *stack.last\n \n if parent_git_commit = git_commit.parents[parent_number]\n unless visited.include? parent_git_commit.id\n visited << parent_git_commit.id\n unless self.commits.where(:gitid => parent_git_commit.id).first\n stack << [parent_git_commit, -1]\n end\n end\n else\n new_commits << git_commit\n stack.pop\n end\n end\n end\n \n new_commits\n end",
"title": ""
},
{
"docid": "4639f479fb84319f19030a096a013e83",
"score": "0.63784486",
"text": "def committed_files sha\n array_output_of \"git diff-tree --no-commit-id --name-only -r #{sha}\"\nend",
"title": ""
},
{
"docid": "fbfe09085e30d5a4c216b74f4fda6134",
"score": "0.6374365",
"text": "def all_commits_cmdln(repo)\n repo.git.rev_list({:all => true}).split(\"\\n\")\nend",
"title": ""
},
{
"docid": "94c5fcdc709e2f46d1f6a18760008742",
"score": "0.63101375",
"text": "def parents\n @parents ||= []\n end",
"title": ""
},
{
"docid": "49b7ed7fe1dfb71d8df34489b2c84d38",
"score": "0.630806",
"text": "def commits_from(commit_sha)\n raise UnsupportedRef if commit_sha.is_a? Array\n read_if_needed\n\n already = {}\n final = []\n left_to_do = [commit_sha]\n\n while commit_sha = left_to_do.shift\n next if already[commit_sha]\n\n final << commit_sha\n already[commit_sha] = true\n\n commit = @commit_index[commit_sha]\n commit[:parents].each do |sha|\n left_to_do << sha\n end if commit\n end\n\n sort_commits(final)\n end",
"title": ""
},
{
"docid": "0b95d2354bd2b1d797d3e6caec925d1c",
"score": "0.6283821",
"text": "def repo_commits\n @@repo_commits = `git log master --no-merges --reverse --format=\"%ai\"`.split(/\\n/)\n @@repo_commits.count\n end",
"title": ""
},
{
"docid": "84718956abc1e9e7bed034827865925d",
"score": "0.62804204",
"text": "def parents\n @parents ||= []\n end",
"title": ""
},
{
"docid": "703b34ba76f640df0b8931ed02aef0fb",
"score": "0.62691265",
"text": "def crumb_parents\n []\n end",
"title": ""
},
{
"docid": "6e6820ee235ee08b12e5be067e20ed8f",
"score": "0.6255134",
"text": "def log\n # great idea or greatest idea?\n delimiter = '!@#%^&*'\n history = `git log --graph --pretty=format:'#{delimiter} %h #{delimiter} %s #{delimiter} %cr #{delimiter} %an' --abbrev-commit`\n\n # iterate over history lines\n commits = []\n lines = history.split \"\\n\"\n lines.each_with_index do |line, i|\n # get information from individual commits\n commit = line.split(delimiter).map { |s| s.strip }\n commits.push({\n :id => commit[1],\n :message => commit[2],\n :timestamp => commit[3],\n :author => commit[4]\n })\n end\n\n return commits\n end",
"title": ""
},
{
"docid": "ddb66dc0e86553c64ed14235455d6876",
"score": "0.6248829",
"text": "def all_commits_bfs(repo)\n seen = [].to_set\n \n repo.heads.each do |head| \n $headnm=head.name if DEBUG\n seen.merge(ancestors(head.commit, seen)) \n end\n\n repo.tags.each do |head| \n $headnm=head.name if DEBUG\n seen.merge(ancestors(head.commit, seen)) \n end\n\n repo.remotes.each do |head| \n $headnm=head.name if DEBUG\n seen.merge(ancestors(head.commit, seen)) \n end\n\n seen\nend",
"title": ""
},
{
"docid": "396a9f200a7d8b9daba68c3fbddb7646",
"score": "0.6240469",
"text": "def get_current_heads\n return @branches.map {|b| b.current_head}\n end",
"title": ""
},
{
"docid": "5c498069cb180bc812d49bfc8293399e",
"score": "0.62387913",
"text": "def get_ref_history(ref)\n first_obj = true\n\n `git rev-list --parents #{ref}`.split(\"\\n\").each do |entry|\n commit, *parents = entry.split(' ')\n\n if $objects.has_key?(commit)\n obj = $objects[commit]\n else\n obj = Commit.new(commit)\n $objects[commit] = obj\n end\n\n if first_obj and ref =~ /\\/tags\\//\n id = `git rev-parse #{ref}`.chomp\n $objects[id] = Tag.new(id, ref, obj)\n first_obj = false\n end\n\n if obj.parents.size == 0\n parents.each do |parent|\n if $objects.has_key?(parent)\n parent_obj = $objects[parent]\n else\n parent_obj = Commit.new(parent)\n $objects[parent] = parent_obj\n end\n obj.add_parent(parent_obj)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "ec67c7dbb404c015d3a22dbaafd78951",
"score": "0.623808",
"text": "def parents\n cama_fetch_cache(\"parents_#{self.id}\") do\n res = []\n p = self.parent\n while p.present?\n res << p\n p = p.parent\n end\n res\n end\n end",
"title": ""
},
{
"docid": "9a3bdd7eafe7c2a790d3cdf133913289",
"score": "0.62325823",
"text": "def branch_parent(commit_oid)\n validate_commit!(commit_oid)\n @rugged_repository.lookup(commit_oid).parents.last.oid\n end",
"title": ""
},
{
"docid": "58afecb47f9e964773e2ad69745473eb",
"score": "0.62226915",
"text": "def commits\n @commits ||= git_log.split(/^\\n?>>> /).collect do |group|\n files = group.split(\"\\n\")\n # The name is the commit message\n name = files.shift\n # What's left is the list of files\n files.collect! do |file|\n # Collect the ones that were added or modified\n file.sub(/[AM]\\t/, '') if file =~ /[AM]\\t/\n end\n # Get rid of the nils\n files.compact!\n # We don't want any files that have been deleted\n files.delete_if { |file| !File.exists?(file) }\n # Exclude files matching .gitupignore\n if File.exists?(@ignore_file)\n @ignores = File.readlines(@ignore_file).collect { |line| line.strip }\n @ignores.each do |ignore|\n files.delete_if { |file| file.match(ignore) }\n end\n end\n # Make the hash for the commit\n { :name => name, :files => files } unless name.nil? || files.nil? || files.empty?\n end.compact\n end",
"title": ""
},
{
"docid": "374bdb8cd9ba0dba569fe70e981bee85",
"score": "0.6209448",
"text": "def get_commits(treepath, repo)\n commits = repo.log('data', treepath)\n commits = nil if commits.empty?\n commits\nend",
"title": ""
},
{
"docid": "e720526b9233bf71061c74168bfdb2c9",
"score": "0.6180124",
"text": "def git_commits\n unpackaged_commits = []\n repo = Grit::Repo.new(ApplicationConfig.config.git_repo_path)\n commits = repo.commits\n \n commits.each do |commit| \n unpackaged_commits << commit unless (packaged?(commit.id))\n end\n unpackaged_commits\n end",
"title": ""
},
{
"docid": "a2db06585fa7575a243d7436577b876b",
"score": "0.61525345",
"text": "def parents()\n t = self\n res = Array.new()\n while t do\n res.push(t)\n t = t.parent\n end\n res\n end",
"title": ""
},
{
"docid": "6a4bfa0cb73cfb1a58244ef25c976f95",
"score": "0.6152421",
"text": "def commit_message_lines\n `git log --format=%B -n 1`.strip.lines.map(&:strip)\nend",
"title": ""
},
{
"docid": "af26e9aac3f0ed9607d8d828f6d394a6",
"score": "0.61388606",
"text": "def ordinary_code_commits\n @ordinary_code_commits ||= Open3.popen3(*%w[\n git rev-list --pretty=oneline --topo-order --max-parents=1 --parents\n ],\n \"#{last_release}..#{end_object}\",\n '--', *CODE_PATHS\n ) do |stdin, stdout, stderr|\n stdout.each_line.collect do |line|\n line.chomp!\n if %r{\\A(#{SHA_PAT}) (#{SHA_PAT}) (.*)}.match(line)\n [$1, {\n :trunk_parent => $2,\n :log => $3,\n }]\n else\n raise \"could not parse '#{line}'\"\n end\n end.compact.to_h\n end\nend",
"title": ""
},
{
"docid": "a09cd323ead39104b8baafa5c6752853",
"score": "0.61360085",
"text": "def commits(time_range = '-1')\n @commits ||= `cd #{data_path} && git log --pretty=format:'%h' #{time_range} && cd ..`.split(\"\\n\")\n end",
"title": ""
},
{
"docid": "0c31fd09766891467a6b8f52294a2a27",
"score": "0.6133592",
"text": "def commits_for(oldrev, newrev)\n commits_by_id = commits.index_by(&:id)\n\n result = []\n pending = Set[newrev]\n\n # We go up the parent chain of our newrev and collect all commits which\n # are new. In case a commit's ID cannot be found in the set of new\n # commits, then it must already be a preexisting commit.\n while pending.any?\n rev = pending.first\n pending.delete(rev)\n\n # Remove the revision from commit candidates such that we don't walk\n # it multiple times. If the hash doesn't contain the revision, then\n # we have either already walked the commit or it's not new.\n commit = commits_by_id.delete(rev)\n next if commit.nil?\n\n # Only add the parent ID to the pending set if we actually know its\n # commit to guards us against readding an ID which we have already\n # queued up before. Furthermore, we stop walking as soon as we hit\n # `oldrev` such that we do not include any commits in our checks\n # which have been \"over-pushed\" by the client.\n commit.parent_ids.each do |parent_id|\n pending.add(parent_id) if commits_by_id.has_key?(parent_id) && parent_id != oldrev\n end\n\n result << commit\n end\n\n result\n end",
"title": ""
},
{
"docid": "a6d06d04f328af55eae24eefa6cf451c",
"score": "0.61264807",
"text": "def commits\n @commits ||= @project.log.entries.sort{ |a, b| a.author.date <=> b.author.date }\n end",
"title": ""
},
{
"docid": "d1203252b25d42b2fcb62c7dcb83fc55",
"score": "0.612306",
"text": "def get_merge_commits\n output = `git log --merges --first-parent -n 20 --format=format:%h`\n output.split(\"\\n\").reverse\nend",
"title": ""
},
{
"docid": "0109b4c50ba4b5470267cf2aecaaf91b",
"score": "0.6122412",
"text": "def parents\n [parent]\n end",
"title": ""
},
{
"docid": "3a39755ad62b03155ae8d516d6b4bf0b",
"score": "0.6099794",
"text": "def parents_of(rev)\n rev.getParentCount.times.map do |i|\n rev.getParent(i)\n end\n end",
"title": ""
},
{
"docid": "0259b459e36c4a08d1495a171f11e840",
"score": "0.60989976",
"text": "def parents\n []\n end",
"title": ""
},
{
"docid": "0259b459e36c4a08d1495a171f11e840",
"score": "0.60989976",
"text": "def parents\n []\n end",
"title": ""
},
{
"docid": "3ce1ec4703cda1ea475822928b1b866d",
"score": "0.6087437",
"text": "def cached_commits(range)\n commits = []\n\n direction = nil\n if @commits.key? range.last\n current_commits = [@commits[range.last]]\n direction = :parents\n elsif @commits.key? range.first\n current_commits = [@commits[range.first]]\n direction = :children\n end\n\n unless direction.nil?\n while !current_commits.empty? do\n new_commits = []\n current_commits.each do |commit|\n new_commits += commit.send direction\n commits << commit if commit.id != range.first\n if direction == :parents && new_commits.include?(range.first)\n new_commits = []\n break\n end\n end\n unless new_commits.include? range.first\n current_commits = new_commits.uniq.map do |commit|\n commit = @commits[commit]\n commits.include?(commit) ? nil : commit\n end.compact\n end\n end\n end\n\n commits.sort_by { |c| c.committed_date }.reverse\n end",
"title": ""
},
{
"docid": "07090fb622f15c203116bc0ded2e6ed4",
"score": "0.6082535",
"text": "def refs\n (clone.tags.map(&:name) + clone.branches.map(&:name)).uniq\n end",
"title": ""
},
{
"docid": "0425061513edcc9d9ac36ce26bfad23e",
"score": "0.607679",
"text": "def repo_names\n @commit_list.map {|cmt| cmt.repo_name }\n end",
"title": ""
},
{
"docid": "10be7675e59e943597826e1823037aff",
"score": "0.6074842",
"text": "def index_commits_array\n res = []\n\n repository_for_indexing.each_id do |oid|\n obj = repository_for_indexing.lookup(oid)\n if obj.type == :commit\n res.push(\n {\n type: 'commit',\n sha: obj.oid,\n author: obj.author,\n committer: obj.committer,\n message: encode!(obj.message)\n }\n )\n end\n end\n\n res\n end",
"title": ""
},
{
"docid": "5e69b9de3af331be5004de565312e6a1",
"score": "0.60703766",
"text": "def ancestors_r\n # fetch all parents\n pending = [self]\n ans = []\n while !pending.empty?\n e = pending.pop\n e.parents.each do |p|\n if !ans.include?(p)\n ans << p\n pending.push(p)\n end\n end\n end\n ans\n end",
"title": ""
},
{
"docid": "ce1ae195c1ac34c94ebfbb69389ac7da",
"score": "0.6051153",
"text": "def build_commits(raw_commits)\n child_commit_id = nil\n raw_commits.map do |commit|\n commit = self.class::Commit.new(self, commit)\n commit.add_child child_commit_id unless child_commit_id.nil?\n child_commit_id = commit.id\n @commits[commit.id] = commit\n commit\n end\n end",
"title": ""
},
{
"docid": "b1cc1e746bea749164dc4e0ff284d607",
"score": "0.6043872",
"text": "def file_list\n files = commits.collect { |commit| commit[:files] }.flatten\n end",
"title": ""
},
{
"docid": "d2d9ea6faf8ec4b451153a183da17645",
"score": "0.60398066",
"text": "def repo_commits(repo)\n Git.repo_hash[repo].commits\n end",
"title": ""
},
{
"docid": "d2d9ea6faf8ec4b451153a183da17645",
"score": "0.60398066",
"text": "def repo_commits(repo)\n Git.repo_hash[repo].commits\n end",
"title": ""
},
{
"docid": "c0e2977bbe03ef287a98fa5267493ce5",
"score": "0.60348916",
"text": "def parents\r\n if @parents.nil?\r\n @parents = []\r\n parents_array.each_index do |i|\r\n @parents << parent(i)\r\n end\r\n end\r\n return @parents\r\n end",
"title": ""
},
{
"docid": "a7750c413a78b3b213f5aaee19da4574",
"score": "0.60323524",
"text": "def versions\n self.git.commits\n end",
"title": ""
},
{
"docid": "f6f29249a43c9fc08cfe7f82b2597650",
"score": "0.60238385",
"text": "def parents\n parents = []\n ref = self\n while parent = ref.parent\n ref = parent\n parents << parent\n end\n parents\n end",
"title": ""
},
{
"docid": "f6f29249a43c9fc08cfe7f82b2597650",
"score": "0.60238385",
"text": "def parents\n parents = []\n ref = self\n while parent = ref.parent\n ref = parent\n parents << parent\n end\n parents\n end",
"title": ""
},
{
"docid": "f70342d29616a942e7aa50c86d51da87",
"score": "0.60198385",
"text": "def branch_commits\n commits = log(log_size_limit).entries\n commits\n end",
"title": ""
},
{
"docid": "6d22022e115706566509070531fb2ef2",
"score": "0.60166657",
"text": "def parent_ids\n if ancestor_ids.empty? then\n nil\n else\n branches.map { |branch| cast_primary_key(branch.split('/').last) }\n end\n end",
"title": ""
},
{
"docid": "1b99e1e930512371a3aaf84e0a504a87",
"score": "0.60110795",
"text": "def commit_entries(pr_id, at_open = false)\n if at_open\n q = <<-QUERY\n select c.sha as sha\n from pull_requests pr, pull_request_commits prc,\n commits c, pull_request_history prh\n where pr.id = prc.pull_request_id\n and prc.commit_id = c.id\n and prh.action = 'opened'\n and prh.pull_request_id = pr.id\n and c.created_at <= prh.created_at\n and pr.id = ?\n QUERY\n else\n q = <<-QUERY\n select c.sha as sha\n from pull_requests pr, pull_request_commits prc, commits c\n where pr.id = prc.pull_request_id\n and prc.commit_id = c.id\n and pr.id = ?\n QUERY\n end\n\n commits = db.fetch(q, pr_id).all\n\n commits.reduce([]){ |acc, x|\n a = mongo['commits'].find_one({:sha => x[:sha]})\n acc << a unless a.nil?\n acc\n }.select{|c| c['parents'].size <= 1}\n end",
"title": ""
},
{
"docid": "d714140b6ada2ff5d73e7c4af4d2e192",
"score": "0.59991795",
"text": "def branch_ids\n parents_cache.split(',').map(&:to_i).reject { |i| i < 1 }.uniq + [id]\n end",
"title": ""
},
{
"docid": "a8f552b6a22db8dba0b9841346982b05",
"score": "0.59911203",
"text": "def revision_components\n []\n end",
"title": ""
},
{
"docid": "023e7b0a3f1fb0610d4770ba127e4233",
"score": "0.59786624",
"text": "def history(path)\n\t\t\thead, _ = latest_commit\n\t\t\t\n\t\t\twalker = Rugged::Walker.new(@repository) # Sounds like 'Walker, Texas Ranger'...\n\t\t\twalker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE)\n\t\t\twalker.push(head.oid)\n\t\t\t\n\t\t\tcommits = []\n\t\t\t\n\t\t\told_oid = nil\n\t\t\t\n\t\t\twalker.each do |commit|\n\t\t\t\tdataset = Dataset.new(@repository, commit.tree)\n\t\t\t\toid = dataset.read(path).oid\n\t\t\t\t\n\t\t\t\tif oid != old_oid # modified\n\t\t\t\t\tyield commit if block_given?\n\t\t\t\t\tcommits << commit\n\t\t\t\t\told_oid = oid\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tbreak if oid.nil? && !old_oid.nil? # deleted or moved\n\t\t\tend\n\t\t\t\n\t\t\treturn commits\n\t\tend",
"title": ""
},
{
"docid": "0a43c40a43fa6c33a82432bf71edbec6",
"score": "0.5967858",
"text": "def parent_ids\n\t\tparents.map{|x| x[\"id\"] || x[:id]}\n\tend",
"title": ""
},
{
"docid": "19f5e4b28692d73adad0b93ff82ae91f",
"score": "0.59650964",
"text": "def revisions\n return 0 if repo.empty?\n # Walk commits to see how many of them are there.\n commits = 1\n current_commit = repo.lookup(repo.head.target)\n while true\n current_commit = current_commit.parents.first\n break if current_commit.nil?\n commits += 1\n end\n commits\n end",
"title": ""
},
{
"docid": "c9dc4ba0d014d59ea3db0781a603c7ce",
"score": "0.5960329",
"text": "def parents\n parent ? (parent.parents + [parent]) : []\n end",
"title": ""
},
{
"docid": "c9dc4ba0d014d59ea3db0781a603c7ce",
"score": "0.5960329",
"text": "def parents\n parent ? (parent.parents + [parent]) : []\n end",
"title": ""
},
{
"docid": "024c787babf44e05f86e0301db5e9215",
"score": "0.59585595",
"text": "def parents_list\n @parents.values.map(&:to_s).sort.join(',')\n end",
"title": ""
},
{
"docid": "3f36e36b9f028836828d20376038cd0b",
"score": "0.59563327",
"text": "def get_committers\n begin\n commits = GithubMatesFetcher.github.repos.commits.all self.username, self.repository\n rescue\n return nil\n end\n commiters = []\n commits.each do |commit|\n commiters << commit['committer']['login'] if commit['committer'] and commit['committer']['login'].present?\n end\n return commiters.uniq\n end",
"title": ""
},
{
"docid": "a9fe495b10fe222615acdb0bc947a123",
"score": "0.59461355",
"text": "def get_commit_walker()\n history = []\n if !@repo.empty?\n walker = Rugged::Walker.new(repo)\n walker.sorting(Rugged::SORT_TOPO)\n walker.push(@repo.head.target)\n\n history = walker.take(5).to_a\n end\n history\n end",
"title": ""
},
{
"docid": "39f1555748ad78ba371e9653022b521b",
"score": "0.59422773",
"text": "def parents\n [self, self.parent.try(:parents)].flatten.compact\n end",
"title": ""
},
{
"docid": "6846b599badaa393e0b5c9018dfd71ad",
"score": "0.5939954",
"text": "def committees\n # legacy LDAP entries\n committees = []\n# committees = weakref(:committees) do\n# Committee.list(\"member=uid=#{name},#{base}\")\n# end\n\n # add in projects\n # Get list of project names where the person is an owner\n projects = self.projects.select {|prj| prj.owners.include? self}.map(&:name)\n committees += ASF::Committee.pmcs.select do |pmc|\n projects.include? pmc.name\n end\n\n # dedup\n committees.uniq\n end",
"title": ""
},
{
"docid": "1bb3d0e72f0047e58afff5cd92055472",
"score": "0.59283566",
"text": "def parentage\n parentage_array = [self]\n prev_parent = self.parent\n while prev_parent\n parentage_array << prev_parent\n prev_parent = prev_parent.parent\n end\n parentage_array.reverse!\n end",
"title": ""
},
{
"docid": "b4eda3f42e5f71812c00c74a6dc261dc",
"score": "0.59258705",
"text": "def parents\r\n\t\tself.parent.nil? ? [] : [self.parent] + self.parent.parents\r\n\tend",
"title": ""
},
{
"docid": "195a3c8c7528f54a283349c3c0fa8a0a",
"score": "0.59154445",
"text": "def blob_list\n tree = lookup_commit_tree\n return [] unless tree\n\n [].tap do |blobs|\n tree.walk_blobs(:preorder) { |root, entry| blobs << \"#{root}#{entry[:name]}\" }\n end\n end",
"title": ""
},
{
"docid": "41d58743bebfd7fff68ee9ad0b90bd21",
"score": "0.59086114",
"text": "def git_branch__current_from git_base=:git_base__from\n git_base = array__from git_base\n [ git_base.first.current_branch ]\n end",
"title": ""
},
{
"docid": "0d013399ad4f03f54f672576895fab5c",
"score": "0.5901605",
"text": "def commit_ids(file)\n cmd = \"git log --pretty=format:'%H' --follow #{file}\"\n `#{cmd}`.split(/\\W+/)\n end",
"title": ""
},
{
"docid": "cc02c3d9f5eacabf244c44b1f0b7218c",
"score": "0.58988476",
"text": "def commit_messages\n revisions.map do |revision|\n commit = repo.lookup(revision)\n commit.message\n end\n end",
"title": ""
},
{
"docid": "8077ca7ee053e1d2cd29da04edd4b974",
"score": "0.5898532",
"text": "def parentage\n return nil if isRoot?\n\n parentageArray = []\n prevParent = self.parent\n while (prevParent)\n parentageArray << prevParent\n prevParent = prevParent.parent\n end\n\n parentageArray\n end",
"title": ""
},
{
"docid": "8077ca7ee053e1d2cd29da04edd4b974",
"score": "0.5898532",
"text": "def parentage\n return nil if isRoot?\n\n parentageArray = []\n prevParent = self.parent\n while (prevParent)\n parentageArray << prevParent\n prevParent = prevParent.parent\n end\n\n parentageArray\n end",
"title": ""
},
{
"docid": "87749fabcf5e1c23d2150ca24a5baec1",
"score": "0.5895934",
"text": "def parent_ids\n [] if parents.nil?\n parents.ids\n end",
"title": ""
},
{
"docid": "97ced88eee5ffa1a0a6cb0f3a7283048",
"score": "0.58925945",
"text": "def branches\n @sha256.map{|x,| x[/((?:branches\\/)?.+?)\\//, 1]}.uniq\n end",
"title": ""
},
{
"docid": "4507d911d54eefd3e9add193d44b6de0",
"score": "0.5891179",
"text": "def parents\n references\n end",
"title": ""
},
{
"docid": "17d538a9e97c54a3248636b3d6189bcd",
"score": "0.5889241",
"text": "def parent_states(state)\n ret = []\n curr = state\n \n ret.push(curr)\n curr = state_object(curr.parent_state, curr.global_concurrent_state)\n \n while(curr)\n ret.push(curr)\n curr = state_object(curr.parent_state, curr.global_concurrent_state)\n end\n \n return ret\n end",
"title": ""
},
{
"docid": "84ab042c1209b495c6ab8f6e45796f78",
"score": "0.5879292",
"text": "def extract_changes\n list = []\n\n command = 'git log --name-only --pretty=format:\"' +\n GIT_COMMIT_MARKER +\n '%ci' +\n GIT_FIELD_MARKER +\n '%aN' +\n GIT_FIELD_MARKER +\n '%H' +\n GIT_FIELD_MARKER +\n '%s%n%n%b' +\n GIT_FIELD_MARKER +\n '\"'\n\n changes = `#{command}`.split(RUBY_COMMIT_MARKER)\n\n changes.shift # throw the first (empty) entry away\n\n changes.each do |entry|\n date, who, id, msg, files = entry.split(RUBY_FIELD_MARKER)\n date = Time.parse(date)\n if files.nil?\n files = [ \"\" ]\n else\n files = files.split(\"\\n\")\n end\n list << Change.new(:id=>id, :date=>date, :who=>who, :msg=>msg, :files=>files)\n end\n\n return list\n end",
"title": ""
},
{
"docid": "5d96376484fbdc1adadfdf7f83a23956",
"score": "0.5879276",
"text": "def branch_ids\n self_and_descendants.map(&:id).uniq \n end",
"title": ""
},
{
"docid": "0df84c2513fa865d70c5e1e02c0f82bb",
"score": "0.58751345",
"text": "def parents\n @parents ||= self.parent ? [self.parent.parents, self.parent].flatten : []\n end",
"title": ""
},
{
"docid": "b799174658e94c064328a6fad9c49191",
"score": "0.5871138",
"text": "def ancestors\n []\n end",
"title": ""
},
{
"docid": "9f3392a253554b7ca147d910f1090904",
"score": "0.5870704",
"text": "def getAllParents\n parents = []\n parent = self.getParentRec\n while parent.present? do\n parents << parent\n parent = parent.getParentRec\n end\n return parents\n end",
"title": ""
},
{
"docid": "190755f75a4fc7a82651397c3beaee88",
"score": "0.5864119",
"text": "def parentage\r\n return nil if isRoot?\r\n\r\n parentageArray = []\r\n prevParent = self.parent\r\n while (prevParent)\r\n parentageArray << prevParent\r\n prevParent = prevParent.parent\r\n end\r\n\r\n parentageArray\r\n end",
"title": ""
}
] |
c52d3554ebc8cabe5998aaa18731ce0f
|
Edit function GET /users/1/edit
|
[
{
"docid": "c8ccd7f09675a8c4fdddac0612b00249",
"score": "0.0",
"text": "def edit\n @offer =current_offer\n @offer = Offer.find(params[:id])\n render \"/offers/show/edit_info\"\n# @user.update_without_password(params[:user])\n# else\n#end\nend",
"title": ""
}
] |
[
{
"docid": "9b4cb26cb42006bbfc9176702b1c0513",
"score": "0.8531562",
"text": "def edit\n @userToEdit = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "f4c72c6ca89b78e0710d57bbf3781821",
"score": "0.85169274",
"text": "def edit\n \n @user = User.find(params[:id])\n \n end",
"title": ""
},
{
"docid": "bdfef13cd65f7ced50a5fff904adf738",
"score": "0.8464158",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "bdfef13cd65f7ced50a5fff904adf738",
"score": "0.8464158",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "bb19fef0b15b67b72d6d85274e643d77",
"score": "0.84160453",
"text": "def edit\n\t@user = User.find(params[:id])\nend",
"title": ""
},
{
"docid": "1662b73c2153808a1baf3c9afbc8691b",
"score": "0.8409011",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "dda4d3d61d9eae3fde2176ab8d6d4738",
"score": "0.8407839",
"text": "def edit\n # When a http GET request to '/users/1/edit' is received, have it render:\n # a view file with a form with user 1's information in the appropriate input field.\n @id = params[:id]\n @user = User.find(@id)\n end",
"title": ""
},
{
"docid": "999819b8b310b425c4533e263e229ef4",
"score": "0.84042007",
"text": "def edit\n @user = User.find params[:id]\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "d7d85e225a5e57a35a973fd017983c0f",
"score": "0.83962756",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "f19d3319fa45373ab7da9fb5d3660ba9",
"score": "0.83824056",
"text": "def edit\n\t\t@user = User.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "f19d3319fa45373ab7da9fb5d3660ba9",
"score": "0.83824056",
"text": "def edit\n\t\t@user = User.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "f19d3319fa45373ab7da9fb5d3660ba9",
"score": "0.83824056",
"text": "def edit\n\t\t@user = User.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "f19d3319fa45373ab7da9fb5d3660ba9",
"score": "0.83824056",
"text": "def edit\n\t\t@user = User.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "676c6ec7affda1bfcc9a656152ded755",
"score": "0.8373611",
"text": "def edit\n # finds user with id of params[:id]\n @user = User.find params[:id]\n end",
"title": ""
},
{
"docid": "1fb6388421ce278ca7ae5fed6c182c9e",
"score": "0.8362773",
"text": "def edit\n\t\t@user = User.find(params(:id))\n\tend",
"title": ""
},
{
"docid": "30f86208126e0172907d13577f8961b4",
"score": "0.83588237",
"text": "def edit\n\t\tthe_user_id = params[\"id\"]\n \t@user = User.find_by(:id => the_user_id)\n\tend",
"title": ""
},
{
"docid": "725e5fe0aac7ee8720dd551b60c84b63",
"score": "0.8356161",
"text": "def edit\n \t@user = User.find params[:id]\n end",
"title": ""
},
{
"docid": "95bd900c918f7bb2c32ae73a99e41460",
"score": "0.8354654",
"text": "def edit\n\t@user = User.find(params[:id])\n\t@title = \"Edit user\"\n end",
"title": ""
},
{
"docid": "a75ac0c861c3fbfe715a3b4556d1ee4c",
"score": "0.83323497",
"text": "def edit\n @user = User.find(params[:user_id])\n end",
"title": ""
},
{
"docid": "a75ac0c861c3fbfe715a3b4556d1ee4c",
"score": "0.83323497",
"text": "def edit\n @user = User.find(params[:user_id])\n end",
"title": ""
},
{
"docid": "76a29ad387cd5e1d730f2094576464a8",
"score": "0.83150285",
"text": "def edit\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "efbe418ee9f500c501006c7287119b3c",
"score": "0.8309544",
"text": "def edit\n # return an HTML form for editing a specific user\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "ed31480d585dbbc5049f32a39b8ab07b",
"score": "0.8281805",
"text": "def edit\n # find the user we want to edit by id\n # this will send the @user to the edit page with a form\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "77b3d250d1d7f75bbd0fc72a279ac868",
"score": "0.82113755",
"text": "def edit\n # @user = User.find(params[:id]) -- not needed bc of correct_user\n end",
"title": ""
},
{
"docid": "908c3d9b63b96b75b6560aea5a34a193",
"score": "0.8196539",
"text": "def edit\n @user=User.find(params[:id])\n end",
"title": ""
},
{
"docid": "59e65a6474a0800db5f42a85d57f7942",
"score": "0.81945586",
"text": "def edit\n # this finds the current user\n @user = User.find params[:id]\n end",
"title": ""
},
{
"docid": "d905d2db829e7e57bd822773a1ab8f37",
"score": "0.81856865",
"text": "def edit\n # loads user from the database\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "f544f82789ba4764f32a408d610ef823",
"score": "0.81619763",
"text": "def edit\n @title = \"Edit user\"\n @user = User.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "edfd33a3686e7a892df0c2f68a43319b",
"score": "0.81554663",
"text": "def edit\n # find the user by the user id in the route params\n # (this will likely be moved to its own before method)\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "9c75e4ef7a4705121a31af8edb03f298",
"score": "0.81071603",
"text": "def edit\n @page_title = 'Edit user'\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "50fe0ec4eaf758690a33e724107a6d7e",
"score": "0.7930396",
"text": "def edit\n @user = User.find(params[:id])\n # @user は編集対象のユーザー\n # current_user はログインしているユーザー \n\n end",
"title": ""
},
{
"docid": "3549bae2a2611723dd5421b982e04978",
"score": "0.7890797",
"text": "def edit\n @user = User.find(params[:id])\n @user.update(user_params)\n end",
"title": ""
},
{
"docid": "402b7726c0ce88b53d4efbf884842900",
"score": "0.7862349",
"text": "def edit\n @user= User.find_by_id(current_user.id)\n end",
"title": ""
},
{
"docid": "285bdc5c85017188ec354a89b150cb6f",
"score": "0.7842844",
"text": "def edit\n @user = current_user\n render 'edit'\n end",
"title": ""
},
{
"docid": "1cf29619e413c8bc7440ccc2851d8594",
"score": "0.78370863",
"text": "def edit\n # @user = User.find(params[:id])\n # already in correct_user\n end",
"title": ""
},
{
"docid": "c07e24d759a35ee59b2a8fd0972a028f",
"score": "0.78361696",
"text": "def edit\n @user = User.find(params[:id])\n # just show me the form\nend",
"title": ""
},
{
"docid": "a3e0cfaf5d40c54f39d71318f6daa9d5",
"score": "0.78330535",
"text": "def edit\n @user = User.find(params[:id])\n\t case params[:form]\n\t when \"email\"\n\t render 'email'\n\t when \"password\"\n\t render 'password'\n\t else\n\t render :action => :edit\n\t end\n\tend",
"title": ""
},
{
"docid": "1bfc8c945355a5ad279803bc190a9eb7",
"score": "0.7829072",
"text": "def edit\n \"\"\"\n @user = User.find(params[:id])\n \"\"\"\n end",
"title": ""
},
{
"docid": "7b45baf1d0baf230dbd886283923df60",
"score": "0.7823838",
"text": "def edit\n\t\t# admin is able to edit any user's page\n if current_user.is_admin?\n @user = User.find(params[:id])\n else\n @user = current_user\n end\n end",
"title": ""
},
{
"docid": "bcfa448d64508b10938566c54b4a8b6e",
"score": "0.77887976",
"text": "def edit(id, options={})\n request(:put, \"/users/#{id}.json\", default_params(options))\n end",
"title": ""
},
{
"docid": "69a376ed53fb3ce6cbff299b2555a13f",
"score": "0.7785846",
"text": "def edit\n\t @user = User.find(params[:id])\n\t redirect_to root_path unless current_user.is_admin? or @user == current_user\n\tend",
"title": ""
},
{
"docid": "e1710b0e1b32fbaa7f360f8217dc391f",
"score": "0.7742876",
"text": "def edit\n @user = current_user\n end",
"title": ""
},
{
"docid": "5e0d30206e0cf1339f534ff7fd7a1490",
"score": "0.77279234",
"text": "def edit\n @usuario = Usuario.find(params[:id])\n end",
"title": ""
},
{
"docid": "f70a497c5f1258a93d7f22bc909cbe78",
"score": "0.77091444",
"text": "def edit\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "9c1ad174872f39af448a6a0f2e119fac",
"score": "0.77015114",
"text": "def edit\n set_user\n end",
"title": ""
},
{
"docid": "ffab3d6129c5ebd2b3bade05254f64c3",
"score": "0.7699493",
"text": "def edit\r\n \t@user = current_user\r\n end",
"title": ""
},
{
"docid": "30bfa0378e23c67865f695434060a962",
"score": "0.769384",
"text": "def edit\n #similar to the NEW action, but instead of create a empty user, we will find a user by its id and than\n # send its params to the partial form, so the params can be edited. Please note the partial form\n # for details, as the column admin can be edited only buy logged users with admin privileges.\n #@user variable will be used in the partial form, when submitted goes to UPDATE action.\n @user = User.find(params[:id])\n #only admin can edit other users information, so we first check if the user is admin.\n unless current_user.admin?\n #if the user is not admin it can edit only its own information, so we redirect to edit its own information\n unless @user.id == current_user.id\n redirect_to edit_user_path (current_user)\n end\n end\n end",
"title": ""
},
{
"docid": "56edd95333df24cac7d393cb4d89cef0",
"score": "0.76931584",
"text": "def edit\n @user = User.find(params[:id])\n\n deny_wrong_user if !current_user?(@user)\n end",
"title": ""
},
{
"docid": "a69a672acd9b05d672367e360f860a6e",
"score": "0.76793015",
"text": "def edit\n if params[:id].present?\n @user = User.find(params[:id])\n else\n super\n end\n end",
"title": ""
},
{
"docid": "7c7d76cb857a40caa127e5233658861e",
"score": "0.76731735",
"text": "def edit\n @user = User.find_by(user_name: params[:user_name])\n end",
"title": ""
},
{
"docid": "080353011732927a3db515516079c142",
"score": "0.7661725",
"text": "def edit\n @user = User.find(params[:id])\n prepare_attribs_in_params(@user)\n end",
"title": ""
},
{
"docid": "e55982d2ef11e924152beb34d54de7b3",
"score": "0.76609343",
"text": "def edit(id)\n @user = flash[:form_data] || User[id]\n\n if @user.nil?\n flash[:error] = 'The specified user is invalid'\n redirect_referrer\n end\n\n @title = \"Edit #{@user.username}\"\n\n render_view(:form)\n end",
"title": ""
},
{
"docid": "24eb8a05d583ca2c135ee8fd7f31b361",
"score": "0.7650472",
"text": "def edit\n\t\t@user = User.find( params[:user_id] )\n\t\t@profile = @user.profile\n\tend",
"title": ""
},
{
"docid": "39c9c8cea6d9a4a62739efa1b0c10b3b",
"score": "0.7633006",
"text": "def edit\n @profile = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "08657cb44e890d6e8a94794c71d77d7b",
"score": "0.7618463",
"text": "def edit\n @user = User.new\n @new_item = User.find_by_id(params[\"id\"])\n end",
"title": ""
},
{
"docid": "056995ca85307dc58f28166aa51e1708",
"score": "0.75975156",
"text": "def edit\n get_user_for_edit\n end",
"title": ""
},
{
"docid": "a926b4a7314cede4ddc04981fc9c4f3c",
"score": "0.75908166",
"text": "def edit\n @user = Admin.find(params[:id]) \n end",
"title": ""
},
{
"docid": "b0a248625b6f204bd42823422b791c6b",
"score": "0.7569264",
"text": "def edit\n @user = User.find (params[:user_id])\n @profile = @user.profile\n end",
"title": ""
},
{
"docid": "36cdd5049fb50e502f6c882a186cf3db",
"score": "0.75655544",
"text": "def edit\n # @userinfos = Userinfo.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "2486fb5620707bc2856b50e6ea360b1e",
"score": "0.756535",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "0e30f199ba20cbd26f31cb08bc0055f7",
"score": "0.7557596",
"text": "def edit\n @user = current_user\n end",
"title": ""
},
{
"docid": "0e30f199ba20cbd26f31cb08bc0055f7",
"score": "0.7557596",
"text": "def edit\n @user = current_user\n end",
"title": ""
},
{
"docid": "0e30f199ba20cbd26f31cb08bc0055f7",
"score": "0.7557596",
"text": "def edit\n @user = current_user\n end",
"title": ""
},
{
"docid": "0e30f199ba20cbd26f31cb08bc0055f7",
"score": "0.7557596",
"text": "def edit\n @user = current_user\n end",
"title": ""
},
{
"docid": "0e30f199ba20cbd26f31cb08bc0055f7",
"score": "0.7557596",
"text": "def edit\n @user = current_user\n end",
"title": ""
}
] |
37c4679095789bfd7d2ba97cc5aaedab
|
Lettercase Counter Given: string Return: hash with three entries: the number of upcase chars, downcase chars and neither seperate into chars, create formatted hash, iterate through check for alpha range add to appropriate entry in hash
|
[
{
"docid": "b360fc91ada5af57df0e670ffb129115",
"score": "0.6514939",
"text": "def letter_case_count(string)\n result = { lowercase: 0, uppercase: 0, neither: 0 }\n string.chars.each do |i|\n if ('a'..'z') === i\n result[:lowercase] += 1\n elsif ('A'..'Z') === i\n result[:uppercase] += 1 \n else\n result[:neither] += 1\n end\n end\n result\nend",
"title": ""
}
] |
[
{
"docid": "9137687164e666b3b3a06f5174d0d6f7",
"score": "0.7450045",
"text": "def letter_case_count(str)\n hsh = str.codepoints.each_with_object(Hash.new(0)) do |asci_num, count_hsh|\n case asci_num\n when (97..122) then count_hsh[:lowercase] += 1\n when (65..90) then count_hsh[:uppercase] += 1\n else\n count_hsh[:neither] += 1\n end\n end\n { lowercase: hsh[:lowercase],\n uppercase: hsh[:uppercase],\n neither: hsh[:neither] }\nend",
"title": ""
},
{
"docid": "9137687164e666b3b3a06f5174d0d6f7",
"score": "0.7450045",
"text": "def letter_case_count(str)\n hsh = str.codepoints.each_with_object(Hash.new(0)) do |asci_num, count_hsh|\n case asci_num\n when (97..122) then count_hsh[:lowercase] += 1\n when (65..90) then count_hsh[:uppercase] += 1\n else\n count_hsh[:neither] += 1\n end\n end\n { lowercase: hsh[:lowercase],\n uppercase: hsh[:uppercase],\n neither: hsh[:neither] }\nend",
"title": ""
},
{
"docid": "9928be8cdf1aef1469f45cd4e6c4bb71",
"score": "0.7335833",
"text": "def lettercase(string)\n hash = {}\n hash[:lowercase] = string.count('a-z')\n hash[:uppercase] = string.count('A-Z')\n hash[:neither] = string.count('^a-z', '^A-Z')\n hash\nend",
"title": ""
},
{
"docid": "3b07652ca165e0e3465137ff05ece127",
"score": "0.7255696",
"text": "def letter_case_count(str)\n hsh = { lowercase: 'a-z', uppercase: 'A-Z', neither: '^a-zA-Z' }\n hsh.transform_values { |pattern| str.count(pattern) }\nend",
"title": ""
},
{
"docid": "4550e2333746bc9a4e1996757000577d",
"score": "0.72201985",
"text": "def letter_case_count(string)\n hash = {}\n arr = string.chars\n count_lowercase = 0\n count_uppercase = 0\n count_neither_lowercase_uppercase = 0\n\n arr.each{|el| count_lowercase += 1 if ('a'..'z').to_a.include?(el)}\n hash[:lowercase] = count_lowercase\n arr.each{|el| count_uppercase += 1 if ('A'..'Z').to_a.include?(el)}\n hash[:uppercase] = count_uppercase\n hash[:neither] = arr.size - count_uppercase - count_lowercase\n\n hash\nend",
"title": ""
},
{
"docid": "048036514cdb85f91eb09aa757983086",
"score": "0.7218205",
"text": "def letter_case_count(stn)\n hash = {lowercase: 0, uppercase: 0, neither: 0}\n lowcase = stn.count(\"a-z\")\n upcase = stn.count(\"A-Z\")\n other = stn.length - lowcase - upcase\n hash[:lowercase] = lowcase\n hash[:uppercase] = upcase\n hash[:neither] = other\n hash\nend",
"title": ""
},
{
"docid": "a107abbb400e10a8507405c6fe685c99",
"score": "0.71470195",
"text": "def letter_case_count(str)\n hash = {}\n hash[:lowercase] = str.count \"a-z\"\n hash[:uppercase] = str.count \"A-Z\"\n hash[:neither] = str.count \"^a-zA-z\"\n hash\nend",
"title": ""
},
{
"docid": "0604f2fb91be795d0b23a62c80a7f073",
"score": "0.7145655",
"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": "bbd84b53eac75b30ce42fcce30746ed2",
"score": "0.7128037",
"text": "def letter_case_count(string)\n l_hash = {}\n l_hash[:lowercase] = string.count(\"a-z\")\n l_hash[:uppercase] = string.count(\"A-Z\")\n l_hash[:neither] = string.length - (l_hash[:lowercase] + l_hash[:uppercase])\n l_hash\nend",
"title": ""
},
{
"docid": "8ddfd0f71256c7782db33c1c08076b9b",
"score": "0.7113128",
"text": "def letter_case_count(str)\n new_hash = { lowercase:0, uppercase:0, neither:0 }\n counter = 0\n \n loop do\n break if counter == str.size\n \n case str[counter]\n when 'a'..'z'\n new_hash[:lowercase] += 1 \n when 'A'..'Z'\n new_hash[:uppercase] += 1\n else\n new_hash[:neither] += 1\n end\n counter += 1 \n end\n \n p new_hash\nend",
"title": ""
},
{
"docid": "3ba6953953490d73273c501bbbe6cd2e",
"score": "0.7097144",
"text": "def change a\nstore = Array.new(26){0}\n a.chars.map do |x|\n if x.chr.ord.between?(97, 122)\n store[x.chr.ord - 97] = 1\n elsif x.chr.ord.between?(65, 90)\n store[x.chr.ord - 65] = 1\n end\n end\nstore.join\nend",
"title": ""
},
{
"docid": "bca8c3f1a807de697587d8604fe7c9c5",
"score": "0.70800906",
"text": "def letter_case_count(str)\n out_hash = { lowercase: 0, uppercase: 0, neither: 0 }\n str.chars.each do |char|\n if char.ord.between?(97, 122)\n out_hash[:lowercase] += 1 \n elsif char.ord.between?(65, 90)\n out_hash[:uppercase] += 1\n else\n out_hash[:neither] += 1\n end\n end\n out_hash\nend",
"title": ""
},
{
"docid": "40e41c6a6a9c8622b14fc93dbbc77482",
"score": "0.7064325",
"text": "def letter_case_count(str)\n lowercase_letters = (\"a\"..\"z\").to_a\n uppercase_letters = (\"A\"..\"Z\").to_a\n h1 = {lowercase: 0, uppercase: 0, neither: 0}\n \n str.chars.each do |chr|\n if lowercase_letters.include?(chr)\n h1[:lowercase] += 1\n elsif uppercase_letters.include?(chr)\n h1[:uppercase] += 1\n else\n h1[:neither] += 1\n end\n end\n h1\nend",
"title": ""
},
{
"docid": "681ab4c7552bad6b3b9d5b4441d6dd9b",
"score": "0.7052103",
"text": "def letter_case_count(str)\n hash_group = { lowercase: 0, uppercase: 0, neither: 0 }\n str.chars.each do |char|\n if char =~ /['a-z']/\n hash_group[:lowercase] += 1\n elsif char =~ /['A-Z']/\n hash_group[:uppercase] += 1\n else\n hash_group[:neither] += 1\n end\n end\n hash_group\nend",
"title": ""
},
{
"docid": "eccf079122bd23f4835146c77223b86e",
"score": "0.70283276",
"text": "def letter_case_count(string)\n string.chars.inject({lowercase: 0, uppercase: 0, neither: 0}) do |hash, char|\n if /[a-z]/.match(char)\n hash[:lowercase] += 1\n elsif /[A-Z]/.match(char)\n hash[:uppercase] += 1\n else\n hash[:neither] += 1\n end\n hash\n end\nend",
"title": ""
},
{
"docid": "47da7099c538fc3c4a83fa0a64c13d75",
"score": "0.7023437",
"text": "def letter_case_count(str)\n lower = 0\n upper = 0\n total = str.size.to_f\n str.each_char do |char|\n if ('a'..'z').include?(char)\n lower += 1\n elsif ('A'..'Z').include?(char)\n upper += 1\n end\n end\n counts = {\n lowercase: lower, uppercase: upper, neither: (str.size - lower - upper)\n }\nend",
"title": ""
},
{
"docid": "6be285375463869fe9afd223f20b5321",
"score": "0.7010512",
"text": "def letter_case_count(string)\n hsh = {}\n hsh[:lowercase] = string.count('a-z')\n hsh[:uppercase] = string.count('A-Z')\n hsh[:neither] = string.count('^a-zA-Z')\n hsh\nend",
"title": ""
},
{
"docid": "b8e0234312e852ba2ac31a52d7f8de67",
"score": "0.69925654",
"text": "def letter_case_count(str)\n hsh = {}\n hsh[:lowercase] = str.scan(/[a-z]+/).join('').length\n hsh[:uppercase] = str.scan(/[A-Z]+/).join('').length\n hsh[:neither] = str.scan(/[\\d\\W]+/).join('').length\n \n hsh\nend",
"title": ""
},
{
"docid": "5e7ff2fc9dbcefe1ddc8b662c1885ada",
"score": "0.69266963",
"text": "def letter_case_count(str)\n { \n lowercase: str.count(\"a-z\"),\n uppercase: str.count(\"A-Z\"),\n neither: str.size - str.count(\"a-z\") - str.count(\"A-Z\")\n }\nend",
"title": ""
},
{
"docid": "a7fbd8cc360408c371ca934da44f8cd2",
"score": "0.6910975",
"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": "e41db013ece4d8becfcf243f183e44e6",
"score": "0.69068944",
"text": "def letter_case_count(str)\n new_hsh = {\n lowercase: 0, uppercase: 0, neither: 0\n }\n str.each_char do |el|\n if !(/[A-Za-z]/ =~ el)\n new_hsh[:neither] += 1\n elsif el.downcase == el\n new_hsh[:lowercase] += 1\n else\n new_hsh[:uppercase] += 1\n end\n end\n new_hsh\nend",
"title": ""
},
{
"docid": "e41db013ece4d8becfcf243f183e44e6",
"score": "0.69068944",
"text": "def letter_case_count(str)\n new_hsh = {\n lowercase: 0, uppercase: 0, neither: 0\n }\n str.each_char do |el|\n if !(/[A-Za-z]/ =~ el)\n new_hsh[:neither] += 1\n elsif el.downcase == el\n new_hsh[:lowercase] += 1\n else\n new_hsh[:uppercase] += 1\n end\n end\n new_hsh\nend",
"title": ""
},
{
"docid": "e6ea6e1b70d814887a3ad7fffb0407ba",
"score": "0.69045365",
"text": "def calculate_alphabet(str)\n ('X'..'Z').map { |n| str.count(n) }\nend",
"title": ""
},
{
"docid": "fedb0b67a3b69205b29374eb717c0380",
"score": "0.6898111",
"text": "def letter_case_count(string)\n count_hash = {lowercase: 0, uppercase: 0, neither: 0}\n \n count_hash[:lowercase] = string.count('a-z')\n count_hash[:uppercase] = string.count('A-Z')\n count_hash[:neither] = (string.length - (count_hash[:lowercase] + count_hash[:uppercase]))\n count_hash\nend",
"title": ""
},
{
"docid": "f0cdb67a7b538a091c56dccd8a4a8e8a",
"score": "0.6897564",
"text": "def letter_case_count(string)\n lowercase = string.delete('^a-z').length\n uppercase = string.delete('^A-Z').length\n neither = string.delete('a-zA-Z').length\n { lowercase: lowercase, uppercase: uppercase, neither: neither }\nend",
"title": ""
},
{
"docid": "2a57d96cb09dce59ec5fbc84ef657d20",
"score": "0.6889795",
"text": "def letter_case_count(s)\n hash = {}\n characters = s.chars\n hash[:lowercase] = characters.count { |char| char =~ /[a-z]/ }\n hash[:uppercase] = characters.count { |char| char =~ /[A-Z]/ }\n hash[:neither] = characters.count { |char| char =~ /[^A-Za-z]/ }\n hash\nend",
"title": ""
},
{
"docid": "86fea757b3b657232e4cd1aa90109da1",
"score": "0.687966",
"text": "def letter_case_count(str)\n hash = { lowercase: 0,\n uppercase: 0,\n neither: 0 }\n str.chars do |ch|\n if ch.match(/[a-z]/)\n hash[:lowercase] += 1\n elsif\n ch.match(/[A-Z]/)\n hash[:uppercase] += 1\n else\n hash[:neither] += 1\n end\n end\n hash\nend",
"title": ""
},
{
"docid": "fcd85b64363e095c44b731a41da38879",
"score": "0.68787384",
"text": "def hashkey(str)\n str.each_char.map.inject(0){|res,c| res += c.downcase.ord * 13}\nend",
"title": ""
},
{
"docid": "f99ea1f5befb56c031b7e44a1ca9c7a0",
"score": "0.6878115",
"text": "def letter_case_count(str)\n hsh = { lowercase: 0, uppercase: 0, neither: 0 }\n str.each_char do |char|\n case\n when char =~ /[a-z]/\n hsh[:lowercase] += 1\n when char =~ /[A-Z]/\n hsh[:uppercase] += 1\n else\n hsh[:neither] += 1\n end\n end\n hsh\nend",
"title": ""
},
{
"docid": "a40e0d2f448e58faabdcda075f1c8028",
"score": "0.6877398",
"text": "def run_length_encoding(string) # AAA\n letters = {}\n start = 0\n\n while start < string.length # 0 < 4, 1 < 4, 2 < 4, 3 < 4\n letter = string[start]\n if letters[letter]\n letters[letter] = letters[letter] + 1 # {\"A\" => 3}\n else\n letters[letter] = 1 # {\"A\" => 0}\n end\n start += 1\n end #{\"A\" => 3}\n\n key_letter_conversion(letters)\nend",
"title": ""
},
{
"docid": "adcecaa845ba24e37b20aaedb08e63b9",
"score": "0.6851197",
"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": "095b0c660490a326120de7f23478c96e",
"score": "0.684399",
"text": "def letter_case_count(str)\nhash ={}\nhash[:lowercase] = str.scan(/[a-z]/).length\nhash[:uppercase] = str.scan(/[A-Z]/).length\nhash[:neither] = str.scan(/[^a-zA-Z]/).length\nhash\nend",
"title": ""
},
{
"docid": "410147924ee873db691f9149934bc046",
"score": "0.68388766",
"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": "7787f0b327f97a612798b0ec270c9c9e",
"score": "0.6819651",
"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": "262d8de60cf1b7cf1b879d931ac183f8",
"score": "0.6796197",
"text": "def letter_case_count(str)\n { lowercase: str.count('a-z'),\n uppercase: str.count('A-Z'),\n neither: str.count('^a-zA-z') }\nend",
"title": ""
},
{
"docid": "2f229fd8b7201017fb771a79efcf99c8",
"score": "0.6776135",
"text": "def calculate_alphabet(str)\n str.each_char.tally\nend",
"title": ""
},
{
"docid": "f43da0802c2c4591e66805ee2fac3989",
"score": "0.6775594",
"text": "def string_letter_count(str)\n letters = ('a'..'z').to_a.map { |letter| [letter, 0] }.to_h\n str.downcase.each_char { |char| letters[char] += 1 if letters.has_key?(char) }\n letters.select { |_, value| value > 0 }.map { |letter, count| \"#{count}#{letter}\" }.join\nend",
"title": ""
},
{
"docid": "b29bd06ec89556bcc274995bd4793abf",
"score": "0.67636377",
"text": "def letter_case_count(str)\n new_hash = {}\n new_hash[:lowercase] = str.scan(/[a-z]/).size\n new_hash[:uppercase] = str.scan(/[A-Z]/).size\n new_hash[:neither] = str.scan(/[^A-Za-z]/).size\n new_hash\nend",
"title": ""
},
{
"docid": "38557e3c52ba43c4e37e630eb79cea11",
"score": "0.6762775",
"text": "def letterCount(text)\n freq = ('A'..'Z').to_a.zip([0]*26).to_h\n text.split('').each{|c| freq[c] += 1}\n return freq\nend",
"title": ""
},
{
"docid": "2c2890966e4f10279e00fc3b1bedfd80",
"score": "0.6753015",
"text": "def letter_case_count(string)\n hash = { lowercase: 0, uppercase: 0, neither: 0 }\n string.chars.each do |char|\n hash[:lowercase] += 1 if char =~ /[a-z]/\n hash[:uppercase] += 1 if char =~ /[A-Z]/\n hash[:neither] += 1 if char =~ /[^a-zA-Z]/\n end\n hash\nend",
"title": ""
},
{
"docid": "e593daedf0edf2ba8180bd98ae673129",
"score": "0.6742339",
"text": "def letter_case_count(str)\n count = {}\n count[:lowercase] = str.count('a-z')\n count[:uppercase] = str.count('A-Z')\n count[:neither] = str.count('^A-Za-z')\n count\nend",
"title": ""
},
{
"docid": "87c5cc142b59a0c317ece558051da791",
"score": "0.67354584",
"text": "def letter_percentages(str)\n hash = { \"lowercase\" => 0, \"uppercase\" => 0, \"neither\" => 0 }\n leng = str.size\n hash[\"lowercase\"] = (str.count('a-z').fdiv(leng)) * 100\n hash[\"uppercase\"] = (str.count('A-Z').fdiv(leng)) * 100\n hash[\"neither\"] = (str.count('^a-zA-Z').fdiv(leng)) * 100\n\n hash\nend",
"title": ""
},
{
"docid": "aa94fc7709da2c8facb2728488a23f4d",
"score": "0.673506",
"text": "def letter_case_count(string)\n types = { lowercase: 'a-z', uppercase: 'A-Z', neither: '^a-zA-Z'} \n types.map { |type, pattern| [type, string.count(pattern)] }.to_h\nend",
"title": ""
},
{
"docid": "7c7d8a99a34b6f050c62b88d6a21edd3",
"score": "0.67270124",
"text": "def letter_case_count(string)\n { lowercase: string.count('a-z'),\n uppercase: string.count('A-Z'),\n neither: string.count('^a-zA-Z') }\nend",
"title": ""
},
{
"docid": "5c2898c27473bd0567dcab82077f739d",
"score": "0.67187524",
"text": "def get_letter_freq(str)\n freq = Hash.new(0)\n str.chars.each{|ch| freq[ch] += 1}\n freq\nend",
"title": ""
},
{
"docid": "bcd6eb9e2baed406ce05fcd289d8f0dd",
"score": "0.6715284",
"text": "def ae_count(str)\n str = str.downcase\n\n counter = Hash.new(0) # counter = {} with default value '0'\n str.each_char do |char|\n counter[char] += 1 # counter[key] = value / adding a key/value pair into the hash\n end\n return {\"a\" => counter[\"a\"], \"e\" => counter[\"e\"]}\n\nend",
"title": ""
},
{
"docid": "744ad2d91221aebe681ada6b4d4aff68",
"score": "0.6711899",
"text": "def lettercase_counter(string)\n uppercase = string.scan(/[A-Z]/).length\n lowercase = string.scan(/[a-z]/).length\n neither = string.scan(/[^A-Za-z]/).length\n p \"Lowercase:#{lowercase}, Uppercase: #{uppercase}, Neither: #{neither}\"\nend",
"title": ""
},
{
"docid": "968ac2ce206d78c9ecac8e00a5f039cb",
"score": "0.6710911",
"text": "def letter_hash\n new_hash = {}\n self.class::ALPHABET.each_char do |char|\n new_hash[char] = a.count(char)\n end\n new_hash\n end",
"title": ""
},
{
"docid": "1426861a1ffa302eadf034bf13e9e20e",
"score": "0.67037785",
"text": "def letter_changes(str)\n h = ('a'..'z').to_a.each_with_object({}) do |c, h|\n h[c] = case c\n when 'z' then 'A'\n when 'd', 'h', 'n', 't' then c.next.upcase\n else c.next\n end\n end\n str.gsub(/[a-z]/, h)\nend",
"title": ""
},
{
"docid": "615f9c2fff4274d0d4ad35ec3934d78b",
"score": "0.6703742",
"text": "def letter_case_count(string)\n char = { lowercase: 0, uppercase: 0, neither: 0 }\n string.each_char do |letter|\n if (\"a\"..\"z\").cover?(letter)\n char[:lowercase] += 1\n elsif (\"A\"..\"Z\").cover?(letter)\n char[:uppercase] += 1\n else\n char[:neither] += 1\n end\n end\n char\nend",
"title": ""
},
{
"docid": "42fb3e4ab009f125a59dbeb51b982958",
"score": "0.66925365",
"text": "def letter_case_count(string)\n case_counter = {}\n lowercase = string.scan(/[a-z]/).count\n uppercase =string.scan(/[A-Z]/).count\n neither = string.scan(/[^SA-Za-z]/).count\n case_counter[:lowercase], case_counter[:uppercase], case_counter[:neither] = lowercase, uppercase, neither\n case_counter\nend",
"title": ""
},
{
"docid": "4c71436c38d0b53e0fb3569db9a54560",
"score": "0.66901404",
"text": "def build_map(string)\n string.delete(\"'.!,;?'\")\n string.chars.reduce(Hash.new(0)) do |map, char|\n map[char.downcase] += 1\n map\n end\nend",
"title": ""
},
{
"docid": "bb7d96dc6b9afdcc50f502dc08e0380f",
"score": "0.6681736",
"text": "def letter_case_count2(string)\n result = {}\n result[:lowercase] = string.count('a-z')\n result[:uppercase] = string.count('A-Z')\n result[:neither] = string.count('^A-Za-z')\n result\nend",
"title": ""
},
{
"docid": "648dea41fb3a0172fd97365196005fb0",
"score": "0.66537625",
"text": "def letter_case_count(str)\n results = {}\n chars_arr = str.chars\n results[:lowercase] = chars_arr.count { |char| ('a'..'z').include?(char) }\n results[:uppercase] = chars_arr.count { |char| ('A'..'Z').include?(char) }\n results[:neither] = chars_arr.size - results[:lowercase] - results[:uppercase]\nend",
"title": ""
},
{
"docid": "fce10f778610781355535037aed64efa",
"score": "0.66536605",
"text": "def letter_case_count(string)\n lowercase = string.gsub(/[^a-z]/, '').size\n uppercase = string.gsub(/[^A-Z]/, '').size\n neither = string.gsub(/[a-z]/i, '').size\n { lowercase: lowercase,\n uppercase: uppercase,\n neither: neither}\nend",
"title": ""
},
{
"docid": "8aebb7e5b1f04365d498b1bec0df43bf",
"score": "0.6651198",
"text": "def accum(s)\n result = \"\"\n num_letters = 1\n \n s.chars.each do |letter|\n result += letter.upcase\n (num_letters - 1).times do\n result += letter.downcase\n end\n break if s.length == num_letters\n result += \"-\"\n num_letters += 1\n end\n \n result\nend",
"title": ""
},
{
"docid": "65f9aaa4dbf775f3c4afb46e84e26d29",
"score": "0.6651039",
"text": "def accum(s)\n alphabet = (\"a\"..\"z\")\n\n s.downcase.split(//)\n .map.with_index { |char, i| char.upcase + char * i }.join(\"-\")\nend",
"title": ""
},
{
"docid": "065c2f50e406bca4eb40f8a9eb2c81ca",
"score": "0.6650241",
"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": "4665c994568a36a6b9bc73fce4e83b0f",
"score": "0.66493404",
"text": "def letter_case_count(str)\n lcase_counter = 0\n ucase_counter = 0\n neither_counter = 0\n\n str.chars.each do |char|\n if char.match?(/[a-z]/)\n lcase_counter += 1\n elsif char.match?(/[A-Z]/)\n ucase_counter += 1\n else\n neither_counter += 1\n end\n end\n { lowercase: lcase_counter, uppercase: ucase_counter, neither: neither_counter}\nend",
"title": ""
},
{
"docid": "fb7e48e30b694538d2364768a4501b09",
"score": "0.66474897",
"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": "8476aaad3a677a485a7a73ac4ece023b",
"score": "0.6646384",
"text": "def letter_counts(s)\n s.chars.group_by { |c| c }.map { |k, v| [k, v.length] }.to_h\nend",
"title": ""
},
{
"docid": "18023699a8e2eb752e7c2eb747e06464",
"score": "0.66450846",
"text": "def letter_counts(word)\n hsh = Hash.new(0)\n word.chars.each { |ch| hsh[ch] += 1 }\n hsh\nend",
"title": ""
},
{
"docid": "d386e6ab60a9f086ff1adff235298bd4",
"score": "0.66369635",
"text": "def letter_case_count(string)\n counts = {lowercase: 0, uppercase: 0, neither: 0}\n\n string.each_char do |char|\n if (\"a\"..\"z\").include? char\n counts[:lowercase] += 1\n elsif (\"A\"..\"Z\").include? char\n counts[:uppercase] += 1\n else\n counts[:neither] +=1\n end\n end\n\n counts\nend",
"title": ""
},
{
"docid": "b6a305a4c63d01f69b7ef4fcb5fe1b24",
"score": "0.6634209",
"text": "def letter_case_counts(string) # count letter case occurences\n letter_count = {:lowercase => 0, :uppercase => 0, :neither => 0}\n string.chars.each do |char|\n case char\n when /[a-z]/ then letter_count[:lowercase] += 1\n when /[A-Z]/ then letter_count[:uppercase] += 1\n else letter_count[:neither] += 1\n end\n end\n letter_count\nend",
"title": ""
},
{
"docid": "c5b4c642571a4c054356d9cdf7a65f36",
"score": "0.66226566",
"text": "def rampant_repeats(string, hash)\n answer = \"\"\n string.each_char do |letter|\n if hash.include?(letter)\n hash[letter].times { answer << letter}\n else\n answer << letter\n end\n end\n answer\nend",
"title": ""
},
{
"docid": "054ffded26f3d7b27ee13d138355ec57",
"score": "0.6621905",
"text": "def character_count(stringthing)\n letter_count = {}\n last_char = nil\n char_one_two_three = 0\n stringthing.each_char do |char|\n char = char.downcase\n if char != last_char\n char_one_two_three = 1\n else\n char_one_two_three += 1\n end\n last_char = char\n letter_count[char] = char_one_two_three if (letter_count[char]||0) < char_one_two_three\n end\nletter_count\nend",
"title": ""
},
{
"docid": "452e37de69a7ee62130c0142acc362a3",
"score": "0.66209114",
"text": "def letter_case_count(str)\n case_hash = { lowercase: 0, uppercase: 0, neither: 0 }\n\n case_hash[:lowercase] = str.scan(/[a-z]/).count\n case_hash[:uppercase] = str.scan(/[A-Z]/).count\n case_hash[:neither] = str.scan(/[^A-z]/).count\n case_hash\nend",
"title": ""
},
{
"docid": "027d7ce7879ffbd2dae5b540ea1e4943",
"score": "0.66165876",
"text": "def count_upcased_letters(string)\n # per ogni carattere contenuto nella stringa controllo che sia una lettera e che sia maiuscola\n numeroUppercase = 0\n string.chars.each do |valore|\n if(valore == valore.upcase)\n if(valore >= 'A' && valore <= 'Z')\n numeroUppercase+=1\n end\n end\n end\n numeroUppercase\nend",
"title": ""
},
{
"docid": "4383d38e88c0eeef401c148d9873a1a6",
"score": "0.66121876",
"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.66121876",
"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": "d08a337a479f534efefe71ebc08d8d02",
"score": "0.66102725",
"text": "def letter_count(str)\n letter_hash = Hash.new(0)\n\n str.downcase.each_char do |char|\n letter_hash[char] +=1 unless char == \" \"\n end\n letter_hash\nend",
"title": ""
},
{
"docid": "b00fc23ee4270059875324de7c8fccb2",
"score": "0.66084146",
"text": "def staggered_case(str)\n alpha_counter = 0\n arr = str.chars\n arr.map do |el|\n alpha_counter += 1 if el =~ /[A-Za-z]/\n alpha_counter.odd? ? el.upcase : el.downcase\n end.join\nend",
"title": ""
},
{
"docid": "ef9a6e842eea9b59fc0cfa32aa7350a8",
"score": "0.6605504",
"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": "18e24910dcb4997136b369b9733813b4",
"score": "0.6605007",
"text": "def format_upcase_alphanumeric(input, bytes)\n format_alphanumeric(input.to_s.upcase, bytes)\n end",
"title": ""
},
{
"docid": "593b8e85a3721ce2237e6038c6dc434a",
"score": "0.6603283",
"text": "def letter_counts(word)\n letters_hash = Hash.new(0)\n word.chars { |char| letters_hash[char] += 1 }\n letters_hash\nend",
"title": ""
},
{
"docid": "dc293019bf16876134c92a35b9d18b37",
"score": "0.6601018",
"text": "def letter_counts(word)\n hash = Hash.new(0)\n word.each_char {|ltr| hash[ltr] += 1}\n hash\nend",
"title": ""
},
{
"docid": "cabb0116758818e7950b7419ade95ebe",
"score": "0.6591491",
"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": "855957c540405d3f0d701cad69e05459",
"score": "0.6591257",
"text": "def letter_case_count(string)\n lowercase = string.gsub(/[^a-z]/, '').size\n uppercase = string.gsub(/[^A-Z]/, '').size\n neither = string.delete('a-zA-Z').size\n { lowercase: lowercase, uppercase: uppercase, neither: neither }\nend",
"title": ""
},
{
"docid": "a9964ca68c60a2f7d5f423974cf4afdc",
"score": "0.6589445",
"text": "def letter_counts(word)\n hash = Hash.new(0)\n word.chars.each { |ch| hash[ch] += 1}\n hash\nend",
"title": ""
},
{
"docid": "c1314e09d8e6db17f56cc5b35be7a15d",
"score": "0.6581082",
"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": "f36c63718a8dfea950849f12025dbfe1",
"score": "0.65803105",
"text": "def ic (str)\n\tstr_len = str.length\n\tindc = 0\n\tbase = 97\n\tfor x in (0..25)\n\t\tchar = (Integer(base)+x).chr\n\t\tch_count = str.downcase.count(char)\n\t\tlen = str_len.to_f\n\t\tindc += (((ch_count)*(ch_count-1))/((len)*(len-1)))\n\tend\n\tindc\nend",
"title": ""
},
{
"docid": "7ee5ca63baa56af78f396b06856601de",
"score": "0.6565426",
"text": "def hand_score(str)\nhash = {\"A\" => 4, \"K\" => 3,\"Q\" => 2, \"J\" => 1}\ncount = 0\nstr.each_char{|char| count += hash[char.upcase] if hash.has_key?(char.upcase)}\ncount\nend",
"title": ""
},
{
"docid": "fbc4af549b32f1071a365bfe23575e06",
"score": "0.6556511",
"text": "def letter_case_count(string)\n char_counter = {}\n \n char_counter[:lowercase] = string.scan(/[a-z]/).count\n char_counter[:uppercase] = string.scan(/[A-Z]/).count\n char_counter[:neither] = string.scan(/[^a-z]/i).count\n \n char_counter\nend",
"title": ""
},
{
"docid": "34f0a61083da09228137242a669b0abe",
"score": "0.6552945",
"text": "def rampant_repeats(string, hash)\n new_str = \"\"\n\n string.each_char do |char|\n if hash[char] \n hash[char].times { new_str += char }\n else\n new_str += char\n end\n end\n\n new_str\nend",
"title": ""
},
{
"docid": "d2a3e0e75c957c03b2ac1d96265880bb",
"score": "0.65432775",
"text": "def duplicate_encode(word)\n letter_set = {}\n return_value = word.downcase\n\n # iterate through once to establish hash of letter occurences \n 0.upto(return_value.length - 1) do |index|\n val = return_value[index]\n letter_set[val] = letter_set[val] ? letter_set[val] += 1 : letter_set[val] = 1\n end\n\n # iterate through once to build return value based on hash values\n 0.upto(return_value.length - 1) do |index|\n val = return_value[index] \n return_value[index] = letter_set[val] > 1 ? \")\" : \"(\"\n end\n return return_value\nend",
"title": ""
},
{
"docid": "444a903c776ec5579133c48d4c2c3d47",
"score": "0.65383977",
"text": "def letter_percentages(string)\n hash = {}\n array = string.chars\n multiplier = 100 / string.size.to_f\n hash[:lowercase] = ((array.count { |char| char =~ /[a-z]/ }) * multiplier).round(2)\n hash[:uppercase] = ((array.count { |char| char =~ /[A-Z]/ }) * multiplier).round(2)\n hash[:neither] = ((array.count { |char| char =~ /[^a-zA-Z]/ }) * multiplier).round(2)\n hash\nend",
"title": ""
},
{
"docid": "2a89bcd3d6d12a67e506781f31bb0c5d",
"score": "0.6534208",
"text": "def staggered_case2(str)\n counter = 0\n staggered_str = ''\n\n str.chars.each do |char|\n if ('a'..'z').include?(char) || ('A'..'Z').include?(char)\n staggered_str << char.upcase if counter.even?\n staggered_str << char.downcase if counter.odd?\n counter += 1\n else\n staggered_str << char\n end\n end\n staggered_str\nend",
"title": ""
},
{
"docid": "4b0affcb87c7c52f198e3f87442d2622",
"score": "0.65296495",
"text": "def rampant_repeats(str, hash)\n newStr = []\n str.split(\"\").each do |letter|\n if hash.keys.include?(letter)\n hash[letter].times do \n newStr << letter\n end\n else\n newStr << letter\n end\n end\n newStr.join(\"\")\nend",
"title": ""
},
{
"docid": "9a1f11edfb09c9c3a1f4d3a6593a1d6b",
"score": "0.6527342",
"text": "def letter_percentages(str)\n return_hash = { lowercase: 0, uppercase: 0, neither: 0 }\n individ_value = (1.0 / str.length) * 100\n arr = str.chars\n arr.each do |char|\n if char =~ /[a-z]/\n return_hash[:lowercase] += individ_value\n elsif char =~ /[A-Z]/\n return_hash[:uppercase] += individ_value\n else\n return_hash[:neither] += individ_value\n end\n end\n return_hash \nend",
"title": ""
},
{
"docid": "d94cd65d354d46553adceaee97351146",
"score": "0.6523498",
"text": "def accum(s)\\\n s.chars.each_with_index.map do |letter, index|\n letter.upcase + (letter.downcase * index)\n end.join('-')\nend",
"title": ""
},
{
"docid": "23d9de4f9268bdf469be0313215c7dc2",
"score": "0.65232325",
"text": "def letter_case_count(string)\n counts = {}\n characters = string.chars\n counts[:lowercase] = characters.count {|char| char =~ /[a-z]/ }\n counts[:uppercase] = characters.count {|char| char =~ /[A_Z]/ }\n counts[:neither] = characters.count {|char| char =~ /[^A-Za-z]/ }\n p counts\n\nend",
"title": ""
},
{
"docid": "0f19a97ef83c4a26f0de9dfe8c710339",
"score": "0.6518494",
"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": "6ec7115fcac80db39d6c6dc53dfebf5b",
"score": "0.65144396",
"text": "def letter_case_count(string)\n array_of_chars = string.chars\n \n result = { :uppercase => 0, :lowercase => 0, :neither => 0 }\n \n array_of_chars.each do |char|\n if char =~ /[a-zA-Z]/\n if char == char.upcase\n result[:uppercase] += 1\n else \n result[:lowercase] += 1\n end\n else\n result[:neither] += 1\n end\n end\n \n result\n \n \nend",
"title": ""
},
{
"docid": "c03d9ee9cc4025bad09851e1382d7a89",
"score": "0.6512094",
"text": "def accum(s)\n s.chars.each_with_index.map{ |c, i| c.upcase + c.downcase * i }.join('-')\nend",
"title": ""
},
{
"docid": "c03d9ee9cc4025bad09851e1382d7a89",
"score": "0.6512094",
"text": "def accum(s)\n s.chars.each_with_index.map{ |c, i| c.upcase + c.downcase * i }.join('-')\nend",
"title": ""
},
{
"docid": "a8ddcd6f74ebc03230f7566a70e71e3a",
"score": "0.6508619",
"text": "def letter_case_count(string)\n counts = {}\n characters = string.chars\n counts[:lowercase] = characters.count { |char| char =~ /[a-z]/ }\n counts[:uppercase] = characters.count { |char| char =~ /[A-Z]/ }\n counts[:neither] = characters.count { |char| char =~ /[^A-Za-z]/ }\n counts\nend",
"title": ""
},
{
"docid": "a8ddcd6f74ebc03230f7566a70e71e3a",
"score": "0.6508619",
"text": "def letter_case_count(string)\n counts = {}\n characters = string.chars\n counts[:lowercase] = characters.count { |char| char =~ /[a-z]/ }\n counts[:uppercase] = characters.count { |char| char =~ /[A-Z]/ }\n counts[:neither] = characters.count { |char| char =~ /[^A-Za-z]/ }\n counts\nend",
"title": ""
},
{
"docid": "a8ddcd6f74ebc03230f7566a70e71e3a",
"score": "0.6508619",
"text": "def letter_case_count(string)\n counts = {}\n characters = string.chars\n counts[:lowercase] = characters.count { |char| char =~ /[a-z]/ }\n counts[:uppercase] = characters.count { |char| char =~ /[A-Z]/ }\n counts[:neither] = characters.count { |char| char =~ /[^A-Za-z]/ }\n counts\nend",
"title": ""
},
{
"docid": "a8ddcd6f74ebc03230f7566a70e71e3a",
"score": "0.6508619",
"text": "def letter_case_count(string)\n counts = {}\n characters = string.chars\n counts[:lowercase] = characters.count { |char| char =~ /[a-z]/ }\n counts[:uppercase] = characters.count { |char| char =~ /[A-Z]/ }\n counts[:neither] = characters.count { |char| char =~ /[^A-Za-z]/ }\n counts\nend",
"title": ""
},
{
"docid": "3998d111ba1262e5edb3ade8697207af",
"score": "0.6507931",
"text": "def letter_case_count_2(string)\n results = {}\n characters = string.chars\n\n results[:lowercase] = characters.count { |x| x =~ /[a-z]/ }\n results[:uppercase] = characters.count { |x| x =~ /[A-Z]/ }\n results[:neither] = characters.count { |x| x =~ /[^A-Za-z]/ }\n\n results\nend",
"title": ""
}
] |
f7cc228175ee4399d9ae406aeefb500e
|
GET /companies/1 or /companies/1.json
|
[
{
"docid": "4e928b4d41387c2b26d2fb7514db13fb",
"score": "0.0",
"text": "def show\n if @company.user == current_user\n render \"show\"\n else\n redirect_to root_path\n end\n end",
"title": ""
}
] |
[
{
"docid": "9970eb7522eae154b5ab58faddef365a",
"score": "0.7452413",
"text": "def query_companies(options={}) path = \"/api/v2/companies\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "64a989c42306e451f5c5357fba4725c0",
"score": "0.7358159",
"text": "def companies\n @companies = AccountingEntity.find(params[:id]).companies\n\n respond_to do |format|\n format.html { render \"companies/index.html\" } # show.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "2254e965be735b7beae359d1da29e0ca",
"score": "0.7312172",
"text": "def company(company_number)\n get(\"/company/#{company_number}\")\n end",
"title": ""
},
{
"docid": "40ad535dd874715dcd0fde5ad67bfb7a",
"score": "0.72778",
"text": "def index\n @company = Company.find(current_user.company.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "fe105c06f484ca17edd478a76b065da0",
"score": "0.7265496",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "fe105c06f484ca17edd478a76b065da0",
"score": "0.7265496",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "fe105c06f484ca17edd478a76b065da0",
"score": "0.7265496",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "d8b788adb05f3ec0c4f2dc948480c3dd",
"score": "0.7251005",
"text": "def index\n @companies = Company.limit(100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "e72d1f53ccf8c1a0e8ea9c0209a7faa4",
"score": "0.7241418",
"text": "def get_company\n render json: {company: Company.find(params[:id]), persons: Person.where(company_id: params[:id])}.to_json\n end",
"title": ""
},
{
"docid": "f676b52d64089a01b79a90cd3b112fc9",
"score": "0.723658",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "7aa314e51471217077d979025ff74965",
"score": "0.7231208",
"text": "def get_company(id, options={}) path = \"/api/v2/companies/#{id}\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "d939cfac054bccce927d8ebfe9ccbb04",
"score": "0.722543",
"text": "def index\n # specifying json format in the URl\n\t\turi = \"#{API_BASE_URL}/companies.json\"\n\t\t\n # It will create new rest-client resource so that we can call different methods of it\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n # this next line will give you back all the details in json format, \n #but it will be wrapped as a string, so we will parse it in the next step.\n \n companies = rest_resource.get\n\n # we will convert the return data into an array of hash. see json data parsing here\n @companies = JSON.parse(companies, :symbolize_names => true)\n end",
"title": ""
},
{
"docid": "200e1c0a7174ad022376e292019325cb",
"score": "0.71806914",
"text": "def get_companies_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CompaniesApi.get_companies ...\"\n end\n # resource path\n local_var_path = \"/v1/companies\".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', 'text/json', 'application/bson', 'text/xml']\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 = []\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'CompanyCollectionResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CompaniesApi#get_companies\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "955d75f19747940f486c9e073e09c51f",
"score": "0.7157925",
"text": "def index\n @companies = Company.all\n respond_to do |format|\n format.json { render :json => @companies }\n end\n end",
"title": ""
},
{
"docid": "e7005718bfc78f5d7995acd47b9bdf8e",
"score": "0.7157584",
"text": "def show\n @company = Company.find(params[:id])\n render json: @company\n end",
"title": ""
},
{
"docid": "2a6c0f69ccd107416f95f50d5c781b8d",
"score": "0.71529794",
"text": "def show\n @company = Company.find(params[:id])\n\n render json: @company\n end",
"title": ""
},
{
"docid": "9ceb4b9bc8b5a4227697de747779f229",
"score": "0.71160907",
"text": "def index\n @companies = Company.all(:order => :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "7a8588f761cb38d4d5cca6ffcac47524",
"score": "0.7071655",
"text": "def index\n if read_from_cache(\"companies\")\n companies = read_from_cache(\"companies\")\n else\n companies = apply_scopes(Company).all\n write_to_cache(\"companies\", companies)\n end\n render :json => companies\n end",
"title": ""
},
{
"docid": "af3dc15078ea126684288664a7dafd24",
"score": "0.7060831",
"text": "def index\r\n @user = User.find(current_user.id)\r\n @companies = Company.find_by(user_id: @user.id)\r\n print @companies.inspect\r\n if !@companies.nil?\r\n return render json: @companies\r\n else\r\n return render json:{ \"error\": \"No company\" }, status: 200\r\n end\r\n end",
"title": ""
},
{
"docid": "2ab47abf46b4a34884123eac73528fb5",
"score": "0.70305896",
"text": "def companies!\n mashup(self.class.get(\"/\", :query => method_params('aj.jobs.getCompanies'))).companies.company\n end",
"title": ""
},
{
"docid": "66df2a94e98bb144f42ebc71f4f44e8f",
"score": "0.7015967",
"text": "def company(company, options = {})\n get \"#{company_path(company)}\", options\n end",
"title": ""
},
{
"docid": "7f815f45c3bd9c2e05e07cc6de11c575",
"score": "0.70056254",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "7f815f45c3bd9c2e05e07cc6de11c575",
"score": "0.70056254",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "7f815f45c3bd9c2e05e07cc6de11c575",
"score": "0.70056254",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "7f815f45c3bd9c2e05e07cc6de11c575",
"score": "0.70056254",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "7f815f45c3bd9c2e05e07cc6de11c575",
"score": "0.70056254",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "7f815f45c3bd9c2e05e07cc6de11c575",
"score": "0.70056254",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "7f815f45c3bd9c2e05e07cc6de11c575",
"score": "0.70056254",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "afdb98801882d6eee5a25e69817a58bc",
"score": "0.698874",
"text": "def index\n @response = HTTParty.get(\"https://rails-api-ipo.herokuapp.com/api/v1/companies.json\")\n @companies = []\n @response.each do |comp|\n @companies.push(comp)\n end\n end",
"title": ""
},
{
"docid": "9fe5b74350eb744599a9ac97ec3148b4",
"score": "0.69784665",
"text": "def index\n @companies = current_user.company.agencies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "b33be5ed306ed579960bbd4fb93f3dce",
"score": "0.69709224",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @company }\n end\n end",
"title": ""
},
{
"docid": "b33be5ed306ed579960bbd4fb93f3dce",
"score": "0.69709224",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @company }\n end\n end",
"title": ""
},
{
"docid": "0be93b73ededca8ef89d938f8fc7622c",
"score": "0.6969501",
"text": "def get(company_name)\n @options = { :query => { v: \"1\", format: \"json\",\n userip: \"192.168.43.42\", useragent: \"Chrome\",\n action: \"employers\",\n \"t.p\".to_sym => \"84632\",\n \"t.k\".to_sym => \"fQ8QKWEsfxG\" } }\n @options[:query][:q] = company_name\n response = self.class.get(\"/api/api.htm\", @options)\n trim_response(response)\n end",
"title": ""
},
{
"docid": "37c8cef3f1238bceb2b6d04ede329927",
"score": "0.6943475",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # _show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "522e2d10821eb1e4903eab07697a647d",
"score": "0.69433695",
"text": "def list\n @companies = Company.order('updated_at desc').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "a7e4bacd5e741296f6fc8950d6ecd984",
"score": "0.6928552",
"text": "def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @company }\n end\n end",
"title": ""
},
{
"docid": "862098fdb55943ceb090168850ccec1a",
"score": "0.68471247",
"text": "def index\n @companies = Company.page(params[:page])\n\n respond_with(@companies)\n end",
"title": ""
},
{
"docid": "703fe70807df847acd0dbe9373c6b4c9",
"score": "0.68454903",
"text": "def show\n respond_to do |format|\n format.json { render :json => { company: @company} }\n end\n end",
"title": ""
},
{
"docid": "d2335929815d2bb1f27e951a0ade9d07",
"score": "0.6829493",
"text": "def api_companies_get(opts = {})\n api_companies_get_with_http_info(opts)\n nil\n end",
"title": ""
},
{
"docid": "6f9b509f33e6371952f3dc163fb06e6b",
"score": "0.6828633",
"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": "65245d7f1b68a125554932f550fabca9",
"score": "0.6826153",
"text": "def selected_company\n begin\n companies = Company.find(params[:id])\n rescue\n end\n render :json => [{'company_house_number' => companies.house_number, 'company_street' => companies.street, 'company_colony' => companies.colony, 'company_landmark' => companies.landmark, 'company_city' => companies.city, 'company_zipcode' => companies.zipcode, 'company_state' => companies.state}].to_json\n end",
"title": ""
},
{
"docid": "7a30a8b4271a8408fc987f488d371f32",
"score": "0.68205464",
"text": "def company(company_number)\n options = { basic_auth: @auth }\n options.merge!(proxy)\n self.class.get(\"/company/#{company_number}\", options)\n end",
"title": ""
},
{
"docid": "4800be47066241338c6648499bcb2805",
"score": "0.6794817",
"text": "def show\n company = Company.find_by_id(params[:id])\n if company.blank?\n render(\n json: {\n error: {\n code: 404,\n message: \"Company not found\",\n errors: {\n message: \"Company not found\"\n }\n }\n })\n return\n end\n\n render json: {\n data: {\n kind: Company.name,\n id: company.id,\n company: company.as_json(include: :industry)\n }\n }\n end",
"title": ""
},
{
"docid": "98aa246c7751a038903d588cd5701580",
"score": "0.6761986",
"text": "def index\n # print companies\n # byebug\n\n render json: @companies, include: :city, except: :city_id\n end",
"title": ""
},
{
"docid": "2ad5814a1028304cccc7832896ba8694",
"score": "0.67358166",
"text": "def companies\n render json: Company.all.to_json\n end",
"title": ""
},
{
"docid": "9345652c2357b592946df9d75013357a",
"score": "0.6730568",
"text": "def show\n\n\t\t \t@company = Company.find(params[:id])\n\n\t\t respond_to do |format|\n\t\t format.html\n\t\t format.json { render :json => @company}\n\t\t end\n\n\t\t end",
"title": ""
},
{
"docid": "021e043f33b2cde0e76d872fb63b423b",
"score": "0.6727202",
"text": "def index\n @content_for_title = \"Мои компании\"\n @companies = @current_user.companies.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "ae2a282909c3b6a03bd9b15f211b0be0",
"score": "0.672714",
"text": "def api_companies_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.api_companies_get ...'\n end\n # resource path\n local_var_path = '/api/companies'\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 = ['Basic']\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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_companies_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ad25b541a9838e07b046124ee224be74",
"score": "0.6722593",
"text": "def index # - the response gives us the id that was injected by the company_scope gem!\n render json: {\n my_company_id: \"#{MyCompany.current_id}\",\n }, status: 200\n end",
"title": ""
},
{
"docid": "eb8cf7486355003e6fbe7fcbc33b2101",
"score": "0.6719457",
"text": "def show\n # Show a specific record\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "a8cbd642f06149fcd45d972b1bbf54dc",
"score": "0.6719279",
"text": "def index\n @companies = @klass.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "b2b4a8bb8e20a0d304135108a0597e4f",
"score": "0.6710379",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "3a7fab706270f315d7610a1a5769ad53",
"score": "0.6689805",
"text": "def show\n @company = Company.find(params[:id])\n if @company.owners.present?\n owners = @company.owners.split(\",\").map { |s| s.to_i }\n @owners = Company.find(owners)\n else\n @owners = []\n end\n if @company.properties.present?\n properties = @company.properties.split(\",\").map { |s| s.to_i }\n @properties = Company.find(properties)\n else\n @properties = []\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "410d69f14d53dea3322983107597e196",
"score": "0.6670424",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "464547d85980038a7d4e8c15c1b3c49f",
"score": "0.66611415",
"text": "def show\n @company = Company.find(params[:id])\n @jobs = @company.jobs\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "01db3aff0fc766f2b48e58b527adead7",
"score": "0.66558534",
"text": "def list_companies_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CompaniesApi.list_companies ...'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling CompaniesApi.list_companies, must be smaller than or equal to 200.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling CompaniesApi.list_companies, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling CompaniesApi.list_companies, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/companies'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'SimpleCompanies'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['basicAuth', 'oAuth2ClientCredentials']\n\n new_options = opts.merge(\n :operation => :\"CompaniesApi.list_companies\",\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: CompaniesApi#list_companies\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "63224b37940bf0972cdaa2cd6ff654d6",
"score": "0.66521025",
"text": "def index\n @companies = Company.all\n paginate json: @companies\n end",
"title": ""
},
{
"docid": "823108bebaea5b7ac71d37494684b9b1",
"score": "0.66482764",
"text": "def show\n @title = 'About us'\n @company = Company.find(COMPANY_ID)\n #@company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "08862bf5423bd6b9fed662ce21054edb",
"score": "0.6645165",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @company }\n end\n end",
"title": ""
},
{
"docid": "4fa20e078c0afc52591823e4603dcc50",
"score": "0.66036254",
"text": "def show\n @company = Company.find(params[:id])\n # @investments= CompanInvestment.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "585f090b8e66a4394def1e20a689d327",
"score": "0.65989155",
"text": "def companies\n @companies = Company.search(params[:search], params[:column]).order(sort_column(Company, 'company_type') + ' ' + sort_direction)\n\n #Returns set of companies in order based on parameters\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "974f18f53d4e4ca3ae1d27357fc2d32a",
"score": "0.6598619",
"text": "def company_info(company_id, *fields)\r\n field_selector = (fields != nil && fields.any?) ? \":(#{fields.join(',')})\" : ''\r\n get(\"/companies/#{company_id}#{field_selector}\")\r\n end",
"title": ""
},
{
"docid": "60a0697ace991261cfa04ffbc0eb036f",
"score": "0.6595076",
"text": "def index\n @member_companies = MemberCompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: MemberCompany.only(\"name\", \"_id\") } # should move the limited output to API \n end\n end",
"title": ""
},
{
"docid": "c981b190afbe81ab8f2ac12e0f847780",
"score": "0.65804464",
"text": "def companies( offset = 0, limit = 50)\n response = HTTParty.get(JobBox.base_uri+\"/companies.json?offset=#{offset}&limit=#{limit}\", :headers => self.headers)\n if response.success?\n response\n else\n raise response.response\n end\n end",
"title": ""
},
{
"docid": "9cea8f34a48e3bf8d37c6382627f3252",
"score": "0.6578176",
"text": "def index\n @companies = Company.find(:all, order: japanese? ? \"kana\" : \"ascii\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "66c694147d4db2662f8d9826d3d4bfd5",
"score": "0.6552842",
"text": "def index\n # Show all companies, order the results and paginate it\n @companies = Company.search(params[:search], params[:column]).order(sort_column(Company, 'company_type') + ' ' + sort_direction).page(params[:page]).per(10)\n \n get_params()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "2ac0d9e056a95ca1e4bffa5517cb55cb",
"score": "0.65524834",
"text": "def detail(options = {})\n options.merge!({:query_type => 'company_detail'})\n self.class.get(\"/\", :query => options)\n end",
"title": ""
},
{
"docid": "8e6e4fd3d690d943c9e3ec3e42a8b024",
"score": "0.65429336",
"text": "def show\n @company = Company.find(current_user.company.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "ece97f139c776af6366a33377f14de47",
"score": "0.65248346",
"text": "def show\n @company = Company.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "90c1df601e33091c54e25f22881c528b",
"score": "0.65131176",
"text": "def index\n @holdcompanies = Holdcompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holdcompanies }\n end\n end",
"title": ""
},
{
"docid": "cf2ae507282b135ec40a8c51f19098b1",
"score": "0.6490343",
"text": "def index\n @companies = Company.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"title": ""
},
{
"docid": "9bac4424f92d054157fac22473b621f9",
"score": "0.6489437",
"text": "def companies( offset = 0, limit = 50)\n response = self.class.get(self.base_uri+\"/companies.json?offset=#{offset}&limit=#{limit}\", :headers => self.headers)\n if response.success?\n response\n else\n raise response.response\n end\n end",
"title": ""
},
{
"docid": "2146a746455e57a577017ba0eb162634",
"score": "0.6485633",
"text": "def index\n\n if @current_user.admin?\n @v1_admin_companies = V1::Admin::Company.all\n render json: @v1_admin_companies\n else\n head :forbidden\n end\n end",
"title": ""
},
{
"docid": "5b0e8786f466ad0da6251606183a4f14",
"score": "0.64733624",
"text": "def show\n @companyp = Companyp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @companyp }\n end\n end",
"title": ""
},
{
"docid": "3b154f264f1a447445d392c35c13473f",
"score": "0.64733005",
"text": "def get_company\n begin\n @company = Company.find(params[:id])\n rescue\n redirect_to companys_path\n end\n end",
"title": ""
},
{
"docid": "4f99774b007e4c30d49824af3d98836c",
"score": "0.64493126",
"text": "def show\n @breadcrumb = 'read'\n @organization = Organization.find(params[:id])\n @companies = @organization.companies\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @organization }\n end\n end",
"title": ""
},
{
"docid": "e7afe00203c1bb61070905a16d535f43",
"score": "0.64458394",
"text": "def index\n @title = \"Страховые компании\"\n @insurance_companies = InsuranceCompany.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_companies }\n end\n end",
"title": ""
},
{
"docid": "e6ca8d152c9deb2293e576ce077cc5a6",
"score": "0.6428557",
"text": "def index\n @companies = Company.includes(:employees).order(\"LOWER(name)\")\n\n respond_to do |format|\n format.html { render :layout => \"application_fluid\" }\n format.json { render json: @companies }\n end\n end",
"title": ""
},
{
"docid": "0789ba577976235ff9f512aaa580f4ae",
"score": "0.6417685",
"text": "def index\n if params[:status]\n @status = params[:status]\n else\n @status = 2\n end\n\n @companies = Company.where(status: @status)\n end",
"title": ""
},
{
"docid": "2455112d2f74cfcdcde58e98f134d852",
"score": "0.64167327",
"text": "def company\n fetch('silicon_valley.companies')\n end",
"title": ""
},
{
"docid": "291c99bfaedf5375dd8b4d1edb8aec10",
"score": "0.6415984",
"text": "def index\n @companies = current_user.companies\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"title": ""
},
{
"docid": "d03b4c68c1c3102353b96b8b8552f7cc",
"score": "0.6415079",
"text": "def show\n @admin_company = Admin::Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_company }\n end\n end",
"title": ""
},
{
"docid": "12de999e483afed7488a971a46813b5f",
"score": "0.6413466",
"text": "def competitors(options = {})\n options.merge!({:query_type => 'company_competitors'})\n self.class.get(\"/\", :query => options)\n end",
"title": ""
},
{
"docid": "7e7de9d615a2c16759f137d98fb11196",
"score": "0.6406376",
"text": "def index\n @companies = if params[:term]\n Company.where('name LIKE ?', \"%#{params[:term]}%\")\n else\n Company.paginate(:page => params[:page])\n end\n render json: @companies\n end",
"title": ""
},
{
"docid": "a7a1328ad162fb9f42ecbc2f721abda3",
"score": "0.6400535",
"text": "def index\n @companies = search_companies\n end",
"title": ""
},
{
"docid": "c7955075d131fd31203a84af643971e9",
"score": "0.63971865",
"text": "def index\n\t\t@company = Company.find(params[:company_id])\n\tend",
"title": ""
},
{
"docid": "4f62750d4e3261ba4a235c6b585b83a8",
"score": "0.6397159",
"text": "def get_company\n @company = Company.find(params[:company_id])\n end",
"title": ""
},
{
"docid": "40f41f6cafb3109a09f0a4877dd383d1",
"score": "0.63860637",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"title": ""
},
{
"docid": "40f41f6cafb3109a09f0a4877dd383d1",
"score": "0.63860637",
"text": "def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"title": ""
},
{
"docid": "450306669cdd0fafd15db5124c229475",
"score": "0.6378457",
"text": "def company_info(company_id, *fields)\n get(\"/organizations/#{company_id}#{field_selector(fields)}\")\n end",
"title": ""
},
{
"docid": "d896e268098511e79f27da8d0821b94d",
"score": "0.63633484",
"text": "def index\n Rack::MiniProfiler.step(\"fetch companies\") do\n @companies = Company.all\n end\n end",
"title": ""
},
{
"docid": "3cf18e9c3d48894b74ce7812bfe4f16b",
"score": "0.6358708",
"text": "def show\n @saved_company = SavedCompany.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @saved_company }\n end\n end",
"title": ""
},
{
"docid": "65c6c8491f00dedf08197cb1ecf5c821",
"score": "0.63572377",
"text": "def show\n @customer_company = Customer.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer_company }\n end\n end",
"title": ""
},
{
"docid": "4cd3f86dde68dd5e0e5c27132f6bcff3",
"score": "0.6355663",
"text": "def show\n @fx_company = FxCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fx_company }\n end\n end",
"title": ""
},
{
"docid": "6059d47704b16a8c78c87291d5b7f289",
"score": "0.6353524",
"text": "def show\n @company_contact = CompanyContact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company_contact }\n end\n end",
"title": ""
},
{
"docid": "b0671abfa37eb14e98e6d18442275455",
"score": "0.6353394",
"text": "def index\n @companies = Company.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"title": ""
},
{
"docid": "67cf1330275272331b02859eb1dbc49e",
"score": "0.6347183",
"text": "def index\n\t\t@companies = Company.all\n\tend",
"title": ""
},
{
"docid": "67cf1330275272331b02859eb1dbc49e",
"score": "0.6347183",
"text": "def index\n\t\t@companies = Company.all\n\tend",
"title": ""
},
{
"docid": "67cf1330275272331b02859eb1dbc49e",
"score": "0.6347183",
"text": "def index\n\t\t@companies = Company.all\n\tend",
"title": ""
},
{
"docid": "55a5b0a8e7a5b78552246d1464f696d7",
"score": "0.63455015",
"text": "def index\n users = User.all.where(company_id:nil)\n json_response(users)\n end",
"title": ""
},
{
"docid": "8f539348839ee38f74b3e3500d01b9d6",
"score": "0.6344231",
"text": "def index\n @company_memberships = CompanyMembership.where(company_id: current_company.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @company_memberships, :meta => {:current_user => current_user, :current_company => current_company} }\n end\n end",
"title": ""
}
] |
fec9744183a95a5ea0ff1b6e5bb0cf4d
|
POST /child_categories POST /child_categories.json
|
[
{
"docid": "c740da5519d06fcf1c6598c2bb9b0fc4",
"score": "0.7262976",
"text": "def create\n @child_category = ChildCategory.new(params[:child_category])\n\n respond_to do |format|\n if @child_category.save\n format.html { redirect_to @child_category, notice: 'Child category was successfully created.' }\n format.json { render json: @child_category, status: :created, location: @child_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @child_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "43f66f7bcbf5dc18ce1be5b108cc5842",
"score": "0.7213602",
"text": "def create\n @category = Category.new(category_params)\n authorize! :create, @category, :message => 'Not authorized as an administrator.'\n parent = Category.find_by(id: category_params[:parent_id])\n \n @category.id = get_category_id(category_params[:parent_id])\n @category.level = get_category_level(category_params[:parent_id])\n @category.parent = parent.name unless parent.nil?\n\n respond_to do |format|\n if @category.save\n unless (parent.nil?)\n parent.has_children = 1\n parent.save\n end\n format.html { redirect_to session.delete(:return_to), notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: session.delete(:return_to) }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aab7166f4548c63b1c7732e4070da477",
"score": "0.70830494",
"text": "def create\n @category = Category.new(category_params)\n if @category.save\n @category.sub_categories.build\n else\n render json: @category.errors\n end\n end",
"title": ""
},
{
"docid": "76e35b8f7502fc24d2d7d1536a075eeb",
"score": "0.70540893",
"text": "def create\n @child_sub_category = ChildSubCategory.new(child_sub_category_params)\n\n respond_to do |format|\n if @child_sub_category.save\n format.html { redirect_to @child_sub_category, notice: 'Child sub category was successfully created.' }\n format.json { render :show, status: :created, location: @child_sub_category }\n else\n format.html { render :new }\n format.json { render json: @child_sub_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b46109d56a57ed9e9a45acf31b5b07ba",
"score": "0.6990302",
"text": "def create\n @category = Category.new()\n @category.name = category_params[:name]\n @category.description = category_params[:description]\n parent_ids = category_params[:parent_ids].reject(&:empty?).map(&:to_i)\n puts(parent_ids)\n respond_to do |format|\n if @category.save\n parent_ids.each do |parent_id|\n puts(\"parent_id = #{parent_id}\")\n @category_link = CategoryLink.new(category_id:@category.id, parent_id: parent_id)\n @category_link.save!\n end\n format.html { redirect_to @category, notice: \"Category was successfully created.\" }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c16f54c8863a952c50494cf8124a7fef",
"score": "0.6863617",
"text": "def create_categories(category_name, parent_id, sub_categories = nil)\r\n category = Category.create! :name => category_name, :parent_id => parent_id\r\n return if sub_categories.nil?\r\n\r\n sub_categories.each do |sub|\r\n create_categories(sub[:name], category.id)\r\n end\r\nend",
"title": ""
},
{
"docid": "b28a4a924227a232473e28e18c0d7810",
"score": "0.6844045",
"text": "def create\n create! {\n ##This extra logic is written for storing parent id\n @category.update_attributes(:parent_id => params[:parent][:id]) if params[:parent][:id].to_i > 0\n admin_categories_path\n }\n end",
"title": ""
},
{
"docid": "150abb4fd1f5c30233a0f76777e20ad3",
"score": "0.6836803",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n # update parent\n @category.parent.clear\n @category.parent << Category.find(params[:parent_id]) if params[:parent_id].present?\n \n # update all level\n Category.update_all_level\n \n format.html { redirect_to edit_admin_category_path(@category.id), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b30c6f90c735c092f18c865de9268756",
"score": "0.68161434",
"text": "def create_child(user,params)\n \tparams.delete(:parent_id)\n \tcategory = self.children.build(params.merge!({:user_id => user.id}))\n \tcategory.level = self.level + 1\n \tself.max_postion = self.children.size + 1\n \tself.save\n \treturn category\n end",
"title": ""
},
{
"docid": "470a4b6a52f33f99ce6bdd90cdd94a0d",
"score": "0.67614466",
"text": "def create\n # authorize\n authorize! :create, Category\n @category = Category.new(category_params)\n \n respond_to do |format|\n if @category.save\n # update parent\n @category.parent.clear\n @category.parent << Category.find(params[:parent_id]) if params[:parent_id].present?\n \n # update all level\n Category.update_all_level\n \n format.html { redirect_to edit_admin_category_path(@category.id), notice: 'Tạo mới chuyên mục thành công.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08cee093988d2a2aeb3d60fb4bfb8454",
"score": "0.67020744",
"text": "def create\n @admin_category = Admin::Category.new(admin_category_params)\n\n respond_to do |format|\n if @admin_category.save\n unless params[:admin_category][:sub_categories_attributes].blank?\n params[:admin_category][:sub_categories_attributes].each do |sub_category|\n admin_sub_category = Admin::SubCategory.create({category_id: @admin_category.id, name: sub_category[1][:name]})\n admin_sub_category.save\n end\n end\n\n format.html { redirect_to admin_categories_path }\n format.json { render action: 'show', status: :created, location: @admin_category }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ec7df4456454c9dee45fae6decf2020",
"score": "0.669717",
"text": "def create_child_items\n self.category.path.each do |parent_category|\n create_child_item_for_category parent_category\n end\n end",
"title": ""
},
{
"docid": "9c7a82cef13b4bf9ebad68eb03d68388",
"score": "0.6687246",
"text": "def prepare_sample_catagory_tree_for_jarek\n parent1 = @jarek.asset\n category = Category.new(\n :name => 'test',\n :description => 'test',\n :user => @jarek,\n :parent => parent1\n )\n\n @jarek.categories << category\n @jarek.save!\n\n child1 = Category.new(\n :name => 'child1',\n :description => 'child1',\n :user => @jarek,\n :parent => category\n )\n\n child2 = Category.new(\n :name => 'child2',\n :description => 'child2',\n :user => @jarek,\n :parent => category\n )\n\n @jarek.categories << child1 << child2\n @jarek.save!\n\n end",
"title": ""
},
{
"docid": "b3870348ab0d42126b5c76c898d21cce",
"score": "0.66854906",
"text": "def create\n RootBranch.context(user: current_user) do\n parent = Category.where(version: Integer(params[:parent][:version])).first\n parent.add_child(params[:category])\n end\n\n redirect_to categories_url, notice: 'Category was successfully created.'\n end",
"title": ""
},
{
"docid": "b561610eac911ac25d2374245eef9f14",
"score": "0.66282517",
"text": "def new\n @category = Category.new\n\n case request.method\n when :get\n @parent_categories = Category.find_all - @category\n when :post\n @category.parentid << Category.find(params[:parentid])\n redirect_to :action => 'show', :id => @category.id\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "01ecbd4c56b456bc36ff542fa0728027",
"score": "0.66047186",
"text": "def set_child_category\n @child_category = ChildCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "df1f264ba7226d25cdf1f24d5c8c8769",
"score": "0.65945727",
"text": "def create\n @category = Category.new(category_params)\n #@category.sub_categories = params[:subcategories]\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Categoria guarda.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5eb2725fac8082e44eefd9cebed345c1",
"score": "0.6593645",
"text": "def update_subcategories\n @subcategories = Category.where(\"parent_id = ?\", params[:parent_id]).order(:name)\n respond_to do |format|\n format.json { render :json => @subcategories }\n end\n end",
"title": ""
},
{
"docid": "b78bcf2b62250f57bbfce9088e9255c9",
"score": "0.65462273",
"text": "def add_child \n @cat = Cat.new(:cat_type => session[:cat_type], :parent_id => params[:id])\n @parent = Cat.find(params[:id])\n \n respond_to do |format|\n format.js # new.js.rjs\n format.xml { render :xml => @cat }\n end\n end",
"title": ""
},
{
"docid": "98c0cc0d507cd199ba575cd19911859b",
"score": "0.65210634",
"text": "def get_child_categories\n ret = []\n body = HashWithIndifferentAccess.new(get_categories(@category_id, {}))#retrieve_object\n cats = body[:category]\n children = cats[:childcategories]\n children.each { |child|\n cat = EIACategory.new\n cat.name = child[:name]\n cat.category_id = child[:category_id]\n ret << cat\n }\n ret\n end",
"title": ""
},
{
"docid": "04dbba9d6889c0e6a8915966839b7d48",
"score": "0.65029055",
"text": "def create\n add_child_categories(params[:category_subscriber][:category_ids])\n @category_subscriber = CategorySubscriber.new(category_subscriber_params)\n\n respond_to do |format|\n if @category_subscriber.save\n format.html { redirect_to @category_subscriber, notice: 'Category subscriber was successfully created.' }\n format.json { render :show, status: :created, location: @category_subscriber }\n else\n format.html { render :new }\n format.json { render json: @category_subscriber.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c0b6b1c638c65c0ad7fb240ff5f04e6",
"score": "0.6494225",
"text": "def create\n params[:category][\"transcrib\"] = transcrib(params[:category]['title'])\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n my_item = Category.find(params[:category]['parent_id'])\n @category.move_to_child_of my_item\n flash[:notice] = 'Category was successfully created.'\n format.html { redirect_to(@category) }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24744081da3a36d8424ebbdcfdcd5443",
"score": "0.64799887",
"text": "def update\n\n respond_to do |format|\n if @category.update(category_params)\n unless @category.children.empty?\n @category.children.each do |child|\n\n child.status = @category.status\n child.save\n\n end\n end\n\n format.html { redirect_to @category, notice: \"Category was successfully updated.\" }\n format.json { render :show, status: :ok, location: @category }\n format.js\n\n\n\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n format.js { render :edit}\n\n end\n end\n end",
"title": ""
},
{
"docid": "3695ca6a2f5ac989acd784369d43f34f",
"score": "0.6457611",
"text": "def new\n @child_category = ChildCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @child_category }\n end\n end",
"title": ""
},
{
"docid": "3d61d93893f52210e5307df4f03eef19",
"score": "0.64270943",
"text": "def insert(parent_id)\n if parent_id and parent_id != \"\"\n # logger.info(\"-----------------\")\n # logger.info(parent_id)\n Category.find(parent_id).children.create :name => self.name\n else\n Category.create! :name => self.name\n end\n end",
"title": ""
},
{
"docid": "9a06ef0bb372ae006067b6ce0718447d",
"score": "0.6418376",
"text": "def create\n params[:category].delete(:ancestry) if params[:category][:ancestry] == '' \n @category = Category.new(params[:category]) \n \n respond_to do |format|\n if @category.save\n flash[:success] = t('activerecord.flash.created')\n format.html { redirect_to :action => 'index' }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n format.js \n else\n flash[:error] = t('activerecord.flash.error')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n format.js \n end\n end\n end",
"title": ""
},
{
"docid": "fb6b363d3c3a243303f524db252cfae9",
"score": "0.64157444",
"text": "def create\n child = Child.create(child_params)\n\n render json: child\n end",
"title": ""
},
{
"docid": "90d7483a5b074e0bd56a8114274b1f47",
"score": "0.63980955",
"text": "def create\n @cat = Cat.new(params[:cat])\n \n respond_to do |format|\n if @cat.save\n if ! @cat.parent_id.nil?\n parent = Cat.find(@cat.parent_id)\n @cat.move_to_child_of(parent)\n end\n @cats = Cat.find(:all)\n format.js # create.js.rjs\n format.xml { render :xml => @cat, :status => :created, :location => @cat }\n else\n format.js # create.js.rjs\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2c7a1197f9943e0631783dbd9a98afe",
"score": "0.63903576",
"text": "def create\n @type = Type.new(params[:type])\n @type.category_mask = array_to_mask(params[\"categories\"],Type::Categories)\n respond_to do |format|\n if @type.save\n # FIXME: Quietly removes parent from children (throw error instead?)\n add_child_ids = s_to_i_array(params[:children_ids]) - s_to_i_array(params[:type][:parent_id])\n add_child_ids.each { |id|\n @child = Type.find(id)\n @child.parent_id = @type.id\n @child.save\n }\n if @type.pending\n format.html { redirect_to grow_types_path, notice: \"Type #{@type.id} was successfully created.\" }\n else\n format.html { redirect_to types_path, notice: \"Type #{@type.id} was successfully created.\" }\n end\n format.json { render json: @type, status: :created, location: @type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f3789e98779dc28a8188b7c8310c6b0",
"score": "0.6373614",
"text": "def add_child(child_category, data_set)\n child_category = PublicEarth::Db::Category.find_by_id(child_category) if child_category.kind_of?(String) \n child_category.add_parent(self, data_set)\n child_category\n end",
"title": ""
},
{
"docid": "820c011b3b8b1327d6d3a877c6fefc9c",
"score": "0.6359808",
"text": "def create\n @parent_category = ParentCategory.new(parent_category_params)\n\n respond_to do |format|\n if @parent_category.save\n format.html { redirect_to admin_parent_category_path(@parent_category), notice: 'Parent category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @parent_category }\n else\n format.html { render action: 'new' }\n format.json { render json: @parent_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "166fb82ef07f7b77216794af2acfda71",
"score": "0.6348095",
"text": "def create\n catparams = params[:category]\n @category = Category.find(catparams[:parent_id])\n @category.add_subcat(catparams[:name])\n\n if @category.errors.empty?\n flash[:notice] = 'Category was successfully created.'\n end\n @subcats = Category.where(\"parent_id = ?\", @category.id).order(\"name ASC\")\n\n respond_to do |format|\n format.html { init_vars; render 'show' }\n format.js # The view template will be create.js.erb.\n end\n end",
"title": ""
},
{
"docid": "41476f252b953cd721edd9cf7559b7d7",
"score": "0.6343317",
"text": "def create\n #TODO supprimer ces deux lignes obsoletes\n params[:category][:factcat_id] = 11\n params[:category][:upcategory_id] = 11\n \n parent = Category.find(params[:category][:parent_id])\n need_to_move_elements_to_new_leaf = true if parent.has_elements?\n @category = Category.new(params[:category])\n \n respond_to do |format|\n if @category.save\n if need_to_move_elements_to_new_leaf\n out = \"les elements suivants sont deplaces de : #{parent.name} a #{@category.name}<br>\" \n out << @category.move_elements_to_new_leaf\n end\n flash[:notice] = \"Category créée. <br> #{out}\"\n format.html { redirect_to(categories_url) }\n format.xml { render :xml => @category, :status => :created, :location => @category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d556e23a0663ba3d17ff036fed11c1b5",
"score": "0.6310846",
"text": "def create\n @categories = Category.order('category ASC').where(parent_id: nil)\n @post = current_user.posts.build(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, success: 'Votre contributions est maintenant en ligne!' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fdcf87e80fdeba4293de609bfc60e4a3",
"score": "0.63021445",
"text": "def category_params\n params.require(:category).permit(:name, :level, :description, parent_ids: [])\n end",
"title": ""
},
{
"docid": "c5167cd99a5541d92b0e3f89b5d2b4b3",
"score": "0.6298473",
"text": "def create\n @category = Category.new(params[:category])\n @category.user = current_user\n\n respond_to do |format|\n begin\n raise UnauthorizedError unless @category.parent.nil? || authorized?(@category.parent)\n raise SaveError unless @category.save\n\n format.html { redirect_to(category_path(@category), :notice => 'Category was successfully created.') }\n format.json { render :json => @category.to_json, :status => :created, :location => @category }\n rescue SaveError\n format.html { render :action => \"new\" }\n format.json { render :json => @category.errors, :status => :unprocessable_entity }\n rescue UnauthorizedError\n format.html { redirect_to(categories_url, :notice => 'Parent category must be owned by you.') }\n format.json { head :unauthorized }\n end\n end\n end",
"title": ""
},
{
"docid": "b9dd259ada732cec5e429a83d6d0a3d5",
"score": "0.6283761",
"text": "def category_params\n params.require(:category).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "b9dd259ada732cec5e429a83d6d0a3d5",
"score": "0.6283761",
"text": "def category_params\n params.require(:category).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "9641816916e1ab48877612d47099af1d",
"score": "0.62791747",
"text": "def create\n @kidandparentcategory = Kidandparentcategory.new(params[:kidandparentcategory])\n\n respond_to do |format|\n if @kidandparentcategory.save\n format.html { redirect_to @kidandparentcategory, :notice => 'Kidandparentcategory was successfully created.' }\n format.json { render :json => @kidandparentcategory, :status => :created, :location => @kidandparentcategory }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @kidandparentcategory.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cde3e670a88e3fddac90cac6e9c9bb28",
"score": "0.6269601",
"text": "def add_child(category)\n category.parent = self\n @children = Array.new if @children.nil?\n @children.push category\n return self\n end",
"title": ""
},
{
"docid": "d17d8f7f3789eb03c549cbe4170b22c6",
"score": "0.62633",
"text": "def create\n @expense_sub_category = ExpenseSubCategory.new(name: params[:expense_sub_category][:name])\n @expense_sub_category.expense_categories << ExpenseCategory.find(params[:expense_sub_category][:expense_category_expense_sub_category][:expense_category_id] - [\"\"])\n\n respond_to do |format|\n if @expense_sub_category.save\n format.html { redirect_to @expense_sub_category, notice: 'Expense sub category was successfully created.' }\n format.json { render :show, status: :created, location: @expense_sub_category }\n else\n @expense_categories = ExpenseCategory.all\n format.html { render :new }\n format.json { render json: @expense_sub_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ad418056cafbb07583dd7d201441b79",
"score": "0.6263158",
"text": "def create\n @tag_category = Category.new(params[:category])\n @tag_category.parent_id = @timeline.id if @timeline.present?\n\n respond_to do |format|\n if @tag_category.save\n format.html { redirect_to tag_identity_timeline_category_path(@identity,@timeline,@tag_category), notice: 'Category was successfully created.' }\n format.json { render json: @tag_category, status: :created, location: @tag_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tag_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a81be2fffbb334cc06a8eed1ac90d4e",
"score": "0.6257651",
"text": "def children\n @taxon = Taxon.find params[:id]\n @children = @taxon.children\n @tree = tree_children(@taxon)\n respond_to do |format|\n format.html\n format.json { render :json => @tree }\n end\n \n end",
"title": ""
},
{
"docid": "b6f8e4beefb8181f55d9f892fa1f7112",
"score": "0.62547237",
"text": "def child_category_params\n params.require(:child_category).permit(:category_id, :name, :gender, :image_path)\n end",
"title": ""
},
{
"docid": "c16662fc1f73e34faa9524994a63abc7",
"score": "0.6251457",
"text": "def new\n @category = @model.new(:treasury => @treasury) #@treasury.categories.build\n @category.parent = Category.find(params[:parent_id]) if params[:parent_id]\n return if needs_deeply_concerned(@treasury)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "ac74f4ddff61ca4d2abea61c371be1f7",
"score": "0.6248744",
"text": "def category_params\n params.require(:category).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "ac74f4ddff61ca4d2abea61c371be1f7",
"score": "0.6248744",
"text": "def category_params\n params.require(:category).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "ecbf93f63278495a1f87f76f1f982230",
"score": "0.6200892",
"text": "def subcat\n @category = Category.find(params[:id])\n @level = params[:level]\n @subcat = @category.children \n \n respond_to do |format|\n format.js\n end \n end",
"title": ""
},
{
"docid": "01d6bdedf1d1baccc5368aa606b6f497",
"score": "0.61982656",
"text": "def create_children\n @organization = @organization.children.new(params[:organization])\n @organization.namespace = current_namespace\n if @organization.save\n render json: @organization, status: :created, serializer: AuthorizedOrganizationSerializer, root: :organization\n else\n render json: @organization.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9ebc6f6a276db3406887cc05e083775b",
"score": "0.61957955",
"text": "def create\n @child = Child.new(params[:child])\n\n respond_to do |format|\n if @child.save\n format.html { redirect_to children_url, notice: 'Child was successfully created.' }\n format.json { render json: @child, status: :created, location: @child }\n else\n format.html { render action: \"new\" }\n format.json { render json: @child.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "291015e67c0bd2e04a3e225ed42e4f82",
"score": "0.6191879",
"text": "def child_sub_category_params\n params.require(:child_sub_category).permit(:name, :descriptions, :slug, :category_id, :subcategory_id)\n end",
"title": ""
},
{
"docid": "91ade3ca87c6d0f9272898b129542f80",
"score": "0.61899126",
"text": "def category_params\n params.require(:category).permit(:category, :catimage, :parent_id, :child_category_parent_id)\n end",
"title": ""
},
{
"docid": "01293388457cd3ea73fac29a60f816a1",
"score": "0.6175767",
"text": "def set_child_sub_category\n @child_sub_category = ChildSubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "2c420e87801cd76f1a10aaece7c870b3",
"score": "0.6169337",
"text": "def create\n\n @category_tree = CategoryTree.new\n @category_tree.root_id = params[:root]\n @category_tree.subone_id = params[:subone]\n @category_tree.subtwo_id = params[:subtwo]\n\n respond_to do |format|\n if @category_tree.save\n format.html { redirect_to @category_tree, notice: 'Category tree was successfully created.' }\n format.json { render json: @category_tree, status: :created, location: @category_tree }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category_tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c944c7787aac7da46609eed3a6a3703",
"score": "0.6161289",
"text": "def category_params\n params.require(:category).permit(:name, :parent_id, :logo,\n sub_categories_attributes: %i[id name logo _destroy])\n end",
"title": ""
},
{
"docid": "06dd815d8ee998c7f867f68f9afe5b3f",
"score": "0.61534494",
"text": "def assign_parent_id(db_connection, category_json, parent_id) \n category_id = db_connection.get_category_id(category_json['value'])\n db_connection.update_parent_category(category_id, parent_id)\n unless category_json['children'].nil?\n category_json['children'].each do |child|\n assign_parent_id(db_connection, child, category_id)\n end\n end\nend",
"title": ""
},
{
"docid": "9031cdce67f70e007596087485ea45a8",
"score": "0.61412144",
"text": "def create\n @child = current_user.children.build(params[:child])\n\n respond_to do |format|\n if @child.save\n format.html { redirect_to([:admin, @child], :notice => 'Child was successfully created.') }\n format.xml { render :xml => @child, :status => :created, :location => @child }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @child.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5870f120e620343c1819cd7272980c44",
"score": "0.614062",
"text": "def category_params\n params.require(:category).permit(:title, :parent_id)\n end",
"title": ""
},
{
"docid": "e95838b366ccc086f8498f801c2cd03e",
"score": "0.612729",
"text": "def child_node\n @category = Category.find(params[:category])\n render layout: false\n end",
"title": ""
},
{
"docid": "4eea4ac298e0bbc24feed9575ef41ebf",
"score": "0.61260396",
"text": "def create\n @child = Child.new(child_params)\n\n respond_to do |format|\n if @child.save\n format.html { redirect_to admin_children_url, notice: 'Barnet er registrert' }\n format.json { render :show, status: :created, location: @child }\n else\n format.html { render :new }\n format.json { render json: @child.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3474bd58346d468e0668a9723a9953a5",
"score": "0.6093858",
"text": "def create_children(parent, children, model_class)\n puts \"creating children of #{parent.name}\\n----------------\"\n children.each do |k, v|\n puts \"Creating #{model_class.name} for #{k}\"\n parent.children.create!(:name => k, :uuid => v['uuid'])\n if v['children']\n new_parent = model_class.find_by_name(k)\n create_children(new_parent, v['children'], model_class)\n end\n end\n \n puts \"No more children left\\n--------------------\"\nend",
"title": ""
},
{
"docid": "7ed5800c4b1c609dce8129bf166234c9",
"score": "0.608932",
"text": "def destroy\n if @category.children.present? \n respond_to do |format|\n format.json { render json: I18n.t('category_have_sub_categories'), status: :conflict }\n end\n else\n @category.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "29c1bef80c990b5d7d83da75403796b6",
"score": "0.60863113",
"text": "def create_children\n true\n end",
"title": ""
},
{
"docid": "ed9c13131fdf5d5ede322c20a1d19f4b",
"score": "0.60835195",
"text": "def index\n if params[:parent_id].present?\n @category = Category.find(params[:parent_id], :include => :children)\n else\n @category = Category.find_or_create_by_name(RacingAssociation.current.short_name)\n @unknowns = Category.find_all_unknowns\n end\n\n @categories = @category.children.sort\n \n end",
"title": ""
},
{
"docid": "de1019d3d161e462915d4ceb82ed94b7",
"score": "0.6079576",
"text": "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"title": ""
},
{
"docid": "9820695cf5374d7f0892321528b990f1",
"score": "0.60689706",
"text": "def new_tree\n @category=Category.new\n \n end",
"title": ""
},
{
"docid": "9bb279560c80ff1b437dab54f65ee2d0",
"score": "0.606756",
"text": "def category_params\r\n params.require(:category).permit(:title, :description, :parent)\r\n end",
"title": ""
},
{
"docid": "0c7920cafba08c4cb88e036bf46e4375",
"score": "0.6065705",
"text": "def add_child\n @article = Article.new\n @articles = Article.root_articles\n #@categories = Category.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @article }\n end\n end",
"title": ""
},
{
"docid": "8c36d470a45e0674954cff62bd858f7a",
"score": "0.6061364",
"text": "def category_params\n params.require(:category).permit(:name, :level, :meta_keywords, :meta_description, :description, parent_ids: [])\n end",
"title": ""
},
{
"docid": "93d342dae0fa814d1681adea2c8648b2",
"score": "0.60481983",
"text": "def orphan_child_categories\n self.children.each do |child|\n child.parent_id = nil\n child.save\n end\n end",
"title": ""
},
{
"docid": "d0a7b64147db8798294c4d43fde2eebe",
"score": "0.60408676",
"text": "def category_params\n params.require(:category).permit(:name, :description, :parent_id)\n end",
"title": ""
},
{
"docid": "d0a7b64147db8798294c4d43fde2eebe",
"score": "0.60408676",
"text": "def category_params\n params.require(:category).permit(:name, :description, :parent_id)\n end",
"title": ""
},
{
"docid": "867612cb46267da9ee38d899f69eb5fc",
"score": "0.6037117",
"text": "def create_child_item_for_category(category)\n category.child_items.find_or_create_by(categorizable_type: self.categorizable.class.base_class.name, categorizable_id: self.categorizable.id, master_item_id: self.id)\n end",
"title": ""
},
{
"docid": "116d953dfb3d32599269697ddc6948d9",
"score": "0.60349387",
"text": "def new\n @category = ::Category.new\n @category.parent = ::Category.find(params[:pid]) if params[:pid]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "42e3cd70323c9b9c33278f6a5a615e21",
"score": "0.60242236",
"text": "def create\n @sub_categories_d = SubCategoriesD.new(params[:sub_categories_d])\n\n respond_to do |format|\n if @sub_categories_d.save\n format.html { redirect_to @sub_categories_d, notice: 'Sub categories d was successfully created.' }\n format.json { render json: @sub_categories_d, status: :created, location: @sub_categories_d }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sub_categories_d.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91338c4d5f2f4f85371f8855b30f83f2",
"score": "0.6022949",
"text": "def new\n @parent = Category.find_by_id(params[:parent])\n \n authorize! :read, @parent if @parent\n \n @category = Category.new\n \n @category.parent_id = params[:parent]\n @category.groups = current_user.groups\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "3ed652ac9da3fb5572d0caf322e0bdf2",
"score": "0.602274",
"text": "def create\n if(params[:sub_category][:category_id].blank?)\n redirect_to new_sub_category_path\n else\n category = Category.find(params[:sub_category][:category_id])\n params[:sub_category].delete(:category_id)\n @sub_category = category.sub_categories.build(params[:sub_category])\n\n respond_to do |format|\n if @sub_category.save\n format.html { redirect_to(@sub_category, \n :notice => 'Sub category was successfully created.') }\n format.xml { render :xml => @sub_category, :status => :created, \n :location => @sub_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sub_category.errors, \n :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a9a81e9b6585b3a00248d96aac2f0261",
"score": "0.6011922",
"text": "def create_category(name, parent_id, code)\n return category = Category.create(name: name, parent_id: parent_id, code_category: code)\nend",
"title": ""
},
{
"docid": "5e7df44730a309f0a7a1ede56a5b0207",
"score": "0.60096866",
"text": "def create\n @sub_category = SubCategory.new(sub_category_params)\n @sub_category.category_id = params[:category_id]\n\n respond_to do |format|\n if @sub_category.save\n format.html { redirect_to category_path(params[:category_id]), notice: t('create.notice', name: t('activerecord.models.sub_category')) }\n format.json { render :show, status: :created, location: @sub_category }\n else\n format.html { render :new }\n format.json { render json: @sub_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aac1f4ded4606709f75c354d301a5625",
"score": "0.60087246",
"text": "def insert_child\n @area = Area.new(area_params)\n @area.id = @id\n\n if !@area.parent.nil?\n if @area.save\n render json: { status: \"success\", message: \"Child added successfully\" }\n else\n render json: { status: \"failure\", message: @area.errors }\n end\n else\n render json: { status: \"failure\", message: \"Parent does not exist\" }\n end\n end",
"title": ""
},
{
"docid": "bec1cd1cdab55b9931553df9e97f5ca3",
"score": "0.6005891",
"text": "def add_child(child_model_name, child_id)\n url = build_nested_url child_model_name\n body = {id: child_id}.to_json\n self.class.send_request url, :post, body\n end",
"title": ""
},
{
"docid": "3b6c3477762dd431540c8a06ff36ff1b",
"score": "0.599892",
"text": "def add_child(child_model_name, child_id)\n url = build_nested_url child_model_name\n body = { id: child_id }.to_json\n self.class.send_request url, :post, body\n end",
"title": ""
},
{
"docid": "85495fc4d950fe6f4de8199de47f3cbf",
"score": "0.5998829",
"text": "def create\n @repairing_category = Repairing::Category.new(repairing_category_params)\n @repairing_category.parent = Repairing::Category.find(repairing_category_params.category_id) if repairing_category_params.respond_to? :category_id\n\n respond_to do |format|\n if @repairing_category.save\n format.json { render :show, status: :created, location: @repairing_category }\n else\n format.json { render json: @repairing_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e107db15182dd1a7d53da6e92fccf5f7",
"score": "0.59886855",
"text": "def create\n if params[:knowledge_tree][:pId] == \"0\"\n @knowledge_tree = KnowledgeTree.new knowledge_tree_params\n @knowledge_tree.save\n else\n parent_knowledge_tree = KnowledgeTree.find(params[:knowledge_tree][:pId])\n @knowledge_tree = parent_knowledge_tree.children.create knowledge_tree_params\n end\n \n\n respond_to do |format|\n if !@knowledge_tree.nil?\n format.html { redirect_to admin_knowledge_tree_path(@knowledge_tree), notice: 'Knowledge tree was successfully created.' }\n format.json { render json: @knowledge_tree, status: :created, location: admin_knowledge_tree_path(@knowledge_tree) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @knowledge_tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24694e0a6ca3e94490d5998aec2bb046",
"score": "0.59840244",
"text": "def category_params\n params.require(:category).permit(:title, :parent_id, :slug, :pos, :ancestry_depth)\n end",
"title": ""
},
{
"docid": "de521b97ae99518a3b7f10ba515b0434",
"score": "0.59832877",
"text": "def add_children_of_child_to_parent\n children_of_child.each do |child_link|\n create_link list, child_link.child, child_link\n end\n end",
"title": ""
},
{
"docid": "f196b73910bf41dcf501dbe26ea586fe",
"score": "0.59815025",
"text": "def children\n @categories = Category.has_children\n end",
"title": ""
},
{
"docid": "2266b8314395f83b607e8c5f68e155b1",
"score": "0.59777695",
"text": "def category_params\n params.require(:category).permit(:code, :name, :parent_id)\n end",
"title": ""
},
{
"docid": "1677e4bf57ff6c6bd3966384405ce2bf",
"score": "0.5966126",
"text": "def create\n @product = Product.new(product_params)\n @products = Product.all\n category_ids = params[:category][:category_id][1..-1]\n category_ids.each do |i|\n c = Category.find(i)\n @product.categories << c\n end\n\n respond_to do |format|\n\n if @product.save\n format.html { render :admin_branch, notice: 'Product was successfully created.' }\n format.json { render :index, status: :created, location: :admin_branch }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "464d3995e99c899f0af6d4f418fe2cf0",
"score": "0.5953341",
"text": "def index\n if params[:parent_id].present?\n @category = Category.find(params[:parent_id], :include => :children)\n else\n @category = Category.find_or_create_by_name(RacingAssociation.current.short_name)\n @unknowns = Category.find_all_unknowns\n end\n end",
"title": ""
},
{
"docid": "6588d311772051a8a7eed1b9cf6bcd71",
"score": "0.5945399",
"text": "def new\n @category = Category.new\n @categories = current_user.get_or_create_root_cat.descendants.arrange(:order => :created_at)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "f25dea1ed9c0fb4b31f9f52cf25330c6",
"score": "0.5944089",
"text": "def post\n @parents = ParentCategory.find :all, :order => 'name ASC'\n end",
"title": ""
},
{
"docid": "42d21260eeec0321084712925882bbc8",
"score": "0.59400773",
"text": "def index\n @child_sub_categories = ChildSubCategory.all\n end",
"title": ""
},
{
"docid": "6442a996b3196007c148b02954126148",
"score": "0.5937426",
"text": "def new_tree\n @category=Category.new\nend",
"title": ""
},
{
"docid": "e9887ae844ead525a401883a1c1e2dd1",
"score": "0.59373724",
"text": "def new\n add_breadcrumb \"New Category\", new_admin_category_path\n @category = params[:id] ? Category.find(params[:id]).children.new : Category.new\n @count = Category.count\n end",
"title": ""
},
{
"docid": "f6aefebbfd875243794eeebb8fa815db",
"score": "0.59265673",
"text": "def create\n @child = Child.new(child_params)\n\n respond_to do |format|\n if @child.save\n format.html { redirect_to @child, notice: 'Child was successfully created.' }\n format.json { render :show, status: :created, location: @child }\n else\n format.html { render :new }\n format.json { render json: @child.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6aefebbfd875243794eeebb8fa815db",
"score": "0.59265673",
"text": "def create\n @child = Child.new(child_params)\n\n respond_to do |format|\n if @child.save\n format.html { redirect_to @child, notice: 'Child was successfully created.' }\n format.json { render :show, status: :created, location: @child }\n else\n format.html { render :new }\n format.json { render json: @child.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56421bc72e8b1f0da8fb8b2a2cd96e52",
"score": "0.59259576",
"text": "def create\n @sub_category = SubCategory.new(params[:sub_category])\n @sub_category.save\n respond_with @sub_category, :location => sub_categories_path\n end",
"title": ""
},
{
"docid": "de5080d900be5140f63ec83dfa9a806d",
"score": "0.5919953",
"text": "def categories_attributes=(category_attributes) #only creating a new category if it doesn't already exist with the current name\n category_attributes.values.each do |category_attribute|\n category = Category.find_or_create_by(category_attribute)\n #self.post_categories.build(category: category)\n self.categories << category #First, we call self.categories, which returns an array of Category objects, and then we call\n # the shovel (<<) method to add our newly found or created Category object to the array.\n end\n end",
"title": ""
},
{
"docid": "78022043440526122dfdbfda4ec18174",
"score": "0.5915265",
"text": "def categories_attributes=(category_attributes)\n category_attributes.values.each do |category_attribute|\n category = Category.find_or_create_by(category_attribute)\n #self.post_categories.build(category: category)\n self.categories << category\n end\n end",
"title": ""
},
{
"docid": "d0561df8d23aa270998c5bb686d14a7a",
"score": "0.5913702",
"text": "def category_params\n params.require(:category).permit(:name, :category_code, :parent_id)\n end",
"title": ""
}
] |
0bcdacb95b5ee1b62edc4af05f96feaf
|
PATCH/PUT /registration_head2s/1 PATCH/PUT /registration_head2s/1.json
|
[
{
"docid": "f470ad27f2617d69c84305adbde4de88",
"score": "0.765047",
"text": "def update\n respond_to do |format|\n if @registration_head2.update(registration_head2_params)\n format.html { redirect_to @registration_head2, notice: 'Registration head2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration_head2 }\n else\n format.html { render :edit }\n format.json { render json: @registration_head2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "e5bdc5c42c49b91f284043aafabf4cc9",
"score": "0.6505244",
"text": "def update\n respond_to do |format|\n if @hjump_head2.update(hjump_head2_params)\n format.html { redirect_to @hjump_head2, notice: 'Hjump head2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @hjump_head2 }\n else\n format.html { render :edit }\n format.json { render json: @hjump_head2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1dfffd48ad77140b952acd1d2e049f82",
"score": "0.63308626",
"text": "def create\n @registration_head2 = RegistrationHead2.new(registration_head2_params)\n\n respond_to do |format|\n if @registration_head2.save\n format.html { redirect_to @registration_head2, notice: 'Registration head2 was successfully created.' }\n format.json { render :show, status: :created, location: @registration_head2 }\n else\n format.html { render :new }\n format.json { render json: @registration_head2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53c7d0d66af6ca42949ff64a7a3e5838",
"score": "0.63022834",
"text": "def update\n respond_to do |format|\n if @jump_head2.update(jump_head2_params)\n format.html { redirect_to @jump_head2, notice: 'Jump head2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @jump_head2 }\n else\n format.html { render :edit }\n format.json { render json: @jump_head2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb1f4d84b4db2281873bcf10d553ad24",
"score": "0.6237758",
"text": "def update\n respond_to do |format|\n if @u2_f_registration.update(u2_f_registration_params)\n format.html { redirect_to @u2_f_registration, notice: 'U2 f registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @u2_f_registration }\n else\n format.html { render :edit }\n format.json { render json: @u2_f_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66de674f3024690257594d873ec86430",
"score": "0.6204007",
"text": "def update\n @registration = Registration.find(params[:id])\n\n if @registration.update(params[:registration])\n head :no_content\n else\n render json: @registration.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4c96eb0ddaaedb117cbdbf6475e708ed",
"score": "0.6089606",
"text": "def update\n @registration = Registration.find(params[:id])\n \n params[:registration][:registration_at].gsub!(\"/\",\".\")\n\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n @registration.person.update_attributes(params[:person])\n if !params[:registration][:admission_type_ids]\n @registration.registration_admission_types.delete_all\n end\n format.html { redirect_to @registration, :notice => 'Matrícula atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @registration.errors, :status => :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "ac9f00671dec21ad74eb65dde4104b28",
"score": "0.6074312",
"text": "def patch_registration(user_id, request)\n start.uri('/api/user/registration')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "81060c869b0d2a3706e7dc4827d1d5c0",
"score": "0.60588706",
"text": "def update\n respond_to do |format|\n if @registration_form1.update(registration_form1_params)\n format.html { redirect_to @registration_form1, notice: 'Registration form1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration_form1 }\n else\n format.html { render :edit }\n format.json { render json: @registration_form1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "729dd1aab687b0b436a5f595699a2d6c",
"score": "0.6047248",
"text": "def update\n @hog_registration = HogRegistration.find(params[:id])\n\n if @hog_registration.update(hog_registration_params)\n Profile.find_by(:user_id => params[:hog_registration][:user_id]).update(hog_registration_params)\n render json: @hog_registration, status: :ok, location: [:web, @hog_registration]\n else\n render json: @hog_registration.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6248441f94f24bdcbfe1288caef5c38a",
"score": "0.6043752",
"text": "def update\n respond_to do |format|\n if @simple_registration.update(simple_registration_params)\n format.html { redirect_to @simple_registration, notice: 'Simple registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @simple_registration }\n else\n format.html { render :edit }\n format.json { render json: @simple_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eae7f58eac1f5b33f8e613f48675e18e",
"score": "0.60264117",
"text": "def update\n respond_to do |format|\n if @shot_put_head.update(shot_put_head_params)\n format.html { redirect_to @shot_put_head, notice: 'Shot put head was successfully updated.' }\n format.json { render :show, status: :ok, location: @shot_put_head }\n else\n format.html { render :edit }\n format.json { render json: @shot_put_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "428de482534615e55974663f7ad04ec0",
"score": "0.60061",
"text": "def update_registration(user_id, request)\n start.uri('/api/user/registration')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "1812494256aeda27a6a1e34483ee5547",
"score": "0.59832823",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9026c6c9f607be34b454656be4a9dce5",
"score": "0.5975905",
"text": "def update_registration(user_id, request)\n start.uri('/api/user/registration')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "46f650a69d9ffbc3307b43675543f63a",
"score": "0.5930058",
"text": "def update\n @registration = resource\n super\n end",
"title": ""
},
{
"docid": "6a6b9591822cfc43c561cffeb0b52352",
"score": "0.5927526",
"text": "def update\n respond_to do |format|\n if @track_head2.update(track_head2_params)\n format.html { redirect_to @track_head2, notice: 'Track head2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @track_head2 }\n else\n format.html { render :edit }\n format.json { render json: @track_head2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ece86a2db9e9a5049442947e42729be8",
"score": "0.59236884",
"text": "def update\n @registration = Registration.find(params[:id])\n\t\t\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07b6fdc861bd1704f29395e7e879cb15",
"score": "0.58910286",
"text": "def update\n\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e030c300bd7bf1972d05948f0259f209",
"score": "0.58624077",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to registrations_path, notice: 'Registration was successfully updated.' }\n format.json { render :index, status: :ok, location: root_path }\n else\n format.html { render :new }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "462a2dab8cc459f401dee2859d9c5c24",
"score": "0.5858789",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "462a2dab8cc459f401dee2859d9c5c24",
"score": "0.5858789",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "462a2dab8cc459f401dee2859d9c5c24",
"score": "0.5858789",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "462a2dab8cc459f401dee2859d9c5c24",
"score": "0.5858789",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "462a2dab8cc459f401dee2859d9c5c24",
"score": "0.5858789",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "462a2dab8cc459f401dee2859d9c5c24",
"score": "0.5858789",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "462a2dab8cc459f401dee2859d9c5c24",
"score": "0.5858789",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration }\n else\n format.html { render :edit }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.58372164",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "6dfe851dc24fde37e5c3720e1cacbbc3",
"score": "0.5834647",
"text": "def update\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2d87e77609644737d713ce989b5366e",
"score": "0.58301383",
"text": "def update\n @registration_scheme = RegistrationScheme.find(params[:id])\n\n respond_to do |format|\n if @registration_scheme.update_attributes(params[:registration_scheme])\n format.html { redirect_to @registration_scheme, :notice => 'Sistema de Registro atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @registration_scheme.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dabb6dd5ad65d9b708ecad93d82f43ad",
"score": "0.5825037",
"text": "def update\n # company_industries\"=>[\"1\", \"2\"]\n respond_to do |format|\n if @registration.update(registration_params)\n \n @registration.company.update_industries(params[:company_industries])\n\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b3294b393a3007497b20083ef07b859",
"score": "0.58244646",
"text": "def update\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(registration_params)\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9e9680eeacd5fcd0504c98e178393fe",
"score": "0.58158857",
"text": "def update\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { redirect_to @registration, :notice => 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @registration.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dbba5eb4b746d507780035d9413730cc",
"score": "0.5801747",
"text": "def update\n @registration = Registration.find(params[:id])\n authorize! :update, @registration\n \n respond_to do |format|\n if @registration.update_attributes(params[:registration].except(\"assign\"))\n \n if (params[:registration][:assign].to_s == \"from_action\")\n \n ass_to = User.find(params[:registration][:assigned_to]).first_name\n ass_by = User.find(params[:registration][:assigned_by]).first_name\n \n tl(\"Registration\",params[:id],'This registration has been reassigned',\n 'Assigned To: ' + ass_to + ' | Assigned By: ' + ass_by,'assign_to',params[:registration][:assigned_to])\n \n elsif params[:registration][:notes_attributes]\n tl(\"Registration\",params[:id],'A note has been created for this registration',\n \"Note created\",'note',@registration.assigned_to)\n \n elsif params[:registration][:documents_attributes]\n doc_no = params[:registration][:documents_attributes].size\n tl(\"Registration\",params[:id],\"#{doc_no} document(s) has been uploaded to this registration\",\n \"Docs Uploaded\",'document',@registration.assigned_to)\n \n else\n \n tl(\"Registration\",params[:id],'Values of this registration has been updated',\n \"Updated\",'Update',@registration.assigned_to)\n end\n \n format.html { redirect_to @registration, notice: 'Registration 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: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f792a71ea7906c69ea97f4e965a5fd5",
"score": "0.5793883",
"text": "def update\n @person_registration = PersonRegistration.find(params[:id])\n\n respond_to do |format|\n if @person_registration.update_attributes(params[:person_registration])\n format.html { redirect_to @person_registration, notice: 'Person registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ae6b17460ba8c07daf1a237b1b63696",
"score": "0.57906365",
"text": "def update\n \n if @api_v1_person.update(api_v1_person_params) \n render json: @api_v1_person\n else\n render json: @api_v1_person.errors, status: 400\n end\n \n end",
"title": ""
},
{
"docid": "8427e2f57073ee6ad77b75a522fa87f8",
"score": "0.57903993",
"text": "def update\n @registration = Registration.find(params[:id])\n \n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { redirect_to registrations_path, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"title": ""
},
{
"docid": "b2450849b874439e06e941876f97c5e5",
"score": "0.57794195",
"text": "def update\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { \n flash[:success] = 'Registration was successfully changed. '\n redirect_to @registration\n }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf1a1b07ff38ef64c32fb31af04af7a3",
"score": "0.57394254",
"text": "def update\n respond_to do |format|\n if @female_shot_put_head.update(female_shot_put_head_params)\n format.html { redirect_to @female_shot_put_head, notice: 'Female shot put head was successfully updated.' }\n format.json { render :show, status: :ok, location: @female_shot_put_head }\n else\n format.html { render :edit }\n format.json { render json: @female_shot_put_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b30e7070340f336fd8874e72a2551ac5",
"score": "0.5738703",
"text": "def update\n @noc_boat_registration = NocBoatRegistration.find(params[:id])\n\n respond_to do |format|\n if @noc_boat_registration.update_attributes(noc_params)\n format.html {redirect_to @noc_boat_registration, notice: 'Noc boat registration was successfully updated.'}\n format.json {head :no_content}\n else\n format.html {render action: \"edit\"}\n format.json {render json: @noc_boat_registration.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "eb2a9cb3436dbf62bc31070127d00fe3",
"score": "0.5734165",
"text": "def update\n respond_to do |format|\n if @regist_1.update(regist_1_params)\n format.html { redirect_to @regist_1, notice: 'Regist 1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @regist_1 }\n else\n format.html { render :edit }\n format.json { render json: @regist_1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99cbca1034c3d0d194d565b026612a2e",
"score": "0.57275313",
"text": "def update\n respond_to do |format|\n if @sregistration.update(sregistration_params)\n format.html { redirect_to @sregistration, notice: 'Sregistration was successfully updated.' }\n format.json { render :show, status: :ok, location: @sregistration }\n else\n format.html { render :edit }\n format.json { render json: @sregistration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "266caa893fccaaa28c0f04d57a9addc8",
"score": "0.5695685",
"text": "def update\n redirect_to(new_registration_url)\n \n #@registration = Registration.find(params[:id])\n\n #respond_to do |format|\n # if @registration.update_attributes(params[:registration])\n # flash[:notice] = 'Registration was successfully updated.'\n # format.html { redirect_to(@registration) }\n # format.xml { head :ok }\n # else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @registration.errors, :status => :unprocessable_entity }\n # end\n #end\n end",
"title": ""
},
{
"docid": "cae51088bdd90ffe6118c20fe0989e6c",
"score": "0.56925535",
"text": "def update\n respond_to do |format|\n if @registrationn.update(registrationn_params)\n format.html { redirect_to @registrationn, notice: 'Registrationn was successfully updated.' }\n format.json { render :show, status: :ok, location: @registrationn }\n else\n format.html { render :edit }\n format.json { render json: @registrationn.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f39a0486e66ba8371ec8ebbe4bf954fd",
"score": "0.5690776",
"text": "def update\n respond_to do |format|\n if @registration_company.update(registration_company_params)\n format.html { redirect_to @registration_company, notice: 'Registration company was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration_company }\n else\n format.html { render :edit }\n format.json { render json: @registration_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9a1fba84d54d5e7efc86e55152fec96",
"score": "0.5689901",
"text": "def update\n @registration = Registration.find(params[:id])\n respond_to do |format|\n if @registration.update_attributes(registration_params)\n format.html { redirect_to latest_matches_path, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e60703fc13a474b630d859bf42739b76",
"score": "0.56875366",
"text": "def update\n @event_registration_status = EventRegistrationStatus.find(params[:id])\n\n if @event_registration_status.update(params[:event_registration_status])\n head :no_content\n else\n render json: @event_registration_status.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a003f57e3f1590ec5b0facc1c86af746",
"score": "0.56725395",
"text": "def update\n respond_to do |format|\n if @registration_status.update(registration_status_params)\n format.html { redirect_to @registration_status, notice: 'Registration status was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration_status }\n else\n format.html { render :edit }\n format.json { render json: @registration_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a567ea07e7cb12e0d75145691f27ac2e",
"score": "0.56597674",
"text": "def update\n respond_to do |format|\n if @registration.update(registration_params)\n format.html do\n redirect_to [@course, @registration], notice: 'Registration was successfully updated.' if student_signed_in?\n redirect_to course_registrations_path(@course) if supervisor_signed_in?\n end\n format.json { render :show, status: :ok, location: [@course, @registration] }\n else\n format.html do\n render :edit if student_signed_in?\n redirect_to course_registrations_path(@course) if supervisor_signed_in?\n end\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "595df6059aaebb0862a72a01d09f4c6c",
"score": "0.5643615",
"text": "def update\n \t@session_id=session[:id]\n\t @session = Session.find(session[:id])\n\t @person = Person.find(@session.person_id)\n\t @registration = Registration.find(params[:id])\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n @registration1 = Registration.find(@registration.id)\n if(@registration1.upload!=\"upload\")\n num=Number.find_by_name(\"image_no\")\n @registration1.image_path='/uploads/'+num.value.to_s + '.jpg'\n end\n @registration1.update_attributes(params[:registration1])\n format.html { redirect_to(\"/registrations/new\", :notice => 'Registration was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @registration.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc66d30405ca5b23ddaf3fa23117b058",
"score": "0.5616415",
"text": "def change_registration\n params.require(:certificate_registration)\n params.require(:firstname)\n params.require(:lastname)\n params.require(:birthdate)\n params.require(:street)\n params.require(:street_number)\n params.require(:zipcode)\n params.require(:city)\n params.require(:vehicle_number)\n params.require(:identity_card)\n params.require(:coc)\n params.require(:evb)\n params.require(:certificate_title)\n params.require(:hu)\n begin\n registration = CarRegistration.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = \"Antrag existiert nicht.\"\n return redirect_to car_official_path\n end\n # make sure user only accesses his own contracts\n if registration.user_id == current_user.id\n reg_contract = registration_contract(registration)\n reg_contract.key = Rails.configuration.eth_deploy_key\n # first cancel the current registration\n reg_contract.transact_and_wait.cancel\n # now create a new one\n return create_registration\n else\n flash[:alert] = \"Not authorized.\"\n return redirect_to car_registration_path\n end\n end",
"title": ""
},
{
"docid": "60b5150f659b05f0cf617644b3ea42fa",
"score": "0.561054",
"text": "def update\n respond_to do |format|\n puts \"*********** update ******************\"\n puts user_registration_params\n puts \"*****************************\"\n if @user_registration.update(user_registration_params)\n format.html { redirect_to @user_registration, notice: 'User registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_registration }\n else\n format.html { render :edit }\n format.json { render json: @user_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46863c99f22e29644ce42f50399b021b",
"score": "0.5604343",
"text": "def update\n respond_to do |format|\n if @pre_registration.update(pre_registration_params)\n format.html { redirect_to @pre_registration, notice: 'Pre registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @pre_registration }\n else\n format.html { render :edit }\n format.json { render json: @pre_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ea7c53f854b8e657da82b851678a010",
"score": "0.5601984",
"text": "def update\n\n @registration = Registration.find(params[:id])\n puts params[:registration]\n if admin?\n if params[:ticket_change]\n @registration.ticket_type_old = params[:registration][:ticket_type_old]\n @registration.includes_dinner = params[:registration][:includes_dinner]\n @registration.create_or_update_payment_info\n else\n @registration.completed_by = current_user.email if admin? and @registration.registration_complete\n @registration.registration_complete = params[:registration][:registration_complete]\n @registration.payment_reference = params[:registration][:payment_reference]\n @registration.paid_amount = params[:registration][:paid_amount]\n @registration.invoiced = params[:registration][:invoiced]\n @registration.user.is_admin =\n (@registration.ticket_type_old == \"organizer\" && @registration.registration_complete)\n @registration.user.save!\n end\n end\n\n if @registration.update_attributes(params[:registration])\n if admin? && @registration.registration_complete?\n flash[:notice] = \"Information updated and confirmation mail sent\"\n\n if @registration.free_ticket?\n BoosterMailer.free_registration_completion(@registration.user).deliver\n else\n BoosterMailer.payment_confirmation(@registration).deliver\n end\n else\n flash[:notice] = \"Information updated\"\n end\n\n redirect_to @registration.user\n else\n flash.now[:error] = 'Unable to update registration'\n render :action => \"edit\"\n end\n end",
"title": ""
},
{
"docid": "171461737238e1909e8871a61733905b",
"score": "0.55964905",
"text": "def update\n respond_to do |format|\n if @user_registration.update(user_registration_params)\n format.html { redirect_to @user_registration, notice: \"Registration was successfully updated.\" }\n format.json { render :show, status: :ok, location: @user_registration }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @user_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf1410a22fa3174ca8a4bb0258844317",
"score": "0.55934143",
"text": "def update\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { redirect_to registration_path({:id=>1,:pid=>@registration.pid}), notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b72d33da23148b73dc79b643f027b563",
"score": "0.55925447",
"text": "def update\n @registration_response = @registration.registration_responses.find(params[:id])\n\n respond_to do |format|\n if @registration_response.update_attributes(params[:registration_response])\n format.html { redirect_to [@registration, @registration_response], notice: 'Registration response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration_response.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c931a063ef595e1f73b321d987b184db",
"score": "0.55879813",
"text": "def update \n @user_requirement = UserRequirement.find(params[:id])\n if @user_requirement.update_attributes(user_requirement_params) \n render json: @user_requirement, status: :updated\n else \n render json: @user_requirement.errors, status: :unprocessable_entity \n end \n end",
"title": ""
},
{
"docid": "3327a75c2f213f80eee94a9ea5bb679a",
"score": "0.5558816",
"text": "def update\n respond_to do |format|\n if @registration_request.update(registration_request_params)\n format.html { redirect_to @registration_request, notice: 'Registration request was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration_request }\n else\n format.html { render :edit }\n format.json { render json: @registration_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b07f56f64c4262c06d33c97e2d8ec001",
"score": "0.55450684",
"text": "def update\n respond_to do |format|\n if @course_registration.update(course_registration_params)\n format.html { redirect_to @course_registration, notice: 'Registration successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "543f0b8d2979488121295ce243e78644",
"score": "0.5543861",
"text": "def destroy\n @registration_head2.destroy\n respond_to do |format|\n format.html { redirect_to registration_head2s_url, notice: 'Registration head2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c1453eaa667f6e3cc84aff07ea6e414",
"score": "0.55310225",
"text": "def update\n registration = Registration.find(params[:id])\n if registration.update(registration_params)\n render json: { status: '200', message: \"Updated Registration with id #{params[:id]}\", data: registration }, status: :ok\n else\n render json: { status: '422', error: 'Registration not updated', data: registration.errors }, status: :unprocessable_entity\n end\n rescue ActiveRecord::RecordNotFound\n render json: { status: '404', error: \"No Registration with id #{params[:id]}\", data: registration }, status: :not_found\n end",
"title": ""
},
{
"docid": "d183e8b763d14d77bd87acd9e7c52d29",
"score": "0.5519538",
"text": "def update\n @registration = StudyGroupRegistration.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { redirect_to @registration, notice: 'StudyGroupRegistration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cabe761bfd9e3e1e8af81e607f817797",
"score": "0.55168426",
"text": "def update\n respond_to do |format|\n if @registration_form.update(registration_form_params)\n format.html { redirect_to registration_forms_path, notice: 'Registration form was successfully updated.' }\n format.json { render :index, status: :ok, location: @registration_form }\n else\n format.html { render :edit }\n format.json { render json: @registration_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7ef39722f2d1fb766176779bdb997f6",
"score": "0.55165714",
"text": "def update\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n flash[:notice] = 'Registration was successfully updated.'\n format.html { redirect_to :action => \"edit\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @registration.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91b24427a7f6e435fbed5de7d8d907f9",
"score": "0.5514067",
"text": "def update\n respond_to do |format|\n if @female200mts_head.update(female200mts_head_params)\n format.html { redirect_to @female200mts_head, notice: 'Female200mts head was successfully updated.' }\n format.json { render :show, status: :ok, location: @female200mts_head }\n else\n format.html { render :edit }\n format.json { render json: @female200mts_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e772e1ddaf813272888062fbf75a783f",
"score": "0.54803854",
"text": "def update\n @event_registration = EventRegistration.find(params[:id])\n\n respond_to do |format|\n if @event_registration.update_attributes(params[:event_registration])\n format.html { redirect_to @event_registration, notice: 'Event registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c480fe7a7c54a971a842526774d6e2a",
"score": "0.5472664",
"text": "def update\n respond_to do |format|\n if @test_registration.update(test_registration_params)\n format.html { redirect_to @test_registration, notice: 'Test registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_registration }\n else\n format.html { render :edit }\n format.json { render json: @test_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49278e7c1428582055ce0d3b27b90160",
"score": "0.54725504",
"text": "def update\n @phone_registration = PhoneRegistration.find(params[:id])\n\n respond_to do |format|\n if @phone_registration.update_attributes(params[:phone_registration])\n format.html { redirect_to @phone_registration, notice: 'Phone registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @phone_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb97679827c04399336dd63eeedcb949",
"score": "0.5460397",
"text": "def update\n respond_to do |format|\n if @registration_form_test_abc.update(registration_form_test_abc_params)\n format.html { redirect_to @registration_form_test_abc, notice: 'Registration form test abc was successfully updated.' }\n format.json { render :show, status: :ok, location: @registration_form_test_abc }\n else\n format.html { render :edit }\n format.json { render json: @registration_form_test_abc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40772f17b5659f7980a2abaafcbb6489",
"score": "0.5458022",
"text": "def update\n @registration_config = RegistrationConfig.find(params[:id])\n\n respond_to do |format|\n if @registration_config.update_attributes(params[:registration_config])\n update_schema\n format.html { redirect_to(@registration_config, :notice => 'RegistrationConfig was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @registration_config.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a97f263e7861b3aad8f4b328b8241126",
"score": "0.54537606",
"text": "def index\n @registration_head2s = RegistrationHead2.all\n end",
"title": ""
},
{
"docid": "36c5011a97e13f745970f0a2fa1b3293",
"score": "0.54497266",
"text": "def update\n registration = Registration.find(params[:id])\n\n if !signed_in_administrator?\n if current_attendee.kth_id != registration.kth_id\n redirect_to root_path, :flash => { :error => 'Sa dar far man icke gora! No access!' } and return\n end\n else\n #fix for reserve and payment fields\n registration.reserve = params[:registration][:reserve]\n registration.hasPayedRegistration = params[:registration][:hasPayedRegistration]\n registration.hasPayedTotal = params[:registration][:hasPayedTotal]\n end\n\n puts params[:registration]\n respond_to do |format|\n if registration.update_attributes(params[:registration])\n format.html { redirect_to project_registration_path(@project, registration), notice: 'Din anmalan har sparats. / Your registration has been saved.' }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3d59ae323717e6bc5fd6a4ade54ea0a",
"score": "0.54490376",
"text": "def update\n respond_to do |format|\n if @sign_up_two.update(sign_up_two_params)\n format.html { redirect_to @sign_up_two, notice: 'Sign up two was successfully updated.' }\n format.json { render :show, status: :ok, location: @sign_up_two }\n else\n format.html { render :edit }\n format.json { render json: @sign_up_two.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81036acabac7d068cf751c893b4d0bd1",
"score": "0.5444499",
"text": "def update\n respond_to do |format|\n if @student_registration.update(student_registration_params)\n format.html { redirect_to @student_registration, notice: 'Student registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @student_registration }\n else\n format.html { render :edit }\n format.json { render json: @student_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b971a2d30bebd48a32fd77eab1c21e44",
"score": "0.54412377",
"text": "def update\n respond_to do |format|\n if @h2.update(h2_params)\n format.html { redirect_to @h2, notice: 'H2 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @h2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2593e0c80048b05397bdef3fdf00252c",
"score": "0.54394346",
"text": "def update\n\n student_id_no = params[:registration][:student_id_card_no]\n student_nam = params[:registration][:student_name]\n semester_no = params[:registration][:semester_no]\n subject_nam = params[:registration][:subject_name]\n\n err = false\n Registration.where(:student_id_card_no => student_id_no).destroy_all\n @registration = Registration.new({semester_no: semester_no, student_name: student_nam, student_id_card_no: student_id_no, subject_no_1: subject_nam[0], subject_no_2: subject_nam[1], subject_no_3: subject_nam[2], subject_no_4: subject_nam[3], subject_no_5: subject_nam[4] })\n unless @registration.save\n err = true\n end\n\n respond_to do |format|\n if !err\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71a9b1ce40c0d256f7145482925951d1",
"score": "0.5436108",
"text": "def update\n @registration = registration_type.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(params[registration_type.to_s.downcase])\n\n format.html { redirect_to @registration, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b64fe25597166ab07162dbcbe7a2e1df",
"score": "0.54282886",
"text": "def update\n respond_to do |format|\n if @event_registration.update(event_registration_params)\n format.html { redirect_to @event_registration, notice: 'Event registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_registration }\n else\n format.html { render :edit }\n format.json { render json: @event_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46170a7389607face323c6e56d8e53b6",
"score": "0.54249483",
"text": "def update\n respond_to do |format|\n if @reg.update(reg_params)\n format.html { redirect_to @reg, notice: 'Registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @reg }\n else\n format.html { render :edit }\n format.json { render json: @reg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31b4a2c1f9b88a136a7d07b5e66918f1",
"score": "0.5423672",
"text": "def registration_head2_params\n params.require(:registration_head2).permit(:championship_id, :sex_id, :fecha, :name, :lastname, :an, :club, :region, :pais, :dni)\n end",
"title": ""
},
{
"docid": "1982c49b44ae3587a652d2a058fe45cf",
"score": "0.54230785",
"text": "def update\n @rider_registration = RiderRegistration.find(params[:id])\n\n respond_to do |format|\n if @rider_registration.update_attributes(params[:rider_registration])\n format.html { redirect_to @rider_registration, notice: 'Rider registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rider_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "981140350e43a7f5e1c05838ab43d901",
"score": "0.5419772",
"text": "def update\n respond_to do |format|\n if @academy_workshop_registration.update(academy_workshop_registration_params)\n format.html { redirect_to @academy_workshop_registration, notice: 'Workshop registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @academy_workshop_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bbd5cf1dd4ac98736e3a65f11e42eb8",
"score": "0.54192865",
"text": "def update\n #@user = User.find(params[:user][:registration_id])\n\n @user.update(user_params)\n if @user.save!\n #render json: {:new => 'succesfully registered'}\n #render :json => { :message => I18n.t('successfull.deleted'), :status => 200}, :status => 200\n #respond_to do |format|\n render :json => {:success => 'Yep', \n :status => 200}, :status => 200\n # format.json { render json: {:new => 'succesfully registered'}}\n\n #end\n else\n render :json => {:error => @user.errors.full_messages, \n :status => 200}, :status => 200\n \n #render json: @resource.errors.full_messages.to_json\n #respond_to do |format|\n # format.json { render json: @resource.errors.full_messages }\n\n # end\n end\n end",
"title": ""
},
{
"docid": "61848efe75eb7034a96a4774c9b6aa66",
"score": "0.5404813",
"text": "def update\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n format.html { redirect_to project_registration_path(@project, @registration), notice: 'Din anmalan har sparats.' }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7203caf56ea9bf599186ad3462eff6d",
"score": "0.5379507",
"text": "def update\n respond_to do |format|\n if @male100mtshurdles_head.update(male100mtshurdles_head_params)\n format.html { redirect_to @male100mtshurdles_head, notice: 'Male100mtshurdles head was successfully updated.' }\n format.json { render :show, status: :ok, location: @male100mtshurdles_head }\n else\n format.html { render :edit }\n format.json { render json: @male100mtshurdles_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d99cbee7f8b264485c30742328ee8c8",
"score": "0.53772163",
"text": "def update\n @requirements = @requirements_template.requirements\n @enumerations = @requirement.enumerations\n @labels = @requirement.labels\n respond_to do |format|\n if @requirement.update(requirement_params)\n if @requirement.previous_changes.blank?\n format.html { redirect_to edit_requirements_template_requirement_path(@requirements_template, @requirement) }\n format.json { head :no_content }\n else\n @requirement.requirements_template.touch \n format.html { redirect_to edit_requirements_template_requirement_path(@requirements_template, @requirement), notice: \"Requirement was successfully updated. \"}\n format.json { head :no_content }\n end\n else\n format.html { render action: 'index' }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d2f391578b1f7dc03f5c689635d2f1c",
"score": "0.5377164",
"text": "def update\n respond_to do |format|\n if @opt10059_two_one.update(opt10059_two_one_params)\n format.html { redirect_to @opt10059_two_one, notice: 'Opt10059 two one was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10059_two_one }\n else\n format.html { render :edit }\n format.json { render json: @opt10059_two_one.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5856900cbdcc2c6c0165280010f6f80",
"score": "0.5371231",
"text": "def update\n @registration = Registration.find(params[:id])\n if admin?\n if params[:ticket_change]\n @registration.ticket_type = params[:registration][:ticket_type]\n @registration.includes_dinner = params[:registration][:includes_dinner]\n @registration.create_payment_info\n else\n @registration.completed_by = current_user.email if admin? and @registration.registration_complete\n @registration.registration_complete = params[:registration][:registration_complete]\n @registration.payment_reference = params[:registration][:payment_reference]\n @registration.paid_amount = params[:registration][:paid_amount]\n @registration.invoiced = params[:registration][:invoiced]\n @registration.user.is_admin =\n (@registration.ticket_type == \"organizer\" && @registration.registration_complete)\n @registration.user.save!\n end\n end\n\n if @registration.update_attributes(params[:registration])\n flash[:notice] = \"Informasjonen er oppdatert#{' - husk å sende mail til bruker' if admin?}\"\n redirect_to @registration.user\n else\n flash.now[:error] = 'Kunne ikke oppdatere informasjonen'\n render :action => \"edit\"\n end\n end",
"title": ""
},
{
"docid": "c72ecd607a3087803ed9ba2d6b3eef79",
"score": "0.537115",
"text": "def update\n respond_to do |format|\n if @dummy2.update(dummy2_params)\n format.html { redirect_to @dummy2, notice: 'Dummy2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @dummy2 }\n else\n format.html { render :edit }\n format.json { render json: @dummy2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9183f23803c041b161927b9f5a79b912",
"score": "0.5370519",
"text": "def update\n respond_to do |format|\n if @start_head.update(start_head_params)\n format.html { redirect_to @start_head, notice: 'Start head was successfully updated.' }\n format.json { render :show, status: :ok, location: @start_head }\n else\n format.html { render :edit }\n format.json { render json: @start_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54facfeb44ea4d8825f64f0bbfc570e2",
"score": "0.53648525",
"text": "def update\n respond_to do |format|\n if @course_registration.update(course_registration_params)\n format.html { redirect_to @course_registration, notice: 'Course registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_registration }\n else\n format.html { render :edit }\n format.json { render json: @course_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "213ac96a3a0ffcd197007af7e8ba6081",
"score": "0.53646487",
"text": "def update\n respond_to do |format|\n if @opt10059_two_two.update(opt10059_two_two_params)\n format.html { redirect_to @opt10059_two_two, notice: 'Opt10059 two two was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10059_two_two }\n else\n format.html { render :edit }\n format.json { render json: @opt10059_two_two.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac5c7a4844f3bbbd0ae8fdc1a19baa7d",
"score": "0.53589",
"text": "def update\n respond_to do |format|\n if @head.update(head_params)\n format.html { redirect_to @head, notice: 'Head was successfully updated.' }\n format.json { render :show, status: :ok, location: @head }\n else\n format.html { render :edit }\n format.json { render json: @head.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdd38d04b8fd00c50f7837ca6d30e253",
"score": "0.53524446",
"text": "def update\n respond_to do |format|\n if @female100mtshurdles_head.update(female100mtshurdles_head_params)\n format.html { redirect_to @female100mtshurdles_head, notice: 'Female100mtshurdles head was successfully updated.' }\n format.json { render :show, status: :ok, location: @female100mtshurdles_head }\n else\n format.html { render :edit }\n format.json { render json: @female100mtshurdles_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5d3a86d6aeef11134a303df0e324acc",
"score": "0.5350231",
"text": "def update\n @registration_whitelabel = Registration::Whitelabel.find(params[:id])\n\n respond_to do |format|\n if update_from_params\n format.html { redirect_to @registration_whitelabel, notice: 'Whitelabel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registration_whitelabel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb7ed616376db4ed2ff763d2659f1e13",
"score": "0.53400296",
"text": "def update\n respond_to do |format|\n if @boilerplate.update(boilerplate_params)\n format.json { render :show, status: :ok, location: @api_v1_boilerplate }\n else\n format.json { render json: @boilerplate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "724b5ce151504a4bc314f197f007556b",
"score": "0.53326815",
"text": "def set_registration_head2\n begin\n \n @registration_head2 = RegistrationHead2.find(params[:id])\nrescue\nensure\nend\n end",
"title": ""
},
{
"docid": "7301d04848d7547e5ffa72119ab67eba",
"score": "0.53324634",
"text": "def update\n respond_to do |format|\n if @choreo_reg.update(choreo_reg_params)\n format.html { redirect_to @choreo_reg, notice: 'Choreo registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @choreo_reg }\n else\n format.html { render :edit }\n format.json { render json: @choreo_reg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64eceb4aa1f605ac267a862f1a42b797",
"score": "0.5327857",
"text": "def update\n respond_to do |format|\n if @course_registration.update(course_registration_params)\n format.html { redirect_to @course, notice: 'Course registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_registration }\n else\n format.html { render :edit }\n format.json { render json: @course_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cb2a5e97f7156ee901c366310756e86",
"score": "0.5320939",
"text": "def update\n @schedulereg = Schedulereg.find(params[:id])\n\n respond_to do |format|\n if @schedulereg.update_attributes(params[:schedulereg])\n format.html { redirect_to @schedulereg, notice: 'Registration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedulereg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
73166ef5305fd8616294335529dcbb37
|
Called when this object is being cast to a string.
|
[
{
"docid": "5e0c646dffbba16f3212f3386d7425ce",
"score": "0.0",
"text": "def to_s\n value.to_s\n end",
"title": ""
}
] |
[
{
"docid": "54a3063a28f1d8deef2a19a4a705c4fa",
"score": "0.6725205",
"text": "def convert_string\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "e84d3b683c603296879bdcbc0ab6b449",
"score": "0.60855746",
"text": "def StringValue(obj)\n Type.coerce_to(obj, String, :to_str)\nend",
"title": ""
},
{
"docid": "d69750822241720c40f7bb43b13201ed",
"score": "0.604576",
"text": "def string(t)\n @@string_visitor.visit_this_0(self, t)\n end",
"title": ""
},
{
"docid": "b35320487319c2178bc12064039229fc",
"score": "0.60391784",
"text": "def StringValue(obj)\n Rubinius::Type.coerce_to obj, String, :to_str\n end",
"title": ""
},
{
"docid": "b35320487319c2178bc12064039229fc",
"score": "0.60391784",
"text": "def StringValue(obj)\n Rubinius::Type.coerce_to obj, String, :to_str\n end",
"title": ""
},
{
"docid": "930efb3c040220e36ea66e46c7b5e95e",
"score": "0.602917",
"text": "def convert(object)\n if String === object\n object\n elsif object.respond_to?(:to_str)\n object.to_str\n else\n object.inspect\n end\n end",
"title": ""
},
{
"docid": "d1f0d39c32cd8416bb95edfd1d9c8357",
"score": "0.5921198",
"text": "def StringValue(obj)\n Type.coerce_to(obj, String, :to_str)\n end",
"title": ""
},
{
"docid": "a95e3078dbcdd5aea93162214f4c3fe8",
"score": "0.59029233",
"text": "def typecast_attribute(typecaster, value)\n value = nil if value.acts_like?(:string) && value.empty?\n super(typecaster, value)\n end",
"title": ""
},
{
"docid": "8fdd574865707d8183dc35956d66d3ae",
"score": "0.5896147",
"text": "def cast; end",
"title": ""
},
{
"docid": "cd2a7c96e5584e83a5d3e6f6c177d214",
"score": "0.58525056",
"text": "def cast(_object, type)\n CORE_FORMATTERS.include?(type) ? type : :self\n end",
"title": ""
},
{
"docid": "79963995f875db9afe89476fa57ae4d4",
"score": "0.5846473",
"text": "def convert_string string\n string\n end",
"title": ""
},
{
"docid": "ba1a4c9e4b5e7ca0aae10270d4b995b4",
"score": "0.58070433",
"text": "def is_string()\n res = super(context,self)\n return res\n end",
"title": ""
},
{
"docid": "e9a36bd302c12095e17dc05150598fff",
"score": "0.57495344",
"text": "def on_string_content; end",
"title": ""
},
{
"docid": "5045a807ccc4ca2c135cd1e48a4c5595",
"score": "0.57135695",
"text": "def to_s!\n @instance = self.to_s\n @format = :text\n end",
"title": ""
},
{
"docid": "5bb0ddca19617ed2650ce08884ce4bf2",
"score": "0.5694448",
"text": "def to_str\n\t\tself.as_string\n\tend",
"title": ""
},
{
"docid": "bdb5e59de52a7ebe0721ae461a716879",
"score": "0.5690058",
"text": "def cast_type; end",
"title": ""
},
{
"docid": "6a18af6cdf9b3e49b80eb6950d2370da",
"score": "0.56597775",
"text": "def cast(object, type); end",
"title": ""
},
{
"docid": "6a18af6cdf9b3e49b80eb6950d2370da",
"score": "0.56597775",
"text": "def cast(object, type); end",
"title": ""
},
{
"docid": "ddddd0e50bbdfba377162f32854f8831",
"score": "0.56316304",
"text": "def make_string_like(obj)\r\n\t\t\t\tif (is_string_like(obj))\r\n\t\t\t\t\treturn obj\r\n\t\t\t\telse\r\n\t\t\t\t\treturn obj.to_s()\r\n\t\t\t\tend\r\n\t\t\tend",
"title": ""
},
{
"docid": "db34dc6d93f4880af08ce69a7a1a7fbd",
"score": "0.5609005",
"text": "def to_str\n # Using any other ways of overriding the String itself will lead you all the way from infinite loops to\n # core dumps. Don't go there.\n @string\n end",
"title": ""
},
{
"docid": "821c8e27a40ffd74aa530975f3127908",
"score": "0.5606534",
"text": "def typecast_value(value)\n case value\n # always translate DataObjects ByteArray to String to avoid failing tests\n when Extlib::ByteArray then value.to_s\n else value\n end\n end",
"title": ""
},
{
"docid": "91c475369f6c4e6887b0bc3b03e5080e",
"score": "0.56017923",
"text": "def serialize_to_string(string='')\n case @@encoding\n when EncodingType::BINARY # primitive format\n serialize_to_string_old(string)\n when EncodingType::HASHMAP # JSON format with key = field.name\n serialize_to_json(:name)\n when EncodingType::TAGMAP # JSON format with key = field.tag\n serialize_to_json(:tag)\n when EncodingType::INDEXED # INDEXED format\n serialize_to_indexed\n else\n raise ArgumentError, \"Invalid encoding type\"\n end\n end",
"title": ""
},
{
"docid": "bb10bcc0f3ee986de9b7310a217ddfe8",
"score": "0.5579119",
"text": "def method_missing(method, *args, &block)\n (s = to_s).respond_to?(method) ? s.send(method, *args, &block) : super\n end",
"title": ""
},
{
"docid": "6236078128b6b7304319e59186971d70",
"score": "0.55769485",
"text": "def to_s\n if (@instance.is_a?(String))\n @instance\n else\n @instance.to_s\n end\n end",
"title": ""
},
{
"docid": "d7506c1e7e9acacaf4270f8205325a06",
"score": "0.554875",
"text": "def try_convert(obj)\n String.try_convert(obj)\nend",
"title": ""
},
{
"docid": "72b1640dfc72f25d0fd30ef277fe6d3c",
"score": "0.552374",
"text": "def force_string!\n @type = 'String'\n unless empty?\n @items = items.map(&:to_s)\n end\n end",
"title": ""
},
{
"docid": "3061a92ec7a5f91de6284a96ae011e6e",
"score": "0.55183154",
"text": "def to_s\n self.respond_to?(:text) ? @text : super.to_s\n end",
"title": ""
},
{
"docid": "e268c67a819e7c854101af0a226ef7cc",
"score": "0.55029875",
"text": "def typecast_to_string(value)\n value.to_s\n end",
"title": ""
},
{
"docid": "bfae4e917d5ce917b1c603458821f839",
"score": "0.5489027",
"text": "def typecast_value(column, value)\n s = super\n if s.is_a?(String) && !s.is_a?(Sequel::SQL::Blob) && (fe = model.forced_encoding)\n s = s.dup if s.frozen?\n s.force_encoding(fe)\n end\n s\n end",
"title": ""
},
{
"docid": "f76a37477bd0a37a587c5396236b8b19",
"score": "0.54861426",
"text": "def method_missing(method_name, *args, **kwds)\n ret = to_s.public_send(method_name, *args, **kwds)\n ret.respond_to?(:to_str) ? self.class.new(ret) : ret\n end",
"title": ""
},
{
"docid": "0ab9bf59d7f8c0c512e045be62135000",
"score": "0.54857385",
"text": "def to_s() abstract end",
"title": ""
},
{
"docid": "0ab9bf59d7f8c0c512e045be62135000",
"score": "0.54857385",
"text": "def to_s() abstract end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.5484908",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.5484908",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.5484908",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.5484908",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.5484908",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "02404f3e844aff8dcfc9b3622bad0ef8",
"score": "0.5484908",
"text": "def to_s\n @string || @object.to_s\n end",
"title": ""
},
{
"docid": "ea687922a118f960c63fadf91c8cbb07",
"score": "0.54790276",
"text": "def stringify(object)\n case object\n when Runtime::Character, String then object.inspect\n when TrueClass then '#t'\n when FalseClass then '#f'\n else object.to_s\n end\n end",
"title": ""
},
{
"docid": "a6f7134304dd55c8a8638ad76741aaf2",
"score": "0.54613876",
"text": "def to_s\n return @string if @string\n @string = @exporter.export self\n end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "c5102d7f884ed2a4f4e594b4c5e48d46",
"score": "0.54612744",
"text": "def string; end",
"title": ""
},
{
"docid": "b4d0567e99e2fda14d6a21023dee27e5",
"score": "0.54588836",
"text": "def type_cast(value); end",
"title": ""
},
{
"docid": "14da9793d7f21b1880c51b54d85a154f",
"score": "0.54528517",
"text": "def cast_type_literal(type)\n (type == String) ? 'CHAR(254)' : super\n end",
"title": ""
},
{
"docid": "8ad0d95e62b27fa63b07f215153bb13a",
"score": "0.5443742",
"text": "def type_cast(value, column)\n return super unless column\n case value\n when String\n if :binary == column.type\n # Send binary data as binary format\n { :value => value, :format => 1 }\n else\n super\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "8ad0d95e62b27fa63b07f215153bb13a",
"score": "0.5442023",
"text": "def type_cast(value, column)\n return super unless column\n case value\n when String\n if :binary == column.type\n # Send binary data as binary format\n { :value => value, :format => 1 }\n else\n super\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "0429a365ba2e0f808337d3394c078dae",
"score": "0.5436992",
"text": "def string()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "c6d315b86c2b75a151bf66d0084204b8",
"score": "0.5435596",
"text": "def to_s \r\n\t\t@string\r\n\tend",
"title": ""
},
{
"docid": "8d53f627724cc01cb0be97f026554ba9",
"score": "0.54337513",
"text": "def emit_to_string\n execute_emitter(Emitters::StringEmitter.new(@options))\n end",
"title": ""
},
{
"docid": "2e19d3f0408794e3355e39a66c1e1a6a",
"score": "0.54286605",
"text": "def type\n\t\t@str.type\n\tend",
"title": ""
},
{
"docid": "a77f6cde34d6956d5dba05661e21089f",
"score": "0.54074013",
"text": "def before_type_cast\n @target\n end",
"title": ""
},
{
"docid": "ae8bbe8b034eb9ef56b64fd6b3152b18",
"score": "0.5398961",
"text": "def to_str\n\t\t# nothing to do here\n\tend",
"title": ""
},
{
"docid": "9aa1a93a50b1d8bbd001634237d819aa",
"score": "0.53866357",
"text": "def string(key, options = {})\n cast(:string, key, options)\n end",
"title": ""
},
{
"docid": "c87b64d909780f7567868557f9e4d443",
"score": "0.53826237",
"text": "def to_s; @text; end",
"title": ""
},
{
"docid": "8de80077206046df158429f1061fe7da",
"score": "0.5379125",
"text": "def to_s\n return self.str\n end",
"title": ""
},
{
"docid": "ed66d0297ac90fabb48fdfd0ca2c4610",
"score": "0.53754926",
"text": "def cast(value); end",
"title": ""
},
{
"docid": "ed66d0297ac90fabb48fdfd0ca2c4610",
"score": "0.53754926",
"text": "def cast(value); end",
"title": ""
},
{
"docid": "ed66d0297ac90fabb48fdfd0ca2c4610",
"score": "0.53754926",
"text": "def cast(value); end",
"title": ""
},
{
"docid": "ffab3b68ed010f5b2a83c18cddb048ea",
"score": "0.53688544",
"text": "def on_tstring_content(value)\n super(value.force_encoding('UTF-8'))\n end",
"title": ""
},
{
"docid": "562d414c00a9cb13a731110c76fd5e39",
"score": "0.5367563",
"text": "def on_tstring_content(value); end",
"title": ""
},
{
"docid": "50617eff8adb5d96bbd988aa8325c99b",
"score": "0.5365294",
"text": "def canonicalize!\n @string = @object.to_s if @object\n self\n end",
"title": ""
},
{
"docid": "50617eff8adb5d96bbd988aa8325c99b",
"score": "0.5365294",
"text": "def canonicalize!\n @string = @object.to_s if @object\n self\n end",
"title": ""
},
{
"docid": "d01456b3e3c89fba616b07291328de69",
"score": "0.53599674",
"text": "def __cast(val)\n val\n end",
"title": ""
},
{
"docid": "fe2eed2fd2b7781ff2ab3412c32af29c",
"score": "0.53598917",
"text": "def method_missing(method, *args, &block)\n return method.to_s if valid_type?(method)\n super\n end",
"title": ""
},
{
"docid": "cff06d0e8503f80ac2249047ea50288b",
"score": "0.535721",
"text": "def coerce(value)\n value.to_s\n end",
"title": ""
},
{
"docid": "963503710bb2e40cb0940df31ee7aac6",
"score": "0.5340345",
"text": "def to_s_safe(obj)\n if obj.respond_to?(:to_s)\n obj.to_s\n else\n 'to_s error'\n end\n end",
"title": ""
},
{
"docid": "afd755187df2ebef98c6ac78464fe94a",
"score": "0.5337637",
"text": "def to_s\n @string\n end",
"title": ""
},
{
"docid": "6646070fa0a303a44cd5ebcc75bd240d",
"score": "0.5335248",
"text": "def from_ruby_object arg\n return \"StringValueCStr(#{arg})\" if @type.char?\n arg\n end",
"title": ""
},
{
"docid": "c894a7eb22d55c2c60f5cd5218512733",
"score": "0.5331994",
"text": "def process_string(inattr, outattr = '')\n basic_converter(self, inattr, outattr) do |text|\n ::ParanoidStarlight::Converters.one_liner(text)\n end\n end",
"title": ""
},
{
"docid": "60ba482fdce1d56c351a7f864aa9866c",
"score": "0.53291434",
"text": "def coerce_string(ctx, value:, **)\n value.to_s\n end",
"title": ""
},
{
"docid": "f37c3c3db657f4194c0d147b58481063",
"score": "0.53165644",
"text": "def to_s\n# return @string if @string\n @obj.inline = self.inline\n @string = @exporter.export @obj\n end",
"title": ""
},
{
"docid": "7ea86d75cce0d70ff8264df49fcaa0e5",
"score": "0.53049016",
"text": "def on_xstring_new; end",
"title": ""
},
{
"docid": "d31191d9e14d90e3f18bda3ee6301f5a",
"score": "0.52990896",
"text": "def as_string\n self\n end",
"title": ""
},
{
"docid": "82c8848410e21883f84e6d5b244a1b93",
"score": "0.5298708",
"text": "def to_s; text; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.529691",
"text": "def to_str; end",
"title": ""
},
{
"docid": "f21c4e309242c7742e5861eff536fe6b",
"score": "0.52943957",
"text": "def on_string_literal(string); end",
"title": ""
},
{
"docid": "d8a257633b4e5f22af1cefb3f3517646",
"score": "0.5294199",
"text": "def cast(value)\n value.to_s.gsub(/\\A\\\"|\\\"\\z/, '')\n end",
"title": ""
},
{
"docid": "d8a257633b4e5f22af1cefb3f3517646",
"score": "0.5294199",
"text": "def cast(value)\n value.to_s.gsub(/\\A\\\"|\\\"\\z/, '')\n end",
"title": ""
},
{
"docid": "45d3fbad7de5b969f5f9af98e79bcec7",
"score": "0.52903193",
"text": "def handle_string_type\n case tags[:string_type]\n when :hex\n modify_for_endianness \"H\", true\n when :base64\n \"m\"\n when :bit\n modify_for_endianness \"B\", true\n else\n modify_for_endianness \"a\", true\n end\n end",
"title": ""
},
{
"docid": "b1d87e1c86f6a2bed2994f3e1432e137",
"score": "0.52865297",
"text": "def typecast(value); end",
"title": ""
},
{
"docid": "b1d87e1c86f6a2bed2994f3e1432e137",
"score": "0.52865297",
"text": "def typecast(value); end",
"title": ""
},
{
"docid": "443b8b2f0332981434df00c3754ae2eb",
"score": "0.527738",
"text": "def to_str\n return self\n end",
"title": ""
},
{
"docid": "a7a3646923d8065331e3668e85bf0e87",
"score": "0.52749664",
"text": "def cast_to_string(*attributes)\n attributes.each do | an_attr |\n define_method(an_attr) { instance_variable_get(\"@#{an_attr}\").to_s }\n define_method(\"#{an_attr}=\") { |to| instance_variable_set(\"@#{an_attr}\", to.to_s) }\n end\n end",
"title": ""
},
{
"docid": "39000b8a1023a0144d83f4466bf58202",
"score": "0.52727467",
"text": "def to_s\n\t\treturn @str\n\tend",
"title": ""
},
{
"docid": "dd26977343be744ee86c804df37467d8",
"score": "0.5272025",
"text": "def to_s\n string_ptr = C.copy_string_rep_of_target_data(self)\n string = string_ptr.read_string\n C.dispose_message(string_ptr)\n\n string\n end",
"title": ""
},
{
"docid": "69ea57767faa2d3feeadb361319d887f",
"score": "0.5271565",
"text": "def to_str\n @string\n end",
"title": ""
},
{
"docid": "cb7a1abcc12028a3fb0b023c0338fcf1",
"score": "0.52712226",
"text": "def cast(klass, value)\n TYPES.each do |type|\n return CONVERT[type].call(value) if CHECK[type].call(klass)\n end\n # String, blank\n # remove carriage returns injected by textarea fields\n value.to_s.tr(\"\\r\", '')\n end",
"title": ""
},
{
"docid": "dab40ba078bfa82283437625f2fc5047",
"score": "0.5267576",
"text": "def to_s\n\t\t\traise \"#{self.class} has not implemented a text representation\"\n\t\tend",
"title": ""
}
] |
c25fcbdaeb92a6fe878d99c5ae43b75a
|
Description Checks if a specific tag is present in the database (if yes, the tag box gets colored) Mode Json
|
[
{
"docid": "a3567822843e2a8711ca9174c6039a87",
"score": "0.5534326",
"text": "def check_presence\n render :json => {:ok => Tag.where(:word => params[:word]).any?}\n end",
"title": ""
}
] |
[
{
"docid": "83bcb447e61e04af5e61ca79ec825a5a",
"score": "0.64920324",
"text": "def taggable?\n description['taggable'] == true\n end",
"title": ""
},
{
"docid": "756a099b48c7171952d28903293d18e1",
"score": "0.6290121",
"text": "def report_json_tags(json_data)\n puts \"component: \" + File.basename(json_data[\"url\"])\n puts \"ref: \" + json_data[\"ref\"].to_s\n if tagged?(json_data[\"url\"], json_data[\"ref\"].to_s)\n tagged = \"Tagged? [ Yes ]\"\n else\n tagged = \"Tagged? [ No ]\"\n end\n col_len = (ENV[\"COLUMNS\"] || 70).to_i\n puts format(\"\\n%#{col_len}s\\n\\n\", tagged)\n puts (\"*\" * col_len)\n end",
"title": ""
},
{
"docid": "15f5bdfa6e41504e37b6c1e165e42554",
"score": "0.5971449",
"text": "def tagged?; end",
"title": ""
},
{
"docid": "65aeb6e6469237b4cffee032516bcf68",
"score": "0.5899352",
"text": "def taggable?\n definition['taggable'] == true\n end",
"title": ""
},
{
"docid": "adc9b7d9e2e33f2aacb40dfca72f0693",
"score": "0.5877147",
"text": "def hastag?(tag)\n @tags[tag] ? true : false\n end",
"title": ""
},
{
"docid": "39d0f92ecc3f355441da2968d0605e0a",
"score": "0.5857502",
"text": "def check_tags(tags)\n if tags['Purpose'] == 'Continuous Integration' && tags['Environment'] == 'QA'\n return 'yes'\n else\n return 'no'\n end\nend",
"title": ""
},
{
"docid": "b06517dcbb2a0bcc5dff5d1b80f2fe3e",
"score": "0.57083255",
"text": "def tags() ; info[:tags] ; end",
"title": ""
},
{
"docid": "b06517dcbb2a0bcc5dff5d1b80f2fe3e",
"score": "0.57083255",
"text": "def tags() ; info[:tags] ; end",
"title": ""
},
{
"docid": "67299dd1827b20348d1e1a249619083e",
"score": "0.57015973",
"text": "def return_tag_infos(tag, language_code)\n if tag.nil?\n render :status => 400, :json => { :error => { :message => 'Tag not found', :code => 'InvalidRequest' }}\n else\n tag_infos = create_tag_infos(tag, language_code)\n\n render :status => 200, :json => { :tags => [tag_infos] }\n end\n end",
"title": ""
},
{
"docid": "64ecd473aa6df1d8d442482c39bbfc0d",
"score": "0.56849",
"text": "def tagged?(tag)\n @tags.include?(tag)\n end",
"title": ""
},
{
"docid": "20c7139ce7a3f713431fbee923876af5",
"score": "0.56795967",
"text": "def has_tag? tag\n out = false\n selected.each do |view|\n if view.rmq_data.has_tag?(tag)\n out = true # This is weird because of RM android bug\n break\n end\n end\n\n out\n end",
"title": ""
},
{
"docid": "9404220353ca9a8296c9b5462764f048",
"score": "0.5673032",
"text": "def has_tag?(tag)\n self.tags.include?(tag)\n end",
"title": ""
},
{
"docid": "bd35f29b3f5ad0b18d13f627756eb6fc",
"score": "0.56723726",
"text": "def tag; end",
"title": ""
},
{
"docid": "bd35f29b3f5ad0b18d13f627756eb6fc",
"score": "0.56723726",
"text": "def tag; end",
"title": ""
},
{
"docid": "7dc209e51c0724812322332165205654",
"score": "0.5671593",
"text": "def has_tag?(value)\r\n @tags.include?(value)\r\n end",
"title": ""
},
{
"docid": "97e963b8f85136056e0593ebc98d5396",
"score": "0.5642147",
"text": "def show\n tagging = Tagging.find(params[:id])\n tag = tagging.tag\n render json: {status: 'SUCCESS', message:'Loaded tagging', data:tagging, tag:tag},status: :ok\n end",
"title": ""
},
{
"docid": "190ec1e3e3da3e7a153c970c90c83063",
"score": "0.5633473",
"text": "def has_tags?\n tags.is_a?(Hash) ? false : true\n end",
"title": ""
},
{
"docid": "2e74a653555e37c7c50edec3eb6c182f",
"score": "0.561429",
"text": "def tags_on(model, format = :html)\n begin\n case format\n when :html\n #t = '<img src=\"/images/tag.gif\" alt=\"Tags\" />'\n t = '<ul class=\"tags\">'\n model.tags.each do |tag|\n t << \"<li><a href=\\\"#{tag.url}\\\">#{tag.title}</a></li>\"\n end\n t << '</ul>'\n when :json\n model.tags.map { |t|\n {:id => t.name, :name => t.title}\n }.to_json\n else\n t = model.tags.map{ |t| t.title }.join(', ')\n end\n rescue\n # HACK: This is probably only going to break because a blank model is\n # missing a primary key or something like that. Since we call this\n # method SO much (and because that specific error is not subclassed\n # by Sequel) no custom error handling here.\n ''\n end\n end",
"title": ""
},
{
"docid": "3b14a38a8ad0baaf45458066f765242b",
"score": "0.5608652",
"text": "def has_tag?(tag)\n tags.include?(tag.to_s)\n end",
"title": ""
},
{
"docid": "06b924518bcce754e82c57bb7d38f7de",
"score": "0.55751824",
"text": "def add_info_on_tag_ids\n desc_hash = Notion.where(locale: @lecture.locale || I18n.default_locale)\n .pluck(:title, :tag_id, :aliased_tag_id)\n .map { |x| [x.first.downcase, x.second || x.third] }\n .select { |x| x.first.in?(@content_descriptions.map(&:downcase)) }\n .to_h\n @content.each do |c|\n c['tag_id'] = desc_hash[c['description'].downcase]\n end\n end",
"title": ""
},
{
"docid": "584fcae2ed5df3a1e28d2cd482cc8b7b",
"score": "0.5574618",
"text": "def show\n @tag = Tag.find(params[:id])\n if !@tag.nil?\n render json: @tag, status: :ok\n else\n render json: @tag.errors, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "b6da9be0bfe2f346e57151926bd8ea05",
"score": "0.55475616",
"text": "def has_tag? tag\n @values.has_key?(Values.unify_tag(tag.to_s))\n end",
"title": ""
},
{
"docid": "5766e7d195a671c5f85190f40403efa5",
"score": "0.55457294",
"text": "def tags\n @data['tags']\n end",
"title": ""
},
{
"docid": "28ed75bee98a986ce7046afe8d651659",
"score": "0.55404264",
"text": "def has_tag\n return @has_tag unless @has_tag.nil?\n get_tag_information\n @has_tag\n end",
"title": ""
},
{
"docid": "6d13e7b38ca72e32cadcf0dc8bc85635",
"score": "0.5511354",
"text": "def create\n if params[\"theme\"].eql? \"Existing Tags\"\n @temp = Tagg.find(params[:tagg][:id])\n params[:tagg][:name] = @temp.name\n end\n\n @tagg = Tagg.new(params[:tagg])\n @tagg.post_id = params[\"post_id\"]\n @post = Post.find(params[\"post_id\"])\n\n\n respond_to do |format|\n @arr = Tagg.where( \"post_id = ? AND name = ?\", params[\"post_id\"], params[:tagg][:name] )\n if @arr.empty?\n if @tagg.save\n format.html { redirect_to @post, notice: 'Tag was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tagg.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to @post, notice: 'Tag already exists.' }\n format.json { render json: @post, status: :created, location: @post }\n end\n end\n end",
"title": ""
},
{
"docid": "ee9c2b7c9dd2a56a7f24b46ed8d8f62a",
"score": "0.550844",
"text": "def tag\n require_admin_permissions\n @model = 'tag'\n @key = 'tag'\n @values = Tag.all.pluck(:tag)\n render 'tags'\n end",
"title": ""
},
{
"docid": "57976df3c9051f6cb094d073abc36601",
"score": "0.55083853",
"text": "def tags\n @values.fetch('tags') { \n @values['tags'] = {}\n }\n end",
"title": ""
},
{
"docid": "7b45ef4d4463ba73bc3ca11da1376a78",
"score": "0.5485914",
"text": "def add_new_tag\n puts \"******* add_new_tag *******\"\n puts \" ** params: #{params.inspect}\"\n\n @post_id = params[:post_id]\n\n # == create brand new tag; add to Tags\n if params[:new_tag] != \"new\"\n\n # == check if tag already exists\n check_tag = Tag.where(tag_name: params[:new_tag])\n puts \" ** check_tag.length: #{check_tag.length.inspect}\"\n\n # == create new tag if not existing and assign to post\n if check_tag.length == 0\n @tag = Tag.create(tag_name: params[:new_tag], tag_rank: 0)\n @post_tag = PostTag.create(post_id: params[:post_id], tag_id: @tag[:id])\n puts \" ** NEW TAG @post_tag: #{@post_tag.inspect}\"\n end\n end\n\n # == assign existing tag if selected from select box (not \"ng\")\n if params[:tag_id] != \"ng\"\n\n # == check if tag already assigned to post\n check_tag = PostTag.where(post_id: params[:post_id], tag_id: params[:tag_id])\n puts \" ** check_tag.length: #{check_tag.length.inspect}\"\n\n if check_tag.length == 0\n @post_tag = PostTag.create(post_id: params[:post_id], tag_id: params[:tag_id])\n puts \" ** EXISTING TAG @post_tag: #{@post_tag.inspect}\"\n end\n end\n @post_tags = PostTag.where(post_id: params[:post_id])\n @post_tag_ids = @post_tags.map{|pt| pt.tag_id }\n @post_no_tags = Tag.where(\"id NOT IN (?)\", @post_tag_ids)\n @tags = Tag.where(id: @post_tag_ids)\n render json: { tags: @tags, post_no_tags: @post_no_tags, post_id: @post_id}\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5484492",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5484492",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5484492",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5484492",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5484492",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4cee7dba45c0eb682fb4cabef91dd1b5",
"score": "0.546116",
"text": "def supported_tags\n [\n # attributes\n # :color\n\n # simple tags\n \"issue-type\".to_sym, :severity,\"cvss-score\".to_sym, :remediation, \"fix-recommendation\".to_sym,\n :advisory,\n ]\n end",
"title": ""
},
{
"docid": "9730fbe20cb8c8f003d5dc00353bfa9f",
"score": "0.54608196",
"text": "def has_tag?(name); end",
"title": ""
},
{
"docid": "cc8fac1ae313f0b1a127f33feb150ccd",
"score": "0.5452744",
"text": "def has_tag? tag\n selected.each do |view|\n return true if view.rmq_data.has_tag?(tag)\n end\n false # tag doesn't exist if we got here\n end",
"title": ""
},
{
"docid": "d93fb2fd432bf87a1b02d97915230e71",
"score": "0.54460496",
"text": "def has_tag?(item, tag)\n return false if item[:tags].nil?\n item[:tags].include? tag\n end",
"title": ""
},
{
"docid": "b44c269cdf73eefeb28dbbdbbbe26302",
"score": "0.54432476",
"text": "def show\n get_status\n @tag = Tag.find(params[:id])\n taggings = Tagging.where(:tag_id => params[:id])\n\n post_ids = []\n taggings.each do |tagging|\n post_ids << tagging.post_id\n end\n post_ids.compact!\n\n @posts = Post.where(:id => post_ids).order('created_at DESC').page(params[:page]).per(5)\n @labels = [\"<span class=\\\"label\\\">\",\"<span class=\\\"label label-success\\\">\",\"<span class=\\\"label label-warning\\\">\",\"<span class=\\\"label label-important\\\">\",\"<span class=\\\"label label-info\\\">\"]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "9d63e38ec50e9f0b9f64571d510ca868",
"score": "0.5430845",
"text": "def hash_tags\n tags = \"\"\n object.data_types.each do |d|\n name = d.name\n tags = tags + h.content_tag( :span, '#' + name, class: 'scenario-tag data-type')\n end\n object.visualization_types.each do |d|\n name = d.name\n tags = tags + h.content_tag( :span, '#' + name, class: 'scenario-tag vis-type')\n end\n object.visualization_tasks.each do |d|\n name = d.name\n tags = tags + h.content_tag( :span, '#' + name, class: 'scenario-tag task')\n end\n return tags.html_safe\n end",
"title": ""
},
{
"docid": "c137e7b0a3437d32079182e19cfcfed0",
"score": "0.5427816",
"text": "def has_tag?(tag)\r\n self.tags.count(:name => tag.name)> 0\r\n end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.54243225",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.54243225",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.54243225",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.54243225",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.54243225",
"text": "def tags; end",
"title": ""
},
{
"docid": "3e087b25f4e7baf69aa07318e5ec7021",
"score": "0.54082024",
"text": "def create_tag_infos(tag, language_code)\n return_tag = {}\n\n # tag infos\n unless tag.nil?\n return_tag[:id] = tag.id\n return_tag[:tag_identifier] = tag.tag_identifier\n\n unless tag.description.nil? or tag.description.empty?\n return_tag[:description] = tag.description\n end\n\n unless tag.place.nil?\n return_tag[:places] = tag.place.id\n end\n\n # name\n # show original name if no lang_code is set\n if language_code.nil? and !tag.original_name.nil?\n return_tag[:name] = { :text => tag.original_name.text, :lang => tag.original_name.lang_code }\n elsif !language_code.nil? and tag.name_translations.count > 0\n return_tag[:name] = { :text => tag.get_name_translation(language_code), :lang => language_code }\n end\n\n # text_record infos\n unless tag.text_record.nil?\n unless tag.text_record.gender.nil?\n return_tag[:gender] = tag.text_record.gender\n end\n\n unless tag.text_record.image_url.empty?\n return_tag[:image_url] = tag.text_record.image_url\n end\n\n unless tag.text_record.text_url.empty?\n return_tag[:text_url] = tag.text_record.text_url\n end\n\n # show original text if no lang_code is set\n if language_code.nil? and !tag.text_record.original_text.nil?\n text = tag.text_record.original_text.text.to_s\n lang_code = tag.text_record.original_text.lang_code.to_s\n elsif !language_code.nil? and tag.text_record.translations.count > 0\n text = tag.text_record.get_translation(language_code)\n lang_code = language_code\n\n # convert to string\n text = text.to_s\n end\n\n unless text.nil?\n unless text.empty?\n return_tag[:translation] = { :text => text, :lang => lang_code }\n end\n end\n end\n\n # linked tags\n if tag.has_children?\n linked_tags = []\n tag.children.all.each { |t| linked_tags << create_linked_tag_infos(t, language_code) }\n return_tag[:linked_tags] = linked_tags\n end\n\n # parent tag\n unless tag.is_root?\n return_tag[:parent_tag] = create_linked_tag_infos(tag.parent, language_code)\n end\n\n # hardware\n unless tag.hardwares.nil? or tag.hardwares.count < 1\n hw_items = []\n tag.hardwares.each do |item|\n hw = {}\n\n hw[:type] = item.hardware_type\n hw[:identifier] = item.identifier\n\n if location = item.current_location\n hw[:latitude] = location.latitude\n hw[:longitude] = location.longitude\n end\n\n unless item.major.nil? and item.minor.nil?\n hw[:major] = item.major\n hw[:minor] = item.minor\n end\n\n hw_items << hw\n end\n return_tag[:hardware] = hw_items\n end\n end\n\n return_tag\n end",
"title": ""
},
{
"docid": "8fd6cc2312b6e2fed5cc29f616eb5c75",
"score": "0.53965604",
"text": "def is_tagged?\n ! @tags.empty?\n end",
"title": ""
},
{
"docid": "7b0113f2554597c554a6de8aa1d2da96",
"score": "0.5385586",
"text": "def tag_exists? (tag)\n found_tag = \"\"\n tags = get_server_tags\n if tags.is_a? Array\n tags.each do |t| \n if t.include?(tag)\n found_tag = t\n end\n end\n else \n fail(\"ERROR: list of tags is not Array as it was expected\")\n end\n return found_tag.gsub(/\\n/, \"\").gsub(/\\\"/, \"\").strip\n end",
"title": ""
},
{
"docid": "4346879562c5853741f5bc403c2a8630",
"score": "0.53810394",
"text": "def has_tag?(t)\n tags.include?(t)\n end",
"title": ""
},
{
"docid": "7cdf7c366d1c4ac3b82e3684286ce778",
"score": "0.5373893",
"text": "def is_tagged?\n ! @tags.empty?\n end",
"title": ""
},
{
"docid": "106e17b00d76d610ae358eeaa11e14c5",
"score": "0.5373511",
"text": "def has_tag? (tag)\n\n @tags.include?(tag)\n end",
"title": ""
},
{
"docid": "fc4c3cce4f5421a2f1109f3724247b1e",
"score": "0.5372471",
"text": "def show\n @tag_name = params[:id]\n @tag = Tag.find_by_name(@tag_name)\n if @tag\n # this is a hack and should be replaced with custom SQL queries\n @taggings = @tag.taggings.by_type('Post')\n @news_taggings = @taggings.select {|tagging| tagging.taggable.news? }\n @gossip_taggings = @taggings.select {|tagging| tagging.taggable.gossip? }\n @question_taggings = @taggings.select {|tagging| tagging.taggable.question? }\n end\n end",
"title": ""
},
{
"docid": "6cd5ef13a8af431101f6d245ffd3a9dd",
"score": "0.5368923",
"text": "def tag\n end",
"title": ""
},
{
"docid": "6cd5ef13a8af431101f6d245ffd3a9dd",
"score": "0.5368923",
"text": "def tag\n end",
"title": ""
},
{
"docid": "48b9951aa5e15c4f970bb26a4033fa21",
"score": "0.5366739",
"text": "def check_tag(new_tag)\n db = connect_to_database()\n if db.execute(\"SELECT * FROM tags WHERE Tag = ?\", new_tag.downcase) != []\n return true \n else \n return false \n end \n end",
"title": ""
},
{
"docid": "f70a93a799f6e88996cfb09a8eb7bef0",
"score": "0.53634375",
"text": "def getRecipeByTag\n begin\n @recipe = Recipe.where('tags ILIKE ?', '%'+params[:tag]+'%').all\n\n if !@recipe.empty?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "90db9acf1dd852c6a955274fe90a0852",
"score": "0.5361525",
"text": "def create\n tag = Tag.find_or_create_by(name: params[:tag][:name])\n if !current_user.tags.find_by(id: tag.id) # use this instead of .find(tag.id)< returns an error but .find_by returns nil and goes throgh tot eh if statement.\n Tagging.create(user_id: current_user.id, tag_id: tag.id)\n render json: tag\n end\n # this is the only way we will return a tag, if the tag doesn;t exisit.\n end",
"title": ""
},
{
"docid": "1c4d67fcb26dd45324afc4f1dd32d5db",
"score": "0.5358342",
"text": "def tag\n @tag ||= to_boolean_phrase.hash.abs.to_s(36)\n end",
"title": ""
},
{
"docid": "6f4be0225fc85c5924670920741ebb8c",
"score": "0.535038",
"text": "def format_tag_data(controller)\n {\n name: tag_name(controller),\n description: format_sentence(controller.description),\n }.reject { |_, v| v.blank? }\n end",
"title": ""
},
{
"docid": "886e5759fd2cb58bfb0f28ac69afe008",
"score": "0.53443056",
"text": "def tag_selected?\n # 入力されたタグ文字列を検証\n if self.added_tags.to_s.scan(/\\[.*?\\]/).blank? &&\n self.deleted_at.blank? &&\n self.tags.blank? &&\n self.selected_tags.blank?\n errors.add(:selected_tags, I18n.t('article.tag_validation_error'))\n end\n end",
"title": ""
},
{
"docid": "db761237296621206890ec4837b90bdf",
"score": "0.53364795",
"text": "def create\n @tag = Tag.new tag_params\n @tag.admin = current_user\n if @tag.save\n render :show, status: 200\n elsif @tag.errors.messages[:value].include? 'has already been taken' # there's probably a better way to do this\n render json: { error: '409 conflict with existing record' }, status: 409\n else\n render json: { error: '422 unprocessable entity' }, status: 422\n end\n end",
"title": ""
},
{
"docid": "caa131e875ed8e15f7aa9ba570b04e6c",
"score": "0.5335747",
"text": "def has_tag?( country, tag_key )\n tags = country.tags.top.select { |tag| tag.key == tag_key }\n if tags.size > 0\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "db6015582e6779ec198c7a651da47a8e",
"score": "0.5327416",
"text": "def see_tag(text); end",
"title": ""
},
{
"docid": "105d591a565c3cf7507df23153a30267",
"score": "0.5316514",
"text": "def show\n @tag = Tag.find(params[:id])\n if current_admin\n if params[:pin]\n @tag.photo_id = params[:pin]\n @tag.save\n end\n end\n # @category_photo = @tag.photo\n @photos = Photo.includes(:tags).where(:tags => {:name => @tag.name})\n @untagged_photos = []\n Photo.all.each do |p|\n @untagged_photos << p if p.tags.count == 0\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tag }\n end\n end",
"title": ""
},
{
"docid": "433b328990ef170a1ccae367f6b76b2e",
"score": "0.53130686",
"text": "def tag_state(tag)\n if current_user.globally_excluded?(tag)\n t(\"winnow.tags.general.globally_excluded\")\n elsif current_user.subscribed?(tag)\n t(\"winnow.tags.general.subscribed\")\n elsif (current_user.id == tag.user_id) && tag.public\n t(\"winnow.tags.general.public\")\n end\n end",
"title": ""
},
{
"docid": "0e461a27cd6d1b5dc91db22480b42610",
"score": "0.5298265",
"text": "def any_tags?\n graph.exist?(\"og\")\n end",
"title": ""
},
{
"docid": "835a7e116fff541974ef9e95090a91b2",
"score": "0.5267228",
"text": "def find_tag_info(tag_info, dictionary)\n ti = default_tag_info(tag_info)\n ti[:is_tag] = (tag_info[COMPLETE_MATCH]&.start_with? '[')\n if ti[:is_tag]\n ti[:closing_tag] = (tag_info[CLOSING_MATCH] == '/')\n ti[:tag] = tag_info[TAG_MATCH].to_sym.downcase\n ti[:params] = {}\n @definition = dictionary[ti[:tag]]\n if !tag_in_dictionary?\n # Tag is not defined in dictionary, so treat as text\n raise \"unknown tag #{ti[:tag]}\" if RubyBBCode.configuration.ignore_unknown_tags == :exception\n\n ti = default_tag_info(tag_info)\n ti[:is_tag] = false\n ti[:text] = if RubyBBCode.configuration.ignore_unknown_tags == :text\n tag_info[COMPLETE_MATCH]\n else\n ''\n end\n elsif (tag_info[TAG_PARAM_MATCH][0] == '=') && can_have_quick_param?\n quick_param = tag_info[TAG_PARAM_MATCH][1..-1]\n # Get list of parameter values and add them as (regular) parameters\n value_array = quick_param.scan(@definition[:quick_param_format])[0]\n if value_array.nil?\n ti[:invalid_quick_param] = quick_param\n else\n param_tokens = @definition[:param_tokens]\n value_array[0..param_tokens.length - 1].each.with_index do |value, i|\n ti[:params][param_tokens[i][:token]] = value\n end\n end\n elsif tag_info[TAG_PARAM_MATCH][0] == \"\\s\"\n regex_string = '((\\w+)=([\\w#]+)) | ((\\w+)=\"([^\"]+)\") | ((\\w+)=\\'([^\\']+)\\')'\n tag_info[TAG_PARAM_MATCH].scan(/#{regex_string}/ix) do |param_info|\n param = param_info[1] || param_info[4] || param_info[7]\n value = param_info[2] || param_info[5] || param_info[8]\n ti[:params][param.to_sym] = value\n end\n end\n else\n # Plain text\n ti[:text] = tag_info[TEXT]\n end\n ti\n end",
"title": ""
},
{
"docid": "30c5156aadb607916523cffd00c74470",
"score": "0.5261286",
"text": "def has_tag?(tag) # rubocop:disable Naming/PredicateName\n !get_tag(tag).nil? # nil is considered not present, thus we can't use `Hash#has_key?`\n end",
"title": ""
},
{
"docid": "763dedc0b8f2e294ccd76366c32cfe5e",
"score": "0.52532744",
"text": "def show\n render json: @has_project_tag\n end",
"title": ""
},
{
"docid": "1f58893f0fea0919e84eea1369374acb",
"score": "0.5252123",
"text": "def description\n @tags.map { |tag| tag.to_s.capitalize }.join(\", \")\n end",
"title": ""
},
{
"docid": "d28962b9761d063083a931264cdb3cfe",
"score": "0.5250816",
"text": "def create\n @tag = Tag.new(tag_params)\n render json: @tag.errors unless @tag.save\n end",
"title": ""
},
{
"docid": "d29c72788307b4ffd3b02a01f154c2b9",
"score": "0.5249102",
"text": "def tag(tag); end",
"title": ""
},
{
"docid": "d29c72788307b4ffd3b02a01f154c2b9",
"score": "0.5249102",
"text": "def tag(tag); end",
"title": ""
},
{
"docid": "955d8c90e9f4efa1439c8a083bbf58a8",
"score": "0.5247118",
"text": "def show\n if @tag.present?\n respond_with @tag, status: :ok, location: tags_path(@tag)\n else\n render json: {error: 'Could not find the resource. Check if you are using the right tag_id.'}, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "0fce177d98e04d49633a48c58ee05b12",
"score": "0.52418137",
"text": "def tag_in_dictionary?\n !@definition.nil?\n end",
"title": ""
},
{
"docid": "4358d3d98d17a799195cb9b3dc2a0b58",
"score": "0.52396816",
"text": "def set_tagged_bool\n self.tag.split(\" \").empty? ? self.tagged = false : self.tagged = true\n end",
"title": ""
},
{
"docid": "b26771a3eff5e1fd0cee1b3b7a8d1801",
"score": "0.52345747",
"text": "def map_tag(tag)\n case\n when tag == \"FeatureArea\"\n return \"Feature Area\"\n when tag == \"Customization_Setup\"\n return \"Customization and setup\"\n when tag == \"Data_Model\"\n return \"Data model\"\n when tag == \"Custom_Objects_Tabs_Fields\"\n return \"Objects and fields\"\n when tag == \"Validation_Rules\"\n return \"Validation rules\"\n when tag == \"Formulas\"\n return \"Formulas\"\n when tag == \"Data_Management\"\n return \"Data management\"\n when tag == \"Data_Loader\"\n return \"Data Loader\"\n when tag == \"Data_Export\"\n return \"Data export\"\n when tag == \"Logic\"\n return \"Logic\"\n when tag == \"Apex_Code_Development_Deployment\"\n return \"Apex Code\"\n when tag == \"Workflow_Approvals\"\n return \"Workflow\"\n when tag == \"API_Integration_Performance\"\n return \"Integration\"\n when tag == \"Bulk_API\"\n return \"Bulk API\"\n when tag == \"Chatter_REST_API\"\n return \"Chatter REST API\"\n when tag == \"Java_SDK\"\n return \"Java SDK\"\n when tag == \"Metadata_API\"\n return \"Metadata API\"\n when tag == \"REST_Metadata_API\"\n return \"Metadata REST API\"\n when tag == \"REST_API\"\n return \"REST API\"\n when tag == \"SOAP_API\"\n return \"SOAP API\"\n when tag == \"Streaming_API\"\n return \"Streaming API\"\n when tag == \"Security\"\n return \"Security\"\n when tag == \"Passwords_Login\"\n return \"Passwords\"\n when tag == \"OAuth\"\n return \"OAuth\"\n when tag == \"Sharing_Visibility\"\n return \"Sharing and visibility\"\n when tag == \"Manage_Users_Profiles\"\n return \"Users and profiles\"\n when tag == \"Deployment_Distribution\"\n return \"Testing and deployment\"\n when tag == \"Change_Management_Change_Sets\"\n return \"Change sets\"\n when tag == \"Deploying\"\n return \"Deploying\"\n when tag == \"Sandbox\"\n return \"Test databases\"\n when tag == \"Packaging_for_Distribution\"\n return \"Packaging for distribution\"\n when tag == \"Mobile\"\n return \"Mobile development\"\n when tag == \"Type\"\n return \"Type\"\n when tag == \"FAQ\"\n return \"FAQs\"\n when tag == \"Guide\"\n return \"Guides\"\n when tag == \"RelNote\"\n return \"Release notes\"\n when tag == \"Tutorial\"\n return \"Tutorials\"\n when tag == \"Video\"\n return \"Videos\"\n else\n return ''\n end\n end",
"title": ""
},
{
"docid": "9f1274e2cc1c6a5e1680a309bb8636e8",
"score": "0.522314",
"text": "def single_tag_questions\n\t# Listing the all the questions related to the tag\n\t\tquestions = Question.with_all_tags(params[:tag])\n\t\t#checking questions is present or not.\n\t\tif questions.present?\n \trender :json=> {success: true, \"question\" => questions.as_json(\"question_data\") }\n\t else\n\t render :json=> { success: false, message: \"Questions are not present\" },:status=> 203\n\t end\n\tend",
"title": ""
},
{
"docid": "75ceff5814970092cee2c40330c92d81",
"score": "0.52187955",
"text": "def tag_name; end",
"title": ""
},
{
"docid": "75ceff5814970092cee2c40330c92d81",
"score": "0.52187955",
"text": "def tag_name; end",
"title": ""
},
{
"docid": "75ceff5814970092cee2c40330c92d81",
"score": "0.52187955",
"text": "def tag_name; end",
"title": ""
},
{
"docid": "d84cb1aee38b0869a77237329bbb688a",
"score": "0.52186525",
"text": "def tags\n @obj['tags']\n end",
"title": ""
},
{
"docid": "6206975597b45261ad477712b0201454",
"score": "0.52165335",
"text": "def is_tag?( tag = '' )\n return false unless @is_tag\n\n return true if tag.blank?\n\n tag_obj = get_queried_object\n\n tag = [tag] unless tag.is_a?(Array)\n tag.map!(&:to_s)\n\n if tag.include?(tag_obj.term_id.to_s)\n return true\n elsif tag.include?(tag_obj.name)\n return true\n elsif tag.include?(tag_obj.slug)\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "7cbf95f06c0a89788b29a47ad0e8a866",
"score": "0.52100116",
"text": "def create\n @tag = Tag.new(params[:tag])\n\n if @tag.save\n render json: JSON.parse(@tag.to_json)\n else\n render json: JSON.parse(@tag.errors.to_json)\n end\n end",
"title": ""
},
{
"docid": "d09dad0cba9d39038f445e39dd502fe7",
"score": "0.520239",
"text": "def show_my_tags\n tags = Tag.where('customer_id = ? AND active = ?', current_customer.id, true)\n\n if tags.nil?\n return_error_infos(400, 'No tags found', 'NoTagsFound', nil)\n else\n json_tags = []\n\n tags.each { |tag| json_tags << create_tag_infos(tag, nil) }\n\n render :status => 200, :json => { :tags => json_tags }\n end\n end",
"title": ""
},
{
"docid": "3797a7988f1ba39a983f52d6154fb286",
"score": "0.5197008",
"text": "def tagged?(tag)\n !! self.tag(tag)\n end",
"title": ""
},
{
"docid": "e9d60e550d87646aed83a8301f4a1e34",
"score": "0.51896405",
"text": "def no_new_tag\n puts red(\"No new tag found\")\n end",
"title": ""
},
{
"docid": "2e67cdfcde8925b59a9218e3d2ffc3d1",
"score": "0.51815087",
"text": "def show\n tag = Tag.find_by_tid(params[:id])\n if tag.nil?\n render json_status_response(404, \"Tag not found\")\n return\n end\n\n render :status => 200,\n :json => tag_as_hash(tag).merge({\n status: 200,\n # TODO csrf\n })\n end",
"title": ""
},
{
"docid": "a43f684ec8ca37126c84dbcf97a96c3f",
"score": "0.5175378",
"text": "def has_description?\n true\n end",
"title": ""
},
{
"docid": "5c1a99e2d7dee5ca0a2a7ad711510601",
"score": "0.5161719",
"text": "def has_tag(tag)\n @tags.include?(\"@#{tag}\")\n end",
"title": ""
},
{
"docid": "5e4fdb8252617adc34f6e82d4e868504",
"score": "0.5154809",
"text": "def display_collection_tag_info(tags_info:, num_tags:, tags_error:, tag_keys:)\n if num_tags == 0\n # there are no tags, or there was an issue retrieving the collection tag\n # information from cmr search (.json format) in which case we are displaying\n # a flash message\n content_tag(:p, 'There are no tags associated with this collection')\n elsif tags_error\n # we retrieved the collection's tag keys, but ran into an issue retrieving\n # further tag information, so we can display the tag keys but no more\n content_tag(:div) do\n concat(content_tag(:div, \"There was an error retrieving Tag information: #{tags_error}\", class: 'eui-banner--danger'))\n\n concat(content_tag(:ul) do\n tag_keys.each do |tag_key|\n concat(content_tag(:p) do\n concat(content_tag(:li) do\n concat(content_tag(:strong, 'Tag Key: '))\n concat(content_tag(:span, tag_key))\n end)\n concat(content_tag(:li) do\n concat(content_tag(:strong, 'Description: '))\n concat(content_tag(:span, 'Not retrieved'))\n end)\n end)\n end\n end)\n end\n else\n content_tag(:ul) do\n tags_info.each do |tag|\n concat(content_tag(:p) do\n concat(content_tag(:li) do\n concat(content_tag(:strong, 'Tag Key: '))\n concat(content_tag(:span, tag.fetch('tag_key', 'Not found')))\n end)\n concat(content_tag(:li) do\n concat(content_tag(:strong, 'Description: '))\n # If there is no description, the response can hold '' so fetch is\n # not sufficient\n description = tag.fetch('description', '')\n description = 'Not provided' if description.blank?\n concat(content_tag(:span, description))\n end)\n end)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "364480b41b0dc8ee5537c3f35e674a1b",
"score": "0.514958",
"text": "def tag=(value)\n @tag = value\n self.status = TAG_STATUS.fetch(value)\n @tag\n end",
"title": ""
},
{
"docid": "4658df85b039bf9fa1b026f5e6c018de",
"score": "0.5147196",
"text": "def supported_tags\n [\n # attributes\n # :color\n\n # simple tags\n :name, :module_name, :severity, :type, :impact, :description,\n :detailed_information, :recommendation, :cwe,\n\n # tags that correspond to Evidence\n :details, :affects, :parameter, :aop_source_file, :aop_source_line,\n :aop_additional, :is_false_positive,\n\n\n # nested tags\n :request, :response,\n :cvss_descriptor, :cvss_score,\n\n # multiple tags\n :cve_list, :references\n ]\n end",
"title": ""
},
{
"docid": "6ce5740c536b282a75be108fbaefb660",
"score": "0.5146242",
"text": "def index\n return render_json_for_api(Tag.map) if params[:map] == \"true\" && api_call?\n @tags_with_counts = Tag.\n joins(:vulnerabilities).\n group(\"tags.id\").\n select(\"tags.name\",\n \"tags.shortname\",\n \"tags.color\",\n \"tags.icon\",\n \"tags.id\",\n \"tags.family\",\n 'count(*) AS num_vulns').\n having('count(*) > 1')\n\n @tags = Tag.order(name: :asc).\n select(\"\n *,\n substring(tags.description from 0 for 240) || '...' as short_desc\n \")\n @articleTags = ArticleTag.joins(:article).distinct(:article_id).select(:title, :blurb, :art)\n if @tags == nil\n flash[:error] = \"Error: Tag not found\"\n redirect_to controller: 'tags', :action => 'index'\n else\n render_json_for_api(@tags)\n end\n end",
"title": ""
},
{
"docid": "51643e7119645b8d5fba7da454b121e0",
"score": "0.5146137",
"text": "def tags_with_html_content\n [:details, :description, :detailed_information, :impact]\n end",
"title": ""
},
{
"docid": "51643e7119645b8d5fba7da454b121e0",
"score": "0.5146137",
"text": "def tags_with_html_content\n [:details, :description, :detailed_information, :impact]\n end",
"title": ""
},
{
"docid": "ca4f77315e19679ba8f407a1bc9cf5be",
"score": "0.5144845",
"text": "def complete_tags\n\n end",
"title": ""
},
{
"docid": "b66fb386561fe0c5ddc8b7e73ad2f0c8",
"score": "0.51436555",
"text": "def hastag2?\n ! @tag2.empty?\n end",
"title": ""
},
{
"docid": "7500e8e999d377e09db37d969823dd35",
"score": "0.5142291",
"text": "def value_for_tag?(tag)\n @set_fields[tag] || false\n end",
"title": ""
},
{
"docid": "9dc346dfcf46664cb477ce3b5c2b6d0c",
"score": "0.5142114",
"text": "def create\n params[:tag][:name].downcase!\n params[:tag][:name] = params[:tag][:name].gsub(/[^a-z0-9]+/,'-')\n\n \n @find = Tag.find(:first, :conditions => \"name = '#{params[:tag][:name]}'\")\n if @find.nil?\n @tag = Tag.new(params[:tag])\n @tag_link = @tag.tag_links.build(params[:tag_link])\n @tag.save\n render :json => {:msg => \"Created and added #{@tag.name} to list of tags\",:tag=>@tag.name}\n else\n @link_find = TagLink.find(:first, :conditions => {:tag_id => @find.id, :taggable_type => params[:tag_link][:taggable_type],:taggable_id => params[:tag_link][:taggable_id]})\n if @link_find.nil?\n @tag_link = @find.tag_links.build(params[:tag_link])\n @find.save\n render :json => {:msg=>\"Added #{@find.name} to list of tags\",:tag=>@find.name}\n else\n render :json => {:msg=>\"This object is already tagged with #{@find.name}\",:tag=>@find.name}\n end\n end\n end",
"title": ""
}
] |
d315737eee405c01dd5a06da457dfe29
|
:callseq: ios.read([length [, buffer ]]) => string, buffer, or nil Reads at most length bytes from the I/O stream, or to the end of file if length is omitted or is nil. length must be a nonnegative integer or nil. If the optional buffer argument is present, it must reference a String, which will receive the data. At end of file, it returns nil or "" depend on length. ios.read() and ios.read(nil) returns "". ios.read(length [, buffer]) returns nil. If the ContentLength of the HTTP request is known (as is the common case for POST requests), then ios.read(length [, buffer]) will block until the specified length is read (or it is the last chunk). Otherwise, for uncommon "TransferEncoding: chunked" requests, ios.read(length [, buffer]) will return immediately if there is any data and only block when nothing is available (providing IOreadpartial semantics).
|
[
{
"docid": "33a6a4088d491a94498f557b6de9dced",
"score": "0.0",
"text": "def read(*args)\n @socket ? tee(super) : @tmp.read(*args)\n end",
"title": ""
}
] |
[
{
"docid": "e46f2deb8dcbd1a1edffa9a3a0060f48",
"score": "0.71864706",
"text": "def read(length = nil)\n assert_can_read\n\n read = \"\"\n if length.nil?\n loop {\n err, current_read = APR.file_read(@native_file, 100)\n APR.raise_apr_errno(err, ignore: [APR::APR_SUCCESS, APR::APR_EOF])\n break if current_read.length == 0\n read += current_read\n }\n else\n err, read = APR.file_read(@native_file, length)\n APR.raise_apr_errno(err, ignore: [APR::APR_SUCCESS, APR::APR_EOF])\n end\n\n if length.nil?\n # should be \"\" if nothing was read (EOF hit)\n read\n elsif length == 0\n # Per ruby documents, return \"\" on length == 0\n \"\"\n else\n # length was provided non-zero, so return nil if nothing read\n read == \"\" ? nil : read\n end\n end",
"title": ""
},
{
"docid": "4a9d4606003e605999937cae7e490086",
"score": "0.69145393",
"text": "def read(length = nil, buffer = nil)\n raise ArgumentError, \"negative length #{length} given\" if length && length < 0\n\n return '' if length == 0\n res = buffer.nil? ? '' : buffer.clear\n\n chunk_size = length.nil? ? @connection.buffer_size : length\n begin\n while chunk_size > 0\n chunk = readpartial(chunk_size)\n break unless chunk\n res << chunk\n chunk_size = length - res.length unless length.nil?\n end\n rescue EOFError\n end\n return length && res.length == 0 ? nil : res\n end",
"title": ""
},
{
"docid": "3e90208ec03e1254f76bc8befe849709",
"score": "0.68951",
"text": "def read(length = nil, offset = 0)\t\n\t\t\tif (length == nil)\n\t\t\t\tdata = ''\n\t\t\t\tfptr = offset\n\t\t\t\tok = self.client.read(self.file_id, fptr, self.chunk_size)\n\t\t\t\twhile (ok and ok['Payload'].v['DataLenLow'] > 0)\n\t\t\t\t\tbuff = ok.to_s.slice(\n\t\t\t\t\t\tok['Payload'].v['DataOffset'] + 4,\n\t\t\t\t\t\tok['Payload'].v['DataLenLow']\n\t\t\t\t\t)\n\t\t\t\t\tdata << buff\n\t\t\t\t\tif ok['Payload'].v['Remaining'] == 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\t\tfptr += ok['Payload'].v['DataLenLow']\n\t\t\t\t\t\n\t\t\t\t\tbegin\n\t\t\t\t\t\tok = self.client.read(self.file_id, fptr, self.chunk_size)\n\t\t\t\t\trescue XCEPT::ErrorCode => e\n\t\t\t\t\t\tcase e.error_code\t\t\t\t\t\n\t\t\t\t\t\twhen 0x00050001\n\t\t\t\t\t\t\t# Novell fires off an access denied error on EOF\n\t\t\t\t\t\t\tok = nil\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\traise e\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\treturn data\n\t\t\telse\n\t\t\t\tok = self.client.read(self.file_id, offset, length)\n\t\t\t\tdata = ok.to_s.slice(\n\t\t\t\t\tok['Payload'].v['DataOffset'] + 4,\n\t\t\t\t\tok['Payload'].v['DataLenLow']\n\t\t\t\t)\n\t\t\t\treturn data\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "6e4c003fc2816e2143ffea6c8d43ac24",
"score": "0.6860479",
"text": "def read(length = nil)\n @buffer.read(length)\n end",
"title": ""
},
{
"docid": "d74e71951d4f32bf250e43a8ae067b44",
"score": "0.6695102",
"text": "def read(length = nil, rv = '')\n if length\n if length <= @rbuf.size\n length < 0 and raise ArgumentError, \"negative length #{length} given\"\n rv.replace(@rbuf.slice!(0, length))\n else\n to_read = length - @rbuf.size\n rv.replace(@rbuf.slice!(0, @rbuf.size))\n until to_read == 0 || eof? || (rv.size > 0 && @chunked)\n @socket.kgio_read(to_read, @buf) or eof!\n filter_body(@rbuf, @buf)\n rv << @rbuf\n to_read -= @rbuf.size\n end\n @rbuf.replace('')\n end\n rv = nil if rv.empty? && length != 0\n else\n read_all(rv)\n end\n rv\n end",
"title": ""
},
{
"docid": "c5685082de8315c41ffec42474b662e5",
"score": "0.6675459",
"text": "def raw_read(path, off, sz)\n #puts \"enter raw_read?{#{path}, #{off}, #{sz})\"\n uri = URI.parse(path2uri(path))\n req = Net::HTTP::Get.new(uri.path)\n req.range=(off..off+sz-1)\n res = Net::HTTP.start(uri.host, uri.port) {|http| http.request(req) }\n case res\n when Net::HTTPPartialContent \n res.body\n else \n nil\n end\n end",
"title": ""
},
{
"docid": "0c2658ee91c742e4fd52226fc94d0607",
"score": "0.65805244",
"text": "def read(handle, offset, length); end",
"title": ""
},
{
"docid": "7d7e38ed13385c9112149900584ee09e",
"score": "0.65441763",
"text": "def read(length=nil)\n return '' if @file_length.zero?\n if length == 0\n return ''\n elsif length.nil? && @file_position.zero?\n read_all\n else\n read_length(length)\n end\n end",
"title": ""
},
{
"docid": "55785cddbd08dda5c94a1da14395b807",
"score": "0.65252787",
"text": "def read(length = nil, buffer = nil)\n\t\t\t\tbuffer ||= Async::IO::Buffer.new\n\t\t\t\tbuffer.clear\n\t\t\t\t\n\t\t\t\tuntil buffer.bytesize == length\n\t\t\t\t\t@buffer = read_next if @buffer.nil?\n\t\t\t\t\tbreak if @buffer.nil?\n\t\t\t\t\t\n\t\t\t\t\tremaining_length = length - buffer.bytesize if length\n\t\t\t\t\t\n\t\t\t\t\tif remaining_length && remaining_length < @buffer.bytesize\n\t\t\t\t\t\t# We know that we are not going to reuse the original buffer.\n\t\t\t\t\t\t# But byteslice will generate a hidden copy. So let's freeze it first:\n\t\t\t\t\t\t@buffer.freeze\n\t\t\t\t\t\t\n\t\t\t\t\t\tbuffer << @buffer.byteslice(0, remaining_length)\n\t\t\t\t\t\t@buffer = @buffer.byteslice(remaining_length, @buffer.bytesize)\n\t\t\t\t\telse\n\t\t\t\t\t\tbuffer << @buffer\n\t\t\t\t\t\t@buffer = nil\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn nil if buffer.empty? && length && length > 0\n\t\t\t\t\n\t\t\t\treturn buffer\n\t\t\tend",
"title": ""
},
{
"docid": "a9a657b710f63da1e84c886baea7f483",
"score": "0.6498259",
"text": "def read(length=nil)\n end",
"title": ""
},
{
"docid": "6af6ba1e30871815cbdfcfe1180bcfc4",
"score": "0.6476434",
"text": "def read(length); end",
"title": ""
},
{
"docid": "6af6ba1e30871815cbdfcfe1180bcfc4",
"score": "0.6476434",
"text": "def read(length); end",
"title": ""
},
{
"docid": "f27ae3d8f6696ed9ea95098ff0a7e847",
"score": "0.64587563",
"text": "def read_bytes(io, length); end",
"title": ""
},
{
"docid": "8791cd630230267a9c2a3672b7d3c11c",
"score": "0.6441095",
"text": "def readpartial(length=nil)\n begin\n io.readpartial(length)\n rescue EOFError\n nil\n end\n end",
"title": ""
},
{
"docid": "f9ff02e449be40c718a37550b617b95b",
"score": "0.6402121",
"text": "def read(length=512)\n if @length\n return nil if @bytes_read >= @length # Already read everything requested\n if @bytes_read + length > @length # Will we read more than requested?\n length = @length - @bytes_read # Truncate it!\n end\n end\n\n buf = @file.read(length)\n @bytes_read += buf.size if buf\n buf\n end",
"title": ""
},
{
"docid": "0ed93118cc2cca3c2d415956d7e3b9b4",
"score": "0.63910383",
"text": "def readpartial( length )\n while (io = @ios[@pos])\n r = io.read( length )\n if r.nil?\n @pos = @pos + 1\n next\n else\n if io.eof?\n @pos = @pos + 1\n end\n return r\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "6907ec4e2ba0adadf90db34642fd86cd",
"score": "0.63628143",
"text": "def read(length = nil, buffer = nil)\n\t\t\t\tif buffer\n\t\t\t\t\tbuffer.clear\n\t\t\t\telse\n\t\t\t\t\tbuffer = String.new\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif length\n\t\t\t\t\treturn String.new(encoding: Encoding::BINARY) if length <= 0\n\t\t\t\t\t\n\t\t\t\t\t# Fast path:\n\t\t\t\t\tif buffer = self.sysread(length, buffer)\n\t\t\t\t\t\t\n\t\t\t\t\t\t# Slow path:\n\t\t\t\t\t\twhile buffer.bytesize < length\n\t\t\t\t\t\t\t# Slow path:\n\t\t\t\t\t\t\tif chunk = self.sysread(length - buffer.bytesize)\n\t\t\t\t\t\t\t\tbuffer << chunk\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn buffer\n\t\t\t\t\telse\n\t\t\t\t\t\treturn nil\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tbuffer = self.sysread(BLOCK_SIZE, buffer)\n\t\t\t\t\t\n\t\t\t\t\twhile chunk = self.sysread(BLOCK_SIZE)\n\t\t\t\t\t\tbuffer << chunk\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\treturn buffer\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "2d95288409dcfec4240cd6a0d6f7ad37",
"score": "0.6348454",
"text": "def read(n_bytes)\n http_range = (@pos..(@pos + n_bytes - 1))\n maybe_size, maybe_body = request_range(http_range)\n if maybe_size && maybe_body\n @remote_size = maybe_size\n @pos += maybe_body.bytesize\n maybe_body.force_encoding(Encoding::ASCII_8BIT)\n end\n end",
"title": ""
},
{
"docid": "31557c23840ad7a0ddc72a99c3e6af96",
"score": "0.6334781",
"text": "def readpartial(length = nil)\n if length.nil? && @buffer.length > 0\n slice = @buffer\n @buffer = \"\"\n else\n unless finished_reading? || (length && length <= @buffer.length)\n @connection.readpartial(length ? length - @buffer.length : @connection.buffer_size)\n end\n\n if length\n slice = @buffer.slice!(0, length)\n else\n slice = @buffer\n @buffer = \"\"\n end\n end\n\n slice && slice.length == 0 ? nil : slice\n end",
"title": ""
},
{
"docid": "b376889fcaf25b444e54a89bb9d54716",
"score": "0.6334156",
"text": "def read(length=nil, buffer=nil)\n ensure_open_and_readable\n buffer = StringValue(buffer) if buffer\n\n unless length\n str = read_all\n return str unless buffer\n\n buffer.replace str\n return buffer\n end\n\n return nil if @ibuffer.exhausted?\n\n str = \"\"\n needed = length\n while needed > 0 and not @ibuffer.exhausted?\n available = @ibuffer.fill_from self\n\n count = available > needed ? needed : available\n str << @ibuffer.shift(count)\n str = nil if str.empty?\n\n needed -= count\n end\n\n return str unless buffer\n\n if str\n buffer.replace str\n buffer\n else\n buffer.replace ''\n nil\n end\n end",
"title": ""
},
{
"docid": "6ffbc6fef44b4198b159b4fbb71c4512",
"score": "0.632983",
"text": "def read(opts={})\n\t\t\t\t\toptions = {\n\t\t\t\t\t\t:length => nil # nil means read all\n\t\t\t\t\t}.update(opts)\n\t\t\t\t\treturn @hndl.read(options[:length])\n\t\t\t\tend",
"title": ""
},
{
"docid": "ef33e17a1df8a7e1ef824efbb9995af2",
"score": "0.6299612",
"text": "def read(len = nil)\n check_closed\n\n return nil if @read >= @header.size\n\n len ||= @header.size - @read\n max_read = [len, @header.size - @read].min\n\n ret = @io.read max_read\n @read += ret.size\n\n ret\n end",
"title": ""
},
{
"docid": "920ecfba6bfccfa85fa8c9d0229ecfe0",
"score": "0.6293659",
"text": "def read(n=nil)\n raise IOError, \"Missing stream.\" if @file == nil\n process_metadata\n return @file.read(n)\n end",
"title": ""
},
{
"docid": "1e2f5674ab521143f3cc9372cd5dd528",
"score": "0.62869847",
"text": "def read(length=nil, offset=nil)\n File.read(path, length, offset)\n end",
"title": ""
},
{
"docid": "6a466749903585ec6e8b71a684a227be",
"score": "0.6248774",
"text": "def read(length=nil)\n # @todo add a seek option\n ensure_mode('r') do\n length ||= files_doc[:length] - @file_position\n return read_string(length)\n end\n end",
"title": ""
},
{
"docid": "b6b198d8cf3b06badac03109a440fe2c",
"score": "0.6245893",
"text": "def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b6b198d8cf3b06badac03109a440fe2c",
"score": "0.6245893",
"text": "def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "266b093b35d7fc658a6afd213ea51f65",
"score": "0.62332886",
"text": "def read(offset, length = nil)\n @file.seek(offset)\n length ? @file.read(length) : @file.read\n end",
"title": ""
},
{
"docid": "5e96a58adba597e994c42ee5eac1c4a2",
"score": "0.62276703",
"text": "def read( socket )\n reset_timeout( socket )\n\n response = @pending_responses[socket]\n\n if response[:has_full_headers]\n headers = response[:parsed_headers]\n\n if headers['Transfer-Encoding'].to_s.downcase == 'chunked'\n read_size = socket.gets.to_s[0...-CRLF.size]\n return if read_size.empty?\n\n if (read_size = read_size.to_i( 16 )) > 0\n response[:body] << socket.read( read_size + CRLF.size ).to_s[0...read_size]\n return\n end\n else\n # A Content-Type is not strictly necessary, the end of the response body\n # can also be signaled by the server closing the connection. That's why\n # the following code is so ugly.\n\n read_size = nil\n if (content_length = headers['Content-length'].to_i) > 0\n read_size = content_length - response[:body].size\n end\n\n has_body = headers['Content-length'] != '0'\n\n closed = false\n if has_body\n begin\n line = (read_size ? socket.read(read_size) : socket.gets)\n if line\n response[:body] << line\n else\n raise RaptorIO::Socket::Error::BrokenPipe\n end\n rescue RaptorIO::Socket::Error::BrokenPipe\n closed = true\n response[:force_no_keep_alive] = true\n end\n end\n\n # Return back to the #select loop if there's more data to be read\n # and wait for our next turn.\n return if has_body && ((!read_size && !closed) || (response[:body].size < content_length))\n end\n\n handle_success( socket )\n return true\n end\n\n response[:headers] << socket.gets.to_s\n\n # Keep going until we get all the headers.\n return if !(response[:headers] =~ HEADER_SEPARATOR_PATTERN)\n response[:has_full_headers] = true\n\n # Perform some preliminary parsing to make our lives easier.\n response[:partial_response] = Response.parse( response[:headers] )\n response[:parsed_headers] = response[:partial_response].headers\n\n # Some of the body may have gotten into the headers' buffer, sort them out.\n response[:headers], response[:body] = response[:headers].split( HEADER_SEPARATOR_PATTERN, 2 )\n\n # If there is no body to expect handle the response now.\n if response[:partial_response].headers['Content-length'] == '0' ||\n status_without_body?( response[:partial_response].code )\n handle_success( socket )\n return true\n end\n\n nil\n end",
"title": ""
},
{
"docid": "07b6adbd750ec30bbf9b78a0afb4760c",
"score": "0.6200182",
"text": "def readpartial(size, buffer = nil)\n timeout = false\n loop do\n result = @socket.read_nonblock(size, buffer, :exception => false)\n\n return :eof if result.nil?\n return result if result != :wait_readable\n\n raise TimeoutError, \"Read timed out after #{@read_timeout} seconds\" if timeout\n\n # marking the socket for timeout. Why is this not being raised immediately?\n # it seems there is some race-condition on the network level between calling\n # #read_nonblock and #wait_readable, in which #read_nonblock signalizes waiting\n # for reads, and when waiting for x seconds, it returns nil suddenly without completing\n # the x seconds. In a normal case this would be a timeout on wait/read, but it can\n # also mean that the socket has been closed by the server. Therefore we \"mark\" the\n # socket for timeout and try to read more bytes. If it returns :eof, it's all good, no\n # timeout. Else, the first timeout was a proper timeout.\n # This hack has to be done because io/wait#wait_readable doesn't provide a value for when\n # the socket is closed by the server, and HTTP::Parser doesn't provide the limit for the chunks.\n timeout = true unless @socket.to_io.wait_readable(@read_timeout)\n end\n end",
"title": ""
},
{
"docid": "b24d2d101c168e4d725a1c5b97f2d661",
"score": "0.6173096",
"text": "def read(len = nil)\n return nil if @read >= @size\n len ||= @size - @read\n max_read = [len, @size - @read].min\n ret = @io.read(max_read)\n @read += ret.size\n ret\n end",
"title": ""
},
{
"docid": "2649f4d6678c40a4a75172db22fc7d84",
"score": "0.6147116",
"text": "def read name,length=nil,offset=nil\n ret = nil\n self.open(name) do |f|\n f.seek(offset) unless offset.nil?\n ret = f.read(length)\n end\n ret\n end",
"title": ""
},
{
"docid": "d1e69491f23a092831dc661c9531cd9b",
"score": "0.6136152",
"text": "def read(length = nil, opts = {})\n\t\tlength = 16384 unless length\n\n\t\tbegin\n\t\t\treturn sslsock.sysread(length)\n\t\trescue EOFError, ::Errno::EPIPE\n\t\t\treturn nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1533743f48f97def9f0194a4c1848350",
"score": "0.6133449",
"text": "def read(length = nil, outbuf = nil)\n @io.read(length, outbuf)\n end",
"title": ""
},
{
"docid": "bfd4cb7d3e2a95b69ab500744176ede7",
"score": "0.61332345",
"text": "def read(length = nil)\n\t\treturn process.channel.read(length)\n\tend",
"title": ""
},
{
"docid": "89d7629b395892e7fc0c471fda14da33",
"score": "0.61252505",
"text": "def read(length)\n @connection.read length\n end",
"title": ""
},
{
"docid": "e09ea76d8465791b9e751c2cc3e4af9b",
"score": "0.6096224",
"text": "def read(length)\n Logger.debug \"reading #{length} bytes from buffer\"\n @buffer.read length\n end",
"title": ""
},
{
"docid": "ace30011a1cca1b236a3e85cb50452cd",
"score": "0.60770077",
"text": "def read(size = nil, result = nil)\n if result\n result.replace('')\n else\n result = ''\n end\n if size\n return nil if @ios.empty?\n until @ios.empty?\n cur = @ios.first.read(size)\n if cur\n result << cur\n break if cur.size >= size\n size -= cur.size\n end\n @ios.shift.close\n end\n else\n return \"\" if @ios.empty?\n until @ios.empty?\n io = @ios.shift\n result << io.read\n io.close\n end\n end\n result\n end",
"title": ""
},
{
"docid": "0951b65ff451a71b035d5d93d360df70",
"score": "0.60760427",
"text": "def read(buffer, offset, length)\n str = nil\n begin\n str = @io.read(length)\n rescue StandardError => e\n raise java.io.IOException.new(\"failed reading from ruby IO object\")\n end\n if str.nil?\n return -1\n else\n jstr = str.to_java\n for i in 0 .. jstr.length - 1\n buffer[i + offset] = jstr.charAt(i)\n end\n return jstr.length\n end\n end",
"title": ""
},
{
"docid": "1a115c2acd7848416a9c5910af3f67be",
"score": "0.6073595",
"text": "def sysread(length)\n if length._equal?(nil)\n len = 4096\n else\n len = Maglev::Type.coerce_to(length, Fixnum, :to_int)\n raise ArgumentError, \"length must not be negative\" if len < 0\n end\n str = self.recv(len)\n if str._equal?(nil)\n raise EOFError, \"End of file on socket\"\n end\n str\n end",
"title": ""
},
{
"docid": "e9b96abc1520aeac68e24519baf62861",
"score": "0.6061967",
"text": "def read!(socket)\n read_head!(socket)\n read_body!(socket)\n self\n end",
"title": ""
},
{
"docid": "a25be66441d52ff159510b5aaa093109",
"score": "0.6052696",
"text": "def read(request, options = {})\n\n end",
"title": ""
},
{
"docid": "8b9be5f3201d3e44da5673ee9a2f20ad",
"score": "0.6044414",
"text": "def readpartial(size, buffer = nil)\n @socket.readpartial(size, buffer)\n rescue EOFError\n :eof\n end",
"title": ""
},
{
"docid": "a6721257ee2c9bf08ec7861e9a533e9c",
"score": "0.60284853",
"text": "def read(length)\n bytes.slice!(0, length)\n end",
"title": ""
},
{
"docid": "3b767fe822ab86b6a320fc5675947d5a",
"score": "0.60274905",
"text": "def read(length = nil, outbuf = nil)\n if length\n while (@buffer.size < length) && (read_chunk > 0)\n end\n data = @buffer.slice!(0, length)\n outbuf << data if outbuf\n data\n else\n while read_chunk > 0\n end\n @buffer\n end\n end",
"title": ""
},
{
"docid": "fc954fb4f570fc00ab24fb8a3ab5362b",
"score": "0.60237783",
"text": "def read\n\t\t\tconnect\n\n\t\t\tloop do\n\t\t\t\t@wait&.deq\n\t\t\t\tbegin\n\t\t\t\t\tread_str = @external_io.read_nonblock(65536)\n\t\t\t\t\tprint_data(\"read-transfer #{read_fds}\", read_str)\n\t\t\t\t\t@internal_io.write(read_str)\n\t\t\t\trescue IO::WaitReadable, Errno::EINTR\n\t\t\t\t\t@external_io.wait_readable\n\t\t\t\trescue EOFError, Errno::ECONNRESET\n\t\t\t\t\tputs \"read_eof from #{read_fds}\"\n\t\t\t\t\t@internal_io.close_write\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "faa349c5e282f5bb3dbf6388008c606e",
"score": "0.6014846",
"text": "def read(*args)\n io.read(*args)\n end",
"title": ""
},
{
"docid": "faa349c5e282f5bb3dbf6388008c606e",
"score": "0.6014846",
"text": "def read(*args)\n io.read(*args)\n end",
"title": ""
},
{
"docid": "adf35f1c3e6efdc5d062d6d856951cf4",
"score": "0.59976923",
"text": "def read length=nil, buffer=\"\"\n raise ArgumentError, \"negative length #{length} given\", caller if (length||0) < 0\n return \"\" if length == 0 && @buffer.length > 0\n return (length ? nil : \"\") if eof\n return \"\" if length == 0\n if length\n @buffer << sysread if @buffer.length<length\n else\n begin\n while str = sysread\n @buffer << str\n end\n rescue EOFError\n nil # For coverage\n end\n end\n buffer[0..-1] = @buffer.slice!(0..(length || 0)-1)\n @position ||= 0\n @position += buffer.length\n return buffer\n end",
"title": ""
},
{
"docid": "8895af69fd58b21eb32b0d1136b1728a",
"score": "0.59960335",
"text": "def read(length)\n data = \"\"\n while data.length < length\n result = fh.read(length - data.length)\n raise EOFError if result.nil?\n data << result\n end\n data\n end",
"title": ""
},
{
"docid": "158134cf616a0d42e468b7895d63d94c",
"score": "0.59849286",
"text": "def read!\n Concurrent::Future.execute(:executor => :fast) do\n begin\n # Read bytes if any are available.\n total = 0\n loop do\n bytes = begin\n @io.read_nonblock(@buffer_size)\n rescue IO::WaitReadable\n nil\n end\n\n if bytes\n total += bytes.bytesize\n @listener.trigger_read(bytes)\n end\n\n # Keep reading if we filled the string. Otherwise if there is a\n # selector, ask it to notify us when there's something available.\n if bytes.nil? || bytes.bytesize < @buffer_size\n @selector.enable_read @io\n break\n end\n end\n rescue IOError, Errno::EBADF, Errno::ECONNRESET => e\n @listener.trigger_error e\n @selector.remove [@io]\n rescue => e\n log(Logger::ERROR, self.to_s + '#read!', e.to_s)\n @selector.enable_read @io\n ensure\n return total\n end\n end\n end",
"title": ""
},
{
"docid": "e62cfbe03535c6b7d5283e6ec2be2e7f",
"score": "0.5977824",
"text": "def readpartial(size)\n loop do\n # JRuby may still raise exceptions on SSL sockets even though\n # we explicitly specify `:exception => false`\n result = rescue_readable do\n socket.read_nonblock(size, :exception => false)\n end\n\n if result.nil?\n return :eof\n elsif result != :wait_readable\n return result\n end\n\n unless socket.to_io.wait_readable(read_timeout)\n fail TimeoutError, \"Read timed out after #{read_timeout} seconds\"\n end\n end\n end",
"title": ""
},
{
"docid": "80bfbb98f296ba04d0b29dd9ff109869",
"score": "0.5974852",
"text": "def read\n return nil unless data\n return data.read\n end",
"title": ""
},
{
"docid": "ea5333e4cced038c180495afb593f663",
"score": "0.5974496",
"text": "def read(*args)\n io.read(*args)\n end",
"title": ""
},
{
"docid": "70675c78ae5d503a24b8d4c79b85c6c7",
"score": "0.5971055",
"text": "def read(buffer, offset, length)\n str = nil\n begin\n str = @io.read(length)\n rescue StandardError => e\n raise java.io.IOException.new(\"failed reading from ruby IO object: #{e.inspect}\")\n end\n return -1 if str.nil?\n\n jstr = str.to_java\n for i in 0 .. jstr.length - 1\n buffer[i + offset] = jstr.charAt(i)\n end\n return jstr.length\n end",
"title": ""
},
{
"docid": "f76ba65ab2c668f8b41a4d620212ace9",
"score": "0.59663856",
"text": "def read(handle:, offset: nil, size: nil)\n {\n method: \"IO.read\",\n params: { handle: handle, offset: offset, size: size }.compact\n }\n end",
"title": ""
},
{
"docid": "f6ed3d1a02a8a3ef548b0ad1122842d0",
"score": "0.595517",
"text": "def read(*args)\n io.read(*args)\n end",
"title": ""
},
{
"docid": "5f2daa3b64378d0e4da17cac68572829",
"score": "0.59447217",
"text": "def read(read_size = @ffi_buffer.size)\n bytes = FFI::MemoryPointer.new(:ulong)\n\n raise Error, \"no pipe created\" unless @pipe\n\n if @asynchronous\n bool = ReadFile(@pipe, @ffi_buffer, read_size, bytes, @overlapped)\n bytes_read = bytes.read_ulong\n\n if bool && bytes_read > 0\n @pending_io = false\n @buffer = @ffi_buffer.get_string(0, bytes_read)\n return true\n end\n\n error = GetLastError()\n if !bool && error == ERROR_IO_PENDING\n @pending_io = true\n return true\n end\n\n return false\n else\n unless ReadFile(@pipe, @ffi_buffer, read_size, bytes, nil)\n raise SystemCallError.new(\"ReadFile\", FFI.errno)\n end\n @buffer = @ffi_buffer.get_string(0, bytes.read_ulong)\n end\n end",
"title": ""
},
{
"docid": "4f4c9ef83e46533a8b310ab26f63b1f4",
"score": "0.594471",
"text": "def read_data(length = 4096)\n @tcp.readpartial(length)\n end",
"title": ""
},
{
"docid": "85fbe270a3ad28f825748ee82d0494b4",
"score": "0.593731",
"text": "def read\n io.read\n end",
"title": ""
},
{
"docid": "a2bf20a4abbe8f7f745ece1077837bab",
"score": "0.5928263",
"text": "def read(length=nil)\n @socks.read(length)\n end",
"title": ""
},
{
"docid": "63c80ab59752ef7e6b3bfd934a865858",
"score": "0.59264475",
"text": "def fs_fileRead(fobj, len)\n fobj.data.read(len)\n end",
"title": ""
},
{
"docid": "63c80ab59752ef7e6b3bfd934a865858",
"score": "0.59264475",
"text": "def fs_fileRead(fobj, len)\n fobj.data.read(len)\n end",
"title": ""
},
{
"docid": "13d24ca68385a8d68b4af7802b18e7cf",
"score": "0.59170735",
"text": "def sysread(length = nil, buffer = nil)\n buffer ||= ''.force_encoding(Encoding::ASCII_8BIT)\n\n @read_latch.synchronize do\n begin\n read_nonblock(length, buffer)\n rescue ::IO::WaitReadable\n wait_readable\n retry\n end\n end\n\n buffer\n end",
"title": ""
},
{
"docid": "ac393f38c98379a8639e846f16d00edf",
"score": "0.5914168",
"text": "def read(length = nil, buffer = String.new)\n raise IOError, \"not opened for reading\" unless @readable\n raise TypeError unless buffer.respond_to?(:to_str)\n buffer = buffer.to_str\n\n if length.nil?\n return buffer.replace(\"\") if self.eof?\n buffer.replace(@string[@pos..-1])\n @pos = @string.size\n else\n raise TypeError unless length.respond_to?(:to_int)\n length = length.to_int\n raise ArgumentError if length < 0\n\n if length == 0\n buffer.replace(\"\")\n else\n if self.eof?\n buffer.replace(\"\")\n return nil\n end\n buffer.replace(@string[@pos, length])\n @pos += buffer.length\n end\n buffer.force_encoding('BINARY')\n end\n\n\n buffer\n end",
"title": ""
},
{
"docid": "85ffb95fccb4bfa7a6d9775896c93635",
"score": "0.5912332",
"text": "def read(number_of_bytes)\n return \"\" if number_of_bytes == 0\n\n data = @io.read(number_of_bytes) or raise EOFError\n\n # If the `read` call returned less data than expected we should not\n # proceed.\n raise EOFError if data.size != number_of_bytes\n\n data\n end",
"title": ""
},
{
"docid": "5e240dbe1d1720245769f7d234d87292",
"score": "0.5895782",
"text": "def read(length=nil, output=\"\")\n @on_initial_read.call if @on_initial_read && !@started\n @started = true\n \n if length && (@buffer || fill_buffer)\n fill_buffer until @buffer.length >= length || @finished\n output.replace(@buffer.slice!(0, length))\n @buffer = nil if @buffer.empty?\n elsif length\n output = nil\n elsif !@finished\n fill_buffer until @finished\n output.replace(@buffer || \"\")\n @buffer = nil\n end\n output\n end",
"title": ""
},
{
"docid": "11fef3bb9d9212f5c1f843d35eceb91c",
"score": "0.58923227",
"text": "def read\n\t output = ByteArrayOutputStream.new\n\t input = @part.getInputStream\n\t while((byte = input.read) != -1)\n\t\toutput.write(byte)\n\t end\n\t output.close\n\t String.from_java_bytes(output.toByteArray)\n\tend",
"title": ""
},
{
"docid": "2672d89963086622decb73ad7c049b69",
"score": "0.58920926",
"text": "def read\n connection.getbinaryfile remote_path, nil\n end",
"title": ""
},
{
"docid": "5a0e0e866bd4153a6b33e4ee10d7120a",
"score": "0.589175",
"text": "def read\n io.read\n end",
"title": ""
},
{
"docid": "a9cb947dfeb55d33a28ac484dd577f7f",
"score": "0.5887377",
"text": "def read_bytes_full\n @_io.read\n end",
"title": ""
},
{
"docid": "250b6934debd7e935c2e6147baac161a",
"score": "0.5880225",
"text": "def read(length = nil)\n len = if length\n [length, @write_pos].min\n else\n @write_pos\n end\n start = @read_pos\n @read_pos += len\n\n @buffer[start, len]\n end",
"title": ""
},
{
"docid": "27fb014a77fa98e73c72c60896110aa0",
"score": "0.58797073",
"text": "def read\n count = meta_end\n @io.seek 0\n count.times {@io.gets} unless count.nil?\n @io.read\n end",
"title": ""
},
{
"docid": "5c3526174c5291efa05ef53590214b27",
"score": "0.5877958",
"text": "def read_string\n length = read_long or return nil\n read( length )\n end",
"title": ""
},
{
"docid": "1e76b25ea03a6b1875e924be9e25a400",
"score": "0.5872442",
"text": "def read\n begin\n if tls?\n data = @socket.readpartial(8192)\n else\n data = @socket.recv(8192)\n end\n rescue Errno::EAGAIN\n # Kick it back to select().\n return\n rescue Exception => e\n @logger.unknown \"-> read error: #{e}\"\n close\n return\n end\n if data.empty?\n @logger.unknown '-> empty read'\n close\n return\n end\n\n string = ''\n string += \"(#{@resource.name}) \" if @resource\n string += '-> ' + data.gsub(\"\\n\", '')\n\n @logger.unknown string\n\n @rtime = $time\n\n parse(data)\n\n self\n end",
"title": ""
},
{
"docid": "463ad1ca701729c3d51a64bdcfa9c730",
"score": "0.5869193",
"text": "def read(len)\n if @currentIoInfo\n # This is meant to be called from inside a fiber. Should add a check to confirm that here.\n @currentIoInfo.readFiberIoFacade.read(len)\n else\n raise \"Reactor.read called with no current io. Was it called from a timer handler?\"\n end\n end",
"title": ""
},
{
"docid": "cc57ab39c68b7474749a4fc526111aaa",
"score": "0.5868698",
"text": "def read(io)\n\t\t\t@headers[0].read(io)\n\t\tend",
"title": ""
},
{
"docid": "cc57ab39c68b7474749a4fc526111aaa",
"score": "0.5868698",
"text": "def read(io)\n\t\t\t@headers[0].read(io)\n\t\tend",
"title": ""
},
{
"docid": "a27aa7d95a15a45a0a54d3a236f41106",
"score": "0.5865528",
"text": "def http_read_sock(uri, http_method = \"GET\")\n sock = Socket.mogilefs_new_request(uri.host, uri.port,\n \"#{http_method} #{uri.request_uri} HTTP/1.0\\r\\n\\r\\n\",\n @get_file_data_timeout)\n buf = sock.recv_nonblock(4096, Socket::MSG_PEEK)\n head, body = buf.split(/\\r\\n\\r\\n/, 2)\n\n # we're dealing with a seriously slow/stupid HTTP server if we can't\n # get the header in a single read(2) syscall.\n if head =~ %r{\\AHTTP/\\d+\\.\\d+\\s+200\\s*} &&\n head =~ %r{^Content-Length:\\s*(\\d+)}i\n sock.mogilefs_size = $1.to_i\n case http_method\n when \"HEAD\" then sock.close\n when \"GET\" then sock.recv(head.size + 4, 0)\n end\n return sock\n end\n sock.close rescue nil\n raise MogileFS::InvalidResponseError,\n \"#{http_method} on #{uri} returned: #{head.inspect}\"\n end",
"title": ""
},
{
"docid": "0a40ad95780fb488ce98a18cda5a26e3",
"score": "0.58610976",
"text": "def read(read_size = nil)\n read_size ||= @read_size\n return @file.sysread(read_size)\n end",
"title": ""
},
{
"docid": "72de6510b512948a9ba98842fde2ea68",
"score": "0.58591646",
"text": "def read\n stream = open()\n str = stream.read\n stream.close\n str\n end",
"title": ""
},
{
"docid": "0884dd4d0a3534dd650170dd69661b24",
"score": "0.58500123",
"text": "def read(length = nil, buffer = nil)\n return @enumerator.next.tap { |e| @pos += e.bytesize } if length.nil? && readable_bytes.zero?\n @buffer.write(@enumerator.next) while !@eof && readable_bytes < (length || 1)\n read_with { @buffer.read(length, buffer) }\n rescue StopIteration\n @eof = true\n read_with { @buffer.read(length, buffer) } if readable_bytes > 0\n end",
"title": ""
},
{
"docid": "c67c715b239cf60aca7b1b6dd590ce4f",
"score": "0.5849406",
"text": "def read_request\n input = []\n while (line = @session.gets) do\n length = line.gsub(/\\D/,\"\") if line =~ /Content-Length/\n if line == \"\\r\\n\"\n input << line\n input << @session.read(length.to_i) if length\n break\n else\n input << line\n end\n end\n\n debug \"Done reading request\"\n input.join\n end",
"title": ""
},
{
"docid": "20e7cbd877b4a46f093a31222a88ce45",
"score": "0.5848193",
"text": "def fs_fileRead(fobj, len)\n return nil if fobj.data.nil?\n fobj.data.read(len)\n end",
"title": ""
},
{
"docid": "685e419db956ac5af1e1e6b2ba3d8aa4",
"score": "0.5840642",
"text": "def read(length = nil, addends = nil)\n return _read(length, addends)\n end",
"title": ""
},
{
"docid": "25bbcc47560364fb532491c432e260a4",
"score": "0.5830929",
"text": "def read\n\t\t\t\t\treturn nil if @finished\n\t\t\t\t\t\n\t\t\t\t\tlength, extensions = read_line.split(\";\", 2)\n\t\t\t\t\t\n\t\t\t\t\tunless length =~ VALID_CHUNK_LENGTH\n\t\t\t\t\t\traise BadRequest, \"Invalid chunk length: #{length.dump}\"\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t# It is possible this line contains chunk extension, so we use `to_i` to only consider the initial integral part:\n\t\t\t\t\tlength = Integer(length, 16)\n\t\t\t\t\t\n\t\t\t\t\tif length == 0\n\t\t\t\t\t\t@finished = true\n\t\t\t\t\t\t\n\t\t\t\t\t\tread_trailer\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn nil\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t# Read trailing CRLF:\n\t\t\t\t\tchunk = @stream.read(length + 2)\n\t\t\t\t\t\n\t\t\t\t\t# ...and chomp it off:\n\t\t\t\t\tchunk.chomp!(CRLF)\n\t\t\t\t\t\n\t\t\t\t\t@length += length\n\t\t\t\t\t@count += 1\n\t\t\t\t\t\n\t\t\t\t\treturn chunk\n\t\t\t\tend",
"title": ""
},
{
"docid": "a5429de2ab98eccdec19d5f5008153e6",
"score": "0.5828868",
"text": "def handle_read\n begin\n do_read\n rescue IOError, Errno::ECONNRESET => e\n read_exception e\n end\n\n handle_data\n nil\n end",
"title": ""
},
{
"docid": "4fc894b1ec3c15cd9e96f30422906302",
"score": "0.5803662",
"text": "def read_binary_data(fname, fd, length); end",
"title": ""
},
{
"docid": "f003e519f5ddca2e3db01cfa9f6a9594",
"score": "0.58033913",
"text": "def read(length)\n check_if_alive!\n handle_socket_errors { super }\n end",
"title": ""
},
{
"docid": "a7f68187ea98c2d9f55ce429af99726f",
"score": "0.58029145",
"text": "def read\n\t\t# request parsing\n\t\t@request = @socket.gets # On lit sur le socket la 1 ère ligne de la requête\n\t\tbegin\n\t\t\theader = @socket.gets \n\t\t\theader_name, header_val = header.chomp.split(': ')\n\t\t\t@headers[header_name] = header_val\n\t\tend until header.chomp.empty?\n\t\t#@headers = headers\n\n\t\t@body = nil\n\t\tunless @headers[\"Content-Length\"].nil? # on teste si le headers a un content-Length\n\t\t\t@body = @socket.read(@headers[\"Content-Length\"].to_i) # on lit et on stocke le corps de la requête\n\t\tend\n\t\t[@request, @headers, @body]\n\tend",
"title": ""
},
{
"docid": "951e2ef5985bb36c68c177764c3da4cc",
"score": "0.57950294",
"text": "def read(length = nil, outbuf = String.new)\n return \"\".force_encoding(Encoding::BINARY) if length == 0 # Shortcut; retval as per IO#read.\n\n # Note: Querying the underlying IO as early as possible allows to\n # have Ruby's own IO exceptions to bubble up.\n if length\n return nil if eof? # In line with IO#read\n outbuf.force_encoding(Encoding::BINARY) # As per IO#read docs\n\n # The user's request is in decompressed bytes, so it doesn't matter\n # how much is actually read from the compressed file.\n if @delegate_io.eof?\n data = \"\"\n action = XZ::LibLZMA::LZMA_FINISH\n else\n data = @delegate_io.read(XZ::CHUNK_SIZE)\n action = @delegate_io.eof? ? XZ::LibLZMA::LZMA_FINISH : XZ::LibLZMA::LZMA_RUN\n end\n\n lzma_code(data, action) { |decompressed| @readbuf << decompressed }\n\n # If the requested amount has been read, return it.\n # Also return if EOF has been reached. Note that\n # String#slice! will clear the string to an empty one\n # if `length' is greater than the string length.\n # If EOF is not yet reached, try reading and decompresing\n # more data.\n if @readbuf.bytesize >= length || @delegate_io.eof?\n result = @readbuf.slice!(0, length)\n @pos += result.bytesize\n return outbuf.replace(result)\n else\n return read(length, outbuf)\n end\n else\n # Read the entire file and decompress it into memory, returning it.\n while chunk = @delegate_io.read(XZ::CHUNK_SIZE)\n action = @delegate_io.eof? ? XZ::LibLZMA::LZMA_FINISH : XZ::LibLZMA::LZMA_RUN\n lzma_code(chunk, action) { |decompressed| @readbuf << decompressed }\n end\n\n @pos += @readbuf.bytesize\n\n # Apply encoding conversion.\n # First, tag the read data with the external encoding.\n @readbuf.force_encoding(@external_encoding)\n\n # Now, transcode it to the internal encoding if that was requested.\n # Otherwise return it with the external encoding as-is.\n if @internal_encoding\n @readbuf.encode!(@internal_encoding, @transcode_options)\n outbuf.force_encoding(@internal_encoding)\n else\n outbuf.force_encoding(@external_encoding)\n end\n\n outbuf.replace(@readbuf)\n @readbuf.clear\n @readbuf.force_encoding(Encoding::BINARY) # Back to binary mode for further reading\n\n return outbuf\n end\n end",
"title": ""
},
{
"docid": "658428cdd0b2c0f4190d4a83b0e61184",
"score": "0.57947177",
"text": "def read(length = nil, outbuf = nil)\n got_result = false\n outbuf = outbuf ? outbuf.replace('') : ''\n\n while current_io\n result = current_io.read(length)\n\n if result\n got_result ||= !result.nil?\n result.force_encoding(BINARY_ENCODING) if result.respond_to?(:force_encoding)\n outbuf << result\n\n length -= result.length if length\n break if length == 0\n end\n\n next_io\n end\n\n !got_result && length ? nil : outbuf\n end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
},
{
"docid": "9971b03f2dd49c0eba50a3c84127ca9f",
"score": "0.5792754",
"text": "def read; end",
"title": ""
}
] |
a016c1b745358dda178673d0638c74b0
|
Set the Will for the client The will is a message that will be delivered by the server when the client dies. The Will must be set before establishing a connection to the server
|
[
{
"docid": "e1d48693eff8d33728cc42157215b8e1",
"score": "0.463624",
"text": "def set_will(topic, payload, retain = false, qos = 0)\n self.will_topic = topic\n self.will_payload = payload\n self.will_retain = retain\n self.will_qos = qos\n end",
"title": ""
}
] |
[
{
"docid": "16626acac9ed9bcf4bcc1da10ae81308",
"score": "0.5377689",
"text": "def post_init\n puts \"TCP connection attempt completed successfully and a new client has connected.\"\n send_line(\"-> Welcome abord bro\")\n end",
"title": ""
},
{
"docid": "2242e63d0f8b7e8ed144388e526339e1",
"score": "0.5302054",
"text": "def on_client_connect(client)\n\tend",
"title": ""
},
{
"docid": "1a07d83d0469da9a165d8cd6fadd125f",
"score": "0.52559",
"text": "def init_client(**options)\n options[:ignore] ||= [PING_IGNORE]\n options[:subprotocol] ||= \"actioncable-v1-json\"\n\n super(**options)\n\n receive(\"data>\" => {\"type\" => \"welcome\"})\n log(:done) { \"Welcomed\" }\n end",
"title": ""
},
{
"docid": "94808f1c10140c6a7b9a5cfc0fe78946",
"score": "0.51793253",
"text": "def client_leaving\r\n puts \"\\nElvis has left the building.\"\r\n\r\n @alarm.on\r\n @ac.off\r\n @tv.off\r\n @lights.off\r\n end",
"title": ""
},
{
"docid": "620ca2570fffb60faa7999d382f5ca1e",
"score": "0.5134779",
"text": "def on_client_close(client)\n\tend",
"title": ""
},
{
"docid": "d46814360f8df712faf264894e0f094b",
"score": "0.5130614",
"text": "def send\n @client.send(self)\n end",
"title": ""
},
{
"docid": "ae506f3318809d400f7a7e37b4a16a19",
"score": "0.5083832",
"text": "def configure_client(options = {})\n socket.client.set(options)\n end",
"title": ""
},
{
"docid": "80e13090a9251d9e06de79f0d38da916",
"score": "0.5036101",
"text": "def post_init\n server.log(\"Client #{id} has connected to the server\")\n end",
"title": ""
},
{
"docid": "0ba8f81d8049541b5c8db2cb09af5e1d",
"score": "0.49877068",
"text": "def client_closed\n logdebug(\"client closed connection\")\n end",
"title": ""
},
{
"docid": "4975a0855ff97f5b84015e0bd5a1028a",
"score": "0.49707893",
"text": "def set_connection_confirmed_alive\n @last_liveness_event = Time.now\n manager.reset_liveness_timer\n end",
"title": ""
},
{
"docid": "623ea8f3191e8949289fccc5719b59bc",
"score": "0.4958272",
"text": "def clientSetup\n begin\n @client = Client.new(JID.new(@botname))\n @client.connect(@host)\n @client.auth(@password)\n @roster = Roster::Helper.new(@client)\n pres = Presence.new\n pres.priority = 5\n pres.set_type(:available)\n pres.set_status('online')\n @client.send(pres)\n @roster.wait_for_roster\n \n @client.on_exception do |ex, stream, symb|\n @logger.debug(\"Disconnected, #{ex}, #{symb}\")\n exit\n end\n rescue Exception => e\n @logger.debug(\"#{e}\")\n end\n end",
"title": ""
},
{
"docid": "9b58551060ef371c99f13efbbe180127",
"score": "0.49432027",
"text": "def client_closed\n end",
"title": ""
},
{
"docid": "e3f2371efe9d979444addf7642e86920",
"score": "0.49297884",
"text": "def post_init\n @username = nil\n @roomid = nil\n @buf = ''\n @lastupdate = Time.now\n\n @@connected_clients.push(self)\n\n puts \"A client has connected...\"\n end",
"title": ""
},
{
"docid": "b9fcec6df576714b4946412fffbdb16f",
"score": "0.49297592",
"text": "def client_left( user )\n @clients.delete( user )\n msg = \"\\\"#{user}\\\" no longer connected.\"\n self.logger( msg )\n self.process_msg( \"ChatServer\", msg )\n end",
"title": ""
},
{
"docid": "1392f92970125bd7b9e45b5a861c33f6",
"score": "0.48937285",
"text": "def setup_client_monitor\n @logger.debug(\"monitoring client keepalives\")\n @timers[:leader] << EM::PeriodicTimer.new(30) do\n determine_stale_clients\n end\n end",
"title": ""
},
{
"docid": "580f6f39ac2816a30863537081d25973",
"score": "0.48523918",
"text": "def post_init\n\t\t\t@peer = Peer.new({\n\t\t\t\tsocket: self\n\t\t\t})\n\t\t\tswdebug \"#{server_id}:> client #{client_id} connected.\"\n\t\tend",
"title": ""
},
{
"docid": "624223c64671274a62ef5bb0b81f2fc3",
"score": "0.48449755",
"text": "def status\n notify \"It's #{Time.now}, and there are #{@@connected_clients.length} marmots\"\n end",
"title": ""
},
{
"docid": "bc723a7c6dde22efe5e061b809251395",
"score": "0.48429462",
"text": "def send_to_client\n \n end",
"title": ""
},
{
"docid": "28c01cc2a801e3cf5f56c0667eaedbd4",
"score": "0.47978482",
"text": "def clientConnected\n\t\tlog(\"clientConnected\", message)\n\tend",
"title": ""
},
{
"docid": "9a80d52149775d9636ca903e955fb9a5",
"score": "0.4793476",
"text": "def client_left( user )\n @clients.delete( user )\n msg = \"#{user} left the Server.\"\n logger( msg )\n process_msg( \"ChatServer\", msg )\n end",
"title": ""
},
{
"docid": "8f897d0a8d558fd3d5d6e4edaa0adf3f",
"score": "0.47763675",
"text": "def linger\n\t\t\t\t@options[:linger]\n\t\t\tend",
"title": ""
},
{
"docid": "8f897d0a8d558fd3d5d6e4edaa0adf3f",
"score": "0.47763675",
"text": "def linger\n\t\t\t\t@options[:linger]\n\t\t\tend",
"title": ""
},
{
"docid": "1910a88c0e7436c009f4cf17a9c3fcf5",
"score": "0.47749472",
"text": "def hold_connection\n \n end",
"title": ""
},
{
"docid": "a69e434f36d43d34f7a52374186ca397",
"score": "0.47731158",
"text": "def reset\n statusLog.puts(\"attempting to reset client\") if statusLog\n client.close\n sleep(5)\n @client = TemperatureControllerClient.new(client.port, client.baud, @opts)\n @slave = @client.with_slave(@slaveAddress)\n end",
"title": ""
},
{
"docid": "53a4886beb71658ef78db565c449bedd",
"score": "0.4773028",
"text": "def alive?; @keepalive; end",
"title": ""
},
{
"docid": "587efffbc1d357e59c8caeea57e5bfea",
"score": "0.4768424",
"text": "def heartbeat_client_limit\n unless defined?(@heartbeat_client_limit)\n @heartbeat_client_limit = heartbeating[0] > 0 ? (1.1 * heartbeating[0]) : 0\n end\n @heartbeat_client_limit\n end",
"title": ""
},
{
"docid": "04942ad2a5b491a755393422c7c6ad48",
"score": "0.47620934",
"text": "def reconnect( client )\n if @client\n @client.disconnect\n end\n if !@active\n @affects.each do |affect|\n affect.active = true\n # Game.instance.add_global_affect(affect)\n end\n self.items.each do |item|\n Game.instance.add_global_item(item)\n if item.affects\n item.affects.each do |affect|\n affect.active = true\n # Game.instance.add_global_affect(affect)\n end\n end\n end\n end\n @client = client\n @active = true\n end",
"title": ""
},
{
"docid": "45291228c4eb17bcc06e4e8a7e05bc77",
"score": "0.47618622",
"text": "def goodbye_my_love!\n debug 'Tearing down connection'\n if(socket && !socket.closed?)\n socket.write Command::Cls.new.to_line\n socket.close\n end\n @socket = nil\n info 'Connection torn down'\n end",
"title": ""
},
{
"docid": "e06662e555dce7bbd3bb084b084fe23b",
"score": "0.47555435",
"text": "def client_arriving\r\n puts \"\\nA good traveler has no fixed plans, and is not intent on arriving.\"\r\n\r\n @alarm.off\r\n @ac.on\r\n @tv.on\r\n @lights.on\r\n end",
"title": ""
},
{
"docid": "576b9e974c7a4f0c7f90f61346d085e0",
"score": "0.47439402",
"text": "def pending_connect_timeout=(value); end",
"title": ""
},
{
"docid": "1473632a7c14f97255da4f994a082260",
"score": "0.47362816",
"text": "def _reconn_prep_hb()\n if @parameters\n change_host()\n end\n @socket = nil\n used_socket = socket()\n end",
"title": ""
},
{
"docid": "05adcfb4a39cf29f378848dd8ac97cac",
"score": "0.47361574",
"text": "def connection_ended; end",
"title": ""
},
{
"docid": "3f41278ef06f48a8ea45e9c1429d5e6e",
"score": "0.4735534",
"text": "def setup\n @timeout = 2\n client_sock\n at_exit do\n @socket.close\n end\n end",
"title": ""
},
{
"docid": "a73d73096d27db5b09da0d8b53b64e4e",
"score": "0.47215614",
"text": "def do_quit(client)\n puts \"Client #{client.peeraddr[2]}|#{client.peeraddr[1]} left.\"\n @clientArray.delete(client)\n @dataSocketHash.delete(client)\n @logined[client] = false\n @name_client.delete(client)\n end",
"title": ""
},
{
"docid": "1f796e4ff6ae3faa66b368e3e057edd2",
"score": "0.47156975",
"text": "def client_connected\n # incrementamos contadores\n if !controller_store[:users_count].blank?\n controller_store[:users_count] += 1\n else\n controller_store[:users_count] = 0\n end\n # Se notifica a todos los conectados por multidifusión\n logger.debug message.inspect\n broadcast_message :users_count_changed, {users_count: controller_store[:users_count]}\n # Se notifica al usuario que se acaba de conectar\n send_message :connection_success, {message: 'Conexión ok. Habla ahora o calla para siempre.'}\n end",
"title": ""
},
{
"docid": "853013ecbf10eeb857212ecab3d918a2",
"score": "0.4713918",
"text": "def post_init\n super\n send_line \"NOTICE AUTH :Marvin Server v#{Marvin.version} initialized, welcome.\"\n end",
"title": ""
},
{
"docid": "72733e005563bbd4aefd35d45bc4a742",
"score": "0.47119087",
"text": "def post_init\n puts \"Connection Initialized #{@my_address} - #{@signature}\"\n #\n # TODO: get access to the HostIP and HostPort associated with this connection\n # if it is the local control connection, do the following\n # * do not repeat other connection traffic to this connection\n # * consider any input a command to be processed\n # send_data \"post_init for #{@my_address} Started #{Time.now}\\n\"\n\n EM::add_periodic_timer( 5+rand(5) ) { $me.send_data \"#{$me.my_address} -=> #{Time.now}\\n\" } ## block executes every 5 to 9 seconds\n\n end",
"title": ""
},
{
"docid": "f0059fbe83af91e9836b77abe8311932",
"score": "0.47090757",
"text": "def automatic_reconnect=(_arg0); end",
"title": ""
},
{
"docid": "a9077d6ceecc3c86f4fa4930dfbe4e48",
"score": "0.47015005",
"text": "def initial_message\n\t\tpost @socket, server_name, RPL_WELCOME, @nick, \"Welcome to the Internet Relay Network #{@prefix}\"\n\t\tpost @socket, server_name, RPL_YOURHOST, @nick, \"Your host is #{server_name}, running version #{server_version}\"\n\t\tpost @socket, server_name, RPL_CREATED, @nick, \"This server was created #{Time.now}\"\n\t\tpost @socket, server_name, RPL_MYINFO, @nick, \"#{server_name} #{server_version} #{available_user_modes} #{available_channel_modes}\"\n\tend",
"title": ""
},
{
"docid": "dbaacaa6de6f76fd8a994c143a1735a5",
"score": "0.46953553",
"text": "def sendHeartbeat()\n if NodeAgent.instance.connected?\n send!(:HB, -1, -1, -1, -1)\n else\n # haven't heard from nodeHandler yet, resend initial message\n sendWHOAMI\n end\n end",
"title": ""
},
{
"docid": "868451e36102fb4a96b3992ffa901a70",
"score": "0.46861863",
"text": "def ignore_disconnect; end",
"title": ""
},
{
"docid": "17b5e8238ceb6b43e18f16dad1ba8721",
"score": "0.46767488",
"text": "def keepalive_idle\n socket.keepalive_idle\n end",
"title": ""
},
{
"docid": "b993088117cc55bdc1db8fe431b8aaeb",
"score": "0.46717423",
"text": "def post_init\n $connections << self\n send_data 'connection ok'\n end",
"title": ""
},
{
"docid": "582c5ac6bc2a821cfe06ada7988d1cfb",
"score": "0.46609756",
"text": "def after_connect=(v) # SEQUEL6: Remove\n @use_old_connect_api = true\n @after_connect = v\n end",
"title": ""
},
{
"docid": "85072cecd40b8b79ee37b47bf1b66192",
"score": "0.4655611",
"text": "def thor\r\n @client[:thor]\r\n end",
"title": ""
},
{
"docid": "cebf4a35e778eb9a60200bc33f50b182",
"score": "0.46555364",
"text": "def post_init\n logger.debug \"Listening from #{client_name}\"\n end",
"title": ""
},
{
"docid": "03a65e6290c06ca8fa9950d5bd203735",
"score": "0.46550548",
"text": "def on_shutdown client\n client.write \"Server shutting down. Goodbye.\"\n end",
"title": ""
},
{
"docid": "03a65e6290c06ca8fa9950d5bd203735",
"score": "0.46550548",
"text": "def on_shutdown client\n client.write \"Server shutting down. Goodbye.\"\n end",
"title": ""
},
{
"docid": "092afa9178a6672a9da44adc1f8cedab",
"score": "0.46440965",
"text": "def on_connect forever = false, &block\n on \"connected\", forever, &block\n end",
"title": ""
},
{
"docid": "a9d0d230bb05ac16855a059ded555826",
"score": "0.4640267",
"text": "def send_heartbeat\n send(MDP::MDPW_HEARTBEAT)\n end",
"title": ""
},
{
"docid": "10f32b54fe08f36692fe67669c034fb7",
"score": "0.46377054",
"text": "def on_reconnect(&block)\n on('reconnect', &block)\n end",
"title": ""
},
{
"docid": "a8d5d39fc2b32b24e12f4a512135b531",
"score": "0.46325588",
"text": "def automatic_reconnect; end",
"title": ""
},
{
"docid": "4b0357f5093a331ed44e3297f563a064",
"score": "0.46304154",
"text": "def reconnect(force=false); end",
"title": ""
},
{
"docid": "1552fa3037f0c4808f011ef592f045c9",
"score": "0.46300527",
"text": "def disconnect!; true; end",
"title": ""
},
{
"docid": "b9b6337e0c235ac5503ca5fffe78c2f9",
"score": "0.4627671",
"text": "def connect!\n raise \"Waithook connection already started\" if @started\n @started = true\n @client.connect!.wait_handshake!\n self\n end",
"title": ""
},
{
"docid": "1b79f3e99a2ccceebe1babd1ce218ee1",
"score": "0.46258146",
"text": "def on()\n puts \"Turning on\"\n $client.lights.turn_on\n $client.flush\nend",
"title": ""
},
{
"docid": "ff32ba8be6adafe123eeada2cd7874b5",
"score": "0.46222106",
"text": "def disconnected?; end",
"title": ""
},
{
"docid": "ff32ba8be6adafe123eeada2cd7874b5",
"score": "0.46222106",
"text": "def disconnected?; end",
"title": ""
},
{
"docid": "831e8e941b19edd4974f45ebabbd9957",
"score": "0.46216393",
"text": "def on_expecting_client(ev) \n\t\t# now game server is expecting the client\n\t\t# we can post the relevant cookies to it\n\t\tclient_link = @clients.find_by_id(ev.client_id)\n\t\tif(client_link==nil)\n\t\t\t# client might have disappeared before we receive response from GameServer\n\t\t\treturn\n\t\tend\n\t\tif(client_link.state!=:waiting_for_cookies)\n\t\t\tclient_link.post_event AuthError.new(self,2,AuthServer::AUTH_UNKN_ERROR)\n\t\t\treturn\n\t\tend\n\t\tclient_link.state = :waiting_for_disconnect\n\t\tclient_link.post_event ServerResponse.new(self,ev.client,ev.db_cookie,ev.server_cookie)\n\tend",
"title": ""
},
{
"docid": "b5a5c1018c0eab588626acc2a37132bf",
"score": "0.46169397",
"text": "def post_init\n puts \"## #{@options[:host]}:#{@options[:port]} => #{I18n.t('client_connect')}\"\n end",
"title": ""
},
{
"docid": "000f9f91c752371f45ace9b62ccde918",
"score": "0.46165478",
"text": "def connection_lost\n @connected = false\n puts \"Connection to server lost.\"\n activate(:command_state)\n end",
"title": ""
},
{
"docid": "a1d483fb494dad8bb5ee32d18aa6561d",
"score": "0.46105206",
"text": "def connect(force = false)\n raise \"Client already connected!\" if @connected && !force\n @connected = true\n end",
"title": ""
},
{
"docid": "9241ff6ae5257ebacc088a52d6d93907",
"score": "0.46100506",
"text": "def post_init\n puts \"TCP connection attempt completed successfully and a new client has connected.\"\n ask_username\n end",
"title": ""
},
{
"docid": "6b6d4cfd9b3eee0915d7355ae9cd827d",
"score": "0.46093467",
"text": "def connect\n super\n self.recv_buff = ''\n end",
"title": ""
},
{
"docid": "6b6d4cfd9b3eee0915d7355ae9cd827d",
"score": "0.46093467",
"text": "def connect\n super\n self.recv_buff = ''\n end",
"title": ""
},
{
"docid": "c033cb9fec09dcb9e4e5c30dcc63b8f3",
"score": "0.4608381",
"text": "def client_closed(response)\n setup_email(response, response.kase.person)\n @subject = \"#{response.kase.person.user_id}, die Bewerbung von #{response.person.title_and_name} wurde geschlossen\"\n end",
"title": ""
},
{
"docid": "2742f52039aedc759481b4b391508772",
"score": "0.46081415",
"text": "def post_init\n logger.info(\"Client #{peer} connected to forwarder #{@forwarder}\")\n EM.connect(@destination_host, @destination_port,\n ForwardedConnection, self)\n rescue RuntimeError => e\n logger.error(\"Client #{peer} on #{@forwarder} couldn't be connected with destination\")\n logger.close\n close_connection\n end",
"title": ""
},
{
"docid": "f2af5ec0719e4380493c1b5e4607f22d",
"score": "0.46021354",
"text": "def disconnect\n @client.close if @client\n end",
"title": ""
},
{
"docid": "16313b4b57d31adaab834a8413572a37",
"score": "0.46005607",
"text": "def keepalive_payload\n payload = @settings[:client].merge({\n :version => VERSION,\n :timestamp => Time.now.to_i\n })\n redact_sensitive(payload, @settings[:client][:redact])\n end",
"title": ""
},
{
"docid": "4119070cb810f4aff676cf420a66607d",
"score": "0.45947307",
"text": "def post_init\n @state = :connecting\n @handshake = ::WebSocket::Handshake::Client.new(@args)\n end",
"title": ""
},
{
"docid": "235048d09a758c5f73f02bc2dda42661",
"score": "0.45845148",
"text": "def tcp_keep_alive=(val)\n @j_del.setTCPKeepAlive(val)\n end",
"title": ""
},
{
"docid": "004b59f9da7ec7244895999644d4b855",
"score": "0.45813498",
"text": "def send_client(msg, client)\n begin\n #enc = AES.encrypt(msg, self.key, {:iv => self.iv})\n client.conn.write(msg.pad(64)) # Send minimal bytes over the wire, no command should be this long\n rescue Exception => e\n puts e.message.red\n puts e.backtrace.join(\"\\n\").red\n end\n end",
"title": ""
},
{
"docid": "b07aef48b655858e930c968edac6da3c",
"score": "0.45804766",
"text": "def on_open(ws, req)\n node_id = req.env['HTTP_KONTENA_NODE_ID']\n connected_at = nil\n\n # check version\n agent_version = req.env['HTTP_KONTENA_VERSION'].to_s\n\n unless self.valid_agent_version?(agent_version)\n send_master_info(ws)\n raise CloseError.new(4010), \"agent version #{agent_version} is not compatible with server version #{Server::VERSION}\"\n end\n\n node = find_node(req)\n\n # check clock after version check, because older agent versions do not send this header\n connected_at = Time.parse(req.env['HTTP_KONTENA_CONNECTED_AT'])\n connected_dt = Time.now - connected_at\n\n if connected_dt > PING_TIMEOUT + CLOCK_SKEW\n raise CloseError.new(4020), \"agent connected too far in the past, clock offset #{'%.2fs' % connected_dt} exceeds threshold\"\n\n elsif connected_dt < -CLOCK_SKEW\n raise CloseError.new(4020), \"agent connected too far in the future, clock offset #{'%.2fs' % connected_dt} exceeds threshold\"\n end\n\n # connect\n logger.info \"node #{node} agent version #{agent_version} connected at #{connected_at}, #{'%.2fs' % connected_dt} ago\"\n\n client = {\n ws: ws,\n id: node.node_id.to_s,\n node_id: node.id,\n grid_id: node.grid.id,\n created_at: Time.now,\n connected_at: connected_at,\n }\n @clients << client\n\n send_master_info(ws)\n\n EM.defer { Agent::NodePlugger.new(node).plugin! connected_at }\n\n rescue CloseError => exc\n logger.warn \"reject websocket connection for node #{node || node_id || '<nil>'}: #{exc}\"\n ws.close(exc.code, exc.message)\n\n if !connected_at || connected_at > Time.now.utc\n # override invalid agent timestamp, as this would prevent the agent from later reconnecting with the correct timestamp\n connected_at = Time.now.utc\n end\n\n if node\n # this only applies to the clock skew errors, not any of the early token -> node or version errors\n Agent::NodePlugger.new(node).reject!(connected_at, exc.code, exc.message)\n end\n\n rescue => exc\n logger.error exc\n end",
"title": ""
},
{
"docid": "f9799c5406d3632fbef86a40f72e7dd6",
"score": "0.45753837",
"text": "def ensure_client!\n raise \"Must have active connection\" unless @client\n end",
"title": ""
},
{
"docid": "e9d720859c96b8430d5091532c0b59db",
"score": "0.45711076",
"text": "def sent\n end",
"title": ""
},
{
"docid": "9384bd934d7b37b3d19f0f890f091d47",
"score": "0.45689425",
"text": "def post_init\n port, *ip_parts = get_peername[2,6].unpack \"nC4\"\n ip = ip_parts.join('.')\n @client = ip,\":#{port}\"\n puts \"Client Connected: #{@client}\"\n\n operation = proc do\n File.open('client_list.txt', \"w\") do |f|\n begin\n f.puts(@client)\n ensure\n f.close\n end\n end\n end\n\n callback = proc do\n puts \"I wrote a file!\"\n end\n\n EventMachine.next_tick(operation)\n EventMachine.defer(operation, callback)\n end",
"title": ""
},
{
"docid": "717b53bbb11901f3463df2946e0ae133",
"score": "0.4568199",
"text": "def without_reconnect(&blk); end",
"title": ""
},
{
"docid": "1329b170356dab6c440f825515564096",
"score": "0.4565392",
"text": "def sendHeartbeat()\n send!(:HB, -1, -1, -1, -1)\n end",
"title": ""
},
{
"docid": "5f073578720c2333caec5b195adad6cc",
"score": "0.45630792",
"text": "def setupListener\n sfile = File.join(@config[\"temp\"], \"wicmand.socket\")\n File.unlink(sfile) rescue nil;\n @socket = UNIXServer.new(sfile)\n File.chmod(0666, sfile)\n while true\n begin\n client = @socket.accept\n conn = client.gets.chomp\n case conn\n when /^disc/\n client.write disconnect!\n when /^conn \"(.*)\" \"(.*)\"/ \n if $1 == \"\" then\n # No ESSID, should autoconnect\n client.write autoConnect\n elsif $2 != \"\" then\n # Forcing new passphrase\n status = genConfig($1, $2)\n if status != \"Configuration ok\"\n client.write status # Some error\n else\n client.write connect!($1)\n end\n else\n # normal connection; if this fails tries to generate conf\n status = connect!($1)\n if status == \"needconf\"\n client.write \"needpp\"\n else\n client.write status # Error or success message\n end\n end\n when /^auto \"(.*)\" \"(.*)\" (\\d*)/ \n client.write addToAC($1, $3)\n when /^xauto \"(.*)\" \"/ \n client.write dropFromAC($1)\n when /^conf \"(.*)\" \"(.*)\"/\n client.write genConfig($1, $2)\n when /^list/\n client.write getNetworks\n when /^show/\n client.write showStatus\n when /^cname/ \n client.write @connected\n else\n client.write \"Your request is unsupported: #{conn}\"\n end\n client.close\n rescue\n client.write \"wicmand encountered an internal error\"\n client.close\n end \n end \n end",
"title": ""
},
{
"docid": "4f40b973f4c560f085cfd92e927167c9",
"score": "0.45622817",
"text": "def disconnect!; end",
"title": ""
},
{
"docid": "4f40b973f4c560f085cfd92e927167c9",
"score": "0.45622817",
"text": "def disconnect!; end",
"title": ""
},
{
"docid": "4f40b973f4c560f085cfd92e927167c9",
"score": "0.45622817",
"text": "def disconnect!; end",
"title": ""
},
{
"docid": "4f40b973f4c560f085cfd92e927167c9",
"score": "0.45622817",
"text": "def disconnect!; end",
"title": ""
},
{
"docid": "6f19d9d9d37e09cf025aefd5a09c56a1",
"score": "0.45603663",
"text": "def connection_completed\n # we only can safely set this value here because EventMachine is a lovely piece of\n # software that calls #post_init before #unbind even when TCP connection\n # fails. MK.\n @tcp_connection_established = true\n @periodic_reconnection_timer.cancel if @periodic_reconnection_timer\n\n\n # again, this is because #unbind is called in different situations\n # and there is no easy way to tell initial connection failure\n # from connection loss. Not in EventMachine 0.12.x, anyway. MK.\n\n if @had_successfully_connected_before\n @recovered = true\n\n\n self.start_automatic_recovery\n self.upgrade_to_tls_if_necessary\n end\n\n # now we can set it. MK.\n @had_successfully_connected_before = true\n @reconnecting = false\n @handling_skipped_hearbeats = false\n @last_server_heartbeat = Time.now\n\n self.handshake\n end",
"title": ""
},
{
"docid": "5f38bc688d9b15dfa37f7e3e9e4c785b",
"score": "0.45599172",
"text": "def send_on_open; end",
"title": ""
},
{
"docid": "5f38bc688d9b15dfa37f7e3e9e4c785b",
"score": "0.45599172",
"text": "def send_on_open; end",
"title": ""
},
{
"docid": "6fcda37817d7fc08176fa637813e74fe",
"score": "0.4556591",
"text": "def connection_end\n nil\n end",
"title": ""
},
{
"docid": "a91ce38db9c16db136e3cbbc5e6c1947",
"score": "0.45386204",
"text": "def post_init\n super\n\n log(\"Connecting to server sending a logon message with our COMP_ID <#{@comp_id}>\")\n\n @logged_in = false\n\n EM.next_tick { send_logon }\n end",
"title": ""
},
{
"docid": "d487c84882dff47824e1baa1d7683dae",
"score": "0.4536599",
"text": "def on_connected; end",
"title": ""
},
{
"docid": "cb983ccdf565dcce32c387b535900d3d",
"score": "0.4531116",
"text": "def keep_alive\n @last_send_at ||= 0\n @last_request_at ||= 0\n @hrtbt_int ||= 0\n\n # Send a regular heartbeat when we don't send anything down the line for a while\n if @hrtbt_int > 0 && (@last_send_at < (Time.now.to_i - @hrtbt_int))\n send_heartbeat\n end\n\n # Trigger a test req message when we haven't received anything for a while\n if !@pending_test_req_id && (last_request_at < (Time.now.to_i - @hrtbt_int))\n send_test_request\n end\n end",
"title": ""
},
{
"docid": "6312160b9417f993dd0d4385fca8db37",
"score": "0.45299476",
"text": "def close_connection(after_writing=false)\n super\n @closed = true\n advance(Client::Closed.new(self))\n end",
"title": ""
},
{
"docid": "b180f49fe38f018bc2f36f083cef7ee4",
"score": "0.45270765",
"text": "def connect\n\t\t\t@socket ||= TCPSocket.new(Whatsapi::Constants::WHATSAPP_HOST, Whatsapi::Constants::PORT)\t\t\t\n\t\tend",
"title": ""
},
{
"docid": "fc41877685ab65aa4f7881822247dabd",
"score": "0.4526469",
"text": "def initialize\n @state = :closed\n @tellers = 0\n @clients = Array.new\n end",
"title": ""
},
{
"docid": "09ac57e5396fc8f376142565749161f8",
"score": "0.4526222",
"text": "def set_ready_for(connection, *args)\n super connection\n if(less_than_ideal? && !args.include?(:force))\n debug \"RDY set ignored due to less than ideal state (con: #{connection})\"\n con = less_than_ideal_ready!\n if(con)\n watch_dog.reset if watch_dog\n super con\n else\n warn 'Failed to set RDY state while less than ideal. Connection stack is empty!'\n end\n end\n end",
"title": ""
},
{
"docid": "459c3fdc36affda63ca9f23e672fe546",
"score": "0.45257625",
"text": "def send (what)\n\t\tunless @channel\n\t\t\traise RuntimeError, 'the process has terminated'\n\t\tend\n\n\t\t@channel.send(what)\n\n\t\tself\n\tend",
"title": ""
},
{
"docid": "1ebba3ba8199a6235ae165340f9062da",
"score": "0.45200872",
"text": "def ready_to_send!; end",
"title": ""
},
{
"docid": "92f9048ad898173dad79f1222feea1ef",
"score": "0.4519751",
"text": "def connect(force = false)\n raise \"Client already connected!\" if @connected && !force\n @connected = true\n end",
"title": ""
},
{
"docid": "46b7dc92f07f994fb244ed2da9d379b0",
"score": "0.45174727",
"text": "def set_message\n end",
"title": ""
},
{
"docid": "6d538882d42a35bfcc7f2e325d9fd82b",
"score": "0.45159736",
"text": "def set_message\n \n end",
"title": ""
},
{
"docid": "f1b841daddf73e7b3bdc4e81d4fbc17e",
"score": "0.45136088",
"text": "def handle_relayopen\n @rsocket = rserver\n end",
"title": ""
}
] |
57490345156a4e9c9de9e345af5d8958
|
GET /hackathons/1 GET /hackathons/1.xml
|
[
{
"docid": "8c79fe796e99a1f528181e7a6dd13982",
"score": "0.66849303",
"text": "def show\n @hackathon = Hackathon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hackathon }\n end\n end",
"title": ""
}
] |
[
{
"docid": "8ca02bb29104366ee9f3f88a451b33cd",
"score": "0.69738084",
"text": "def index\n @hackathons = Hackathon.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @hackathons }\n end\n end",
"title": ""
},
{
"docid": "3d27a98ff08a2c220b1046b5f986e9c2",
"score": "0.6765809",
"text": "def show\n @hack = Hack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hack }\n end\n end",
"title": ""
},
{
"docid": "5fd6d2bf4ef7c9dfe3a4ac8afee442e2",
"score": "0.6202593",
"text": "def get\n @xml = @paths.map { |path|\n puts \"GET\\t#{@host + path}\"\n RestClient.get(@host + path) { |response, request, result|\n puts \"RESPONSE #{response.code}\"\n response.body\n }\n }.map { |response|\n Nokogiri::XML(response).xpath(\"/*\").to_s\n }\n self\n end",
"title": ""
},
{
"docid": "0b4524c6bb021ffb4ca23102a34a8385",
"score": "0.6031121",
"text": "def index\n @hackerspaces = Hackerspace.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @hackerspaces }\n end\n end",
"title": ""
},
{
"docid": "27519824b67207bccfba0de28d5b2919",
"score": "0.6030153",
"text": "def url; \"http://localhost:3000/sdn.xml\"; end",
"title": ""
},
{
"docid": "e43f10c16cb465c3f308c45cb516cd91",
"score": "0.5977447",
"text": "def show\n @hackerspace = Hackerspace.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hackerspace }\n end\n end",
"title": ""
},
{
"docid": "fd5d1488c6c92f932ed191746d652680",
"score": "0.5946799",
"text": "def show\n @hack = Hack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hack }\n end\n end",
"title": ""
},
{
"docid": "f5c90108fab09e5666134a1937e26ad9",
"score": "0.59415746",
"text": "def show\n @hat = Hat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hat }\n end\n end",
"title": ""
},
{
"docid": "219675f818311e83d809ad50537f49e6",
"score": "0.5865767",
"text": "def apis\n respond_to do |format|\n format.xml\n end\n end",
"title": ""
},
{
"docid": "a673f43264cc3acc51bca8250ba7998c",
"score": "0.5761289",
"text": "def get_xml(params = {:format => :xml, :action => :query})#TODO put these in so that they're default and not lost when we pass stuff in...\n url = _form_url(params)\n \n #requests without user-agents are refused. See:\n #http://www.mooduino.co.uk/2010/04/wikipedia-api-user-agent-string-in-php.html\n http = Net::HTTP.new(WIKI_API_SERVER) #en.wikipedia.org\n resp = http.request_get(WIKI_API_PATH+url, 'User-Agent' => 'WikipediaSpamBot/0.1 (+hincapie.cis.upenn.edu)')\n \n raise \"POST FAILED:\" + resp.inspect unless resp.is_a? Net::HTTPOK or resp.is_a? Net::HTTPFound\n resp.body #get xml\nend",
"title": ""
},
{
"docid": "d1c86c5e8c9be9f0c2d81cddda79b923",
"score": "0.5750952",
"text": "def index\n @dailies = @location.dailies\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @dailies }\n end\n end",
"title": ""
},
{
"docid": "9ed5321765652b0df9be52251ca61ca6",
"score": "0.57364476",
"text": "def index\n @hats = Hat.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n# format.xml { render :xml => @hats }\n end\n end",
"title": ""
},
{
"docid": "277963703d47ff0d4bde243341819e21",
"score": "0.57330894",
"text": "def index\n @hackathons = Hackathon.all\n end",
"title": ""
},
{
"docid": "a378256ce3d6338af7180ff544f22b3c",
"score": "0.56805414",
"text": "def xml_report\n RestClient::get \"#{@base}/OTHER/core/other/xmlreport/\"\n end",
"title": ""
},
{
"docid": "b4012fa329faa8db1f71edd022b62d21",
"score": "0.56705195",
"text": "def show\n @hacks_scope = HacksScope.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hacks_scope }\n end\n end",
"title": ""
},
{
"docid": "02a4dfad5186f6b047c8ad91905c403a",
"score": "0.5653131",
"text": "def request(user, method)\n doc = Nokogiri::XML(open(\"#{BASE_FEED}#{user}/#{method}.xml\"))\n end",
"title": ""
},
{
"docid": "e41893e82f3e87195cb1c0869d9f5e21",
"score": "0.56518793",
"text": "def getXML(url)\n puts \"Requesting from \" + url.to_s\n url = URI.parse(url)\n req = Net::HTTP::Get.new(url.to_s)\n res = Net::HTTP.start(url.host, url.port) { |http|\n http.request(req)\n }\n return res.body\nend",
"title": ""
},
{
"docid": "5287660ffc1da7d33d5de8abe3f2ebbf",
"score": "0.5641027",
"text": "def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end",
"title": ""
},
{
"docid": "5a7d741cce59a2eafd2dff90a3e137e8",
"score": "0.5639596",
"text": "def show\n @helicopter = Helicopter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helicopter }\n end\n end",
"title": ""
},
{
"docid": "7046787db45a222cc4baa40023c674cd",
"score": "0.56344",
"text": "def xml = \"docs/index.xml\"",
"title": ""
},
{
"docid": "a9a3737fd9727c4618c82ce663c5cbf7",
"score": "0.5633988",
"text": "def new\n @hack = Hack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hack }\n end\n end",
"title": ""
},
{
"docid": "0d784e792ab10eda1c418c9d67a99d3f",
"score": "0.56330353",
"text": "def show\n @hap = Hap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hap }\n end\n end",
"title": ""
},
{
"docid": "42c69b585448e4eaf3c297811a0e8ae6",
"score": "0.56281793",
"text": "def xml_for(action) rio(url_for(action)).read end",
"title": ""
},
{
"docid": "5a896d73b37584bfc114c2119636c20b",
"score": "0.5620324",
"text": "def ping\n respond_to do |format|\n if @server.ping\n format.xml { render :xml => @server.to_xml(:only => [ :id, :name, :hostname, :last_seen ]) }\n # format.xml { head :ok, :location => server_path(@server) }\n else\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f5d6a0da9dc577124984fb903c179b",
"score": "0.56199163",
"text": "def show\n @koozy = Koozy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @koozy }\n end\n end",
"title": ""
},
{
"docid": "9f2ac274c91c09820ffc55ee39524532",
"score": "0.561547",
"text": "def douban_get_xml url\n#\tputs url\n Nokogiri::HTML(open(url,'User-Agent' => 'ruby'),nil, \"utf-8\")\n #Nokogiri::HTML(open(url,:proxy => nil,'User-Agent' => 'ruby'),nil, \"utf-8\")\n\t\n\t#no network access, used to simulator \n\t#doc = File.read(File.join(RAILS_ROOT, \"app\",\"controllers\",\"event_sample.xml\"))\n\t#Nokogiri::HTML(doc,nil, \"utf-8\")\n #Nokogiri::HTML(open(url,:proxy => nil,'User-Agent' => 'ruby'),nil, \"utf-8\")\nend",
"title": ""
},
{
"docid": "75cbcf56e70b6f05f18bf63abd4293fd",
"score": "0.5607419",
"text": "def index\n self.class.get(\"/cards/index.xml\");\n end",
"title": ""
},
{
"docid": "e4c6ba9c3b88293efd8372c8f7db504f",
"score": "0.5597068",
"text": "def index\n @short_urls = ShortUrl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @short_urls }\n end\n end",
"title": ""
},
{
"docid": "e7619e6adac8fbea6222a30db984355a",
"score": "0.55868006",
"text": "def show\n @soon = Soon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @soon }\n end\n end",
"title": ""
},
{
"docid": "9fa6821632fc2b98734cc704ff1c6929",
"score": "0.5584977",
"text": "def show\n @opensong = Opensong.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opensong }\n end\n end",
"title": ""
},
{
"docid": "28f855a4ba8b0cf924d8db76af24c62b",
"score": "0.5581363",
"text": "def index\n provider = WorkOaiProvider.new\n response = provider.process_request(oai_params.to_h)\n render :body => response, :content_type => 'text/xml'\n end",
"title": ""
},
{
"docid": "a4bbea1eeccafc8af3c1897fa1f433da",
"score": "0.5581273",
"text": "def hackathons()\n\n\t\treturn @result[\"hackathons\"]\n\tend",
"title": ""
},
{
"docid": "764de76443daf13beda61b14a266ea71",
"score": "0.5571526",
"text": "def get_xml\n end",
"title": ""
},
{
"docid": "54a90a7ac61277e2f8ed0cf9f9a04686",
"score": "0.55684274",
"text": "def show\n @server = Server.accessible_by(current_ability).find(params[:id], :include => [:quirk_details => :quirk])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "51628aa915b40aabd95d8515ed2edaf3",
"score": "0.5556402",
"text": "def show\n @whisky = Whisky.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @whisky }\n end\n end",
"title": ""
},
{
"docid": "9cef2fb6b63b19e58ab966a6e8bc5ded",
"score": "0.5551435",
"text": "def show\n @xpath = Xpath.find(params[:id])\n set_site\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @xpath }\n end\n end",
"title": ""
},
{
"docid": "5a24a1b1a3223f85f129bd8111275dea",
"score": "0.5548192",
"text": "def show\n @site = Site.find(params[:id])\n @site_title = @site.nil? ? \"unknown..\" : @site.title\n @xpaths = @site.xpaths\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "f2f8039ffbdcedbc60bb69ee66fc281b",
"score": "0.5513859",
"text": "def show\n @scrap_xml = ScrapXml.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scrap_xml }\n end\n end",
"title": ""
},
{
"docid": "b0fdc2a443d0dffa7741558759c6ff76",
"score": "0.55124456",
"text": "def index\n @shien_keikakus = ShienKeikaku.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @shien_keikakus }\n end\n end",
"title": ""
},
{
"docid": "c7032e3875347d65457e283bf45ab9ce",
"score": "0.5510667",
"text": "def new\n @hackathon = Hackathon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hackathon }\n end\n end",
"title": ""
},
{
"docid": "4d6112e252092e3d8905e5916b2353ce",
"score": "0.5507494",
"text": "def show\n @housing_service = HousingService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @housing_service }\n end\n end",
"title": ""
},
{
"docid": "3cb6e5af885f842e1404af2a6fb5b59b",
"score": "0.54916906",
"text": "def index\n @wikis = Wiki.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wikis }\n end\n end",
"title": ""
},
{
"docid": "590da5dfed9ce7b943099395f8c4fdac",
"score": "0.5487465",
"text": "def show\n @shortessay = Shortessay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shortessay }\n end\n end",
"title": ""
},
{
"docid": "3aaf7ae2d50a902009ddd58d87f8211a",
"score": "0.5482251",
"text": "def show\n @ultra_evil_witch = UltraEvilWitch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ultra_evil_witch }\n end\n end",
"title": ""
},
{
"docid": "d3da825d5becf6e819a6fa59ce5f108d",
"score": "0.5476988",
"text": "def show\n @whishlist = Whishlist.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @whishlist }\n end\n end",
"title": ""
},
{
"docid": "77a6934d45ba0ad696c78013fb16e620",
"score": "0.5472787",
"text": "def permalink\n @installation = Installation.find_by_permalink(params[:permalink])\n\n respond_to do |format|\n format.html { render :action => 'show' }\n format.xml { render :xml => @installation.to_xml }\n end\nend",
"title": ""
},
{
"docid": "e19ef50bb9c62845d4fd22839ebf61cb",
"score": "0.54726064",
"text": "def show\n @tool_kit = ToolKit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tool_kit }\n end\n end",
"title": ""
},
{
"docid": "38300bd122eaaf102fed355250b2a6e8",
"score": "0.5467366",
"text": "def show\n @platoon = Platoon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @platoon }\n end\n end",
"title": ""
},
{
"docid": "37be0ceb4da264628d6c479dd96d6833",
"score": "0.54624194",
"text": "def show\n @ping = Ping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ping }\n end\n end",
"title": ""
},
{
"docid": "0eb809381d474f639e60b318a303a57c",
"score": "0.54608345",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "5412f0a187bbc4ad5965fbc6f852fc61",
"score": "0.5459703",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sip_servers }\n end\n end",
"title": ""
},
{
"docid": "5412f0a187bbc4ad5965fbc6f852fc61",
"score": "0.5459633",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sip_servers }\n end\n end",
"title": ""
},
{
"docid": "ba040e4ed3afae7d1ab4f39ca4564de7",
"score": "0.5455547",
"text": "def show\n @nagios_service = NagiosService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nagios_service }\n end\n end",
"title": ""
},
{
"docid": "6a634460f42c1431e9cbc4b03ddca0f1",
"score": "0.5453583",
"text": "def go\n if true\n uri = URI(ODDS_URL)\n response = Net::HTTP.get_response(uri)\n doc = Nokogiri::XML(response.body)\n doc\n else\n file_name = \"#{CODE}_#{Time.now.to_i}.xml\"\n File.open(File.join(Rails.root, 'db', 'odds_xmls', file_name), 'w') { |f| doc.write_xml_to f }\n read_from_local\n end\n end",
"title": ""
},
{
"docid": "066bb5b08454906bb5f72a7d467ce8b2",
"score": "0.5448658",
"text": "def show\n @hit = Hit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hit }\n end\n end",
"title": ""
},
{
"docid": "b1bfa6e5ba9cca6a062b5a933adb92a7",
"score": "0.54443234",
"text": "def show\n @hoge = Hoge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hoge }\n end\n end",
"title": ""
},
{
"docid": "132a9740121fb10692bfb169b8e73fb0",
"score": "0.54429907",
"text": "def show\n @league = League.find(params[:id])\n# doc = Hpricot.XML(open(\"http://football9.myfantasyleague.com/2007/export?TYPE=league&L=18664&W=\"))\n \n# doc = Hash.from_xml(open(\"http://football9.myfantasyleague.com/2007/export?TYPE=topAdds&L=18664&W=\"))\n \n# Hash.create_from_xml open(\"http://football9.myfantasyleague.com/2007/export?TYPE=league&L=18664&W=\")\n \n# (doc/:league).each do |league|\n# league.attributes do |attr|\n# attr\n# end\n# end\n\n# doc = Hpricot.parse(open(\"http://football9.myfantasyleague.com/2007/export?TYPE=league&L=18664&W=\"))\n \n# (doc/:league).each do |xml_league|\n# for fields in FIELDS\n# league[field] = (xml_league/field.intern).first\n# end\n# end\n \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @league.to_xml }\n end\n end",
"title": ""
},
{
"docid": "a3c4b858c32604119ae283fcbc5f8fcd",
"score": "0.54420733",
"text": "def show\n @power_socket = PowerSocket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @power_socket }\n end\n end",
"title": ""
},
{
"docid": "8e569cec62be315ce27ade573d7bdd6e",
"score": "0.54334265",
"text": "def show\n @kicad_housing = KicadHousing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @kicad_housing }\n end\n end",
"title": ""
},
{
"docid": "85e43a1218b0d70694b013d8c7dc1d6d",
"score": "0.54287463",
"text": "def index\n @hacks = Hack.all\n end",
"title": ""
},
{
"docid": "8f0c2a56d3fc351d42268683d626401f",
"score": "0.54276913",
"text": "def show\n @kitaitoi = Kitaitoi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @kitaitoi }\n end\n end",
"title": ""
},
{
"docid": "7b842a1c38dd797d9b6075eed7ac4779",
"score": "0.5425746",
"text": "def show\n\t\t@hack=Hack.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "9fd4771b93172e47b29d091c9f5b9000",
"score": "0.541561",
"text": "def show\n @scraper = Scraper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"title": ""
},
{
"docid": "9fd4771b93172e47b29d091c9f5b9000",
"score": "0.541561",
"text": "def show\n @scraper = Scraper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"title": ""
},
{
"docid": "e9d196d5de67b22552bbac7ae8929780",
"score": "0.5412785",
"text": "def get(path, opts={})\n puts path\n @db ||= Waxx::Database.connections\n io = Stringy.new \"GET #{path} HTTP1/0\\n#{ENV.map{|n,v| \"#{n}: #{v}\"}.join(\"\\n\")}\"\n x = Waxx::Server.process_request(io, @db)\n #if ARGV[0] == \"get\"\n puts x.res.out\n #else\n # x.res.out.join\n #end\n end",
"title": ""
},
{
"docid": "4371e93a6af324bf056cf15a0b1d51c5",
"score": "0.54125667",
"text": "def show\n @thingie = Thingie.find(params[:id])\n respond_to do |format|\n format.html\n format.json { render json: @thingie}\n format.xml { render xml: @thingie}\n end\n end",
"title": ""
},
{
"docid": "a4f7e4d7be27d74f84827cf405a197aa",
"score": "0.54069006",
"text": "def show\n @infoset = Infoset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @infoset }\n end\n end",
"title": ""
},
{
"docid": "5bf9cf469139c45d6fffe66775200900",
"score": "0.5405888",
"text": "def show\n @server = Server.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "a39726d63e4174f6ebfb8f3a9f18093f",
"score": "0.54045105",
"text": "def show\n @hq_nic = HqNic.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hq_nic }\n end\n end",
"title": ""
},
{
"docid": "cb880a45f76177ab876c27a041bede62",
"score": "0.5401997",
"text": "def index\n @gyms = Gym.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @gyms }\n end\n end",
"title": ""
},
{
"docid": "04cbd016e875b05787eb0275b68a9ab7",
"score": "0.54015243",
"text": "def show\n @witch_cat = WitchCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @witch_cat }\n end\n end",
"title": ""
},
{
"docid": "3e97b54d62735f0c711d85b7574187c7",
"score": "0.5398589",
"text": "def show\r\n Usage.switch_data(params[:Usage], \"daily\")\r\n @usages = Usage.find(params[:id])\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.xml { render :xml => @usages.to_xml(:root => 'records', :children => 'record', :dasherize => false) }\r\n end\r\n end",
"title": ""
},
{
"docid": "f9a545172e403d2cbe1b1c7fcc94808d",
"score": "0.53978974",
"text": "def station1\n @response = Twilio::TwiML::Response.new do |r|\n r.Play 'http://teethtracker.heroku.com/call01.mp3'\n r.Dial :callerId => '+19138151163' do |d|\n d.Client 'Authorities'\n end\n end\n\n respond_to do |format|\n format.all {render :xml => @response.text }\n end\n end",
"title": ""
},
{
"docid": "a7d5b835444fe5ea3b8673d04541585d",
"score": "0.5396781",
"text": "def show\n @nhif = Nhif.find(params[:id])\n load_patient_actions\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nhif }\n end\n end",
"title": ""
},
{
"docid": "e41ef28f38dcd71f23ee7106a111b1ef",
"score": "0.5394522",
"text": "def show\n @bottle = Bottle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bottle }\n end\n end",
"title": ""
},
{
"docid": "c4a541585e252540c29da7680276deeb",
"score": "0.53936225",
"text": "def show\n @jumper = Jumper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @jumper }\n end\n end",
"title": ""
},
{
"docid": "a33c8bd58a3b8dcb94fb1cb646bef5cc",
"score": "0.5393463",
"text": "def show\n @maven_jnlp_server = MavenJnlp::MavenJnlpServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @maven_jnlp_server }\n end\n end",
"title": ""
},
{
"docid": "f176de84a2356232b1050110e0244be4",
"score": "0.53926575",
"text": "def index\n @shiftinfos = Saison.shiftinfos_by_saison\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @shiftinfos }\n end\n end",
"title": ""
},
{
"docid": "c3daa1a7c209e431f8964d0259c2e573",
"score": "0.5391611",
"text": "def show\n @sitio = Sitio.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sitio }\n end\n end",
"title": ""
},
{
"docid": "33ba220e17c1be136aedce2d1817cf62",
"score": "0.5388781",
"text": "def show\n @diag_official = DiagOfficial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diag_official }\n end\n end",
"title": ""
},
{
"docid": "eeec8c02965ded34120eb0d39f5d113a",
"score": "0.53885937",
"text": "def index\n @apis = Api.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @apis }\n end\n end",
"title": ""
},
{
"docid": "737ed3f0a902ecdc350203bbaebc975c",
"score": "0.53849953",
"text": "def show\n @therapy = Therapy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @therapy }\n end\n end",
"title": ""
},
{
"docid": "90eaad6bb27ab4b9a6e48a3293570d8c",
"score": "0.5384097",
"text": "def show\n @wiki = Wiki.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "90eaad6bb27ab4b9a6e48a3293570d8c",
"score": "0.5384097",
"text": "def show\n @wiki = Wiki.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "90eaad6bb27ab4b9a6e48a3293570d8c",
"score": "0.5384097",
"text": "def show\n @wiki = Wiki.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "3507950ed5d93675a52a6be2d7c3dd86",
"score": "0.538347",
"text": "def index\n @tools = Tool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tools }\n end\n end",
"title": ""
},
{
"docid": "ba8971341250bfbd4301a5bbe574cc51",
"score": "0.5377257",
"text": "def show\n @help = Help.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @help }\n end\n end",
"title": ""
},
{
"docid": "d4fc9d9e7eb3698419e0f4fb92ea2020",
"score": "0.5377024",
"text": "def show\n @hecho = Hecho.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hecho }\n end\n end",
"title": ""
},
{
"docid": "7ef1ec93308227009a42df1fb038ce46",
"score": "0.53741723",
"text": "def show\n @weather = Weather.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @weather }\n end\n end",
"title": ""
},
{
"docid": "089b0d8f61387bf0d79de6af8503aa0b",
"score": "0.5373891",
"text": "def index\n @shorturl_redirects = Shorturl::Redirect.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @shorturl_redirects }\n end\n end",
"title": ""
},
{
"docid": "da6ba48d549910fec18c5c85671bf8f3",
"score": "0.53726906",
"text": "def get\n response = Net::HTTP.start(host) do |http|\n query = build_signed_query\n http.get(\"/onca/xml?#{query}\")\n end\n\n Response.new(response)\n end",
"title": ""
},
{
"docid": "e0fc636b0ec464b1e3939cb02d4ff10f",
"score": "0.5366124",
"text": "def show\n @warmup = Warmup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warmup }\n end\n end",
"title": ""
},
{
"docid": "f4e28aceb08673c43a3c5128e901a21b",
"score": "0.5365027",
"text": "def _request(meth, uri, req, *hargs)\n path = \"#{uri.path}/#{meth}?#{h2get(hargs[0])}\"\n puts path if $debug\n open(\"xml.log\", \"a\") { |f|\n f << \"*\" * 50\n f << \"#{Time.now}\\n\"\n f << path\n f << \"\\n\"\n } if $logxml\n convert(req.get(path).body) unless $trap\n end",
"title": ""
},
{
"docid": "7c42dc50753e7821ac7a4b5bcf7dd0f8",
"score": "0.53632283",
"text": "def show\n @sifi = Sifi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sifi }\n end\n end",
"title": ""
},
{
"docid": "b2e585fcf6c42596ba065375bf05c111",
"score": "0.53625435",
"text": "def index\n @attacks = Attack.all\n \n @title = \"Attacks\" \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @attacks }\n end\n end",
"title": ""
},
{
"docid": "b78c1ce0419d6d7e82843a9f31c34ab6",
"score": "0.5360179",
"text": "def show\n @shorturl = Shorturl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shorturl }\n end\n end",
"title": ""
},
{
"docid": "a672dcd1bc08d4e2fae8ffc172bd32f7",
"score": "0.5360047",
"text": "def show\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tool }\n end\n end",
"title": ""
},
{
"docid": "a672dcd1bc08d4e2fae8ffc172bd32f7",
"score": "0.5360047",
"text": "def show\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tool }\n end\n end",
"title": ""
},
{
"docid": "7b8f7228e5733671ad774333fc061c85",
"score": "0.53596836",
"text": "def show\n @chemoinformatics = Chemoinformatic.all\n @chemoinformatic = Chemoinformatic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chemoinformatic }\n end\n end",
"title": ""
},
{
"docid": "fd8631069662d666dd95c1edd44cb467",
"score": "0.53577894",
"text": "def weather_hamburg\n url_hamburg = URI.parse('http://api.openweathermap.org/data/2.5/weather?lat=53.5511&lon=9.9937&&APPID=fecc541c55c2ee50b1ebf1d68067b1e8')\n req_hamburg = Net::HTTP::Get.new(url_hamburg.to_s)\n res_hamburg = Net::HTTP.start(url_hamburg.host, url_hamburg.port) {|http|\n http.request(req_hamburg)}\n puts res_hamburg.body\nend",
"title": ""
}
] |
9939c9c89629b4ac80e900c881692eb3
|
DELETE /todos/1 or /todos/1.json
|
[
{
"docid": "b17786db71fe3d791ae3119afcb78ada",
"score": "0.73896843",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: \"Aufgabe wurde erfolgreich gelöscht!\" }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "13460d1f36ba31172415ebeec718fff4",
"score": "0.77328116",
"text": "def delete\n\t\tt = Todo.find(params[:id].to_i)\n\t\tt.delete()\n\t\trender json: t\n\tend",
"title": ""
},
{
"docid": "edb1a55951817c40c3f0a2a6c4172354",
"score": "0.7715794",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9b6387911c3fbc845ec4f14ff46daf3",
"score": "0.77079785",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9b6387911c3fbc845ec4f14ff46daf3",
"score": "0.77079785",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9b6387911c3fbc845ec4f14ff46daf3",
"score": "0.77079785",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9b6387911c3fbc845ec4f14ff46daf3",
"score": "0.77079785",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9b6387911c3fbc845ec4f14ff46daf3",
"score": "0.77079785",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9b6387911c3fbc845ec4f14ff46daf3",
"score": "0.77079785",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9b6387911c3fbc845ec4f14ff46daf3",
"score": "0.77079785",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1be68e43980093e1ba24c40d34d4e56d",
"score": "0.77009743",
"text": "def destroy\n @todo = Todo.find(params[:id])\n if @todo\n @todo.destroy\n render json: @todo\n else\n render json: { error: 'Unable to delete todo'}, status: 400\n end\n end",
"title": ""
},
{
"docid": "f5a0236a76caa0b3f08619e27fc10884",
"score": "0.76431745",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "74c7db7a7eac2cace698a70d1b8bc09b",
"score": "0.75759757",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5b634cb8a0499056831c7cde86ba89a",
"score": "0.75621533",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n format.json { render :json => true }\n end\n end",
"title": ""
},
{
"docid": "f290eb712225c8e548e3ab2892e7ac97",
"score": "0.7518048",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "24c681e635a283c90fb9e6e2b199e376",
"score": "0.75012046",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c1a98bbf68f6eb432c175ebf533d991",
"score": "0.7427337",
"text": "def destroy\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n format.xml { render xml: @todo }\n end\n end",
"title": ""
},
{
"docid": "efd4aeb9e0819adabc1e0283a8f4cb17",
"score": "0.74262506",
"text": "def destroy\n id_removed = @todo.id\n @todo.destroy\n render json: {id: id_removed}, status: 200\n end",
"title": ""
},
{
"docid": "5f66cd3e7d5c504df1d5257e74463e70",
"score": "0.74090683",
"text": "def destroy\n\t#\t@todo.destroy\n\t#\trespond_to do |format|\n\t#\t\tformat.html { redirect_to todos_url }\n\t#\t\tformat.json { head :no_content }\n\t#\tend\n\tend",
"title": ""
},
{
"docid": "7bd39c522d4377534902b459fb3b927a",
"score": "0.7394338",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.json { render json: {status: 'success'}, status: :ok, location: @root_url }\n end\n end",
"title": ""
},
{
"docid": "e3a59fcacb07ea3f15ab56d36cce86d1",
"score": "0.7390433",
"text": "def destroy\n @todo = Todo.find(params[:id])\n\n authorize! :manage, @todo\n\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "412edb3292ef23d879033ded4f1b9b2f",
"score": "0.73710793",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "412edb3292ef23d879033ded4f1b9b2f",
"score": "0.73710793",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "92c3d3ff4b6ece1ad90baef919bc184c",
"score": "0.7354529",
"text": "def destroy\n @todo_list.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a18f3f79730a707c0b0899b371276f7",
"score": "0.7346003",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to list_path(@list) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8dfc2e6c4022e9f425706baaa47881c8",
"score": "0.7345072",
"text": "def destroy\n @todo_item.destroy\n respond_to do |format|\n format.html\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c59a4d94d81208c0ca198c479e10c065",
"score": "0.731417",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c59a4d94d81208c0ca198c479e10c065",
"score": "0.731417",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c59a4d94d81208c0ca198c479e10c065",
"score": "0.731417",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c59a4d94d81208c0ca198c479e10c065",
"score": "0.731417",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c59a4d94d81208c0ca198c479e10c065",
"score": "0.731417",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c59a4d94d81208c0ca198c479e10c065",
"score": "0.731417",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "74617c9c176b6aeb3cbd5560b0e475af",
"score": "0.73128766",
"text": "def destroy\n @todo = Todo.destroy(params)\n end",
"title": ""
},
{
"docid": "8c4cdfc4f9f8dbcdd0865c535db4fc70",
"score": "0.7311684",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content}\n end\n end",
"title": ""
},
{
"docid": "98dc5389c9e3de0c4d554171bb27d2f0",
"score": "0.7311251",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: \"Todo was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98dc5389c9e3de0c4d554171bb27d2f0",
"score": "0.7311251",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: \"Todo was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69a17577d9221aeb2d3efd7d37137a95",
"score": "0.7310678",
"text": "def destroy\n @todo.destroy\n authorize! :manage, @todos, :message => \"Not authorized to delete task.\"\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7cb88ee6350353a69ed4916c6a9fc60b",
"score": "0.7299031",
"text": "def destroy\n todo = Todo.find(params[:id])\n todo.destroy\nend",
"title": ""
},
{
"docid": "636e0c612fe0c6d86a4410c5a6bee36a",
"score": "0.72878236",
"text": "def delete(todo)\n @service.delete(todo)\n end",
"title": ""
},
{
"docid": "e5bcc8b2aaf65adcd474925bead78acc",
"score": "0.7255919",
"text": "def destroy\n @todolist = Todolist.find(params[:id])\n @todolist.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_url($current_todo) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3a61bf0bca762eff703ccc0e6bde94cd",
"score": "0.72417337",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html do\n redirect_to todos_url, notice: 'Todo was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d41484fe47b5a15d4efa889e471c30e",
"score": "0.72380877",
"text": "def destroy\n @list = @todo.list\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to my_list_todos_url(@list) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5499ff5641aa6dcbd750d6812a2246ac",
"score": "0.7237336",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to :controller => 'todos', :action => \"list\" }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5dc806708b415e938d5b1c07453225fe",
"score": "0.7221776",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n \n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :ok }\n format.js\n end \n end",
"title": ""
},
{
"docid": "814a5f8ed7ac5cc2b2bc64b53f3e9d54",
"score": "0.7196785",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to project_todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4e52fd3cdbb0b3a6b544395838c38ea3",
"score": "0.7174842",
"text": "def delete_todo(todo)\n response = Logan::Client.delete \"/projects/#{@project_id}/todos/#{todo.id}.json\"\n end",
"title": ""
},
{
"docid": "4e52fd3cdbb0b3a6b544395838c38ea3",
"score": "0.7174842",
"text": "def delete_todo(todo)\n response = Logan::Client.delete \"/projects/#{@project_id}/todos/#{todo.id}.json\"\n end",
"title": ""
},
{
"docid": "44521f2cf96cc1997a4c2425f7428a5e",
"score": "0.7165183",
"text": "def destroy\n @todo.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "44521f2cf96cc1997a4c2425f7428a5e",
"score": "0.7165183",
"text": "def destroy\n @todo.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "377697204f69c5544db255871aa1748d",
"score": "0.7161724",
"text": "def destroy\n @todo_todo.destroy\n respond_to do |format|\n format.html { redirect_to todo_todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.7156664",
"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": "1116d8fa6187cb301009555c767e8836",
"score": "0.71492076",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to project_url(@todo.project) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "592bef2fa454fc994758ff8a92f56003",
"score": "0.7142785",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, :flash => { :danger => 'Task was successfully deleted.' } }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "28778a0950bdfc2fb0c3c3fb479d2d98",
"score": "0.7135633",
"text": "def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f9a5d46fff8ebe54a07716de75c9f865",
"score": "0.7127515",
"text": "def destroy\n @todo_item = TodoItem.find(params[:id])\n @todo_item.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f9a5d46fff8ebe54a07716de75c9f865",
"score": "0.7127515",
"text": "def destroy\n @todo_item = TodoItem.find(params[:id])\n @todo_item.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.7103217",
"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": "496bc5d13c9fe057a50ac41628861cc2",
"score": "0.7089427",
"text": "def destroy\n begin \n todo = Todo.find(params[:id])\n todo.destroy\n result = { notice: 'Successfully deleted.' }\n status = 200\n rescue => ex\n result = { notice: 'The task cannot be deleted!!' }\n staus = 400\n end\n \n respond_to do |format|\n format.html { render :json => result, :status => status }\n format.json { render :json => result, :status => status }\n end\n end",
"title": ""
},
{
"docid": "55b1aaa27e2f82689139175aa3783bf7",
"score": "0.70888007",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n format.js { render :text => 'ok' }\n end\n end",
"title": ""
},
{
"docid": "9f70b36cfc0f4bec26adc285c6cb14ec",
"score": "0.7088304",
"text": "def destroy\n @todo_list= @todo_lists.find(params[:id])\n @todo_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n format.json render :json => {:status => 'ok'}.to_json\n end\n end",
"title": ""
},
{
"docid": "cc7a46a1493ceb91070ef485b26440cc",
"score": "0.7079788",
"text": "def destroy\n @todo_item = TodoItem.find(params[:id])\n @todo_item.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_list_url(@todo_list) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f39c1c18d0ebc1ce42529ab71aac5b47",
"score": "0.70691",
"text": "def destroy\n #@todo = Todo.find(params[:id])\n @todo = current_user.todos.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
},
{
"docid": "ba36a9a37dcfa8ae5b41a6039352348a",
"score": "0.70489806",
"text": "def destroy\n @todo = @project.todos.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to [@project, :todos] }\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
},
{
"docid": "115fdea22c3593a8f7119a33be878947",
"score": "0.70315087",
"text": "def destroy\n respond_with todo_item.destroy\n end",
"title": ""
},
{
"docid": "ef5c9742db0553f6bc08634abb89e568",
"score": "0.70305777",
"text": "def destroy\n @todo_status = TodoStatus.find(params[:id])\n @todo_status.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_statuses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "91f9bb1334fc561a4d366870402f0aef",
"score": "0.69993365",
"text": "def destroy\n @todo = @proxy.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url(:uid => params[:uid])) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.69948715",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "5a40159bf32acc3db5466af0fc132702",
"score": "0.6988838",
"text": "def destroy\n todo = Todo.find_by_uuid!(params[:uuid])\n return respond_with(nil, :status => {:msg => \"You are not the author of this todo, you can't delete it\", :code => 403}) unless current_user === todo.user\n\n if todo.destroy\n return respond_with(nil)\n end\n respond_with(nil, :status => {:msg => \"Todo can't be deleted\", :code => 400})\n end",
"title": ""
},
{
"docid": "de9a496060db7148337950dbef4f232e",
"score": "0.6972587",
"text": "def destroy\n @to_do = ToDo.find(params[:id])\n @to_do.destroy\n\n respond_to do |format|\n format.html { redirect_to to_dos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a3dce76fc11a4b610e30b41cbbbcc645",
"score": "0.6971504",
"text": "def destroy\n @todoitem.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "c53a7ddfb5f66bdab62b1fc4305a0473",
"score": "0.6958477",
"text": "def delete *args\n make_request :delete, *args\n end",
"title": ""
},
{
"docid": "5ad707d80911e4cb7a2c005dbd1e65f7",
"score": "0.695565",
"text": "def destroy\n authorize! :destroy, :todo, :message => \"Not authorized\"\n if @todo\n if @todo.destroy\n render json: { success: 'Todo was successfully destroyed.' }, status: :ok\n else\n render json: {error: @todo.errors.full_messages.to_sentence } , status: :unprocessable_entity\n end\n else\n render json: {error: \"Todo does not exist\"} , status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "57e10821338ffd9b2f9b6b0e6e2e2692",
"score": "0.6953329",
"text": "def destroy\n @todo = Todo.find(params[:id])\n \n flash[:notice] = \"#{@todo.name} successfully removed\"\n \n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todonts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f5a40dae99bb749e32da864600433974",
"score": "0.6944337",
"text": "def destroy\n @todo = Todo.find(params[:id])\n\n if current_user_owns_todo? @todo\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n else\n redirect_to(todos_path, :alert => \"Not a valid action!\")\n end\n end",
"title": ""
},
{
"docid": "cc0243d9096e1be380fbcef879647feb",
"score": "0.69406265",
"text": "def destroy\n @todo_list.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Todo list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8d232021c384f33fa74721d620f9bb5",
"score": "0.693987",
"text": "def destroy\n @result = all_items.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to todo_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1a362d1a9230005179f7ad72bba96a4",
"score": "0.6938318",
"text": "def destroy\n @todo_item.destroy\n\n respond_to do |format|\n format.html { redirect_to [@todo_list], notice: 'Todo item deleted successfully.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.69267076",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "0f16ee63259c8d20cbb1c543d81b3fc1",
"score": "0.69152665",
"text": "def destroy\n \t@todo = Todo.find(params[:id])\n \t@todo.destroy\n \tredirect_to todos_path, notice: \"Your todo was deleted!\"\n end",
"title": ""
},
{
"docid": "e50993f7c633f710eabfb4bc0202f242",
"score": "0.6909831",
"text": "def destroy\n respond_with @todo_list.destroy\n end",
"title": ""
},
{
"docid": "7ede6228c15411d778dfe81407258f59",
"score": "0.69057727",
"text": "def destroy\n @todo.destroy\n prepare_todos\n\n if session[:todo_list_cond] == :all\n # no op\n elsif session[:todo_list_cond] == :complete\n @todos = @todos_complete\n else\n @todos -= @todos_complete\n end\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.mobile { redirect_to todos_url }\n format.mobi { redirect_to todos_url }\n format.js\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8dfeb8acb50066069b0c7e973c04b74",
"score": "0.69037914",
"text": "def destroy\n @todo.tasks.each(&:destroy)\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "47a3c9c28e1fcd0fcae5ea58416b42bd",
"score": "0.6891689",
"text": "def delete(path)\n api :delete, path\n end",
"title": ""
},
{
"docid": "9e4a6119dfaa91c86440eabd1bf141ea",
"score": "0.6871717",
"text": "def destroy\n @todo_list2.destroy\n respond_to do |format|\n format.html { redirect_to todo_list2s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2ce1d05f9d996ed4b8582ab7f5f6d451",
"score": "0.68617153",
"text": "def destroy\n @todo=Todo.find(params[:todo_id])\n @task.destroy\n respond_to do |format|\n format.html { redirect_to @todo, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "346ad7fa55ab770039a6f59576e4884c",
"score": "0.68597186",
"text": "def destroy\n\t\ttodo_id = params[:id]\n\t\t@todo = Todo.find(todo_id)\n\t\t@todo.destroy\n\n\t\trender json: {\n message: \"article destroyed\"\n }\n\n\tend",
"title": ""
},
{
"docid": "feb05fa712cede2232b7a79bf0cdeb56",
"score": "0.6853782",
"text": "def delete\n render json: Entry.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.68462104",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "f996be4c9e85319dea34d40654ece2bb",
"score": "0.68397707",
"text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n redirect_to todo_index_path, :notice => \"Your todo item was deleted!\"\n end",
"title": ""
},
{
"docid": "12e676840bfc35abd3790876bf485d43",
"score": "0.68350637",
"text": "def destroy\n @todoo.destroy\n respond_to do |format|\n format.html { redirect_to todoos_url, notice: 'Todoo was successfully destroyed.' }\n # format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cca7c1214e6053ffab756f0584e3c25a",
"score": "0.6818353",
"text": "def destroy\n @todo_item.destroy\n respond_to do |format|\n format.html { redirect_to todo_items_url, notice: 'Todo item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b9b622cf62e8e67ab1329ded4848dad0",
"score": "0.680275",
"text": "def destroy\n @vtodo = ICAL::Vtodo.find_by_id(params[:id])\n @vtodo.destroy\n\n respond_to do |format|\n format.html { redirect_to(vtodos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5b74950f34dfa39ad60c3df6930b7de8",
"score": "0.68003815",
"text": "def destroy\n @todo_item.destroy\n respond_to do |format|\n format.html { redirect_to todo_items_url, notice: 'TodoItem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ffaf25a5b2e3226e8d283ef2c2793fa",
"score": "0.67894506",
"text": "def destroy\n @todoitem.destroy\n respond_to do |format|\n format.html { redirect_to todoitems_url, notice: 'Todoitem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "718fd485f95a30a8c897e2403defb29f",
"score": "0.67892003",
"text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end",
"title": ""
},
{
"docid": "0e56080b1a68f5ff21b4fb1e1dbe2ae4",
"score": "0.67819446",
"text": "def destroy\n @todo_list.destroy\n respond_to do |format|\n format.html { redirect_to todo_lists_url, notice: 'Todo list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e56080b1a68f5ff21b4fb1e1dbe2ae4",
"score": "0.67819446",
"text": "def destroy\n @todo_list.destroy\n respond_to do |format|\n format.html { redirect_to todo_lists_url, notice: 'Todo list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6962994b2944f0a256256e13904f37a8",
"score": "0.67769945",
"text": "def destroy\n @todolist.destroy\n respond_to do |format|\n format.html { redirect_to todolists_url, notice: 'Todolist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57b799133d29316426c358002043baa2",
"score": "0.67753834",
"text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end",
"title": ""
},
{
"docid": "0387aa3c568d857184e97a214e580a14",
"score": "0.6767138",
"text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end",
"title": ""
},
{
"docid": "19a742df9773281469b36df8e34f0d3c",
"score": "0.6760271",
"text": "def deleteTodoItem(param)\n @TodoList.delete(param) \n end",
"title": ""
}
] |
b027a94ee3cfdd7423dbcdcf719004a2
|
Deletes each of the named images and returns an empty string. If there are instances of the images displayed in widgets, the images will not actually be deleted until all of the instances are released. However, the association between the instances and the image manager will be dropped. Existing instances will retain their sizes but redisplay as empty areas. If a deleted image is recreated with another call to image create, the existing instances will use the new image.
|
[
{
"docid": "d5b6189a7063e6b84d9b935e3625b46e",
"score": "0.74304813",
"text": "def delete(*names)\n Tk.execute(:image, :delete, *names)\n end",
"title": ""
}
] |
[
{
"docid": "87dc297215f6476533a8a54672139b4d",
"score": "0.7003474",
"text": "def delete_image tags\n all_images_by_tags( tags ).each { | image | image.deregister } \n end",
"title": ""
},
{
"docid": "d60205b7e63e2b7292807e4d5d0c6fe7",
"score": "0.69657975",
"text": "def delete_images(old_images)\n old_images.each do |name, image|\n image.delete(:all) if image && image != send(name)\n end\n end",
"title": ""
},
{
"docid": "0eb47de8b26b1564b8df384c0250c0b8",
"score": "0.68448174",
"text": "def prune_images\n if self.images.present?\n self.assets.where('id <> ?',self.default_image_id).destroy_all\n end\n end",
"title": ""
},
{
"docid": "7a0680a4eb72d1600be1fe6bac63e60d",
"score": "0.67321604",
"text": "def remove_images(object, name)\n FileUtils.rm Dir.glob(File.join(path_for(object.has_image_id), name + '*'))\n Dir.rmdir path_for(object.has_image_id)\n rescue SystemCallError \n end",
"title": ""
},
{
"docid": "d6f0895e60f959a5b1d1be448eeb41bd",
"score": "0.66994655",
"text": "def remove_images\n rm_r images_dir\n end",
"title": ""
},
{
"docid": "cdec92db4e8c0b4366b75ec8315869f3",
"score": "0.6516358",
"text": "def delete_image_files\n [ :original , :medium , :thumb ].each do |size|\n path = image_path(size, true)\n File.delete(path) if path\n end\n end",
"title": ""
},
{
"docid": "7f182e4ac2a27465baa951ffb075806f",
"score": "0.6465249",
"text": "def delete\n [filename, thumbnail_name].each do |name|\n image = \"#{DIRECTORY}/#{name}\"\n File.delete(image) if File.exists?(image)\n end\n end",
"title": ""
},
{
"docid": "7f182e4ac2a27465baa951ffb075806f",
"score": "0.6465249",
"text": "def delete\n [filename, thumbnail_name].each do |name|\n image = \"#{DIRECTORY}/#{name}\"\n File.delete(image) if File.exists?(image)\n end\n end",
"title": ""
},
{
"docid": "bb68b8f092595d9e1d062ef04ac6d3bb",
"score": "0.6457005",
"text": "def delete_associated_image(parameters)\n eachImageField(parameters) do |image, fieldName|\n if image.present? and image[:assets].blank? and image[:id].blank?\n image_var = send(fieldName)\n image_var.destroy if image_var\n end\n end\n end",
"title": ""
},
{
"docid": "9afed398f395b877e01e1e100e81c2b8",
"score": "0.6419259",
"text": "def delete_all_images\n fog_storage = get_fog_storage\n bucket = get_bucket\n \n directory = fog_storage.directories.get(bucket)\n \n return_string = \"\" \n \n directory.files.each do |file|\n \n return_string += file.key\n \n if ( file.key.to_s.start_with? \"uploads/quiz/#{quiz_id}/quiz_question_images/\")\n file.destroy\n end \n end\n \n return return_string\n end",
"title": ""
},
{
"docid": "e7aafb00dcd17a715b63e68c1a1f886d",
"score": "0.6402247",
"text": "def delete_pxe_image_types\n pxe_image_type_button_operation('destroy', 'deletion')\n end",
"title": ""
},
{
"docid": "c9cd0bf6ff0e0b3b622c53833165c572",
"score": "0.63859254",
"text": "def save_images\n images.each { |n| (n.should_destroy?) ? n.destroy : n.save(false)\t}\n end",
"title": ""
},
{
"docid": "32593724188415de4c2f3ec84be0447e",
"score": "0.6379595",
"text": "def deleted_images(albid)\n Dir[_(albid, \"trash\", \"*.jpg\")].collect do |f|\n image(albid, File.basename(f))\n end\n end",
"title": ""
},
{
"docid": "e37b050228bfb773a939a5be9ad47f93",
"score": "0.63755286",
"text": "def clean_generated_images(image_version)\n @process_runner.execute!(\"docker rmi #{@repository_name}:latest #{@repository_name}:#{image_version}\")\n end",
"title": ""
},
{
"docid": "719e0a2a28f2fe75bfad8667a61a6f08",
"score": "0.6372829",
"text": "def remove_images\n remove_images_from_object(Observation, params)\n end",
"title": ""
},
{
"docid": "a5bcc8fad6a484219a171b32cf57a3e4",
"score": "0.6358994",
"text": "def remove_images # :norobots:\n remove_images_from_object(Observation, params)\n end",
"title": ""
},
{
"docid": "b3aa8a6d7f3c41dcee7f54c60843d527",
"score": "0.63197523",
"text": "def delete_image(image_name)\n File.delete(image_name)\n end",
"title": ""
},
{
"docid": "7ce91dab61817c00aceda53a3e4ddab2",
"score": "0.63113016",
"text": "def remove_all_images\n self.cover_image.purge if self.cover_image.attached?\n self.images.each {|image| image.purge} if self.images.attached?\n end",
"title": ""
},
{
"docid": "3b695c8170493783c11cde0a1c179b34",
"score": "0.62591773",
"text": "def save_images \n post_images.each do |n|\n if n.should_destroy?\n \tn.destroy\n else\n \tn.save(false)\t\n end\t\n end\n end",
"title": ""
},
{
"docid": "ae1e628625d1e338e492540f0b035e17",
"score": "0.6145676",
"text": "def destroy\n output = \"oneimage delete #{resource[:name]} \", self.class.login\n `#{output}`\n end",
"title": ""
},
{
"docid": "c2bd41d54bda140d42f40cd0410dde5c",
"score": "0.61395055",
"text": "def delete_all_uploaded_images\n images_dir = FileUploader.file_dir('article', id)\n FileUtils.rm_rf(images_dir) if File.directory?(images_dir)\n end",
"title": ""
},
{
"docid": "5026d81379efada083f61662cddfe103",
"score": "0.6132162",
"text": "def images(filter: nil)\n old_images\n broken_images\n # Trust docker to do something worthwhile.\n args = {\n all: true,\n filters: '{\"dangling\":[\"true\"]}'\n }\n args[:filter] = filter unless filter.nil?\n Docker::Image.all(args).each do |image|\n remove_image(image)\n end\n # NOTE: Manual code implementing agggressive cleanups. Should docker be\n # stupid use this:\n\n # Docker::Image.all(all: true).each do |image|\n # tags = image.info.fetch('RepoTags') { nil }\n # next unless tags\n # none_tags_only = true\n # tags.each do |str|\n # repo, tag = Docker::Util.parse_repo_tag(str)\n # if repo != '<none>' && tag != '<none>'\n # none_tags_only = false\n # break\n # end\n # end\n # next unless none_tags_only # Image used by something.\n # begin\n # log.warn \"Removing image #{image.id}\"\n # image.delete\n # rescue Docker::Error::ConflictError\n # log.warn 'There was a conflict error, continuing.'\n # rescue Docker::Error::DockerError => e\n # log.warn 'Removing failed, continuing.'\n # log.warn e\n # end\n # end\n end",
"title": ""
},
{
"docid": "474459cd04d85e05cd13993179349904",
"score": "0.61181444",
"text": "def remove_images\n @sample.cover_image.purge if sample_params[:remove_cover_image] == '1'\n image_to_remove_ids = params['image_to_remove_ids']\n if image_to_remove_ids.present?\n image_to_remove_ids.each do |image_to_remove_id|\n @sample.images.find(image_to_remove_id).purge\n end\n end\n end",
"title": ""
},
{
"docid": "e57471cbc7e4d176ba238b8ec1f6425f",
"score": "0.61039954",
"text": "def destroy\n @image.destroy\n end",
"title": ""
},
{
"docid": "e57471cbc7e4d176ba238b8ec1f6425f",
"score": "0.61039954",
"text": "def destroy\n @image.destroy\n end",
"title": ""
},
{
"docid": "e7269f38f8c330559ddedc452d124681",
"score": "0.60125333",
"text": "def destroy_image?\n self.image.clear if @image_delete == \"1\"\n end",
"title": ""
},
{
"docid": "8ab0cd03e6f0fedb963326a15b594569",
"score": "0.6003374",
"text": "def destroy\n @image_attrib.destroy\n end",
"title": ""
},
{
"docid": "d6695969d7b401df70754a77c2947bba",
"score": "0.5974669",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n redirect_to console_images_path\n end",
"title": ""
},
{
"docid": "c7990d00e624b0ae2e46a3c88e7752f5",
"score": "0.5941674",
"text": "def delete_image(image_id)\n delete(\"cloud-instances/#{guid}/images/#{image_id}\")\n end",
"title": ""
},
{
"docid": "4dcdc6d0e5462b19cf47e9c324370a77",
"score": "0.5925552",
"text": "def destroy\n request(:delete, \"/computing/image/#{uuid}\")\n true\n end",
"title": ""
},
{
"docid": "4bd0b4c293a7fb383fcd2f7834f3e3f7",
"score": "0.5901009",
"text": "def delete name,params=nil\n\n # Skip hook calls made by update\n skiphook = (params && params[:skiphook])\n\n images = self.image(name)\n return nil if images.nil?\n o = absolute(images[:original])\n\n if params.nil? || (!params[:width] && !params[:height])\n File.delete(o) if File.exists?(o)\n [:widths,:heights].each do |w|\n images[w].each do |i|\n File.delete(absolute(name,\n (w==:widths ? :width : :height) => i))\n end\n end\n @hooks.delete(:original => images[:original],\n :sized => images[:widths]+images[:heights]) if @hooks && !skiphook\n return o\n\n else\n w,h = params[:width],params[:height]\n n = nil\n if w\n n = absolute(name,:width => w)\n File.delete(n)\n @hooks.delete(:sized => [n]) if @hooks && !skiphook\n elsif h\n n = absolute(name,:height => h)\n File.delete(n)\n @hooks.delete(:sized => [n]) if @hooks && !skiphook\n else\n raise 'Error #2 '+@@errors[2]\n end\n return n\n\n end\n end",
"title": ""
},
{
"docid": "482bf80dbb9324958e0fa95c4c2c73ca",
"score": "0.583228",
"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": "441005c2c3a4fd1f109b1c0310ddbb88",
"score": "0.5827165",
"text": "def delete_files\n\t\t\tFileUtils.rm_rf(@clean_image)\n\t\t\tFileUtils.rm_rf(@image) if pdf?\n\t\tend",
"title": ""
},
{
"docid": "df996d676f86c1a2b964621fc1e074ae",
"score": "0.578875",
"text": "def destroy\n if @image_target.images.empty?\n @image_target.destroy\n redirect_to admin_image_targets_url, notice: \"#{t('notice.deleted',{model: \"#{t('activerecord.models.admin/image_target')}\"})}\"\n else\n redirect_to admin_image_targets_url, notice: \"#{t('notice.delete_canceled', {model: \"#{t('activerecord.models.admin/image_target')}\", relation: \"#{t('activerecord.models.admin/image')}\"})}\"\n end\n end",
"title": ""
},
{
"docid": "7b9aae084d4015a275d449e1d344cb39",
"score": "0.5773641",
"text": "def clean\n # TODO: help?\n # TODO: check for unknown args\n\n # Can give the following\n # Error response from daemon: conflict: unable to delete cfc459985b4b (cannot be forced)\n # image is being used by running container a7108a524a4d\n command = \"docker images -q -f='dangling=true' | xargs docker rmi --force\"\n run command\nend",
"title": ""
},
{
"docid": "ab1e0fe376a26bd0fcb93940ca0e2aa5",
"score": "0.5768901",
"text": "def cleanup\n FileUtils.rm(autoinst_path, force: true)\n FileUtils.rm(definition_path, force: true)\n FileUtils.rm(libvirt_definition_path, force: true)\n if provider == :libvirt\n # Due a bug in vagrant-libvirt the images will not cleanuped correctly\n # in the /var/lib/libvirt directory. This has to be done manually\n # (including DB update)\n system \"sudo virsh vol-delete #{IMAGE_BOX_NAME} default\"\n end\n end",
"title": ""
},
{
"docid": "071834d865f9a44be63a1d1d5a79e280",
"score": "0.5754656",
"text": "def destroy_image\n unless self.image_id.blank?\n unless (image = HopeUpdateImage.find(self.image_id)) && image.destroy\n logger.error \"#destroy <HopeUpdateImage># id:#{self.image_id} failure\"\n end\n end\n end",
"title": ""
},
{
"docid": "a97ed200e6fa59c7003d69a2d3627030",
"score": "0.57316226",
"text": "def available_images; Image.all - images; end",
"title": ""
},
{
"docid": "a97ed200e6fa59c7003d69a2d3627030",
"score": "0.57316226",
"text": "def available_images; Image.all - images; end",
"title": ""
},
{
"docid": "2226ad18c292a349f3c036246266f3ae",
"score": "0.57288367",
"text": "def remove_cached_images\n UserAssetService.remove_assets_from_remote(\"branding_groups/#{self.id}\")\n end",
"title": ""
},
{
"docid": "980660e9218a9aa7b91eb7103586739e",
"score": "0.5722093",
"text": "def destroy_image(key)\n return unless key.is_a?(String) && !key.empty?\n name, ext = key.split('.')\n self.transaction do\n record = find_by_name name\n # do nothing if not found\n return unless record\n if record.refcount > 1\n record.refcount -= 1\n record.save\n else\n if record.keep_till && record.keep_till > Time.now\n record.refcount = 0\n record.save\n else\n record.purge_image_data\n record.delete\n end\n end\n end\n cleanup_temporary_image\n end",
"title": ""
},
{
"docid": "7055552a484cf2d5c8dac5c00ecae31f",
"score": "0.57203263",
"text": "def delete_stored_image\n deleted_files_on_session(params[:name]) << params[:delete_file] unless deleted_files_on_session(params[:name]).include?(params[:delete_file])\n render :text=> \"success\"\n end",
"title": ""
},
{
"docid": "51ce4f6bd487fda6f37e2dc9cef42f41",
"score": "0.57194775",
"text": "def destroy\n @tag_image = TagImage.find params[:id], :include => [ :image ]\n @image = @tag_image.image\n @tag_image.destroy\n @image.tag_images.reload\n @tag_images = @image.tag_images\n render :partial => 'tag_images'\n end",
"title": ""
},
{
"docid": "a57309273b5fc6cf607a99d9cdf07c7b",
"score": "0.57179314",
"text": "def destroy\n @image = Gui::Image.find(params[:id])\n @image.destroy\n redirect_to gui_panels_path\n\n # respond_to do |format|\n # format.html { redirect_to gui_images_url }\n # format.json { head :no_content }\n # end\n end",
"title": ""
},
{
"docid": "62bfc072cc6d30a90fce9103f986223c",
"score": "0.5715312",
"text": "def destroy_image(image_id)\n destroy_resource :image, image_id\n end",
"title": ""
},
{
"docid": "62bfc072cc6d30a90fce9103f986223c",
"score": "0.5715312",
"text": "def destroy_image(image_id)\n destroy_resource :image, image_id\n end",
"title": ""
},
{
"docid": "1d230f2b71aa08dbdd592d9123009431",
"score": "0.57073665",
"text": "def images\n all_attachments = attachment_definitions.clone\n all_attachments.delete_if{|k,v| v[:type] != \"image\"}\n end",
"title": ""
},
{
"docid": "1ebf53900a60102211b854d773837dc9",
"score": "0.57067657",
"text": "def update_thumbnails\n (thumb_glossary_terms + thumb_observations + profile_users).each do |obj|\n obj.remove_image(self)\n end\n end",
"title": ""
},
{
"docid": "47b7c24b6a5f0fc27d78faea6cd59426",
"score": "0.57045645",
"text": "def clear_images(user_id)\n Dir.glob(\"public/images/#{user_id.to_s}_*\") do |my_file|\n File.delete(my_file)\n end\n end",
"title": ""
},
{
"docid": "84a398c7c0f73c7711895c5069820854",
"score": "0.5703543",
"text": "def destroy\n @image.tags.destroy_all\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e118c8ed0a3c954a875eb36ed15f7f7",
"score": "0.56828755",
"text": "def destroy\n @raw_image.destroy\n redirect_to admin_raw_images_path\n end",
"title": ""
},
{
"docid": "85373797bd3d931a9f346267ed39eddd",
"score": "0.56782997",
"text": "def post(original_name)\n img = Magick::ImageList.new(original_name)\n if check? img\n element_name = ELEMENTS_PATH + File.basename(original_name)\n export(img, element_name)\n else\n File.delete original_name\n end\n img.destroy!\n end",
"title": ""
},
{
"docid": "4063e12abc70831deab4d39e9b245b6a",
"score": "0.5670143",
"text": "def photo__after_destroy_trigger\r\n\r\nDir[File.join(FILES_DEST_PHOTO, \"#{self.id}_*\")].each{|f| File.delete(f)}\r\nDir[File.join(FILES_DEST_PHOTO__THUMBS, \"#{self.id}_*\")].each{|f| File.delete(f)}\r\nend",
"title": ""
},
{
"docid": "42b4e3ab1ec6477ef9b0ab3635c886bd",
"score": "0.5663664",
"text": "def destroy\n @image = Image.find(params[:id])\n checkaccountobject(\"images\",@image)\n cloud = Oecloud.new(:zone => @image.zone, :image => @image)\n if cloud.deregisterimage\n @image.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "95621ca433f82e9d8d38bbfa3a7fe5a9",
"score": "0.5657845",
"text": "def delete_old_uploaded_images\n dir = FileUploader.file_dir('article', id) # absolete path to images dir\n return unless File.directory?(dir)\n base_url = FileUploader.file_base_url('articles', id) # base url path (whithout filename)\n old_files = Dir.children(dir).select do |file| # select files that not in the article content\n not images.include?(\"#{base_url}/#{file}\")\n end\n old_files.each do |file| # delete files that not in article content\n attached_file_existence = AttachedFile.exists?(\n filable_type: 'Article',\n filable_id: id,\n new_name: file)\n next if attached_file_existence # File is not image in article\n file_path = \"#{dir}/#{file}\"\n File.delete(file_path) if File.exist?(file_path)\n end\n end",
"title": ""
},
{
"docid": "bc17a6b8fab6228df933a27fe589933e",
"score": "0.56442326",
"text": "def cleanup_derivatives\n deleted_files = []\n image_derivatives = resource.file_metadata.select { |file| (file.derivative? || file.thumbnail_file?) && file.mime_type.include?(image_mime_type) }\n image_derivatives.each do |file|\n storage_adapter.delete(id: file.id)\n deleted_files << file.id\n end\n cleanup_derivative_metadata(derivatives: deleted_files)\n end",
"title": ""
},
{
"docid": "4e6764926c1fa112a38ab585ad6ceb43",
"score": "0.5642884",
"text": "def delete_image\n\t\t@delete_image ||= \"0\"\n\tend",
"title": ""
},
{
"docid": "cbc44cf7a12007a11625fa34e3c0689b",
"score": "0.56081325",
"text": "def unload_image(image_handle)\n end",
"title": ""
},
{
"docid": "0ae78d75f80175ff0975edf198080d56",
"score": "0.56028664",
"text": "def remove_image(img)\n if images.include?(img) || thumb_image_id == img.id\n images.delete(img)\n update(thumb_image: images.empty? ? nil : images.first) \\\n if thumb_image_id == img.id\n notify_users(:removed_image)\n end\n img\n end",
"title": ""
},
{
"docid": "1b4a315e652fc4967297c6e23a4b5bf8",
"score": "0.55928934",
"text": "def image_delete\n @image_delete ||= \"0\"\n end",
"title": ""
},
{
"docid": "c210157342511f6a803d374de4e71a68",
"score": "0.55772495",
"text": "def clear(i)\n newImage = FXPNGImage.new(@parentApp, nil, @canvasWidth, @canvasHeight) #Creates a new image object\n newImage.create #initializes the image object.\n newImage.resize(@canvasWidth, @canvasHeight) #Sizes the image to match canvas width and height\n dc = FXDCWindow.new(newImage)\n dc.foreground = FXRGB(255,255,255)\n dc.fillRectangle(0,0, @canvasWidth, @canvasHeight) #Populates the image with white pixels.\n dc.end\n @imageArray[i] = newImage #Push the cleared image onto the image array, overwriting the old image data.\n @canvas.update #Redraw the canvas to reflect changes to user data\n @activeImage = @imageArray[@activeIndex] #Update active index to default.\n end",
"title": ""
},
{
"docid": "e9169606a93a79cad504b716477bacfd",
"score": "0.5573175",
"text": "def clear\r\n System.instance.remove_item(self.id)\r\n\r\n unless self.picture =~ /default_item\\.png$/\r\n File.delete(Helpers::absolute_path(self.picture.sub(\"/images\", \"../public/images\"), __FILE__))\r\n end\r\n end",
"title": ""
},
{
"docid": "27bdfcf687c76e54ed59d0b1ad0c1edb",
"score": "0.556706",
"text": "def remove_image( image_id )\n image_id = image_id.to_s.upcase\n upload_key = UPLOAD_PATH % image_id\n hires_key = HIRES_PATH % image_id\n lowres_key = LOWRES_PATH % image_id\n\n client.delete_objects(\n bucket: aws.bucket,\n delete: {\n objects: [\n {key: upload_key},\n {key: hires_key},\n {key: lowres_key}\n ]\n }\n )\n end",
"title": ""
},
{
"docid": "bd2330c3b1fd744b517ad9f27eb17db0",
"score": "0.55609345",
"text": "def purge_image\n image.purge_later\n end",
"title": ""
},
{
"docid": "9673c661d6fb14d574171d8f291f7e0a",
"score": "0.5559716",
"text": "def delete_storage(request, params)\n # --- Get the Image ---\n image = ImageOCCI.new(\n Image.build_xml(params[:id]),\n @client)\n\n # --- Delete the Image ---\n rc = image.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end",
"title": ""
},
{
"docid": "2b4898b095f4a1afe4afee91567793d4",
"score": "0.5546956",
"text": "def destroy_image\n @image = find_or_goto_index(Image, params[:id].to_s)\n return unless @image\n\n next_state = nil\n # decide where to redirect after deleting image\n if (this_state = find_query(:Image))\n query_params_set(this_state)\n this_state.current = @image\n next_state = this_state.next\n end\n if !check_permission!(@image)\n redirect_with_query(action: \"show_image\", id: @image.id)\n else\n @image.log_destroy\n @image.destroy\n flash_notice(:runtime_image_destroy_success.t(id: params[:id].to_s))\n if next_state\n query_params_set(next_state)\n redirect_with_query(action: \"show_image\", id: next_state.current_id)\n else\n redirect_to(action: \"list_images\")\n end\n end\n end",
"title": ""
},
{
"docid": "64c95ec0a0997d0c2b661104523f0c9f",
"score": "0.55427885",
"text": "def cleanup_derivatives\n deleted_files = []\n raster_derivatives = resource.file_metadata.select { |file| file.derivative? || file.thumbnail_file? || file.cloud_derivative? }\n raster_derivatives.each do |file|\n storage_adapter.delete(id: file.file_identifiers.first)\n deleted_files << file.id\n end\n cleanup_derivative_metadata(derivatives: deleted_files)\n generate_mosaic unless deleted_files.empty?\n end",
"title": ""
},
{
"docid": "c9af7d0edb803eda969d7e8db4870e02",
"score": "0.5539364",
"text": "def delete_thumbnails\n Jhead.call(\"-dt\", @match, @pattern)\n end",
"title": ""
},
{
"docid": "57fdabd700b1582639e07417b12ce945",
"score": "0.5527238",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "40eee18ef6f069fede31cd2d8d4cff0b",
"score": "0.55236",
"text": "def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end",
"title": ""
},
{
"docid": "25e82a6ef5e28e4b798c2f07ab5e4dda",
"score": "0.5522849",
"text": "def clear\n @uploaders.each do |uploader| \n full_preview_path = \"#{Rails.root}/public/uploads/tmp/#{uploader.preview.cache_name}\"\n cache_dir = File.expand_path('..', full_preview_path)\n uploader.remove!\n Dir.delete(cache_dir)\n end\n\n @uploaders.clear\n @downloaded_images.clear\n end",
"title": ""
},
{
"docid": "2a7f6ff6c09b5b3553e1e5562cdba3f6",
"score": "0.55055153",
"text": "def remove_photos\n self.photos.clear\n end",
"title": ""
},
{
"docid": "86d0ee28091c283b802bb852b2e6c5ee",
"score": "0.54991734",
"text": "def destroy\n @family_image.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "f51cdc5faf97554f543ce13416dce46f",
"score": "0.54969203",
"text": "def destroy\n @image.destroy\n redirect_to images_url, notice: 'Image was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "57bd3fa2addb492e891315203ffd8263",
"score": "0.5495918",
"text": "def cleanup\n self.image = nil\n GC.start\n end",
"title": ""
},
{
"docid": "57bd3fa2addb492e891315203ffd8263",
"score": "0.5495918",
"text": "def cleanup\n self.image = nil\n GC.start\n end",
"title": ""
},
{
"docid": "186b5d3929f9a5091c4d7493096ccd97",
"score": "0.5485411",
"text": "def reconcile_images(imageable, images)\n current_image_ids = imageable.images.pluck(:id)\n\n # remove associations\n images_to_remove = current_image_ids - images.pluck(:id)\n imageable.images.where(id: images_to_remove).each do |img_to_remove|\n img_to_remove.update(imageable_id: nil, imageable_type: nil)\n end\n # create / update\n images.each do |image|\n if current_image_ids.include? image['id']\n Image.find(image['id']).update(image.except(:image_src, :updated_at, :created_at))\n else\n Image.create(\n name: image['name'],\n imageable: imageable,\n image_src: image['image_src']['url'],\n primary: image['primary'] || false,\n size: image['size'],\n order_index: image['order_index']\n )\n end\n end\n end",
"title": ""
},
{
"docid": "32f2f89a50a38e305690a1637200883d",
"score": "0.548063",
"text": "def destroy\n @image = Image.find(params[:id])\n if @image.destroy\n flash[:notice] = \"Successfully deleted image!\"\n redirect_to images_path\n else\n flash[:alert] = \"Error updating image!\"\n end\n end",
"title": ""
},
{
"docid": "d019299b49e6ea0fc40ad69b756cca58",
"score": "0.54747564",
"text": "def before_destroy\n \n begin\n del_html = \"#{SHIP_LABELS_STORE}/#{File.basename(self.label)}\"\n del_graphic = \"#{SHIP_LABELS_STORE}/label#{File.basename(self.label).gsub(\".html\", \".gif\")}\"\n FileUtils.rm del_html, :force => true\n FileUtils.rm del_graphic, :force => true\n rescue\n return true\n end\n\n end",
"title": ""
},
{
"docid": "111f2e95471a281f1bd68dd79aa66699",
"score": "0.54689825",
"text": "def dispose_pictures\n for sprite in @picture_sprites\n sprite.dispose\n end\n end",
"title": ""
},
{
"docid": "f92d3c665febab8b6008aa3ade5b0b4b",
"score": "0.5466497",
"text": "def delete_software_image(opts)\n opts = check_params(opts,[:image_filenames])\n super(opts)\n end",
"title": ""
},
{
"docid": "4c19475d8c14d00c3defb2ccb2975000",
"score": "0.54657084",
"text": "def delete_pic\n self.posts.each do |post|\n post.pic.destroy\n end\n end",
"title": ""
},
{
"docid": "3232cacfcaf5b92d3936b3c29d6b6d92",
"score": "0.5449221",
"text": "def destroy_image # :norobots:\n if @image = find_or_goto_index(Image, params[:id].to_s)\n next_state = nil\n # decide where to redirect after deleting image\n if this_state = find_query(:Image)\n set_query_params(this_state)\n this_state.current = @image\n next_state = this_state.next\n end\n if !check_permission!(@image)\n redirect_to(:action => 'show_image', :id => @image.id,\n :params => query_params)\n else\n @image.log_destroy\n @image.destroy\n Transaction.delete_image(:id => @image)\n flash_notice(:runtime_image_destroy_success.t(:id => params[:id].to_s))\n if next_state\n redirect_to(:action => 'show_image', :id => next_state.current_id,\n :params => set_query_params(next_state))\n else\n redirect_to(:action => 'list_images')\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a73bf6cf589f9cc0b4ed50e16b96951a",
"score": "0.54411906",
"text": "def destroy_image(action_handler, image_spec, image_options, machine_options={})\n raise \"#{self.class} does not implement destroy_image\"\n end",
"title": ""
},
{
"docid": "6ae30c8fe872c2cf21aaed2b19257684",
"score": "0.54301476",
"text": "def smart_delete(container_repository, tag_names)\n # generates the blobs for the dummy image\n dummy_manifest = container_repository.client.generate_empty_manifest(container_repository.path)\n\n # update the manifests of the tags with the new dummy image\n tag_digests = tag_names.map do |name|\n container_repository.client.put_tag(container_repository.path, name, dummy_manifest)\n end\n\n # make sure the digests are the same (it should always be)\n tag_digests.uniq!\n\n # rubocop: disable CodeReuse/ActiveRecord\n Gitlab::Sentry.track_exception(ArgumentError.new('multiple tag digests')) if tag_digests.many?\n\n # Deletes the dummy image\n # All created tag digests are the same since they all have the same dummy image.\n # a single delete is sufficient to remove all tags with it\n if container_repository.delete_tag_by_digest(tag_digests.first)\n success(deleted: tag_names)\n else\n error('could not delete tags')\n end\n end",
"title": ""
},
{
"docid": "e870e3ac058cfd59996b91ad6bb513d2",
"score": "0.5425508",
"text": "def destroy\n\t\timage = Image.find(params[:id])\n\t\timage.destroy\n\t\tredirect_to :back\n\tend",
"title": ""
},
{
"docid": "4b7e5438eb51b230f7c895bbfae3e0e0",
"score": "0.5425156",
"text": "def delete_expired_images(region = AWSCONFIG[:default_region])\n #find images with tags of expiring and less than today's date\n ec2 = AWS::EC2.new(:region => region).client\n images = ec2.describe_images(:owners => [\"self\"], :filters => [:name => 'tag-key', :values => ['expiring']])\n deleted_images = []\n\n #loop thru to see if they are in the past\n if images\n images.data[:images_set].each do |i|\n expdate = get_tagvalue(i, \"expiring\")\n if expdate.length > 0\n begin\n expdate = Time.parse(tags.value)\n if expdate < Time.now\n #expired in the past so delete\n deleted_images << i\n #delete associated snapshots first\n i[:block_device_mapping].each do |dev|\n ec2.delete_snapshot(:snapshot_id => dev[:ebs][:snapshot_id])\n end\n ec2.deregister_image(:image_id => i[:image_id])\n end\n rescue => e\n #error parsing - do something or nothing\n end\n end\n end\n end\n\n return deleted_images\n end",
"title": ""
},
{
"docid": "fe26ef913c3b3eda7eab878015f98dca",
"score": "0.5416215",
"text": "def destroy\n @admin_journal_issue.journal_issue_images.each do |image|\n loaded = Cloudinary::Uploader.destroy(\"journal_issue/images/#{image.id}\", :public_id => \"journal_issue/files/#{image.id}\", :invalidate => true)\n end\n @admin_journal_issue.journal_issue_files.each do |file|\n loaded = Cloudinary::Uploader.destroy(\"journal_issue/files/4_admin_login.html\", :public_id => \"journal_issue/files/4_admin_login.html\", :invalidate => true, :resource_type => :raw)\n end\n Admin::JournalIssueFile.delete_all \"journal_issue_id = #{@admin_journal_issue.id}\"\n Admin::JournalIssueImage.delete_all \"journal_issue_id = #{@admin_journal_issue.id}\"\n @admin_journal_issue.destroy\n respond_to do |format|\n format.html { redirect_to admin_journals_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d240ef69d38206b3253aa5bab0ab5595",
"score": "0.54113513",
"text": "def log_destroy\n (glossary_terms + observations).each do |object|\n object.log(:log_image_destroyed, name: log_name, touch: true)\n end\n end",
"title": ""
},
{
"docid": "af992fe5176a12e712f045b3c00c511d",
"score": "0.5401084",
"text": "def destroy_multiple\n @photos = Photo.where(id: params[:photo_ids]).with_attached_images\n @photos.destroy_all\n respond_to do |format|\n format.html { redirect_to photos_path, notice: 'Selected photos were successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c302ed84938791a87b8721cb85a96631",
"score": "0.5381393",
"text": "def cleanup_nontarget_files\n\n delete_dir = File.expand_path(File.join(app.build_dir, 'Resources/', 'Base.lproj/', 'assets/', 'images/'))\n\n puts_blue \"Cleaning up excess image files from target '#{options.Target}'\"\n puts_red \"Images for the following targets are being deleted from the build directory:\"\n\n (options.Targets.keys - [options.Target]).each do |target|\n\n puts_red \"#{target.to_s}\"\n Dir.glob(\"#{delete_dir}/**/#{target}-*.{jpg,png,gif}\").each do |f|\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n puts_red \"\\nImages prefixed all- are being deleted if a corresponding #{options.Target}- exists.\"\n\n Dir.glob(\"#{delete_dir}/**/all-*.{jpg,png,gif}\").each do |f|\n if File.exist?( f.sub(\"all-\", \"#{options.Target}-\") )\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "a3350a79dbe4ee339043480f821fd5b7",
"score": "0.53743",
"text": "def destroy\n @student_image.destroy\n end",
"title": ""
},
{
"docid": "b20a4e7629bac6d2e1dd52e4b14dd90e",
"score": "0.53664154",
"text": "def remove_image(value)\n @children['image'][:value].delete(value)\n end",
"title": ""
},
{
"docid": "7fa108e4dd5c5883f85510bca4bd64f0",
"score": "0.5365856",
"text": "def destroy_instances_if_ami_changed\n self.instances.each { |i| i.destroy } if self.ami_id_changed?\n end",
"title": ""
},
{
"docid": "4d8764568174b6a01104dcd88e43a1ae",
"score": "0.53647256",
"text": "def destroy_image(credentials, image_id)\n safely do\n new_client(credentials).get('images/%s/destroy', image_id)\n end\n end",
"title": ""
},
{
"docid": "8cf5159d1a255e1805b397e65b7b1409",
"score": "0.53631455",
"text": "def destroy\n @combined_image = CombinedImage.find(params[:id])\n @combined_image.destroy\n\n respond_to do |format|\n format.html { redirect_to combined_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "749652307153a14ff23c9317a108908e",
"score": "0.5356454",
"text": "def remove_photos(db, selected)\n\n photos = selected.split(\",\")\n\n photos.each do |photo|\n delete_s3_file(photo)\n delete_db_record(db, photo)\n end\n\nend",
"title": ""
},
{
"docid": "259f5f41343bea7cf3bc1807ba89663e",
"score": "0.5349862",
"text": "def undelete_image!(albid, imgid)\n img = image(albid, imgid)\n source, target = _(img[:path]), _(albid, imgid)\n FileUtils.mv(source, target) if img[:deleted]\n img[:deleted]\n end",
"title": ""
},
{
"docid": "f09eb2f8e82258f6af19a4a3b1b097d5",
"score": "0.5349023",
"text": "def delete!\n response = @connection.csreq(\"DELETE\",@connection.svrmgmthost,\"#{@connection.svrmgmtpath}/images/#{URI.escape(self.id.to_s)}\",@connection.svrmgmtport,@connection.svrmgmtscheme)\n CloudServers::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end",
"title": ""
},
{
"docid": "c6eccf5f67d311657d481cbe94820aa5",
"score": "0.53484213",
"text": "def remove_math_images_folder\n math_images.remove_folder\n end",
"title": ""
}
] |
e973c4a723582b9469014a521f6b7b2f
|
PATCH/PUT /backoffice/questions/1 PATCH/PUT /backoffice/questions/1.json
|
[
{
"docid": "bea0a1d5748b78fad5bce19c5dc69fa0",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @instruction.update(instruction_params)\n format.html { redirect_to backoffice_instruction_path(@instruction), notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: backoffice_instruction_path(@instruction) }\n else\n format.html { render :edit }\n format.json { render json: @instruction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "3b1af6b89a0e0f1659059190f1c5b6ae",
"score": "0.6725025",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fdaf46ea4ec4df6362adc952aed6f6a",
"score": "0.6617885",
"text": "def update\n respond_to do |format|\n if @api_v1_question.update(api_v1_question_params)\n format.html { redirect_to @api_v1_question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_question }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "496c2796ef049221622ff21443bd82d3",
"score": "0.65759045",
"text": "def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d37378ce5ecf2472bb955258a1f4119",
"score": "0.65738046",
"text": "def update\n question = Question.find(params[:id_question])\n if question.update(params_question)\n render json: question, status: 200\n else\n render json: question.errors, status: 422\n end\n\n end",
"title": ""
},
{
"docid": "18ade210f20e64bc8cb1ab5a477e966f",
"score": "0.6532872",
"text": "def update\n @test_question = TestQuestion.find(params[:id])\n\n respond_to do |format|\n if @test_question.update_attributes(params[:test_question])\n format.html { redirect_to @test_question, :notice => 'Test question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @test_question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e8503786e60b18cc73a66b78e6e81dd",
"score": "0.6505304",
"text": "def update\n @question = Question.update(params[:id], { \n :body => params[:body], \n :answer_type => params[:answer_type] }, \n params[:answers].values\n )\n\n respond_to do |format|\n format.json { render :json => @question.as_json({:include => :answers}) }\n\n # if @question.update_attributes(params[:question])\n # format.html { redirect_to @question, :notice => 'Question was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render :action => \"edit\" }\n # format.json { render :json => @question.errors, :status => :unprocessable_entity }\n # end\n end\n end",
"title": ""
},
{
"docid": "b655c3e98e1f831340b84e44c39fe8f6",
"score": "0.649575",
"text": "def update_question\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to :planner, notice: 'Question was successfully updated.' }\n format.json { respond_with_bip(@question) }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77b85db09878da4a819580ee404c6419",
"score": "0.6459733",
"text": "def update\n if @v1_question.update(v1_question_params)\n render json: @v1_question, status: :ok\n else\n render json: get_errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "12e92c65d0662f5651bc8ada4d5f3270",
"score": "0.6432376",
"text": "def update_mod\n if params[:title] != nil && params[:content] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/updateQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to questions_path\n end\n end",
"title": ""
},
{
"docid": "1e1f48dbca0d9de92b519839e101cf05",
"score": "0.6416894",
"text": "def update\n respond_to do |format|\n if @b_question.update(b_question_params)\n format.html { redirect_to @b_question }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @b_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff27b464b79d3829afa2fd746685ea2d",
"score": "0.6407626",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.json { render :json => 'Question updated OK' }\n format.xml { head :ok }\n else\n format.json { render :json => @question.errors }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97887b6ee508cd8e6a8cb82047e7ca42",
"score": "0.6396153",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, :notice => 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d9d5eda045bdcaba4e153c645edca8a",
"score": "0.63909364",
"text": "def edit_question\n\t\t\tquizzes = current_instructor.quizzes\n\t\t\t@found = 0\n\t\t\tquizzes.each do |quiz|\n\t\t\t\tif(quiz.questions.exists?(:id => params[:question_id]))\n\t\t\t\t\t@found = @found + 1\n\t\t\t\tend \n\t\t\tend\n\t\t\tif (@found > 0)\n\t\t\t\tquestion = Question.find(params[:question_id])\n\t\t\t\tif (question.update(question_params))\n\t\t\t\t\trender json: { success: true, data: { :question => question }, info:{} }, status: 200\n\t\t\t\telse\n\t\t\t\t\trender json: { error: question.errors }, status: 422 \n\t\t\t\tend\t\n\t\t\telse\n\t\t\t\trender json: { error:\"Question is not found\" }, status: 422\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "4798b54f55d5679b9ec891a80e224c2d",
"score": "0.63905424",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to new_question_path, notice: 'questions was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef439ec973a89ac171b2b635b8715a60",
"score": "0.63479227",
"text": "def update\n #@question = Question.find(params[:id])\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: t('alert.question.update_success', default: 'Question was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "066a00b89f567fbac778a5c2c3239ab7",
"score": "0.63472617",
"text": "def update\n\n qp = question_params\n if qp[:question_type] == \"vignette\" or qp[:question_type] == \"nonchoice\"\n qp[:answer] = \"\"\n end\n\n respond_to do |format|\n if @question.update(qp)\n format.html { redirect_to paper_questions_path(question_params[:paper_id],question_params[:id]), notice: '題目已被成功編輯' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { redirect_to edit_paper_question_path, notice: '上傳檔案大小不可超過500KB' }\n format.json { render json: paper_questions_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85825dbde05d1aefaf83c671cb1bd6f",
"score": "0.634652",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85825dbde05d1aefaf83c671cb1bd6f",
"score": "0.634652",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85825dbde05d1aefaf83c671cb1bd6f",
"score": "0.634652",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85825dbde05d1aefaf83c671cb1bd6f",
"score": "0.634652",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85825dbde05d1aefaf83c671cb1bd6f",
"score": "0.634652",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f95f40d248ce0f1fff60dab15ed0dca",
"score": "0.63279706",
"text": "def update\n question = Question.find_by!(id: params[:id])\n if question\n question.name = params[:name]\n question.description = params[:description]\n question.user_id = params[:user_id]\n question.category_id = params[:category_id]\n question.zavrseno = params[:zavrseno]\n question.uposlenik_id = params[:uposlenik_id]\n question.save\n render json: question, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "43b55fe20efcdec3c2c9ded86ac0515f",
"score": "0.6324067",
"text": "def update\n @question = Question.find(params[:id])\n @question.update_attributes(params[:question])\n render :json => @question.id if @question.save\n # respond_to do |format|\n # if @question.update_attributes(params[:question])\n # format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n # format.xml { head :ok }\n # else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "c15733f41d6b36aa8f87db7bfe3c5efd",
"score": "0.6314051",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b445ae8f8b604b99227b50d807e80fc8",
"score": "0.6297216",
"text": "def update\n if @question.status == 'published' || @question.version_independent_id != question_params[:version_independent_id]\n render json: @question.errors, status: :unprocessable_entity\n else\n update_response_sets(params)\n @question.update_concepts('Question')\n @question.updated_by = current_user\n if @question.update(question_params)\n @question.groups.each do |group|\n @question.add_to_group(group.id)\n end\n render :show, status: :ok, location: @question\n else\n @categories = Category.all\n render json: @question.errors, status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "4df8bc84a9d46c93b8c1774c99e21fcb",
"score": "0.62940586",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4df8bc84a9d46c93b8c1774c99e21fcb",
"score": "0.62940586",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4df8bc84a9d46c93b8c1774c99e21fcb",
"score": "0.62940586",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50a57588cea0cca86808ee07456b9119",
"score": "0.6274768",
"text": "def update\n @my_question = MyQuestion.find(params[:id])\n\n respond_to do |format|\n if @my_question.update_attributes(params[:my_question])\n format.html { redirect_to @my_question, notice: 'My question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c366e8dc2a2a7e52a1129efdc61fdae",
"score": "0.6258571",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f83e347f68fdc220f1c623a35dcc928e",
"score": "0.62398136",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, :notice =>'Question was successfully updated.' }\n format.json { render :show, :status => :ok, :location => @question }\n else\n format.html { render :edit }\n format.json { render :json => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4d027a943110d9976e87ecd20aad026",
"score": "0.62379086",
"text": "def update\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to quiz_path(@question.subsection_id), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c13f8d9d617c585f7785dba59280126",
"score": "0.62363523",
"text": "def update\n respond_to do |format|\n if @test_question.update(test_question_params)\n format.html { redirect_to @test_question, notice: 'Test question was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_question }\n else\n format.html { render :edit }\n format.json { render json: @test_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbf03f235dff3fb63e500533555921ce",
"score": "0.6218432",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question 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 => @question.errors, :status => :unprocessable_entity }\n\t\t\t\tformat.json { render :json => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de7460a0a0ea5be2ee2e974d0de13ead",
"score": "0.6191643",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n if (@question.question_type.short_text? || @question.question_type.open_ended_text?)\n path = survey_path(params[:survey_id])\n else\n path = survey_question_path(params[:survey_id],@question.id)\n end\n format.html { redirect_to path, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c106fda5e2d13dde37983dcb7cf8f8a4",
"score": "0.61911494",
"text": "def update_correct_answer\n question_params = params.permit(:question_id, :question_type_id, :option_id)\n \n render json: Question.update_correct_option(question_params)\n end",
"title": ""
},
{
"docid": "b81b2eab32af5649edb5e8a39fd6ef19",
"score": "0.61895645",
"text": "def update_rest\n @question_localized = QuestionLocalized.find(params[:id])\n\n respond_to do |format|\n if @question_localized.update_attributes(params[:question_localized])\n flash[:notice] = 'QuestionLocalized was successfully updated.'\n format.html { redirect_to(@question_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question_localized.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0da717edfd6045dbb0e58d02395761c2",
"score": "0.6178364",
"text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question.course, notice: 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4238d6d8820be0065be9e7eb86734e07",
"score": "0.6165206",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83c4272cfdfc1bffc1383305c99d1e67",
"score": "0.61614895",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: \"Question was successfully updated.\" }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2dad3fdb8ae2c4b41957261030566cd",
"score": "0.61435497",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to edit_question_path(@question), notice: 'Question was successfully updated.' }\n format.json\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fafab269da114b7afa0c8b34c421c389",
"score": "0.6140194",
"text": "def update\n @question_set = QuestionSet.find(params[:id])\n\n respond_to do |format|\n if @question_set.update_attributes(params[:question_set])\n format.html { redirect_to @question_set, notice: 'Question set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1b1f5a9d473e62e34699950f36995a4",
"score": "0.6129668",
"text": "def update\n @base_question = BaseQuestion.find(params[:id])\n\n respond_to do |format|\n if @base_question.update_attributes(params[:base_question])\n format.html { redirect_to @base_question, notice: 'Base question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @base_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bd16264d2dc3ffb61109fcb09655a44",
"score": "0.6118728",
"text": "def update\n @intake_question = IntakeQuestion.find(params[:id])\n\n respond_to do |format|\n if @intake_question.update_attributes(params[:intake_question])\n format.html { redirect_to @intake_question, notice: 'Intake question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @intake_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cf8c71fe94565ce6f13cef1b82a7a91",
"score": "0.61185396",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'La pregunta fue modificada correctamente.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70bca19e1ca775f5a257f2b81d762fba",
"score": "0.61157256",
"text": "def update\n # before_action :set_question\n #before_action :set_tag\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: \"更新しました\" }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ade816d3f4234d5c40187e769dcfd0c",
"score": "0.6111474",
"text": "def update\n respond_to do |format|\n if @admin_academy_question.update(admin_academy_question_params)\n format.html { redirect_to @admin_academy_question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_academy_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7663d0348b74542ff1d2f4fd96156fe",
"score": "0.6107263",
"text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"title": ""
},
{
"docid": "7e130a04480cdf941831de6b08519aec",
"score": "0.6106126",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to [@category, @question], notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67061ca54d98fa013bd76f2c6c6f096c",
"score": "0.6100627",
"text": "def update\n @questionset = Questionset.find(params[:id])\n\n respond_to do |format|\n if @questionset.update_attributes(params[:questionset])\n format.html { redirect_to @questionset, notice: 'Questionset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questionset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.60872537",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.60872537",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "0a932c896c0c0f2254dc917eef27f817",
"score": "0.60722417",
"text": "def update_question_content\n question_params = params.require(:question).permit(:id, :content)\n\n render json: Question.update_question_content(question_params)\n end",
"title": ""
},
{
"docid": "a6900f29d06c0c61dcd14936cb5bbddd",
"score": "0.6056017",
"text": "def update\n respond_to do |format|\n if @add_question.update(add_question_params)\n format.html { redirect_to @add_question, notice: 'Add question was successfully updated.' }\n format.json { render :show, status: :ok, location: @add_question }\n else\n format.html { render :edit }\n format.json { render json: @add_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa05984bbad6df5b15b230fd72dc63f5",
"score": "0.6053651",
"text": "def update\n authorize @question\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.6039842",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "2b4a50ccc88a1ebc4d2d5cda7b49b715",
"score": "0.6037328",
"text": "def update\n redirect_to \"/\"\n\n # respond_to do |format|\n # if @question.update(question_params)\n # format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n # format.json { render :show, status: :ok, location: @question }\n # else\n # format.html { render :edit }\n # format.json { render json: @question.errors, status: :bad_request }\n # end\n # end\n end",
"title": ""
},
{
"docid": "d9b91c48c9b090e424e3cb9e2c5ec912",
"score": "0.6036545",
"text": "def update\n respond_to do |format|\n if @quizzes_question.update(quizzes_question_params)\n if params[:commit] =~ /add/i\n format.html { redirect_to edit_quiz_question_path(@question.quiz, @question) }\n else\n format.html { redirect_to quiz_questions_path(@question.quiz), notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @quizzes_question }\n end\n else\n format.html { render :edit }\n format.json { render json: @quizzes_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efee165fcf446d526da0b3814f31e053",
"score": "0.6034413",
"text": "def update\n respond_to do |format|\n if @mongo_question.update(mongo_question_params)\n format.html { redirect_to @mongo_question, notice: 'Mongo question was successfully updated.' }\n format.json { render :show, status: :ok, location: @mongo_question }\n else\n format.html { render :edit }\n format.json { render json: @mongo_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a42ce0fe1bc2507d4f24d6eea77a071e",
"score": "0.60331583",
"text": "def update\n @survey_question = SurveyQuestion.find(params[:id])\n\n respond_to do |format|\n if @survey_question.update_attributes(params[:survey_question])\n format.html { redirect_to survey_questions_path(@survey_question.survey_id),\n notice: 'Survey question was successfully updated.' }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @survey_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9a096ddf16c7ba4c65853f78ed469e9",
"score": "0.60295254",
"text": "def update\n respond_to do |format|\n if @examquestion.update(examquestion_params)\n format.html { redirect_to @examquestion, notice: 'Examquestion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @examquestion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a25dc13e9922bfaa142fb6c3fe44d5bf",
"score": "0.6029185",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n format.js { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n format.js { head :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7b47119be76c022f09ee957955b176a",
"score": "0.6026811",
"text": "def update\n @poll_question = PollQuestion.find(params[:id])\n\n respond_to do |format|\n if @poll_question.update_attributes(params[:poll_question])\n format.html { redirect_to @poll_question, notice: 'Poll question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c0bc7be457ac0959966804a13deac2f",
"score": "0.60207146",
"text": "def update\n @faq.update(faqs_params)\n json_response(@faq)\n end",
"title": ""
},
{
"docid": "4aacdd7a1cbd2cbe530bac93cf2f90ca",
"score": "0.60195273",
"text": "def update\n respond_to do |format|\n @test.update_question_details(test_params)\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a95fc8d9cbd8a040fc9280b75596b75",
"score": "0.60061944",
"text": "def update\n respond_to do |format|\n if @question.update(question_params)\n @question_link = QuizQuestion.find_by_id(@question.questionid)\n @question_link.update(:points => params[:points])\n @quiz = Quiz.find_by_id(@question_link.quizid)\n format.html { redirect_to admin_quiz_path(@quiz), notice: 'Quiz multiple choice question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02ff7d7c4afd644788c5a805ac4f0431",
"score": "0.5992508",
"text": "def update\n authorize! :edit, @questionnaire\n\n @questionnaire.load_JSON(params[:questionnaire], current_user)\n\n respond_to do |format|\n# if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to @questionnaire, notice: 'Kysymyslomakkeen muokkaaminen onnistui.' }\n format.json { head :no_content }\n# else\n# format.html { render action: \"edit\" }\n# format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n# end\n\n end\n end",
"title": ""
},
{
"docid": "1928a34f72a417beb87f0cce2b796cc6",
"score": "0.5991527",
"text": "def update\n question = Question.find(params[:id])\n authorize question\n\n new_version = question.template.generate_version?\n\n old_question_ids = {}\n if new_version\n # get a map from option number to id\n old_number_to_id = {}\n question.question_options.each do |opt|\n old_number_to_id[opt.number] = opt.id\n end\n\n # get a map from question versionable id to old id\n question.template.questions.each do |q|\n old_question_ids[q.versionable_id] = q.id\n end\n end\n\n question = get_modifiable(question)\n\n question_id_map = {}\n if new_version\n # params now out of sync (after versioning) with the question_options\n # so when we do the question.update it'll mess up\n # need to remap params to keep them consistent\n old_to_new_opts = {}\n question.question_options.each do |opt|\n old_id = old_number_to_id[opt.number]\n old_to_new_opts[old_id.to_s] = opt.id.to_s\n end\n\n question.template.questions.each do |q|\n question_id_map[old_question_ids[q.versionable_id].to_s] = q.id.to_s\n end\n end\n\n # rewrite the question_option ids so they match the new\n # version of the question\n # and also rewrite the remove_data question ids\n attrs = question_params\n attrs = update_option_ids(attrs, old_to_new_opts) if new_version && !attrs['question_options_attributes'].nil?\n\n # Need to reattach the incoming annotation's and question_options to the\n # modifiable (versioned) question\n attrs = transfer_associations(attrs, question) if new_version\n\n # If the user unchecked all of the themes set the association to an empty array\n # add check for number present to ensure this is not just an annotation\n attrs[:theme_ids] = [] if attrs[:theme_ids].blank? && attrs[:number].present?\n if question.update(attrs)\n if question.update_conditions(sanitize_hash(params['conditions']),\n old_to_new_opts, question_id_map)\n flash.now[:notice] = success_message(question, _('updated'))\n end\n else\n flash.now[:alert] = flash.now[:alert] = failure_message(question, _('update'))\n end\n if question.section.phase.template.customization_of.present?\n redirect_to org_admin_template_phase_path(\n template_id: question.section.phase.template.id,\n id: question.section.phase.id,\n section: question.section.id\n )\n else\n redirect_to edit_org_admin_template_phase_path(\n template_id: question.section.phase.template.id,\n id: question.section.phase.id,\n section: question.section.id\n )\n end\n end",
"title": ""
},
{
"docid": "df6f528d1b882d5f23686970c3fc7d39",
"score": "0.5990809",
"text": "def update\n @questions_option = QuestionsOption.find(params[:id])\n\n respond_to do |format|\n if @questions_option.update_attributes(params[:questions_option])\n format.html { redirect_to @questions_option, notice: 'Questions option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questions_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45cfb5f3109422186f5f33cc2ca85e20",
"score": "0.59869415",
"text": "def update\n @question = Question.find(params[:id])\n\n # @question.question_type_id = params[:question][:question_type_id]\n # @question.question_category_id = @question.question_type.question_category_id\n\n # authorize! :update, @question\n # @question.question_type_id = params[:question][:question_type_id]\n # @question.question_category_id = @question.question_type.question_category_id\n\n \n # # get fields from the form to update the question's section\n # @question.book = params[:question][:book]\n # @question.chapter = params[:question][:chapter]\n # @question.verse = params[:question][:verse]\n # @question.section_id = @question.set_section\n #---------------------------------------------------------\n \n # # if the the question has been approved, set the approver and the date approved\n # unless params[:question][:approval_level] == nil\n # @question.approved_by = current_user.id\n # @question.approved_on = DateTime.now\n # end\n\t\n @question.update_attributes(params[:question])\n unless @question.approval_level == -1\n respond_with @question\n\tend\n\t\n\t# set the section for this question\n\t#@question.section_id = @question.set_section\n \n # the quesiton is marked as refused, drop from database\n if @question.approval_level == -1\n \t@question.destroy\n destroyed = 1\n redirect_to approve_path, :notice => \"Successfully deleted question\"\n return\n end\n # if @question.update_attributes(params[:question])\n # # determine user and send them to appropriate page\n # if current_user.is_writer?\n # redirect_to write_path, :notice => \"Successfully updated question.\"\n # elsif current_user.is_approver?\n # redirect_to approve_path, :notice => \"Successfully updated question.\"\n # else\n # redirect_to @question, :notice => \"Successfully updated question.\"\n # end\n # else\n # render :action => 'edit'\n # end\n end",
"title": ""
},
{
"docid": "db75479c5e9fdc40d1d25336a7bb861f",
"score": "0.5983014",
"text": "def update\n respond_to do |format|\n if @questionset.update(questionset_params)\n format.html { redirect_to @questionset, notice: 'Questionset was successfully updated.' }\n format.json { render :show, status: :ok, location: @questionset }\n else\n format.html { render :edit }\n format.json { render json: @questionset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6ee0fd28699387d51eef42579ac7619",
"score": "0.59706527",
"text": "def update\n @survey_question.update(survey_question_params)\n @survey_question = SurveyQuestion.new\n @survey_questions = SurveyQuestion.all \n # respond_to do |format|\n # if @survey_question.update(survey_question_params)\n # format.html { redirect_to @survey_question, notice: 'Survey question was successfully updated.' }\n # format.json { render :show, status: :ok, location: @survey_question }\n # else\n # format.html { render :edit }\n # format.json { render json: @survey_question.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "d0e7ac9b377517e772732e2ff6f5f200",
"score": "0.59671617",
"text": "def update\n respond_to do |format|\n if @inquiry_question.update(inquiry_question_params)\n format.html { redirect_to @inquiry_question.business, notice: 'Inquiry question was successfully updated.' }\n format.json { render :show, status: :ok, location: @inquiry_question.business }\n else\n format.html { render :edit }\n format.json { render json: @inquiry_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46b6e3fd1454c3bf0d13689feba01c91",
"score": "0.59603506",
"text": "def update\n authorize_action_for @question\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "803c0071302a85d450d2b9ad505c5cc7",
"score": "0.5957866",
"text": "def update\n @survey = Survey.find(params[:id])\n success = @survey.update_attributes(params[:survey])\n \n puts \"UPDATE: Survey:#{@survey.id} - #{@survey.name}\"\n # Load the JSON Survey form data.\n survey_questions = ActiveSupport::JSON.decode(@survey.survey_data)\n #y survey_questions\n \n update_questions(@survey, survey_questions)\n \n # Render a response.\n respond_to do |format|\n if success\n format.html { redirect_to(@survey, :notice => 'Survey was successfully updated.') }\n format.xml { head :ok }\n format.js { head :ok}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @survey.errors, :status => :unprocessable_entity }\n format.js { render :json => @survey.errors, :status => :error }\n end\n end\n end",
"title": ""
},
{
"docid": "bcdbda2d528db69aea8775e13e5b6382",
"score": "0.59548485",
"text": "def update\n @question = Question.find(params[:id])\n @type = 'Post'\n @top = nil\n if(@question.parentid >0)\n \n @top = Question.find_by_id(@question.parentid)\n @question.headline = '1'\n end\n respond_to do |format|\n if @question.update_attributes(params[:question])\n if(@question.parentid < 1) # if editing a question\n flash[:notice] = 'Question was successfully updated.'\n format.html { redirect_to(question_path(@question.id)) }\n else #If editing an answer\n flash[:notice] = 'Answer was successfully updated.'\n format.html { redirect_to(question_path(@question.parentid)) }\n end\n else\n if @question.headline == '1'\n format.html { render :action => \"editanswer\" }\n else\n format.html { render :action => \"edit\" }\n end\n \n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c21d69cbcd73734f6f2eb6105f21f46b",
"score": "0.59456235",
"text": "def update\n @multiple_choice_question = MultipleChoiceQuestion.find(params[:id])\n\n respond_to do |format|\n if @multiple_choice_question.update_attributes(params[:multiple_choice_question])\n format.html { redirect_to @multiple_choice_question, notice: 'Multiple choice question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @multiple_choice_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "755ec5adfe47a7f589b7c06de00abae6",
"score": "0.5944635",
"text": "def update\n respond_to do |format|\n if @template_question.update(template_question_params)\n format.html { redirect_to @template_question, notice: 'Template question was successfully updated.' }\n format.json { render :show, status: :ok, location: @template_question }\n else\n format.html { render :edit }\n format.json { render json: @template_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a47392fce3a7c9094e3e6f9874f682a",
"score": "0.59406406",
"text": "def update\n @critical_question = CriticalQuestion.find(params[:id])\n\n respond_to do |format|\n if @critical_question.update_attributes(params[:critical_question])\n format.html { redirect_to @critical_question, notice: 'Critical question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @critical_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ccf6447182b3131a3194f094bbace6b6",
"score": "0.59291345",
"text": "def update\n @question = Question.find(params[:id])\n \n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44e232f007c606d7ee824183ec482e43",
"score": "0.59228534",
"text": "def update\n respond_to do |wants|\n if @question.update_attributes(params[:question])\n flash[:notice] = 'Question was successfully updated.'\n wants.html { redirect_to(@question) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50a807d281dcc91fa446f17b05e1600a",
"score": "0.5920248",
"text": "def update\n authorize! :update, @admin_question\n\n respond_to do |format|\n if @admin_question.update(admin_question_params)\n format.html { redirect_to @admin_question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "753506a4bcc8af9e4cfcc404ea0ed659",
"score": "0.5915426",
"text": "def update\n @question = @quiz.questions.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n flash[:notice] = 'Question was successfully updated.'\n format.html { redirect_to(quiz_questions_path(@quiz)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0683f825edf4823b2b6b17118b0cf79d",
"score": "0.59112823",
"text": "def update\n\t\t@question = Question.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @question.update_attributes(params[:question])\n\t\t\t\tformat.html { redirect_to @question, notice: 'Question 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: @question.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "718faa1b1831bac5f69123bced2bd9b8",
"score": "0.0",
"text": "def photo_params\n params.require(:photo).permit(:iptc, :data, :caption, :byline, :sizes, :s3_key)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7497801",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957249",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.6922864",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6894648",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6786758",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.67450184",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682515",
"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.66380686",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66294324",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.662768",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.6562991",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491257",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64791185",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64545095",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64005315",
"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.63839954",
"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.63651323",
"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.6340763",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336921",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6326123",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63204646",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63156325",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.6315594",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.63078135",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.63025755",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.62997544",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6297044",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292996",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292996",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62799454",
"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.62747735",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267526",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256206",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.6255869",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6253548",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6236989",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62287927",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.62287027",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6228029",
"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": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226944",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6201237",
"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.6191959",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6184071",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61811763",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61642146",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.61621594",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.6156416",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.61560374",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.613732",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.6134527",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61210734",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6117956",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6117956",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6113261",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61116403",
"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.61052126",
"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.61052126",
"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.6099496",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6099496",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6086654",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608609",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.6085689",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.607834",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.6075777",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60698164",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677266",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.6067109",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6066692",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60653156",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6064253",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6063467",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60578674",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60511786",
"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.60511786",
"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.60500324",
"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.6047289",
"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.60416925",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60361874",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6032305",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6025675",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6022113",
"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.60209477",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017353",
"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.6015427",
"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.60087335",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60068774",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60068774",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006627",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.6004571",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.60036385",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60023195",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60013676",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60013676",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59998983",
"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.59998983",
"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": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59997034",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.5996126",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5994328",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59936756",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.5991889",
"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.59916514",
"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": ""
}
] |
adf63d15fb6adc6027a5a65594ed477a
|
Generates Markdown or HTML documentation from JSON schema
|
[
{
"docid": "6a837940a185fc361b3c2677981bd218",
"score": "0.5354773",
"text": "def call\n result = self.class.markdown_renderer.result(schema: schema)\n if @html\n result = self.class.html_renderer.result(body: self.class.redcarpet.render(result))\n result.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n result\n end\n end",
"title": ""
}
] |
[
{
"docid": "b6873f1269e3a98b12631797ed5d5a4d",
"score": "0.6333013",
"text": "def show_documentation req, res\n store, path = documentation_source req.path\n\n if_modified_since req, res, store.cache_path\n\n generator = generator_for store\n\n case path\n when nil, '', 'index.html' then\n res.body = generator.generate_index\n when 'table_of_contents.html' then\n res.body = generator.generate_table_of_contents\n when 'js/search_index.js' then\n documentation_search store, generator, req, res\n else\n documentation_page store, generator, path, req, res\n end\n ensure\n res.content_type ||= 'text/html'\n end",
"title": ""
},
{
"docid": "df3a1c610f239cd73c28f41d5161c2a9",
"score": "0.6230242",
"text": "def generate\n print \"Generating documentation...\"\n \n # Require the generator\n require File.dirname(__FILE__) + \"/generators/#{@options[:output_format]}/generator.rb\"\n \n # Generate it!\n generator = DocR::Generator.new(structured_tokens)\n docs = generator.generate\n print \"done.\\n\"\n end",
"title": ""
},
{
"docid": "38a1eed4cd34be2e701551c873e18aae",
"score": "0.6216695",
"text": "def generate_documentation_html\n YARD::Registry.yardoc_file = Dir.mktmpdir('auto_yardoc')\n begin\n YARD::Tags::Library.define_tag('', :request_param, :with_types_and_name)\n YARD::Tags::Library.define_tag('', :request_body, :with_types_and_name)\n YARD::Registry.load([settings.app_file], true)\n template_path = File.join(File.dirname(__FILE__), '../../templates_custom')\n YARD::Templates::Engine.register_template_path(template_path)\n YARD::Templates::Engine.render(:object => YARD::Registry.resolve(nil, self.class.to_s),\n :format => :html)\n ensure\n YARD::Registry.delete_from_disk\n end\n end",
"title": ""
},
{
"docid": "6df0f0f0068efd738d130d2653b1a48a",
"score": "0.6108346",
"text": "def generate_doc\n\n end",
"title": ""
},
{
"docid": "b2a6b1cfd5e2e2bd0a6a60330ea79925",
"score": "0.61043024",
"text": "def call\n markdown = markdown_renderer.result(schema: schema)\n if @html\n html = markdown_parser.render(markdown)\n html = html_renderer.result(body: html)\n html.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n markdown\n end\n rescue Jdoc::Link::ExampleNotFound => exception\n abort(\"Error: #{exception.to_s}\")\n end",
"title": ""
},
{
"docid": "0011ba3bf213065d49fc0f2317d56895",
"score": "0.599602",
"text": "def template(model_name)\n <<~HEREDOC\n {\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {}\n }\n HEREDOC\n end",
"title": ""
},
{
"docid": "f0790f1131e73519213d20b2b017e37b",
"score": "0.59179676",
"text": "def generate_technique_docs!(atomic_yaml, output_doc_path)\n technique = ATTACK_API.technique_info(atomic_yaml.fetch('attack_technique'))\n technique['identifier'] = atomic_yaml.fetch('attack_technique').upcase\n\n template = ERB.new File.read(\"#{File.dirname(File.dirname(__FILE__))}/atomic-red-team/atomic_doc_template.md.erb\"), nil, \"-\"\n generated_doc = template.result(binding)\n\n print \" => #{output_doc_path} => \"\n File.write output_doc_path, generated_doc\n end",
"title": ""
},
{
"docid": "ae5d90bf4420121b2b7cc370229cf1ee",
"score": "0.5896763",
"text": "def generate_technique_docs!(atomic_yaml, output_doc_path)\n technique = ATTACK_API.technique_info(atomic_yaml.fetch('attack_technique'))\n technique['identifier'] = atomic_yaml.fetch('attack_technique').upcase\n\n template = ERB.new File.read(\"#{ATOMIC_RED_TEAM_DIR}/atomic_doc_template.md.erb\"), nil, \"-\"\n generated_doc = template.result(binding)\n\n print \" => #{output_doc_path} => \"\n File.write output_doc_path, generated_doc\n end",
"title": ""
},
{
"docid": "933879e57db8577b12af367de32c27bc",
"score": "0.58307993",
"text": "def what_it_does() \"Generate javadoc to '#{@name}' folder\" end",
"title": ""
},
{
"docid": "e5465e9d2ee5fb7c2e14d3214a8e00ed",
"score": "0.5810468",
"text": "def documentation_page store, generator, path, req, res\n text_name = path.chomp '.html'\n name = text_name.gsub '/', '::'\n\n if klass = store.find_class_or_module(name) then\n res.body = generator.generate_class klass\n elsif page = store.find_text_page(name.sub(/_([^_]*)\\z/, '.\\1')) then\n res.body = generator.generate_page page\n elsif page = store.find_text_page(text_name.sub(/_([^_]*)\\z/, '.\\1')) then\n res.body = generator.generate_page page\n else\n not_found generator, req, res\n end\n end",
"title": ""
},
{
"docid": "2da5b524c6c6371fda84706ce6ed156a",
"score": "0.5772736",
"text": "def build_docs\n object_map.each do |index, objects|\n objects.each do |object|\n template_context = {\n #:meta => Site\n index => object\n }\n content = converter.render(template_map[index], template_context)\n filename = converter.filename_for(object)\n write_output_file(filename, content)\n end\n end\n end",
"title": ""
},
{
"docid": "7ffea928b5b27ccc868d6aa65a5d52c1",
"score": "0.5729172",
"text": "def render_doc_markup_for(code_object)\n docs = docs_for(code_object)\n\n if code_object.command?\n # command '--help' shouldn't use markup highlighting\n docs\n else\n process_comment_markup(docs)\n end\n end",
"title": ""
},
{
"docid": "2f2d5ab0d4174e11cec01114994c5f63",
"score": "0.5616015",
"text": "def generate_index_templates(resource_docs)\n restapi_config = YAML.load(File.read(\"#{config_dir}/restapi_doc.yml\"))\n resource_docs.each { |resource| resource.parse_apidoc }\n template = IO.read(template_dir('index.html.haml'))\n parsed = Haml::Engine.new(template).render(Object.new, :project_info => restapi_config, :resource_docs => resource_docs)\n File.open(temp_dir(\"index.html\"), 'w') { |file| file.write parsed }\n \n # Generate detail files\n resource_docs.each do | resource_doc|\n generate_resource_detail_file!(resource_doc)\n end\n end",
"title": ""
},
{
"docid": "78b31237336743607ac455f72e011ec6",
"score": "0.5615375",
"text": "def generate(site)\n\n # page_gen_dirs determines whether we want to generate index pages\n # (name/index.html) or standard files (name.html). This information\n # is passed to the DataPage constructor, which sets the @dir variable\n # as required by this directive\n\n index_files = site.config['page_gen-dirs'] == true\n\n # data contains the specification of the data for which we want to generate\n # the pages (look at the README file for its specification)\n data = site.config['page_gen']\n types = site.config['data_types']\n if data\n data.each do |data_spec|\n # template = data_spec['template'] || data_spec['data']\n name = data_spec['name']\n # dir = data_spec['dir'] || data_spec['data']\n # Added 2 lines: Set context and type for JSON-LD \n context = data_spec['context'] || \"http://schema.org/\"\n # type = data_spec['type'] || \"Thing\"\n extension = data_spec['extension'] || \"html\"\n\n # records is the list of records defined in _data.yml\n # for which we want to generate different pages\n records = nil\n data_spec['data'].split('.').each do |level|\n if records.nil?\n records = site.data[level]\n else\n records = records[level]\n end\n end\n records.each do |record|\n # Added 3 lines: Add context and type for JSON-LD to each record\n collection = record[\"collection\"]\n dir = types[collection][\"dir\"] || collection\n template = types[collection][\"template\"]\n type = types[collection][\"type\"]\n record[\"@context\"] = context\n record[\"data\"][\"@type\"] = type\n record[\"data\"][\"name\"] = record[\"name\"]\n site.pages << DataPage.new(site, site.source, index_files, dir, record, name, template, extension)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c7f3087925a9f06f430a6593a93c19a3",
"score": "0.559931",
"text": "def fulldoc_template; end",
"title": ""
},
{
"docid": "24713ff3767c582567b5c61d6e312976",
"score": "0.55980957",
"text": "def documentation_html\n @documentation_html ||= generate_documentation_html\n end",
"title": ""
},
{
"docid": "cd948a8ef8328e4c8b160d2b587f9a17",
"score": "0.55797803",
"text": "def generate_doc(resource_docs)\n generate_index_templates(resource_docs)\n copy_assets!\n end",
"title": ""
},
{
"docid": "b5d0c548a28911de27d9ecc6e2b0a2b9",
"score": "0.55649674",
"text": "def exec_doc\n output = File.join('doc', 'rdoc')\n title = (PACKAGE.capitalize + \" API\").strip\n main = Dir.glob(\"README{,.txt}\", File::FNM_CASEFOLD).first\n template = config.doctemplate || 'html'\n\n opt = []\n opt << \"-U\"\n opt << \"-S\"\n opt << \"--op=#{output}\"\n opt << \"--template=#{template}\"\n opt << \"--title=#{title}\"\n opt << \"--main=#{main}\" if main\n\n if File.exist?('.document')\n files = File.read('.document').split(\"\\n\")\n files.reject!{ |l| l =~ /^\\s*[#]/ || l !~ /\\S/ }\n files.collect!{ |f| f.strip }\n opt << files\n else\n opt << main if main\n opt << [\"lib\", \"ext\"]\n end\n\n opt = opt.flatten\n\n if no_harm?\n puts \"rdoc \" + opt.join(' ').strip\n else\n #sh \"rdoc {opt.join(' ').strip}\"\n require 'rdoc/rdoc'\n ::RDoc::RDoc.new.document(opt)\n end\n end",
"title": ""
},
{
"docid": "c1c2b1d883a08c8a73c203dc8313f434",
"score": "0.55616283",
"text": "def genDocs(docs)\n docs.each_key{ |t|\n yield \"#{DOC} #{t}\"\n d = docs[t]\n yield d.text\n yield END_KW\n }\n end",
"title": ""
},
{
"docid": "c05c25d008be36ce701c1e318e261fba",
"score": "0.5557215",
"text": "def doc( path )\n get \"#{path}.html\" do\n password_protected!\n \n endpoint = path.split('/').last\n \n template_path = File.join( VIEW_PATH, \"#{endpoint}.md\" )\n rendered = GitHub::Markup.render( template_path )\n\n erb :layout, :locals => { :content => rendered }\n end\nend",
"title": ""
},
{
"docid": "0952e6d5a8ce4008ba11bab3f571c4ae",
"score": "0.55489653",
"text": "def schema_generator\n JSON::SchemaGenerator\n end",
"title": ""
},
{
"docid": "420072c8ccf0bf89c1059192c2b450c2",
"score": "0.55263376",
"text": "def generate(options = {})\n embed_outline(options[:selflink]) if options[:outline]\n\n #if options[:dirmap]\n # md_dir = Pathname.new(@md_file).dirname.expand_path\n # embed_sidebar( Madowu::DirectoryMapper.dirmap(md_dir) )\n #end\n\n if options[:sidebar]\n #lines = File.open( options[:sidebar], \"r\").readlines\n lines = `#{@markdown} #{options[:sidebar]}`.split(\"\\n\")\n embed_sidebar(lines)\n end\n\n result = [\n make_header(options[:css], options[:charset]),\n @markup_lines,\n \"</div></div></body></html>\",\n ''\n ].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "1e14c6be4eb3537a85f518455bb670be",
"score": "0.55236316",
"text": "def index\n if request.format.html?\n api_canon_docs\n else\n super\n end\n end",
"title": ""
},
{
"docid": "7bdda5bb6c60eeb9c2b9e09545be4732",
"score": "0.5513837",
"text": "def link_documentation; end",
"title": ""
},
{
"docid": "d119e205d8887225d070021b3ce46de8",
"score": "0.55124766",
"text": "def docs; end",
"title": ""
},
{
"docid": "e9946c5f6d6a83f558ffbfbb4bb63ea5",
"score": "0.55106586",
"text": "def initialize(app, path: nil, schema: nil)\n @app = app\n @path = path\n @markdown = Jdoc::Generator.call(schema)\n @html = Jdoc::Generator.call(schema, html: true)\n end",
"title": ""
},
{
"docid": "57602b6f794f19078008f024e462b64c",
"score": "0.5506636",
"text": "def minimal_doc_block(prop, config, spaces)\n [\n minimal_yaml(prop, spaces),\n indent([\n \"required: #{prop.required ? 'true' : 'false'}\",\n (\"type: bool\" if prop.is_a? Api::Type::Boolean),\n (\"aliases: [#{config['aliases'][prop.name].join(', ')}]\" \\\n if config['aliases']&.keys&.include?(prop.name)),\n (if prop.is_a? Api::Type::Enum\n [\n 'choices:',\n \"[#{prop.values.map { |x| quote_string(x.to_s) }.join(', ')}]\"\n ].join(' ')\n end)\n ].compact, 4)\n ]\n end",
"title": ""
},
{
"docid": "66759731fe716db20dd30fbc1e94e8f6",
"score": "0.55011576",
"text": "def docufy(src,i)\n m = /RM_[A-z0-9]+/.match(src[i])\n name = m[0]\n name = name.sub(\"RM_\",\"RedisModule_\")\n proto = src[i].sub(\"{\",\"\").strip+\";\\n\"\n proto = proto.sub(\"RM_\",\"RedisModule_\")\n proto = linebreak_proto(proto, \" \");\n # Add a link target with the function name. (We don't trust the exact id of\n # the generated one, which depends on the Markdown implementation.)\n puts \"<span id=\\\"#{name}\\\"></span>\\n\\n\"\n puts \"### `#{name}`\\n\\n\"\n puts \" #{proto}\\n\"\n puts \"**Available since:** #{$since[name] or \"unreleased\"}\\n\\n\"\n comment = \"\"\n while true\n i = i-1\n comment = src[i]+comment\n break if src[i] =~ /\\/\\*/\n end\n comment = markdown(comment)\n puts comment+\"\\n\\n\"\nend",
"title": ""
},
{
"docid": "f550e05c4833eed7b9a5d09ad0fef379",
"score": "0.5499297",
"text": "def generate_technique_execution_docs!(atomic_yaml, output_doc_path)\n FileUtils.mkdir_p File.dirname(output_doc_path)\n\n technique = ATTACK_API.technique_info(atomic_yaml.fetch('attack_technique'))\n technique['identifier'] = atomic_yaml.fetch('attack_technique').upcase\n\n template = ERB.new File.read(\"#{File.dirname(File.dirname(__FILE__))}/atomic-red-team/atomic_execution_template.html.erb\"), nil, \"-\"\n generated_doc = template.result(binding)\n\n print \" => #{output_doc_path} => \"\n File.write output_doc_path, generated_doc\n end",
"title": ""
},
{
"docid": "0f7d7bf907159968cdd631e81953d2a0",
"score": "0.54702055",
"text": "def generate_technique_execution_docs!(atomic_yaml, output_doc_path)\n FileUtils.mkdir_p File.dirname(output_doc_path)\n\n technique = ATTACK_API.technique_info(atomic_yaml.fetch('attack_technique'))\n technique['identifier'] = atomic_yaml.fetch('attack_technique').upcase\n\n template = ERB.new File.read(\"#{ATOMIC_RED_TEAM_DIR}/atomic_execution_template.html.erb\"), nil, \"-\"\n generated_doc = template.result(binding)\n\n print \" => #{output_doc_path} => \"\n File.write output_doc_path, generated_doc\n end",
"title": ""
},
{
"docid": "464b5c5676f8f72efdbd4beb9145c6ce",
"score": "0.5463073",
"text": "def create_docs\n directory 'templates/docs', 'docs'\nend",
"title": ""
},
{
"docid": "f15dbe0a7445d2199e925afda2a7648a",
"score": "0.54537356",
"text": "def documentation(text)\n @response_schema.documentation = text\n end",
"title": ""
},
{
"docid": "46d15a20e0cba89413314ea5489175bd",
"score": "0.54322344",
"text": "def generate_document_structure; build_document_hash end",
"title": ""
},
{
"docid": "00f509c405f594415fcbb281860f5f66",
"score": "0.5427817",
"text": "def html_markup_rdoc(text); end",
"title": ""
},
{
"docid": "f971ba0ad9d6265c32f439d951e2b6b5",
"score": "0.5427339",
"text": "def design_docs\n req = make_http_request(\"/pools/default/buckets/#{bucket}/ddocs\",\n :type => :management, :extended => true)\n docmap = {}\n req.on_body do |body|\n res = MultiJson.load(body.value)\n res[\"rows\"].each do |obj|\n if obj['doc']\n obj['doc']['value'] = obj['doc'].delete('json')\n end\n doc = DesignDoc.wrap(self, obj)\n key = doc.id.sub(/^_design\\//, '')\n next if self.environment == :production && key =~ /dev_/\n docmap[key] = doc\n end\n yield(docmap) if block_given?\n end\n req.continue\n async? ? nil : docmap\n end",
"title": ""
},
{
"docid": "23e87b398ecfcc93030fe95f883cfb54",
"score": "0.5393538",
"text": "def add_empty_json_ld_schema(edited_document, schema, schema_name, schema_type, yaml) #:nodoc\r\n data = {}\r\n doc = DcJsonLd.new\r\n doc.name = schema_name\r\n doc.type = schema_type\r\n \r\n edited_document.dc_json_lds << doc\r\n schema.each do |element_name, element|\r\n next if element_name == 'level' # skip level element\r\n if yaml[element['type']]\r\n if element['n'].to_s == '1'\r\n # single element\r\n doc_1 = yaml[element['type'] ]\r\n data[element_name] = doc_1\r\n else\r\n # array\r\n add_empty_json_ld_schema(doc, yaml[element['type']], element_name, element['type'], yaml)\r\n end\r\n else\r\n data[element_name] = element['text']\r\n end\r\n end\r\n doc.data = data.to_yaml\r\n doc.save\r\nend",
"title": ""
},
{
"docid": "d91927277076af6571fb76469be54eb7",
"score": "0.53858703",
"text": "def to_html\n require 'mustache'\n template = File.read(__dir__ + '/app_documentation_tpl.mustache')\n Mustache.render(template, :html_fragment => to_html_fragment)\n end",
"title": ""
},
{
"docid": "5434023e97d84ea8b0ea0b062cf6b832",
"score": "0.53840095",
"text": "def copy_api_docs_starterkit\n log :copy_api_docs_starterkit, \"\"\n\n mkdir_p \"doc\"\n\n template \"doc/api_doc.mkd.erb\",\n 'doc/api.markdown',\n force: true\n end",
"title": ""
},
{
"docid": "def3944aa36e1480e82214659adcab4c",
"score": "0.5377299",
"text": "def html_markup_asciidoc(text); end",
"title": ""
},
{
"docid": "c4d5d07975ef934c423e0e222347d3ac",
"score": "0.5374658",
"text": "def postprocess(json_schema); json_schema; end",
"title": ""
},
{
"docid": "0b60ae0e1bc1adc745d35449a3731ddd",
"score": "0.53667074",
"text": "def generate_all_the_docs!\n oks = []\n fails = []\n\n ATOMIC_RED_TEAM.atomic_tests.each do |atomic_yaml|\n begin\n print \"Generating docs for #{atomic_yaml['atomic_yaml_path']}\"\n generate_technique_docs! atomic_yaml, atomic_yaml['atomic_yaml_path'].gsub(/.yaml/, '.md')\n # generate_technique_execution_docs! atomic_yaml, \"#{File.dirname(File.dirname(__FILE__))}/atomic-red-team-execution/#{atomic_yaml['attack_technique'].downcase}.html\"\n\n oks << atomic_yaml['atomic_yaml_path']\n puts \"OK\"\n rescue => ex\n fails << atomic_yaml['atomic_yaml_path']\n puts \"FAIL\\n#{ex}\\n#{ex.backtrace.join(\"\\n\")}\"\n end\n end\n puts\n puts \"Generated docs for #{oks.count} techniques, #{fails.count} failures\"\n generate_attack_matrix! \"#{File.dirname(File.dirname(__FILE__))}/atomics/matrix.md\"\n generate_index! \"#{File.dirname(File.dirname(__FILE__))}/atomics/index.md\"\n \n return oks, fails\n end",
"title": ""
},
{
"docid": "e02917400af7490865922171ffde946a",
"score": "0.5346356",
"text": "def doc()\n buffer = ''\n descr_mapping = {}\n\n buffer += '## Available Methods :\\n\\n'\n buffer += 'This GEM wraps the following SOLIDserver API calls, allowing you to interract with SOLIDserver DDI solution.\\n'\n\n begin\n @servicemapper.each do |service_name, service_mapped|\n buffer += '\\n### Method - #{service_name}\\n'\n rest_answer = RestClient::Request.execute(\n url: sprintf('%s/%s', @resturl, service_mapped[0]),\n accept: 'application/json',\n method: 'options',\n timeout: @timeout,\n verify_ssl: @sslcheck,\n headers: {\n 'X-IPM-Username' => @username,\n 'X-IPM-Password' => @password\n }\n )\n\n first_input = true\n first_output = true\n\n JSON.parse(rest_answer.body).each do |item|\n if (item.has_key?('description'))\n buffer += 'Description\\n\\n'\n buffer += '\\t#{@servicemapper[service_name.to_s][1]}\\n'\n end\n\n if (item.has_key?('mandatory_addition_params') && service_name.match(/_add$/))\n buffer += '\\nMandatory Parameters\\n\\n'\n buffer += '\\t' + item['mandatory_addition_params'].gsub('&&', '+').gsub('||','|') + '\\n'\n end\n\n if (item.has_key?('mandatory_edition_params') && service_name.match(/_update$/))\n buffer += '\\nMandatory Parameters\\n\\n'\n buffer += '\\t' + item['mandatory_edition_params'].gsub('&&', '+').gsub('||','|') + '\\n'\n end\n\n if (item.has_key?('mandatory_params'))\n buffer += '\\nMandatory Parameters\\n\\n'\n buffer += '\\t' + item['mandatory_params'].gsub('&&', '+').gsub('||','|') + '\\n'\n end\n\n if (item.has_key?('param_type'))\n if (item['param_type'] == 'in')\n if (first_input == true)\n buffer += '\\nAvailable Input Parameters :\\n\\n'\n first_input = false\n end\n\n if (item['name'] == 'WHERE')\n buffer += '\\t* where - Can be used to filter the result using any output field in an SQL fashion.\\n'\n elsif (item['name'] == 'ORDERBY')\n buffer += '\\t* orderby - Can be used to order the result using any output field in an SQL fashion.\\n'\n else\n descr_key = service_name[/^(ip|vlm|dns)/]\n if (item.has_key?('descr'))\n descr_mapping[descr_key.to_s + '_' + item['name']] = item['descr']\n end\n if !(item.has_key?('descr') && item['name'].match(/^no_usertracking/))\n buffer += '\\t* ' + item['name'] + (item.has_key?('descr') ? ' - ' + item['descr'] : '') + '\\n'\n end\n end\n else\n if (first_output == true)\n buffer += '\\nAvailable Output Fields :\\n\\n'\n first_output = false\n end\n\n descr_key = service_name[/^(ip|vlm|dns)/]\n\n if (item.has_key?('descr'))\n descr_mapping[descr_key.to_s + '_' + item['name']] = item['descr']\n else\n if (descr_mapping.has_key?(descr_key.to_s + '_' + item['name']))\n item['descr'] = descr_mapping[descr_key + '_' + item['name']]\n end\n end\n buffer += '\\t* ' + item['name'] + (item.has_key?('descr') ? ' - ' + item['descr'] : '') + '\\n'\n end\n end\n end\n end\n\n return(buffer)\n rescue RestClient::ExceptionWithResponse => rest_error\n raise SOLIDserverError.new('SOLIDserver REST call error : - TEST')\n end\n end",
"title": ""
},
{
"docid": "1f9ce9a92cd42ff2dd34bc582adebc12",
"score": "0.5320072",
"text": "def generate_all_the_docs!\n oks = []\n fails = []\n\n ATOMIC_RED_TEAM.atomic_tests.each do |atomic_yaml|\n begin\n print \"Generating docs for #{atomic_yaml['atomic_yaml_path']}\"\n generate_technique_docs! atomic_yaml, atomic_yaml['atomic_yaml_path'].gsub(/.yaml/, '.md')\n # generate_technique_execution_docs! atomic_yaml, \"#{File.dirname(File.dirname(__FILE__))}/atomic-red-team-execution/#{atomic_yaml['attack_technique'].downcase}.html\"\n\n oks << atomic_yaml['atomic_yaml_path']\n puts \"OK\"\n rescue => ex\n fails << atomic_yaml['atomic_yaml_path']\n puts \"FAIL\\n#{ex}\\n#{ex.backtrace.join(\"\\n\")}\"\n end\n end\n puts\n puts \"Generated docs for #{oks.count} techniques, #{fails.count} failures\"\n generate_attack_matrix! 'All', \"#{File.dirname(File.dirname(__FILE__))}/atomics/matrix.md\"\n generate_attack_matrix! 'Windows', \"#{File.dirname(File.dirname(__FILE__))}/atomics/windows-matrix.md\", only_platform: /windows/\n generate_attack_matrix! 'macOS', \"#{File.dirname(File.dirname(__FILE__))}/atomics/macos-matrix.md\", only_platform: /macos/\n generate_attack_matrix! 'Linux', \"#{File.dirname(File.dirname(__FILE__))}/atomics/linux-matrix.md\", only_platform: /^(?!windows|macos).*$/\n\n generate_index! 'All', \"#{File.dirname(File.dirname(__FILE__))}/atomics/index.md\"\n generate_index! 'Windows', \"#{File.dirname(File.dirname(__FILE__))}/atomics/windows-index.md\", only_platform: /windows/\n generate_index! 'macOS', \"#{File.dirname(File.dirname(__FILE__))}/atomics/macos-index.md\", only_platform: /macos/\n generate_index! 'Linux', \"#{File.dirname(File.dirname(__FILE__))}/atomics/linux-index.md\", only_platform: /^(?!windows|macos).*$/\n \n return oks, fails\n end",
"title": ""
},
{
"docid": "fd4da23d9caead27a9aaab79456d5a57",
"score": "0.5318702",
"text": "def visual_guidelines\n kit_examples = {}\n Dir.glob(Rails.root.join(\"app/views/pages/code_snippets/*.txt\")).each do |example_path|\n example_txt = File.read(example_path)\n formatted_example_txt = render_code(example_txt, \"react\")\n kit_examples[example_path.split(\"/\").last.sub(\".txt\", \"\")] = formatted_example_txt\n end\n @kit_examples_json = kit_examples\n render \"pages/visual_guidelines\"\n end",
"title": ""
},
{
"docid": "b3d4af80dcd8bcdfbd9805f7e896687b",
"score": "0.53047943",
"text": "def initialize(options = {})\n @format = options[:format] || :text\n @images = []\n @tables = []\n\n # Look for and load any special files\n if options[:markdown_file]\n options[:slug] ||= options[:markdown_file].gsub(/.md$/, \"\").to_slug.normalize.to_s\n\n # Will throw on error\n options[:content] ||= File.read(options[:markdown_file])\n\n @format = :markdown\n end\n\n # In case we don't have any content... default to empty\n options[:content] ||= \"\"\n\n # Grab metadata from content\n match = options[:content].match(/^---$(.*?)^---$(.*)/m)\n\n unless match.nil?\n meta_data = match[1].strip\n options[:content] = match[2].strip\n\n meta_data = YAML.load(meta_data)\n\n options[:title] ||= meta_data[\"title\"]\n options[:authors] ||= meta_data[\"authors\"]\n options[:scripts] ||= meta_data[\"scripts\"]\n options[:summary] ||= meta_data[\"summary\"]\n options[:language] ||= meta_data[\"language\"]\n options[:index] = meta_data[\"index\"] if meta_data[\"index\"]\n end\n\n options[:language] ||= \"en_us\"\n options[:index] ||= \"\"\n\n case @format\n when :markdown\n renderer = Gutenberg::MarkdownRenderer.new(options[:slug],\n options[:title],\n options[:language],\n options[:style],\n options[:index])\n markdown = Redcarpet::Markdown.new(renderer, :fenced_code_blocks => true)\n\n @html = markdown.render(options[:content])\n @outline = renderer.outline;\n\n # Replace references\n @html.gsub! /<p>(.*?)<\\/p>/ do\n s = $1.gsub /\\@\\[([^\\]]+)\\]/ do\n data = renderer.lookup($1)\n if data\n \"<a href='##{data[:slug]}'>#{data[:full_index]}</a>\"\n else\n $&\n end\n end\n \"<p>#{s}</p>\"\n end if @html\n\n # title can be inferred from markdown\n options[:title] = options[:title] || renderer.title\n\n if renderer.title.nil? && options[:title]\n @html = \"<h1 id='#{renderer.outline.slug}'>#{options[:title]}</h1>#{@html}\"\n end\n\n # Get the image list\n @images = renderer.images\n\n # Get the table list\n @tables = renderer.tables\n when :html\n @html = @content\n else\n @html = \"<pre>#{@content}</pre>\"\n end\n\n @title = options[:title] || \"Untitled\"\n @authors = options[:authors] || []\n @slug = options[:slug] || \"chapter\"\n @content = options[:content] || \"\"\n @language = options[:language]\n @index = options[:index]\n end",
"title": ""
},
{
"docid": "370b4856ce1ce78f91e631d3f7dc4e2a",
"score": "0.52941614",
"text": "def getToolsDocs( object, format)\n params = Hash.new\n params['object'] = object\n params['format'] = format\n return doCurl(\"get\",\"/tools/docs\",params)\n end",
"title": ""
},
{
"docid": "6f6234e3a44733fc5a1a24900d57836e",
"score": "0.5281407",
"text": "def great_job\n report = RDoc::Markup::Document.new\n\n report << RDoc::Markup::Paragraph.new('100% documentation!')\n report << RDoc::Markup::Paragraph.new('Great Job!')\n\n report\n end",
"title": ""
},
{
"docid": "e0306663509914ab48219ee9ddbda49d",
"score": "0.5276601",
"text": "def output_documentation_debugging\n\t\tsummary = self.extract_summary\n\t\tdescription = self.extract_description\n\t\thomepage = self.extract_homepage || DEFAULT_HOMEPAGE\n\n\t\tself.prompt.say( \"Documentation\", color: :bright_green )\n\t\tself.prompt.say( \"Authors:\" )\n\t\tself.authors.each do |author|\n\t\t\tself.prompt.say( \" • \" )\n\t\t\tself.prompt.say( author, color: :bold )\n\t\tend\n\t\tself.prompt.say( \"Summary: \" )\n\t\tself.prompt.say( summary, color: :bold )\n\t\tself.prompt.say( \"Description:\" )\n\t\tself.prompt.say( \" \" + description, color: :bold )\n\t\tself.prompt.say( \"Homepage:\" )\n\t\tself.prompt.say( \" \" + homepage, color: :bold )\n\t\tself.prompt.say( \"\\n\" )\n\tend",
"title": ""
},
{
"docid": "dbebdf053d207e2d161859c190769535",
"score": "0.5274858",
"text": "def index\n page_title \"View all things\"\n @things = Thing.all\n\n @things.each do |thing|\n # TODO: make this into a helper\n thing.description = thing.description[0..500]\n\n # stop at the end of the first paragraph\n thing.description = thing.description.split(\"\\r\\n\\r\\n\")\n thing.description = thing.description[0]\n\n # remove the last word (fragment)\n thing.description = thing.description.split(\" \")\n thing.description = thing.description[0..-1]\n thing.description = thing.description.join(\" \")\n thing.description = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true).render(thing.description)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @things }\n end\n end",
"title": ""
},
{
"docid": "760e26f34561cc90eeba0047d65d4eb4",
"score": "0.52278787",
"text": "def generate_html\n # the individual descriptions for files and classes\n gen_into(@files)\n gen_into(@classes)\n # and the index files\n gen_file_index\n gen_class_index\n gen_method_index\n gen_main_index\n\n # this method is defined in the template file\n write_extra_pages if defined? write_extra_pages\n end",
"title": ""
},
{
"docid": "bc1b121298e923321fdf6a95174823fc",
"score": "0.5223316",
"text": "def show\n respond_with(@schema) do |format|\n format.json { render json: @schema.to_json }\n end\n end",
"title": ""
},
{
"docid": "cc2b4df3fa7a585c57fed61d80d52b79",
"score": "0.52220887",
"text": "def resolveDoxygen(schema, name)\n doxygenId = get_page(name)\n unless doxygenId.empty?\n schema[\"api\"] = doxygenId\n end\n end",
"title": ""
},
{
"docid": "2d5d424471c7d0ffafa0dd2dfe79d7a8",
"score": "0.5213344",
"text": "def render\n ::JSON::SchemaDsl::Renderer.new(self).render\n end",
"title": ""
},
{
"docid": "4a55aa13644133c36adf762647aec1f8",
"score": "0.5208342",
"text": "def describe\n columns = ask_for_fields\n name = extract_option('--name') || ask(\"Enter the dataset name\")\n output = extract_option('--output') || ask(\"Enter path to the file where to save the model description\", :default => \"#{name}.json\")\n open output, 'w' do |f|\n f << JSON.pretty_generate( :title => name, :columns => columns ) + \"\\n\"\n f.flush\n end\n end",
"title": ""
},
{
"docid": "a79d75eeab6fa91a74bfc34c41bc70bc",
"score": "0.52040046",
"text": "def document(file_name)\n origin = File.open(\"#{file_name}\",'r')\n docs = File.open(\"docs/doc-#{file_name.split('/')[-1]}.html\",'w')\n comment = true\n script = Script.new(file_name)\n \n # Need to refactor this into some form of a rules engine. It's getting a bit hairy\n str = origin.each_line.inject(\"\") do |str, line|\n # Skip if it's a shebang\n if line =~ /^ *#!/\n str << \"\"\n \n # Blank Comment line, insert newline\n elsif line =~ /^ *# *$/\n comment = true\n str << \"\\n\"\n \n # Evaluate as text if it's a comment with spaces prior\n elsif line =~ /^ *#/\n str << \"\\n\" unless comment \n comment = true\n \n # Find the meta-information in the comments and harvest it\n if line.include? '**Author**'\n script.author = line.gsub(/^.*: /,'').chomp\n elsif line.include? '**Description**'\n script.description = line.gsub(/^.*: /,'').chomp\n elsif line.include? '**Usage**'\n script.usage = line.gsub(/^.*: /,'').chomp\n elsif line.include? '**Type**'\n script.type = line.gsub(/^.*: /,'').chomp\n end\n \n str << \"#{line.gsub(/^ *# /,'')}\"\n \n # Find the Gems used\n elsif line =~ /^ *require /\n gemname = line.gsub(/^ *require /,'').delete(\"'\").delete('\"').gsub('/','-').chomp\n # Don't add it unless it's not there or it's an absolute path\n unless ($gems.include? gemname) or (gemname =~ /^[A-Za-z]\\:/)\n $gems << gemname\n end\n \n str << \"\\n\" if comment \n comment = false\n str << \" #{line}\"\n # Evaluate as a code block if it's code\n else\n str << \"\\n\" if comment \n comment = false\n str << \" #{line}\"\n end\n end\n \n # Add the current script to the collection for indexing\n $scripts << script\n \n # The following outputs a complete documentation for each and every single script that's in the directory. Very useful if you remember to type them out properly, otherwise you get to spend a few hours fixing it. Do it right the first time, trust me.\n \n # Headers and style information\n docs.puts \"<html>\"\n docs.puts \"<link rel='stylesheet' type='text/css' href='style.css' />\"\n docs.puts \"<body>\"\n \n docs.puts \"<a href='index.html'>( << Back to Index )</a>\"\n \n # Insert the string into the docs\n docs.puts GitHub::Markdown.render(str)\n \n docs.puts \"<a href='index.html'>( << Back to Index )</a>\"\n docs.puts \"</body></html>\"\nend",
"title": ""
},
{
"docid": "aff3b053e1d540aaa5b42c447d26ebe1",
"score": "0.5202715",
"text": "def docs api\n\t\tget_html \"#{@options[:docs]}/#{@apis[api][:url]}.htm\"\n\tend",
"title": ""
},
{
"docid": "42b34947fb818b7a8aeed14301402229",
"score": "0.5202066",
"text": "def generate_schema_list\n puts \"GENERATE SCHEMA LIST\"\n # load all the features from the Registry\n @items = Registry.all(:schema).sort { |a,b| a.name.downcase <=> b.name.downcase }\n\n @list_title = \"Schema List\"\n @list_type = \"schema\"\n\n # optional: the specified stylesheet class\n # when not specified it will default to the value of @list_type\n @list_class = \"schema\"\n\n # Generate the full list html file with named feature_list.html\n # @note this file must be match the name of the type\n asset('schema_list.html', erb(:full_list))\nend",
"title": ""
},
{
"docid": "fe858870b146ba0670912d6eaf5167e0",
"score": "0.51978093",
"text": "def get_document_schema\n filePath = Rails.root.join(\"lib\", \"base_truevault_doc.json\")\n file = File.read(filePath)\n schema = JSON.parse(file).with_indifferent_access\n end",
"title": ""
},
{
"docid": "2e86ed03fd518c9d7ac888f79c7bd5a5",
"score": "0.51942325",
"text": "def prepare_doc(req, json)\n var = requestor(req, json)\n parse var.body\n end",
"title": ""
},
{
"docid": "01d742befc7cc491a94f48f9fd5b4fd3",
"score": "0.519255",
"text": "def docs_for(code_object)\n if code_object.module_with_yard_docs?\n # yard docs\n code_object.yard_doc\n else\n # normal docs (i.e comments above method/module/command)\n code_object.doc\n end\n end",
"title": ""
},
{
"docid": "d9a6ea5973d07d7af93b727f42c0e838",
"score": "0.5187122",
"text": "def test_example_body\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n link = schema.resource('resource').link('create')\n assert_equal({'date_field' => '2013-10-19 22:10:29Z',\n 'string_field' => 'Sample text.',\n 'boolean_field' => true,\n 'uuid_field' => '44724831-bf66-4bc2-865f-e2c4c2b14c78',\n 'email_field' => 'username@example.com'},\n link.example_body)\n end",
"title": ""
},
{
"docid": "e34169675e0f6a037b144da79d8d2d5c",
"score": "0.5185424",
"text": "def generate_html\n @main_url = main_url\n @sorted_files = @files.sort\n @sorted_classes = @classes.sort\n @sorted_methods = RDoc::Generator::Method.all_methods.sort\n\n # the individual descriptions for files and classes\n gen_into(@files)\n gen_into(@classes)\n\n # and the index files\n gen_file_index\n gen_class_index\n gen_method_index\n gen_main_index\n\n # this method is defined in the template file\n values = {\n :title_suffix => CGI.escapeHTML(\"[#{@options.title}]\"),\n :charset => @options.charset,\n :style_url => style_url('', @options.css),\n }\n\n @template.write_extra_pages(values) if\n @template.respond_to?(:write_extra_pages)\n end",
"title": ""
},
{
"docid": "d4147447e9d2fcdd1b71ded0c0dd1c61",
"score": "0.51826286",
"text": "def api_html page\n <<-STR\n<html>\n <head>\n <title>#{self.class} Api Documentation</title>\n <style>\n#{API_CSS}\n </style>\n </head>\n <body class=\"indexpage\">\n <div>\n #{RDoc::Markup::ToHtml.new.convert page.to_s}\n </div>\n </body>\n</html>\n STR\n end",
"title": ""
},
{
"docid": "7de25e220167a571b369572f6e8bda71",
"score": "0.5182324",
"text": "def generate_description\n text, _ = parse_description\n parts = []\n parts << text if text.length > 0\n parts << JSON.generate(config) if config && config.length > 0\n parts.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "78d799674509c5773f963c2720ff6084",
"score": "0.51734626",
"text": "def to_markdown\n str = <<-EOS\n# #{name} drop\n\n#{info}\n\n#{example.try(:to_markdown)}\n\n## Methods\n#{methods.map(&:to_markdown).join(\"\\n\\n\")}\n\n-----------\n EOS\n\n str.gsub(/<model>/,name.underscore)\n end",
"title": ""
},
{
"docid": "ede4dabe9232e4805435271f88ee9a22",
"score": "0.5170339",
"text": "def generate(obj, path = nil)\n y = JSON.pretty_generate(obj)\n File.open(path, 'w') { |fh| fh.print y } unless path.nil?\n y\n end",
"title": ""
},
{
"docid": "2d5afdc58cd74691c8f1f3defa37546d",
"score": "0.516164",
"text": "def process_pages\n bindings = {\n :name => @definition.get_name,\n :version => @definition.get_version\n }\n\n page = Calamum::DocGenerator.new(:view)\n @definition.resources.each do |methods|\n methods[1].each do |resource|\n bindings.merge!(:resource => resource)\n filename = \"#{resource.slug}.html\"\n page.save_template(filename, bindings)\n end\n end\n end",
"title": ""
},
{
"docid": "0a128370cf72c4dbc463ff3590a9a9bd",
"score": "0.51554155",
"text": "def test_description\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n assert_equal('Show all sample resources',\n schema.resource('resource').link('list').description)\n end",
"title": ""
},
{
"docid": "8f61a206094a564c9cd18ca20ed686df",
"score": "0.5155064",
"text": "def documentation\n @docotype = params[:docotype]\n if @docotype.blank?\n flash[:error] = 'Documentation type must be specified. Redirected to default documentation. If you arrived here from a bookmark or link, please update.'\n redirect_to :action => 'documentation', :docotype => 'text'\n return\n else\n @doco_elements = Doco.build_doco(@docotype)\n end\n end",
"title": ""
},
{
"docid": "e6fae026b4c373275bf661166b4241b4",
"score": "0.5154933",
"text": "def generate(pdf, technical_skills)\n heading, content = technical_skills.values_at(:heading, :content)\n Entry::Heading.generate(pdf, heading)\n generate_table(pdf, content)\n end",
"title": ""
},
{
"docid": "3e462e270daf309f80cfa0edafeb509e",
"score": "0.5142744",
"text": "def angular_scaffold\n object = get_stdin(\"What is the Object name to scaffold? \")\n puts \"Describe your structure like a model generation :\\nnom:string description:text prix:decimal rdv:date validation:boolean heure:time creation:datetime\"\n parameters = get_stdin(\"What's the structure of the object? \")\n system \"rails generate angular_scaffold #{object} #{parameters}\"\nend",
"title": ""
},
{
"docid": "474f84f28b4ddb0b04d4c66cb2dffc90",
"score": "0.51414657",
"text": "def new\n @doc_type_am_configuration = DocTypeAmConfiguration.new\n\n @doc_type_am_configuration.structural_markup_enabled = true\n @doc_type_am_configuration.structural_markup_extension_whole_document = true\n @doc_type_am_configuration.structural_markup_depth_all = true\n @doc_type_am_configuration.semantic_markup_enabled = true\n @doc_type_am_configuration.semantic_markup_extension_whole_document = true\n @doc_type_am_configuration.semantic_markup_depth_all = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @doc_type_am_configuration }\n end\n end",
"title": ""
},
{
"docid": "ba635dd69587de93fd1128a8f2431533",
"score": "0.51383066",
"text": "def html\n if FUNCTION != 'none'\n if self.md.value != nil\n hm = self.md.value\n else\n hm = INDEX\n end\n @me = YAML.load(self.yaml.value)\n [\n ERB.new(HEAD).result(binding),\n Kramdown::Document.new(ERB.new(hm).result(binding)).to_html,\n \"</body></html>\"\n ].flatten.join('')\n end\n end",
"title": ""
},
{
"docid": "15d309920b8cfe4e756b3a26313c0643",
"score": "0.51355475",
"text": "def process_index\n bindings = {\n :url => @definition.get_url,\n :name => @definition.get_name,\n :resources => @definition.resources,\n :description => @definition.get_description,\n :version => @definition.get_version\n }\n\n page = Calamum::DocGenerator.new(:index)\n page.save_template('index.html', bindings)\n end",
"title": ""
},
{
"docid": "7c35db7414c2c73fe7e25e5fe169f7fe",
"score": "0.51341754",
"text": "def generate\n graph = crate.entities.map(&:properties).reject(&:empty?)\n JSON.pretty_generate('@context' => context, '@graph' => graph)\n end",
"title": ""
},
{
"docid": "3f980967c1b1b38957c7257c47c0ae75",
"score": "0.5124385",
"text": "def r_m\n if @params[:helper] == 'true'\n klass = helper.class\n else\n klass = node.klass\n end\n\n out \"<div class='rubyless-m'><h3>Documentation for <b>#{klass}</b></h3>\"\n out \"<ul>\"\n RubyLess::SafeClass.safe_methods_for(klass).each do |signature, opts|\n opts = opts.dup\n opts.delete(:method)\n if opts.keys == [:class]\n opts = opts[:class]\n end\n out \"<li>#{signature.inspect} => #{opts.inspect}</li>\"\n end\n out \"</ul></div>\"\n end",
"title": ""
},
{
"docid": "f3a7ddc0a6dfa8337087387ab2f8c9ba",
"score": "0.512436",
"text": "def generate_yardoc(includes, yardoc_db)\n system(\"yardoc --db #{yardoc_db} --no-output --no-api --no-private #{includes.join(' ')}\")\nend",
"title": ""
},
{
"docid": "66d035a63b3023d1373f3794c1d3945e",
"score": "0.51194584",
"text": "def documentation\n\troot = settings.root + '/doc'\n\tcontent = File.open(\"#{root}/#{@user.default_locale}.textile\", 'r').read()\n\tRedCloth.new(content).to_html\nend",
"title": ""
},
{
"docid": "c952ac7252eb451794c167f232d6233c",
"score": "0.51028764",
"text": "def generate_document(data)\n template = config.get(:template)\n options = template[:options]\n file = \"#{template[:root]}/mongoid.slim\"\n # create template\n document = Slim::Template.new(\n # delegate file read to slim\n file,\n # declare default options\n options\n )\n .render(\n # ensure helpers are scoped\n self,\n # pass data via parameter\n data: data\n )\n # publish data to file\n publish_document(document)\n # return document\n document\n end",
"title": ""
},
{
"docid": "fe588336ed8e28aac6470b387ebc7dfe",
"score": "0.50993603",
"text": "def save_design_doc(data)\n attrs = case data\n when String\n MultiJson.load(data)\n when IO\n MultiJson.load(data.read)\n when Hash\n data\n else\n raise ArgumentError, \"Document should be Hash, String or IO instance\"\n end\n rv = nil\n id = attrs.delete('_id').to_s\n attrs['language'] ||= 'javascript'\n if id !~ /\\A_design\\//\n rv = Result.new(:operation => :http_request,\n :key => id,\n :error => ArgumentError.new(\"'_id' key must be set and start with '_design/'.\"))\n yield rv if block_given?\n raise rv.error unless async?\n end\n req = make_http_request(id, :body => MultiJson.dump(attrs),\n :method => :put, :extended => true)\n req.on_body do |res|\n rv = res\n val = MultiJson.load(res.value)\n if block_given?\n if res.success? && val['error']\n res.error = Error::View.new(\"save_design_doc\", val['error'])\n end\n yield(res)\n end\n end\n req.continue\n unless async?\n rv.success? or raise res.error\n end\n end",
"title": ""
},
{
"docid": "5c758967b8b64c3801d3da9b11752378",
"score": "0.5098206",
"text": "def call(env)\n DocumentGenerator.call(\n app: @app,\n env: env,\n html: @html,\n markdown: @markdown,\n path: path,\n )\n end",
"title": ""
},
{
"docid": "87ac6c86953d1eaa11d2880c16ad337f",
"score": "0.50885385",
"text": "def main\n blog = File.read(FILE_PATH).gsub(/-----[\\r\\n|\\n|\\r]EXTENDED BODY:/, '<!-- more -->')\n articles = split_to_articles(blog)\n headers_and_bodies = split_to_headers_and_bodies(articles)\n\n headers_and_bodies.each do |header_and_body|\n header_and_body[:header] = convert_header(header_and_body[:header])\n header_and_body[:body] = ReverseMarkdown.convert header_and_body[:body]\n end\n\n create_md_file(headers_and_bodies)\nend",
"title": ""
},
{
"docid": "1969d8c049f07faba46e50a2ecc2c5f2",
"score": "0.50858474",
"text": "def default_api_doc req, endpoint\n response api_html(endpoint.to_markup)\n end",
"title": ""
},
{
"docid": "9e9a58cc4d208a944bb6f466f3e48333",
"score": "0.50775504",
"text": "def show\n @thing = Thing.find(params[:id])\n @thing.description = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true).render(@thing.description)\n page_title \"About the \" + @thing.name + \" thing\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thing }\n end\n end",
"title": ""
},
{
"docid": "48b4b0ac371888c2e0efac4693852de1",
"score": "0.5069907",
"text": "def readme\n @provider = Provider.find(params[:provider_id])\n @readme=@provider.readme\n respond_to do |format|\n format.html\n format.json { render json: @readme }\n end\n end",
"title": ""
},
{
"docid": "9dd60a216e9617448c8797806e22a692",
"score": "0.50688297",
"text": "def json_schema\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9dd60a216e9617448c8797806e22a692",
"score": "0.50688297",
"text": "def json_schema\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "56a3b2b3d30e0527ac19ae45f1d01ef9",
"score": "0.5067085",
"text": "def writeMarkdown(doc, page)\n\n layers = page[\"children\"].reverse\n pagetitle = page[\"name\"]\n blocks = []\n\n # Let's get the text layers\n text = layers.select do |layer|\n layer[\"type\"] === \"TEXT\"\n end\n\n # Let's get only the frames\n frames = layers.select do |layer|\n layer[\"type\"] === \"FRAME\"\n end\n \n # let's build this\n frames.each do |frame|\n ftitle = self.showTitle?(frame[\"name\"]) ? frame[\"name\"] : nil\n fimage = self.getFrameImage(doc, page[\"name\"], frame)\n ftext = self.getFrameText(text, frame[\"name\"])\n\n blocks.push([ftitle, \"/#{@assetpath}/#{fimage}\", ftext])\n end\n\n\n # Do we have a summary?\n summary = text.select do |layer|\n layer[\"name\"] == \"_summary.md\"\n end\n\n summary = summary.size > 0 ? summary.first[\"characters\"] : nil\n\n # Do we have a tags?\n tags = text.select do |layer|\n layer[\"name\"] == \"_tags\"\n end\n\n tags = tags.size > 0 ? tags.first[\"characters\"] : nil\n menutag = !tags.nil? ? tags.split(\",\").first : nil\n\n \n # Export markdown from erb template\n filename = \"#{doc[\"document\"].parameterize}-#{pagetitle.parameterize}\"\n template = File.read('_plugins/figma-template.md.erb')\n result = ERB.new(template).result(binding)\n\n open(\"#{@pagespath}/#{filename}.md\", \"wb\") { |file|\n file.write(result)\n file.close\n }\n\n [pagetitle, filename, menutag]\n end",
"title": ""
},
{
"docid": "0be4698ae4d33adf49a31ba28331e790",
"score": "0.5063978",
"text": "def generate_javadoc\n classpath = \"tools/jambidoc\"\n system \"javadoc -classpath #{classpath} -doclet jambidoc.JambiDoclet \" + \n \"-header \\\"#{@header}\\\" -J-Xmx500m -sourcepath #{@BASE_PATH} com.trolltech.qt com.trolltech.qt.core \" + \n \"com.trolltech.qt.gui com.trolltech.qt.opengl com.trolltech.qt.sql com.trolltech.qt.opengl \"+\n \"com.trolltech.qt.svg com.trolltech.qt.network com.trolltech.qt.xml \" +\n \"com.trolltech.qt.designer com.trolltech.qt.webkit com.trolltech.qt.phonon\"\n if $?.exitstatus != 0\n puts \"Failed to run javadoc\"\n exit 1\n end\n\n system 'find . -name \"qt jambi.dcf\" -exec rm {} \\;'\n system 'find . -name \"qt jambi.index\" -exec rm {} \\;'\n system 'find . -name \"*.jdoc\" -exec rm {} \\;'\n\n system \"jar -cf #{@OUTPUT_DIRECTORY}/qtjambi-javadoc-#{@qtjambi_version}.jar doc/html/*\"\n if $?.exitstatus != 0\n puts \"Failed to run jar -cf doc/*\"\n exit 1\n end\n\n #FileUtils.cp \"doc/html/qtjambi-javadoc-$QTJAMBI_VERSION.jar\", @OUTPUT_DIRECTORY\n end",
"title": ""
},
{
"docid": "3b55b96aac51d691768abb9d53f390e4",
"score": "0.50579894",
"text": "def docs\n options.verbose? ? @@log.level = Logger::DEBUG : @@log.level = Logger::ERROR\n repo_parent_dir = File.expand_path(\"#{File.dirname(__FILE__)}/../../\") \n remove_dir \"#{repo_parent_dir}/origin-docs\"\n empty_directory \"#{repo_parent_dir}/origin-docs\"\n \n unless File.exist?(\"/tmp/yard-js\")\n run \"git clone git://github.com/lsegal/yard-js /tmp/yard-js\"\n inside(\"/tmp/yard-js\") { run \"bundle install\" }\n end\n \n inside(repo_parent_dir) do\n doc_files = Dir[\"#{repo_parent_dir}/origin-server/documentation/*.md\"].join(\",\")\n inside(\"origin-server/documentation\") { run \"yardoc --markup=markdown --output-dir '#{repo_parent_dir}/origin-docs' --files #{doc_files}\" }\n run %{yardoc --output-dir '#{repo_parent_dir}/origin-docs/broker' --main origin-server/documentation/broker.md --private --protected --exclude test \\\n #{Dir[\"origin-server/broker/**/*.rb\"].join(' ')} \\\n #{Dir[\"origin-server/controller/**/*.rb\"].join(' ')}}\n run %{yardoc --output-dir '#{repo_parent_dir}/origin-docs/rest_api' --main origin-server/documentation/rest_api.md --api REST \\\n #{Dir[\"origin-server/controller/**/*.rb\"].join(' ')}}\n run \"yardoc --output-dir '#{repo_parent_dir}/origin-docs/broker_models' --main origin-server/documentation/broker_models.md --private --protected --api model #{Dir[\"origin-server/controller/**/*.rb\"].join(' ')}\"\n run \"yardoc --output-dir '#{repo_parent_dir}/origin-docs/node' --main origin-server/documentation/node.md --private --protected --exclude test #{Dir[\"origin-server/node/**/*.rb\"].join(' ')}\"\n run \"yardoc --output-dir '#{repo_parent_dir}/origin-docs/common' --main origin-server/documentation/common.md --private --protected --exclude test #{Dir[\"origin-server/common/**/*.rb\"].join(' ')}\"\n run \"yardoc --output-dir '#{repo_parent_dir}/origin-docs/build-tools' --main origin-dev-tools/README.md --private --protected --exclude test #{Dir[\"origin-dev-tools/build/*\"].join(' ')}\"\n end\n end",
"title": ""
},
{
"docid": "5b80dcfbb34f4f421cf9e06dd0b49df9",
"score": "0.5052776",
"text": "def generate_resource(pwd, data, _generate_code, generate_docs)\n return unless generate_docs\n\n examples = data.object.examples\n .reject(&:skip_test)\n .reject { |e| !e.test_env_vars.nil? && e.test_env_vars.any? }\n .reject { |e| @version < @api.version_obj_or_closest(e.min_version) }\n\n examples.each do |example|\n target_folder = data.output_folder\n target_folder = File.join(target_folder, example.name)\n FileUtils.mkpath target_folder\n\n data.example = example\n\n data.generate(pwd,\n 'templates/terraform/examples/base_configs/oics_example_file.tf.erb',\n File.join(target_folder, 'main.tf'),\n self)\n\n data.generate(pwd,\n 'templates/terraform/examples/base_configs/tutorial.md.erb',\n File.join(target_folder, 'tutorial.md'),\n self)\n\n data.generate(pwd,\n 'templates/terraform/examples/base_configs/example_backing_file.tf.erb',\n File.join(target_folder, 'backing_file.tf'),\n self)\n\n data.generate(pwd,\n 'templates/terraform/examples/static/motd',\n File.join(target_folder, 'motd'),\n self)\n end\n end",
"title": ""
},
{
"docid": "52d322149a830b23eb631868a1139504",
"score": "0.5051127",
"text": "def publish_document(document)\n schema = config.get(:schema)\n paths = config.get(:paths)\n file = \"#{paths[:output]}/#{schema[:name].downcase}\"\n puts \"\\n>> #{file}\"\n # puts document\n File.write(\"#{file}.rb\", document)\n end",
"title": ""
},
{
"docid": "b317616fa0eaf071b0489c0e1ceda6f4",
"score": "0.5047806",
"text": "def html_markup_markdown(text); end",
"title": ""
},
{
"docid": "7460cb13c13f3b89c8ae049e1f2f3286",
"score": "0.504757",
"text": "def generate_index!(title_prefix, output_doc_path, only_platform: /.*/)\n result = ''\n result += \"# #{title_prefix} Atomic Tests by ATT&CK Tactic & Technique\\n\"\n\n ATTACK_API.techniques_by_tactic(only_platform: only_platform).each do |tactic, techniques|\n result += \"# #{tactic}\\n\"\n techniques.each do |technique|\n result += \"- #{ATOMIC_RED_TEAM.github_link_to_technique(technique, include_identifier: true, link_new_to_contrib: true)}\\n\"\n ATOMIC_RED_TEAM.atomic_tests_for_technique(technique).each_with_index do |atomic_test, i|\n next unless atomic_test['supported_platforms'].any? {|platform| platform.downcase =~ only_platform}\n\n result += \" - Atomic Test ##{i+1}: #{atomic_test['name']} [#{atomic_test['supported_platforms'].join(', ')}]\\n\"\n end\n end\n result += \"\\n\"\n end\n\n File.write output_doc_path, result\n\n puts \"Generated Atomic Red Team index at #{output_doc_path}\"\n end",
"title": ""
},
{
"docid": "b399bf1103d83931615fb5a81ce1d173",
"score": "0.5033825",
"text": "def structure\n [\n # scaffold inject marker\n ]\n end",
"title": ""
},
{
"docid": "1e9f769c4e351207f1ec3915166f3406",
"score": "0.50326425",
"text": "def add_json_ld_schema\r\n edited_document = DcJsonLd.find_document_by_ids(CmsHelper.table_param(params), params[:ids])\r\n yaml = YAML.load_file( CmsHelper.form_file_find('json_ld_schema') )\r\n schema_data = yaml[params[:schema]]\r\n # Existing document\r\n if edited_document.dc_json_lds.find_by(type: \"@#{params[:schema]}\")\r\n return render json: {'msg_error' => t('helpers.help.dc_json_ld.add_error', schema: params[:schema] ) }\r\n else\r\n add_empty_json_ld_schema(edited_document, schema_data, params[:schema], params[:schema], yaml)\r\n end\r\n render json: {'reload_' => 1}\r\nend",
"title": ""
},
{
"docid": "691b88811960f266b1d9957159dfecd2",
"score": "0.5031597",
"text": "def build_mdlinks\n return unless options.Build_Markdown_Links\n\n puts_cyan \"Middlemac is creating `#{options.File_Markdown_Links}`.\"\n\n files_array = []\n out_array = []\n longest_shortcut = 0\n longest_path = 0\n\n Dir.glob(\"#{app.source}/Resources/**/*.erb\").each do |fileName|\n\n # Remove all file extensions and make a shortcut\n base_name = fileName\n while File.extname(base_name) != '' do\n base_name = File.basename( base_name, '.*' )\n end\n next if base_name.start_with?('_') # || base_name == 'index'\n\n if base_name == 'index'\n shortcut = \"[#{File.split(File.split(fileName)[0])[1]}_index]:\"\n\n else\n shortcut = \"[#{base_name}]:\"\n end\n\n # Make a fake absolute path\n path = Pathname.new(fileName).relative_path_from(Pathname.new(app.source))\n path = File::SEPARATOR + File.join(File.dirname(path), base_name) + '.html'\n\n # Get the title, if any\n metadata = YAML.load_file(fileName)\n title = (metadata.is_a?(Hash) && metadata.key?('title')) ? metadata['title'] : ''\n\n files_array << { :shortcut => shortcut, :path => path, :title => title }\n\n longest_shortcut = shortcut.length if shortcut.length > longest_shortcut\n longest_path = path.length if path.length > longest_path\n\n end\n\n files_array = files_array.sort_by { |key| [File.split(key[:path])[0], key[:path]] }\n files_array.uniq.each do |item|\n item[:shortcut] = \"%-#{longest_shortcut}.#{longest_shortcut}s\" % item[:shortcut]\n\n if item[:title].length == 0\n out_array << \"#{item[:shortcut]} #{item[:path]}\"\n else\n item[:path] = \"%-#{longest_path}.#{longest_path}s\" % item[:path]\n out_array << \"#{item[:shortcut]} #{item[:path]} \\\"#{item[:title]}\\\"\"\n end\n end\n\n File.open(options.File_Markdown_Links, 'w') { |f| out_array.each { |line| f.puts(line) } }\n\n end",
"title": ""
},
{
"docid": "5fe93dc8cd5ee83d09d9823d31edd348",
"score": "0.5026975",
"text": "def contstruct_readme\n config = template.config\n\n s = []\n s << \"# %s - %s\" % [config[:name], config[:summary]]\n s << \"## SYNOPSIS\"\n s << Array(usage).join(\"\\n\")\n s << \"## DESCRIPTION\"\n s << config[:description]\n s << \"## COPYRIGHT\"\n s << config[:copyright]\n s.join(\"\\n\\n\")\n end",
"title": ""
},
{
"docid": "fd1d6c93cca5fe501ce728c41ed978b9",
"score": "0.50214875",
"text": "def generatedDoc() \n asciidocCode = self.generateColumnDef\n #asciidocCode = asciidocCode + self.generateStoredProcDef\n return asciidocCode\n end",
"title": ""
},
{
"docid": "acfb185a1cf503a08265f4ad4b861961",
"score": "0.5021465",
"text": "def create_md tool\n \n original = tool[1].split(\"\\n\")\n new = []\n note = false\n\n # Cambia las rutas y < y > por código HTML\n def diple l\n return l.gsub('de +++YAML+++ en <http://pecas.cliteratu.re>', 'de [+++YAML+++](yaml.html)')\n .gsub('de JavaScript en <http://pecas.cliteratu.re>', 'de [JavaScript](js.html)')\n .gsub('Lista de acrónimos: <https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#languages>', '[Lista de acrónimos](https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#languages)')\n .gsub('<','<').gsub('>','>')\n end\n\n # Agrega versalitas\n def smallcaps l\n return l.gsub(/([A-Z]{3,})/, '+++\\1+++')\n end\n\n # Cambia comillas por sintaxis para línea de código\n def to_code l\n return l.gsub(/«(.+?)»/, '`\\1`')\n end\n\n # Añade líneas de código en las opciones\n def to_code_option l\n return l.gsub(/^(\\S+)/, '`\\1`')\n end\n\n new.push('# ' + $l_g_pc_docs_creation + '`' + tool[0] + '`')\n\n original.each_with_index do |l, i|\n\n l = to_code(diple(smallcaps(l)))\n\n if l =~ /^\\S/\n # Encabezados 2\n if l !~ /^Nota/ && i != 1\n new.push('## ' + l + \"\\n\\n\")\n # Párrafos\n else\n # Notas\n if l =~ /^Nota/\n if !note\n new.push(\"--- {.espacio-arriba3}\\n\\n\")\n note = true\n new.push(l + ' {.espacio-arriba3}')\n else\n new.push(l + ' {.espacio-arriba1 .sin-sangria}')\n end \n # Descripción\n else\n # Esto servirá para crear «herramientas.md»\n $tools_md[\"#{tool[0]}\"] = [tool[0], l.gsub(/^\\S+\\s+/, '')]\n new.push(l)\n end\n end\n else\n if l.strip != ''\n l = l.strip\n\n # Opciones de Pecas\n if l =~ /^-/\n new.push('* ' + to_code_option(l))\n # Comandos de Pecas\n elsif l =~ /^pc-/\n new.push('```')\n new.push(l)\n new.push('```')\n # Explicaciones\n elsif l =~ /^[A-Z]/\n new.push(\"\\n\" + l)\n # Dependencias / Tipos\n else\n # Evita que se quede como línea de código el tipo y su descripción\n l_final = []\n l.split(/\\s+/).each_with_index do |ll, i|\n # Solo la primera palabra se va como código\n if i == 0\n l_final.push('* `' + ll + '`')\n # El resto de las palabras se quedan como texto\n else\n l_final.push(ll)\n end\n end\n new.push(l_final.join(' '))\n end\n # Líneas en blanco\n else\n new.push(l)\n end\n end\n end\n\n\tarchivo = File.new(Dir.pwd + '/md/' + tool[0] + '.md', 'w:UTF-8')\n\tarchivo.puts new\n\tarchivo.close\nend",
"title": ""
}
] |
ec6b7021c0833d6264c1e4889527b107
|
For now, loaders can't modify loader config they way that reducers can. This is because reducers like OAI return config that allows them to fetch successive batches of content
|
[
{
"docid": "dfa7bee6d76dbe50ff7ea20573094036",
"score": "0.53490174",
"text": "def loaders\n @loaders ||= profile.loaders\n end",
"title": ""
}
] |
[
{
"docid": "4b2019f26c4956e54e888e08982ce7b1",
"score": "0.5770274",
"text": "def loader\n config.loader || container.config.loader\n end",
"title": ""
},
{
"docid": "4b2019f26c4956e54e888e08982ce7b1",
"score": "0.5770274",
"text": "def loader\n config.loader || container.config.loader\n end",
"title": ""
},
{
"docid": "e6bf655a24c81b52c183b4f2af87e7f0",
"score": "0.57172203",
"text": "def config_loader\n @config_loader ||= TestConfigLoader.new\n end",
"title": ""
},
{
"docid": "3dcdb166fad5d1b034dcb54731c6f260",
"score": "0.5694559",
"text": "def processor\n case data_store_name\n when 'elasticsearch' then :elasticsearch_loader\n when 'kafka' then :kafka_loader\n when 'mongo','mongodb' then :mongodb_loader\n when 'sql', 'mysql' then :sql_loader\n end\n end",
"title": ""
},
{
"docid": "e5d9e4d32478cb9bdadd796f2eb2c5d5",
"score": "0.54794496",
"text": "def configure_loader(loader, system)\n loader.tag = system.config.name || system.name unless loader.tag\n loader.inflector = CompatInflector.new(system.config)\n loader.logger = method(:puts) if debug\n end",
"title": ""
},
{
"docid": "4212038f6b1590d99da8dda9ab8fa460",
"score": "0.54777145",
"text": "def loader; end",
"title": ""
},
{
"docid": "3280d9b98a772e69538ad2441e2d0583",
"score": "0.5471842",
"text": "def load config\n \n # TODO better place for this?\n if config['log4r_config']\n ycfg = Log4r::YamlConfigurator\n # ycfg['foo'] = bar # replaces instances of #{foo} in the YAML with bar\n ycfg.load_yaml_string(YAML.dump(config))\n end\n \n # gah - log4r expects strings, so only convert to symbols here\n config.keys_to_symbols!\n \n # load all scrapers, and mix all shared fields into them\n config[:scrapers].each_pair do |group, included|\n \n shared_setup = {}\n scraper_setups = {}\n \n # load setups\n included.each_pair do |key, value|\n target = if is_scraper?(key)\n logger.info \"Loading scraper #{group}::#{key}\"\n scraper_setups\n else\n shared_setup\n end\n\n target[key] = value\n end\n \n # create each scraper when whole setup is present\n scrapers[group] = setup_scrapers(scraper_setups, shared_setup);\n end if config[:scrapers]\n end",
"title": ""
},
{
"docid": "c0c4ac871091dbcc5506d41421785797",
"score": "0.5264202",
"text": "def loader\n render plain: 'loaderio-8fd226ca0551bbb679e5234f2b165e72'\n end",
"title": ""
},
{
"docid": "db7e3e2c316a9dc8963e9aa42fe7a0fa",
"score": "0.5167544",
"text": "def loader(**options)\n branch loader: options\n end",
"title": ""
},
{
"docid": "15b0615799422b6d4250767e0b7a4147",
"score": "0.5144501",
"text": "def config_load(config); end",
"title": ""
},
{
"docid": "e0fc4e92745fb874169ecf2e671d87af",
"score": "0.5127107",
"text": "def loader=( new_loader )\n\t\tif new_loader.is_a?( Arrow::Config::Loader )\n\t\t\t@loader = new_loader\n\t\telse\n\t\t\t@loader = self.class.get_loader( new_loader )\n\t\tend\n\tend",
"title": ""
},
{
"docid": "35ea7faa29d57918d0a1a6c500a40253",
"score": "0.50841624",
"text": "def server_side_config_options\n [:eager_loading, :klass]\n end",
"title": ""
},
{
"docid": "35ea7faa29d57918d0a1a6c500a40253",
"score": "0.50841624",
"text": "def server_side_config_options\n [:eager_loading, :klass]\n end",
"title": ""
},
{
"docid": "61698ca7f9b2405b4a8961da14d59f25",
"score": "0.5059756",
"text": "def loader(&block)\n loader_class.class_eval(&block)\n\n self\n end",
"title": ""
},
{
"docid": "a8e902c0268954c80bef5a925f7883ad",
"score": "0.49947",
"text": "def define_loader_for(name)\n define_method(\"full_#{name}\") do\n if send(\"has_loaded_#{name}?\")\n instance_variable_get(\"@#{name}\")\n else\n instance_variable_set(\"@#{name}_load_state\", true)\n instance_variable_set(\"@#{name}\", load_associated(name))\n end\n end\n end",
"title": ""
},
{
"docid": "893efcc2da787bd1c4bf601360b12eb9",
"score": "0.49616653",
"text": "def config(tool, loader)\n data = {tool: tool, loader: loader}\n tool.flags.each do |flag|\n config_desc(flag, generate_flag_desc(flag, data), generate_flag_long_desc(flag, data))\n end\n tool.positional_args.each do |arg|\n config_desc(arg, generate_arg_desc(arg, data), generate_arg_long_desc(arg, data))\n end\n tool.flag_groups.each do |flag_group|\n config_desc(flag_group, generate_flag_group_desc(flag_group, data),\n generate_flag_group_long_desc(flag_group, data))\n end\n config_desc(tool, generate_tool_desc(tool, data), generate_tool_long_desc(tool, data))\n yield\n end",
"title": ""
},
{
"docid": "a14e7bd2876dd06bd0c3c5fa976a0fd3",
"score": "0.4945176",
"text": "def load_config\n self.config = JSON.load(self.data)\n end",
"title": ""
},
{
"docid": "a14e7bd2876dd06bd0c3c5fa976a0fd3",
"score": "0.4945176",
"text": "def load_config\n self.config = JSON.load(self.data)\n end",
"title": ""
},
{
"docid": "02ad715b3562ff612e2d256872657be7",
"score": "0.48749965",
"text": "def populateSettingValuesFromConfigMap(parsedConfig)\n begin\n if !parsedConfig.nil? && !parsedConfig[:agent_settings].nil?\n if !parsedConfig[:agent_settings][:health_model].nil? && !parsedConfig[:agent_settings][:health_model][:enabled].nil?\n @enable_health_model = parsedConfig[:agent_settings][:health_model][:enabled]\n puts \"enable_health_model = #{@enable_health_model}\"\n end\n chunk_config = parsedConfig[:agent_settings][:chunk_config]\n if !chunk_config.nil?\n nodesChunkSize = chunk_config[:NODES_CHUNK_SIZE]\n if !nodesChunkSize.nil? && is_number?(nodesChunkSize) && (@nodesChunkSizeMin..@nodesChunkSizeMax) === nodesChunkSize.to_i\n @nodesChunkSize = nodesChunkSize.to_i\n puts \"Using config map value: NODES_CHUNK_SIZE = #{@nodesChunkSize}\"\n end\n\n podsChunkSize = chunk_config[:PODS_CHUNK_SIZE]\n if !podsChunkSize.nil? && is_number?(podsChunkSize) && (@podsChunkSizeMin..@podsChunkSizeMax) === podsChunkSize.to_i\n @podsChunkSize = podsChunkSize.to_i\n puts \"Using config map value: PODS_CHUNK_SIZE = #{@podsChunkSize}\"\n end\n\n eventsChunkSize = chunk_config[:EVENTS_CHUNK_SIZE]\n if !eventsChunkSize.nil? && is_number?(eventsChunkSize) && (@eventsChunkSizeMin..@eventsChunkSizeMax) === eventsChunkSize.to_i\n @eventsChunkSize = eventsChunkSize.to_i\n puts \"Using config map value: EVENTS_CHUNK_SIZE = #{@eventsChunkSize}\"\n end\n\n deploymentsChunkSize = chunk_config[:DEPLOYMENTS_CHUNK_SIZE]\n if !deploymentsChunkSize.nil? && is_number?(deploymentsChunkSize) && (@deploymentsChunkSizeMin..@deploymentsChunkSizeMax) === deploymentsChunkSize.to_i\n @deploymentsChunkSize = deploymentsChunkSize.to_i\n puts \"Using config map value: DEPLOYMENTS_CHUNK_SIZE = #{@deploymentsChunkSize}\"\n end\n\n hpaChunkSize = chunk_config[:HPA_CHUNK_SIZE]\n if !hpaChunkSize.nil? && is_number?(hpaChunkSize) && (@hpaChunkSizeMin..@hpaChunkSizeMax) === hpaChunkSize.to_i\n @hpaChunkSize = hpaChunkSize.to_i\n puts \"Using config map value: HPA_CHUNK_SIZE = #{@hpaChunkSize}\"\n end\n\n podsEmitStreamBatchSize = chunk_config[:PODS_EMIT_STREAM_BATCH_SIZE]\n if !podsEmitStreamBatchSize.nil? && is_number?(podsEmitStreamBatchSize) &&\n podsEmitStreamBatchSize.to_i <= @podsChunkSize && podsEmitStreamBatchSize.to_i >= @podsEmitStreamBatchSizeMin\n @podsEmitStreamBatchSize = podsEmitStreamBatchSize.to_i\n puts \"Using config map value: PODS_EMIT_STREAM_BATCH_SIZE = #{@podsEmitStreamBatchSize}\"\n end\n nodesEmitStreamBatchSize = chunk_config[:NODES_EMIT_STREAM_BATCH_SIZE]\n if !nodesEmitStreamBatchSize.nil? && is_number?(nodesEmitStreamBatchSize) &&\n nodesEmitStreamBatchSize.to_i <= @nodesChunkSize && nodesEmitStreamBatchSize.to_i >= @nodesEmitStreamBatchSizeMin\n @nodesEmitStreamBatchSize = nodesEmitStreamBatchSize.to_i\n puts \"Using config map value: NODES_EMIT_STREAM_BATCH_SIZE = #{@nodesEmitStreamBatchSize}\"\n end\n end\n # fbit config settings\n fbit_config = parsedConfig[:agent_settings][:fbit_config]\n if !fbit_config.nil?\n fbitFlushIntervalSecs = fbit_config[:log_flush_interval_secs]\n if !fbitFlushIntervalSecs.nil? && is_number?(fbitFlushIntervalSecs) && fbitFlushIntervalSecs.to_i > 0\n @fbitFlushIntervalSecs = fbitFlushIntervalSecs.to_i\n puts \"Using config map value: log_flush_interval_secs = #{@fbitFlushIntervalSecs}\"\n end\n\n fbitTailBufferChunkSizeMBs = fbit_config[:tail_buf_chunksize_megabytes]\n if !fbitTailBufferChunkSizeMBs.nil? && is_number?(fbitTailBufferChunkSizeMBs) && fbitTailBufferChunkSizeMBs.to_i > 0\n @fbitTailBufferChunkSizeMBs = fbitTailBufferChunkSizeMBs.to_i\n puts \"Using config map value: tail_buf_chunksize_megabytes = #{@fbitTailBufferChunkSizeMBs}\"\n end\n\n fbitTailBufferMaxSizeMBs = fbit_config[:tail_buf_maxsize_megabytes]\n if !fbitTailBufferMaxSizeMBs.nil? && is_number?(fbitTailBufferMaxSizeMBs) && fbitTailBufferMaxSizeMBs.to_i > 0 \n if fbitTailBufferMaxSizeMBs.to_i >= @fbitTailBufferChunkSizeMBs\n @fbitTailBufferMaxSizeMBs = fbitTailBufferMaxSizeMBs.to_i\n puts \"Using config map value: tail_buf_maxsize_megabytes = #{@fbitTailBufferMaxSizeMBs}\"\n else\n # tail_buf_maxsize_megabytes has to be greater or equal to tail_buf_chunksize_megabytes\n @fbitTailBufferMaxSizeMBs = @fbitTailBufferChunkSizeMBs\n puts \"config::warn: tail_buf_maxsize_megabytes must be greater or equal to value of tail_buf_chunksize_megabytes. Using tail_buf_maxsize_megabytes = #{@fbitTailBufferMaxSizeMBs} since provided config value not valid\"\n end\n end\n # in scenario - tail_buf_chunksize_megabytes provided but not tail_buf_maxsize_megabytes to prevent fbit crash\n if @fbitTailBufferChunkSizeMBs > 0 && @fbitTailBufferMaxSizeMBs == 0\n @fbitTailBufferMaxSizeMBs = @fbitTailBufferChunkSizeMBs\n puts \"config::warn: since tail_buf_maxsize_megabytes not provided hence using tail_buf_maxsize_megabytes=#{@fbitTailBufferMaxSizeMBs} which is same as the value of tail_buf_chunksize_megabytes\"\n end \n\n fbitTailMemBufLimitMBs = fbit_config[:tail_mem_buf_limit_megabytes]\n if !fbitTailMemBufLimitMBs.nil? && is_number?(fbitTailMemBufLimitMBs) && fbitTailMemBufLimitMBs.to_i > 0\n @fbitTailMemBufLimitMBs = fbitTailMemBufLimitMBs.to_i\n puts \"Using config map value: tail_mem_buf_limit_megabytes = #{@fbitTailMemBufLimitMBs}\"\n end\n end\n end\n rescue => errorStr\n puts \"config::error:Exception while reading config settings for agent configuration setting - #{errorStr}, using defaults\"\n @enable_health_model = false\n end\nend",
"title": ""
},
{
"docid": "93218d71c1c06ef62a37d85e356dee02",
"score": "0.48584715",
"text": "def define_loader(klass)\n self\n end",
"title": ""
},
{
"docid": "e53aaa17311db631dc43d0fe789c6c6b",
"score": "0.48577923",
"text": "def loader\n\t\t@loader ||= self.class.get_loader\n\tend",
"title": ""
},
{
"docid": "807c20f58d364473f240c5330c360173",
"score": "0.48450947",
"text": "def reducers(config)\n [\n CSVQueryScenarios::Fetch,\n CSVQueryScenarios::CSVBuilder,\n CSVQueryScenarios::IOWriter.new(config.output),\n CSVQueryScenarios::ProgressBar.create_for_io(\n config.output, config.scenarios.length\n )\n ]\n end",
"title": ""
},
{
"docid": "43f5a227dd0f780173ced7df63310704",
"score": "0.48352182",
"text": "def load_config\n self.config = JSON.load(self.data)\n end",
"title": ""
},
{
"docid": "326b9034aa525dfdd1f1049cfe53ed03",
"score": "0.48303974",
"text": "def config(tool, loader)\n tool_class = tool.tool_class\n DSL::Internal.prepare(tool_class, tool.full_name, tool.priority, nil, @source_info,\n loader) do\n tool_class.class_eval(&@block)\n end\n yield\n end",
"title": ""
},
{
"docid": "1ad8a511838d758ddcc18c48673e1c30",
"score": "0.48192504",
"text": "def load_config\n @config = YAML.safe_load(ERB.new(File.read(config_path)).result)\n @queue_ahead = @config[\"queue_ahead\"] || Task::DEFAULT_QUEUE_AHEAD_MINUTES\n @queue_name = @config[\"queue_name\"] || \"default\"\n @time_zone = @config[\"tz\"] || Time.zone.tzinfo.name\n @config.delete(\"queue_ahead\")\n @config.delete(\"queue_name\")\n @config.delete(\"tz\")\n end",
"title": ""
},
{
"docid": "535b9d19bfa0522c9d4ac560f8bfbcd6",
"score": "0.48170757",
"text": "def autoloaders; end",
"title": ""
},
{
"docid": "4df50b841c98271e737ad0c731a5e771",
"score": "0.4815427",
"text": "def worker_initial_config\n\n end",
"title": ""
},
{
"docid": "3e614e467ae23f60109837887800d6b5",
"score": "0.48054314",
"text": "def configure_components\n config.producer ||= ::WaterDrop::Producer.new do |producer_config|\n # In some cases WaterDrop updates the config and we don't want our consumer config to\n # be polluted by those updates, that's why we copy\n producer_config.kafka = config.kafka.dup\n producer_config.logger = config.logger\n end\n\n return unless Karafka.pro?\n\n # Runs the pro loader that includes all the pro components\n require 'karafka/pro/loader'\n Pro::Loader.setup(config)\n end",
"title": ""
},
{
"docid": "cbf8a30d0ce4a11080a26a89e76f9e18",
"score": "0.47969452",
"text": "def loader_class\n attributes.loader_class\n end",
"title": ""
},
{
"docid": "46c1d79afdebf7b00e3761d3cf004354",
"score": "0.4781296",
"text": "def loaders\n @loaders ||= LoggedChangeLoaders.new(session)\n end",
"title": ""
},
{
"docid": "4462500b2d6c0a0c97ae5b177d4a83ba",
"score": "0.4779171",
"text": "def initialize(loader)\n # This is a Puma::PluginLoader\n @loader = loader\n end",
"title": ""
},
{
"docid": "9f3a6d6e56c656d26eec02683c9c5f92",
"score": "0.47752866",
"text": "def reloader; end",
"title": ""
},
{
"docid": "9f3a6d6e56c656d26eec02683c9c5f92",
"score": "0.47752866",
"text": "def reloader; end",
"title": ""
},
{
"docid": "af2d9efc991ef87219a6d467295101cc",
"score": "0.4766153",
"text": "def eager_loader_key\n self[:key]\n end",
"title": ""
},
{
"docid": "86ba5f523e227247d70e74932db62c70",
"score": "0.47614366",
"text": "def postprocessor(&block)\n @config.postprocessor = block\n end",
"title": ""
},
{
"docid": "084b309835ea42db6f8fb60af87191a8",
"score": "0.47614074",
"text": "def configure\n load_all_configs \n end",
"title": ""
},
{
"docid": "7ce0e426510269c22a3fd97e06de419f",
"score": "0.47506145",
"text": "def use_reloader!\n if configuration.use_reloader\n Kernel.require 'rucola/reloader'\n Rucola::Reloader.start!\n end\n end",
"title": ""
},
{
"docid": "54980580e01777014d804250eb11f34a",
"score": "0.47408757",
"text": "def eager_load_all\n Registry.loaders.each(&:eager_load)\n end",
"title": ""
},
{
"docid": "198a51e2804fefda1764582d6086738b",
"score": "0.4736177",
"text": "def eager_loader_key\n self[:eager_loader_key]\n end",
"title": ""
},
{
"docid": "5511ce5a425f733433b9f91cbfc2c555",
"score": "0.47323906",
"text": "def config\n yield self\n end",
"title": ""
},
{
"docid": "6f1bd542975055a1349f3e0f5c433498",
"score": "0.47239333",
"text": "def eager_load_paths=(_arg0); end",
"title": ""
},
{
"docid": "5db494b2060850bd521fd765e27d9051",
"score": "0.47200772",
"text": "def process_config(parsed_config)\n final_config = []\n parsed_config.each do |config_block|\n # Skip any blocks that are explicitely not enabled\n next if config_block.key?('enabled') && !config_block['enabled']\n if config_block['remoteHost'].instance_of? Array\n final_config += split_multi_remotehost_config_blocks(config_block)\n else\n final_config << config_block\n end\n end\n final_config\nend",
"title": ""
},
{
"docid": "1e4ae5baef2b2c95bfd08a27983fcaac",
"score": "0.47166803",
"text": "def load_per_cluster(cfg)\n cluster = cfg['cluster']\n query = format(\n 'sum(node_load5{job=\"%s\"})/count(node_cpu{mode=\"system\",job=\"%s\"})',\n cluster,\n cluster\n )\n\n result = @client.query(query).first\n source = cfg['source']\n value = result['value'][1].to_f.round(2)\n log.debug(\n \"[load_per_cluster] value: '#{value}', source: '#{source}'\"\n )\n\n [{ 'source' => source, 'value' => value }]\n end",
"title": ""
},
{
"docid": "12d5d72b143c87ccf66454e544d4117f",
"score": "0.47146177",
"text": "def config_store; end",
"title": ""
},
{
"docid": "223bcda6e950afd075d9da0192fb77be",
"score": "0.47134027",
"text": "def [](name)\n @_configs ||= {}\n @_configs[name.to_sym] ||= load(name)\n end",
"title": ""
},
{
"docid": "738cd751fbd6d09590bf358187c24472",
"score": "0.4713144",
"text": "def configure\n yield config if block_given?\n end",
"title": ""
},
{
"docid": "738cd751fbd6d09590bf358187c24472",
"score": "0.4713144",
"text": "def configure\n yield config if block_given?\n end",
"title": ""
},
{
"docid": "fa1d41c77dfcc48397bf30734b114988",
"score": "0.4708737",
"text": "def check_for_too_many_processors(config, hash); end",
"title": ""
},
{
"docid": "26df3355fa1dc8e1a84bd55f561c0aee",
"score": "0.46838808",
"text": "def config(queue, klass)\n config = SideJob.redis.hget \"workers:#{queue}\", klass\n config = JSON.parse(config) if config\n config\n end",
"title": ""
},
{
"docid": "477e187a77960c52ba36ce552aba2fbb",
"score": "0.46767086",
"text": "def config\n @config ||= YAML.load_file(BASE_PATH + '/local.config.yml')\nend",
"title": ""
},
{
"docid": "afbb44ebcb7e7191118b5285577b6939",
"score": "0.4668853",
"text": "def formatter_loader\n @formatter_loader ||= NagiosHerald::FormatterLoader.new\n end",
"title": ""
},
{
"docid": "3c6fa159019090c200d4dbf232f82da8",
"score": "0.46650988",
"text": "def configure_cache; end",
"title": ""
},
{
"docid": "6b69eeaaa80cd1c8621dfea6a4b93082",
"score": "0.4658654",
"text": "def configure_rdig\n # back up original config\n old_logger = RDig.logger\n old_cfg = RDig.configuration.dup\n RDig.logger = ActsAsFerret.logger\n rdig_configuration[:crawler].each { |k,v| RDig.configuration.crawler.send :\"#{k}=\", v } if rdig_configuration[:crawler]\n if ce_config = rdig_configuration[:content_extraction]\n RDig.configuration.content_extraction = OpenStruct.new( :hpricot => OpenStruct.new( ce_config ) )\n end\n yield\n ensure\n # restore original config\n RDig.configuration.crawler = old_cfg.crawler\n RDig.configuration.content_extraction = old_cfg.content_extraction\n RDig.logger = old_logger\n end",
"title": ""
},
{
"docid": "95aa9ae20e2b0bb23998b6e5025e92c1",
"score": "0.46505013",
"text": "def from_config\n config ||= YAML::load(File.open((File.join(File.dirname(__FILE__), 'config.yml'))))\nend",
"title": ""
},
{
"docid": "93f3f5098958abdf4f500cb806bc75f2",
"score": "0.46495688",
"text": "def _process_load_data(config, index, name, file,\n config_class = PRC::BaseConfig)\n return unless config.layer_index(name).nil?\n\n return if file.nil?\n\n layer = PRC::CoreConfig.define_layer(:name => name,\n :config => config_class.new,\n :load => true,\n :set => false)\n unless File.exist?(file)\n PrcLib.warning(\"Process '%s', data file '%s' doesn't exist.\"\\\n ' Not loaded.', name, file)\n return\n end\n\n begin\n unless layer[:config].load(file)\n PrcLib.warning(\"Process '%s', data file '%s' was not loaded.\",\n name, file)\n end\n rescue => e\n PrcLib.error(\"Process '%s', unable to load data file '%s'. %s\",\n name, file, e.message)\n end\n\n config.layer_add(layer.merge(:index => (config.layers.length - index)))\n end",
"title": ""
},
{
"docid": "2b048aa8956f091034f52d2cef3fd2f1",
"score": "0.4648369",
"text": "def before_eager_load(&block); end",
"title": ""
},
{
"docid": "b19e5170ee5541d3d5c1ca51f261f9af",
"score": "0.4633358",
"text": "def get_config\n {}.update(local_config)\nend",
"title": ""
},
{
"docid": "4ac2f885c1eba365f8d7456db9064bf9",
"score": "0.46283844",
"text": "def configure(*args)\n @options = args[0] || {}\n @fetcher_opts = @options.dup\n @fetcher_opts.delete(:backends_file)\n @fetcher_opts.delete(:domainmap_file)\n @fetcher_opts.delete(:interval)\n end",
"title": ""
},
{
"docid": "f1c670041c3f146d328136545d8b4119",
"score": "0.4627894",
"text": "def config(&block)\n instance_eval(&block) if block_given?\n end",
"title": ""
},
{
"docid": "1f979117fb361aa95506745483458d02",
"score": "0.46217752",
"text": "def parsed_config\n @parsed_config ||= begin\n JSON.parse(config[:json_config], symbolize_names: true)\n rescue JSON::ParserError\n JSON.parse(File.read(config[:json_config]),\n symbolize_names: true)\n end\n end",
"title": ""
},
{
"docid": "1ee3a543910e83ad7a497985269e7138",
"score": "0.45976183",
"text": "def setup(&blk)\n @config.read(&blk)\n @config\n end",
"title": ""
},
{
"docid": "8602e0339be7bb80e20ccb6b4423b7e8",
"score": "0.45965528",
"text": "def load_scenario_with_caching(name)\n EOL::ScenarioLoader.load_with_caching(name)\n end",
"title": ""
},
{
"docid": "578a656e8da96a516442ce82dbef7b1a",
"score": "0.4591828",
"text": "def config\n name = $0.scan(/thin_(\\d+)/) && $1\n config = <<__CONFIG\ngraph_title Delayed::Job queue size\ngraph_vlabel Entries\ngraph_category Rails\nentries.label Entries\nentries.warning 200\nentries.critical 300\ngraph_info Number of records in the Delayed::Job table\n__CONFIG\nend",
"title": ""
},
{
"docid": "3172dd1ae95e459372971d33ef20de55",
"score": "0.4586185",
"text": "def configure\n yield(config)\n end",
"title": ""
},
{
"docid": "40447ae6ae8f9359960fde08405b7ef2",
"score": "0.45808673",
"text": "def load_config\n if @type == :upload\n config_file = \"ul_config.xml\"\n else\n config_file = \"dl_config.xml\"\n end\n doc = Nokogiri::XML(open(\"config/#{config_file}\"))\n doc.search(@type.to_s).each do |config|\n @config_map[:ip] = get_content config, \"ip\"\n @config_map[:port] = get_content config, \"port\"\n @config_map[:user] = get_content config, \"user\"\n @config_map[:password] = get_content config, \"password\"\n @config_map[:remotedir] = get_content config, \"remotedir\"\n @config_map[:localdir] = get_content config, \"localdir\"\n\n @localfile = get_content config, \"localfile\"\n @remotefile = get_content config, \"remotefile\"\n\n @thread_num = get_content(config, \"thread_num\").to_i\n @sleep = get_content(config, \"sleep\").to_i\n @test = get_content(config, \"test\")\n end\n\n if @type == :upload\n @thread_num = @thread_num >= 10 ? @thread_num : 10\n end\n end",
"title": ""
},
{
"docid": "991453515c2fd62912108a361b4f1af5",
"score": "0.45799622",
"text": "def merged_config_for_generator\n return {}\n end",
"title": ""
},
{
"docid": "80e94065959891f7430732c7347d8766",
"score": "0.45734677",
"text": "def initialize(loader)\n @loader = loader\n end",
"title": ""
},
{
"docid": "a8c38d7e6b2837420b729579be6e7f2a",
"score": "0.45720923",
"text": "def configure\n yield configuration if block_given?\n end",
"title": ""
},
{
"docid": "fe391506ca4659f58cdc4605369a3ff3",
"score": "0.45644113",
"text": "def get_processor; end",
"title": ""
},
{
"docid": "13ca6882d076bb20a3c42ece3727414c",
"score": "0.456107",
"text": "def initialize(parent_loader, loaders, module_name, path, loader_name, loadables = LOADABLE_KINDS)\n super\n @path_index = Set.new\n end",
"title": ""
},
{
"docid": "1b2ca2ce0b136c37d4fa272ffff59db3",
"score": "0.4552631",
"text": "def load_config\n BeEF::Core::Configuration.new(\"#{$root_dir}/config.yaml\")\n BeEF::Core::Configuration.instance.load_extensions_config\n @config = BeEF::Core::Configuration.instance.get('beef.extension.metasploit')\n end",
"title": ""
},
{
"docid": "a6a47b1bb64677e6baaa34907f575a36",
"score": "0.45348707",
"text": "def config\n yield self\n end",
"title": ""
},
{
"docid": "a6a47b1bb64677e6baaa34907f575a36",
"score": "0.45348707",
"text": "def config\n yield self\n end",
"title": ""
},
{
"docid": "a6a47b1bb64677e6baaa34907f575a36",
"score": "0.45348707",
"text": "def config\n yield self\n end",
"title": ""
},
{
"docid": "b3001ceb1df8d268307835d2ebc7fc4d",
"score": "0.4533622",
"text": "def load_transformer_conf(*path)\n Transformer.use_bundle_loader\n Orocos.transformer.manager.conf.load_transformer_conf(*path)\n end",
"title": ""
},
{
"docid": "dfe1fd0388617036b908f61d5e4f5ae0",
"score": "0.4531348",
"text": "def config\n @config ||= yaml_content || {\n 'apiVersion' => 'v1',\n 'clusters' => [],\n 'contexts' => [],\n 'current-context' => nil,\n 'kind' => 'Config',\n 'preferences' => {},\n 'users' => []\n }\n end",
"title": ""
},
{
"docid": "9322b1ee3cc174ab1e9b2dc265d269a5",
"score": "0.4526084",
"text": "def preload\n forked = ForkedProcess.new\n\n forked.write do |writer|\n log \"INITIALIZING...\"\n FieldProcessor.preload \n YAML.dump(FieldProcessor.field_cache, writer)\n end \n \n forked.read do |reader| \n FieldProcessor.field_cache.merge!(YAML.load(reader.read))\n end\n\n# forked.run\n end",
"title": ""
},
{
"docid": "eb748d55bc3dbf45b25f996c1b3b2476",
"score": "0.4525454",
"text": "def load_config!\n\n # Read the config\n @config.load_mccloud_config()\n\n # Read the templates in the template sub-dir\n @config.templates.load!\n @config.definitions.load!\n\n # Read the vms specified inthe vm sub-dir\n @config.vms.load!\n\n ui.info \"Loaded providers[#{@config.providers.length}]\"+\" vms[#{@config.vms.length}]\"+\" ips[#{@config.ips.length}]\"+\" lbs[#{@config.lbs.length}]\"+\" stacks[#{@config.stacks.length}]\"+\" templates[#{@config.templates.length}] keypairs[#{@config.keypairs.length}] keystores[#{@config.keystores.length}]\"\n\n return self\n end",
"title": ""
},
{
"docid": "b4f20db7a8034f6b43e51f31d928c459",
"score": "0.4521022",
"text": "def config_read\n f = File.expand_path(CONFIG_FILE)\n if File.readable? f\n load f\n # maybe we should check for these existing else crash will happen.\n #$bookmarks.push(*bookmarks) if bookmarks\n log \"loaded #{CONFIG_FILE} \"\n end\nend",
"title": ""
},
{
"docid": "7f99389baa4f4f3bcc4bdd8f811c7db6",
"score": "0.45135006",
"text": "def after_config_update(*_)\n config[:parameters] ||= Smash.new\n config[:compile_parameters] ||= Smash.new\n config[:apply_stack] ||= []\n config[:apply_mapping] ||= Smash.new\n stack_name = arguments.first\n content = load_file_for(stack_name)\n process_information_hash(content, [])\n nil\n end",
"title": ""
},
{
"docid": "59a79b8ddc3bc696eca7e6b129922517",
"score": "0.4513427",
"text": "def configure\n yield config if block_given?\n end",
"title": ""
},
{
"docid": "58397bf1c6395f5d82d945f73d228fba",
"score": "0.45113096",
"text": "def third_party_processors; end",
"title": ""
},
{
"docid": "a7467ffdaf33580d70cc37b9e23e632f",
"score": "0.45077705",
"text": "def config_read\n f = File.expand_path(CONFIG_FILE)\n return unless File.readable? f\n\n hash = loadYML(f)\n @used_dirs = hash['DIRS']\n @visited_files = hash['FILES']\n @bookmarks = hash['BOOKMARKS']\n @used_dirs.concat get_env_paths\nend",
"title": ""
},
{
"docid": "0c9d1b353aa3cdd888483e5aee691561",
"score": "0.44977257",
"text": "def config(&block)\n instance_exec(&block)\n end",
"title": ""
},
{
"docid": "70f6368eed30fbce08be130402c46846",
"score": "0.44945028",
"text": "def [](name)\n @config ||= {}\n @config[name.to_sym] ||= load(name)\n end",
"title": ""
},
{
"docid": "e881c360938eb3af2ea3765c6007fa05",
"score": "0.4494103",
"text": "def context\n config.file? ? YAML.load_file(config) : {}\n end",
"title": ""
},
{
"docid": "e881c360938eb3af2ea3765c6007fa05",
"score": "0.4494103",
"text": "def context\n config.file? ? YAML.load_file(config) : {}\n end",
"title": ""
},
{
"docid": "3d11851daec0df56bca2057a7f92a1c6",
"score": "0.44864383",
"text": "def load_config\n path = File.expand_path(@config_path)\n\n if File.exist?(path)\n file = File.new(path, \"r\")\n @config = MultiJson.decode(file.read)\n else\n load_default_config\n end\n end",
"title": ""
},
{
"docid": "e74d6b58036cc12dd4a9d732d162e9e5",
"score": "0.44799107",
"text": "def setup_jobs\n JobLoader.call\n end",
"title": ""
},
{
"docid": "31f0ddcd78ab0cd10762aa2fe3d2d796",
"score": "0.44792694",
"text": "def after_read_processors\n @after_read_processors ||= []\n end",
"title": ""
},
{
"docid": "30c6d67ab7e35e6b70744717ab9a6a8d",
"score": "0.4479141",
"text": "def use\n if block_given?\n yield self.config\n end\n self.config\n end",
"title": ""
},
{
"docid": "e641681456f7fc3861e0315adf225d1a",
"score": "0.44672805",
"text": "def asigna_loader\n nombre_loader = self.class.name.demodulize.downcase\n self.loader = Soulmate::Loader.new(nombre_loader)\n Rails.logger.debug \"[DEBUG] - Loader: #{loader.inspect}\"\n end",
"title": ""
},
{
"docid": "29b70a0b92dbf462435f1901a136d81b",
"score": "0.44658092",
"text": "def configure &blk\n instance_eval &blk\n end",
"title": ""
},
{
"docid": "f66975589c51fd49fa9b3ec934d527c2",
"score": "0.4465186",
"text": "def post_processors\n []\n end",
"title": ""
},
{
"docid": "0e8fa36a7ce0237776f25521211a1398",
"score": "0.44650543",
"text": "def register_bundle_processor(mime_type, klass, &block)\n mutate_hash_config(:bundle_processors, mime_type) do |processors|\n processors.push(wrap_processor(klass, block))\n processors\n end\n end",
"title": ""
},
{
"docid": "f264748684090b58963af28ba1cbf4b5",
"score": "0.44588196",
"text": "def update_config_value(use_prepend)\n if config_key && auto_configured?\n NewRelic::Agent.config.instance_variable_get(:@cache)[config_key] = use_prepend ? :prepend : :chain\n end\n use_prepend\n end",
"title": ""
},
{
"docid": "f369edff00612cd035f0c13997a4122d",
"score": "0.4456977",
"text": "def fetch\n cfg = {}\n cfg = YAML.load_file(@default) if File.file?(@default)\n\n local = {}\n if File.file?(@local)\n # Check for bad user input in the local config.yml file.\n local = YAML.load_file(@local)\n unless local.is_a?(Hash)\n raise StandardError, \"Wrong format for the config-local file!\"\n end\n end\n\n hsh = strict_merge_with_env(cfg, local)\n add_enabled(hsh)\n end",
"title": ""
},
{
"docid": "1ee361307de30781fea928f42e5cdd49",
"score": "0.44553584",
"text": "def load_config(filename='~/grapevine.yml')\n data = YAML.load(IO.read(File.expand_path(filename)))\n \n # Create loaders\n if data.key?('sources') && data['sources'].is_a?(Array)\n data['sources'].each do |hash|\n type = hash.delete('type')\n loader = Grapevine::Loader.create(type, hash)\n add_loader(loader)\n end\n end\n\n # Create notifiers\n if data.key?('notifiers') && data['notifiers'].is_a?(Array)\n data['notifiers'].each do |hash|\n type = hash.delete('type')\n notifier = Grapevine::Notifier.create(type, hash)\n add_notifier(notifier)\n end\n end\n \n nil\n end",
"title": ""
},
{
"docid": "a52f58fcc51b74358261dac20bd71c15",
"score": "0.44508377",
"text": "def worker_config\n worker = JSON.parse(SideJob.redis.get(\"#{redis_key}:worker\"))\n SideJob::Worker.config(worker['queue'], worker['class']) || {}\n end",
"title": ""
},
{
"docid": "537c46d6b1d3a2ab7436a32bc272c727",
"score": "0.444889",
"text": "def configure\n yield configuration\n end",
"title": ""
}
] |
0a8909146e1fd229853ad32e203fefca
|
methode pour la fin de la partie
|
[
{
"docid": "0622072c655b92ace0ee34d93161a137",
"score": "0.0",
"text": "def end\n\t\tif @user1.life_points>0 then\n\t\t\tputs \"BRAVO !!!! TU AS GAGNE !\"\n\t\telse\n\t\t\tputs \"BOUUUUUUU! TU AS PERDU !\"\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "2d184052a6e6071e93a993d5d03d315d",
"score": "0.71448165",
"text": "def part_end\n end",
"title": ""
},
{
"docid": "77d479ae2ea9b0b64f605e7e331878aa",
"score": "0.6823689",
"text": "def add_part\n\n\n\n end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.6596576",
"text": "def parts; end",
"title": ""
},
{
"docid": "e806f684239aab65146c38b186a51e5e",
"score": "0.64947593",
"text": "def finish\n #\n end",
"title": ""
},
{
"docid": "3fdffbde108f7ca6389d7f13fac45c52",
"score": "0.6384258",
"text": "def footer; end",
"title": ""
},
{
"docid": "3fdffbde108f7ca6389d7f13fac45c52",
"score": "0.6384258",
"text": "def footer; end",
"title": ""
},
{
"docid": "1b7f2745c5153bc76ab2921cc27c0cdc",
"score": "0.6363111",
"text": "def part_begin\n end",
"title": ""
},
{
"docid": "eabcc5fd6f83a88d2b7300383ac4fbe5",
"score": "0.6338535",
"text": "def part_d\n end",
"title": ""
},
{
"docid": "b4f962513b458fce31b0ce45f6cb469f",
"score": "0.63221335",
"text": "def end\n end",
"title": ""
},
{
"docid": "b4f962513b458fce31b0ce45f6cb469f",
"score": "0.63221335",
"text": "def end\n end",
"title": ""
},
{
"docid": "b4f962513b458fce31b0ce45f6cb469f",
"score": "0.63221335",
"text": "def end\n end",
"title": ""
},
{
"docid": "daa8999942f195c165f5a390930ab3e8",
"score": "0.63029814",
"text": "def end\n\n end",
"title": ""
},
{
"docid": "a7a7f742c9125435d551237aec8f196c",
"score": "0.6189653",
"text": "def finish\n end",
"title": ""
},
{
"docid": "a7a7f742c9125435d551237aec8f196c",
"score": "0.6189653",
"text": "def finish\n end",
"title": ""
},
{
"docid": "281e9a43f3408650bd69047a8fabab55",
"score": "0.61883575",
"text": "def end; end",
"title": ""
},
{
"docid": "281e9a43f3408650bd69047a8fabab55",
"score": "0.61883575",
"text": "def end; end",
"title": ""
},
{
"docid": "281e9a43f3408650bd69047a8fabab55",
"score": "0.61883575",
"text": "def end; end",
"title": ""
},
{
"docid": "281e9a43f3408650bd69047a8fabab55",
"score": "0.61883575",
"text": "def end; end",
"title": ""
},
{
"docid": "281e9a43f3408650bd69047a8fabab55",
"score": "0.61883575",
"text": "def end; end",
"title": ""
},
{
"docid": "281e9a43f3408650bd69047a8fabab55",
"score": "0.61883575",
"text": "def end; end",
"title": ""
},
{
"docid": "281e9a43f3408650bd69047a8fabab55",
"score": "0.61883575",
"text": "def end; end",
"title": ""
},
{
"docid": "1df65d045e0d65f9bf9b98c8cdd94356",
"score": "0.6183124",
"text": "def finish()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "552950d9a2c7b24b09c0813bc66f431b",
"score": "0.61541146",
"text": "def complete\n end",
"title": ""
},
{
"docid": "552950d9a2c7b24b09c0813bc66f431b",
"score": "0.61541146",
"text": "def complete\n end",
"title": ""
},
{
"docid": "d93ea344472704ae159dcad872082d64",
"score": "0.60733527",
"text": "def complete\n end",
"title": ""
},
{
"docid": "821213e5c1a9a650c3be3c98526d8992",
"score": "0.60676724",
"text": "def footer\n end",
"title": ""
},
{
"docid": "4f1456685591db1599bf5770fa30432a",
"score": "0.59955263",
"text": "def finish\n end",
"title": ""
},
{
"docid": "4f1456685591db1599bf5770fa30432a",
"score": "0.59955263",
"text": "def finish\n end",
"title": ""
},
{
"docid": "4f1456685591db1599bf5770fa30432a",
"score": "0.59955263",
"text": "def finish\n end",
"title": ""
},
{
"docid": "4f1456685591db1599bf5770fa30432a",
"score": "0.59955263",
"text": "def finish\n end",
"title": ""
},
{
"docid": "4f1456685591db1599bf5770fa30432a",
"score": "0.59955263",
"text": "def finish\n end",
"title": ""
},
{
"docid": "2309707e2aef111ef9d155cbcac838fd",
"score": "0.596727",
"text": "def cargar_insumo;\n\t\t\n\tend",
"title": ""
},
{
"docid": "7f5e9435e0db7d63b56c4ef68a5d9a30",
"score": "0.5953155",
"text": "def finish\n end",
"title": ""
},
{
"docid": "87dc79c3b96b6d1cbb634c62ca4bb7dd",
"score": "0.5892075",
"text": "def sections; end",
"title": ""
},
{
"docid": "1c95642a26f46aa81146aa08a721a3c1",
"score": "0.5847322",
"text": "def complete!; end",
"title": ""
},
{
"docid": "dbf9d4c3d7943ad687492d9f34bc977c",
"score": "0.58360165",
"text": "def main_end ; end",
"title": ""
},
{
"docid": "12fdd2732d912b95e3274a3504a785db",
"score": "0.57761955",
"text": "def finPartie\n # initialisation de la fenetre\n popFin = Window.new\n popFin.set_title(\"Fin de la partie\")\n popFin.set_window_position(:center_always)\n popFin.border_width=10\n popFin.set_default_size(75,75)\n popFin.set_resizable(false)\n pres = Table.new(10,2,true)\n # Désactiver les boutons\n @gomme.set_sensitive(false)\n @crayon.set_sensitive(false)\n @aide.set_sensitive(false)\n @unDo.set_sensitive(false)\n @reDo.set_sensitive(false)\n @pause.set_sensitive(false)\n @nouvellePartie.set_sensitive(false)\n @erreur.set_sensitive(false)\n @recommencerPartie.set_sensitive(false)\n 1.upto(9){ |i|\n @tableauChiffre[i].set_sensitive(false)\n }\n\n # Désactiver la grille\n @partie.grille.tabCase.each{ |n|\n n.each{ |cell|\n cell.set_sensitive(false)\n }\n }\n\n if @partie.enCours\n label = @mylabel.label\n label = label.gsub(\"<big>\", \"\")\n label = label.gsub(\"</big>\", \"\")\n chrono = label.split(\":\")\n i = (chrono[0].to_i*3600) + (chrono[1].to_i*60) + chrono[2].to_i\n @partie.score.calculScoreFinal(i)\n @partie.enCours = false\n @partie.marshal_dump(@partie.nomPartie())\n @partie.finDePartie()\n end\n\n # création des boutons de la fenetre pop up\n voirGrille = Button.new().set_label(\"Revoir la grille\")\n quitter = Button.new().set_label(\"Quitter\")\n # connexion des signaux\n voirGrille.signal_connect('clicked'){\n @kakuro.set_sensitive(true)\n popFin.close()\n }\n quitter.signal_connect('clicked'){\n onDestroy\n popFin.close()\n }\n pres.attach(getLabelX(\"Felicitations : vous avez terminé la partie\", false), 0, 2, 1, 3)\n pres.attach(getLabelXX(\"Score : #{@partie.score.nb_score} point(s)\"), 0, 2, 3, 6)\n\n if @partie.score.nb_score <= @meilleurScore\n pres.attach(getLabelLarge(\"Meilleur score : #{@partie.score.nb_score} point(s)\"), 0, 2, 6, 7)\n else\n pres.attach(getLabelLarge(\"Vous avez établi le nouveau meilleur score\"), 0, 2, 6, 7)\n end\n\n pres.attach(voirGrille, 0, 1, 8, 10)\n pres.attach(quitter, 1, 2, 8, 10)\n popFin.add(pres)\n #affichage de la fenetre pop up\n popFin.show_all\n end",
"title": ""
},
{
"docid": "40769f9969d33ad71cb2389a7e574114",
"score": "0.57667994",
"text": "def institucional\n\t\t\n\tend",
"title": ""
},
{
"docid": "2fa71f67c857eefd16abf835ac1216c5",
"score": "0.5759369",
"text": "def finish; end",
"title": ""
},
{
"docid": "2fa71f67c857eefd16abf835ac1216c5",
"score": "0.5759369",
"text": "def finish; end",
"title": ""
},
{
"docid": "2fa71f67c857eefd16abf835ac1216c5",
"score": "0.5759369",
"text": "def finish; end",
"title": ""
},
{
"docid": "2fa71f67c857eefd16abf835ac1216c5",
"score": "0.5759369",
"text": "def finish; end",
"title": ""
},
{
"docid": "2fa71f67c857eefd16abf835ac1216c5",
"score": "0.5759369",
"text": "def finish; end",
"title": ""
},
{
"docid": "2fa71f67c857eefd16abf835ac1216c5",
"score": "0.5759369",
"text": "def finish; end",
"title": ""
},
{
"docid": "047655b53f43a35abd4770d7159f1fce",
"score": "0.57228094",
"text": "def Footer\n end",
"title": ""
},
{
"docid": "ef1091aaf10d95943fe7b3548e0955a2",
"score": "0.57134426",
"text": "def closedown\n \n end",
"title": ""
},
{
"docid": "9a0c11c8628071f9acf84c303f744759",
"score": "0.5706784",
"text": "def export\n \n end",
"title": ""
},
{
"docid": "61e594e9a61f84d90eff76e49f3e6eb2",
"score": "0.57019454",
"text": "def finished\n\tend",
"title": ""
},
{
"docid": "92ded0cc89cb98b4dff40c160bf65c97",
"score": "0.56974417",
"text": "def eachPartie()\r\n\t\t@listeParties.compact!\n\t\tfor item in @listeParties\n\t\t\tyield(item) # yield exécute le bloc appelant\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a8e5a29f57aef8c45b8fe6862252245b",
"score": "0.5686901",
"text": "def finished; end",
"title": ""
},
{
"docid": "df1c6c082ba0b1ed433d03da46224f15",
"score": "0.56837803",
"text": "def end_export\n end",
"title": ""
},
{
"docid": "4080ad230750222e679428206f5dcc9f",
"score": "0.5661607",
"text": "def footer\n raise NotImplementedError, 'This must be implemented in a subclass.'\n end",
"title": ""
},
{
"docid": "8fcc62a65bc45e47ee355d7ac561967e",
"score": "0.5660003",
"text": "def section; end",
"title": ""
},
{
"docid": "8fcc62a65bc45e47ee355d7ac561967e",
"score": "0.5660003",
"text": "def section; end",
"title": ""
},
{
"docid": "4fe655da88e61d28e8b9a9ed964af838",
"score": "0.5659895",
"text": "def imprensa\n\t\t\n\tend",
"title": ""
},
{
"docid": "15d8291c9742d53ac5e101814f121cdb",
"score": "0.5631705",
"text": "def eachPartie()\n\t\tfor item in @listeParties\n\t\t\tyield(item) # yield exécute le bloc appelant\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.56235635",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.56235635",
"text": "def operations; end",
"title": ""
},
{
"docid": "13f7b0d3600e07b900cdefd76c8c0799",
"score": "0.560942",
"text": "def parts; part; end",
"title": ""
},
{
"docid": "04e074efc99de627ea58633a58870ec3",
"score": "0.5608332",
"text": "def stpreason\n end",
"title": ""
},
{
"docid": "5290fed6abb3d1aa4a92144f54fe399a",
"score": "0.5603985",
"text": "def finished\n end",
"title": ""
},
{
"docid": "338ac812358fd2df02d160ea4f4a89bf",
"score": "0.56031555",
"text": "def create_sections; end",
"title": ""
},
{
"docid": "7477f36427db1eed71e3d1fe5ae5eb83",
"score": "0.5596882",
"text": "def manuver\n\tend",
"title": ""
},
{
"docid": "8704d23d47d0af916067c5189706815c",
"score": "0.55953926",
"text": "def process_end\n end",
"title": ""
},
{
"docid": "1284ad8cfe9dc7e66f41331cef91d1e2",
"score": "0.55923855",
"text": "def run_finish\n end",
"title": ""
},
{
"docid": "bafa14ea1ac57b9f707cd2809baa4314",
"score": "0.5591407",
"text": "def finish(*) end",
"title": ""
},
{
"docid": "bafa14ea1ac57b9f707cd2809baa4314",
"score": "0.5591407",
"text": "def finish(*) end",
"title": ""
},
{
"docid": "bafa14ea1ac57b9f707cd2809baa4314",
"score": "0.5591407",
"text": "def finish(*) end",
"title": ""
},
{
"docid": "8e2e2862e3b757f88dc8c13caa403f42",
"score": "0.5590908",
"text": "def finalize\n end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.55723524",
"text": "def methods; end",
"title": ""
},
{
"docid": "26afde75bfcc6a7ddab3f8d23d38b58f",
"score": "0.55598456",
"text": "def finalize\n\n end",
"title": ""
},
{
"docid": "26afde75bfcc6a7ddab3f8d23d38b58f",
"score": "0.55598456",
"text": "def finalize\n\n end",
"title": ""
},
{
"docid": "9fa4e26b96649d8d9ab37b320816e7f3",
"score": "0.5556399",
"text": "def finalize; end",
"title": ""
},
{
"docid": "9e2afb587bcfb59347b8060099c5c0b8",
"score": "0.55562395",
"text": "def finish\n nil\n end",
"title": ""
},
{
"docid": "df399de8d7156dc1c37e8db856849c84",
"score": "0.5553316",
"text": "def add_sections?; end",
"title": ""
},
{
"docid": "8525b6ec2f596e987e02419048a91851",
"score": "0.55516523",
"text": "def contents; end",
"title": ""
},
{
"docid": "8525b6ec2f596e987e02419048a91851",
"score": "0.55516523",
"text": "def contents; end",
"title": ""
},
{
"docid": "8525b6ec2f596e987e02419048a91851",
"score": "0.55516523",
"text": "def contents; end",
"title": ""
},
{
"docid": "8525b6ec2f596e987e02419048a91851",
"score": "0.55516523",
"text": "def contents; end",
"title": ""
},
{
"docid": "8525b6ec2f596e987e02419048a91851",
"score": "0.55516523",
"text": "def contents; end",
"title": ""
},
{
"docid": "8525b6ec2f596e987e02419048a91851",
"score": "0.55516523",
"text": "def contents; end",
"title": ""
}
] |
f1c512af4ff635ef2e5f429baf79cc8c
|
POST /attendees POST /attendees.json
|
[
{
"docid": "6dc857d9681803d3d5407ddceb5ed99c",
"score": "0.0",
"text": "def create\n @attendee = current_user.attendees.new(attendee_params)\n\n respond_to do |format|\n if @attendee.save\n begin\n @qr = RQRCode::QRCode.new( attendee_url(@attendee.id), :size => 5, :level => :h )\n rescue RQRCode::QRCodeRunTimeError => e\n logger.info \"Manage qr error in create #{e.inspect}\"\n end\n format.html { redirect_to @attendee, notice: 'Attendee was successfully created.' }\n format.json { render :show, status: :created, location: @attendee }\n format.js\n else\n logger.info @attendee.inspect\n format.html { render :new }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n format.js \n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "4cb96d732485683cc7460c63c1cd20d8",
"score": "0.7294385",
"text": "def create\n @attendee = @current_user.attendees.new(attendee_params)\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @attendee, notice: 'Attendee was successfully created.' }\n format.json { render :show, status: :created, location: @attendee }\n else\n format.html { render :new }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a65667c52f2e02e6a9d6e684ae9c4661",
"score": "0.7168703",
"text": "def create\n\t\tclient = OAuth2::Client.new( ENV[\"FT_UID\"], ENV[\"FT_SECRET\"], site:\"https://api.intra.42.fr\")\n\t\ttoken = client.client_credentials.get_token\n\t\t@user_quest = token.get(\"/v2/users/\" + params[:attendee][:login]).parsed\n\t\t# if @user_quest.nil?\n\t\t# \terrors.add( message: \"cannot be nil\")\n\t\t# end\n\n\t\t@attendee = current_user.attendees.build(attendee_params)\n\t\t@attendee.name = @user_quest[\"displayname\"]\n\t\trespond_to do |format|\n\t\t\tif @attendee.save\n\t\t\t\tformat.html { redirect_to @attendee, notice: 'Attendee was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @attendee }\n\t\t\t\tformat.js\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @attendee.errors, status: :unprocessable_entity }\n\t\t\t\tformat.js\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4327274e1822075fe30e5f8eb887a534",
"score": "0.70766383",
"text": "def create\n @admin_attendee = @admin_form.attendees.new(admin_attendee_params)\n respond_to do |format|\n if @admin_attendee.save\n format.html { redirect_to admin_form_attendee_path(@admin_form, @admin_attendee), notice: t('crud.created_successfully!', name: Admin::Attendee.model_name.human) }\n format.json { render :show, status: :created, location: @admin_attendee }\n else\n format.html { render :new }\n format.json { render json: @admin_attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53e87b877b318e38ad88f94cd54dfd0c",
"score": "0.70639795",
"text": "def create\n @event = current_event\n @attendee = @event.attendees.new(attendee_params)\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to root_path, notice: \n \"Awesome! You're signed up. Expect to receive an email from \n the event organizer in the next couple of days. \" }\n format.json { render json: @event, status: :created, location: @attendee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b866efada5ad013a41e12e4fa7d636b",
"score": "0.6950722",
"text": "def create\n puts \"*\" * 80\n puts attendees_param\n puts \"*\" * 80\n @event = Creators::Event.new.create_from_post(attendees_param, event_params)\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1764bdee0bf3faa664e2d648e06c1cfa",
"score": "0.6899983",
"text": "def create\n @atende = Atende.new(atende_params)\n\n respond_to do |format|\n if @atende.save\n format.html { redirect_to @atende, notice: 'Atende was successfully created.' }\n format.json { render :show, status: :created, location: @atende }\n else\n format.html { render :new }\n format.json { render json: @atende.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d74a62990af251e9aeafb01bf645109b",
"score": "0.672926",
"text": "def attendees\n @attendees = @event.attendances.with_state(:attending)\n \n respond_to do |format|\n format.html { render :partial => 'attendees' }\n format.json { render json: @attendees }\n end\n end",
"title": ""
},
{
"docid": "9a5f08ee33290ad3250e4196baae7956",
"score": "0.6670924",
"text": "def attendees=(value)\n @attendees = value\n end",
"title": ""
},
{
"docid": "9a5f08ee33290ad3250e4196baae7956",
"score": "0.6670924",
"text": "def attendees=(value)\n @attendees = value\n end",
"title": ""
},
{
"docid": "f7d7f5ab9a1076ce45e7f87c2c9ec163",
"score": "0.6622745",
"text": "def create\n @last_attendee = Attendee.last\n inc_id = 1\n unless @last_attendee.nil?\n inc_id = @last_attendee.attendee_id[2..-1].to_i + 1\n end\n params[:attendee][:attendee_id] = @event.token_for_id + \"%04d\" % inc_id\n params[:attendee][:a_platform] = params[:attendee][:a_platform].join(\";\") unless params[:attendee][:a_platform].nil?\n params[:attendee][:a_market_segment] = params[:attendee][:a_market_segment].join(\";\") unless params[:attendee][:a_market_segment].nil?\n params[:attendee][:confirmation_token] = Array.new(10) {[*'0'..'9', *'a'..'z'].sample}.join\n @attendee = Attendee.new(params[:attendee])\n AttendeeMailer.welcome_email(@attendee).deliver!\n \n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @attendee, notice: t(:successfully_created) }\n format.json { render json: @attendee, status: :created, location: @attendee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51a0dd993cb979d9d3cb8bf966f26a34",
"score": "0.6594513",
"text": "def create\n @event = Creators::Event.new.create_from_post(attendees_param, event_params)\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to '/admin/manage/event', notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffa41981f290810aa824c15114b085e0",
"score": "0.65736485",
"text": "def create\n @attendee = Attendee.new(attendee_params)\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @attendee, notice: 'Attendee was successfully created.' }\n format.json { render :show, status: :created, location: @attendee }\n else\n format.html { render :new }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d64cc9e6906e5ecbbce5af405e60dcf2",
"score": "0.65678144",
"text": "def attend\n @attendee = @event.attendees.build(:student_id => current_user.rolable.id)\n \n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @event, notice: \"Votre participation à cet événement a été enregistrée.\" }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html do\n @attendees = @event.attendees.select { |a| a unless a.student.user.nil? }\n render action: \"show\"\n end\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b32b32f25600ae8080f7ccffa77b317d",
"score": "0.65471065",
"text": "def create\n @atendee = Atendee.new(atendee_params)\n respond_to do |format|\n if @atendee.save\n format.html { redirect_to @atendee, notice: 'Atendee was successfully created.' }\n format.json { render :show, status: :created, location: @atendee }\n else\n @users = User.all\n @meetings = Meeting.all\n format.html { render :new }\n format.json { render json: @atendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d3035f9f40c9c9f5a4603c542f4ae6d",
"score": "0.65319854",
"text": "def create\n @attendee = Attendee.new(params[:attendee])\n\t\t@event = Event.find(params[:event_id])\n\t\t@attendee.event_id = @event.id\n respond_to do |format|\n if @attendee.save\n\t\t\t\tsend_message_to(@attendee, current_user)\n format.html { redirect_to [@event,@attendee], notice: 'Attendee was successfully created.' }\n format.json { render json: @attendee, status: :created, location: @attendee }\n else\n format.html { render action: \"new\", status: :unprocessable_entity }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65e2fab0cceb8c0cf64c8fc8eb5cce8d",
"score": "0.6518836",
"text": "def create\n if Attendee.find_by name: attendee_params[:name]\n @attendee = Attendee.find_by name: attendee_params[:name]\n else\n @attendee = Attendee.new(attendee_params)\n end\n \n @attendee.events << @event\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @event, notice: \"Attendee was successfully created.\" }\n # format.json { render :show, status: :created, location: @attendee }\n else\n format.html { render :new, status: :unprocessable_entity }\n # format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"title": ""
},
{
"docid": "e055d8131c75635cbeb907712f3d6f5b",
"score": "0.65139544",
"text": "def create\n @event_attendee = EventAttendee.new(params[:event_attendee])\n\n respond_to do |format|\n if @event_attendee.save\n format.html { redirect_to @event_attendee, notice: 'Event attendee was successfully created.' }\n format.json { render json: @event_attendee, status: :created, location: @event_attendee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event_attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50d2260b592feea084e6b1412a444662",
"score": "0.6471322",
"text": "def create\n @event_attendee = EventAttendee.new(event_attendee_params)\n\n respond_to do |format|\n if @event_attendee.save\n format.html { redirect_to @event_attendee, notice: 'Event attendee was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event_attendee }\n else\n format.html { render action: 'new' }\n format.json { render json: @event_attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93e43a17ae5b07fe70cb73ba20d396d3",
"score": "0.646049",
"text": "def update_attendees\n self.attendees.each do |attendee|\n attendee.update_attributes(public_event_id: self.public_event_id)\n end\n end",
"title": ""
},
{
"docid": "dd11b1c7977c29ff438aa5fd5f9027b6",
"score": "0.64580303",
"text": "def create\n # @event = Event.new(event_params)\n @user = User.find(session[:user_id])\n @event = @user.events.build(event_params)\n\n if @event.save\n @event.attendees.push(@user)\n redirect_to events_path, notice: 'Event was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "f84fd35fca75c787fdae3a48ac9565b4",
"score": "0.6442002",
"text": "def attendee_params\n params.require(:attendee).permit(:name, :email, :attending, :attendees_count)\n end",
"title": ""
},
{
"docid": "8123f352a98aaad7f6b86fbbecacac6f",
"score": "0.6408526",
"text": "def add_and_attend_meetup\n user = User.new(name: params[:user][:name],\n email: params[:user][:email],\n native_language: params[:user][:native_language])\n\n respond_to do |format|\n if user.save\n @meetup.meetup_attendees.create(user_id: user.id)\n\n flash[:success] = \"#{user.name} marked as present.\"\n format.html { redirect_to @meetup }\n format.json { render :show, status: :created, location: @meetup}\n else\n flash[:danger] = \"Problem creating user: #{user.errors.full_messages.join(\", \")}\"\n format.html { redirect_to @meetup }\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "fc05f95ac9143b776cbd10719ec0f169",
"score": "0.63648677",
"text": "def join\n @event_attendee = EventAttendee.new(attendee: @user, event: @event)\n authorize @event\n if @event_attendee.save\n render json: {\n attending: true,\n attendees: @event.attendees_counter.value,\n attendee: current_user.card_json\n }\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cc68da10ddf1b97c758b546e34ed0165",
"score": "0.6361028",
"text": "def attendee_params\n params.require(:attendee).permit(:name, :phone_number, :email, event_ids: [])\n end",
"title": ""
},
{
"docid": "c9b668c9140b4de519c39877690651b8",
"score": "0.62986135",
"text": "def set_attende\n @attendees = Attendee.find(params[:id].to_i)\n end",
"title": ""
},
{
"docid": "1fbcf897a679a995353b2dd05c1c9a6e",
"score": "0.6230565",
"text": "def create\n # if we've got an unpaid existing username\n @attendee = Attendee.where(:username => params[:attendee][:username], :paid => false).first\n if @attendee\n redirect_to edit_attendee_path(@attendee), :notice => 'Previous registration for '+@attendee.username+' was not completed, please re-check registration info and complete payment to secure registration.' and return\n end\n @attendee = @current_event.attendees.create(params[:attendee])\n\n flash[:notice] = 'Attendee was successfully created.' if @attendee.save\n respond_with(@attendee)\n\n end",
"title": ""
},
{
"docid": "efa6ec3bb4a301e85c7c1507da8aba04",
"score": "0.621349",
"text": "def create\n @event_atendee = EventAtendee.new(event_atendee_params)\n\n respond_to do |format|\n if @event_atendee.save\n format.html { redirect_to @event_atendee, notice: 'Event atendee was successfully created.' }\n format.json { render :show, status: :created, location: @event_atendee }\n else\n format.html { render :new }\n format.json { render json: @event_atendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2def0e7673bd01520f021afb38b7f3f4",
"score": "0.6197664",
"text": "def create\n # if we've got an unpaid existing username\n @attendee = Attendee.where(:username => params[:attendee][:username], :paid => false).first\n if @attendee\n redirect_to edit_register_path(@attendee), :notice => 'Previous registration for '+@attendee.username+' was not completed, please re-check registration info and complete payment to secure registration.' and return\n end\n @attendee = @current_event.attendees.create(params[:attendee])\n\n flash[:notice] = 'Attendee was successfully created.' if @attendee.save\n respond_with(@attendee, :location => register_path)\n\n end",
"title": ""
},
{
"docid": "9a585061ac48eab6d4bc8ce3d847ae6d",
"score": "0.61948997",
"text": "def create\n @event_attendee = EventAttendee.new(event_attendee_params)\n @event=Event.where('event_date>=?', Date.today).order(\"event_date ASC\").first\n @event_attendee.event_id=@event.id\n @event_attendee.paid=false\n respond_to do |format|\n if @event_attendee.save\n format.html { redirect_to root_path, notice: 'Event attendee was successfully created.' }\n format.json { render :show, status: :created, location: @event_attendee }\n else\n format.html { render :new }\n format.json { render json: @event_attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c74ed6f9ed8b5ca348e901b6fc1456c6",
"score": "0.61637515",
"text": "def attendee_params\n params.require(:attendee).permit(:user_id, :event_id, :status)\n end",
"title": ""
},
{
"docid": "8a0ae95bfe1e1496c0b7590602e858b1",
"score": "0.6159782",
"text": "def create\n @attend = Attend.new(params[:attend])\n\n respond_to do |format|\n if @attend.save\n AtndNotifier.received(@attend).deliver\n format.html { redirect_to @attend, notice: '参加登録を受付いたしました!' }\n format.json { render json: @attend, status: :created, location: @attend }\n\n p \"call format\"\n else\n format.html { render action: \"new\" }\n format.json { render json: @attend.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5efa11230ee7ce5abc9c103557545693",
"score": "0.61352664",
"text": "def attendee_params\n params.require(:attendee).permit(:name, :email, :phone, :trip_id)\n end",
"title": ""
},
{
"docid": "d2c199e2d0533971a0b169bcb9f80b12",
"score": "0.6134874",
"text": "def attendees_attributes\n return {} unless @attendees\n\n attendees = @attendees.map do |attendee|\n attendee.select { |k,_v| ['displayName', 'email', 'responseStatus'].include?(k) }\n end\n\n { \"attendees\" => attendees }\n end",
"title": ""
},
{
"docid": "db1ca30ceeb1074289c4c2b00ef1a97c",
"score": "0.6132514",
"text": "def get_attendees( params )\n LastFM.get( \"event.getAttendees\", params )\n end",
"title": ""
},
{
"docid": "06e56db45fa5f23ef43ddf479dd5a4e5",
"score": "0.612784",
"text": "def add_attendee\n gtid = params[:attendee][:gtid]\n member = Member.where(:gtid => gtid).first\n if !member.nil?\n @event = Event.find(params[:id])\n if @event.members.where(:gtid => gtid).count == 0\n Attendance.create(:member_id => member.id, :event_id => params[:id], :status => 'Present', :points => 1)\n flash[:error] = \"#{Member.find(member.id).first_name} has been added to the event!\"\n else\n flash[:error] = \"#{Member.find(member.id).first_name} is already attending the event\"\n end\n else\n redirect_to :controller => 'members', :action => 'new', :gtid => gtid, :event_id => params[:id], :createAndAdd => true\n return\n flash[:error] = 'GTID does not exist in DB'\n end\n\n respond_to do |format|\n format.html { redirect_to :action => 'show' }\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "308c184ce9ba201e0f8ed06dae30ca17",
"score": "0.61245215",
"text": "def attendeelist\n @eventid = params[:eventId]\n\n @accesstoken = params[:accessToken]\n url = URI(\"https://www.explara.com/api/e/attendee-list\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = 'multipart/form-data; boundary='\n request[\"authorization\"] = \"Bearer #{@accesstoken}\"\n request.body = \"--\\r\\nContent-Disposition: form-data; name=\\\"eventId\\\"\\r\\n\\r\\n#{@eventid}\\r\\n--\\r\\nContent-Disposition: form-data; name=\\\"fromRecord\\\"\\r\\n\\r\\n0\\r\\n--\\r\\nContent-Disposition: form-data; name=\\\"toRecord\\\"\\r\\n\\r\\n50\\r\\n----\"\n\n response = http.request(request)\n attendees = JSON.parse(response.read_body)\n @attendee = attendees[\"attendee\"]\n\n\n end",
"title": ""
},
{
"docid": "b6fe85471a31bb9fe59032450b29dfa8",
"score": "0.6109123",
"text": "def index\n\t\t@event = Event.find(params[:event_id])\n\n respond_to do |format|\n format.html { render :layout => false }# index.html.erb \n format.json { render json: @attendees }\n end\n end",
"title": ""
},
{
"docid": "d272286d04a43a4d67516c991fec13d6",
"score": "0.61015916",
"text": "def create\n @attenden = Attenden.new(attenden_params)\n\n respond_to do |format|\n if @attenden.save\n format.html { redirect_to @attenden, notice: 'Attenden was successfully created.' }\n format.json { render :show, status: :created, location: @attenden }\n else\n format.html { render :new }\n format.json { render json: @attenden.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d788b0b11700a70a90f070193923898",
"score": "0.60555106",
"text": "def meetup_params\n params.require(:meetup).permit(:date, :meetup_attendees_attributes => [:user_id])\n end",
"title": ""
},
{
"docid": "b89b97f9beb58170fa809218bf303060",
"score": "0.6039278",
"text": "def attendee_params\n params.require(:attendee).permit(:event_id, :user_id)\n end",
"title": ""
},
{
"docid": "538356696d8b53b533bcc481fd2ace1a",
"score": "0.6036214",
"text": "def new_conference_attendee_from_params\n @conference_attendee = @conference.conference_attendees.new(:user => current_user)\n end",
"title": ""
},
{
"docid": "9bb40e7cc1904161b9cbc84a6a24c8e8",
"score": "0.6032045",
"text": "def attendees_json\n attendees_attributes.to_json\n end",
"title": ""
},
{
"docid": "299a37edcb37e14bdef8741e90074514",
"score": "0.60127985",
"text": "def create\n @event = current_user.events.new(event_params)\n # @event = Event.new(event_params)\n\n \n\n respond_to do |format|\n\n\n if !@event.has_not_passed? \n\n format.html { redirect_to user_path(@event.user), notice: 'Please create an event for a future date and time'}\n format.json { render json: @event.errors, status: :unprocessable_entity }\n\n elsif (params[\"event\"][\"description\"] === \"\" || params[\"event\"][\"location\"] == \"\" || params[\"event\"][\"zip_code\"] == \"\" || params[\"event\"][\"street_address\"] == \"\" || params[\"event\"][\"neighborhood\"] == \"\")\n format.html { redirect_to user_path(@event.user), notice: 'Please fill in all information for your event.'}\n elsif @event.save \n #add the creator of an event as an attendee\n\n @attendee = @event.attendees.create(user_id: current_user.id)\n # raise StandardError\n format.html { redirect_to user_path(@event.user), notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n\n \n end\n end\n end",
"title": ""
},
{
"docid": "02387096fb23cfe31a3bc3badf54445f",
"score": "0.60121095",
"text": "def create\n @event = current_user.created_events.build(event_params)\n @event.attendees << current_user\n @event.date = DateTime.strptime(event_params[:date], \"%m/%d/%Y\")\n if @event.save\n flash[:success] = \"Event successfully created!\"\n redirect_to root_path\n else\n flash[:error] = \"Something went wrong\"\n render :new\n end\n end",
"title": ""
},
{
"docid": "c95d5c14d58a40b27662be5b2d827de3",
"score": "0.5997974",
"text": "def new_talk_attendee_from_params\n @talk_attendee = @talk.talk_attendees.new(:user => current_user)\n end",
"title": ""
},
{
"docid": "75a02fcc82b6853cffd46131e71dd858",
"score": "0.5997483",
"text": "def create\n @attend = Attend.new(attend_params)\n # @attend = Attend.new(user: current_user, start_at: Time.current)\n\n respond_to do |format|\n if @attend.save\n format.html { redirect_to @attend, notice: 'Attend was successfully created.' }\n # format.html { redirect_to root_path, notice: 'Attend was successfully created.' }\n format.json { render :show, status: :created, location: @attend }\n else\n format.html { render :new }\n # format.html { redirect_to root_path, notice: 'Attend was successfully created.' }\n format.json { render json: @attend.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d51dba70574ceeb14ab80259f1a758b",
"score": "0.59895116",
"text": "def create\n #logger.info \"Token for user #{@certified.user.email}: #{@certified.user.token}\"\n\n attendees = SimpleEventickApi::Attendee.all @certified.user.token, @certified.event_id\n\n @attendee = attendees.select { |x| x.email == params[:email] }.first\n\n if @attendee != nil\n logger.info \"Attendee name is #{@attendee.name}\"\n render 'result' , layout: false\n elsif\n logger.info \"Attendee not found\"\n redirect_to generate_new_url(params), notice: 'This user does not in roll list of event.'\n end\n end",
"title": ""
},
{
"docid": "e479b414b2f8bec7b40a754b0b03403b",
"score": "0.598857",
"text": "def create\n @attendee = Attendee.new(params[:attendee])\n\n @attendee.conferences = Array.new\n\n params[:conferences].each do |c|\n @attendee.conferences << Conference.find(c)\n end\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to(@attendee, :notice => 'Attendee was successfully created.') }\n format.xml { render :xml => @attendee, :status => :created, :location => @attendee }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attendee.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a582d7f06124f128910a44e843a62d21",
"score": "0.59868246",
"text": "def create\n @attender = Attender.new(attender_params)\n\n respond_to do |format|\n if @attender.save\n format.html { redirect_to @attender, notice: 'Attender was successfully created.' }\n format.json { render action: 'show', status: :created, location: @attender }\n else\n format.html { render action: 'new' }\n format.json { render json: @attender.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "227e900b10b5b4deb6f8e25b4be93fb4",
"score": "0.59620047",
"text": "def attending\n \tuser = FacebookAccount.find_by_fb_id( current_user.identifier ).user\n event = FbGraph::Event.fetch(params[:id])\n result = event.attending!(:access_token => user.access_token)\n\n render :json => result.to_json\t\n end",
"title": ""
},
{
"docid": "6fafa2283e703169753b291df55792df",
"score": "0.59514403",
"text": "def create\n @not_attending = NotAttending.new(not_attending_params)\n\n respond_to do |format|\n if @not_attending.save\n format.html { redirect_to @not_attending, notice: 'Not attending was successfully created.' }\n format.json { render :show, status: :created, location: @not_attending }\n else\n format.html { render :new }\n format.json { render json: @not_attending.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d0630d5a02b3d631a380b2d33327d29",
"score": "0.5949349",
"text": "def create\n @atendente = Atendente.new(params[:atendente])\n\n respond_to do |format|\n if @atendente.save\n format.html { redirect_to @atendente, :notice => 'Atendente was successfully created.' }\n format.json { render :json => @atendente, :status => :created, :location => @atendente }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @atendente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "593361dae1be2fe617c240ad913c4cb4",
"score": "0.5947271",
"text": "def index\n @attendees = Attendee.all\n respond_with(@attendees)\n end",
"title": ""
},
{
"docid": "593361dae1be2fe617c240ad913c4cb4",
"score": "0.5947271",
"text": "def index\n @attendees = Attendee.all\n respond_with(@attendees)\n end",
"title": ""
},
{
"docid": "a628e3dc503348dd8b6ee3ae6bcb26fa",
"score": "0.5941068",
"text": "def attendee_params\n params.require(:attendee).permit(:name, :phone, :email, :dob, :address, :postnumber, :town, :event_id, :school_id)\n end",
"title": ""
},
{
"docid": "1dc5ac4e8826b579f8737f3948d8711f",
"score": "0.59151417",
"text": "def atendence_params\n params.require(:atendence).permit(:atendee_id, :attended_event_id)\n end",
"title": ""
},
{
"docid": "efefb49460ec919fc6e0ba4140c1bd3c",
"score": "0.59127873",
"text": "def create\n @attendace = Attendace.new(attendace_params)\n\n respond_to do |format|\n if @attendace.save\n format.html { redirect_to @attendace, notice: 'Attendace was successfully created.' }\n format.json { render :show, status: :created, location: @attendace }\n else\n format.html { render :new }\n format.json { render json: @attendace.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cab7b4cb27a596fe9046e6f36203cc88",
"score": "0.5905993",
"text": "def create\n @backend_conf_attendee = Conf::Attendee.new(backend_conf_attendee_params)\n\n respond_to do |format|\n if @backend_conf_attendee.save\n format.html { redirect_to backend_conf_attendee_path(@backend_conf_attendee), notice: 'Conf attendee was successfully created.' }\n format.json { render :show, status: :created, location: backend_conf_attendee_path(@backend_conf_attendee) }\n else\n format.html { render :new }\n format.json { render json: @backend_conf_attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fc37fce86b6058a1574d69691495a2f",
"score": "0.59011626",
"text": "def create\n @atendente = Atendente.new(atendente_params)\n\n respond_to do |format|\n if @atendente.save\n format.html { redirect_to @atendente, notice: 'Atendente was successfully created.' }\n format.json { render :show, status: :created, location: @atendente }\n else\n format.html { render :new }\n format.json { render json: @atendente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56b4341f7a01d3b59099d1330384c782",
"score": "0.589894",
"text": "def attendee_params\n params.require(:attendee).permit(:user_id, :name, :about, :image)\n end",
"title": ""
},
{
"docid": "3da57cfa0f2f90a5ac51af8a3477fa06",
"score": "0.5894257",
"text": "def create\n invitees = params[:user_id]\n @event = current_user.created_events.new(event_params)\n respond_to do |format|\n if @event.save\n invitees.each do |id| \n # binding.pry\n @event.event_invites.create(user_id: id, sender_id: current_user.id)\n @event.invites.create(user_id: id)\n end\n @event.invites.create(user_id: current_user.id, rsvp: \"Attending\")\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "330dd284397609a73bb2a9740b8743d4",
"score": "0.58909017",
"text": "def new\n @attendee = Attendee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attendee }\n end\n end",
"title": ""
},
{
"docid": "330dd284397609a73bb2a9740b8743d4",
"score": "0.58909017",
"text": "def new\n @attendee = Attendee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attendee }\n end\n end",
"title": ""
},
{
"docid": "3c466eb4d558f701265ff44a87869e8b",
"score": "0.58890903",
"text": "def attendee_params\n params.require(:attendee).permit(:name)\n end",
"title": ""
},
{
"docid": "0fc1b622c40a01ea1526e573de5d92f9",
"score": "0.5882709",
"text": "def create\n if params[:create_meeting_with_attendee].to_s.to_boolean(false) || ChimeSdk.config.create_meeting_with_attendee\n create_meeting_with_attendee\n else\n create_meeting\n end\n respond_to do |format|\n format.html { redirect_to meeting_resource_path(meeting_id), notice: \"Meeting <#{meeting_id}> was successfully created.\" }\n format.json { render status: 201, json: @meeting.merge(@attendee || {}) }\n end\n end",
"title": ""
},
{
"docid": "7262a97334c5fbb12e0acfb647078c04",
"score": "0.5882667",
"text": "def create\n attendee = @certified.attendees[params[:email]]\n\n if attendee\n\t\t\t@name = attendee.upcase\n render 'result', layout: false\n elsif\n redirect_to generate_new_url(params), notice: 'Seu email não foi localizado, por favor utilize o mesmo email utilizado no Eventick.'\n end\n end",
"title": ""
},
{
"docid": "325075569eae62029cbac5b5a8e70250",
"score": "0.5878236",
"text": "def create\n unless params[:attendee][:e_city].blank?\n params[:attendee][:attendee_id] = (params[:attendee][:e_city][0].upcase + Array.new(2){[*'0'..'9'].sample}.join + [\"0\", \"2\", \"4\", \"6\", \"8\"].sample)\n while !Attendee.find_by_attendee_id(params[:attendee][:attendee_id]).nil?\n params[:attendee][:attendee_id] = (params[:attendee][:e_city][0].upcase + Array.new(2){[*'0'..'9'].sample}.join + [\"0\", \"2\", \"4\", \"6\", \"8\"].sample)\n end\n end\n params[:attendee][:a_platform] = params[:attendee][:a_platform].join(\";\") unless params[:attendee][:a_platform].nil?\n params[:attendee][:a_market_segment] = params[:attendee][:a_market_segment].join(\";\") unless params[:attendee][:a_market_segment].nil?\n @attendee = Attendee.new(params[:attendee])\n\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @attendee, notice: t(:successfully_created) }\n format.json { render json: @attendee, status: :created, location: @attendee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "638caca940f892c9efdae2644bc6f7bc",
"score": "0.5862005",
"text": "def attendee_params\n params.require(:attendee).permit(:user_id, :event_id, :team_id)\n end",
"title": ""
},
{
"docid": "7e686ee6122ac7c7ec48571bbd989c99",
"score": "0.58561695",
"text": "def add_to_firebase\n new_event = {\n creator: {\n name: @creator.name,\n phone: @creator.phone,\n email: @creator.email\n },\n time: @event_time,\n deadline: @deadline, \n event_name: @event_name,\n event_description: @event_description, \n location: @event_location, \n attendees: [], #@attendees,\n minimum: @minimum_attendees.to_i, \n maximum: @maximum_attendees.to_i,\n create_date: @create_date,\n modify_date: @modify_date\n }\n new_event = new_event.to_json\n\n response = Unirest::post \"https://gamestarter.firebaseio.com/events.json\",\n { \"Accept\" => \"application/json\" }, new_event\n end",
"title": ""
},
{
"docid": "85d1bd8bb426989d5a6f52425f189956",
"score": "0.58530164",
"text": "def atendee_params\n params.require(:atendee).permit(:name, :meeting_id)\n end",
"title": ""
},
{
"docid": "3f2f87361d68d6060fbc2cd57a05a00d",
"score": "0.585036",
"text": "def attend\n @cuid = isSignedIn ? current_user.id : nil\n if @cuid == nil\n redirect_to \"/users/sign_in\", notice: \"You must be signed in to attend events.\"\n else\n @event = Event.find_by(id: params[:eid])\n if @event != nil && (@event.private ? (isInvited(@event.id, @cuid) || @event.user_id == @cuid) : true)\n if !isAttending(@event.id, @cuid)\n @attending = @event.attendings.build(:event_id => @event.id, :user_id => @cuid)\n @attending.save\n deleteNotificationIfExists(@event.id, @cuid)\n respond_to do |format|\n format.html { redirect_to \"/events/\" + @event.id.to_s, notice: 'Confirmed attendance.' }\n format.json { head :no_content }\n end\n else\n deleteNotificationIfExists(@event.id, @cuid)\n redirect_to \"/events/\" + @event.id.to_s, notice: \"You are already attending this event.\"\n end\n else\n redirect_to \"/events/\", notice: \"You cannot attend this event without an invite.\"\n end\n end\n end",
"title": ""
},
{
"docid": "875fd2db29ae7672fca1132dc6a9e0da",
"score": "0.5842735",
"text": "def create\n @attendence = Attendence.new(attendence_params)\n respond_to do |format|\n if @attendence.save\n format.html { redirect_to @attendence}\n format.json { render :show, status: :created, location: @attendence }\n else\n format.html { render :new }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b7c080296b457d76ec2b036b1ff1d16",
"score": "0.58425015",
"text": "def new\n @event = current_event\n @attendee = Attendee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attendee }\n end\n end",
"title": ""
},
{
"docid": "9beb13adaa043820f58138e03431867f",
"score": "0.5828251",
"text": "def create\n params.each do |key, value|\n end\n\n @trips = Trip.all\n @attendee = Attendee.new(attendee_params)\n @attendee.trip_id = params[:trip_id]\n @attendee.user_id = current_user.id\n @attendee.balance = 0\n @attendees = Attendee.where(trip_id: params[:trip_id])\n @trip_length_night = (@trip.end_date - @trip.start_date).to_i\n @price_per_night = @trip.price_per_night\n @total_cost = @price_per_night.to_i * @trip_length_night.to_i\n\n if @attendee.save\n @total_confirmed_accomodation_cost_per_person = @total_cost.to_i / @attendees.size\n @trip.update_attribute(:total_confirmed_cost, @total_confirmed_accomodation_cost_per_person)\n redirect_to @trip, notice: 'A new guest has joined your trip!'\n else\n render json: @attendee.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0eeb6eb3025366faa9046789e9ea8d27",
"score": "0.5810748",
"text": "def attend\n @auth = User.find_by(email: current_userlogin.email)\n redirect_to memberDashboard_path unless @auth\n @point_event = PointEvent.find(params[:id])\n @user = User.where(email: current_userlogin.email).first\n\n return unless request.post?\n\n attendance = PointEventAttendee.find_by(user_id: @user.id, point_event_id: @point_event.id)\n # If the user has signed up\n if attendance\n # If the user has not attended\n if !attendance.attended\n attendance.attended = true\n attendance.save\n flash[:notice] = \"Successfully attended #{@point_event.name}!\"\n redirect_to @point_event\n else\n flash[:notice] = \"Could not attend #{@point_event.name} because you did not sign up for the engagement.\"\n redirect_to @point_event\n nil\n end\n elsif @point_event.capacity.positive?\n # If the capacity is greater than zero, require signing up for the engagement to attend.\n flash[:notice] = \"Could not attend #{@point_event.name} because you did not sign up for the engagement.\"\n redirect_to @point_event\n nil\n else\n # Force a user in and set them as attended.\n @point_event.users << @user\n attendance = PointEventAttendee.find_by(user_id: @user.id, point_event_id: @point_event.id)\n attendance.attended = true\n attendance.save\n flash[:notice] = \"Successfully attended #{@point_event.name}!\"\n redirect_to @point_event\n end\n end",
"title": ""
},
{
"docid": "fd1d00dd3f6e831cb2519b7a45617c16",
"score": "0.58081484",
"text": "def attend\n @auth = User.find_by(email: current_userlogin.email)\n redirect_to member_dashboard_path unless @auth\n @event = Event.find(params[:id])\n @user = User.where(email: current_userlogin.email).first\n\n return unless request.post?\n\n attendance = EventAttendee.find_by(user_id: @user.id, event_id: @event.id)\n # If the user has signed up\n if attendance\n # If the user has not attended\n if !attendance.attended\n attendance.attended = true\n attendance.save\n flash[:notice] = \"Successfully attended #{@event.name}!\"\n else\n flash[:notice] = \"You have already attended #{@event.name}!\"\n end\n redirect_to @event\n elsif @event.capacity.positive?\n # If the capacity is greater than zero, require signing up for the event to attend.\n flash[:notice] = \"Could not attend #{@event.name} because you did not sign up for the event.\"\n redirect_to @event\n nil\n else\n if DateTime.now > @event.endDate\n flash[:notice] = \"Could not attend #{@event.name} because the event has already ended.\"\n else\n # Force a user in and set them as attended.\n @event.users << @user\n attendance = EventAttendee.find_by(user_id: @user.id, event_id: @event.id)\n attendance.attended = true\n attendance.save\n flash[:notice] = \"Successfully attended #{@event.name}!\"\n end\n redirect_to @event\n end\n end",
"title": ""
},
{
"docid": "edac5d51a3b7b5a3466e73e81779cc34",
"score": "0.5789851",
"text": "def attendee_params\n params.require(:attendee)\n .permit(:name,\n :email,\n :active_user,\n :school_name,\n :contact_number,\n :notes,\n :webinar_id)\n end",
"title": ""
},
{
"docid": "945a6717183171082da43d7570ea019f",
"score": "0.5789226",
"text": "def attendee_params\n params.require(:attendee).permit(:event_id, :member_id, :temperature)\n end",
"title": ""
},
{
"docid": "4832f52eddfb232dab067a68816f3be9",
"score": "0.5785456",
"text": "def attend\n @demo_day.add_attendee!(current_user)\n redirect_to :action => :index\n end",
"title": ""
},
{
"docid": "ae89df496754f43510bcdbaf7a80f6d7",
"score": "0.5784847",
"text": "def update\n respond_to do |format|\n if @attendee.save\n format.html { redirect_to @trip, notice: 'Attendee was successfully created.' }\n format.json { render :show, status: :created, location: trip_path }\n else\n format.html { redirect_to @trip, notice: 'Attendee not successfully created.' }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f94f57c3fa7c82bb0227272f3b20da1",
"score": "0.5767034",
"text": "def set_atende\n @atende = Atende.find(params[:id])\n end",
"title": ""
},
{
"docid": "7030de329cbac1dc12611236f705bd47",
"score": "0.5766403",
"text": "def attendee_params\n params.require(:attendee).permit(:f_name, :l_name, :email, :phone_number, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "6852cf1b4b6f184a8dac43cce81801c0",
"score": "0.5765462",
"text": "def add_booking\n @userId = UserService.find_user session[:user]\n userId = params[:user]\n attendees = params[:attendees]\n @room = Room.find(params[:room])\n @day = DateTime.parse(params[:day])\n @from = params[:from].to_i\n @to = @from + 2\n @booking = BookingService.create_booking(@room, @day, @from, @to, User.find(userId),attendees,true)\n if (attendees != \"\")\n puts \"sent email to #{attendees}\"\n attendeeList = attendees.split(\",\")\n attendeeList.each {|a| LibraryMailer.send_email(a,@booking,User.find(userId)).deliver}\n end\n redirect_to action: \"manage_bookings\"\n end",
"title": ""
},
{
"docid": "bd90ee430d5694cde29f831e582e4ac0",
"score": "0.5764885",
"text": "def create\n @meeting = Meeting.new(params[:meeting])\n @all_meeting_types = MeetingType.get_all_meeting_types.collect{|m| [m.name,m.id]}\n \n respond_to do |format|\n if @meeting.save\n AttendeeMailer.send_email(@meeting).deliver\n format.html { redirect_to @meeting, :notice => 'Meeting was successfully created.' }\n format.json { render :json => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24fbfbb9ed6e0862805f7f78536faaa8",
"score": "0.57625693",
"text": "def create\n @emailannouncement = Emailannouncement.new(params[:emailannouncement])\n\n respond_to do |format|\n if @emailannouncement.save\n format.html { redirect_to @emailannouncement, notice: 'Emailannouncement was successfully created.' }\n format.json { render json: @emailannouncement, status: :created, location: @emailannouncement }\n RegMailer.contact_registrants(@emailannouncement).deliver\n else\n format.html { render action: \"new\" }\n format.json { render json: @emailannouncement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85b716e5c0d7e291df4a6988ae8d20cd",
"score": "0.5749943",
"text": "def new\n @attendee = Attendee.new\n respond_with(@attendee)\n end",
"title": ""
},
{
"docid": "85b716e5c0d7e291df4a6988ae8d20cd",
"score": "0.5749943",
"text": "def new\n @attendee = Attendee.new\n respond_with(@attendee)\n end",
"title": ""
},
{
"docid": "8d7e378ec587e13173cf65168c3da649",
"score": "0.5749779",
"text": "def request_to_attend(attendee)\n args = {\n event_id: event.id.to_s,\n event_name: event.name,\n event_thumb_url: event.thumb_url,\n attendee_name: attendee.display_name,\n attendee_id: attendee.id.to_s,\n attendee_thumb_url: attendee.thumb_url\n }\n event.user.notifications.create({\n args: args,\n message_type: 'event_request_to_attend'\n })\n delayed_mailer.send_request_to_attend(event, event.user, attendee).deliver_now\n end",
"title": ""
},
{
"docid": "dcdb624ecf77571923ae2ff53e9eebb6",
"score": "0.5748738",
"text": "def unattend\n @attendee = @event.attendees.where(:student_id => current_user.rolable.id).first\n \n if @attendee\n @attendee.destroy\n respond_to do |format|\n format.html { redirect_to @event, notice: \"Votre participation à cet événement a été supprimée.\" }\n format.json { render json: @event, status: :created, location: @event }\n end\n else\n respond_to do |format|\n format.html { redirect_to @event, notice: \"Vous ne participez pas à cet événement.\" }\n format.json { render json: @event, status: :created, location: @event }\n end\n end\n end",
"title": ""
},
{
"docid": "cf5cc2360edaf7313f69fb5bff1c2daa",
"score": "0.5746828",
"text": "def attendee_params\n\t\tparams.require(:attendee).permit(:name, :login, :user_id)\n\tend",
"title": ""
},
{
"docid": "cf5cc2360edaf7313f69fb5bff1c2daa",
"score": "0.5746828",
"text": "def attendee_params\n\t\tparams.require(:attendee).permit(:name, :login, :user_id)\n\tend",
"title": ""
},
{
"docid": "57ab72780798104db26249190f525bff",
"score": "0.5746291",
"text": "def attendee_params\n params.require(:attendee).permit(:name, :tel_no, :email, :gender, :programming_lang, :session_id)\n end",
"title": ""
},
{
"docid": "d76e2cf053afb5817fd1661cbbe3fecb",
"score": "0.57424355",
"text": "def new\n @event_attendee = EventAttendee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_attendee }\n end\n end",
"title": ""
},
{
"docid": "e79a98afa3f38ea3c38b6c0b21e50a20",
"score": "0.5739618",
"text": "def create\n @user = get_user\n @meeting = Meeting.new(params[:meeting])\n @attendees = Usermeeting.find_all_by_meeting_id_and_is_attending(@meeting, 1)\n @actual = []\n for attendee in @attendees\n @actual << User.find_by_id(attendee.user_id)\n end\n respond_to do |format|\n if @meeting.save\n flash[:notice] = 'Meeting was successfully created.'\n \n Usermeeting.create(:user_id => @user.id, :meeting_id => @meeting.id, :is_host => 1, :is_attending => 1)\n \n #*************************************************************\n for attendee in @actual\n Meetingmailer.deliver_meeting_notification(attendee,@meeting)\n end\n #*************************************************************\n format.html { redirect_to(@meeting) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cefcd17661c4fa5d951721a30d610a15",
"score": "0.5734943",
"text": "def attendee_params\n params.require(:attendee).permit(:ticket_id, :user_id)\n end",
"title": ""
},
{
"docid": "c7883711cb33b21736ec83a80c0cd694",
"score": "0.573242",
"text": "def new\n @meeting = Meeting.new\n #@attendees = current_user.organization.attendees\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"title": ""
},
{
"docid": "917daa75f6c1fde8f56be5c254fbd2d8",
"score": "0.5725873",
"text": "def create\n @default_rehearsal_attendee = DefaultRehearsalAttendee.new(default_rehearsal_attendee_params)\n\n respond_to do |format|\n if @default_rehearsal_attendee.save\n format.html { redirect_to @default_rehearsal_attendee, notice: 'Default rehearsal attendee was successfully created.' }\n format.json { render :show, status: :created, location: @default_rehearsal_attendee }\n else\n format.html { render :new }\n format.json { render json: @default_rehearsal_attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62bcf6bb4a5d40d9c96993b29f108210",
"score": "0.57148635",
"text": "def create\n\t\t@agenda = Agenda.new(params[:agenda])\n\t\t@agenda.instructor = current_instructor if current_instructor\n\t\trespond_to do |format|\n\t\t if @agenda.save\n \t\t send_mail(@agenda.week.title, @agenda.title, @agenda.body) if (params[:mail][:flag] == \"1\") \n\t\t\t format.html { redirect_to admin_agendas_path, notice: 'Agenda was successfully created.' }\n\t\t\t format.json { render json: @agenda, status: :created, location: @agenda }\n\t\t else\n\t\t\t format.html { render action: \"new\" }\n\t\t\t format.json { render json: @agenda.errors, status: :unprocessable_entity }\n\t\t end\n\t\tend\n\t end",
"title": ""
},
{
"docid": "e5cfe3f4ee108df5e8b03f1bfc157e7c",
"score": "0.5712006",
"text": "def index\n @attendees = Attendee.all\n end",
"title": ""
},
{
"docid": "29481bc5b7e9a077b5ce7085dc123267",
"score": "0.57112694",
"text": "def create\n @event = current_user.events.build(event_params) if user_logged_in\n respond_to do |format|\n if @event.save\n Attendance.create(attendee_id: current_user.id, attended_event_id: @event.id)\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "859a0293353ace2d83217af06c61a331",
"score": "0.57103115",
"text": "def attend\n if @event.external?\n render_error(:message => \"Event is external; you cannot sign up for it through Villagecraft\", :status => 403)\n elsif @event.slots_left <= 0\n render_error(:message => \"Event is full\", :status => 403)\n elsif current_user.attending_event?(@event)\n render_error(:message => \"You are already attending this event\", :status => 403)\n else\n current_user.attends << @event\n @event.create_activity key: 'event.interested', owner: current_user\n \n unless (@event.workshop.greeting_subject.blank? or @event.workshop.greeting_body.blank?)\n # create the greeting email to be sent right away\n Message.create!(:from_user => @event.host,\n :to_user => current_user, \n :apropos => @event, \n :subject => @event.workshop.greeting_subject,\n :body => @event.workshop.greeting_body)\n end\n\n # late signups should be sent the warmup immediately\n mtg = @event.first_meeting\n if mtg.immediately_send_warmup_message_to_late_signup?\n Message.create!(\n :from_user => mtg.event.host, \n :to_user => current_user,\n :send_at => 1.minute.from_now,\n :apropos => mtg.workshop,\n :subject => mtg.workshop.warmup_subject,\n :body => mtg.workshop.warmup_body)\n end\n \n respond_to do |format|\n format.html { redirect_to @event.workshop, notice: \"Thanks for signing up.\" }\n format.json { render json: {:location => @event.location}, status: :ok }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
}
] |
e2f77dee920d2bb3670cf2b31fd63f4c
|
Another hack, to see if Capybara sessions have been used
|
[
{
"docid": "4488dc6033ce72a41674e91f6e9b9e07",
"score": "0.0",
"text": "def is_session_touched?(session)\n session.instance_variable_get(:@touched)\n end",
"title": ""
}
] |
[
{
"docid": "d6d2415afaf43289e0f0ce98685b0479",
"score": "0.7362217",
"text": "def capybara_sessions\n Capybara.send :session_pool\n end",
"title": ""
},
{
"docid": "c11526539a2224074a0c8669ad06dde3",
"score": "0.7171844",
"text": "def touch_session\n page.execute_script('')\nrescue Capybara::NotSupportedByDriverError\n false\nend",
"title": ""
},
{
"docid": "68a251beb4210af9b1d489056340d3cd",
"score": "0.7030252",
"text": "def session_working?\n @session_working\n end",
"title": ""
},
{
"docid": "3339c1bc37628b9eccbba656c731391b",
"score": "0.6980065",
"text": "def browser_status\n\n # Create bogus browser for testing purposes.\n if RAILS_ENV == 'test'\n @session_working = TEST_SESSION_WORKING\n @cookies_enabled = TEST_COOKIES_ENABLED\n @js = TEST_JS\n @ua = TEST_UA\n @ua_version = TEST_UA_VERSION\n return true\n end\n\n ua = request.env['HTTP_USER_AGENT']\n ip = request.env['HTTP_X_FORWARDED_FOR'] ||\n request.env['HTTP_CLIENT_IP'] ||\n request.env['HTTP_REMOTE_ADDR']\n browser_id = \"#{ip}|#{ua}\"\n\n # Look up the user's browser. We keep some minimal info about all browsers\n # that do not have a working session yet.\n @@our_session_cache ||= {}\n our_session = @@our_session_cache[browser_id]\n\n if session[:_x]\n\n # Session is working, clear entry from \"our session\" cache.\n session_new = false\n @session_working = true\n if our_session\n @@our_session_cache.delete(browser_id)\n clean_our_session_cache\n end\n\n else\n session[:_x] = true\n if our_session\n\n # Session is not working, but we've seen this browser before.\n session_new = false\n @session_working = false\n our_session[:time] = Time.now\n\n else\n\n # Session in not working, and we've never seen this browser before.\n session_new = true\n @session_working = nil\n our_session = @@our_session_cache[browser_id] = { :time => Time.now }\n clean_our_session_cache\n end\n end\n\n # Is javascript enabled?\n if session[:js_override]\n @js = (session[:js_override] == :on)\n elsif params[:_js]\n @js = (params[:_js] == 'on')\n elsif session[:_js] != nil\n @js = (session[:_js] == true)\n elsif our_session && our_session[:js] != nil\n @js = (our_session[:js] == true)\n else\n @js = nil\n end\n session[:_js] = @js\n our_session[:js] = @js if our_session\n\n # Are cookies enabled?\n if cookies[:_x]\n @cookies_enabled = true\n else\n cookies[:_x] = '1'\n @cookies_enabled = session_new ? nil : false\n end\n\n # What is the user agent?\n @ua, @ua_version = parse_user_agent(ua)\n\n # print \"========================================\\n\"\n # print \"browser_id = [#{browser_id }]\\n\"\n # print \"session_new = [#{session_new }]\\n\"\n # print \"@session_working = [#{@session_working}]\\n\"\n # print \"@cookies_enabled = [#{@cookies_enabled}]\\n\"\n # print \"@js = [#{@js }]\\n\"\n # print \"@ua = [#{@ua }]\\n\"\n # print \"@ua_version = [#{@ua_version }]\\n\"\n # print \"HTTP_USER_AGENT = [#{ua }]\\n\"\n # print \"params = [#{params.inspect }]\\n\"\n # print \"========================================\\n\"\n\n # Find time zone that matches the best.\n Time.zone = cookies[:tz]\n\n # If we've never seen this user before, serve a tiny page that redirects\n # immediately to tell us the state of javascript, and lets us determine\n # whether session and cookies are woring correctly immediately. (The\n # _new thing prevents infinite loops, just in case.)\n if session_new && params[:_new] != 'true'\n render(:text => FIRST_PAGE % [\n reload_with_args(:_js => 'on', :_new => 'true'),\n reload_with_args(:_js => 'off', :_new => 'true'),\n ])\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "595d4d9db2fb7169646a6598fc663951",
"score": "0.6835021",
"text": "def live_session?\n !!(session && folder)\n end",
"title": ""
},
{
"docid": "648f10a6b21c2d5fbc2aa1b37b301890",
"score": "0.6832917",
"text": "def _rack_test_current_session; end",
"title": ""
},
{
"docid": "c2d2278dea17a61c0812f02f50afb67f",
"score": "0.6690659",
"text": "def live_session?\n !!(session && file)\n end",
"title": ""
},
{
"docid": "ff7698beeada48ef0f1d15c3c92047d1",
"score": "0.6673215",
"text": "def in_use?\n active_session = access_sessions.active.first\n !active_session.nil?\n end",
"title": ""
},
{
"docid": "ff7698beeada48ef0f1d15c3c92047d1",
"score": "0.6673215",
"text": "def in_use?\n active_session = access_sessions.active.first\n !active_session.nil?\n end",
"title": ""
},
{
"docid": "bd738dd8409d55a8cf3b48409c450a57",
"score": "0.6672712",
"text": "def page; Capybara.current_session; end",
"title": ""
},
{
"docid": "bd738dd8409d55a8cf3b48409c450a57",
"score": "0.6672712",
"text": "def page; Capybara.current_session; end",
"title": ""
},
{
"docid": "3d1cd20670b0f602ef417572795096f9",
"score": "0.66479105",
"text": "def is_running?\n request('session-get')\n true\n rescue\n false\n end",
"title": ""
},
{
"docid": "5bcbfc86f1736dd3c4d6b9a12fc6262f",
"score": "0.66206795",
"text": "def store_in_session?\n false\n end",
"title": ""
},
{
"docid": "d9cd4142483411f617c1bd81cc97e3ab",
"score": "0.66070956",
"text": "def logged_in?\n !current_tester.nil?\n end",
"title": ""
},
{
"docid": "2773f25da95856ce93d315ed4a739995",
"score": "0.6573017",
"text": "def valid_session\n nil\n end",
"title": ""
},
{
"docid": "6cb1e2af8753cb0a6c5e7b45645a327b",
"score": "0.654502",
"text": "def driver_has_current_page?\n return driver.current_url != \"about:blank\"\n end",
"title": ""
},
{
"docid": "cc7c0310e41f9da523b751a2cd57bcd0",
"score": "0.6533341",
"text": "def is_new_practical_session\n secs_since_significant_action > SESSION_TIMEOUT_SECONDS\n end",
"title": ""
},
{
"docid": "5500eaea84fe7ec5b45780a80ba6e32f",
"score": "0.65271604",
"text": "def valid_session?\n true\n end",
"title": ""
},
{
"docid": "3f3d5686c3072776e130bdd71facc7b2",
"score": "0.65191615",
"text": "def session?\n\t\t@session ? true : false\n\tend",
"title": ""
},
{
"docid": "abae8a1801d8842d7898d69d02b584db",
"score": "0.6496314",
"text": "def session_token?\n session == true\n end",
"title": ""
},
{
"docid": "c79e5d417878ce9c3bc711a350e4b6ea",
"score": "0.64962137",
"text": "def in_browser(name)\n old_session = Capybara.session_name\n\n Capybara.session_name = name\n yield\n\n Capybara.session_name = old_session\nend",
"title": ""
},
{
"docid": "ead8dcc02ab1599913c3b1b66a15e77c",
"score": "0.64889246",
"text": "def in_session?\n @in_session ||= false\n end",
"title": ""
},
{
"docid": "ead8dcc02ab1599913c3b1b66a15e77c",
"score": "0.64889246",
"text": "def in_session?\n @in_session ||= false\n end",
"title": ""
},
{
"docid": "608a8b954801ff18177f24e00cff5d33",
"score": "0.64755094",
"text": "def session?\n !expires_at || discard\n end",
"title": ""
},
{
"docid": "eff3c223f80285ba37b5995afbea7b92",
"score": "0.64688563",
"text": "def use_session? session\n visit_time = session[0][\"visit_time\"]\n return during?(visit_time,\n @start_time,\n @end_time)\n end",
"title": ""
},
{
"docid": "d2865bad6ec80e6619e524bd2ed533d1",
"score": "0.6459364",
"text": "def has_session?\n Process.kill(0, @session_pid) && @session_pid rescue false\n end",
"title": ""
},
{
"docid": "7192cdcce4866fa2363a1f26b467b0a1",
"score": "0.64402384",
"text": "def valid_session\n nil\n end",
"title": ""
},
{
"docid": "7192cdcce4866fa2363a1f26b467b0a1",
"score": "0.64402384",
"text": "def valid_session\n nil\n end",
"title": ""
},
{
"docid": "d41e060b5a7ea376cdb6711f7a101c1b",
"score": "0.64252055",
"text": "def session_exists?(req); end",
"title": ""
},
{
"docid": "d41e060b5a7ea376cdb6711f7a101c1b",
"score": "0.64252055",
"text": "def session_exists?(req); end",
"title": ""
},
{
"docid": "004813e1c736149005835523127a4a37",
"score": "0.6407893",
"text": "def session_known?\n if section\n true\n elsif cached_grade\n cached_grade.possible_sessions.size == 1\n # else no action\n end\nend",
"title": ""
},
{
"docid": "1e045633d349150a0a1d16ed522fc490",
"score": "0.64047277",
"text": "def session?\n return true if session[:user_id]\n end",
"title": ""
},
{
"docid": "dbdf5550e0fb1b77330c52c8fc721b4f",
"score": "0.6400149",
"text": "def session?\n !!@session\n end",
"title": ""
},
{
"docid": "8b69e7e05a2648556205f9e3941fb606",
"score": "0.6385809",
"text": "def session?\n @session.empty?\n end",
"title": ""
},
{
"docid": "33663bb8f1e4f679a002cd7459c3d6b6",
"score": "0.6380993",
"text": "def agent_session?\n if session[:dashboard] == 'agent'\n return true\n end\n\n false\n end",
"title": ""
},
{
"docid": "acdc6da6a1af1643ff660e9f91ba6a6d",
"score": "0.63621217",
"text": "def session_active?\n flag?(:puppet_started)\n end",
"title": ""
},
{
"docid": "8e62fda6935234ce7dbf1393254b1cbd",
"score": "0.635704",
"text": "def test_is_persistent?\n token = parse_token(login(@creds[0]))\n if valid_token?(token)\n logout(token)\n else\n raise \"Supplied creds did not yield valid session token.\"\n end\n\n if valid_token?(token)\n puts \"[!] Tokens still valid after logout.\"\n return true\n end\n\n return false\n end",
"title": ""
},
{
"docid": "3755d25c899eb404f6a8a65e47eca3fc",
"score": "0.6350344",
"text": "def session?\n return (STATE_SESSION & @state != 0) ? true : false\n end",
"title": ""
},
{
"docid": "3ba46fdd0f5b5f1b5cba435c33f7bf42",
"score": "0.6344718",
"text": "def agent_session?\n session[:dashboard] == 'agent'\n end",
"title": ""
},
{
"docid": "dab4d02504da99c2701f95be3126bee9",
"score": "0.63163453",
"text": "def current_session\n session_pool[\"#{current_driver}:#{session_name}:#{app.object_id}\"] ||= Capybara::Session.new(current_driver, app)\n end",
"title": ""
},
{
"docid": "6c57665a920bc120df81a0c32becb227",
"score": "0.6313794",
"text": "def selenium_remote?\n !(Capybara.current_driver.to_s =~ /\\Aselenium_remote/).nil?\n end",
"title": ""
},
{
"docid": "586b70f5ee5765752ca99208ec095e40",
"score": "0.6307193",
"text": "def logged_in?\n not session[:usr].nil?\n end",
"title": ""
},
{
"docid": "0de71e4ac624a39c34bb8e8ca351d2ff",
"score": "0.6296579",
"text": "def logged_in?\n session[ :user ] != nil\n end",
"title": ""
},
{
"docid": "70ca368380ee39c49e0f38e51d0c6422",
"score": "0.62872255",
"text": "def gather_session_owner?\n (@session_owner_monitor == :always) || \n (@session_owner_monitor == :on_login && \n File.exists?(\"#@tmp_dir/#@conn_changed_file\"))\n end",
"title": ""
},
{
"docid": "e375d256fcdf65005006cd14d90e6d39",
"score": "0.6285533",
"text": "def logged_in?\n page = @agent.get('https://okcupid.com')\n !page.link_with(href: '/logout').nil?\n end",
"title": ""
},
{
"docid": "d5369eba94e43edee12cd2dd07f4a0e0",
"score": "0.62825435",
"text": "def session_loaded?\n\t\treturn @session ? true : false\n\tend",
"title": ""
},
{
"docid": "8f3692e79c5a0d299ba4c2d870d9e995",
"score": "0.6272304",
"text": "def session_logged_in?\n !session[:user_id].blank?\n end",
"title": ""
},
{
"docid": "09fc31a0cb65609012bcbf0ed9aa906a",
"score": "0.6271652",
"text": "def logged_in?\n session[Shibbolite.pid]\n end",
"title": ""
},
{
"docid": "ebc82d4ff3c541e590a9337a1c0befaf",
"score": "0.625619",
"text": "def is_logged_in?\n !session[:agent_id].nil?\n end",
"title": ""
},
{
"docid": "ebc82d4ff3c541e590a9337a1c0befaf",
"score": "0.625619",
"text": "def is_logged_in?\n !session[:agent_id].nil?\n end",
"title": ""
},
{
"docid": "44a49a9fcaa38d6d9d0949bb8d8ee153",
"score": "0.625315",
"text": "def integration_test?\n defined?(post login_path)\n end",
"title": ""
},
{
"docid": "19a01a601ae410b45ce9b7223c42a9c0",
"score": "0.62471265",
"text": "def search_dev?\n session_debug?\n end",
"title": ""
},
{
"docid": "78422c9016c8d6ac79b0b77130075566",
"score": "0.62465227",
"text": "def firefox?\r\n session[:firefox]\r\n end",
"title": ""
},
{
"docid": "a1c6cd2cce988838e463bf7c39cf4d17",
"score": "0.62374914",
"text": "def no_spawned_session_for_non_exploits_except_logins\n return true unless spawned_session.present?\n return true if module_name_components.last.include?(\"login\")\n\n if module_name_components.first != 'exploit'\n errors.add(:base, 'spawned_session cannot be set for non-exploit modules. Use target_session.')\n end\n end",
"title": ""
},
{
"docid": "733c4a2bbf0adc46cfbeb194a54389d7",
"score": "0.62368584",
"text": "def session_healthy?(session)\n return false unless session\n session_healthy = false\n uri = URI(\"http://#{session[:host]}:#{session[:port]}/MySchedule.do\")\n begin\n Net::HTTP.start(uri.host, uri.port) do |http|\n request = Net::HTTP::Get.new(uri)\n request.add_field(\"Cookie\", \"#{session[:cookie]}\")\n request = http.request(request)\n # ...\n # <a style=\"display:inline\" href=\"\\"javascript:\" prelogout('null')\\\"=\"\">Log out</a>\n # ...\n session_healthy = true if /preLogout/.match(request.body)\n end\n rescue *EXCEPTIONS => @last_error\n end\n session_healthy\n end",
"title": ""
},
{
"docid": "2ac02e7961872dfe4dca22bc40a7249f",
"score": "0.6231667",
"text": "def session?\n !@persistent\n end",
"title": ""
},
{
"docid": "24e8387c671fb43df82fd470a8a7b4c1",
"score": "0.6221483",
"text": "def session_already_secured?\n (@facebook_session = session[:facebook_session]) && session[:facebook_session].secured?\n end",
"title": ""
},
{
"docid": "fdf4d72f77b1ddfd18249344dcb36ee8",
"score": "0.62205875",
"text": "def check_session\n return true if !oauth_enabled?\n \n p \"check_session\"\n if cookies[:atoken]\n session[:atoken] = cookies[:atoken]\n elsif session && session[:atoken]== nil\n start_oauth_flow\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "3c0b00ac0a0060f1a51dddfd67c1a554",
"score": "0.6210029",
"text": "def authenticated?\n !session.nil?\n end",
"title": ""
},
{
"docid": "7e7c64a90b4e047a29177d9462770d8f",
"score": "0.6204039",
"text": "def session?\n attributes[\"session\"]\n end",
"title": ""
},
{
"docid": "0186ebddcb6138fdddef109cf695c7d4",
"score": "0.62007093",
"text": "def verify_login?()\n @pages[:pools].load # can't access the property here since that tries to set cookies.\n return URI.parse(current_url).to_s.index(\"login\") == nil\n end",
"title": ""
},
{
"docid": "9c2c436efe220cfb99b59edd9eeb656e",
"score": "0.6190379",
"text": "def session_exists?\n return @session.present?\n end",
"title": ""
},
{
"docid": "0aff3da0a74be2d5253dac5d20719f8d",
"score": "0.6186674",
"text": "def logged_in?\n session_id.nil? ? false : true\n end",
"title": ""
},
{
"docid": "2d100ba015eed638aa85283fba68fa55",
"score": "0.6186205",
"text": "def logged_in?(session)\n !!session[:user_id]\n end",
"title": ""
},
{
"docid": "487e2dbfdfe73721db3f2a7a4b949764",
"score": "0.6179502",
"text": "def logged_in?\n wait_for_logout_element\n end",
"title": ""
},
{
"docid": "a3c3ac5050a3d042fc9c5fb9bbb5a0e0",
"score": "0.6177417",
"text": "def logged_in?\n @session_token != nil\n end",
"title": ""
},
{
"docid": "13ca55ec423c8006f93f2b5cc2e8e95c",
"score": "0.617722",
"text": "def is_not_authenticated?\n #if yes, it is not nil...else false\n session[:user].nil?\nend",
"title": ""
},
{
"docid": "984050a8a6ce0bcbbb82e5ad5d6251f6",
"score": "0.61657304",
"text": "def session?; end",
"title": ""
},
{
"docid": "89b0d0a3047e1163f0d60303abe12a9f",
"score": "0.6161599",
"text": "def test_session\n # The user got here by authenticating via OAuth not session cookie, but the cookie was also sent to make\n # sure that the interactive call from the browser comes from the owner of the token.\n # current_user in this call is set by the OAuth library\n # curent_user_session is set by authlogic from the cookie\n # if current_user matches the user owner of the cooke then we return 200\n if( current_token )\n @user = current_token.user\n if current_user_session && current_user_session.valid? && current_user?(current_user_session.user)\n current_token.update_attribute( :agent_version, request.headers['HTTP_X_ZZ_AGENT_VER'] )\n render :text => \"Valid Session\", :status => 200\n else\n render :text => \"Session/Token Missmatched. The signed-in user cannot use this agent\", :status => 412\n end\n else\n render :text => \"Access Token No Longer Valid, Please re-authorize.\", :status => 417\n end\n end",
"title": ""
},
{
"docid": "3eaf3811c4eb14abb9f5394010682b7a",
"score": "0.6157054",
"text": "def logged_in?\n !!session[:token]\n end",
"title": ""
},
{
"docid": "a67a35fb9d16e5739fef368483b9b2c0",
"score": "0.6156063",
"text": "def ensure_session_auth(sess)\n if request.variant == :opentracker\n authenticate_or_request_with_http_token do |token, options|\n sess.key.key == token\n end\n else\n true\n end\n end",
"title": ""
},
{
"docid": "a617e259350b0b29827f0ce6a3219fd0",
"score": "0.6155793",
"text": "def check_session_status\n logged_in? ? 'Logged in' : failure_reason\n end",
"title": ""
},
{
"docid": "9339a0f780a886b8da70fe20d99a2304",
"score": "0.6153451",
"text": "def logged_in?\n @session ? true : false\n end",
"title": ""
},
{
"docid": "d04b1539081712108b3dac04888580ec",
"score": "0.61490864",
"text": "def session_name\n if threadsafe\n Thread.current.thread_variable_get(:capybara_session_name) ||\n Thread.current.thread_variable_set(:capybara_session_name, :default)\n else\n @session_name ||= :default\n end\n end",
"title": ""
},
{
"docid": "259f9241e4419e04a7dbabcf728acb3c",
"score": "0.61484",
"text": "def exists?\n begin\n p = @session_parameters.clone\n p['new_session'] = false\n session = CGI::Session.new(cgi, p)\n rescue ArgumentError\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "4bec6530c6b4367f7b27732649926133",
"score": "0.61291337",
"text": "def using_session(name, &block)\n Capybara.using_session(name, &block)\n end",
"title": ""
},
{
"docid": "f5e381a9d712d236d474f350645249c6",
"score": "0.61221856",
"text": "def valid_session\n \n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61221594",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
},
{
"docid": "7ccd6e02d7415dd3a603d42c9e4e8195",
"score": "0.61217487",
"text": "def valid_session\n {}\n end",
"title": ""
}
] |
05aaa2c0998a6b207b5ffce3cd969d04
|
Retriev IDs of specified virtual machines
|
[
{
"docid": "b11cb07a4c44e68525d13881c141a904",
"score": "0.6410967",
"text": "def vms(range, groups)\n vms = []\n # load specific batch\n vm_pool = load_vm_pool\n return nil if vm_pool.count == 0\n\n @log.debug(\"Searching for vms based on range: #{range} and groups: #{groups}.\")\n vm_pool.each do |vm|\n unless vm['ID']\n @log.error('Skipping a record without an ID present.')\n next\n end\n\n # skip unsuitable virtual machines\n next unless want?(vm, range, groups)\n\n vms << vm['ID'].to_i\n end\n\n @log.debug(\"Selected vms: #{vms}.\")\n vms\n end",
"title": ""
}
] |
[
{
"docid": "f74234cc7cba6ba052dca316a8ed5aa6",
"score": "0.7118474",
"text": "def vm_ids\n updated = Array.new\n\n self.each('UPDATED_VMS/ID') do |id|\n updated << id.text.to_i\n end\n\n outdated = Array.new\n\n self.each('OUTDATED_VMS/ID') do |id|\n outdated << id.text.to_i\n end\n\n self.each('UPDATING_VMS/ID') do |id|\n outdated << id.text.to_i\n end\n\n error = Array.new\n\n self.each('ERROR_VMS/ID') do |id|\n error << id.text.to_i\n end\n\n [updated, outdated, error]\n end",
"title": ""
},
{
"docid": "cb060871970d7e6101fef9fc812c8b89",
"score": "0.69787514",
"text": "def virtual_machines(id)\n response = request(:get, \"/users/#{id}/virtual_machines.json\")\n response.collect { |vm| vm['virtual_machine']}\n end",
"title": ""
},
{
"docid": "cb060871970d7e6101fef9fc812c8b89",
"score": "0.69787514",
"text": "def virtual_machines(id)\n response = request(:get, \"/users/#{id}/virtual_machines.json\")\n response.collect { |vm| vm['virtual_machine']}\n end",
"title": ""
},
{
"docid": "f3ba9f8f77beda563ff46587e7a80d46",
"score": "0.67518604",
"text": "def virtual_machines\n kubevirt_client.get_virtual_machines(namespace: @namespace)\n end",
"title": ""
},
{
"docid": "e8d4b29479420fbfc27fa3dba1f31b0a",
"score": "0.63346076",
"text": "def virtualbox_nonrunning_vm_guids\n running_vms_guids = []\n `vboxmanage list runningvms`.scan(/{(.*)}/) { running_vms_guids << Regexp.last_match(1) }\n vm_guids = []\n `vboxmanage list vms`.scan(/{(.*)}/) { vm_guids << Regexp.last_match(1) unless running_vms_guids.include?(Regexp.last_match(1)) }\n\n vm_guids\nend",
"title": ""
},
{
"docid": "c3177ba1dd1b5cfdc5730cd34e8037df",
"score": "0.62915415",
"text": "def vrouter_ids\n array = Array.new\n\n self.each(\"VROUTERS/ID\") do |id|\n array << id.text.to_i\n end\n\n return array\n end",
"title": ""
},
{
"docid": "2e406a8060befe0d9f7987e686f4ff2a",
"score": "0.62887084",
"text": "def vm_instances\n @conn.vminstances\n end",
"title": ""
},
{
"docid": "e85f9ed15480114ae55e46d0cd5058a2",
"score": "0.6271772",
"text": "def xe_get_resident_vms(uuid)\n vms = Array.new\n xe_open(\"xe vm-list resident-on=#{uuid}\").each do |line|\n if line =~ /uuid.*:\\s(.*)$/\n vms << $1\n end\n end\n return vms\nend",
"title": ""
},
{
"docid": "c4bed048f2c7089b09277a687239bbd4",
"score": "0.6254087",
"text": "def stored_virtual_machines\n kubevirt_client.get_stored_virtual_machines(namespace: @namespace)\n end",
"title": ""
},
{
"docid": "b56c1133aca19e82de42c36e188ca61f",
"score": "0.62512904",
"text": "def all_vms\n collection = connection[vms_collection]\n collection.find.batch_size(999).projection(_id: 1).map { |k| k[:_id] }\n end",
"title": ""
},
{
"docid": "5ffc9bb7728a35f8de610fcd48f41f18",
"score": "0.6240922",
"text": "def vms\n vms = object.vms.select do |vm|\n !current_user ||\n current_user.id == vm.user.id ||\n current_user.admin? ||\n (current_user.lead? && vm.project.users.include?(current_user)) ||\n (current_user.dev? && vm.project.users.include?(current_user) && vm.is_jenkins)\n end\n vms.map { |v| v.id }\n end",
"title": ""
},
{
"docid": "fa1f1e743c6dd053b4fda5df92a01c56",
"score": "0.62161416",
"text": "def index\n\n @virtualmachines = Virtualmachine.all\n\n end",
"title": ""
},
{
"docid": "d8d21ca3528775c115a544df76e515af",
"score": "0.62080556",
"text": "def vms\n vms = `VBoxManage list vms`.split(\"\\n\")\nend",
"title": ""
},
{
"docid": "539e7c61b979a1bc018f715c3a396c17",
"score": "0.6177599",
"text": "def vms\n Vm.where(commit_id: @id)\n end",
"title": ""
},
{
"docid": "86098b8e0c993dfe159f4e34c04f2a45",
"score": "0.61725736",
"text": "def vms\n vms = []\n if current_user.admin?\n vms = object.vms\n elsif current_user.lead?\n vms = object.vms.select { |vm| vm.project.users.include?(current_user) }\n elsif current_user.dev?\n vms = object.vms.select { |vm| vm.user.id == current_user.id || vm.is_jenkins }\n else\n vms = object.vms.select { |vm| vm.user.id == current_user.id }\n end\n vms.map { |v| v.id }\n end",
"title": ""
},
{
"docid": "86098b8e0c993dfe159f4e34c04f2a45",
"score": "0.61725736",
"text": "def vms\n vms = []\n if current_user.admin?\n vms = object.vms\n elsif current_user.lead?\n vms = object.vms.select { |vm| vm.project.users.include?(current_user) }\n elsif current_user.dev?\n vms = object.vms.select { |vm| vm.user.id == current_user.id || vm.is_jenkins }\n else\n vms = object.vms.select { |vm| vm.user.id == current_user.id }\n end\n vms.map { |v| v.id }\n end",
"title": ""
},
{
"docid": "426808fde59596ebdb8ddd502f8a60fc",
"score": "0.6145546",
"text": "def vmsizes\n object.vmsizes.map { |v| v.id }\n end",
"title": ""
},
{
"docid": "6ba678be08a7fdd00ea3b06f992b09f4",
"score": "0.6110553",
"text": "def fetchVehicleIdList()\n com = Sumo::Traci::Command_GetVariable.new(:vehicle, :idList, \"\") ;\n @traciClient.execCommands(com) ;\n return com.responseValue() ;\n end",
"title": ""
},
{
"docid": "f56bc0754c8e398a472d21dd9e0fbf7c",
"score": "0.61080647",
"text": "def vm_names\n machines = manager.vbox.machines.find_all do |machine|\n machine.name =~ /#{Travis::Worker.config.vms.name_prefix}/\n end\n machines ? machines.map { |machine| machine.name } : []\n end",
"title": ""
},
{
"docid": "b1bd70ff64333ef99332a53878ae9887",
"score": "0.60827094",
"text": "def getVMs\n @vms = VirtualMachine.all(@ip_address)\n end",
"title": ""
},
{
"docid": "04b624f6f80c57a1a73d8ced14b05d13",
"score": "0.60374916",
"text": "def vagrant_virtualbox_mastervms_guid\n Dir[\"#{vagrant_home}/boxes/**/virtualbox/master_id\"].map do |path|\n read_file(path)\n end\nend",
"title": ""
},
{
"docid": "1f0614b12883a85ec1ab94165cce75a2",
"score": "0.6018652",
"text": "def compute_list_ids(mixins = nil)\n # TODO: impl filtering with mixins\n backend_compute_pool = ::OpenNebula::VirtualMachinePool.new(@client)\n rc = backend_compute_pool.info_all\n check_retval(rc, Backends::Errors::ResourceRetrievalError)\n\n compute = []\n backend_compute_pool.each do |backend_compute|\n compute << backend_compute['ID']\n end\n\n compute\n end",
"title": ""
},
{
"docid": "8d82f767efdd31b607f0463533b96e19",
"score": "0.60086626",
"text": "def get_vms\n return [] unless File.executable? '/usr/bin/virsh'\n\n cmd_out = Facter::Core::Execution.exec('/usr/bin/virsh list --all ').split(\"\\n\")\n\n cmd_out.shift(2) # remove the outputs headers\n\n return [] if cmd_out.empty?\n\n cmd_out.map! { |line| line.chomp }\nend",
"title": ""
},
{
"docid": "916cb8f9de5e29fdcbea6862fa435da1",
"score": "0.59928566",
"text": "def get_all_parallels_vms(options)\n message = \"Information:\\tListing Parallels VMs\"\n command = \"prlctl list --all |grep -v UUID |awk '{print $4}'\"\n vm_list = execute_command(options,message,command)\n vm_list = vm_list.split(\"\\n\")\n return vm_list\nend",
"title": ""
},
{
"docid": "083011429857711be0a19447e803066d",
"score": "0.599018",
"text": "def get_parallels_vm_uuid(options)\n message = \"Information:\\tDetermining UUID for Parallels VM \"+options['name']\n command = \"prlctl list --info \\\"#{options['name']}\\\" |grep '^ID' |cut -f2 -d:\"\n vm_uuid = vm_uuid.chomp.gsub(/^\\s+/,\"\")\n vm_uuid = execute_command(options,message,command)\n return vm_uuid\nend",
"title": ""
},
{
"docid": "8d0581cf14e816597d1e30c76c316378",
"score": "0.5981262",
"text": "def id\n vm_info['VM']['ID'].to_i\n end",
"title": ""
},
{
"docid": "63a79803403bf9b7e57cfb82016c95e6",
"score": "0.59257215",
"text": "def machines\n api_execute(version_prefix + '/machines', :get).body.split(',').map(&:strip)\n end",
"title": ""
},
{
"docid": "6e8ee04fdc1af5b883671a7cda64f123",
"score": "0.5899618",
"text": "def get_indexed_vms(dir)\n machine_list = {}\n indexfile = \"#{`echo $HOME`.chomp}/.vagrant.d/data/machine-index/index\"\n File.foreach(indexfile) do |line|\n machineindex = JSON.parse(line)\n machineindex[\"machines\"].each do |machine|\n if dir == machine[1][\"vagrantfile_path\"]\n machine_list[machine[1][\"name\"]] = machine[1][\"extra_data\"][\"box\"][\"name\"]\n end\n end\n end\n return machine_list\nend",
"title": ""
},
{
"docid": "0dabcd97a5bd0482819ab8673e35be12",
"score": "0.58882624",
"text": "def virtual_machine_templates\n kubevirt_client.get_virtual_machine_templates(namespace: @namespace)\n end",
"title": ""
},
{
"docid": "08bcc73145e6c79871418bef6d1794f1",
"score": "0.58879155",
"text": "def all_vms_info()\n str_info = \"\"\n\n @host.vm.each { |v|\n begin\n vivm = VIDriver::VIVm.new(\"\", v)\n rescue\n next\n end\n\n vivm.monitor\n\n name = v.name\n number = -1\n number = name.split('-').last if (name =~ /^one-\\d*$/)\n\n str_info << \"VM = [\"\n str_info << \"ID=#{number},\"\n str_info << \"DEPLOY_ID=\\\"#{name}\\\",\"\n str_info << \"POLL=\\\"#{vivm.info}\\\"]\\n\"\n }\n\n return str_info\n end",
"title": ""
},
{
"docid": "2790e3f6b5f1fc374d2ffcdcb3c15126",
"score": "0.5864439",
"text": "def vboxmanage_vminfo(machine_id)\n vm = Mash.new\n\n if vbox_host?\n so_cmd = \"VBoxManage showvminfo #{machine_id} --machinereadable\"\n logger.trace(so_cmd)\n so = shell_out(so_cmd)\n\n if so.exitstatus == 0\n so.stdout.lines.each do |line|\n line.chomp!\n left, right = line.split(\"=\")\n\n # remove enclosing quotes, if needed\n key =\n case left\n when /^\"(.*)\"$/\n Regexp.last_match(1)\n else\n left\n end\n\n # skip the name attribute since that is the parent key\n next if left == \"name\"\n\n # remove enclosing quotes, if needed\n value =\n case right\n when /^\"(.*)\"$/\n Regexp.last_match(1)\n else\n right\n end\n\n vm[key.downcase] = value\n end\n end\n end\n vm\n rescue Ohai::Exceptions::Exec\n logger.trace(\"Plugin VboxHost: Could not run '#{so_cmd}'. Skipping data\")\n end",
"title": ""
},
{
"docid": "3992ecdbc5af31c6671e4c20745dcab5",
"score": "0.58460927",
"text": "def virtualmachines(headers = {})\n list_virtualmachines({}, headers).resources.map do |virtualmachine|\n Resources::Virtualmachine.new(self, virtualmachine)\n end\n end",
"title": ""
},
{
"docid": "6c100286702d26675e8cebb07a2e2a08",
"score": "0.58344066",
"text": "def read_vms\n args = %w[list --all --no-header --json -o name,uuid]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms = vms_arr | templates_arr\n Hash[vms.map { |i| [i.fetch('name'), i.fetch('uuid')] }]\n end",
"title": ""
},
{
"docid": "13d3409f252ea97f74a920f4d7d972e0",
"score": "0.58143985",
"text": "def set_virtualmachine\n @virtualmachine = Virtualmachine.find(params[:id])\n end",
"title": ""
},
{
"docid": "945926836296db428e72e0aa49d9b116",
"score": "0.5814011",
"text": "def obtain_vm_data(resource)\n\n puts \"Obtaining virtual machines' data\"\n \n # ...\n \n ips = [\"IP_A\", \"IP_B\"]\n ip_roles = {:rol_a => \"IP_A\", :rol_b => \"IP_B\"}\n img_roles = {:rol_a => \"/path/to/IMG_A\", :rol_b => \"/path/to/IMG_B\"}\n \n return ips, ip_roles, img_roles\n \n end",
"title": ""
},
{
"docid": "76edd10ae23fcabe0190f5663c08c4ba",
"score": "0.5809209",
"text": "def show\n @virtualmachines = Virtualmachine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @virtualmachines }\n end\n end",
"title": ""
},
{
"docid": "3df4bca182f5410941386a907ee21dda",
"score": "0.58049715",
"text": "def machines\n response = request(:get, @machines_uri)\n response.body.split(MACHINES_SEPARATOR_RE)\n end",
"title": ""
},
{
"docid": "be50d0f9b4d955a82f279cd077ed29a8",
"score": "0.5779114",
"text": "def system_ids\n systems.map { |s| s.id }\n end",
"title": ""
},
{
"docid": "21c3475e1dc94c8e49a27fc31d291697",
"score": "0.57470185",
"text": "def edit_multiple\n @machines = Machine.find(params[:machine_ids])\n end",
"title": ""
},
{
"docid": "8692a6e281036b12f14b004f942390d2",
"score": "0.573287",
"text": "def vnet_ids\n array = Array.new\n\n self.each(\"VNETS/ID\") do |id|\n array << id.text.to_i\n end\n\n return array\n end",
"title": ""
},
{
"docid": "cb6631c4a433c51e9545082c65f32f3c",
"score": "0.57030225",
"text": "def get_pvm_instances\n pvm_instances = get(\"cloud-instances/#{guid}/pvm-instances\")[\"pvmInstances\"] || []\n\n pvm_instances.map do |pvm_instance|\n get_pvm_instance(pvm_instance[\"pvmInstanceID\"])\n end\n end",
"title": ""
},
{
"docid": "b1c4f788973d6f87c27017e44d7c8fb8",
"score": "0.56741405",
"text": "def get_vms_selector(deployment_name, ids: [])\n {\n \"Deployment\" => {\n \"Name\" => deployment_name,\n \"Limit\" => \"100%\"\n },\n \"ID\" => { \"Values\" => ids }\n }\n end",
"title": ""
},
{
"docid": "b4c2b4069217d7dcaf5cc00a16ee7114",
"score": "0.56548107",
"text": "def list_ai_vbox_vms()\n search_string = \"sol.11\"\n list_vbox_vms(search_string)\n return\nend",
"title": ""
},
{
"docid": "944aa4f4d807aa9a47701c9f97b521bf",
"score": "0.56455714",
"text": "def list_virtual_machines\n roles = []\n cloud_service = Azure::CloudServiceManagementService.new\n cloud_services = cloud_service.list_cloud_services\n cloud_services.each do |cloud_service|\n request_path = \"/services/hostedservices/#{cloud_service.name}/deploymentslots/production\"\n request = ManagementHttpRequest.new(:get, request_path)\n request.warn = true\n response = request.call\n roles << Serialization.virtual_machines_from_xml(response,cloud_service.name)\n end\n \n vnet_service = Azure::VirtualNetworkManagementService.new\n virtual_networks = vnet_service.list_virtual_networks\n \n roles.each do |role|\n next if role.nil?\n vnet = virtual_networks.select do |network|\n network.name == role.virtual_network_name\n end\n\n role.virtual_network = vnet.first unless vnet.nil? || vnet.empty?\n end\n\n roles.compact\n end",
"title": ""
},
{
"docid": "80b00247494f18e34b93f430715a0f06",
"score": "0.56451136",
"text": "def get_ids(host)\n node_uid, site_uid, grid_uid, _tdl = host.split('.')\n cluster_uid, node_num = node_uid.split('-')\n ids = { 'node_uid' => node_uid, 'site_uid' => site_uid, 'grid_uid' => grid_uid, 'cluster_uid' => cluster_uid, 'node_num' => node_num }\n return ids\nend",
"title": ""
},
{
"docid": "ad66c6fcb1eea3f67ebc5376628d8945",
"score": "0.5643868",
"text": "def with_vms_and_hosts\n NUM_HOSTS.times do |h_id|\n VMS_PER_HOST.times do |v_count|\n v_id = h_id * VMS_PER_HOST + v_count\n yield \"Vm\", v_id + 1\n end\n yield \"Host\", h_id + 1\n end\n end",
"title": ""
},
{
"docid": "d532a8551c57cf6bb81e224a12ed5e58",
"score": "0.56401545",
"text": "def get_running_fusion_vms(options)\n vm_list = %x['#{options['vmrun']}' list |grep vmx].split(\"\\n\")\n return vm_list\nend",
"title": ""
},
{
"docid": "b38e38df6aad81170ec3ac79c957acbd",
"score": "0.5639152",
"text": "def get_vmids(nodes)\n\n one_xml = REXML::Document.new( %x[ onevm list -x ] )\n #one_xml = REXML::Document.new( %x[cat /home/oneadmin/test_input.xml] )\n\n one_xml.elements.each('//VM_POOL/VM') do |vm_xml|\n\n vmid_xml = vm_xml.get_elements('ID').first\n next unless vmid_xml\n\n ip_xml = vm_xml.get_elements('TEMPLATE/NIC[1]/IP').first\n next unless ip_xml\n\n vmid = Integer(vmid_xml.text)\n ip = ip_xml.text\n\n fqdn = get_fqdn(ip)\n next unless fqdn\n\n nodes.each do |wn|\n next unless wn[:fqdn] == fqdn\n wn[:vmid] = vmid\n end\n\n end\n\nend",
"title": ""
},
{
"docid": "2f6dee7c7f849175c1047f82a07b3bcc",
"score": "0.5618951",
"text": "def query_vms(query)\n return all_vms if query.nil? || query.strip.empty?\n mongo_query = convert.query(query)\n collection = connection[vms_collection]\n collection.find(mongo_query).batch_size(999).projection(_id: 1).map { |k| k[:_id] }\n end",
"title": ""
},
{
"docid": "a7aaf0b2cc0f6b4702c0c8149105d6a8",
"score": "0.56175506",
"text": "def get_ids_by_host(data)\n result = []\n @client.api_request(:method => \"template.get\", :params => data).each do |tmpl|\n result << tmpl['templateid']\n end\n result\n end",
"title": ""
},
{
"docid": "a7aaf0b2cc0f6b4702c0c8149105d6a8",
"score": "0.56175506",
"text": "def get_ids_by_host(data)\n result = []\n @client.api_request(:method => \"template.get\", :params => data).each do |tmpl|\n result << tmpl['templateid']\n end\n result\n end",
"title": ""
},
{
"docid": "45862516b908b04931f05c6f43aedd0e",
"score": "0.5608459",
"text": "def info_set(vm_ids, extended)\n xmlrpc_info(VM_POOL_METHODS[:info_set], vm_ids, extended)\n end",
"title": ""
},
{
"docid": "08be3bf0fdd0d786b5f1df7da7427f60",
"score": "0.55895716",
"text": "def vms\n @conn.vms\n end",
"title": ""
},
{
"docid": "6f93a8b934d46404077d632e77c17314",
"score": "0.55773443",
"text": "def list_private_virtual_machine_images\n request_path = '/services/vmimages'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.virtual_machine_vmimages_from_xml(response)\n end",
"title": ""
},
{
"docid": "7a53d1b6ef26d9ec73fe018ee6e6895e",
"score": "0.5577186",
"text": "def vivo_ids\n vivo_uris.map {|uri| uri.to_s.split('/').last.to_i }\nend",
"title": ""
},
{
"docid": "84955fc26d9cf8f3c1a7cab1ad926490",
"score": "0.555511",
"text": "def list_ids(mixins = nil)\n id_list = []\n\n Backends::Ec2::Helpers::AwsConnectHelper.rescue_aws_service(@logger) do\n instance_statuses = @ec2_client.describe_instance_status(include_all_instances: true).instance_statuses\n instance_statuses.each { |istatus| id_list << istatus[:instance_id] } if instance_statuses\n end\n\n id_list\n end",
"title": ""
},
{
"docid": "9fe470750957766d6fb9666bc4d2aa3d",
"score": "0.55521005",
"text": "def get_machine_id()\n machine_id_filepath = \".vagrant/machines/default/virtualbox/id\"\n\n if not File.exists? machine_id_filepath\n # VM hasn't been created yet.\n return false\n end\n\n # This is probably not a great way to do this: shell out to the cat command.\n # It seems likely that ruby has a get-file-contents function somewhere,\n # but I'm definitely not a ruby dev right now.\n machine_id = `cat #{machine_id_filepath}`\nend",
"title": ""
},
{
"docid": "449c4fb41e1a7e7244c6b82fc989b5a2",
"score": "0.55497885",
"text": "def fetch_source_vms(machines)\n machines.inject({}) do |acc, machine|\n acc[machine.name] = API::Vm.fetch(env, machine.provider_config.vm_url)\n acc\n end\n end",
"title": ""
},
{
"docid": "1999f459c31348fa0e181d13e562c106",
"score": "0.55371904",
"text": "def load_virtualmachine\n @virtualmachine = Virtualmachine.find(params[:virtualmachine_id])\n end",
"title": ""
},
{
"docid": "515a68290eb39ff0a360a03ff1cb7288",
"score": "0.55334955",
"text": "def list_ks_vbox_vms()\n search_string = \"rhel|centos|ubuntu\"\n list_vbox_vms(search_string)\n return\nend",
"title": ""
},
{
"docid": "29d5d14ed87667799c085c63ffcac2fd",
"score": "0.5529797",
"text": "def vboxmanage_list_vms\n vms = Mash.new\n if vbox_host?\n so_cmd = \"VBoxManage list --sorted vms\"\n logger.trace(so_cmd)\n so = shell_out(so_cmd)\n\n if so.exitstatus == 0\n # parse the output\n so.stdout.lines.each do |line|\n case line\n when /^\"(\\S*)\" \\{(\\S*)\\}$/\n name = Regexp.last_match(1)\n uuid = Regexp.last_match(2)\n vms[name] = vboxmanage_vminfo(uuid)\n end\n end\n end\n end\n vms\n rescue Ohai::Exceptions::Exec\n logger.trace(\"Plugin VboxHost: Could not run 'VBoxManage list --sorted vms'. Skipping data\")\n end",
"title": ""
},
{
"docid": "6d4ed6069d3b1d31d280b8a46a815cc9",
"score": "0.5520976",
"text": "def get_vm_info()\n promise = @compute_client.virtual_machines.get(@rg_name, @instance_name)\n result = promise.value!\n OOLog.info(\"vm info :\"+result.body.inspect)\n return result.body\n end",
"title": ""
},
{
"docid": "ece387512ea271c9aabe23492033ec64",
"score": "0.5495207",
"text": "def vm_from_objects(objects)\n vm = nil\n objects.each do |object|\n if object[:kind] == \"VirtualMachine\"\n vm = object\n end\n end\n # make sure there is one\n raise ::Fog::Kubevirt::Errors::ServiceError if vm.nil?\n vm\n end",
"title": ""
},
{
"docid": "ea072e8a87cbf1a2b85ca4bae2eff9bb",
"score": "0.5495096",
"text": "def watch_virtual_machines(opts = {})\n kubevirt_client.watch_virtual_machines(opts)\n end",
"title": ""
},
{
"docid": "2dfbaedc87f3b75fb50df098b9ab5b59",
"score": "0.549495",
"text": "def vagrant_machines\n case test_environment\n when \"virtualbox\"\n vagrant_status.split(\"\\n\").select { |l| l.split(\",\")[2] == \"metadata\" }\n .map { |l| l.split(\",\")[1] }\n when \"staging\"\n hosts = YAML.safe_load(ansible_inventory_list)[\"all\"][\"children\"][\"ec2\"][\"hosts\"]\n hosts.keys.map { |k| hosts[k][\"ec2_tag_Name\"] }\n else\n raise \"unknown test_environment `#{test_environment}`\"\n end\nend",
"title": ""
},
{
"docid": "af599ac5aeb371fef9eaf0ab15910ea2",
"score": "0.54837126",
"text": "def get_kvm_hostinfo\n guests = {}\n begin\n result = `virsh list --all`\n result.split(\"\\n\").each do |line|\n if line =~ /(\\d+)\\s+(\\S+)\\s+(\\S+)/\n guest_hostname = $2\n guests[guest_hostname] = get_kvm_guest_info(guest_hostname)\n end\n end\n rescue\n warn \"Failed to run/parse virsh command\"\n end\n return guests\n end",
"title": ""
},
{
"docid": "d12de4ad89ebc7e8e82eeecdf28c9015",
"score": "0.54712003",
"text": "def service_ids\n services.collect { |s| s[\"id\"] }\n end",
"title": ""
},
{
"docid": "9701838d65663832f882f9ddf3628a50",
"score": "0.54481006",
"text": "def watch_stored_virtual_machines(opts = {})\n kubevirt_client.watch_stored_virtual_machines(opts)\n end",
"title": ""
},
{
"docid": "1c8f11af490ced31f16627939865714c",
"score": "0.54433984",
"text": "def get_vm(vm_id)\n end",
"title": ""
},
{
"docid": "fe9f9c85362e8cdd70590635c0887530",
"score": "0.54362595",
"text": "def get_volume_id(sys_id,volume_name)\n response = request(:get, \"/devmgr/v2/storage-systems/#{sys_id}/volumes\")\n status(response, 200, 'Failed to get Volumes')\n volumes = JSON.parse(response.body)\n volumes.each do |vm|\n \t return vm['id'] if vm['name'] == volume_name\n \tend\n response = request(:get, \"/devmgr/v2/storage-systems/#{sys_id}/thin-volumes\")\n status(response, 200, 'Failed to get thin Volumes')\n volumes = JSON.parse(response.body)\n volumes.each do |vm|\n return vm['id'] if vm['name'] == volume_name\n end\n \tfalse\n end",
"title": ""
},
{
"docid": "22081060224b6622dc417b0644620ca6",
"score": "0.5415351",
"text": "def ids\n @ids ||= begin\n ioctl(EVIOCGID, buf = '\\x00' * 8)\n buf.unpack('S!4')\n end\n end",
"title": ""
},
{
"docid": "30c499d6b268c58f3b926d4a453a0c15",
"score": "0.54094666",
"text": "def used_ips\n existing_kvms.map do |name|\n kvm_ip(name)\n end\nend",
"title": ""
},
{
"docid": "1c126bffcc299fbdccd37ddcd4cfaa5c",
"score": "0.5383559",
"text": "def read_vms_info\n args = %w[list --all --info --no-header --json]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms_arr | templates_arr\n end",
"title": ""
},
{
"docid": "51b5a4d17036a880077d063305aa44b3",
"score": "0.5376949",
"text": "def vm\n object.vm.id\n end",
"title": ""
},
{
"docid": "5ec15f28fbff66dcbf2c1626745df5cd",
"score": "0.5373956",
"text": "def get_varray_virtual_pools(varray_id,auth=nil, cert=nil)\n\t\trest_get(\"#{@base_url}/vdc/varrays/#{varray_id}/vpools\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n\tend",
"title": ""
},
{
"docid": "982e3abbf0e43eeb35cdd48365190a81",
"score": "0.5367486",
"text": "def list_virtual_machines(*cloud_service_names)\n roles = []\n cloud_service_names.flatten!\n if cloud_service_names.empty?\n cloud_service = client.cloud_service_management\n cloud_service_names = cloud_service.list_cloud_services.map(&:name)\n end\n cloud_service_names.each do |cloud_service_name|\n request_path = \"/services/hostedservices/#{cloud_service_name}/deploymentslots/production\"\n request = client.management_request(:get, request_path)\n request.warn = true\n response = request.call\n roles << Serialization.virtual_machines_from_xml(response, cloud_service_name)\n end\n roles.flatten.compact\n end",
"title": ""
},
{
"docid": "5343051134090f62d947df0bb18488a4",
"score": "0.5358029",
"text": "def virtual_disk_views\n client.enumerate(\"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_VirtualDiskView\")\n end",
"title": ""
},
{
"docid": "6a5d8a4bee238200388f6d42600e6e0c",
"score": "0.5352425",
"text": "def get_vm(vmId)\n params = {\n 'method' => :get,\n 'command' => \"/vApp/vm-#{vmId}\"\n }\n\n response, headers = send_request(params)\n\n os_desc = response.css('ovf|OperatingSystemSection ovf|Description').first.text\n\n networks = {}\n response.css('NetworkConnection').each do |network|\n ip = network.css('IpAddress').first\n ip = ip.text if ip\n\n networks[network['network']] = {\n :index => network.css('NetworkConnectionIndex').first.text,\n :ip => ip,\n :is_connected => network.css('IsConnected').first.text,\n :mac_address => network.css('MACAddress').first.text,\n :ip_allocation_mode => network.css('IpAddressAllocationMode').first.text\n }\n end\n\n admin_password = response.css('GuestCustomizationSection AdminPassword').first\n admin_password = admin_password.text if admin_password\n\n guest_customizations = {\n :enabled => response.css('GuestCustomizationSection Enabled').first.text,\n :admin_passwd_enabled => response.css('GuestCustomizationSection AdminPasswordEnabled').first.text,\n :admin_passwd_auto => response.css('GuestCustomizationSection AdminPasswordAuto').first.text,\n :admin_passwd => admin_password,\n :reset_passwd_required => response.css('GuestCustomizationSection ResetPasswordRequired').first.text,\n :computer_name => response.css('GuestCustomizationSection ComputerName').first.text\n }\n\n { :os_desc => os_desc, :networks => networks, :guest_customizations => guest_customizations }\n end",
"title": ""
},
{
"docid": "13e24b91da92b37b732a852522f95325",
"score": "0.5348345",
"text": "def vcenter_vms_state\n vc_uuid = @vic.vim.serviceContent.about.instanceUuid\n\n view = @vic.vim\n .serviceContent\n .viewManager\n .CreateContainerView(\n {\n :container => @cluster.item,\n :type => ['VirtualMachine'],\n :recursive => true\n }\n )\n\n pc = @vic.vim.serviceContent.propertyCollector\n\n result = pc.RetrieveProperties(\n :specSet => [\n RbVmomi::VIM.PropertyFilterSpec(\n :objectSet => [\n :obj => view,\n :skip => true,\n :selectSet => [\n RbVmomi::VIM.TraversalSpec(\n :name => 'traverseEntities',\n :type => 'ContainerView',\n :path => 'view',\n :skip => false\n )\n ]\n ],\n :propSet => [\n {\n :type => 'VirtualMachine',\n :pathSet => VM_STATE_PROPERTIES\n }\n ]\n )\n ]\n )\n\n vms_hash = {}\n\n result.each do |r|\n next unless r.obj.is_a?(RbVmomi::VIM::VirtualMachine)\n\n vms_hash[r.obj._ref + '_' + vc_uuid] = r.to_hash\n end\n\n view.DestroyView\n\n vmpool = OpenNebula::VirtualMachinePool.new(@onec)\n rc = vmpool.info(-2)\n\n return {} if OpenNebula.is_error?(rc)\n\n vms = {}\n vms_hash.each do |vm_ref, info|\n one_id = -1\n\n # Add OR to retrieve VMs that are using old deploy ID\n ids = vmpool.retrieve_xmlelements(\n \"/VM_POOL/VM[(DEPLOY_ID = '#{vm_ref}')\" \\\n ' or ' \\\n \"(DEPLOY_ID = '#{vm_ref.split('_')[0]}')]\"\n )\n\n ids.select do |vm|\n hid = vm['HISTORY_RECORDS/HISTORY/HID']\n\n if hid\n hid.to_i == @host_id\n else\n false\n end\n end\n\n one_id = ids[0]['ID'] if ids[0]\n next if one_id.to_i == -1\n\n vms[vm_ref] = {\n :id => one_id,\n :name => \"#{info['name']} - #{@cluster.item.name}\",\n :deploy_id => vm_ref,\n :state => STATE_MAP[info['summary.runtime.powerState']] || 'UNKNOWN'\n }\n end\n\n vms\n end",
"title": ""
},
{
"docid": "b97a61e395ed5217368fa0e44f8d89fb",
"score": "0.534628",
"text": "def get_virtualization_vmware_virtual_machine_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VirtualizationApi.get_virtualization_vmware_virtual_machine_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/virtualization/VmwareVirtualMachines'\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] || 'VirtualizationVmwareVirtualMachineResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"VirtualizationApi.get_virtualization_vmware_virtual_machine_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: VirtualizationApi#get_virtualization_vmware_virtual_machine_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2043dd380e52a7c818c0bea520b64270",
"score": "0.534545",
"text": "def vms_in_host?(host_id)\n\n host = OpenNebula::Host.new_with_id(host_id,get_one_client)\n\n rc = host.info\n\n if OpenNebula::is_error?(rc)\n puts rc.message\n exit -1\n end\n \n host['host_share/running_vms'].to_i\n\nend",
"title": ""
},
{
"docid": "4a21ee7e17965acfe74bdcee30868a47",
"score": "0.5306531",
"text": "def read_vms_info\n vms_arr = json([]) do\n execute_prlctl('list', '--all','--info', '--json')\n end\n templates_arr = json([]) do\n execute_prlctl('list', '--all','--info', '--json', '--template')\n end\n vms_arr | templates_arr\n end",
"title": ""
},
{
"docid": "4ea8b4ba3081a10753ed6a9808077842",
"score": "0.53026366",
"text": "def vservers\n @vservers=get_endpoint('vservers').keys\n end",
"title": ""
},
{
"docid": "7d08d86e80a8984d6d5d51666eef36df",
"score": "0.5290829",
"text": "def vm_count\n manager.vbox.machines.count do |machine|\n machine.name =~ /#{Travis::Worker.config.vms.name_prefix}/\n end\n end",
"title": ""
},
{
"docid": "5d399da3061a79b326868fb388fb076c",
"score": "0.52676725",
"text": "def probe_vm_monitor\n one_vms = ''\n vms = @db.select_one\n vms.each do |vm|\n one_vms << Base64.decode64(vm)\n end\n one_vms\n end",
"title": ""
},
{
"docid": "981df6742eb437f096d1336e0eac5642",
"score": "0.52646637",
"text": "def read_vms\n end",
"title": ""
},
{
"docid": "ec57d55c9c8f68878e73e4e141781044",
"score": "0.5258733",
"text": "def identifiers\n request[:ids]\n end",
"title": ""
},
{
"docid": "452b2d3b6c383afc95d05f5b84b86645",
"score": "0.52516735",
"text": "def virtual_machine(name)\n kubevirt_client.get_virtual_machine(name, @namespace)\n end",
"title": ""
},
{
"docid": "f7b321829ea70c8541f23e6729c1891c",
"score": "0.5243946",
"text": "def get_vm_info(name)\n output = vboxmanage('showvminfo', name, '--machinereadable')\n # Split this on the '=' sign\n split_output = []\n output = output.split(\"\\n\")\n output.each do |line|\n \tsplit_output << line.split('=')\n end\n\n # Map the array to a hash\n info_hash = Hash[split_output.map {|key, value| [key, value]}]\n\n # Remove any literal quotes\n info_hash.each do |key, value|\n \tinfo_hash[key] = value.tr(\"\\\"\",\"\")\n end\n\n info_hash\n end",
"title": ""
},
{
"docid": "a5c2864128f9cd069f627fe084ee7d57",
"score": "0.5238861",
"text": "def get_vmi\n puts \"please wait...\"\n vm_image_management = Azure.vm_image_management\n vm_image_management.list_virtual_machine_images.each do |image|\n puts \"#{image.os_type}\"\n puts \" locations: #{image.locations}\"\n puts \" name : #{image.name}\"\n puts\n end\nend",
"title": ""
},
{
"docid": "384d3dfe7d538fb112eb960bbe862bac",
"score": "0.52194536",
"text": "def obtain_vm_data(resource)\n\n puts \"Obtaining virtual machines' data\"\n return obtain_torque_data(resource[:head], resource[:compute])\n \nend",
"title": ""
},
{
"docid": "496ccf32cee5275feaa382d8f1d93e6b",
"score": "0.52184457",
"text": "def get_vm(_pool_name, _vm_name)\n # raise(\"#{self.class.name} does not implement get_vm\")\n\n return @virtual_box.get_machines_by_groups({ :groups => [_pool_name] }).select do | machine |\n begin\n machine.name\n rescue\n $logger.log('s', \"[x] skipping bad vm [#{_pool_name}] '#{machine}'\")\n next\n end\n end.map do | machine |\n { \n 'name' => machine.name,\n 'hostname' => 'localhost',\n 'template' => _pool_name,\n 'poolname' => _pool_name,\n 'boottime' => Time.new,\n 'powerstate' => machine.state, \n }\n end.first\n end",
"title": ""
},
{
"docid": "deae42e928478830c6b8ae2ed22d9460",
"score": "0.52153766",
"text": "def vm(name)\n @conn.vms.get(name)\n end",
"title": ""
},
{
"docid": "abafa9b8783b2be52905e66e55fa483e",
"score": "0.5211097",
"text": "def vms_in_pool(_pool_name)\n\n return @virtual_box.get_machines_by_groups({ :groups => [_pool_name] }).select do | machine |\n begin\n machine.name\n rescue\n $logger.log('s', \"[x] skipping bad vm [#{_pool_name}] '#{machine}'\")\n next\n end\n end.map do | machine |\n { \"name\" => machine.name }\n end\n\n end",
"title": ""
},
{
"docid": "0883116f4c59c916a6721d2fc4e402ee",
"score": "0.52013767",
"text": "def current_vm_id\n # xxxx = coreCloud.current_vm_id()\n # process xxxx based on version\n # return based on version\n\n return @current_vm_id if @current_vm_id\n\n http_client = HTTPClient.new\n http_client.connect_timeout = METADATA_TIMEOUT\n headers = {}\n\n # Using 169.254.169.254 is an EC2 convention for getting\n # instance metadata\n response = http_client.put('http://169.254.169.254/latest/api/token', nil, { 'X-aws-ec2-metadata-token-ttl-seconds' => '300' })\n if response.status == 200\n headers['X-aws-ec2-metadata-token'] = response.body #body consists of the token\n end\n\n response = http_client.get('http://169.254.169.254/latest/meta-data/instance-id/', nil, headers)\n unless response.status == 200\n cloud_error('Instance metadata endpoint returned ' \\\n \"HTTP #{response.status}\")\n end\n\n @current_vm_id = response.body\n rescue HTTPClient::TimeoutError\n cloud_error('Timed out reading instance metadata, ' \\\n 'please make sure CPI is running on EC2 instance')\n end",
"title": ""
},
{
"docid": "5a4317226d868e6cc23b169bb741813b",
"score": "0.5191441",
"text": "def workload_network_vlans\n workload_networks.map {|x| x[\"vlanId\"]}.flatten\n end",
"title": ""
},
{
"docid": "ef127660b98556b891efb2b6b17b1c37",
"score": "0.5189072",
"text": "def virtual_cpus\n domain_info[:nrVirtCpu]\n end",
"title": ""
},
{
"docid": "ef127660b98556b891efb2b6b17b1c37",
"score": "0.5189072",
"text": "def virtual_cpus\n domain_info[:nrVirtCpu]\n end",
"title": ""
},
{
"docid": "536113bb3394746c883c927b6f7edbc6",
"score": "0.5174132",
"text": "def id_ebs_volumes\n @id_ebs_volumes ||= Hash[ebs_volumes.map { |vol| [vol.volume_id, vol] }]\n end",
"title": ""
},
{
"docid": "bf7c935fe0ee0bf28670afb78714f9f8",
"score": "0.5170561",
"text": "def list_public_virtual_machine_images\n request_path = '/services/images'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.virtual_machine_images_from_xml(response)\n end",
"title": ""
}
] |
b2535b1a1fbeb0ec77588e4b9f0dad29
|
PATCH/PUT /members/1 PATCH/PUT /members/1.json
|
[
{
"docid": "4020e16d87ffc50acddbde326fb3a9a0",
"score": "0.63130623",
"text": "def update\n respond_to do |format|\n if @member.update_attributes(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n format.js \n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "973d0f3c973a223584258b0fc379de9b",
"score": "0.6816826",
"text": "def update\n if @current_user.id != @member.user_id\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n if @member.update(member_params)\n render json: @member, status: :ok\n else\n render json: @member.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5f409af04413db3ba30bfc020762eaff",
"score": "0.67805964",
"text": "def update_members(members)\n self.errors.clear\n self.messages.clear\n body = {\n :members => members.map do |m|\n {\n :id => (m.id if m.respond_to? :id),\n :login => (m.login if m.respond_to? :login),\n :role => m.role,\n :type => m.type\n }\n end\n }\n response = post(:members, nil, body.to_json)\n self.messages = extract_messages(response)\n resource = self.class.format.decode(response.body)\n p = child_prefix_options\n if resource.is_a? Array\n self.attributes[:members] = resource.map{ |r| m = self.class.member_resource.new(r, true, p); m.as = as; m }\n else\n m = self.class.member_resource.new(resource, true, p)\n m.as = as\n self.members.delete_if{ |o| o == m }\n self.members << m\n end\n true\n rescue ActiveResource::ConnectionError => e\n if e.respond_to? :response\n @remote_errors = e.response\n load_remote_errors(e.response, false, true, members, :members)\n errors[:members] = \"The #{self.class.model_name.humanize.downcase} members could not be updated.\" if errors.empty?\n end\n false\n end",
"title": ""
},
{
"docid": "2b9f03522dd6705061cbad0632ac9016",
"score": "0.67292243",
"text": "def update_members\n members = ProjectService.new.update_members(params,current_user)\n render json: {members: members}\n end",
"title": ""
},
{
"docid": "59cd7084ac337953ca0a2df157dc0a0f",
"score": "0.6693765",
"text": "def update\n respond_to do |format|\n if @member.update_attributes(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5af1e826e49676be947199804312c95",
"score": "0.6663455",
"text": "def putMember(memberId, fullName, initials, bio)\n\n\thash = Hash.new\n\thash[:fullName] = fullName\t\n\thash[:initials] = initials\t\n\thash[:bio] = bio\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/members/\"+memberId, hash \n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "c292a30ad82998d0184f5ddf8942cb4f",
"score": "0.6643316",
"text": "def update_group_members(request)\n start.uri('/api/group/member')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "26de0411604ff73655f06fa95b204292",
"score": "0.6619362",
"text": "def update\n @member = Member.find(params[:id])\n\n if @member.update(member_params)\n head :no_content\n else\n render json: @member.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4ab00a9643299646ba24b1e8aefc12c9",
"score": "0.66062284",
"text": "def update\n #@member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ab00a9643299646ba24b1e8aefc12c9",
"score": "0.66062284",
"text": "def update\n #@member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.65920675",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.65920675",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.65920675",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f06f1549ea0d3f0ddcd617b0aea3c8",
"score": "0.65920675",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3213069f815ca5a0ebab4c6b21398fc8",
"score": "0.6584884",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @member.update(member_params)\n\t\t\t\tformat.html { redirect_to @member, notice: 'Member was successfully updated.' }\n\t\t\t\tformat.json { render json: @member.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1cd40cfacfbc46c6ff6129ca16fc7d1c",
"score": "0.6566075",
"text": "def update\n @member.update_attributes unwrap_params(:member)\n respond_with(:api, @member)\n end",
"title": ""
},
{
"docid": "7d39deec2a2f0439ba6259c5584e2737",
"score": "0.65631306",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, :notice => 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d39deec2a2f0439ba6259c5584e2737",
"score": "0.65631306",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, :notice => 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d9179b65f02d48640f9d1f2066460a5",
"score": "0.65547687",
"text": "def update\n expose Member.update(@oauth_token, params[:membername], params)\n end",
"title": ""
},
{
"docid": "85507349c50d9da05563cf94f70bae9a",
"score": "0.6551955",
"text": "def update\n \n respond_to do |format|\n if @member.update(member_params) \n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58ab03b8bdb076cfa7f882cdee2d8ca6",
"score": "0.6545809",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to edit_member_path, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5f919f99d61281588b64b26632c3812",
"score": "0.6539173",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n \n \n end",
"title": ""
},
{
"docid": "eb41efb46df447c3dd00e8b70035a152",
"score": "0.653187",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member]) \n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "831783d9e12e6c2fcee0de42987d0bc7",
"score": "0.6528327",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to admin_member_url(@member), notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fa7896f7a5a9a97f5e727417a8f8a68",
"score": "0.6524277",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to members_url, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.6517594",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.6517594",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.6517594",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.6517594",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0525ad44c20980b689169e6ad410ca8c",
"score": "0.6517594",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93b3cd382ec1a5fcd6317f9e18cf86a2",
"score": "0.6515129",
"text": "def update\n #not_found() unless current_user\n @member = Member.find(params[:id])\n if @member.user_id != current_user.id\n not_found()\n end\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2187ce2c266015362fa9a8b2512b41c8",
"score": "0.6500132",
"text": "def update(data)\n @client.make_request(:post, @client.concat_user_path(\"#{CONFERENCE_PATH}/#{@conference_id}/members/#{id}\"), data)[0]\n end",
"title": ""
},
{
"docid": "12f13601e2a7b2f6eb55bd5422ddea53",
"score": "0.6495923",
"text": "def update\n respond_to do |format|\n if member.update(member_params)\n format.html { redirect_to admin_member_path(member), notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: member }\n else\n format.html { render :edit }\n format.json { render json: member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.6492828",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.64920187",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819e1a09dc2baab67af0a929401fa006",
"score": "0.6490645",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6bc47ac03d78443d805d8be0ba24986",
"score": "0.64702153",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: { message: @member.errors, status: :unprocessable_entity }, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d65a4bb97f2d557c2aa8e1c8a86f7f9",
"score": "0.64595777",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d65a4bb97f2d557c2aa8e1c8a86f7f9",
"score": "0.64595777",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed43503a383cdc67549088627a4616f9",
"score": "0.6444317",
"text": "def update\n if @member.update(member_params)\n render status: :ok, json: @member\n else\n self.send(:edit)\n end\n end",
"title": ""
},
{
"docid": "95ebe44bdba451b98b0dbd1556b3b24f",
"score": "0.6434225",
"text": "def patch_update\n group = @company.public_send(ScimRails.config.scim_groups_scope).find(params[:id])\n\n json_scim_missing_field_response(params) and return if patch_path.blank?\n\n if patch_path == :members\n case patch_operation.downcase\n when \"add\"\n add_members(group) if members_param.present?\n when \"remove\"\n remove_members(group) if members_param.present?\n end\n else\n update_attribute(group)\n end\n\n json_scim_response(object: group)\n end",
"title": ""
},
{
"docid": "b2600b5579a2744e29b5cbbb90d01eed",
"score": "0.64034075",
"text": "def update\n respond_to do |format|\n if @user_member.update(user_member_params)\n format.html { redirect_to @user_member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_member }\n else\n format.html { render :edit }\n format.json { render json: @user_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41f61991d067e8734c4e201548ad1655",
"score": "0.6366365",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to admin_members_url, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75b8ea2b25f602159cb2ffc8c47cdb72",
"score": "0.63650584",
"text": "def edit_members\n end",
"title": ""
},
{
"docid": "3a6e1bf33426525ecea563d6e5e0927c",
"score": "0.6364229",
"text": "def update\n \n \n respond_to do |format|\n if @member.update_attributes(member_params)\n format.html { redirect_to @member, notice: 'Les données ont été mises à jour' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51a0485aad722515d800d668a1f003e2",
"score": "0.6362949",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to non_member_url, notice: \"Member was successfully updated.\" }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc5622be3cb74bc8cd18b9d79d4fe655",
"score": "0.63611764",
"text": "def update\n @member.update(member_params)\n end",
"title": ""
},
{
"docid": "48b8ab482f4666e078e8fac5d52d07dc",
"score": "0.6360497",
"text": "def update\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n format.xml { head :ok }\n else\n prep_for_editing(@member)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e17334980bff5ac453f0d74c4f47c56",
"score": "0.6355871",
"text": "def update\n @user = User.find(params[:id])\n @member_id=params[:member_id]\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n if !@member_id.blank?\n @member=Member.find(@member_id.to_i)\n @user.update_attributes(:member=>@member) \n end\n format.html { redirect_to @user, notice: '会员修改成功.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60cc364444d309fb9e72fa289f9ef592",
"score": "0.63492584",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: '会员已更新。' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a375597786a2a1ad873e1df2ab9bbfc2",
"score": "0.63289064",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: '成员修改成功!' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a5b8b3cb7d677e463d1e74ac6ef0f92",
"score": "0.6327719",
"text": "def update \n current_user\n\n @member = Member.new(member_params)\n @member.save!\n\n is_admin?(@current_user) ? () : (@member.junior_enterprise_id = current_user.junior_enterprise.id)\n\n result = HTTParty.put(\"http://jeapi.herokuapp.com/members/#{params[:id]}\",\n :body => {:name => @member.name, :phone => @member.phone, :email => @member.email, :photo => @member.photo_url.to_s, :position => @member.position, :junior_enterprise_id => @member.junior_enterprise_id },\n :headers => { 'token' => JEAPI_KEY } )\n \n @member.destroy \n if result.code == 204 \n if is_admin?(@current_user)\n redirect_to \"/admin/members\", notice: \"Editado com sucesso\"\n else \n redirect_to \"/members\", notice: \"Editado com sucesso\"\n end\n else\n @errors = JSON.parse(result.body)\n is_admin?(@current_user) ? (render template: \"admin/member_edit\") : (render :edit) \n end\n end",
"title": ""
},
{
"docid": "edc2019593920b894852c03f47b87e0a",
"score": "0.63135695",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to members_url, notice: '用户信息更新成功.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7623ef5927878096dbb4fcec258a41cf",
"score": "0.63033646",
"text": "def update\n puts params[:fields]\n expose Participant.update(@oauth_token, params[:membername].strip,\n params[:challenge_id].strip, params[:fields])\n end",
"title": ""
},
{
"docid": "5ce701290a1e9d0fea1ecab6cfec459f",
"score": "0.6297726",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to :action => \"index\", :member_update_origin => \"update\" and return }\n #format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc3156db8bca4fcdfa4e29c39af52f4b",
"score": "0.62895787",
"text": "def batch_update_members(pool_id, members)\n elektron_lb2.put(\"pools/#{pool_id}/members?additive_only=true\") do\n members\n end\n end",
"title": ""
},
{
"docid": "2cc55c2caa6d88b7d00085ebd203df53",
"score": "0.6285256",
"text": "def update\n @member = Member.find(params[:id])\n respond_to do |format|\n if @member.update_attributes(params[:member])\n sign_in @member\n format.html { redirect_to @member, :notice=> 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json=> @member.errors, :status=> :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7efd4c6b2f2e1e71adf9dfcc28413795",
"score": "0.62796974",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_with(@member) do |format|\n if @member.update_attributes(params[:member])\n if @member.avatar\n if @member.avatar_file_name != nil\n @member.update_attribute(:image_url, @member.avatar.url(:medium))\n else\n @member.update_attribute(:image_url, nil)\n end\n end\n if current_user.id == @member.user_id\n format.html { redirect_to root_url, notice: 'Member was successfully updated.' }\n else\n format.html { redirect_to family_lists_path, notice: 'Member was successfully updated.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a19e5b3f26f092adbb5f1289ac41ec88",
"score": "0.62746984",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to members_path, notice: 'Member Berhasil Diupdate.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eadefae083b26516fff21d1fa0a22d8a",
"score": "0.6259414",
"text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n format.js { reload }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db6e19946a0bc62d5da0a7b0d69c4083",
"score": "0.625787",
"text": "def update\n mp = member_params\n respond_to do |format|\n if @member.update(mp)\n puts \"\\n\\nUpdate succeeded\\n\\n\"\n puts mp\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n puts \"\\n\\nUpdate failed\\n\\n\"\n puts mp\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "edf39968b1d2b431c0ecd2b213f42fdc",
"score": "0.62324625",
"text": "def update(id:, roles:)\n id_check(:id, id)\n non_empty_array_check(:roles, roles)\n\n data = {roles: roles}\n\n cf_patch(path: \"/organizations/#{org_id}/members/#{id}\", data: data)\n end",
"title": ""
},
{
"docid": "6ce723bce66a908ef08195472edc6ef9",
"score": "0.6220147",
"text": "def update\n #@member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "effa54b0c1b4de6a94cf7a7a5f460eba",
"score": "0.62071043",
"text": "def update\n @user = User.find_by_member_id(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:success] = \"Successfully updated.\"\n format.html { redirect_to(\"/members/#{@user.member_id}\", :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6da4031957deb31082641dc54d49a24",
"score": "0.620067",
"text": "def update\n @member = Member.find(params[:id])\n # See parameters from application_controller\n member = params.require(:member).\n permit(\n :email, :password, :password_confirmation,\n :gender, :pseudo, :first_name, :name, :bio, :birth_date,\n :address, :zip, :city, :country, :avatar, :site,\n :category_list, :tag, { tag_ids: [] }, :tag_ids, :title\n\n )\n respond_to do |format|\n if @member.update(member)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n @member.index!\n end",
"title": ""
},
{
"docid": "519161254acf9e40a727396807a601c0",
"score": "0.61931914",
"text": "def update\n @member = Member.with_permissions_to(:update).find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Jäsentiedot päivitetty onnistuneesti.'\n format.html { redirect_to(member_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07b845fb13e1d2ba0d72e44a8c1e69e4",
"score": "0.6190441",
"text": "def update\n authorize @project\n\n params[:project][:member_ids].each do |member_id|\n unless member_id.empty?\n member = Member.find(member_id)\n @project.members << member\n end\n end\n\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d42866e298c57a584aa8fefe222fcd8",
"score": "0.6179475",
"text": "def update\n respond_to do |format|\n if @member.update!(member_params)\n format.html { redirect_to @member, notice: 'Vig was successfully updated.' }\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"title": ""
},
{
"docid": "4285a6adaef833f10ddad3cd5a7b6b47",
"score": "0.6179198",
"text": "def update\n service = Fl::Framework::Service::Actor::GroupMember.new(current_user, params, self)\n @group_member = service.update()\n respond_to do |format|\n format.json do\n if @group_member && service.success?\n render :json => { :group_member => hash_one_object(@group_member, service.to_hash_params) }\n else\n error_response(generate_error_info(service, @group_member))\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f1b451de9af738e5a874252be9e8da6d",
"score": "0.61762124",
"text": "def update\n # Update a member\n respond_to do |format|\n if @membership.update(membership_params)\n format.html { redirect_to @membership, notice: 'Membership was successfully updated.' }\n format.json { render :show, status: :ok, location: @membership }\n else\n format.html { render :edit }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8e5d58cf0a32cd0dbf4a4265dad6754",
"score": "0.6168448",
"text": "def update\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, :notice => I18n.t(:updated_member) ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03b5ec6afe67eb15314e9e76a53bb6df",
"score": "0.6168425",
"text": "def update\n respond_to do |format|\n if @member_service_member.update(member_service_member_params)\n format.html { redirect_to @member_service_member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member_service_member }\n else\n format.html { render :edit }\n format.json { render json: @member_service_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41ea872b9f343b902ee4075f538d0039",
"score": "0.6161103",
"text": "def update\n status_code = isMemberLoggedIn\n if status_code == false\n flash[:notice] = \"Please login before you continue\"\n render members_signin_path and return\n end\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90f25645eefc57ad097e6a94a0a70318",
"score": "0.6157546",
"text": "def update\n respond_to do |format|\n if @member.update_attributes(member_params)\n format.html { redirect_to updated_path, notice: 'Membro atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18c9073be36cdce09d72be6440e36340",
"score": "0.6152386",
"text": "def update\n respond_to do |format|\n if params[:is_admin]\n if @member.update(:is_admin => !@member.is_admin)\n if @member.is_admin == true\n Member.change_permissions_to_true(@member.email)\n else\n Member.change_permissions_to_false(@member.email)\n end\n format.html { redirect_to edit_project_path(@project)}\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n else\n if @member.update(member_params)\n format.html { redirect_to edit_project_path(@project)}\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "744980241bd423420a35b0bb9d61a210",
"score": "0.6151171",
"text": "def update\n respond_to do |format|\n @member.update_attributes('slug' => member_params[:user_name].downcase.gsub(' ','-').gsub('\\n',''))\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fe523bf9a42e487ebb77a444b98a424",
"score": "0.61486536",
"text": "def update\n\t\t@member = Member.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @member.update_attributes(params[:member])\n\t\t\t\tformat.html { redirect_to @member, notice: 'Member 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: @member.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "87c40427380181c823437a3cc2636bfb",
"score": "0.61482155",
"text": "def update!(**args)\n @members = args[:members] if args.key?(:members)\n @role = args[:role] if args.key?(:role)\n end",
"title": ""
},
{
"docid": "147ebf38fd006453b3f9a95cc87f32bd",
"score": "0.61438954",
"text": "def update\r\n @member = Member.find(params[:id])\r\n# @member.society_id = current_user.society_id\r\n\r\n respond_to do |format|\r\n if @member.update_attributes(params[:member])\r\n format.html { redirect_to @member, notice: 'Member 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: @member.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "5ed65f2d03131756b48df3ec67014ab7",
"score": "0.61398864",
"text": "def update\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, notice: I18n.t(:updated_member) ) }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "924d3b39a89a98f4a1ec5a36bf255f2a",
"score": "0.6137291",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "924d3b39a89a98f4a1ec5a36bf255f2a",
"score": "0.6137291",
"text": "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02e26af4e940e32f18e090844b848de1",
"score": "0.6127661",
"text": "def update\n @family_member = current_user.family_members.find_by_id(params[:id])\n\n respond_to do |format|\n if @family_member.update_attributes(params[:family_member])\n format.html { redirect_to current_user, notice: 'Family Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49c52c239254ac6143168d27c7ca215f",
"score": "0.61270374",
"text": "def update\n\t\treturn not_found unless current_user.is_admin?\n @sample_member = SampleMember.find(params[:id])\n\n respond_to do |format|\n if @sample_member.update_attributes(member_params)\n format.html { redirect_to @sample_member, notice: 'Sample member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sample_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24d7c4bf915d92c4e4830e4370c70fe9",
"score": "0.6123268",
"text": "def update\n @members_section = MembersSection.find(params[:id])\n\n respond_to do |format|\n if @members_section.update_attributes(params[:members_section])\n format.html { redirect_to @members_section, notice: 'Members section was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @members_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "329f3227fcb1650aaae3da87a38aeb87",
"score": "0.61229837",
"text": "def edit_members(members)\n\t\t\t\t@params[:edit_members] = members\n\t\t\tend",
"title": ""
},
{
"docid": "0c4f77d6a1aeeb14e131dd3b2c8cdede",
"score": "0.61121756",
"text": "def update\n @member = Member.find(params[:id])\n \n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to(@member) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84657dd1227cc4a5e3be5766362332d0",
"score": "0.6109873",
"text": "def update\n respond_to do |format|\n if @member_info.update(member_info_params)\n format.html { redirect_to @member_info, notice: 'Member info was successfully updated.' }\n format.json { render :show, status: :ok, location: @member_info }\n else\n format.html { render :edit }\n format.json { render json: @member_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b00e693b3873c5b9663cc7fc9c2a129",
"score": "0.61033106",
"text": "def update\n @member.attributes = member_params\n respond_to do |format|\n if safe_save\n format.html {redirect_to @member, notice: 'Member was successfully updated.'}\n format.json {render :show, status: :ok, location: @member}\n else\n format.html {render :edit}\n format.json {render json: @member.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "93c8507054d0cf160791b8cd86ff8729",
"score": "0.61014026",
"text": "def update\n Rails.logger.debug \"*\" * 100\n Rails.logger.debug \"Params: #{params}\"\n\n @member = Member.find(params[:id])\n if params[:member].has_key? :contact_ids\n params[:member][:contact_ids] = params[:member][:contact_ids].first.split(\",\")\n end\n respond_to do |format|\n if @member.update_attributes(params[:member])\n @member.delay.create_member_tag_on_contacts\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
3e05f03623e844db86a8683762fe10d1
|
To find the full shortest route to a node
|
[
{
"docid": "b4f2e611cbe67dd878809ec9ec9ffa4c",
"score": "0.0",
"text": "def find_path(dest)\n if @previous[dest] != -1\n find_path @previous[dest]\n end\n @path << dest\n end",
"title": ""
}
] |
[
{
"docid": "ee2a0de4c1b0357fe858397cb970fefd",
"score": "0.84170574",
"text": "def find_shortest_route\n node = @closed_nodes[@goal[0]][@goal[1]]\n loop do\n break if node.from == @start\n @result << node.from\n @shortest_route[node.from[0]][node.from[1]] = true\n node = @closed_nodes[node.from[0]][node.from[1]]\n end\n end",
"title": ""
},
{
"docid": "eecde74d212e02fb033bf6ccef3cfe18",
"score": "0.799892",
"text": "def shortestRoute()\n sh = 99999\n frm = 0\n to = 0\n ROUTE_DATA.each do |r|\n if r[RTE_DIST] < sh\n sh = r[RTE_DIST]\n frm = r[RTE_FROM]\n to = r[RTE_TO] \n end\n end\n return to,frm,sh\n end",
"title": ""
},
{
"docid": "6b1d174eaf766eb0c447996b60f5e3ec",
"score": "0.7983708",
"text": "def naiveShortest\n\t\tcar = @nodes.first\n\t\tcdr = @nodes.drop 1\n\t\tmyroute = [car]+ cdr.permutation.min_by {|e| self.route [car]+e}\n\t\tr=Route.new self\n\t\tr.route = myroute\n\t\tr.cost =route(myroute)\n\t\tr\n\tend",
"title": ""
},
{
"docid": "e6b08035f04dc4ea04f3906bb34b5138",
"score": "0.78819287",
"text": "def shortest_path\n road(@end)\n @path\n end",
"title": ""
},
{
"docid": "2213fa6b6013e0d47181840cb0484869",
"score": "0.76725507",
"text": "def shortest_route\n @res = []\n @distance = []\n @result\n stops = 10\n\n # create a list of all available routes\n for l in 1..stops - 1\n @railroad.stations[@origin].each do |k, v|\n @res.push(helper(k, @destination, l, @origin+k))\n end\n end\n\n # select the route with the minimum distance of travel\n min = 1000;\n @res.each do |i|\n calculated_dist = calc_dist(i)\n if (i[i.length - 1] == @destination) && (calculated_dist.is_a? Fixnum) && ((calculated_dist) < min)\n min = calculated_dist\n @result = i\n end\n end\n return min\n end",
"title": ""
},
{
"docid": "dec90576e3cc0597cb453675ed0ff923",
"score": "0.7572937",
"text": "def find_shortest_route(from = nil, to = nil, length = 0, min = 0)\n return NO_ROUTE if ((from.nil?) || (to.nil?))\n\n #if 'from' and 'to' cities exist in routes hash\n if (@routes.has_key? from.name) && (@routes.has_key? to.name)\n from.visited = true #we visit 'from' city\n\n routes = @routes[from.name] #get all routes by city key\n\n routes.each do |route|\n #if 'to' not visited and its a destination\n #calculate route length\n length += route.length if (route.to.equals? to) || (not route.to.visited)\n\n #if destination achieved\n if route.to.equals? to\n #verify length and set min value, return the result\n min = length if (min == 0) || (length < min)\n from.visited = false\n return min\n\n #if route not visited\n elsif not route.to.visited\n #find min path recursively\n min = find_shortest_route(route.to, to, length, min)\n length -= route.length\n end\n end\n\n else\n return NO_ROUTE\n end\n\n from.visited = false\n min\n end",
"title": ""
},
{
"docid": "c4368ed30bf56d2be6173c95dabb2c4c",
"score": "0.74475384",
"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": "bf2106d2ddeb89522e79193cb3798c3c",
"score": "0.7433019",
"text": "def getShortestPath(startpt, endpt)\n # create vertex set Q\n # initialize weights\n unseen = []\n seen = []\n @metros.map{ |metro|\n v = DNode.new(metro.code)\n if startpt == metro.code\n v.weight = 0\n end\n unseen.push(v)\n }\n\n until unseen.empty?\n curr = unseen.min_by(&:weight)\n seen.push(curr)\n unseen.delete(curr)\n\n @routes[@@code_to_city[curr.code]].each{ |neighbor|\n unless seen.flatten.include?(neighbor.city.code)\n neighbor_node = unseen.index { |node| node.code == neighbor.city.code }\n cumulative_distance = curr.weight + neighbor.distance\n\n if cumulative_distance < unseen[neighbor_node].weight\n unseen[neighbor_node].weight = cumulative_distance\n unseen[neighbor_node].prev = curr\n end\n end\n }\n end\n\n end",
"title": ""
},
{
"docid": "ea52163d0c881fde7e7ea20c72796e61",
"score": "0.7402048",
"text": "def shortest_path\n graph.shortest_path(start.to_sym, finish.to_sym)\n end",
"title": ""
},
{
"docid": "0bb90b275110646faea7e14b1e546084",
"score": "0.73288953",
"text": "def shortest_path\n distances.min_by(&:last).first\n end",
"title": ""
},
{
"docid": "429f428aedbfc5a15e324e4cac35559d",
"score": "0.72106934",
"text": "def get_trip_shortest_route(departure_node, destination_node)\n number_of_trips_by_max_stops(departure_node, destination_node, 10).min do |first_route, second_route|\n first_route.calc_total_weight <=> second_route.calc_total_weight\n end\n end",
"title": ""
},
{
"docid": "6c74269602c2419b901cb45c6471e8be",
"score": "0.71853787",
"text": "def shortestSingleFlight()\n return reduceVariable('edges', 'distance', '<')\n end",
"title": ""
},
{
"docid": "95f297edddfedbb0c6b5d3cf02bb59f1",
"score": "0.71643776",
"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": "fb93113e7ac7d23f19e9fbb69054e08b",
"score": "0.7158165",
"text": "def shortest_path(end_node)\n\t\tfind_distances() do |found_vertex, known_vertexes|\n\t\t\tif(found_vertex.object == end_node)\n\t\t\t\treturn shortest_path_internal(found_vertex, known_vertexes)\n\t\t\tend\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "1b583d92be706996b96daa3dd2d463e3",
"score": "0.7125132",
"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": "d3dbfa184d365f8ad77580762abacafb",
"score": "0.71089965",
"text": "def shortest_path(graph, origin, destination)\n\n def remove_key(graph, key)\n graph.dup.tap {|hash| hash.delete(key)}\n end\n\n def extend_route(graph, route)\n lastcity = route[-1]\n if graph.has_key?(lastcity)\n new_graph = remove_key(graph, lastcity)\n graph[lastcity].each do |nextcity, distance|\n new_route = route + [nextcity]\n @routes[new_route] = @routes[route] + distance\n extend_route(new_graph, new_route)\n end\n end\n end\n\n # { [NY,LA]=>10, [NY,LA,SF]=>12 }\n @routes = {}\n\n graph[origin].each do |nextcity, distance|\n route = [origin, nextcity]\n @routes[route] = distance\n new_graph = remove_key(graph, origin)\n extend_route(new_graph, route)\n end\n\n all_paths = @routes.select {|route| route[-1] == destination}\n return nil if all_paths.empty?\n all_paths.sort_by {|route, distance| distance}.first.first\nend",
"title": ""
},
{
"docid": "9ea7f8ff9aaf284ff505c7875b14653e",
"score": "0.7090528",
"text": "def find_shortest_path(start_node_label, end_node_label)\n # make sure nodes exist\n [start_node_label, end_node_label].each do |label|\n return if node_absent(label)\n end\n\n # reset nodes for path search and initialize start distance\n reset_nodes_path_properties()\n @nodes[start_node_label].distance = 0\n\n # initialize queue and path tracking variables\n queue = [start_node_label]\n path_cost = 0\n previous_node_labels = Hash.new() # track path to end node\n\n while !queue.empty? do\n node_label = queue.pop()\n break if node_label.eql?(end_node_label) # found the end node\n\n # get neighbors and sort them by min distance\n node = self.get_node(node_label)\n neighbors = node.get_neighbors().sort_by { |k,v| v.to_i }\n\n neighbors.each do |neighbor_label, neighbor_weight|\n neighbor = self.get_node(neighbor_label)\n next if neighbor.visited\n\n # add neighbor to queue and calculate potential distance\n queue.unshift(neighbor_label)\n path_cost = node.distance.to_i + neighbor_weight.to_i\n\n # if distnace is shorter, then update and add to previous nodes\n if neighbor.distance.nil? or path_cost < neighbor.distance\n neighbor.distance = path_cost\n previous_node_labels[neighbor_label] = node.label\n end\n end\n\n node.visited = true # so node isn't checked again\n end\n\n # after search, backtrack and build path\n path = backtrack_path(previous_node_labels, end_node_label)\n\n # if a path was found prepend the start node, else there's no path\n path_cost > 0 ? path.unshift(start_node_label) : path = ['non-existent']\n end_node = self.get_node(end_node_label)\n\n return {'path' => path.join(','), 'cost' => end_node.distance}\n end",
"title": ""
},
{
"docid": "4847636ebbbef1968ecc5aeb7142d485",
"score": "0.7055373",
"text": "def shortest_paths s\n dijkstra s\n puts \"Source: #{s}\"\n @nodes.each do |dest|\n puts \"\\nTarget: #{dest}\"\n print_path dest\n if @d[dest] == @INFINITY\n puts \"\\nNO PATH\"\n else\n puts \"\\nDistance: #{@d[dest]}\"\n end\n end\n end",
"title": ""
},
{
"docid": "3d1a4ea4ca928ba37e53d228d04ed151",
"score": "0.70279783",
"text": "def shortest_paths(s)\n dijkstra s\n puts \"Source: #{s}\"\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": ""
},
{
"docid": "0648aabfa8266f24f2262ef3dd06249d",
"score": "0.6981488",
"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": "e162ffcdadfae3750f3c82e4abdfa4f1",
"score": "0.6966396",
"text": "def get_shortestroad(source, target)\n \t#Cleans the arrays\n distances = {}\n visited = {}\n self.each do |node|\n distances[node] = nil\n visited[node] = nil\n end\n \n #Sets the distance to the first node to 0 because it starts there\n distances[source] = 0\n \n #Copy the array of this class to the array 'nodes'\n nodes = self.clone\n until nodes.empty?\n \t#Finds the nearest nodes of the array 'nodes'\n \tnearest_node = nodes.inject do |node1, node2|\n next node2 unless distances[node1]\n next node1 unless distances[node2]\n next node1 if distances[node1] < distances[node2]\n node2\n end\n \n # returns the length if it reaches the goal\n return distances[target] if nearest_node == target\n \n #Gets the neighbors nodes to the node 'nearest_node'\n neighbors = get_neighbors(nearest_node)\n neighbors.each do |node|\n \t#Saves in a temporal variable the sum of the current value + the length between the two nodes\n temp = distances[nearest_node] + nodes.get_length_to(node, nearest_node)\n if distances[node].nil? or temp < distances[node]\n distances[node] = temp\n visited[nodes] = nearest_node\n end\n end\n nodes.delete nearest_node\n end\n \n #Return the result\n if target\n return nil\n else\n return distances\n end\n end",
"title": ""
},
{
"docid": "6f5d4f45b66050bfc00005226358564d",
"score": "0.6939783",
"text": "def shortest_route(graph, ports)\n source = graph.vertices[graph.metros[ports[0]]]\n target = graph.vertices[graph.metros[ports[1]]]\n sequence = dijkstra(graph, source, target)\n graph.route_details(sequence)\n end",
"title": ""
},
{
"docid": "0385d6ca906400c077072e88f9ec6959",
"score": "0.6934192",
"text": "def shortest_path(end_node)\n\t\tfind_distances() do |found_vertex, known_vertexes|\n\t\t\tif(found_vertex.object == end_node)\n next_vertex = found_vertex\n path = []\n while next_vertex\n path.unshift(next_vertex.object)\n next_vertex = next_vertex.parent\n end\n return path\n\t\t\tend\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "0babfc5194d89e67f65fd546e4d7178a",
"score": "0.6934015",
"text": "def shortest_path(graph)\n ports = prompt_route\n # check if metro exists\n if graph.metros.has_key?(ports[0]) && graph.metros.has_key?(ports[1])\n shortest_route(graph, ports)\n else\n puts 'Invalid Input'\n end\n end",
"title": ""
},
{
"docid": "0d443bd6717628a85ddbfb008f832245",
"score": "0.69057083",
"text": "def return_shortest\n @min = @infinity\n @node = \"\"\n @unoptimized_nodes.each do |node|\n if @vertices[node].distance <= @min\n @min = @vertices[node].distance\n @node = @vertices[node].node\n @unoptimized_nodes.delete_if{|x| x == @node}\n end\n end\n return @node\n end",
"title": ""
},
{
"docid": "0d443bd6717628a85ddbfb008f832245",
"score": "0.69057083",
"text": "def return_shortest\n @min = @infinity\n @node = \"\"\n @unoptimized_nodes.each do |node|\n if @vertices[node].distance <= @min\n @min = @vertices[node].distance\n @node = @vertices[node].node\n @unoptimized_nodes.delete_if{|x| x == @node}\n end\n end\n return @node\n end",
"title": ""
},
{
"docid": "cb7cd4d17d4f4e1b4ae88eb8eae13f6a",
"score": "0.6903554",
"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": ""
},
{
"docid": "4b01cd55e73a0e213a5b250166c7a8db",
"score": "0.68867385",
"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": "3a121a1f9a9f301100edfc52ba271dca",
"score": "0.6857579",
"text": "def shortest_path(to, max_depth: Float::INFINITY)\n return self.class.no_result unless @is_visitable.call(@grid[to])\n @heuristic = PathFinder::Euristiques.method(:oil_stain)\n dijkstra(to: to,\n break_if: @break_if || -> (current,to) { current.uid == to || current.depth >= max_depth }\n )\n generate_result(to)\n end",
"title": ""
},
{
"docid": "d1871d6a082aae90f5b58dd5d5cd9fef",
"score": "0.6850046",
"text": "def route\n @shortest_route.unshift @goal\n end",
"title": ""
},
{
"docid": "0f2e4d336b3314f772df35b36ace149a",
"score": "0.6849953",
"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": "49c829f55c49aa58244e864f7886d12d",
"score": "0.6845052",
"text": "def shortest_paths(s)\n\t\t@source = s\n\t\tdijkstra s\n\t\t#puts \"Source: #{@source}\"\n\t\t@nodes.each do |dest|\n\t\t\t#puts \"Target: #{dest}\"\n\t\t\tprint_path dest\n\t\t\tif @d[dest] != @INFINITY\n\t\t\t\t#puts \"Distance: #{@d[dest]}\"\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a5805fe12576a2f7ba0e387e6776ce48",
"score": "0.68384844",
"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": "3a8883b7c39d99bd3ffbf190aa266abe",
"score": "0.6818623",
"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 end\n end\n end",
"title": ""
},
{
"docid": "c3abf0c38e3a905ca6577629ce88316e",
"score": "0.6813304",
"text": "def shortest_path(start,finish)\n prev = {}\n node_dist = {}\n\n for node in get_all_nodes\n if node.get_elt == start then next end\n prev[node] = nil\n node_dist[node.get_elt] = 1/0.0 #starting value of infinity\n end\n\n node_dist[start] = 0\n\n pq = PriorityQueue.new(node_dist)\n\n while !pq.is_empty\n curr = pq.get_top\n\n for edge in get_node_edges(get_node(curr))\n next_elt = edge.to_node.get_elt\n \n if node_dist[next_elt] > node_dist[curr] + edge.get_weight\n pq.update_priority(next_elt,\n node_dist[curr] + edge.get_weight)\n prev[get_node(next_elt)] = get_node(curr)\n end\n end\n end\n\n #Extra check to find shortest (non-zero) cycle path by using our\n #known shortest distances and finding the shortest one back\n #to our start node. It requires another graph traversal in \n #the worst case.\n node_dist[start] = 1/0.0\n for node in get_all_nodes\n for edge in get_node_edges(node)\n from = edge.from_node.get_elt\n to = edge.to_node.get_elt\n if to == start and node_dist[from] < 1/0.0\n if node_dist[start] > node_dist[from] + edge.get_weight\n node_dist[start] = node_dist[from] + edge.get_weight\n prev[get_node(start)] = get_node(from)\n break\n end\n end\n end\n end\n\n return node_dist[finish]\n end",
"title": ""
},
{
"docid": "da33e3d29df7a43a1f9642272646b93f",
"score": "0.6810411",
"text": "def shortestPath\n @nodes.each_with_index do |_, nodeIndex|\n addOption(0, nodeIndex)\n addNextNode(0, nodeIndex)\n end\n\n return {\n distance: @shortestDistance,\n path: @shortestPath.join(\", \")\n }\n end",
"title": ""
},
{
"docid": "314c2ccfbcbefe35ba47c04d59f44357",
"score": "0.6809245",
"text": "def solve\n # Start with the start_node\n current_node = @unvisited_vertices.delete @start_node\n current_node.dist = 0\n\n # Apply algorithm \n while !@unvisited_vertices.empty?\n current_node.neighbors.each do |neighbor, neighbor_distance|\n alt = current_node.dist + neighbor_distance\n if alt < @vertices[neighbor].dist\n @vertices[neighbor].dist = alt\n @vertices[neighbor].prev = current_node.point\n end\n end\n\n min_dist_node = @unvisited_vertices.min_by{|k, v| v.dist} # [1] is the vertex, [0] key \n current_node = @unvisited_vertices.delete min_dist_node[0]\n end\n\n # Back track to get the shortest path\n shortest_sequence = Array.new\n current_target = @vertices[@target_node]\n while !current_target.prev.nil?\n shortest_sequence << current_target\n current_target = @vertices[current_target.prev]\n end\n shortest_sequence << @vertices[@start_node]\n\n result = \"Shortest path is [#{shortest_sequence.reverse.map{|x| x.point}.join(',')}] with total cost #{@vertices[@target_node].dist}\"\n end",
"title": ""
},
{
"docid": "16f2ff698d588872127e26e881456e8a",
"score": "0.6802997",
"text": "def shortest_paths(s)\n\t\t@source = s\n\t\tdijkstra s\n\t\tputs \"Source: #{@source}\"\n\t\t@nodes.each do |dest|\n\t\t\tputs \"\\nTarget: #{dest}\"\n\t\t\tprint_path dest\n\t\t\tif @d[dest] != @INFINITY\n\t\t\t\tputs \"\\nDistance: #{@d[dest]}\"\n\t\t\telse\n\t\t\t\tputs \"\\nNO PATH\"\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "16f2ff698d588872127e26e881456e8a",
"score": "0.6802997",
"text": "def shortest_paths(s)\n\t\t@source = s\n\t\tdijkstra s\n\t\tputs \"Source: #{@source}\"\n\t\t@nodes.each do |dest|\n\t\t\tputs \"\\nTarget: #{dest}\"\n\t\t\tprint_path dest\n\t\t\tif @d[dest] != @INFINITY\n\t\t\t\tputs \"\\nDistance: #{@d[dest]}\"\n\t\t\telse\n\t\t\t\tputs \"\\nNO PATH\"\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "16f2ff698d588872127e26e881456e8a",
"score": "0.6802997",
"text": "def shortest_paths(s)\n\t\t@source = s\n\t\tdijkstra s\n\t\tputs \"Source: #{@source}\"\n\t\t@nodes.each do |dest|\n\t\t\tputs \"\\nTarget: #{dest}\"\n\t\t\tprint_path dest\n\t\t\tif @d[dest] != @INFINITY\n\t\t\t\tputs \"\\nDistance: #{@d[dest]}\"\n\t\t\telse\n\t\t\t\tputs \"\\nNO PATH\"\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eff41d3e826d440382ed48526d800b69",
"score": "0.67964554",
"text": "def getShortestRoute(question)\n startStation = question.parameters[0]\n endStation = question.parameters[1]\n \n routeProcessor = ShortestRouteProcessor.new(@routeList, question.constraint, question.action)\n routeProcessor.getRoute(startStation, endStation)\n \n return routeProcessor.shortestRoute == Constants::INTEGER_MAX ? NO_ROUTE : routeProcessor.shortestRoute\n end",
"title": ""
},
{
"docid": "538a1cd3ddd82e50f87575ec31f2c0d0",
"score": "0.67955995",
"text": "def shortest_path(locs)\n result = JSON.parse(request_route(locs))\n if result.has_key? 'Error' or result['status'] != 'OK'\n return ERR_REQUEST_FAIL\n end\n legs = result['routes'][0][\"legs\"]\n order = result['routes'][0]['waypoint_order']\n order.map! { |x| x+1 }\n order << locs.length-1\n route1 = { steps: [], mode: @mode, name: 'route' }\n first_step = {}\n first_step[:geocode] = geocode_to_s(legs[0][\"start_location\"])\n first_step[:name] = locs[0]['searchtext']\n first_step[:departure] = locs[0]['departafter']\n first_step[:arrival] = locs[0]['departafter']\n route1[:steps]<< first_step\n legs.each_with_index do |leg, i|\n step = {}\n step[:geocode] = geocode_to_s(leg[\"end_location\"])\n step[:name] = locs[order[i]]['searchtext']\n step[:arrival] = route1[:steps].last[:departure] + leg[\"duration\"][\"value\"]\n step[:departure] = step[:arrival] + locs[order[i]]['minduration']\n route1[:steps] << step\n end\n route1[:traveltime] = route1[:steps].last[:arrival] - route1[:steps].first[:departure]\n if route1[:steps].last[:arrival] > locs.last['arrivebefore']\n return ERR_NO_ROUTE_FOUND_TO_FIT_SCHEDULE\n end\n return { errCode: SUCCESS, routes: [route1] }\n end",
"title": ""
},
{
"docid": "961e8cea0585c7d38852f015d306d3ce",
"score": "0.6793255",
"text": "def findShortestPath(city1, city2)\n node1 = getCode(city1)\n node2 = getCode(city2)\n if(node1 == nil || node2 == nil)\n return nil\n end\n #start with city1\n startNode = createPathNode(node1.code, false, 0, nil)\n hash = {node1.code =>startNode}#for storing the unvisited pathNodes\n totalHash = {node1.code =>startNode}#for storing all the pathNodes\n \n while(hash.length != 0 )\n #sort\n hash = hash.sort_by{|k,v| v[\"dist\"]}.to_h\n #pop\n curCode = hash.keys[0]\n curPathNode = hash.delete(curCode)\n neighbors = @map[curCode].destinations\n #loop destinations\n neighbors.each do |code, dis|\n codes = setDistanceMapKey(curCode, code)\n directDis = @distanceMap[codes]\n alt = directDis + curPathNode[\"dist\"]\n if(totalHash.has_key?(code))#if in totalHash, check if visited, then compare path\n pathNode = totalHash[code]\n if(pathNode['visited'] == true)\n next\n else\n if(alt < pathNode[\"dist\"])\n pathNode[\"dist\"] = alt\n pathNode[\"prevCode\"] = curCode\n end\n end\n else #if not exist, create a new path node, add it to both hash and totalhash\n pathNode = createPathNode(code, false, alt, curCode)\n hash[code] = pathNode\n totalHash[code] = pathNode\n end\n end\n curPathNode[\"visited\"] = true\n end\n \n #check if the city2 is actually visited\n curPathNode = totalHash[node2.code]\n if(curPathNode[\"visited\"] == false)\n return nil\n end\n \n #trace back to find the routeString\n routeString = city2\n while(curPathNode[\"prevCode\"] != nil)\n prevCode = curPathNode[\"prevCode\"]\n prevNode = @map[prevCode]\n routeString = prevNode.name+ \",\"+routeString\n curPathNode = totalHash[prevCode]\n end\n return routeString\n end",
"title": ""
},
{
"docid": "a781cad8375d7d3c9e1b269420207ca7",
"score": "0.6792133",
"text": "def find_shortest_paths(source)\n init(source)\n relax_edges\n end",
"title": ""
},
{
"docid": "574b67a4103539278b47a71829f00d6c",
"score": "0.6788681",
"text": "def shortest_flight\n # return max integer of no edges\n return Edge.new('', (2**(0.size * 8 -2) -1)) if @edges.length == 0\n\n # find the shortest distance in the distances array\n min = distances.min\n @edges.each{|edge| return edge if edge.distance == min}\n end",
"title": ""
},
{
"docid": "b3a493e813759f25de9fcb44626e7573",
"score": "0.67846346",
"text": "def find_shortest_path(name1, name2)\n dijkstra(name1)\n @distance[name2].nil? ? Float::INFINITY : @distance[name2]\n end",
"title": ""
},
{
"docid": "8d11fd1595e5ce43f546baf5c3b9e216",
"score": "0.67681956",
"text": "def shortest_path(graph, starting_node, ending_node)\n\n\t\tparent = {}\n\t\tdist = {}\n\t\tgraph.vertices.each do |v|\n\t\t\tdist[v] = Float::INFINITY\n\t\t\tparent[v] = nil\n\t\tend\n\t\tdist[starting_node] = 0\n\t\tparent[starting_node] = starting_node\n\n\n\tend",
"title": ""
},
{
"docid": "ffa38a973f82a03e32309ffbc4d5cad3",
"score": "0.67250717",
"text": "def node_with_minimum_distance # unvisited node with minimum distance\n debug \"node_with_minimum_distance\"\n @candidates.min_by{ |x| best_distance_to(x) }\\\n .tap{|x| debug \"=> #{x.inspect}\"}\n end",
"title": ""
},
{
"docid": "fe10120d8869ba96bdb55ea995527c44",
"score": "0.6710497",
"text": "def shortest_path(nodes, starting, ending)\n queue = [[starting]]\n while !queue.empty?\n last_path = queue.pop\n last_node = last_path.last\n return last_path if last_node == ending\n if neighbors = nodes[last_node]\n neighbors.each do |neighbor|\n new_path_to_queue = last_path + [neighbor]\n queue.unshift(new_path_to_queue) \n end\n end \n end \nend",
"title": ""
},
{
"docid": "d64a665ebbad2940d48a40ed301919ab",
"score": "0.6696541",
"text": "def find(start, target, current_route = [])\n return [target] if start == target\n return nil unless paths.has_key?(start)\n\n # Map all possible paths to the target.\n # Skip nodes we have already visited\n next_nodes = paths[start] - current_route\n routes = next_nodes.map do |next_node|\n find(next_node, target, current_route + [start])\n end\n\n # Reduce the collection to the shortest path\n shortest_route = routes.compact.inject(nil) {|shortest,possibility|\n next possibility if shortest.nil?\n possibility.size < shortest.size ? possibility : shortest\n }\n return [start] + shortest_route if shortest_route\n nil\n end",
"title": ""
},
{
"docid": "54844c49ed54c4ae68a03668366b9d17",
"score": "0.667609",
"text": "def bfs_shortest_path(start, goal, paths=false)\n\t\tdist = nil\n\t explored = {} # keep track of explored nodes\n\t previous = {}\n\t queue = [[start, 0]] # keep track of all the paths to be checked\n\t is_goal = false\n\t while !queue.empty? && !is_goal # keeps looping until all possible paths have been checked\n\t node, dist = queue.pop # pop the first path from the queue\n\t if !explored.include?(node) # get the last node from the path\n\t neighbours = @edges[node] \n\t explored[node] = true # mark node as explored\n\t next if neighbours.nil?\n\t dist += 1 \n\t neighbours.each do |neighbour| # go through all neighbour nodes, construct a new path\n\t \tnext if explored.include?(neighbour)\n\t queue.unshift([neighbour, dist]) # push it into the queue\n\t previous[neighbour] = node if paths\n\t if neighbour == goal # return path if neighbour is goal\n\t \tis_goal = true\n\t \tbreak\n\t end\n\t end\n\t end\n\t end\n\t\tif is_goal\n\t\t\tpath = build_path(previous, start, goal) if paths\n\t\telse\n\t\t\tdist = nil \n\t\t\tpath = []\n\t\tend\n\t return dist, path\n\tend",
"title": ""
},
{
"docid": "0a77cda6e2d5f26da591d35c2b6e0ae2",
"score": "0.66670865",
"text": "def shortest_path(source, target = nil)\n distances = {}\n previouses = {}\n\n vertices.each_pair do |key, vertex|\n distances[key] = nil # Infinity\n previouses[key] = nil\n end\n\n distances[source] = 0\n verts = vertices.clone \n\n until verts.empty?\n nearest_vertex = verts.inject(verts.first.first) do |a, (b, c)|\n next b unless distances[a]\n next a unless distances[b]\n next a if distances[a] < distances[b]\n b\n end\n\n break unless distances[nearest_vertex] # Infinity\n\n if target && nearest_vertex == target\n return compose_path(target, distances[target], previouses)\n end\n\n neighbors = verts[nearest_vertex].neighbors\n neighbors.each_pair do |name, vertex|\n alt = distances[nearest_vertex] + 1\n\n if distances[name].nil? || alt < distances[name]\n distances[name] = alt\n previouses[name] = nearest_vertex\n end\n end\n verts.delete(nearest_vertex)\n end\n end",
"title": ""
},
{
"docid": "1860de4d134042bb0060f71a28ac1f21",
"score": "0.66430306",
"text": "def shortest_flight(graph)\n # find the vertex corresponding to the shortest flight\n shortest_flight_vertex = graph.vertices.values.min_by do |vertex|\n vertex.shortest_flight.distance\n end\n # print out the info for the starting vertex\n info = shortest_flight_vertex.metro.info\n\n # print out info about the route itself, and the ending vertex\n shortest_flight = shortest_flight_vertex.shortest_flight\n info << shortest_flight.info\n end",
"title": ""
},
{
"docid": "7ee4e8b692c81a5676e9865ba141c7c1",
"score": "0.66393715",
"text": "def shortest_path(node1, node2)\n\t\t@queue = Array.new\n\t\t@explored = Array.new(vertices.count, false)\n\t\t@explored[node1.label-1] = true\n\t\t@queue.push([node1.label, 0])\n\t\tcalculate_shortest_path(node2)\n\tend",
"title": ""
},
{
"docid": "3aae0d7a6d168e94fd41157b81ec3bdd",
"score": "0.66339993",
"text": "def shortest_path(start, finish, append_trip_time = false)\n maxint = (2**(0.size * 8 -2) -1) # this is the infinity\n distances = {}\n previous = {}\n nodes = PriorityQueue.new\n total_trip_time = 0\n # intialize distances to 0 for start, infinite for remainder\n @vertices.each do | vertex, value |\n if vertex == start\n distances[vertex] = 0\n nodes[vertex] = 0\n else\n distances[vertex] = maxint\n nodes[vertex] = maxint\n end\n previous[vertex] = nil\n end\n while nodes\n # O(log n) to choose best vertex (shortest)\n smallest = nodes.delete_min_return_key \n if smallest == finish\n path = []\n while previous[smallest]\n path.push(smallest)\n smallest = previous[smallest]\n end\n final_path = path.push(start).reverse\n return append_trip_time ? [final_path, total_trip_time] : final_path\n end\n \n if smallest == nil or distances[smallest] == maxint\n break \n end\n # for each edge from current vertex\n @vertices[smallest].each do | neighbor, value |\n # [0] is because distance is first value in array\n alt = distances[smallest] + @vertices[smallest][neighbor][0] \n if alt < distances[neighbor]\n distances[neighbor] = alt\n previous[neighbor] = smallest\n nodes[neighbor] = alt\n end\n total_trip_time = alt if neighbor == finish\n end\n end\n return distances.inspect\n end",
"title": ""
},
{
"docid": "a6d957b5f11182bf5741e0e316c6acc4",
"score": "0.6629074",
"text": "def shortest_path finish\n path = []\n current_vertex = finish\n path << current_vertex\n while @previous[current_vertex]\n path << @previous[current_vertex]\n current_vertex = @previous[current_vertex]\n end\n path.reverse\n end",
"title": ""
},
{
"docid": "420fa5ffd074058385ce250059e5f460",
"score": "0.6625247",
"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.6625247",
"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": "88efe7102e753283fe4e2a447fe27276",
"score": "0.65807134",
"text": "def get_shortest_path\n start_knight_movement = { position: start_position, source: {} }\n\n knight_movements = [start_knight_movement]\n\n while knight_movements.present?\n knight_movement = knight_movements.shift\n\n position = knight_movement[:position]\n\n if position == end_position\n return movements_from_source(knight_movement, start_knight_movement)\n end\n\n add_possible_destination_movements(position, knight_movement, knight_movements)\n end\n end",
"title": ""
},
{
"docid": "4a82fde90a6ff65bca9e300229b7cc99",
"score": "0.6575936",
"text": "def shortest_path from, to, init_state\n path_vertices = []\n path_edges = []\n\n spt = shortest_path_tree( from, to, init_state, true )\n curr = spt.get_vertex( to )\n\n #if the end node wasn't found\n unless curr then raise RuntimeError end\n\n path_vertices << curr\n\n while incoming = curr.edge_in( 0 )\n path_edges << incoming\n\n curr = incoming.from\n path_vertices << curr\n end\n\n return path_vertices.reverse, path_edges.reverse\n end",
"title": ""
},
{
"docid": "5341f0b2f10d6a07b0c847e16da39042",
"score": "0.6570536",
"text": "def mincost_path\n return [] if length==0\n # calc cost\n self[0].each{|n|\n n.total_cost=n.word.cost\n n.nearest_prev=nil\n }\n (1...length).each{|i|\n prevs=@ends[i-1]\n curs=@begins[i]\n prevs.each{|prev|\n # 途中で行き止まりのNodeはtotal_costが設定されない\n next if prev.total_cost.nil?\n curs.each{|cur|\n join_cost=@mat.cost(prev.word.right.id,cur.word.left.id)\n next if join_cost.nil?\n cost=prev.total_cost+join_cost+cur.word.cost\n if !cur.total_cost || cost < cur.total_cost\n cur.total_cost=cost\n cur.nearest_prev=prev\n end\n }\n }\n }\n # calc mincost path\n ret=[]\n cur=self[-1][0]\n until cur.nil?\n ret.push cur\n cur=cur.nearest_prev\n end\n # TODO: disconnected\n # return nil unless ...\n # success\n return ret.reverse\n end",
"title": ""
},
{
"docid": "5341f0b2f10d6a07b0c847e16da39042",
"score": "0.6570536",
"text": "def mincost_path\n return [] if length==0\n # calc cost\n self[0].each{|n|\n n.total_cost=n.word.cost\n n.nearest_prev=nil\n }\n (1...length).each{|i|\n prevs=@ends[i-1]\n curs=@begins[i]\n prevs.each{|prev|\n # 途中で行き止まりのNodeはtotal_costが設定されない\n next if prev.total_cost.nil?\n curs.each{|cur|\n join_cost=@mat.cost(prev.word.right.id,cur.word.left.id)\n next if join_cost.nil?\n cost=prev.total_cost+join_cost+cur.word.cost\n if !cur.total_cost || cost < cur.total_cost\n cur.total_cost=cost\n cur.nearest_prev=prev\n end\n }\n }\n }\n # calc mincost path\n ret=[]\n cur=self[-1][0]\n until cur.nil?\n ret.push cur\n cur=cur.nearest_prev\n end\n # TODO: disconnected\n # return nil unless ...\n # success\n return ret.reverse\n end",
"title": ""
},
{
"docid": "a93bff50d0971017604751f4c5b455e8",
"score": "0.65618914",
"text": "def shortest_path(start, finish)\n maxint = Float::INFINITY\n distances = Hash.new\n previous = Hash.new\n nodes = PriorityQueue.new\n \n @vertices.each do | vertex, value |\n if vertex == start\n distances[vertex] = 0\n nodes[vertex] = 0\n else\n distances[vertex] = maxint\n nodes[vertex] = maxint\n end\n previous[vertex] = nil\n end\n \n while nodes\n smallest = nodes.delete_min_return_key\n \n if smallest == finish\n path = Array.new\n while previous[smallest]\n path.push(smallest)\n smallest = previous[smallest]\n end\n return path.reverse\n end\n \n if smallest.nil? || distances[smallest] == maxint\n break \n end\n \n @vertices[smallest].each do | neighbor, value | \n alt = distances[smallest] + @vertices[smallest][neighbor]\n if alt < distances[neighbor]\n distances[neighbor] = alt\n previous[neighbor] = smallest\n nodes[neighbor] = alt\n end\n end\n end\n end",
"title": ""
},
{
"docid": "20cee2c1aa26c1ac55243b753453432f",
"score": "0.65616786",
"text": "def calculate_shortest(my_graph, city1, city2)\n if !(my_graph.metro.has_key?(city1)&&my_graph.metro.has_key?(city2))\n puts \"We don't have the city!\"\n return\n end\n\n #Use my dijkastra\n previous, distance = my_graph.dijkstra(city1, city2)\n s = []\n u = city2\n while previous[u] != nil\n s.push(u)\n u = previous[u]\n end\n s.push(u)\n s = s.reverse\n check_routes(my_graph, s)\n puts 'The cities that we are going to pass by are'\n s.each do |city|\n puts \"#{city}\"\n end\n return s\nend",
"title": ""
},
{
"docid": "40da73e44b044aefc91d6a6fe3808f95",
"score": "0.6559988",
"text": "def print_shortest_path finish\n puts \"The shortest path to #{finish} is:\"\n puts shortest_path(finish).join(\"->\")\n end",
"title": ""
},
{
"docid": "4bb3e41fe50c05f9bda3e8e458b0c888",
"score": "0.6552684",
"text": "def shortest_distance(start, finish)\n all_nodes = @graph.each.map { |k,v| [k, v.keys] }.flatten.uniq\n dist = { }\n all_nodes.each { |x| dist[x] = Infinity }\n dist[start] = 0\n if start == finish then\n # The trick for the 'funny' requirement #9: travelling to the same town you should leave it.\n all_nodes.delete(start)\n dist[start] = Infinity\n @graph[start].each { |nxt, how_far| dist[nxt] = how_far }\n end\n \n while not all_nodes.empty? do\n min_node = all_nodes.min { |a,b| dist[a] <=> dist[b] }\n if !min_node || min_node == Infinity\n return nil # remaining vertices are inaccessible from source\n end\n all_nodes.delete(min_node)\n \n @graph[min_node].each_key do |v|\n alt = dist[min_node] + (@graph[min_node][v] || Infinity)\n dist[v] = alt if dist[v] && alt < dist[v]\n end\n end\n return nil if dist[finish] == Infinity\n dist[finish]\n end",
"title": ""
},
{
"docid": "d9508e14fb68588a151cfbc92ad784ac",
"score": "0.6552607",
"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.6552607",
"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": "95aa6f86176cd6ff29540c18284e69ff",
"score": "0.65152603",
"text": "def shortest_path(visited, ground)\n unless self == ground\n # really large number guaranteed to be larger than the resistance of a particular segment\n ohms = Math.exp(999)\n path = []\n # for each segment connected to this node...\n self.segments.each do |s|\n tar_node = s.target_node(self)\n unless visited.include?(tar_node)\n visited_copy = visited.clone << self\n # recursively ask target node to compute its shortest path\n result = tar_node.shortest_path(visited_copy, ground)\n # if the result path is shorter than our current shortest path then...\n if ((result[:ohms] + s.ohms) < ohms)\n # the new shortest resistance value = target node's shortest resistance\n # plus the resistance of the segment connecting to that node\n ohms = result[:ohms] + s.ohms\n # record the shortest path also. it is an array and we need to add the\n # segment at the 'head' of the array\n path = result[:path].unshift(s)\n end\n end\n end\n # return the shortest path (segment array) and value of total resistance for that path\n {:path => path, :ohms => ohms}\n else # self == ground\n # for ground, we have nothing interesting to return - we are already at th end\n {:path => [], :ohms => 0}\n end\n end",
"title": ""
},
{
"docid": "992ae6d7b1c3b184d915502fbc369c74",
"score": "0.6497864",
"text": "def start\n @open_nodes[@start[0]][@start[1]] = Node.new(@start[0], @start[1])\n @open_nodes[@start[0]][@start[1]].from = [0, 0]\n\n loop do\n # Search a position of the node that has the minimun score from the open nodes.\n target_pos = \n @open_nodes.flatten.select { |node| !node.nil? }\n .min_by { |node| node.score }.current\n open_node(target_pos[0], target_pos[1])\n break if target_pos == @goal\n end\n\n # Get the shortest route from the closed list.\n node = @closed_nodes[@goal[0]][@goal[1]]\n loop do\n break if [node.from[0], node.from[1]] == @start\n @shortest_route << node.from\n node = @closed_nodes[node.from[0]][node.from[1]]\n end\n\n rescue Interrupt\n exit 1\n end",
"title": ""
},
{
"docid": "a336b937dc0fef0d5e8b34b59ca137f4",
"score": "0.6491221",
"text": "def step_forward\n shortest_node = self.return_shortest\n self.distances(shortest_node)\n end",
"title": ""
},
{
"docid": "a336b937dc0fef0d5e8b34b59ca137f4",
"score": "0.6491221",
"text": "def step_forward\n shortest_node = self.return_shortest\n self.distances(shortest_node)\n end",
"title": ""
},
{
"docid": "836d623e7e5be19acbc1495e06b49c8c",
"score": "0.6468053",
"text": "def print_shortest_path(graph, nodes, source_stopid, destination_stopid)\n source_node = get_node_by_stopid(nodes, source_stopid)\n destination_node = get_node_by_stopid(nodes, destination_stopid)\n\n dijkstra = WhichBus::Dijkstra.new(graph, source_node)\n shortest_path = dijkstra.shortest_path_to(destination_node)\n\n epochTime = dijkstra.distance.first[1] # total cost of time\n time = Time.at(Time.now - epochTime).min\n source_node_title = get_node_by_stopid(nodes, source_stopid).name\n destination_node_title = get_node_by_stopid(nodes, destination_stopid).name\n\n\n puts \"It should take about #{time} min to get from #{source_node_title} to #{destination_node_title}\"\n puts \"Here is the path you need to take:\"\n shortest_path.each_with_index do |bus_stop, index|\n puts \"#{index + 1}: #{bus_stop} with bus: #{bus_stop.route_id}\"\n end\n return shortest_path\nend",
"title": ""
},
{
"docid": "a249caf53800957fe1d257caf0f12089",
"score": "0.6448751",
"text": "def shortest_flight\n\t\t\n\t\tprint \"Enter the two points (Ex: A-B) : \"\n\t\tinitial_node, final_node = gets.chomp.upcase.split(/\\s*-\\s*/)\n\t\tunvisited_nodes = []\n\t\tnode_set_price = {initial_node => [0,initial_node]}\n\t\tnode_set_time = {initial_node => [0,initial_node, str_to_time(\"0000\")]}\n\t\t\n\t\t@combinations.each do |key, value|\n\t\t\tfor i in 0...2 do\n\t\t\t\tunvisited_nodes << key[i] if !unvisited_nodes.include?(key[i])\n\t\t\tend\n\t\tend\n\t\t\n\t\tcheapest_price, path = find_least_price(node_set_price, unvisited_nodes.dup, final_node)\t\t\t\t#for cheapest fare\n\t\tputs \"\\nCheapest price from #{initial_node} to #{final_node} is #{cheapest_price} and path is #{path}\"\n\t\t\n\t\tearliest_time, path = find_earliest_time(node_set_time, unvisited_nodes.dup, final_node)\t\t#for earliest time\n\t\tearliest_time /= 60\n\t\thours = earliest_time.to_i / 60\n\t\tmins = earliest_time.to_i % 60\n\t\tputs \"Earliest time is #{hours} hours and #{mins} mins, path is #{path}\"\n\tend",
"title": ""
},
{
"docid": "ef82323390f2904da684fc86ead29fef",
"score": "0.6438398",
"text": "def solve(start_node, end_node, forbidden_nodes = [])\n\n\t\t\tgraph = UndirectedGraph.new\n\n\t\t\tfor x in COLUMNS\n\t\t\t\tfor y in ROWS\n\n\t\t\t\t\tu = \"#{x}#{y}\"\n\n\t\t\t\t\t# Do not add a node to the graph if it is one of the positions on which the knigth may not land\n\t\t\t\t\tif (!forbidden_nodes.include?(u))\n\t\t\t\t\t\tpossible_moves = get_possible_moves(u)\n\t\t\t\t\t\tpossible_moves.each do |v|\n\t\t\t\t\t\t\tif (!forbidden_nodes.include?(v))\n\t\t\t\t\t\t\t\tgraph.add_edge(u, v)\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn graph.find_shortest_path(start_node, end_node)\n\t\t\t\n\t\tend",
"title": ""
},
{
"docid": "c8f4515a733c0165fd21181ce81afbf8",
"score": "0.64337814",
"text": "def shortest_path(node1, node2)\n\t\t@queue = Array.new\n\t\t@explored = Array.new(size, false)\n\t\t@explored[node1-1] = true\n\t\t@queue.push([node1, 0])\n\t\tcalculate_shortest_path(node2)\n\tend",
"title": ""
},
{
"docid": "519158b7134c6485276767afaea69072",
"score": "0.6432454",
"text": "def basic\n #Assign origin as the start point - which we will amend at the end of each iteration.\n start_point = origin\n\n until optimal_route.size == points_to_visit.size + 1 #for the origin\n tmp = []\n\n #Get hold of the paths from the start point for this iteration and shovel them into tmp to analyse.\n graph.each do |path|\n tmp << path if path[:origin] == start_point\n end\n\n #Take the first possible path as the benchmark against which we can measure against.\n shortest = tmp.first\n\n tmp.each do |possible_path|\n shortest = possible_path if possible_path[:distance] < shortest[:distance]\n end\n\n #This is the shortest path from this start point so we use it.\n optimal_route << shortest\n\n #Delete nodes\n graph.delete_if { |h| h[:origin] == start_point }\n\n #Do not delete if the origin (also the endpoint) is the destination.\n graph.delete_if { |h| h[:destination] == start_point && h[:destination] != origin }\n\n #Assign the destination of the current path as the new start point for the next iteration.\n start_point = shortest[:destination]\n end\n optimal_route\n end",
"title": ""
},
{
"docid": "ddbd699832858427a53a23e82c78bb1c",
"score": "0.6407794",
"text": "def shortest_direction_to_room(start, finish)\n best = 100\n result = nil\n\n DIRECTIONS.each_value do |d|\n @visited = [start]\n if start.valid_move_direction?(d)\n route = room_by_name(start.door_destination(d))\n distance = room_distance(route, finish)\n if distance && distance < best\n best = distance\n result = d\n end\n end\n end\n\n {:direction => result, :distance => best}\n end",
"title": ""
},
{
"docid": "8b1dd7d0d460a5fd3e8e6749708b0f57",
"score": "0.6396942",
"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": "a51ff28f23192548cb37d82dcba16ecf",
"score": "0.6392369",
"text": "def shortest_path s, d\n dijkstra s\n @path = []\n add_path d\n @path\n end",
"title": ""
},
{
"docid": "f50b73cd14f044a1fdfe5a89ad71b908",
"score": "0.6385236",
"text": "def shortest_paths(s, dest)\n @source = s\n dijkstra s\n #puts \"Source: #{@source}\"\n #puts \"\\nTarget: #{dest}\"\n #print_path dest\n\n if @d[dest] != @INFINITY\n @dist = @d[dest]\n else\n puts \"\\nNO PATH\"\n end\n\n print_path dest\n\n end",
"title": ""
},
{
"docid": "88759e06589296044755f449e500809e",
"score": "0.6385082",
"text": "def find_shortest_path(all_routes, origin, destination)\n shortest_path = Array.new\n origin_index = nil\n destination_index = nil\n\n # puts \"All Possible Routes: \"\n all_routes.uniq.each { |stops|\n # p stops\n\n if shortest_path.empty?\n\n # Populate the origin index and destination index\n origin_index = find_string_in_array(stops, origin)\n destination_index = find_string_in_array(stops, destination)\n\n # Check if the origin and destination are in the stop\n if !origin_index.nil? and !destination_index.nil?\n shortest_path = stops.clone\n end\n end\n }\n if !origin_index.nil? and !destination_index.nil?\n shortest_path[origin_index..destination_index]\n end\nend",
"title": ""
},
{
"docid": "4df48b93714957fce3f7efff8a03bf72",
"score": "0.63797915",
"text": "def solution\n graph_map = parse_graph_map.flatten\n set_route(graph_map)\n graph = Graph.new(rows, cols, graph_map)\n graph.shortest_path(start, finish).map(&:reverse).reverse\n end",
"title": ""
},
{
"docid": "a0a6bb18748acf1daeed95f6e46eeaf4",
"score": "0.6370789",
"text": "def brute_force_tsp(return_to_origin = true)\n min_distance = 1.0/0.0\n best_path = nil\n paths = (0...count).to_a.permutation.to_a\n\n paths.each do |path|\n cumulative_distance = 0\n\n path[0..path.length - 2].each_with_index do |start_index, i|\n end_index = path[i + 1]\n if vertices[start_index].weights[end_index]\n cumulative_distance += vertices[start_index].weights[end_index]\n else\n cumulative_distance += 1.0/0.0\n end\n end\n\n if return_to_origin\n if vertices[path[-1]].weights[path[0]]\n cumulative_distance += vertices[path[-1]].weights[path[0]]\n else\n cumulative_distance += 1.0/0.0\n end\n end\n\n if cumulative_distance < min_distance\n min_distance = cumulative_distance\n best_path = path\n end\n end\n\n if return_to_origin\n puts \"The shortest distance for a complete loop is #{min_distance}\"\n else\n puts \"The shortest route to visit each vertex exactly once is #{min_distance}\"\n end\n puts humanize_tsp_route(best_path, return_to_origin)\n [min_distance, best_path]\n end",
"title": ""
},
{
"docid": "1cc2110b59cd90c89e09ce48b12aaa5b",
"score": "0.6361427",
"text": "def shortest_path(adj_list, start_node, end_node)\n parents = {}\n distances = {}\n current_distances = MapMinHeap.new(create_node_array(adj_list, start_node))\n\n # Of the remaining nodes, remove the one with the shortest distance and add it to the hash of known\n # shortest distances, then update its neighbors.\n while current_distances.size > 0\n node, distance = current_distances.extract_min\n distances[node] = distance\n break if node == end_node\n\n # Iterate through adjacent nodes and update them if necessary.\n # If the distance from the start node to the adjacent node through the current node is less than the\n # previously found shortest distance to the adjacent node, then update the adjacent node's shortest\n # distance and parent.\n adj_list[node].each do |neighbor|\n adj_node, adj_distance = neighbor\n next if distances[adj_node]\n parents[adj_node] = node if current_distances.decrease(adj_node, adj_distance + distance)\n end\n end\n\n distance = distances[end_node]\n return -1 if !distance || distance == Float::INFINITY\n path = get_path(parents, end_node)\n { path: path, distance: distance }\nend",
"title": ""
},
{
"docid": "d74718a94d769acea1de55048039e20e",
"score": "0.6349136",
"text": "def shortest_path(paths)\n l = paths[0].length\n shortest = paths[0]\n for i in 1...paths.length\n if l > paths[i].length\n l = paths[i].length\n shortest = paths[i]\n end\n end\n shortest\n end",
"title": ""
},
{
"docid": "cf68820d484616baf5f5a14b2766bfe8",
"score": "0.6345961",
"text": "def shortest_distance(start_town,end_town)\n\n temp_nodes,queue,visited = init_dijkstra(start_town)\n\n while visited.length < temp_nodes.length\n current = extract_min(queue)\n visited.push current\n\n visited.delete temp_nodes[start_town] if start_town == end_town\n\n current.edges.each do |edge_target, edge|\n node = temp_nodes[edge_target]\n\n new_dist = edge.value + current.min_dist\n if node.min_dist > new_dist || node.min_dist == 0\n node.min_dist = edge.value + current.min_dist\n end\n if !(queue.include? node) || !(visited.include? node)\n queue.push node\n end\n\n end\n end\n temp_nodes[end_town].min_dist\n end",
"title": ""
},
{
"docid": "1f721492a87674473cf713373c4621f6",
"score": "0.6345596",
"text": "def shortest_path(root, dest)\n priority = Hash.new\n visited = Hash.new\n previous = Hash.new\n q = PriorityQueue.new\n @vertices.each do |k, up|\n if up\n priority[k] = @@infinity\n visited[k] = false\n previous[k] = nil\n end\n end\n priority[root] = 0\n q[root] = 0\n until q.empty?\n u = q.delete_min\n visited[u[0]] = true\n break if u[1] == @@infinity\n @edges_cost.each_key do |s|\n @edges_cost[s].each_key do |d|\n if edges_up[s].fetch(d) and vertices[s] and vertices[d]\n if !visited[d] and priority[s] + @edges_cost[s].fetch(d) < priority[d]\n previous[d] = s\n priority[d] = priority[s] + @edges_cost[s].fetch(d)\n q[d] = priority[d]\n end\n end\n end\n end\n end\n prior = dest\n out = \"#{prior} \"\n while previous[prior]\n out = \"#{previous[prior]} \" + out\n prior = previous[prior]\n end\n out += \"#{priority[dest]}\\n\"\n print out\n priority[dest]\n end",
"title": ""
},
{
"docid": "1a9a17acf884af31f40435148ea24be2",
"score": "0.63322383",
"text": "def shortest_path(source, finish_list)\n dist = {} # The distance of all vertices from start vertex\n prev = {} # Previous node in the optimal path\n q = Depq.new\n\n @dg.each_vertex do |v|\n # dist contains the \"Depq::Locator\" for that value\n dist[v] = (v == source) ? q.insert(v, 0) : q.insert(v, INFINITY)\n end\n\n while not q.empty?\n u = q.delete_min\n if dist[u].priority == INFINITY\n @log.info(\"shortest_path(): dist[#{u}] == Infinity\")\n break\n end\n if finish_list.include?(u)\n finish_vertex = u\n break\n end\n @dg.adjacent_vertices(u).each do |v|\n alt = dist[u].priority + 1\n if alt < dist[v].priority\n dist[v].update(v, alt)\n prev[v] = u\n end\n end\n end # while\n\n s = [] # The shortest path from source to finish_vertex\n w = finish_vertex\n while not prev[w].nil?\n s.push(w)\n w = prev[w]\n end\n\n return s\n end",
"title": ""
},
{
"docid": "f466d3dd1b9f3e32db6c0a1efa46de9c",
"score": "0.63317126",
"text": "def test_findShortestPath\n graph = AirGraph.new()\n data = {\"metros\" => [{\"code\"=> \"A\", \"name\"=>\"A\", \"population\"=>1}, {\"code\"=> \"B\", \"name\"=>\"B\", \"population\"=>2}, {\"code\"=> \"C\", \"name\"=>\"C\", \"population\"=>3}], \"routes\" => [{\"ports\"=> [\"A\", \"B\"], \"distance\"=>1, \"routeStatus\"=>1}, {\"ports\"=> [\"B\", \"C\"], \"distance\"=>3, \"routeStatus\"=>1}, {\"ports\"=> [\"A\", \"C\"], \"distance\"=>5, \"routeStatus\"=>1}]}\n graph.fillData(data)\n routeString = findShortestPath(\"A\", \"C\")\n assert_equal(routeString, \"A,B,C\")\n end",
"title": ""
},
{
"docid": "74dbe80e2ca3c76dfa9d80754440c91f",
"score": "0.6319839",
"text": "def get_min_distance_in_fringe\n @fringe.reduce(Float::INFINITY) do |memo,node|\n if (node.destination_distance < memo)\n node.destination_distance\n else\n memo\n end\n end\n end",
"title": ""
},
{
"docid": "a461ee88ce49eb8b4e4d3c13cb9f07cc",
"score": "0.63144416",
"text": "def shortest_path_opt(graph,start_vertex,finish_vertex)\n #O(vertex * edge) implementation of djikstra's algorithm\n #graph is a nested hash of nodes, with their edges represented by a hash of the vertices they are connected to and their length\n #finds shortest path between start_vertex and finish_vertex\n distance_hash = initialize_distance_hash(graph, graph.keys, start_vertex) #The distance hash represents how long it takes to get to the node in question from the start_vertex\n distance_heap = initialize_heap(distance_hash)\n visited = [start_vertex]\n while visited.length != graph.keys.length\n node = distance_heap.get_and_remove_min \n if node.value == Float::INFINITY \n break\n end\n node_length = distance_hash[node.name]\n neighbors = graph[node.name] #returns dictionary of neighbors and their distance from node\n discover_heap(distance_heap, neighbors, visited) #updates heap with distance information of closest nodes\n\n distance_heap.array_rep.each do |neighbor|\n if neighbor.value == Float::INFINITY \n break\n end\n \n new_length = node_length + neighbor.value\n \n if distance_hash[neighbor.name] > new_length\n distance_hash[neighbor.name] = new_length\n end\n end\n \n visited << node\n end\n return distance_hash[finish_vertex]\nend",
"title": ""
},
{
"docid": "b62587f38496c7a311f12a9c2fe915bf",
"score": "0.6309249",
"text": "def shortest_path(airlineData, metro, destination, distance)\n metros = airlineData.metros\n if metro[CODE] == destination\n return nil\n end\n traverse_graph(destination, metros, metro[CODE])\n end",
"title": ""
},
{
"docid": "df3742fd7532de5a94dcec8e8cfeca90",
"score": "0.62996036",
"text": "def solve\n # @ending = [@map.width - 1, (@map.height - 1)*25]\n @infinity = @map.size * 10\n res = shortest_path_wg(@map.array)\n res.sum\n # prepare_cost_map\n end",
"title": ""
},
{
"docid": "ba15794384424e9994a5192922dd24fc",
"score": "0.6286499",
"text": "def path_to(goal)\n closed_nodes = Set.new\n open_nodes = Set.new\n open_nodes.add(self)\n\n g_scores = {self => 0}\n h_scores = {self => guess_distance(goal)}\n f_scores = h_scores.dup\n came_from = {}\n\n until open_nodes.empty?\n fmin_node = nil\n fmin = nil\n open_nodes.each do |node|\n next unless fmin.nil? || f_scores[node] < fmin\n fmin_node = node\n fmin = f_scores[node]\n end\n\n if fmin_node == goal\n path = []\n node = fmin_node\n while node\n path.unshift(node)\n node = came_from[node]\n end\n return [g_scores[goal], path]\n end\n\n open_nodes.delete(fmin_node)\n closed_nodes.add(fmin_node)\n\n fmin_node.neighbors.each do |neighbor|\n next if closed_nodes.include?(neighbor)\n tmp_g_score = g_scores[fmin_node] + fmin_node.movement_cost(neighbor)\n if !open_nodes.include?(neighbor)\n open_nodes.add(neighbor)\n tmp_is_better = true\n elsif tmp_g_score < g_scores[neighbor]\n tmp_is_better = true\n else\n tmp_is_better = false\n end\n\n if tmp_is_better\n came_from[neighbor] = fmin_node\n g_scores[neighbor] = tmp_g_score\n h_scores[neighbor] = neighbor.guess_distance(goal)\n f_scores[neighbor] = g_scores[neighbor] + h_scores[neighbor]\n end\n end\n end\n\n [nil, nil]\n end",
"title": ""
},
{
"docid": "465b2193558a66afeb2ef9315d4da0a7",
"score": "0.62745667",
"text": "def shortest_distance\n distances.min_by(&:last).last\n end",
"title": ""
},
{
"docid": "f34cf7a53dd1c368fb3df9ea95c510c4",
"score": "0.6270032",
"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": "ceb18f70ebce3bebf9b568e39c68331f",
"score": "0.6267864",
"text": "def shortest_path(s, d)\n dijkstra s\n @path = []\n add_path d\n @path\n end",
"title": ""
},
{
"docid": "626f71e7c35d2c9646ad62ecdc3db3e4",
"score": "0.6258317",
"text": "def shortest_path_retro from, to, final_state\n path_vertices = []\n path_edges = []\n\n spt = shortest_path_tree( from, to, final_state, false )\n curr = spt.get_vertex( from )\n path_vertices << curr\n\n while incoming = curr.edge_in(0)\n path_edges << incoming\n\n curr = incoming.from\n path_vertices << curr\n end\n\n return path_vertices, path_edges\n end",
"title": ""
},
{
"docid": "da99e1c8e826ecc4cec2934762daf6ee",
"score": "0.6257987",
"text": "def dijkstra1(vertex)\n shortest_paths = {}\n possible_paths = { vertex => {cost: 0, edge: nil } }\n until possible_paths.length == 0\n next_vertex = find_min_vertex(possible_paths)\n shortest_paths[next_vertex] = possible_paths[next_vertex]\n possible_paths.delete(next_vertex)\n\n next_vertex.out_edges.each do |edge|\n possible_cost = shortest_paths[edge.from_vertex][:cost] +\n edge.cost\n last_cost = possible_paths[edge.to_vertex]\n if !last_cost || possible_cost < last_cost[:cost]\n possible_paths[edge.to_vertex] = {cost: possible_cost,\n edge: edge}\n end\n end\n end\n\n shortest_paths\nend",
"title": ""
},
{
"docid": "1b1e60e21f8a73e24da255ba51b73c86",
"score": "0.62413216",
"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": ""
}
] |
90782d154b1a77362ae17e4efcd7abfd
|
Set Exception Arguments: e: (Exception)
|
[
{
"docid": "f3daba6993c8a9c99e8014895bb964b8",
"score": "0.7716147",
"text": "def set_exception(e)\n @exception = e\n end",
"title": ""
}
] |
[
{
"docid": "fbb56ab9d0ebc5e437d5bb322cf305c6",
"score": "0.73475164",
"text": "def exception(*rest) end",
"title": ""
},
{
"docid": "5d97705576cc100ce70e45d32cd56138",
"score": "0.7157339",
"text": "def original_exception=(_arg0); end",
"title": ""
},
{
"docid": "cb25fb66cba0442901646596287d22ce",
"score": "0.70434445",
"text": "def underlying_exception=(_arg0); end",
"title": ""
},
{
"docid": "2c26b2bd03069eec75ce31e8b7badb5c",
"score": "0.6916538",
"text": "def exception(arg0, arg1, *rest)\n end",
"title": ""
},
{
"docid": "96dfb5699fcaa6361da681917b3237ca",
"score": "0.67195886",
"text": "def raise(*rest) end",
"title": ""
},
{
"docid": "96dfb5699fcaa6361da681917b3237ca",
"score": "0.67195886",
"text": "def raise(*rest) end",
"title": ""
},
{
"docid": "14968cf747e515f29e58b2748bb080b4",
"score": "0.65878254",
"text": "def exceptions_app=(_arg0); end",
"title": ""
},
{
"docid": "14968cf747e515f29e58b2748bb080b4",
"score": "0.65878254",
"text": "def exceptions_app=(_arg0); end",
"title": ""
},
{
"docid": "bc9816d3faf3fde74c2c5e83b5176462",
"score": "0.6569528",
"text": "def continued_exception=(_arg0); end",
"title": ""
},
{
"docid": "4dac4b979f593b9d292627b536bbf930",
"score": "0.64432514",
"text": "def enter_exception_context(exception); end",
"title": ""
},
{
"docid": "44d22064397fb382e8a90b8c6dde21fd",
"score": "0.64222705",
"text": "def raise(exception); end",
"title": ""
},
{
"docid": "edf8e8887c84ae24edc25331f5f9960a",
"score": "0.64121556",
"text": "def exception(exception = {})\n raise Teabag::RunnerException\n end",
"title": ""
},
{
"docid": "ed19f784297b5ee7fd40db7b7c7a9efe",
"score": "0.6381471",
"text": "def pass_exception\n throw :next_exception_handler\n end",
"title": ""
},
{
"docid": "8311a2811efb575cf69ba6bcb88af94e",
"score": "0.6369366",
"text": "def exception(e)\n self.error \"#{e.class}: #{e.message}\" << (\"\\n#{e.backtrace.join(\"\\n\")}\" unless e.backtrace.nil?)\n end",
"title": ""
},
{
"docid": "9e24219294b625fa3e25c027f492c6a1",
"score": "0.63289076",
"text": "def eval_exception(*args)\n eval(*args).exception\n end",
"title": ""
},
{
"docid": "fb8040b5131e08b792ecf33a85d346a0",
"score": "0.6289618",
"text": "def exception(params)\n update_attributes(\n {\n :res_message => \"Exception\",\n :status => 'EXCEPTION'\n }.merge(params)\n )\n end",
"title": ""
},
{
"docid": "1f056c44ee9efe3b6d66d35ccf642cdf",
"score": "0.62354374",
"text": "def handle_error(e)\n raise e\n end",
"title": ""
},
{
"docid": "05b0625467bb6113858f55795419216e",
"score": "0.6229918",
"text": "def exception_handler=(exception_handler); end",
"title": ""
},
{
"docid": "ba008d6cf17fd8d17d1542d3270a3520",
"score": "0.6212974",
"text": "def exception(command, exception)\n end",
"title": ""
},
{
"docid": "4394e1eb51f722b75b3838a1567a2a2b",
"score": "0.621287",
"text": "def sanitize_exception(e)\n e\n end",
"title": ""
},
{
"docid": "00646598185239f49e9674f717e32b47",
"score": "0.620248",
"text": "def rescue_from(exception); end",
"title": ""
},
{
"docid": "7e44fc560df197f35967ddbf52c4a879",
"score": "0.61824495",
"text": "def update!(**args)\n @exception = args[:exception] if args.key?(:exception)\n end",
"title": ""
},
{
"docid": "d44a85b9a28fe90d5f1b3e6119a2ff26",
"score": "0.6171227",
"text": "def original_exception; end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.61445665",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.61445665",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.61445665",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.61445665",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "b737e940d69bec805a2b9b2a43346ce2",
"score": "0.6141308",
"text": "def set_error(span, exception)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "911a1093b98239ca762d9ab5728531b1",
"score": "0.6135168",
"text": "def register_exception(e)\n @exceptions << e\n end",
"title": ""
},
{
"docid": "75bf6a345bf9bbd0a5c12dce5bf43a0b",
"score": "0.61289686",
"text": "def wrapped_exception; end",
"title": ""
},
{
"docid": "750ffd3738b798ae1dccaac78e531ec1",
"score": "0.6110691",
"text": "def exception_hook=(val); @rye_exception_hook = val; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.608707",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.608707",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.608707",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.608707",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.608707",
"text": "def exception; end",
"title": ""
},
{
"docid": "0cc86cb0dc378cd14d023d7a2a0fbcc2",
"score": "0.60855454",
"text": "def exception_details(e, msg); end",
"title": ""
},
{
"docid": "e9261e0a0d72b770314b048ecb249a06",
"score": "0.6058478",
"text": "def raise(*args)\n Kernel.raise(*args)\n end",
"title": ""
},
{
"docid": "6e75c3809cec6d24b46e04157ff4e676",
"score": "0.6027512",
"text": "def abort_on_exception=(_arg0); end",
"title": ""
},
{
"docid": "b726108d9a78c3633a644a2a9126c63d",
"score": "0.59959257",
"text": "def exception_class; end",
"title": ""
},
{
"docid": "598fd6e7ede42ca92d950387658409dc",
"score": "0.5993511",
"text": "def exception_on_syntax_error=(_arg0); end",
"title": ""
},
{
"docid": "0d70296f055df63853b325a62e7fe2ec",
"score": "0.59806174",
"text": "def raise(*args)\n ::Object.send(:raise, *args)\n end",
"title": ""
},
{
"docid": "d1e2748d1cc2ba1eb8a452cb4e704ea3",
"score": "0.5979972",
"text": "def set_exception(worker_name, exc_or_message)\n if exc_or_message.is_a?(Exception)\n self.exception = JobException.from_exception(exc_or_message)\n exception.worker_name = worker_name\n else\n build_exception(\n class_name: 'RocketJob::DirmonEntryException',\n message: exc_or_message,\n backtrace: [],\n worker_name: worker_name\n )\n end\n end",
"title": ""
},
{
"docid": "8a48d57b2eb9336a27dd33522e8f7ff9",
"score": "0.59778917",
"text": "def handle_perform_error(_e); end",
"title": ""
},
{
"docid": "64d8d44eecc1767b305769006b8d4050",
"score": "0.59746516",
"text": "def exceptions\n end",
"title": ""
},
{
"docid": "9d5ceef4419cd6f63d8bb4d8e3938177",
"score": "0.5965552",
"text": "def exception_renderer=(_arg0); end",
"title": ""
},
{
"docid": "67b42fc0d6f532eb409f121fab69fb6e",
"score": "0.5965287",
"text": "def model_exception(e)\n\t puts e\n\tend",
"title": ""
},
{
"docid": "d397a8a8ae4caf4edc402309735b8c3d",
"score": "0.5961583",
"text": "def exception(ex)\n raise NotImplementedError.new(\"Method 'exception' not implemented by '#{self.class.name}'\")\n end",
"title": ""
},
{
"docid": "dae4b7a2c99898300702fba290291fbb",
"score": "0.5949923",
"text": "def rescue_action(e); raise e; end",
"title": ""
},
{
"docid": "f2846b3469506555dc49c6b14e6eaf72",
"score": "0.59350634",
"text": "def exception_handler(ex)\n \nend",
"title": ""
},
{
"docid": "9fb31e2895ed0ae6ff921815e1c8f56e",
"score": "0.59306973",
"text": "def throw _args\n \"throw _args;\" \n end",
"title": ""
},
{
"docid": "d007f050f69900c2c27211e3150080bb",
"score": "0.59262913",
"text": "def raise_exc\n raise\n rescue\n end",
"title": ""
},
{
"docid": "5aa23556536f7f4a21e77f0af1142122",
"score": "0.59222054",
"text": "def raise(*args)\n ::Object.send(:raise, *args)\n end",
"title": ""
},
{
"docid": "b5bb9220d3cb42111fb1de566f53c758",
"score": "0.59142524",
"text": "def raises *args\n @raises = args\n self\n end",
"title": ""
},
{
"docid": "cabfc2eef5628cefd36fdc1bc510703f",
"score": "0.5913065",
"text": "def exception\n\t\t@exception\n\tend",
"title": ""
},
{
"docid": "eac9233caf3eae874e95270662a85a26",
"score": "0.5912108",
"text": "def exception\n @__exception\n end",
"title": ""
},
{
"docid": "9253a4ced2bba68a23efad2613fc0683",
"score": "0.590454",
"text": "def notify_exception(e)\n # ignore exception because the exception caused tuple server is down...\n Util.ignore_exception do\n write(Tuple[:exception].new(uuid, agent_type, e))\n end\n end",
"title": ""
},
{
"docid": "6cdbacc37db7b6d5f8ea43b81cafc392",
"score": "0.5893443",
"text": "def exceptions=(value)\n @exceptions = value\n end",
"title": ""
},
{
"docid": "6cdbacc37db7b6d5f8ea43b81cafc392",
"score": "0.5893443",
"text": "def exceptions=(value)\n @exceptions = value\n end",
"title": ""
},
{
"docid": "c37da160e0f3bf3300f665f5cfc9197e",
"score": "0.58683425",
"text": "def hubssolib_set_exception_data(e)\n HubSsoLib::Crypto.encode_object(e.message, request.remote_ip)\n end",
"title": ""
},
{
"docid": "8e3a42388bfc759cfde1d754bd67f5b6",
"score": "0.5862895",
"text": "def abort_on_exception=(val)\n @abort_on_exception = val\n end",
"title": ""
},
{
"docid": "e3348650e2d2261c204878dabc9f3db0",
"score": "0.586061",
"text": "def exception_handler; end",
"title": ""
},
{
"docid": "7852b50f5f6e3d7e9b006f57c9cda6f7",
"score": "0.5837203",
"text": "def cause=(exception)\n set_cause exception\n set_backtrace\n end",
"title": ""
},
{
"docid": "be21ba69cc6b00c3df65005d2681594e",
"score": "0.5816646",
"text": "def log_exception(e)\n error(e.inspect)\n e.backtrace.each { |line| error(line) }\n end",
"title": ""
},
{
"docid": "fe4579a8b911d5f578c266d6a8013be2",
"score": "0.5814219",
"text": "def exceptions; end",
"title": ""
},
{
"docid": "d5a1acc2e66f7c35ea724de617b61aaa",
"score": "0.5795203",
"text": "def setup_exception_context(ex, _pry_, options={})\n _pry_.last_exception = ex \n _pry_.backtrace = (ex.backtrace || [])\n\n PryStackExplorer.frame_manager(_pry_).user[:exception] = ex\n PryStackExplorer.frame_manager(_pry_).user[:inline_exception] = !!options[:inline]\n end",
"title": ""
},
{
"docid": "c4d206a1e96d2e0c13d591de37b3da1a",
"score": "0.5788657",
"text": "def exception\n @context[:exception]\n end",
"title": ""
},
{
"docid": "42ad383779a88cbaae1f85e65a90d70d",
"score": "0.5780072",
"text": "def refine_call_exception(e)\n if task.partially_instanciated?\n TaskEventNotExecutable.new(self).exception(\n \"#{symbol}_event.call on #{task} which is partially instanciated\\n\"\\\n \"The following arguments were not set:\\n \"\\\n \"#{task.list_unset_arguments.map(&:to_s).join('\\n ')}\"\n )\n elsif !plan\n TaskEventNotExecutable.new(self).exception(\n \"#{symbol}_event.call on #{task} but \"\\\n \"the task has been removed from its plan\"\n )\n elsif !plan.executable?\n TaskEventNotExecutable.new(self).exception(\n \"#{symbol}_event.call on #{task} but its plan is not executable\"\n )\n elsif task.abstract?\n TaskEventNotExecutable.new(self).exception(\n \"#{symbol}_event.call on #{task} but the task is abstract\"\n )\n elsif e.kind_of?(EventNotExecutable)\n TaskEventNotExecutable.new(self).exception(\n \"#{symbol}_event.call on #{task} which is not executable\"\n )\n else\n e\n end\n end",
"title": ""
},
{
"docid": "b92617be20c156cfe7912e48b3738c05",
"score": "0.5757681",
"text": "def log_error(exception); end",
"title": ""
},
{
"docid": "228ab50fc612c1ef2cd2ecd1ee4ccd14",
"score": "0.57569295",
"text": "def exception(exception, status)\n @current_step[:exception] = build_exception_detail(exception)\n end",
"title": ""
},
{
"docid": "578c65e697f06a93f8f21d985c8a073b",
"score": "0.57494926",
"text": "def set_exception(exc = nil, record_number = nil)\n if exc\n self.exception = JobException.from_exception(exc)\n exception.worker_name = worker_name\n exception.record_number = record_number\n end\n self.failure_count = failure_count.to_i + 1\n self.worker_name = nil\n end",
"title": ""
},
{
"docid": "f0c49c2fb48b95f09222ccfb18de7296",
"score": "0.5731925",
"text": "def catch_exceptions; end",
"title": ""
},
{
"docid": "2856613d454cc93364a2fdcd72d6839d",
"score": "0.5718714",
"text": "def raise(exception_klass = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "62c4f675f61371a2b32114b432af529a",
"score": "0.57081634",
"text": "def on_exception(&value)\n @on_exception = value if block_given?\n \n @on_exception\n end",
"title": ""
},
{
"docid": "634801aab7145a70be278d6450564d51",
"score": "0.57018447",
"text": "def raise_error(*args)\n @expectation.raise(*args)\n self\n end",
"title": ""
},
{
"docid": "b2808caadc50e6ced97f8ae9cabb1906",
"score": "0.5693406",
"text": "def any_exception_captured=(_arg0); end",
"title": ""
},
{
"docid": "87a6f488959275e80a6ab30194fb60a6",
"score": "0.5672909",
"text": "def log_exceptions\n yield\n rescue Exception => e\n self.exception e\n raise e\n end",
"title": ""
},
{
"docid": "4e7c954ec07a99c0d7d5f22c380b667e",
"score": "0.5667289",
"text": "def raise(fiber, *arguments); end",
"title": ""
},
{
"docid": "160736172f351b72a4401d1aed2b0e17",
"score": "0.56642807",
"text": "def set_backtrace(arg0)\n end",
"title": ""
},
{
"docid": "72463325bb8edf4786a5fdb294f445ee",
"score": "0.56625074",
"text": "def set_exit_exception; end",
"title": ""
},
{
"docid": "61148f2d94a1f64f1b482fee767e0b86",
"score": "0.5658006",
"text": "def exception\n raise \"It's a bad one!\"\n end",
"title": ""
},
{
"docid": "8ba49a0c14b94eec5471e3ceced0fe4e",
"score": "0.5655256",
"text": "def model_exception(e, a_label)\n\t puts e #DEBUG - ERRORS\n\t\tputs clean_backtrace(e) #DEBUG - ERRORS\n\t\ta_label.setStringValue(\"Database Error: \" + e.to_s) unless a_label.nil?\n\tend",
"title": ""
},
{
"docid": "258822e49d25593351846633eb85599f",
"score": "0.5654618",
"text": "def abort_on_exception=(*) end",
"title": ""
},
{
"docid": "9e750daa93454fc66e8070b84d0ebe92",
"score": "0.5654032",
"text": "def exception(ex)\n update_result(Automation::Result::Exception)\n @logger.error(format_exception(ex))\n end",
"title": ""
},
{
"docid": "c6889cf8185318de4725c229f6cef9f5",
"score": "0.5645634",
"text": "def underlying_exception; end",
"title": ""
},
{
"docid": "4b84fc3f5d22d8dd977e7acfda21c131",
"score": "0.56382805",
"text": "def exception_with_data(e, code, msg, data = {})\n\n OstKycSdkRuby::Util::Result.exception(\n e, {\n error: code,\n error_message: msg,\n data: data\n }\n )\n\n end",
"title": ""
},
{
"docid": "da31515b9d2646f73e96af6d3426c53f",
"score": "0.56287986",
"text": "def on_exception(&blk)\n @on_exception = blk\n end",
"title": ""
},
{
"docid": "0115a10e08b43dc117d245488e75e13a",
"score": "0.56194556",
"text": "def refute_exception\n yield\n rescue StandardError => e\n flunk e.message\n end",
"title": ""
},
{
"docid": "e938bc1ed32aa2ce12dc99be8b7970ef",
"score": "0.5618132",
"text": "def report(e, other = {})\n if raise_errors?\n squash_context(exception_info(e), other) # surface problems squashing\n raise e\n else\n report!(e, other)\n end\n end",
"title": ""
},
{
"docid": "8aeb8cd1c725dcc9ab0d36cc97b816cc",
"score": "0.5610048",
"text": "def on_exception(&f)\n @on_exception = f\n end",
"title": ""
},
{
"docid": "c4a596738780745b12ec0aa0b452d499",
"score": "0.5552908",
"text": "def visit_exception\n exception = object.value\n\n puts(\n EXCEPTION_ERROR_MESSAGE % [\n exception.inspect,\n exception.backtrace.join(\"\\n\")\n ]\n )\n end",
"title": ""
},
{
"docid": "998a90aae1cc47f8cbf9b76b71edece1",
"score": "0.5541827",
"text": "def default_exception_renderer=(_arg0); end",
"title": ""
},
{
"docid": "9a441f9db4409b3b6d0376d82dbdc4cd",
"score": "0.5523012",
"text": "def error e\n log(\"ERREUR: #{e.message}\")\n log(\"BACKTRACE ERREUR: #{e.backtrace.join(\"\\n\")}\")\n self << {error: e.message, backtrace: e.backtrace}\n end",
"title": ""
},
{
"docid": "10ab5a76e87610c31bededccdca9f11b",
"score": "0.5515497",
"text": "def handle_exception(e = Exception, &block)\n raise CapabilitiesExceeded\n end",
"title": ""
},
{
"docid": "0d56af1d0b05102277d5573b8568d141",
"score": "0.5515128",
"text": "def after_exception(e)\n end",
"title": ""
},
{
"docid": "ec6f61d708db2199fcae1a179ad7a908",
"score": "0.55097455",
"text": "def fail(message)\n @exception = message\n end",
"title": ""
},
{
"docid": "1a018ec453d2734bfcb4ac656e7259c4",
"score": "0.5508401",
"text": "def handle_receiving_exception(e)\n end",
"title": ""
},
{
"docid": "75dd9d2a725c832f30c94ad0576fadba",
"score": "0.55059326",
"text": "def with_ruby_exception(matcher)\n with_original_exception(matcher)\n @ruby_exception_class = matcher\n self\n end",
"title": ""
},
{
"docid": "b3ed10304240c28a903b7498b5d4935d",
"score": "0.5498799",
"text": "def initError(msg)\n raise ArgumentError, msg\nend",
"title": ""
},
{
"docid": "e4bbc8a5776822dc8888512eae01ecfe",
"score": "0.5486903",
"text": "def exceptions=(value)\n @values['exceptions'] = value\n end",
"title": ""
}
] |
5d61bec6282e9b06668b1e55eca7eb5a
|
datetime Start date/time of export range.
|
[
{
"docid": "4b2372c14b80d618d4fba713f05789e8",
"score": "0.0",
"text": "def start_at\n @attributes[:start_at]\n end",
"title": ""
}
] |
[
{
"docid": "4756cd01497dddacd7eedc161d44e4ad",
"score": "0.7160854",
"text": "def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end",
"title": ""
},
{
"docid": "b59ed01648d451127a7801136102ef3a",
"score": "0.71453273",
"text": "def start_time\n dtstart.to_datetime\n end",
"title": ""
},
{
"docid": "58cbdd3039708d57aab83d9b5fa36c5f",
"score": "0.68475777",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "0a6b497b3493c4a22028475f7442685a",
"score": "0.6841517",
"text": "def start_time\n begin_date\n end",
"title": ""
},
{
"docid": "89cc9f81d3d98d7387208db7dccb1216",
"score": "0.68063617",
"text": "def start_date\n return start\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "924b40e6a771a053d236d5751ae622b7",
"score": "0.6803775",
"text": "def start_date_time\n return @start_date_time\n end",
"title": ""
},
{
"docid": "1182805902cca93ca1a6e71c708f16f8",
"score": "0.6705303",
"text": "def start_time\n dtstart_property ? dtstart.to_datetime : nil\n end",
"title": ""
},
{
"docid": "c2da5aba9f8616293ea27c1c1e48ed04",
"score": "0.66394114",
"text": "def declare_beg_range\n\t\t@beg_range = @beg_range.to_date \n\t\t@end_range = @end_range.to_date \n\tend",
"title": ""
},
{
"docid": "9bf363dfc192f56305e4ebe64afd5817",
"score": "0.66106576",
"text": "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end",
"title": ""
},
{
"docid": "f935a597c986fdf02f299714eb492653",
"score": "0.6609672",
"text": "def start_date\n date\n end",
"title": ""
},
{
"docid": "1a4d58891b4f98c46eebd98cb15ea4d5",
"score": "0.66006434",
"text": "def start_date_time\n return nil unless start_date && start_time\n DateTime.new(start_date.year, start_date.month, start_date.day, start_time.hour, start_time.min, start_time.sec, start_time.zone)\n end",
"title": ""
},
{
"docid": "07d8646d7145a10f1f6656aba2fc4607",
"score": "0.6595773",
"text": "def start_time\n by_date\n end",
"title": ""
},
{
"docid": "58a84fae4eb298dbdbac8c0d850771be",
"score": "0.6589696",
"text": "def start_date\n @start_date = Date.strptime(date_range_to_dates.first, \"%m/%d/%Y\")\n end",
"title": ""
},
{
"docid": "4c9f08854439eca24a14d6c73fd8dcbd",
"score": "0.6572255",
"text": "def start_date\n\t\treturn Date.new(y=year, m=START_MONTH, d=START_DAY)\n\tend",
"title": ""
},
{
"docid": "57e1c10df871f555bb4371d4fedc6082",
"score": "0.6552002",
"text": "def start_date\n\t\tDate.new( @year, @month, 1 )\n\tend",
"title": ""
},
{
"docid": "9ffd6955878b86c457531e695628172a",
"score": "0.6518506",
"text": "def start_time\n self.date\n end",
"title": ""
},
{
"docid": "f70da4c076e62d8c94c80335a78cace2",
"score": "0.6471168",
"text": "def dt_start\n @current_date.clone if @current_date\n end",
"title": ""
},
{
"docid": "1b7fae6072409b673f4188966be8ed99",
"score": "0.6405556",
"text": "def starts_at\n Time.at(start_time_millis / 1000).utc.to_datetime\n end",
"title": ""
},
{
"docid": "106e33cca32dcbba049f4388fd682ccc",
"score": "0.6397294",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "1bb2e52980818ef8b193ce4a6e56405d",
"score": "0.63919294",
"text": "def start_time\n self.day\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "671d680c3ef541145a2a7054e48678c7",
"score": "0.6384007",
"text": "def start_date_time=(value)\n @start_date_time = value\n end",
"title": ""
},
{
"docid": "5d9c609a46dc4c48e714d1202c10c01c",
"score": "0.6358607",
"text": "def reporthelp_start_time( form )\n return form.calendar_date_select(\n :range_start,\n {\n :embedded => false,\n :year_range => Timesheet.used_range()\n }\n )\n end",
"title": ""
},
{
"docid": "25492f999bfb1660c81743c1203353be",
"score": "0.633682",
"text": "def range_start=( value ); @range_start = value; rationalise_dates(); end",
"title": ""
},
{
"docid": "fde2debc12cec03fdf18e91d1a2234fb",
"score": "0.63308036",
"text": "def immersive_start_date\n @p0_start_date + 63\n end",
"title": ""
},
{
"docid": "86749f68e2d9e7c16a1f57b3feb35eb1",
"score": "0.6322091",
"text": "def start\n\tself[:date_start].strftime(\"%d.%m.%Y\") || '-'\n end",
"title": ""
},
{
"docid": "f42d726d11a9509b897d366a85d92e73",
"score": "0.6310717",
"text": "def start_of_time\n Date.jd(0).strftime(\"%Y-%m-%d\")\n end",
"title": ""
},
{
"docid": "0ed029f97eadad999f8901919bcd1627",
"score": "0.6300754",
"text": "def started_at; end",
"title": ""
},
{
"docid": "0ed029f97eadad999f8901919bcd1627",
"score": "0.6300754",
"text": "def started_at; end",
"title": ""
},
{
"docid": "0ed029f97eadad999f8901919bcd1627",
"score": "0.6300754",
"text": "def started_at; end",
"title": ""
},
{
"docid": "0ed029f97eadad999f8901919bcd1627",
"score": "0.6300754",
"text": "def started_at; end",
"title": ""
},
{
"docid": "0ed029f97eadad999f8901919bcd1627",
"score": "0.6300754",
"text": "def started_at; end",
"title": ""
},
{
"docid": "28eb0d0b881f584aca8bfc5a1eb7beda",
"score": "0.6286126",
"text": "def start_date\n Time.parse(@start_date) if @start_date\n end",
"title": ""
},
{
"docid": "612a0cb5790b094091c67c6d5ab52d49",
"score": "0.6233708",
"text": "def start_time\n Date.today\n end",
"title": ""
},
{
"docid": "526c68aa74bec87110348934f4608b7b",
"score": "0.6224372",
"text": "def start_date\n @raw.first.date\n end",
"title": ""
},
{
"docid": "82d5d969ed7fa0b655ed99339377cf53",
"score": "0.62198323",
"text": "def start_time\n @start_time\n end",
"title": ""
},
{
"docid": "988e465a73408c1857df97e2b591b6f8",
"score": "0.6218324",
"text": "def date_range\n @date_range ||= start_at..end_at\n end",
"title": ""
},
{
"docid": "7b3076dea4426dfef69f0cfdaecec5b9",
"score": "0.61977595",
"text": "def date()\n\t\t(@start_date.to_time + (10**9)).to_date\n\tend",
"title": ""
},
{
"docid": "003fb352a7b41dccacb41153099b8264",
"score": "0.61574435",
"text": "def date_range\n earliest = WorkPacket.find_earliest_by_tasks( @task_ids )\n latest = WorkPacket.find_latest_by_tasks( @task_ids )\n\n # If the earliest or latest work packet value is nil, both should be\n # nil (obviously) and this means there are no work packets for the\n # tasks. In that case we just span 'all of time' so that the user\n # can see explicitly there's no booked time. Generating a report over\n # some single day range just looks odd (user thinks \"why hasn't it\n # covered all dates\"). The hide-zero-columns option can be employed\n # to clear up the report.\n\n end_of_range = latest.nil? ? Date.current : latest.date.to_date\n start_of_range = earliest.nil? ? Date.new( Timesheet.allowed_range().min, 1, 1 ) : earliest.date.to_date\n\n return ( start_of_range..end_of_range )\n end",
"title": ""
},
{
"docid": "686c29435bb0d9249f956cb12358002e",
"score": "0.6152568",
"text": "def start_time_idx() return (self.start_date.strftime(\"%Y%m%d%H%M\") rescue nil); end",
"title": ""
},
{
"docid": "f4d0ec087dd013ad57f27f5006fc7705",
"score": "0.6152339",
"text": "def start_time\n start_at.strftime(\"%F\") if start_at\n end",
"title": ""
},
{
"docid": "9b54eda3c89f42792f37b3368eece21b",
"score": "0.61472267",
"text": "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 9,0,0)\n end",
"title": ""
},
{
"docid": "beea9fb5b33670dacb286665d6f2dee7",
"score": "0.6142542",
"text": "def start_time\n data.start_time\n end",
"title": ""
},
{
"docid": "beea9fb5b33670dacb286665d6f2dee7",
"score": "0.6142542",
"text": "def start_time\n data.start_time\n end",
"title": ""
},
{
"docid": "e127a39ecdc957496560b2abad51cc44",
"score": "0.6133504",
"text": "def setup_range(date)\n diff = date.wday - self.class.windex(start_wday)\n @first = date - (diff + ((diff < 0) ? DAYS : 0))\n @last = @first + DAYS - 1\n end",
"title": ""
},
{
"docid": "b92a0996519bd6ddb0de3d04d476fde9",
"score": "0.61330277",
"text": "def start_time; end",
"title": ""
},
{
"docid": "50d73be4f0b5c8ebb18d64ce1fd3e4cd",
"score": "0.6121676",
"text": "def start\n starts_at.strftime(\"%R\")\n end",
"title": ""
},
{
"docid": "e03b65c89c5cd91a2ee09ce3598463ca",
"score": "0.6119843",
"text": "def start_time\n start\n end",
"title": ""
},
{
"docid": "561119d6a9eced699716cde7842a94fd",
"score": "0.6115964",
"text": "def start_time\n return @start_time\n end",
"title": ""
},
{
"docid": "49beb319a5b6274c12466cb9d8716cdd",
"score": "0.6089564",
"text": "def project_begin_date=(dt)\n self.project_period_start_date = dt\n end",
"title": ""
},
{
"docid": "cd16605240a0872104e0cff5d1a6ba3f",
"score": "0.6059625",
"text": "def start\n startDate\n end",
"title": ""
},
{
"docid": "eff5c5c75c62268487c4df447f9d568b",
"score": "0.6055056",
"text": "def base_for_time_range_components\n Time.current.beginning_of_day\n end",
"title": ""
},
{
"docid": "c7e701c2417cc3465dc4d0acb309e7e7",
"score": "0.6044104",
"text": "def history_start\n start_dt = case QaServer.config.historical_datatable_default_time_period\n when :month\n history_end_dt - 1.month\n when :year\n history_end_dt - 1.year\n else\n @parent.first_updated_dt\n end\n QaServer::TimeService.pretty_date(start_dt)\n end",
"title": ""
},
{
"docid": "3ec7ce4b2188bbd116312c8f59c0d33b",
"score": "0.60415465",
"text": "def default_date_range\n \"#{Hyrax.config.analytics_start_date},#{Time.zone.today}\"\n end",
"title": ""
},
{
"docid": "40dd364750253a677cd878e5424ed18d",
"score": "0.5991806",
"text": "def convert_to_start_at\n\t\tunless @start_date.blank? && @start_time.blank? \n\t\t\tself.start_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eff1bed00381757684b0bd5f35530d8e",
"score": "0.5990466",
"text": "def start_date\n @start_date ||= respond_to?(:parliamentPeriodStartDate) ? DateTime.parse(parliamentPeriodStartDate) : nil\n end",
"title": ""
},
{
"docid": "e93f81be862f74095422558588a0b211",
"score": "0.59823537",
"text": "def start_date_time\n return @start_datetime if @exec_date.nil? && @start_after.nil?\n # set tomorrow as default\n date = (@exec_date || date_add(_date_, 1)).split(\"-\").map(&:to_i)\n # set midnight as default\n time = (@start_after || \"00:00:00\").split(\":\").map(&:to_i)\n return Time.new(date[0], date[1], date[2], time[0], time[1], time[2])\n end",
"title": ""
},
{
"docid": "7abeebc0ef9503a83f44b3a6e69fcc7d",
"score": "0.5973524",
"text": "def period_start\n period.begin\n end",
"title": ""
},
{
"docid": "67dc4ce260943007b734d45280a7db86",
"score": "0.59586203",
"text": "def start=(time); end",
"title": ""
},
{
"docid": "78d02994fea10febb3d099673b2c4a42",
"score": "0.59544486",
"text": "def start_t\n self.start_time.strftime(\"%I:%M\") if self.start_time\n end",
"title": ""
},
{
"docid": "a952debff3eded45cd304f478aea90e5",
"score": "0.59382087",
"text": "def started_at\n date_at :start\n end",
"title": ""
},
{
"docid": "41b527efffe7fb580b1953f9d62da84b",
"score": "0.59374154",
"text": "def expected_start\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end",
"title": ""
},
{
"docid": "41ec084232b3367a867e19f298953f53",
"score": "0.59333634",
"text": "def specified_period\n @range = [@start_date, @end_date]\n end",
"title": ""
},
{
"docid": "e74ff4f93fbf2a92edb096c438e741cc",
"score": "0.59269786",
"text": "def start_date\n params[:start_date] ? params[:start_date].to_datetime : DateTime.now.beginning_of_month\n end",
"title": ""
},
{
"docid": "a08ddc7b4e4392093de3d069f8be4c70",
"score": "0.59199697",
"text": "def f_start_date\n\t\tself.expected_start_date.strftime(\"%d / %m / %Y\")\n\tend",
"title": ""
},
{
"docid": "38a9da85bc4762103d0d4797dbe2d7c1",
"score": "0.590598",
"text": "def start_date(starts)\n if starts.nil?\n t = Time.now\n t = Time.utc(t.year, t.month, t.day)\n t = t - 24 * 60 * 60 \n \"start\" + time_str(t)\n elsif starts.kind_of?(Time)\n \"start\" + time_str(starts)\n end\n end",
"title": ""
},
{
"docid": "489a6b8e396a33c11aa7b36086db2130",
"score": "0.59006566",
"text": "def report_range(start_date, end_date)\n @start_date = start_date\n @end_date = end_date\n end",
"title": ""
},
{
"docid": "985ccb78061c1b448923746a6aa12332",
"score": "0.589626",
"text": "def start_time=(value)\n @start_time = value\n end",
"title": ""
},
{
"docid": "5c6704ef25377ae07f51ccf4b8de8b2c",
"score": "0.58940876",
"text": "def start_time\n @internal_data.start_time\n end",
"title": ""
},
{
"docid": "984f753d2a4425853856bd881218b9f9",
"score": "0.5891918",
"text": "def start(value)\n merge(gadrstart: value.iso8601)\n end",
"title": ""
},
{
"docid": "3259c3413b1b8fd2cf7db66817d6ee78",
"score": "0.5881741",
"text": "def getStartDate\r\n\t\t\t\t\treturn startDate\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "a2d52bcf7be71cc9566d272254a53a65",
"score": "0.5880545",
"text": "def start_time\n @parts.first.start_time\n end",
"title": ""
},
{
"docid": "057f7ae02e88ba9c49f7e0334293dd9a",
"score": "0.5871031",
"text": "def set_time_range\n begin_date = Date.strptime(params[:begin_date], '%Y-%m-%d') rescue User.minimum(:created_at) rescue Date.new(2015)\n end_date = Date.strptime(params[:end_date], '%Y-%m-%d') rescue Time.zone.today\n @stats_time_range = (begin_date.beginning_of_day)..(end_date.end_of_day)\n end",
"title": ""
},
{
"docid": "c9f15f23154eeeccf3d275ed8bdc1faf",
"score": "0.5862955",
"text": "def started_at\n Convert.millis_to_time @gapi.statistics.start_time\n end",
"title": ""
},
{
"docid": "2998aa86abf50e62483a5cc0e3f01491",
"score": "0.5852306",
"text": "def end_time\n\t\tstart + 1.day\n\tend",
"title": ""
},
{
"docid": "54d4e60c5cc6a887aa93587cbe114095",
"score": "0.5842322",
"text": "def start_date_icalendar\n\t\treturn start_date.utc.strftime(\"%Y%m%dT%H%M%S\")\n\tend",
"title": ""
},
{
"docid": "acb4c98686fdf03616db9b24b6ee9769",
"score": "0.58357203",
"text": "def start_datetime(timeframe = nil)\n case timeframe\n when \"1month\" then 1.month.ago.to_datetime\n when \"3months\" then 3.months.ago.to_datetime\n when \"2years\" then 2.years.ago.to_datetime\n else 5.years.ago.to_datetime\n end\n end",
"title": ""
},
{
"docid": "fd99e07df38928deea3fcccdbf4c1ac7",
"score": "0.5826095",
"text": "def start_date\n @start_date ||= existing_prices.map { |x| Date.strptime(x.split(\" \")[1], DATE_FORMAT) }.max || begin\n stats = `ledger stats` # Most compact way to retrieve this data\n date_str = /Time\\speriod:\\s*([\\d\\w\\-]*)\\s*to/.match(stats)[1]\n return Date.strptime(date_str, \"%y-%b-%d\")\n end\n end",
"title": ""
},
{
"docid": "bb686194bb9b9dba2d3f60bc17b47586",
"score": "0.58258426",
"text": "def start_date\n taken_at || created_at \n end",
"title": ""
},
{
"docid": "c5bd8ff61403a57e71f69c13cd6f4e59",
"score": "0.5812175",
"text": "def starts_at=(date)\n super(date)\n set_ends_at\n end",
"title": ""
},
{
"docid": "0caab78b35f562e77c73e17207a3e25a",
"score": "0.5800782",
"text": "def range_start; range.first; end",
"title": ""
},
{
"docid": "f2a4ab2d771139bc9e84477f27a5b935",
"score": "0.57944846",
"text": "def start\n @range.start\n end",
"title": ""
},
{
"docid": "4c5f8f8160146495f169bd8d079a3433",
"score": "0.5793226",
"text": "def get_start_date\n date = Time.new\n year = date.year\n month = date.month < 10 ? \"0\" + date.month.to_s : date.month\n day = date.day < 10 ? \"0\" + date.day.to_s : date.day\n start_date = \"#{year-2}-#{month}-#{day}\"\n start_date\nend",
"title": ""
}
] |
dcaf53a5331bfe2c10108590ff81be90
|
grabs default search parameters if user has not input any or if the user just hit the page
|
[
{
"docid": "e34ea828c0b5e0f0cbb9fa4e6c94115f",
"score": "0.6574836",
"text": "def grab_search_params(location)\n\n params = {}\n\n params[:'search-text'] = \"Web Developer\"\n params[:'search-location'] = location\n params[:'start_date'] = Date.today\n\n verify_search(params, location)\n\n end",
"title": ""
}
] |
[
{
"docid": "144e186159bfea47af5a6362412f7dd2",
"score": "0.7380324",
"text": "def homepage_default user_parameters\n if !user_parameters['facet.field'].kind_of?(Array) || user_parameters['facet.field'].count == 1\n # this is a request for a facet page, like /catalog/facet/author_facet\n elsif user_parameters['q'].nil? && user_parameters['fq'].blank?\n user_parameters = streamline_query(user_parameters)\n end\n end",
"title": ""
},
{
"docid": "d471200beea84befc865829e3097d534",
"score": "0.73285997",
"text": "def default_search_params\n {\n content_cont: '',\n user_kind_in: [],\n user_looking_for: [],\n city_eq: '',\n within_range: [0, nil],\n user_id_eq: nil,\n user_is_verified_eq: nil,\n user_is_drinker_eq: nil,\n user_is_smoker_eq: nil,\n user_with_photos: nil,\n user_without_photos: nil,\n user_birth_year_or_user_birth_year_second_person_lteq: Time.now.year - 18,\n user_birth_year_or_user_birth_year_second_person_gteq: Time.now.year - 50,\n height: '',\n user_height_lteq: nil,\n user_height_gteq: nil,\n user_body_in: [],\n user_interests_id_in: [],\n sorts: sort_options[0][:value]\n }\n end",
"title": ""
},
{
"docid": "9149ed1a4b04908c2d041ff49cd1c4a1",
"score": "0.72891194",
"text": "def default_search_args(query_str)\n {'q'=> query_str}\nend",
"title": ""
},
{
"docid": "312b520ef3588613aa757735b6868d2c",
"score": "0.71687776",
"text": "def current_search_parameters\n if on_the_dashboard?\n return nil\n else\n return params[:q]\n end\n end",
"title": ""
},
{
"docid": "8cec4c94b432b252ec8cdede732b9b2f",
"score": "0.7161188",
"text": "def current_search_parameters\n return if on_the_dashboard?\n params[:q]\n end",
"title": ""
},
{
"docid": "75b403ccf34307c5bfd0c0b133e3e7a5",
"score": "0.7119322",
"text": "def default_search_params\n\t\t{\n\t\t\tvisitor_kind_in: [],\n\t\t\tvisitor_looking_for: [],\n\t\t\tvisitor_city_eq: '',\n\t\t\tvisitor_is_verified_eq: nil,\n\t\t\tvisitor_is_drinker_eq: nil,\n\t\t\tvisitor_is_smoker_eq: nil,\n\t\t\tvisitor_within_range: [0, nil],\n\t\t\tvisitor_with_photos: nil,\n\t\t\tvisitor_without_photos: nil,\n\t\t\tvisitor_birth_year_or_visitor_birth_year_second_person_lteq: Time.now.year - 18,\n\t\t\tvisitor_birth_year_or_visitor_birth_year_second_person_gteq: Time.now.year - 50,\n\t\t\tvisitor_height_lteq: nil,\n\t\t\tvisitor_height_gteq: nil,\n\t\t\theight: '',\n\t\t\tvisitor_body_in: [],\n\t\t\tvisitor_interests_id_in: [],\n\t\t\tvisitor_online_recently: nil,\n\t\t\tvisitor_online_now: nil,\n\t\t\tsorts: VISIT_SORT_OPTIONS[0][:value]\n\t\t}\n\tend",
"title": ""
},
{
"docid": "7ad7bf206151671a581f7a3ab21ef989",
"score": "0.7061542",
"text": "def search_value\n\t \tparams[:search_for] || nil\n\t end",
"title": ""
},
{
"docid": "5a8bd6167a85031d94be3f47c925cb2f",
"score": "0.6979111",
"text": "def normalize_search\n return unless request.get? || request.head?\n params[:search] = ActionController::Parameters.new unless params[:search].is_a?(ActionController::Parameters)\n\n deep_reject_blank = lambda do |hash|\n hash.reject { |_k, v| v.blank? || (v.is_a?(Hash) && deep_reject_blank.call(v).blank?) }\n end\n nonblank_search_params = deep_reject_blank.call(params[:search])\n\n if nonblank_search_params != params[:search]\n params[:search] = nonblank_search_params\n redirect_to url_for(params: params.except(:controller, :action, :index).permit!)\n end\n end",
"title": ""
},
{
"docid": "a2cb13a0a898aa16c7a61638addf9dc1",
"score": "0.69786435",
"text": "def search_value\n\t \tparams[:search] || nil\n\t end",
"title": ""
},
{
"docid": "b18e483c29fd64d32572dea01f5113f0",
"score": "0.6971072",
"text": "def params_search\n { order: 'name', return: 100, search: initial.downcase }\n end",
"title": ""
},
{
"docid": "1105a2feae212fb2b2aa23ca2212a6e5",
"score": "0.6941241",
"text": "def setup_search_options\n params[:search] ||= \"\"\n params.keys.each do |param|\n if param =~ /(\\w+)_id$/\n unless params[param].blank?\n query = \" #{$1} = #{params[param]}\"\n params[:search] += query unless params[:search].include? query\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e1604589d7fa79d339f09d04bff74c0a",
"score": "0.6931297",
"text": "def search_params\n unless params[:search].nil? || params[:search] == '' || params[:search] == ' '\n @search = params.require(:search)\n end\n end",
"title": ""
},
{
"docid": "fa0359d9be5c3e593c3962765400e0db",
"score": "0.6902882",
"text": "def search_qry\n {\n location: @attribs[:loc],\n keywords: @attribs[:q]\n }.merge(default_params).compact.to_query\n end",
"title": ""
},
{
"docid": "69e90ef4ebfb1297d10a92270d758fe5",
"score": "0.68818605",
"text": "def default_search_params\n\t\t{\n\t\t\tdestinations_in_bounds: nil, # southwest, northeast bounding coordinates eg. [{lon: \"\", lat: \"\"}, {lon: \"\", lat: \"\"}]\n\t\t\tdestinations_within: [0, nil], \t\t\t\t\t# origin point and range eg. [25, {lon: 19, lat: 52}]\n\t\t\tcity_eq: \t\t\t'',\n\t\t\tuser_kind_in: [],\n\t\t\tuser_looking_for: [],\n\t\t\tuser_is_verified_eq: nil,\n\t\t\tuser_is_drinker_eq: nil,\n\t\t\tuser_is_smoker_eq: nil,\n\t\t\tuser_with_photos: nil,\n\t\t\tuser_without_photos: nil,\n\t\t\tuser_birth_year_or_user_birth_year_second_person_lteq: Time.now.year - 18,\n\t\t\tuser_birth_year_or_user_birth_year_second_person_gteq: Time.now.year - 50,\n\t\t\theight: '',\n\t\t\tuser_height_lteq: nil,\n\t\t\tuser_height_gteq: nil,\n\t\t\tuser_body_in: [],\n\t\t\tuser_interests_id_in: [],\n\t\t\tuser_id_eq: nil,\n\t\t\tupcoming: true,\n\t\t\tother_users_location_not_eq: nil,\n\t\t\tsorts: SORT_OPTIONS[0][:value]\n\t\t}\n\tend",
"title": ""
},
{
"docid": "54db88bf135d782c307199184f278424",
"score": "0.68391436",
"text": "def determine_search_params(ip_loc)\n location = ip_loc\n options = parameters\n if options[:location] == \"ip\"\n options[:location] = location\n end\n options\nend",
"title": ""
},
{
"docid": "ff35aa512e4a655af07ed012f5f3a715",
"score": "0.67542005",
"text": "def search\n #depends on what to search\n search_by = Hash.new\n\n if not params[:name].blank?\n search_by[:name] = params[:name]\n end\n\n end",
"title": ""
},
{
"docid": "be780128ae9e2770373a3ab3d0a6d59e",
"score": "0.6754071",
"text": "def search_params\n params.fetch(:search, {})\n end",
"title": ""
},
{
"docid": "7d93f3ef672c19be3de25af2ef794f24",
"score": "0.67394227",
"text": "def search_params\n # TODO Configurar acá la variable params\n params[:query_name]\n end",
"title": ""
},
{
"docid": "8f5fd13523b04ce46352c825ce872e89",
"score": "0.67376816",
"text": "def default_search_field\n blacklight_config.default_search_field || search_field_list.first\n end",
"title": ""
},
{
"docid": "b9ba53b21305d5664610439b54fc603f",
"score": "0.6704365",
"text": "def base_search_params\n params.fetch(:base_search, {})\n end",
"title": ""
},
{
"docid": "64345a65f73f4b3b42f8bb1dcbe08032",
"score": "0.67039067",
"text": "def search_params\n params.fetch(:search, {})\n end",
"title": ""
},
{
"docid": "5938b1f6e58ddbb55e5b5a7444e06cc3",
"score": "0.66856027",
"text": "def default_search_params\n {\n destinations_in_bounds: nil, # southwest, northeast bounding coordinates eg. [{lon: \"\", lat: \"\"}, {lon: \"\", lat: \"\"}]\n destinations_within: [0, nil], # origin point and range eg. [25, {lon: 19, lat: 52}]\n city_eq: '',\n user_kind_in: [],\n user_looking_for: [],\n user_is_verified_eq: nil,\n user_is_drinker_eq: nil,\n user_is_smoker_eq: nil,\n user_with_photos: nil,\n user_without_photos: nil,\n user_birth_year_or_user_birth_year_second_person_lteq: Time.now.year - 18,\n user_birth_year_or_user_birth_year_second_person_gteq: Time.now.year - 50,\n user_height_lteq: nil,\n user_height_gteq: nil,\n user_body_in: [],\n\t\t\tuser_interests_id_in: [],\n\t\t\tupcoming: true,\n sorts: TRIP_SORT_OPTIONS[0][:value]\n }\n end",
"title": ""
},
{
"docid": "eeac00a54731bd81bda74000a5d2aabb",
"score": "0.6656505",
"text": "def default_search(input, list)\n send(\"#{Search.default_search}_search\", input, list)\n end",
"title": ""
},
{
"docid": "691ec3960cb9005cbbddf16d3c8b611d",
"score": "0.66273224",
"text": "def get_params_to_search(context)\n if params[:saved_search].present?\n @saved_search = SavedSearch.find_by(id: params[:saved_search], context: context)\n end\n return params[:q] if params[:use_search_params].present?\n params[:q] = @saved_search.try(:search_params) || params[:q]\n end",
"title": ""
},
{
"docid": "07a5559cd21be6cf6c267b50cce85bf1",
"score": "0.6625414",
"text": "def search_params\n if !params[:search].nil?\n params.fetch(:search).permit(:what)\n else\n params\n end\n end",
"title": ""
},
{
"docid": "07a5559cd21be6cf6c267b50cce85bf1",
"score": "0.6625414",
"text": "def search_params\n if !params[:search].nil?\n params.fetch(:search).permit(:what)\n else\n params\n end\n end",
"title": ""
},
{
"docid": "8eff96b7c7499917b4a89e883cb3516f",
"score": "0.659616",
"text": "def postSearch\n job_title = params[:job_title]\n company = params[:company]\n company = \"*\" if params[:company].blank?\n location = params[:location]\n location = \"*\" if params[:course_number].blank?\n return job_title , company, location\nend",
"title": ""
},
{
"docid": "c7add436e88a5333ef03cc81fc4fa636",
"score": "0.65914047",
"text": "def search(default_filter = false)\n @klass = default_filter ? \"selected\" : \"\"\n @predefined = {}\n @predefined[:open] = { :state => [:open, :reopened] }\n @predefined[:my_open] = { :state => [:open, :reopened], :assigned_to_id => [controller.current_user.id] } if controller.current_user\n\n render\n end",
"title": ""
},
{
"docid": "c43d07f31c456aa8205b5b3d56b92d9c",
"score": "0.6586555",
"text": "def search_param\n params[:loans][:search] if params[:loans] || nil\n end",
"title": ""
},
{
"docid": "e28fa3f5759b21680f3a7b53b392f547",
"score": "0.6580083",
"text": "def searchbyloc_params\n params.fetch(:searchbyloc, {})\n end",
"title": ""
},
{
"docid": "1678230f09f2740795853f488a14fe58",
"score": "0.656348",
"text": "def current_search_params(search_params = nil)\n search_params ||= params\n h = {}\n h[:query] = search_params[:query].strip if search_params[:query].present?\n h[:category_id] = search_params[:category_id] if search_params[:category_id].to_i > 0\n h[:school_id] = search_params[:school_id] if search_params[:school_id].to_i > 0\n h[:near_by_school_ids] = search_params[:near_by_school_ids] if search_params[:near_by_school_ids].present?\n h[:sort] = search_params[:sort] if ::ItemsHelper.valid_sort?(search_params[:sort] )\n h\n end",
"title": ""
},
{
"docid": "091e3495e77a162e1af1ace3e1274fb7",
"score": "0.65608734",
"text": "def search_params\n if params[:q] == nil\n params[:q] = session[search_key]\n end\n if params[:q]\n session[search_key] = params[:q]\n end\n params[:q]\n end",
"title": ""
},
{
"docid": "a5555eb269514f3cfb9dc683c7a62435",
"score": "0.65590936",
"text": "def default_query_params\n raise \"needs implementation\"\n end",
"title": ""
},
{
"docid": "a5555eb269514f3cfb9dc683c7a62435",
"score": "0.65590936",
"text": "def default_query_params\n raise \"needs implementation\"\n end",
"title": ""
},
{
"docid": "fe40c685e7edf2bbc3ba154e0a40c852",
"score": "0.655875",
"text": "def index\n @page_title = t('titles.search_results')\n @query = params[:query]\n allowed_punctuation = [\"/\",\"-\"]\n @query = sanitize_param_value(@query, allowed_punctuation) if @query.present?\n authorize_query!(@query)\n\n pdf_only_search_results? ? search_pdf_only : search_site_only\n\n end",
"title": ""
},
{
"docid": "d533cb358d616e19627261fea5228879",
"score": "0.65477437",
"text": "def build_search_params\n {\n keyword: '',\n skills: '',\n locations: '',\n company_names: '',\n titles: '',\n schools: '',\n degrees: '',\n names: '',\n phone_number_available: '0',\n active: '0',\n top_company: '0',\n top_school: '0',\n emails: '',\n tags: ''\n }\nend",
"title": ""
},
{
"docid": "aad4bd5cb12c510f514cc3dacb660f5f",
"score": "0.654276",
"text": "def search_value\n params[:search] && params[:search][:value]\n end",
"title": ""
},
{
"docid": "eb803e464dcc90b4c48424a1b348973f",
"score": "0.65350485",
"text": "def build_search_params\n {\n keyword: '',\n skills: '',\n locations: '',\n company_names: '',\n titles: '',\n schools: '',\n degrees: '',\n names: '',\n phone_number_available: false,\n active: false,\n top_company: false,\n top_school: false,\n emails: '',\n tags: ''\n }\nend",
"title": ""
},
{
"docid": "bd9ef582b73bb424ca9028d3644836e8",
"score": "0.6527717",
"text": "def search_params\n unless @search_params\n @search_params = {}.with_indifferent_access\n [:warehouse_id, :user_id, :invoice_number].map do |key|\n @search_params[key] = (!params[key].blank?) ? params[key].to_s : nil\n end\n end\n @search_params\n end",
"title": ""
},
{
"docid": "bda040fc8295661c75f302a6d6f2fcb2",
"score": "0.6526041",
"text": "def search_params\n search_params = {}\n unless (@issn.nil? or @issn.empty?) and (@isbn.nil? or @isbn.empty?)\n search_params[:isbn] = @isbn unless @isbn.nil?\n search_params[:issn] = @issn if search_params.empty?\n else\n search_params[:title] = @title unless @title.nil?\n search_params[:author] = @author unless @title.nil? or @author.nil?\n search_params[:genre] = @genre unless @title.nil? or @author.nil? or @genre.nil?\n end\n return search_params\n end",
"title": ""
},
{
"docid": "786f18fe109733250c7a25e80c1eacad",
"score": "0.6512017",
"text": "def search_attrs_params_hash\n @search_attrs_params_hash ||= if params[:search_attrs].nil? || params[:search_attrs] == '_use_defaults_'\n @runner.using_defaults = true\n { _use_defaults_: '_use_defaults_' }\n else\n params.require(:search_attrs).permit!.to_h.dup\n end\n end",
"title": ""
},
{
"docid": "c0ab6934849eeb7b1bdac7351e2452b3",
"score": "0.6502904",
"text": "def search_query\n params[:search_query]\n end",
"title": ""
},
{
"docid": "d330e35221fbeda94b9f48b7ffe757d8",
"score": "0.6486082",
"text": "def search(request)\n nil\n end",
"title": ""
},
{
"docid": "44db887b4b6f91155d9fb566ff389f3c",
"score": "0.6478732",
"text": "def get_search_params(params)\n search_params = {}\n search_params[:search] = params[:search] unless params[:search].blank?\n search_params[:sort] = params[:sort] unless params[:sort].blank?\n search_params[:authors] = params[:authors] unless params[:authors].blank?\n search_params[:categories] = params[:categories] unless params[:categories].blank?\n search_params[:document_type] = params[:document_type] unless params[:document_type].blank?\n search_params[:publisher] = params[:publisher] unless params[:publisher].blank?\n search_params[:city] = params[:city] unless params[:city].blank?\n search_params[:published] = params[:published] unless params[:published].blank?\n search_params[:page] = params[:page] unless params[:page].blank?\n return search_params\n end",
"title": ""
},
{
"docid": "7f4dcb1aed674f00d0ed578ba5a88b36",
"score": "0.6453707",
"text": "def perform_search\n if self.class == Alchemy::Admin::PagesController && params[:query].blank?\n params[:query] = \"lorem\"\n end\n return if params[:query].blank?\n @search_results = search_results\n if paginate_per\n @search_results = @search_results.page(params[:page]).per(paginate_per)\n end\n end",
"title": ""
},
{
"docid": "f1685dbbcc351120a7cf221f0a66ceff",
"score": "0.6449903",
"text": "def maintain_search_params\n search_params = {}\n search_params.merge!(:taxon => params[:taxon]) if !params[:taxon].nil? && !params[:taxon].empty?\n search_params.merge!(:subtaxons => params[:subtaxons]) if params[:subtaxons] != \"0\"\n search_params.merge!(:min_price => params[:min_price]) if !params[:min_price].nil? && !params[:min_price].empty?\n search_params.merge!(:max_price => params[:max_price]) if !params[:max_price].nil? && !params[:max_price].empty?\n search_params.merge!(:keywords => params[:keywords]) if !params[:keywords].nil? && !params[:keywords].empty?\n search_params.merge!(:sort => params[:sort]) if !params[:sort].nil? && !params[:sort].empty?\n search_params.merge!(:search => params[:search]) if !params[:search].nil? && !params[:search].empty?\n\n search_params\n end",
"title": ""
},
{
"docid": "30b8313154c8cc83852db315fad4d0a3",
"score": "0.64354056",
"text": "def search_result\n if params[:url][:keyword].nil?\n @urls = []\n else\n @urls = Url.custom_search(params[:url])\n end\n end",
"title": ""
},
{
"docid": "e70e0792f7ba16911e88b30cbd3f0966",
"score": "0.6423245",
"text": "def search_params search\n search = Hash.new\n [:writing, :kana, :romaji, :def_de, :def_en, :def_fr].each do |field|\n search[field] = \"%#{params[:search]}%\"\n end\n search\n end",
"title": ""
},
{
"docid": "98f399105841803a59db3abd01a384b6",
"score": "0.6411785",
"text": "def search_by_meta(model_name)\n # clean params\n old_params_search = params[:search]\n params[:search].delete_if { |key, value| (value.nil? || value.blank?) } unless params[:search].nil? || params[:search].empty?\n \n # check to see if params are there\n unless params[:search].nil? || params[:search].empty?\n # store old \"show_all\"\n show_all = params[:search]['show_all']\n params[:search].delete('show_all')\n \n @search = model_name.to_s.classify.constantize.search(params[:search])\n\n unless show_all.nil? || !show_all\n params[:search]['show_all'] = show_all\n end\n\n return @search\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "03fdcd4a5dd9b27b52936ed44a8a5c73",
"score": "0.6405177",
"text": "def filter_search\n # SET FORM\n city_id = params[\"user\"][\"city_id\"]\n @user_name = params[\"user\"][\"name\"]\n region_id = params[\"user\"][\"region\"][\"name\"]\n help_opts = params[\"user\"][\"help_option_ids\"]\n help_opts = help_opts.reject(&:empty?).map(&:to_i)\n @help_choice = help_opts\n @user_cities = city_id.reject(&:empty?).map(&:to_i)\n # @user = help_opts == \"true\" if user != \"\"\n @region_ids = region_id.reject(&:empty?).map(&:to_i)\n if @region_ids.empty? && !@user_cities.empty? # region not selected\n @users = User.where(city_id: city_id)\n elsif !@region_ids.empty?\n @users = User.joins(:city).where(cities: { region_id: region_id })\n end\n @users = @users.joins(:user_options).where(user_options: { help_option_id: help_opts }) unless help_opts.empty?\n @users = @users.where(name: @user_name) unless @user_name.empty?\n end",
"title": ""
},
{
"docid": "60a6864b685162aff39c45d77403cda2",
"score": "0.63990605",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "ef096018120a2d9ab8212b4e801561c4",
"score": "0.63881123",
"text": "def search_params\n params[:search_bar]\n end",
"title": ""
},
{
"docid": "7a503f6a2934fd86e8edf61ee0801e3b",
"score": "0.63844657",
"text": "def optionally_search(query = nil)\n query.present? ? search(query) : all\n end",
"title": ""
},
{
"docid": "751da205aa20f9dd37857f5089725e14",
"score": "0.6365776",
"text": "def search_params\n @search_params = whitelisted_params. \n to_h.\n except(:format, :action, :controller, :page, :per_page)\n end",
"title": ""
},
{
"docid": "f7514f902f1d005ef88aeb693a894273",
"score": "0.63645476",
"text": "def initialize(params = {})\n return if params.nil?\n @search_by = params[:search_by] if params[:search_by]\n @search_value = params[:search_value] if params[:search_value]\n end",
"title": ""
},
{
"docid": "b6b891b742602d7371acbcfa0b9cc178",
"score": "0.6358446",
"text": "def assign_variables\n @search = helpers.payment_query_data[:search]\n @search ? validate_search_params : assign_pagination\n end",
"title": ""
},
{
"docid": "9ab7a3e64540ec0b3305bc8a91cd055d",
"score": "0.6354356",
"text": "def default_search\n search_for( @primary_entity, @primary_search_condition )\n # Nothing found? Do a secondary search:\n search_for( secondary_entity, @secondary_search_condition ) if ( @secondary_search_condition && result_not_found? )\n end",
"title": ""
},
{
"docid": "9a00cd292a7f8d65aa1ccb6e27ee6429",
"score": "0.6352047",
"text": "def search lookup_string\n search_by_lookup_string lookup_string if lookup_string.present?\n find_blank_translations if params[:only_blank] == 'true'\n end",
"title": ""
},
{
"docid": "959faa4a22ae0bf97ea8ce3f68ef2274",
"score": "0.6351107",
"text": "def searchable?\n @paginable_params[:search].present?\n end",
"title": ""
},
{
"docid": "33ef7d38728be970f9cfcc6423b37fef",
"score": "0.6348903",
"text": "def search_params\n params.require(:search_string)\n end",
"title": ""
},
{
"docid": "79d409f718702d20696e98be0158e73b",
"score": "0.63450515",
"text": "def search_params\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "46d1517774232bf005d370567beea46d",
"score": "0.63428015",
"text": "def search\n if params[:q]\n @q = params[:q]\n do_search\n elsif params[:gma_search]\n @q = params[:gma_search][:q]\n s= GmaSearch.new params[:gma_search]\n s.ip= request.env[\"REMOTE_ADDR\"]\n s.save\n do_search\n else\n redirect_to \"/\"\n end\n end",
"title": ""
},
{
"docid": "8e778c0f46b1940ff57daaac043edef0",
"score": "0.63367856",
"text": "def search\n query = params[:urls_search].presence && params[:urls_search][:query]\n if query\n @urls = Url.custom_search(params[:urls_search][:query],params[:urls_search][:field])\n end\n end",
"title": ""
},
{
"docid": "1b2e9b3756333b4751d31f1b4b832ce0",
"score": "0.6332673",
"text": "def set_search_params\n\n\t\t\t# Initialise an empty hash\n\t\t\t@search_parameters = Hash.new\n\n\t\t\t# Set the Query Value\n\t\t\t# TODO: Remove duplicate queries because the system isn't smart enough yet\n\t\t\t# \t\tuse the 'uniq' function\n\t\t\t@search_parameters['query'] = params[:q].split unless params[:q].blank?\n\n\t\t\t# Set the First SDG Filter Value\n\t\t\t@search_parameters['primary_sdg'] = params[:a].split unless params[:a].blank?\n\n\t\t\t# Set the Sector IDs\n\t\t\t@search_parameters['sector_ids'] = params[:b] unless params[:b].blank?\n\n\t\t\t# Set the Demographic IDs\n\t\t\t@search_parameters['demographic_ids'] = params[:c] unless params[:c].blank?\n\n\t\t\t# Set the Development Actors IDs\n\t\t\t@search_parameters['development_actor_ids'] = params[:d] unless params[:d].blank?\n\n\t\t\t# Set the Country IDs\n\t\t\t@search_parameters['country_ids'] = params[:e] unless params[:e].blank?\n\n\t\t\t# Set the Region IDs\n\t\t\t@search_parameters['region_ids'] = params[:f] unless params[:f].blank?\n\n\t\t\t# Set the Subregion IDs\n\t\t\t@search_parameters['subregion_ids'] = params[:g] unless params[:g].blank?\n\n\t\t\t# Set the Research Method IDs\n\t\t\t@search_parameters['research_method_ids'] = params[:h] unless params[:h].blank?\n\n\t\t\t# Set the Organisations\n\t\t\t@search_parameters['organisation_ids'] = params[:i] unless params[:i].blank?\n\n\t\t\t# Set the Organisation TYpes\n\t\t\t@search_parameters['organisation_type_ids'] = params[:j] unless params[:j].blank?\n\n\t\t\t# Set the Province\n\t\t\t@search_parameters['province_ids'] = params[:k] unless params[:k].blank?\n\n\t\t\t# Set the Advanced Search Flag\n\t\t\t@search_parameters['advanced_search_flag'] = params[:z] unless params[:z].blank?\n\n\t\tend",
"title": ""
},
{
"docid": "c01f272dba744a2c5eecf7117fe64537",
"score": "0.6330312",
"text": "def search_options(search_name,field_map,order_map,default_fields,default_order,joins=nil,associations=nil)\n if !params[:search]\n # if the search params aren't in the actual params from the requst\n # then look for them in the session first, and if not there use the defaults\n if session[search_name]\n \t @search_params = session[search_name]\n\t elsif default_fields\n\t @search_params = default_fields\n end\n params[:search] = @search_params if @search_params\n else\n # otherwise use the search parameters and store them in the session for later\n @search_params = params[:search]\n session[search_name] = @search_params\n end\n if @search_params\n options = {}\n \tif @search_params[:order]\n \t o = order_map[@search_params[:order]]\n \t options[:order] = o ? o : order_map[default_order] \t\t\n end\n conditions = add_conditions(conditions,field_map,@search_params[:on],@search_params[:for])\n @search_params.keys.each{|k| \n conditions = add_conditions(conditions,field_map,$1,@search_params[k]) if k =~ /^on_(.*)/\n }\n options[:conditions] = conditions if conditions\n options[:joins] = joins if joins\n options[:include] = associations if associations\n options\n else\n nil\n end\n\tend",
"title": ""
},
{
"docid": "add9c0c755942117686ff9565cb018f5",
"score": "0.63293856",
"text": "def set_search_value\n if params[:search]\n if params[:search][:gene]\n @gene\n elsif !params[:search][:genes].nil?\n @genes.map{|gene| gene['name']}.join(' ')\n end\n elsif params[:gene]\n params[:gene]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "bb08281cd31521d75815d9e47ec0b05c",
"score": "0.63283354",
"text": "def perform_search\n if @preview_mode && params[:query].blank?\n params[:query] = 'lorem'\n end\n return if params[:query].blank?\n @search_results = get_search_results\n end",
"title": ""
},
{
"docid": "735b314e76d3f73ae9377de293ad79a7",
"score": "0.6325459",
"text": "def set_search_params\n #logger.fatal \"#{params[]}\"\n #debugger\n if(params[:room] != nil)\n room_id = params[:room]\n @bookings = Booking.where(room_id: room_id)\n else if(params[:member] != nil)\n member_id = params[:member]\n @bookings = Booking.where(member_id: member_id)\n else\n @bookings = Booking.all\n end\n end\n end",
"title": ""
},
{
"docid": "57ff9cc00e32bf348398eecb62e47f8a",
"score": "0.6324211",
"text": "def search\n Log.add_info(request, params.inspect)\n\n unless params[:select_sorting].blank?\n sort_a = params[:select_sorting].split(' ')\n params[:sort_col] = sort_a.first\n params[:sort_type] = sort_a.last\n end\n\n list\n\n if params[:keyword].blank?\n if params[:from_action].nil? or params[:from_action] == 'bbs'\n render(:action => 'bbs')\n else\n render(:action => 'list')\n end\n end\n end",
"title": ""
},
{
"docid": "45e9e55a4ad3bacfc2973631c1db9642",
"score": "0.63214487",
"text": "def params_search(query: [], artist: nil, genres: [],\n excluded_artists: [], excluded_genres: [])\n { action: 'exploreLoad',\n artist: artist.to_s,\n style: genres,\n exartist: excluded_artists,\n exstyle: excluded_genres,\n searchQuery: query,\n orderType: 'downloads',\n orderDate: 'all',\n orderDateMagnitude: '', # wut\n onlyShowBroken: false\n }\n end",
"title": ""
},
{
"docid": "226a50f4d7f7e5ae2b3a4f4b82161bfe",
"score": "0.6306974",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "226a50f4d7f7e5ae2b3a4f4b82161bfe",
"score": "0.6306974",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "226a50f4d7f7e5ae2b3a4f4b82161bfe",
"score": "0.6306974",
"text": "def search_params\n params[:search]\n end",
"title": ""
},
{
"docid": "99bb89c22599ae3e313f7c6d7ec96f0d",
"score": "0.6298724",
"text": "def default_query_params\n true\n end",
"title": ""
},
{
"docid": "99bb89c22599ae3e313f7c6d7ec96f0d",
"score": "0.6298724",
"text": "def default_query_params\n true\n end",
"title": ""
},
{
"docid": "534eb9fb294089db80e828e0ec074d60",
"score": "0.6286706",
"text": "def search_interviews search_from\n \n if search_from == \"refine_search\"\n query = session[:query]\n company = params[:company]\n session[:company] = company\n compaines = Company.all\n \n if company == \"\" and query == \"\"\n @interviews = InterviewReview.all\n elsif company == \"\" and query != \"\"\n @interviews = search_with_query query.downcase, :interview\n elsif company != \"\" and query == \"\"\n @interviews = find_interview_or_review_for_companies company.downcase, :interview_review\n\n else\n @interviews = refine_inter_review_with_companies company.downcase, query.downcase, :interview_review\n end\n elsif search_from == \"navbar\" || search_from == \"welcome_page_search\"\n query = params[:query]\n if query == \"\" || query == nil\n @interviews = InterviewReview.all\n else\n @interviews = search_with_query query.downcase, :interview\n \n end\n session[:query] = params[:query]\n end\n \n end",
"title": ""
},
{
"docid": "92ae3bd9017cda804f984bdb0c9ff75d",
"score": "0.62776774",
"text": "def fallback_query_params\n params = {}\n fallback_keys.each do |key, value|\n params[value] = doc[key].first unless doc[key].nil?\n end\n params[:max_title_words] = 10\n params\n end",
"title": ""
},
{
"docid": "48ebf9ea191901236a9edc94f0fc3f45",
"score": "0.6273455",
"text": "def search_parameters?\n !blacklight_params[:q].nil? || blacklight_params[:f].present? ||\n blacklight_params[:search_field] == 'advanced'\n end",
"title": ""
},
{
"docid": "48ebf9ea191901236a9edc94f0fc3f45",
"score": "0.6273455",
"text": "def search_parameters?\n !blacklight_params[:q].nil? || blacklight_params[:f].present? ||\n blacklight_params[:search_field] == 'advanced'\n end",
"title": ""
},
{
"docid": "01c5de3039d6d0a1c7954b308c2b474d",
"score": "0.62677586",
"text": "def setup_search(params)\n @search_term = params[:term]\n\n if !@search_term then\n @search_term = session[:last_search_term]\n end\n # Save this for after editing\n session[:last_view] = 'search'\n session[:last_search_term] = @search_term\n \n # Need this so that links show up\n @list_options = @@list_options\n @title = \"Search Results\"\n @search_title = \"You Searched For '#{@search_term}'\"\n end",
"title": ""
},
{
"docid": "22c082ef79c08e78bf555dc76c1ad619",
"score": "0.62655264",
"text": "def search_query\n @search_query ||= params[:query].present? ? JSON.parse(params[:query].gsub('=>', ':')) : false\n end",
"title": ""
},
{
"docid": "260f7e5603ba3b3c1c44b50e240ccfa5",
"score": "0.626222",
"text": "def search\n @search_results = Product.search_it(params[:search_it]) if params[:search_it].present?\n end",
"title": ""
},
{
"docid": "23724a2349d14eaa17322d7f9c9a2017",
"score": "0.6252724",
"text": "def search_context_params\n search_state.params_for_search.except(:q, :qt, :page, :utf8)\n end",
"title": ""
},
{
"docid": "e8d78ad6743218ce87bda721222b754f",
"score": "0.62465465",
"text": "def index\n params[:sort_by] ||= 'score'\n params[:type] ||= ['all']\n params[:type] = ['taxon_concept'] if params[:mobile_search] # Mobile search is limited to taxa for now\n @all_params = []\n [:taxon_concept, :image, :video, :sound, :text, :data, :link, :user, :community ,:collection].each do |keyword|\n @all_params << [I18n.t(\"#{keyword}_search_keyword\", count: 1),I18n.t(\"#{keyword}_search_keyword\", count: 123),keyword]\n end\n @sort_by = params[:sort_by]\n @params_type = params[:type]\n @params_type = ['all'] if @params_type.map(&:downcase).include?('all')\n @params_type.map!{ |t| t.camelize }\n @querystring = params[:q] || params[:id] || params[:mobile_search]\n params[:id] = nil\n params[:q] = @querystring\n\n @attributes = []\n @attributes = KnownUri.by_name(@querystring) if search_data?\n\n if request.format == Mime::XML\n return redirect_to controller: \"api\", action: \"search\", id: @querystring\n end\n\n if @querystring == I18n.t(:search_placeholder) || @querystring == I18n.t(:must_provide_search_term_error) || @querystring.blank?\n flash[:error] = I18n.t(:must_provide_search_term_error)\n redirect_to root_path\n end\n\n if @querystring == '*' || @querystring == '%'\n @wildcard_search = true\n if params[:type].size != 1 || !EOL::Solr::SiteSearch.types_to_show_all.include?(params[:type].first)\n bad_query = true\n end\n end\n\n params[:exact] = false\n # if the querystring is a double-quoted string, then interpret this as an exact search\n if @querystring =~ /^\".*\"$/\n @querystring = @querystring[1...-1]\n params[:exact] = true\n end\n\n @page_title = I18n.t(:search_by_term_page_title, term: @querystring)\n if @querystring.blank? || bad_query\n @all_results = empty_paginated_set\n @facets = {}\n else\n query_array = (@querystring.downcase.gsub(/\\s+/m, ' ').strip.split(\" \"))\n query_reserved_words = (query_array & @all_params.map{|key| key[0]}) + (query_array & @all_params.map{|key| key[1]})\n if query_reserved_words.any?\n @params_type += query_reserved_words.map{|word| @all_params.select{|param| param[0] == word || param[1] == word}.first[2].to_s.camelize}\n @params_type -= ['All']\n query_array.reject! {|t| (@all_params.map{|key| key[0]}).include?(t) || (@all_params.map{|key| key[1]}).include?(t)}\n @querystring = query_array.join(\" \")\n params[:type] = @params_type\n end\n search_response = EOL::Solr::SiteSearch.search_with_pagination(@querystring, params.merge({ per_page: @@results_per_page, language_id: current_language.id }))\n @all_results = search_response[:results]\n @facets = (@wildcard_search) ? {} : EOL::Solr::SiteSearch.get_facet_counts(@querystring)\n @suggestions = search_response[:suggestions]\n # TODO - there is a weird, rare border case where total_entries == 1 and #length == 0. Not sure what causes it, but we should handle that\n # case here, probably by re-submitting the search (because, at least in the case I saw, the next load of the page was fine).\n if params[:show_all].blank? && @all_results.length == 1 && @all_results.total_entries == 1\n redirect_to_page(@all_results.first, total_results: 1, params: params)\n elsif params[:show_all].blank? && @params_type[0] == 'All' && @all_results.total_entries > 1 && @all_results.length > 1 &&\n superior_result = pick_superior_result(@all_results)\n redirect_to_page(superior_result, total_results: @all_results.total_entries, params: params)\n end\n end\n params.delete(:type) if params[:type] == ['all']\n params.delete(:sort_by) if params[:sort_by] == 'score'\n\n set_canonical_urls(for: {q: @querystring, show_all: true}, paginated: @all_results,\n url_method: :search_url)\n @combined_results_count = @all_results.total_entries + @attributes.count\n end",
"title": ""
},
{
"docid": "4ef220749eae401cc8c21c884077c2c9",
"score": "0.62260956",
"text": "def list(params={})\n if params.has_key? :search\n params.delete(:search) unless params[:search]\n end\n super params\n end",
"title": ""
},
{
"docid": "0f29aa2ba2fde52335153b68b565b61c",
"score": "0.62193507",
"text": "def search\n\n if params[:user][:search].blank?\n @users = User.all\n else\n @users = User.search(params[:user][:search])\n end\n end",
"title": ""
},
{
"docid": "59a0ea5c92ff24944ac7de82ae51462b",
"score": "0.62153393",
"text": "def search\n case request.method_symbol\n when :get\n search_get\n when :post\n search_post\n end\n end",
"title": ""
},
{
"docid": "8274cbab80a5efcf8aaabf20d3be6354",
"score": "0.62019557",
"text": "def search_params\n params[:name]\n end",
"title": ""
},
{
"docid": "0ea069c3be2d3fcf84d0672b088c2067",
"score": "0.620119",
"text": "def search_term\n if params[:props]\n params[:props][:search_term]\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "0ea069c3be2d3fcf84d0672b088c2067",
"score": "0.620119",
"text": "def search_term\n if params[:props]\n params[:props][:search_term]\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "aa18e0be31d15232fce445744f62690c",
"score": "0.61988395",
"text": "def advanced_search_result\n @students ||= params[:students]\n @search ||= params[:search]\n @general_setting = GeneralSetting.first\n render 'advanced_search_result', layout: false\n end",
"title": ""
},
{
"docid": "cada1a477f8289c7eb881fb91ffd6613",
"score": "0.6195915",
"text": "def search\n if !params[:vimeoquery].nil?\n # complete vimeo search\n @creators = vimeo_search(params[:vimeoquery])\n elsif !params[:twitterquery].nil?\n @creators = twitter_search(params[:twitterquery])\n else\n # nothing in either search field\n end\n\n end",
"title": ""
},
{
"docid": "77b5db2ac65035e914017a7a034444f6",
"score": "0.61945266",
"text": "def reset_search_params\n Parameters.sanitize(params).except(:page, :counter)\n end",
"title": ""
},
{
"docid": "c0a21e086e9a5211ddab07eeeb5b0146",
"score": "0.61941385",
"text": "def has_search_parameters?\n params[:featured].present? || super\n end",
"title": ""
},
{
"docid": "61c1704905baaa20a1f6bb0954b02761",
"score": "0.61921173",
"text": "def setting_searching_params(*args)\n\t\toptions = args.extract_options!\n\t\tif options[:from_params]\n\t\t\toptions = options[:from_params]#.merge({ :cat => nil, :models => nil })\n\t\tend\n\t\tmodels =\n\t\t\tif options[:cat]\n\t\t\t\tif options[:cat] == 'item'\n\t\t\t\t\tavailable_items_list\n\t\t\t\telsif options[:cat] == 'container'\n\t\t\t\t\tavailable_containers\n\t#\t\t\telsif options[:cat] == 'profile'\n\t#\t\t\t\tavailable_profile\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t(available_items_list+available_containers)\n\t\t\tend\n\t\t#raise models.inspect\n\t\treturn {\n\t\t\t:user => @current_user,\n\t\t\t:permission => 'show',\n\t\t\t:category => options[:cat],\n\t\t\t:models => options[:m] || models || [],\n :containers => options[:containers] || current_container ? [current_container.class.to_s.underscore+'-'+current_container.id.to_s] : nil,\n\t\t\t:full_text => (options[:q] && !options[:q].blank? && options[:q] != I18n.t('layout.search.search_label')) ? options[:q] : nil,\n\t\t\t:conditions => options[:cond],\n\t\t\t:filter => { :field => options[:by] ? options[:by].split('-').first : 'created_at', :way => options[:by] ? options[:by].split('-').last : 'desc' },\n\t\t\t:pagination => { :page => options[:page] || 1, :per_page => options[:per_page] || get_per_page_value },\n\t\t\t:opti => options[:opti] ? options[:opti] : 'skip_pag_but_filter'\n\t\t\t}\n\tend",
"title": ""
},
{
"docid": "0547ca2f76edad561cc0b351e4a66a19",
"score": "0.61920035",
"text": "def search\n @search_config = YAML.load(File.open(File.join(RAILS_ROOT,\"config\",\"search.yml\")))\n\n if @params['search_terms'].nil? then\n @search_terms = @search_config['default_search_terms']\n else \n @search_terms = @params['search_terms'].split\n end\n\n @count = @params['count'].to_i || -1\n \n self.send(\"#{@search_config['search_backend']}_search\")\n end",
"title": ""
},
{
"docid": "2e692cb6a64b8bb96874e767d8c93575",
"score": "0.61906904",
"text": "def parse_search_params(params, genre)\n # Map brands, genres and order methods into available URL-parameter values\n brands = $brands.map(&:slug)\n genres = $genres.sort.map { |key, _value| key }\n genre = genre.nil? ? 'any' : genre\n order = $default_locals[:search][:fields][:order][:options].map { |_key, value| value }\n\n # Set URL-parameter values for search or use defaults\n {\n brand: brands.include?(params['brand']) ? params['brand'] : 'any',\n genre: genres.include?(params['genre']) ? params['genre'] : genre,\n limit: $search_items.include?(params['limit'].to_i) ? params['limit'] : '12',\n order: order.include?(params['order']) ? params['order'] : 'date-desc',\n id: 'none',\n page: !params['page'].to_i.zero? ? parse_slug(params['page']) : '1'\n }\n end",
"title": ""
},
{
"docid": "9b873a827758765447b26e4821fe5919",
"score": "0.6190231",
"text": "def process_params\n return unless params[:search].present?\n\n params[:search] = params[:search].reduce(Hash.new) do |processed_params, (filter, value)|\n if %w(city_id county_id).include? filter\n processed_params.merge(\"#{filter}_eq\" => value)\n elsif value.is_a? Array\n processed_params.merge(filter => value.map { |v| v.empty? ? nil : v }.compact)\n else\n processed_params.merge(filter => value)\n end.with_indifferent_access\n end\n end",
"title": ""
},
{
"docid": "c957a83412a0cb8b40e74e5e9e0901df",
"score": "0.6187155",
"text": "def has_search_parameters?\n !params[:q].blank? || !params[:f].blank? || !params[:search_field].blank?\n end",
"title": ""
},
{
"docid": "1489a4f6f6a0d89faaba0a54d0aa0875",
"score": "0.618639",
"text": "def site_search_params(args = {})\n result = load_subsite.blacklight_config.default_solr_params.merge(sort: \"random_#{Random.new_seed} DESC\")\n result.merge(args)\n end",
"title": ""
}
] |
aa63b080668366e4839a60e1ff8b8ad0
|
GET /diarios/1 GET /diarios/1.json
|
[
{
"docid": "1396639d397ba1bb5634d5f0a96fecfc",
"score": "0.0",
"text": "def show\n respond_to do |format|\n format.html\n format.pdf do\n pdf = DiarioPdf.new(@diario, view_context)\n send_data pdf.render, filename: \"mypdf.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "0d1f8e9052d692d06c13f94915a9619f",
"score": "0.7645194",
"text": "def index\n @diretorios = Diretorio.where(pessoa_id: params[:usuario]).first\n render json: @diretorios\n end",
"title": ""
},
{
"docid": "39400dc029c1a6dbd878f065d90b9dbe",
"score": "0.7243036",
"text": "def index\n @doctores = Doctores.all\n\n render json: @doctores\n end",
"title": ""
},
{
"docid": "d126937218b15d84420d28b93838d796",
"score": "0.70368195",
"text": "def index\n @datos = Dato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @datos }\n end\n end",
"title": ""
},
{
"docid": "1b8f48b9e439803a707e64278378d75a",
"score": "0.69907796",
"text": "def show\n @doacao = Doacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doacao }\n end\n end",
"title": ""
},
{
"docid": "f23ca27eb69f43814ac7b8b921c72d70",
"score": "0.69824624",
"text": "def index\n @dioceses = Diocese.all\n\n render json: @dioceses\n end",
"title": ""
},
{
"docid": "e8c19a02c77d7499702c9ea1b974469c",
"score": "0.69569176",
"text": "def index\n @distritos = Distrito.all\n\n render json: @distritos\n end",
"title": ""
},
{
"docid": "7033dafcb878866f9c3110c0ad8266d7",
"score": "0.6953539",
"text": "def show\n @dato = Dato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dato }\n end\n end",
"title": ""
},
{
"docid": "316a5a2e07d32033a0a2fd2092597649",
"score": "0.68568134",
"text": "def show\n @idioma = Idioma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idioma }\n end\n end",
"title": ""
},
{
"docid": "f34f5ac022ee555807032455cc638a38",
"score": "0.685454",
"text": "def show\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oficio }\n end\n end",
"title": ""
},
{
"docid": "4d76422e2466ab19564e24d8d9e0ec6a",
"score": "0.68108326",
"text": "def show\n render json: @distrito\n end",
"title": ""
},
{
"docid": "5597f28c30bc5101e254f7df219c1ee1",
"score": "0.6806257",
"text": "def show\n @direccion = Direccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @direccion }\n end\n end",
"title": ""
},
{
"docid": "a1750f89b86357eee41c261961ffb42a",
"score": "0.6798539",
"text": "def show\n @diario = Diario.find(params[:id])\n #@tareas = Tarea.where(\"zona_id = ?\", @diario.zona_id)\n @tareas = Tarea.find(:all, :conditions => [\"zona_id = ? AND fecha = ?\", @diario.zona_id, @diario.fecha])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diario }\n end\n end",
"title": ""
},
{
"docid": "435bd271524ccc9056f2cb551cacf5d1",
"score": "0.6775021",
"text": "def show\n @douro = Douro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @douro }\n end\n end",
"title": ""
},
{
"docid": "cf08668106e45e07bdcbc146659b7f2d",
"score": "0.676587",
"text": "def show\n #@donacion = Donacion.find(params[:id])\n\t@donacion = Donacion.find(4)\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @donacion }\n end\n end",
"title": ""
},
{
"docid": "2974d8430e6098235a7a5ec602edf107",
"score": "0.67509186",
"text": "def show\n @direccionusuario = Direccionusuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @direccionusuario }\n end\n end",
"title": ""
},
{
"docid": "fb9f2b270e01cfcd44139cb21549c7ee",
"score": "0.67495257",
"text": "def show\n @adjunto = Adjunto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adjunto }\n end\n end",
"title": ""
},
{
"docid": "cd557ef16f6d820f35a33c42ac1d254f",
"score": "0.67454046",
"text": "def show\n @dia_semana = DiaSemana.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dia_semana }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.6729741",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.6729741",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.6729741",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "3a98fdb2e5775b24abd9b76b8f1e6eef",
"score": "0.6717276",
"text": "def show\n @estudiante = Estudiante.find(params[:id])\n\n render json: @estudiante\n end",
"title": ""
},
{
"docid": "47aeb2c71e55446d0a3b75ac09831054",
"score": "0.6689561",
"text": "def index\n @denuncias = Denuncia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @denuncias }\n end\n end",
"title": ""
},
{
"docid": "b01815ebdce091dd8d992dae5e7785c1",
"score": "0.668067",
"text": "def index\n Deputado.all\n respond_to do |format|\n format.json {}\n end\n end",
"title": ""
},
{
"docid": "8834d8efeb766be337366e5b97600a76",
"score": "0.66696686",
"text": "def show\n @receipe = Receipe.find(params[:id])\n\n render json: @receipe\n end",
"title": ""
},
{
"docid": "690d1c5f034afb79b6b4d6fa85bfea4f",
"score": "0.666902",
"text": "def index\n @dinamicas = Dinamica.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dinamicas }\n end\n end",
"title": ""
},
{
"docid": "3bb1569789db02d8171db0d297e4bd64",
"score": "0.6664377",
"text": "def show\n render json: @diretorio\n end",
"title": ""
},
{
"docid": "2b8d5380c1d2879ed722c8253f5fc08a",
"score": "0.6641844",
"text": "def show\n @direccion_negocio = DireccionNegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @direccion_negocio }\n end\n end",
"title": ""
},
{
"docid": "2e2aa4e74166cee982eb428384f072e6",
"score": "0.66339403",
"text": "def index\n @days = DiasSemanasEmpresaPerfil.select('dias_semanas_empresa_perfils.dias_semana_id').joins(:empresa_perfil).where(empresa_perfils: {empresa_id: params[:q]})\n list = @days.map {|u| Hash[ id: u.dias_semana_id]}\n render json: list\n end",
"title": ""
},
{
"docid": "593122710fb9dd291b90d90b620dce75",
"score": "0.6630407",
"text": "def index\n @donaciones = Donacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @donaciones }\n end\n end",
"title": ""
},
{
"docid": "e93e8a74b447adc5748c25dbf0949faf",
"score": "0.66303885",
"text": "def show\n render json:@respuesta, :only =>[:id, :descripcion, :imagen],status: :ok\n end",
"title": ""
},
{
"docid": "98ffbf7f3194b7a17a8a6f2f4bdd6925",
"score": "0.66249263",
"text": "def show\n @datos_significativo = DatosSignificativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @datos_significativo }\n end\n end",
"title": ""
},
{
"docid": "ab89d159ef23bf64f5662acd8b8ef5b3",
"score": "0.6623586",
"text": "def show\n @denuncia = Denuncia.find(params[:id])\n @archivo = Archivo.new\n @nota = Nota.new\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncia }\n end\n end",
"title": ""
},
{
"docid": "b210687e6d7559ff07c2bc429f7374ed",
"score": "0.6623426",
"text": "def show\n seleccionarMenu(:rondas)\n @ronda = Ronda.find(params[:ronda_id])\n @visita_diaria = VisitaDiaria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @visita_diaria }\n end\n end",
"title": ""
},
{
"docid": "0a8430d446c08f09a518d4961df6a61b",
"score": "0.66232085",
"text": "def show\n @dinamica = Dinamica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dinamica }\n end\n end",
"title": ""
},
{
"docid": "f7cba2a03dc4c06ac37fb8c1e77dd2d6",
"score": "0.6620115",
"text": "def show\n @gerente_comercial = GerenteComercial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gerente_comercial }\n end\n end",
"title": ""
},
{
"docid": "117894f08b56733fece823a7803ce850",
"score": "0.6607527",
"text": "def show\n @indicador = Indicador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicador }\n end\n end",
"title": ""
},
{
"docid": "dbfe2efe932aa7784db2b0ac38a311c5",
"score": "0.660591",
"text": "def index\n find_cargos\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @cargos.to_json(:only => [:id, :nombre])}\n end\n\n end",
"title": ""
},
{
"docid": "d47d2a653083ce27d487f4fafedc2044",
"score": "0.66046613",
"text": "def show\n @ejercicio1 = Ejercicio1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio1 }\n end\n end",
"title": ""
},
{
"docid": "9b1b2ad002930148ad94ed6efc3346a6",
"score": "0.66019106",
"text": "def index\n seleccionarMenu(:rondas)\n @ronda = Ronda.find(params[:ronda_id])\n @visita_diarias = @ronda.visita_diarias.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @visita_diarias }\n end\n end",
"title": ""
},
{
"docid": "1b86caab697b8b0f552d3a1ad0dabe29",
"score": "0.6601696",
"text": "def index\n @codigos = Codigo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @codigos }\n end\n end",
"title": ""
},
{
"docid": "84b9c670445fa61d99bd892b674959b5",
"score": "0.65915763",
"text": "def get\n response = ApiPago.get_factura(params[:id_factura])\n render json: response\n end",
"title": ""
},
{
"docid": "8616d49483e42c4e6d44efe347de6bab",
"score": "0.65893114",
"text": "def show\n @tipo_de_admision = TipoDeAdmision.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_de_admision }\n end\n end",
"title": ""
},
{
"docid": "711604a466e95f32ec5f53a6e10b5384",
"score": "0.6585206",
"text": "def show\n @comida = Comida.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comida }\n end\n end",
"title": ""
},
{
"docid": "645da3e9c82b274ba57e6b1e5683bf20",
"score": "0.6579042",
"text": "def show\n @gerencia = Gerencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gerencia }\n end\n end",
"title": ""
},
{
"docid": "15eee0f5215093ce91541572166aad0d",
"score": "0.6576346",
"text": "def show\n @dudad = Dudad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dudad }\n end\n end",
"title": ""
},
{
"docid": "df1aad75198571c94d021ccb399d4d9d",
"score": "0.6571871",
"text": "def show\n @pais_dominio = PaisDominio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pais_dominio }\n end\n end",
"title": ""
},
{
"docid": "11bcd3132a987e7e74e3baae868a639a",
"score": "0.6567667",
"text": "def show\n @tipologium = Tipologium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipologium }\n end\n end",
"title": ""
},
{
"docid": "1c63714838e8d52479306a25d704f2e4",
"score": "0.6563447",
"text": "def show\n @delegato = Delegato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @delegato }\n end\n end",
"title": ""
},
{
"docid": "5ed467ce5fbc89d66fdaebc79f39839f",
"score": "0.65632963",
"text": "def show\n @docente = Docente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @docente }\n end\n end",
"title": ""
},
{
"docid": "5ed467ce5fbc89d66fdaebc79f39839f",
"score": "0.65632963",
"text": "def show\n @docente = Docente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @docente }\n end\n end",
"title": ""
},
{
"docid": "6f51683e3e03789d806dd8114a5f78aa",
"score": "0.656184",
"text": "def show\n @diemtrentuyen = Diemtrentuyen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diemtrentuyen }\n end\n end",
"title": ""
},
{
"docid": "55c10ae77a36f63c05f647d17e7d250e",
"score": "0.6556789",
"text": "def show\n @consultorio = Consultorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultorio }\n end\n end",
"title": ""
},
{
"docid": "c019514688050937d9bd66c9eae292a7",
"score": "0.65533847",
"text": "def index\n @clientes = Cliente.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clientes }\n end\n end",
"title": ""
},
{
"docid": "a5d4128f9a065abbe74de73e8253f1aa",
"score": "0.6549106",
"text": "def show\n @tipo_seguro = TipoSeguro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_seguro }\n end\n end",
"title": ""
},
{
"docid": "24a536fb0104c2cc38a74df47ad8c0b8",
"score": "0.6547867",
"text": "def show\n @opcion = Opcion.find(params[:id])\n\n render json: @opcion\n end",
"title": ""
},
{
"docid": "733f665d7cdddb335329100f37d74e1f",
"score": "0.65449643",
"text": "def index\n @fornecedores = Fornecedor.page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fornecedores }\n end\n end",
"title": ""
},
{
"docid": "1b9a4107c327869881e7c8a52779e892",
"score": "0.6539735",
"text": "def show\n render json: @diocese\n end",
"title": ""
},
{
"docid": "326d8709dfce99a8639d07320bbd147a",
"score": "0.65386987",
"text": "def show\n @exercice_dynamique = ExerciceDynamique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercice_dynamique }\n end\n end",
"title": ""
},
{
"docid": "a7f0bb7956b509638f174c5ca2594f9e",
"score": "0.6530779",
"text": "def show\n @punto_servicio = PuntoServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @punto_servicio }\n end\n end",
"title": ""
},
{
"docid": "8af2f9673dca5c23eeff38164fa7e659",
"score": "0.65300995",
"text": "def show\n @ciudadano = Ciudadano.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ciudadano }\n end\n end",
"title": ""
},
{
"docid": "0c33947f5c45b6b94cbde2e0a7f4d623",
"score": "0.6529436",
"text": "def show\n render json:@pregunta, :only =>[:id, :descripcion, :obligatoria], status: :ok\n end",
"title": ""
},
{
"docid": "6e3654e06e02e365524391e29ed99f27",
"score": "0.652892",
"text": "def show\n @resposta = Resposta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resposta }\n end\n end",
"title": ""
},
{
"docid": "0b0521740fcd9577703015043f1b09c8",
"score": "0.652479",
"text": "def show\n @cliente_juridico = ClienteJuridico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente_juridico }\n end\n end",
"title": ""
},
{
"docid": "0b0521740fcd9577703015043f1b09c8",
"score": "0.652479",
"text": "def show\n @cliente_juridico = ClienteJuridico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente_juridico }\n end\n end",
"title": ""
},
{
"docid": "9bb50f8954f2da8e22c767c4fc7c78ae",
"score": "0.6520216",
"text": "def show\n @reconocimiento = Reconocimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reconocimiento }\n end\n end",
"title": ""
},
{
"docid": "df84d202147b1341b4ddf64b593cc62f",
"score": "0.65097505",
"text": "def show\n @consultado = Consultado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @consultado }\n end\n end",
"title": ""
},
{
"docid": "f4009a4851983c625c1323c63e31a183",
"score": "0.6507014",
"text": "def show\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicacao }\n end\n end",
"title": ""
},
{
"docid": "3b250cc49b9b48532e5c11e19cc9efa4",
"score": "0.650645",
"text": "def show\n @condo = Condo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condo }\n end\n end",
"title": ""
},
{
"docid": "46bff93754089fa1f0f0985a3905c8fb",
"score": "0.650258",
"text": "def show\n @idddnteger = Idddnteger.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idddnteger }\n end\n end",
"title": ""
},
{
"docid": "59b2666c346208d77b451fb010539d71",
"score": "0.649692",
"text": "def show\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientetipo }\n end\n end",
"title": ""
},
{
"docid": "e9470dea650ae44f64be99b795632b46",
"score": "0.6495237",
"text": "def show\n @denuncia = Denuncia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncia }\n end\n end",
"title": ""
},
{
"docid": "b54880a66909e09f06a6679f92359c12",
"score": "0.6493432",
"text": "def show\n @diet = Diet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diet }\n end\n end",
"title": ""
},
{
"docid": "cecb2dbae436fc62d304c9b3a39ec246",
"score": "0.649124",
"text": "def show\n @itinerario = Itinerario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itinerario }\n end\n end",
"title": ""
},
{
"docid": "76d8d2580f27eb9840da039fa9c497f9",
"score": "0.6485944",
"text": "def show\n @departamento = Departamento.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @departamento }\n end\n end",
"title": ""
},
{
"docid": "8b46243b086330de870b4d2f78ce7e48",
"score": "0.6485319",
"text": "def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asiento }\n end\n end",
"title": ""
},
{
"docid": "78493dd345c3f3f12ccb708ee1aeffaa",
"score": "0.6482441",
"text": "def show_domicilios\n @domicilios = Profesional.find(params[:profesional_id]).domicilios\n\n respond_to do |format|\n format.html # show_domicilios.html.erb\n format.json { render json: @domicilios }\n end\n end",
"title": ""
},
{
"docid": "fbd9d2c4450064184c5c7c979afb6a46",
"score": "0.6481727",
"text": "def show\n @pedido = Pedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pedido }\n end\n end",
"title": ""
},
{
"docid": "fbd9d2c4450064184c5c7c979afb6a46",
"score": "0.6481727",
"text": "def show\n @pedido = Pedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pedido }\n end\n end",
"title": ""
},
{
"docid": "fbd9d2c4450064184c5c7c979afb6a46",
"score": "0.6481727",
"text": "def show\n @pedido = Pedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pedido }\n end\n end",
"title": ""
},
{
"docid": "ed375191250c7ede407cb6056fe0d09f",
"score": "0.64765704",
"text": "def show\n @pelicula = Pelicula.find_by(id: params[:id])\n if @pelicula\n render json: @pelicula, status: :ok\n else\n render json: {error: 'Not Found'}, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "19c753e2ebbcff340f8a632ba2a8fa36",
"score": "0.64753306",
"text": "def show\n @soupdejour = Soupdejour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soupdejour }\n end\n end",
"title": ""
},
{
"docid": "3f38c6d00619b661defcd6b6cea46027",
"score": "0.64742637",
"text": "def buscar_estados\n render json: Estado.by_pais(params[:pais_id])\n end",
"title": ""
},
{
"docid": "e11e7a0a54783f313bb5509a48ef4a35",
"score": "0.64654773",
"text": "def show\n @filiale = Filiale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @filiale }\n end\n end",
"title": ""
},
{
"docid": "db94b92109199dd4f61e96128ef2de21",
"score": "0.64653105",
"text": "def show\n @periferico = Periferico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @periferico }\n end\n end",
"title": ""
},
{
"docid": "d91cb322d6e6aaaacfb1e5d03151be5d",
"score": "0.6464848",
"text": "def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"title": ""
},
{
"docid": "4b9ab501f0c2317bec38cb362856133e",
"score": "0.6463209",
"text": "def show\n @core_fiel_depositario = Core::FielDepositario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_fiel_depositario }\n end\n end",
"title": ""
},
{
"docid": "3656158a031f8dd6db202f37f14297d2",
"score": "0.64629775",
"text": "def show\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inventario }\n end\n end",
"title": ""
},
{
"docid": "4e6cbffd90f5b4aa338fba33c6b530b4",
"score": "0.64619356",
"text": "def show\n @cadena = Cadena.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cadena }\n end\n end",
"title": ""
},
{
"docid": "a95a8fb75b9893b7ba7ce8a294f80c9a",
"score": "0.64608234",
"text": "def show\n @tipo_imovel = TipoImovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_imovel }\n end\n end",
"title": ""
},
{
"docid": "a3d56f445fe754b8a6465220c224ef57",
"score": "0.6454011",
"text": "def dino_show\n cage = Cage.find(params[:id])\n\n if cage\n render json: cage.dinosaurs\n else\n render json: cage.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f48ef8d72edf59e38afc25c9c3354397",
"score": "0.64509606",
"text": "def show\n @tipo_personaje = TipoPersonaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_personaje }\n end\n end",
"title": ""
},
{
"docid": "739be130054f02456a79f58fef1b8e6e",
"score": "0.64509046",
"text": "def show\n @feriado = Feriado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feriado }\n end\n end",
"title": ""
},
{
"docid": "383c34271dd1afbe17d322bebcd45ba6",
"score": "0.64506876",
"text": "def index\n @tipo_de_admisions = TipoDeAdmision.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_de_admisions }\n end\n end",
"title": ""
},
{
"docid": "391510886307915dc23effe324f3b0dd",
"score": "0.6450632",
"text": "def show\n @olimpiada = Olimpiada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @olimpiada }\n end\n end",
"title": ""
},
{
"docid": "f69717ad7fac0613e61b4b3a3c4cd905",
"score": "0.64486325",
"text": "def show\n @dotacion = Dotacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dotacion }\n end\n end",
"title": ""
},
{
"docid": "1795dea83b74c65f27e581c40135e893",
"score": "0.64485556",
"text": "def index\n @destaques = Destaque.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @destaques }\n end\n end",
"title": ""
},
{
"docid": "e00c7e9a1c747c199b92011da2c0c13a",
"score": "0.64480287",
"text": "def index\n @persona = Persona.find(params[:persona_id])\n @domicilios = @persona.domicilioents.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @domicilios }\n end\n end",
"title": ""
},
{
"docid": "16b6bd251a78826e880f2e0eb4cb0cf7",
"score": "0.6446409",
"text": "def show\n @azione = Azione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @azione }\n end\n end",
"title": ""
},
{
"docid": "2e5cd93aa4adf40025e00253bd921125",
"score": "0.64451563",
"text": "def show\n @descuento_cliente = DescuentoCliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @descuento_cliente }\n end\n end",
"title": ""
},
{
"docid": "0152535dfb3dc44fe4a2859ca6e02d73",
"score": "0.64443827",
"text": "def show\n @seminario = Seminario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seminario }\n end\n end",
"title": ""
},
{
"docid": "09ba1df44be32f577f02b73d6c359191",
"score": "0.64435124",
"text": "def show\n @pedido = Pedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pedido }\n end\n end",
"title": ""
}
] |
107e3a2427b3eaa75900e643681e73a9
|
Recommended queue interval for appending node. Can overwrite [queue interval] at setup()/initialize().
|
[
{
"docid": "dc32aee0f0f253c98fd60087fa2aa1be",
"score": "0.64114755",
"text": "def ff_get_query_interval\n QUEUE_DEFAULT_INTERVAL\n end",
"title": ""
}
] |
[
{
"docid": "ea4126bfce5d65c29e1e14d2c98dc7a4",
"score": "0.64935374",
"text": "def enqueue_to_in(queue, interval, klass, *args); end",
"title": ""
},
{
"docid": "515ce5f384bbd4e84e299d51e58b92d4",
"score": "0.646926",
"text": "def interval\n (self['resque.interval'] || 5).to_i\n end",
"title": ""
},
{
"docid": "5701d8d1e5631790a09446e104090ebc",
"score": "0.5997333",
"text": "def queue_time\n NotImplementedError\n end",
"title": ""
},
{
"docid": "ec0360f41faac490cdf7045be8f169f4",
"score": "0.5976535",
"text": "def delayed_queue_schedule_size\n redis.zcard(:delayed_queue)\n end",
"title": ""
},
{
"docid": "8d24e86da7ed974a87d3db3b88b91b9e",
"score": "0.59695435",
"text": "def queues_cmd\n return @unique_queues.dup << TIMEOUT if @strictly_ordered_queues\n queues = @queues.sample(@unique_queues.size).uniq\n queues.concat(@unique_queues - queues)\n queues << TIMEOUT\n end",
"title": ""
},
{
"docid": "4b57c9cca4a893371e85f64a2f15657b",
"score": "0.578973",
"text": "def queue\n\n @queue ||= channel.queue(*(opt('queue') || [ '' ]))\n end",
"title": ""
},
{
"docid": "137877e33942bb50bec63d6747a3a7a8",
"score": "0.5759112",
"text": "def queue\n @queue ||= SizedQueue.new @queue_size\n end",
"title": ""
},
{
"docid": "9066a08bf61880b06ed78c7483979070",
"score": "0.57193416",
"text": "def onTimeout(interval, &block)\n \n raise ArgumentError unless interval.kind_of? Numeric\n \n ref = {:interval => interval.to_i, :block => block}\n \n with_mutex do \n if @queue.empty?\n @queue << ref\n else \n @queue.each.with_index do |v, i|\n if v[:interval] >= interval\n v[:interval] -= interval\n @queue.insert(i, ref) \n break\n else\n ref[:interval] -= v[:interval] \n if @queue.last == v\n @queue << ref\n break\n end\n end\n end\n end \n @update.push ref \n end\n \n ref\n end",
"title": ""
},
{
"docid": "58b4510f02209d7d5a68f192fd9288c1",
"score": "0.57109815",
"text": "def max_queue_threads\n 1\n end",
"title": ""
},
{
"docid": "cdc5478191fe029b9cc42e100e003e4b",
"score": "0.5634598",
"text": "def queue\n @queue ||= Queue.new\n end",
"title": ""
},
{
"docid": "7501d27101ff5ec7f766a75210a81a33",
"score": "0.5618539",
"text": "def queue\n @queue ||= produce_queue\n end",
"title": ""
},
{
"docid": "9a8eb20c15b9d598c0ed6d14fc93c51b",
"score": "0.5574737",
"text": "def random_poll_interval\n now = Time.now.to_f\n\n interval = calculate_process_based_interval(now)\n\n interval = calculate_safe_enqueue_interval(now, interval) + safe_random_interval\n\n logger.info \"CRON JOB: random_poll_interval: (#{interval})\"\n\n interval\n end",
"title": ""
},
{
"docid": "dbc7338001535a3c6f5a28884444eb04",
"score": "0.55662346",
"text": "def enqueue_in(interval, klass, *args); end",
"title": ""
},
{
"docid": "50531306270ac780a9d66e01b8bbb9b9",
"score": "0.55560076",
"text": "def _q\n @queue||=[]\n end",
"title": ""
},
{
"docid": "119b65c9a953855453534c596a81c9f0",
"score": "0.55309254",
"text": "def initialize\n @queue_options = {}\n @queue_configs = []\n end",
"title": ""
},
{
"docid": "7e618f0b11bc997ed89a4b633d895ebe",
"score": "0.5519102",
"text": "def span_events_queue_size\n NewRelic::Agent.config[:'span_events.queue_size']\n end",
"title": ""
},
{
"docid": "0b529d0ed832b7f3ebc252af477dc726",
"score": "0.55153173",
"text": "def interval ; @options[ :interval ] ; end",
"title": ""
},
{
"docid": "f3cbb0678b9f02468269cffb9f9fa3e6",
"score": "0.5483262",
"text": "def requeue_throttled\n Sidekiq.redis { |conn| conn.lpush(QueueName.expand(queue_name), job) }\n end",
"title": ""
},
{
"docid": "fa7562476b7415be7c7a1dfa9e7f6764",
"score": "0.54802436",
"text": "def queue_lock_timeout\n 3600\n end",
"title": ""
},
{
"docid": "076273d60d494f550d8aecf7feca3849",
"score": "0.5475201",
"text": "def queue\n @queue ||= []\n end",
"title": ""
},
{
"docid": "59e14612bf2fc300310e7e077d4f7c22",
"score": "0.54695684",
"text": "def configuration worker\n if @queues[worker] \n @queues[worker].respond_to?(:max) ? max_size=@queues[worker].max : max_size=0\n {'worker'=>worker,'maximum_size'=>max_size}\n else\n raise InvalidData,\"non existent queue\"\n end\n end",
"title": ""
},
{
"docid": "3f768d6a5aca609573870f0dc96012fb",
"score": "0.5451073",
"text": "def push(*args)\n @metric_queue_write.time do\n super(*args)\n end\n end",
"title": ""
},
{
"docid": "1de05a2a35ca933fcb53a8bf01b7de3c",
"score": "0.545105",
"text": "def configure worker,worker_config\n if worker_config[\"maximum_size\"]>0\n @queues[worker]=SizedQueue.new(worker_config[\"maximum_size\"])\n else\n @queues[worker]=Queue.new\n end\n configuration(worker)\n end",
"title": ""
},
{
"docid": "ec97167e233aaeb52d88608484318038",
"score": "0.5441873",
"text": "def queue_length\n @job_queue.length\n end",
"title": ""
},
{
"docid": "19f9767b1f5bb1e0b8a3532e55878305",
"score": "0.5440726",
"text": "def initialize\n @queue = Queue.new\n @workers = []\n @workers_count = 5\n end",
"title": ""
},
{
"docid": "3238d9f1c7e47b51b785a9cbdfcd792b",
"score": "0.5429051",
"text": "def initialize\n @queue = []\n end",
"title": ""
},
{
"docid": "8317e09f4bfea3b72424ddf2e674be74",
"score": "0.53972954",
"text": "def doge_control\r\n @next_queue_time = get_queue_time\r\n end",
"title": ""
},
{
"docid": "808ff8365765bee4d785dd98acde2935",
"score": "0.53897464",
"text": "def enqueue(el)\n self.queue_var = [el] + self.queue_var \n end",
"title": ""
},
{
"docid": "297660be774ade2b85af2f5827d7240c",
"score": "0.53828",
"text": "def queue; end",
"title": ""
},
{
"docid": "297660be774ade2b85af2f5827d7240c",
"score": "0.53828",
"text": "def queue; end",
"title": ""
},
{
"docid": "9f46eb6382a26514a5f4a8d021e57da4",
"score": "0.53791815",
"text": "def queue(queue)\n @configuration.queue = queue\n end",
"title": ""
},
{
"docid": "15eaa060261d68fe6868861c7162d7ea",
"score": "0.5375307",
"text": "def queue(queue = 'default')\n get_queue(queue)\n end",
"title": ""
},
{
"docid": "81fe30cfd6e068a38cc88003863d820d",
"score": "0.53691727",
"text": "def queue(_); end",
"title": ""
},
{
"docid": "81fe30cfd6e068a38cc88003863d820d",
"score": "0.53691727",
"text": "def queue(_); end",
"title": ""
},
{
"docid": "1731765cbbbd34277ff9c818437c1746",
"score": "0.5366297",
"text": "def queue_length\n if system.empty?\n 0\n else\n system.length - 1\n end\n end",
"title": ""
},
{
"docid": "f55576ffb7b17673398392dc77850217",
"score": "0.53401303",
"text": "def monitor_queue\n @monitor_queue ||= sqs.queue('monitor')\n return @monitor_queue\n end",
"title": ""
},
{
"docid": "32824233fee85f3afde69affd1b81927",
"score": "0.5336359",
"text": "def backlog\n @queue.size\n end",
"title": ""
},
{
"docid": "3982ad533389dea3d8cb4ed709680e0e",
"score": "0.53279686",
"text": "def work(interval = 5.0)\n end",
"title": ""
},
{
"docid": "48b84fa98c8e7aa8c241cc1d1851eb61",
"score": "0.5324835",
"text": "def queue_count()\n @work_queue.size + super()\n end",
"title": ""
},
{
"docid": "c509fff4b5b29839db4ad78852c65558",
"score": "0.53223145",
"text": "def queue\n @queue ||= channel.queue(generate_queue_name, exclusive: true)\n end",
"title": ""
},
{
"docid": "c614ef4daf0b54a6826c3541ea327c3d",
"score": "0.532066",
"text": "def queue_for_evaluation\n SubscriptionEvalutaionQueue.append_subscription id\n end",
"title": ""
},
{
"docid": "500115601582328d782c3e18c4ff4719",
"score": "0.53112483",
"text": "def queue_config\n Backburner.configuration\n end",
"title": ""
},
{
"docid": "c2d2c0aabbbeb37a14a535b216e8ae17",
"score": "0.53077126",
"text": "def queue_size\n @redis.llen(\"xque:queue:#{@queue_name}\")\n end",
"title": ""
},
{
"docid": "578a656e8da96a516442ce82dbef7b1a",
"score": "0.52886224",
"text": "def config\n name = $0.scan(/thin_(\\d+)/) && $1\n config = <<__CONFIG\ngraph_title Delayed::Job queue size\ngraph_vlabel Entries\ngraph_category Rails\nentries.label Entries\nentries.warning 200\nentries.critical 300\ngraph_info Number of records in the Delayed::Job table\n__CONFIG\nend",
"title": ""
},
{
"docid": "ea8ddac6b9c7b444e2eead8f9f608402",
"score": "0.52859217",
"text": "def interval; end",
"title": ""
},
{
"docid": "ea8ddac6b9c7b444e2eead8f9f608402",
"score": "0.52859217",
"text": "def interval; end",
"title": ""
},
{
"docid": "f2df4292f88eb41798aecdc56b6d269a",
"score": "0.5274888",
"text": "def work(interval = 5.0)\n interval = Float(interval)\n $0 = \"resque-delayed: harvesting\"\n startup\n\n loop do\n break if shutdown?\n\n # harvest delayed jobs while they are available\n while job = Resque::Delayed.next do\n log \"got: #{job.inspect}\"\n queue, klass, *args = job\n Resque::Job.create(queue, klass, *args)\n end\n\n break if interval.zero?\n log! \"Sleeping for #{interval} seconds\"\n sleep interval\n end\n end",
"title": ""
},
{
"docid": "03107e1dde5da9db7b3bcc1cb0aeeab8",
"score": "0.5272916",
"text": "def interval_param\n \"interval:auto\"\n end",
"title": ""
},
{
"docid": "d6630007a7a47ce432cc2ad7e81999fc",
"score": "0.5265373",
"text": "def queue() = @queue ||= CommandQueue.new",
"title": ""
},
{
"docid": "6e53ff85bb1739f58fc5358010cf01c4",
"score": "0.5264496",
"text": "def default_queue\n @queues[nil]\n end",
"title": ""
},
{
"docid": "39ab617538e8e63a9001fa9413dfceaa",
"score": "0.52571976",
"text": "def default_queue=(queue)\n @queues[nil] = queue\n end",
"title": ""
},
{
"docid": "5f021a251b7c09b660e41a7afd09f6c1",
"score": "0.52539176",
"text": "def max_queue_count()\n @max_queue_count\n end",
"title": ""
},
{
"docid": "dcc0cbc7eeb77e66f9c52ad37a4cad18",
"score": "0.5252379",
"text": "def queue\n @queue ||= channel.queue(queue_name)\n end",
"title": ""
},
{
"docid": "3bd9770f0b3edf2762564937de0b4ec6",
"score": "0.5247329",
"text": "def queue_length\n @executor.getQueue.size\n end",
"title": ""
},
{
"docid": "87755b9d9ff45ce7995925c01baaba39",
"score": "0.5234941",
"text": "def enqueue(el)\n @maxqueue.push(el) if @maxqueue.length.zero?\n\n @store.push(el)\n while @maxqueue[0] < el\n @maxqueue.pop\n break if @maxqueue.length.zero?\n end\n @maxqueue.push(el)\n end",
"title": ""
},
{
"docid": "7d92e20382912aacb7609f0c075791a2",
"score": "0.5233359",
"text": "def create_work_queue\n queue = Queue.new\n\n @edges.size.times do |index|\n queue << index\n end\n\n queue\n end",
"title": ""
},
{
"docid": "01825c27945501c40734d4730fd20f54",
"score": "0.52253824",
"text": "def enqueue_in_with_queue(queue, number_of_seconds_from_now,\n klass, *args)\n enqueue_at_with_queue(queue, Time.now + number_of_seconds_from_now,\n klass, *args)\n end",
"title": ""
},
{
"docid": "ceec9bfff92cb28c613bd32382af6f66",
"score": "0.52232385",
"text": "def add_item value\n\n @queue << value.to_f\n @queue.shift if @buffer.size > @period\n\n @buffer << @queue.sum / @queue.size # @queue.sum is always a float. \n\n current # return the last buffer value\n end",
"title": ""
},
{
"docid": "861765887c551a9e8ba148301de79d5a",
"score": "0.52073306",
"text": "def queue_length\n request_queue.length\n end",
"title": ""
},
{
"docid": "0c3d4d379bde9755e4e7bbc08eb12d98",
"score": "0.5203267",
"text": "def add_item value\n @queue << value\n @queue.shift if @queue.size > @period\n if @buffer.empty?\n @buffer=[value.to_f]\n else\n prev_ema = @buffer.last\n current_value = value.to_f\n # this is the incremential approach\n # @buffer << (current_value * @smooth_constant ) + prev_ema * (1 - @smooth_constant)\n # it is identical to\n @buffer << (current_value - prev_ema) * @smooth_constant + prev_ema\n # which is much easier to compute\n end\n current # return the last buffer value\n end",
"title": ""
},
{
"docid": "a66a292ac3782d355336855f64249f0d",
"score": "0.5198383",
"text": "def reserve\n queues.each do |queue|\n log_with_severity :debug, \"Checking #{queue}\"\n if job = Resque.reserve(queue)\n log_with_severity :debug, \"Found job on #{queue}\"\n\n if job.payload['enqueue_ts']\n delay_ts = Time.now.to_i - job.payload['enqueue_ts'].to_i\n max_delay = Resque.redis.get(\"fifo-stats-max-delay\") || 0\n Resque.redis.incrby(\"fifo-stats-accumulated-delay\", delay_ts)\n Resque.redis.incr(\"fifo-stats-accumulated-count\")\n if (delay_ts > max_delay.to_i)\n Resque.redis.set(\"fifo-stats-max-delay\", max_delay)\n end\n end\n return job\n end\n end\n\n nil\n rescue Exception => e\n log_with_severity :error, \"Error reserving job: #{e.inspect}\"\n log_with_severity :error, e.backtrace.join(\"\\n\")\n raise e\n end",
"title": ""
},
{
"docid": "8ee44e0c11fed1566eb2051fc2ca7530",
"score": "0.5186312",
"text": "def queue( name )\n Qup::Adapter::Kestrel::Queue.new( @addr, name )\n end",
"title": ""
},
{
"docid": "2eabe78374116fa94a2198141a8a40da",
"score": "0.5178251",
"text": "def default_task_heartbeat_timeout; Float::INFINITY; end",
"title": ""
},
{
"docid": "c04c9d59fc1709abfcb1e10aa0f0f349",
"score": "0.5178033",
"text": "def timeout_queue(params = nil)\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"timeout queue \" + params.to_s + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end",
"title": ""
},
{
"docid": "ef546ca6902146774827ab1881b293da",
"score": "0.5158081",
"text": "def queue(*args)\n @queue = args.first unless args.empty?\n (@queue || :default).to_s\n end",
"title": ""
},
{
"docid": "acf92cb22f35cda63f37b11f70197d3d",
"score": "0.51447976",
"text": "def base_priority\n QUEUE_PRIORITY[queue_key]\n end",
"title": ""
},
{
"docid": "b5105d49905ca12cf2fd154fd56f6e26",
"score": "0.51373065",
"text": "def queue_count()\n @queue.length\n end",
"title": ""
},
{
"docid": "4f014cc0a471344cd5602a941e561122",
"score": "0.513396",
"text": "def master_queue; @master_queue ||= []; end",
"title": ""
},
{
"docid": "44488b24e6ff6da40f0f5d558cb7df70",
"score": "0.5124107",
"text": "def queue(&b)\n @queue << b\n end",
"title": ""
},
{
"docid": "54d79f0637aaee1700aee31954768bad",
"score": "0.51234406",
"text": "def queue_key\n super || default_queue_key\n end",
"title": ""
},
{
"docid": "a8e2c0ed1e6bb498b5e39b7ee739d029",
"score": "0.5119532",
"text": "def minimum_interval\n 500\n end",
"title": ""
},
{
"docid": "ea43103713ce4d3c29ca064c6fe7edf1",
"score": "0.51188624",
"text": "def queue_for(num)\n \"#{queue}.#{num}\"\n end",
"title": ""
},
{
"docid": "a941c9fba824ee38fe7899831fbb7e87",
"score": "0.51163733",
"text": "def enqueue(node)\n #the double arrow means to PUSH the node into our q list\n @q << node\n end",
"title": ""
},
{
"docid": "4d0cc77453bea1ed7a9d9358c31faa54",
"score": "0.5107645",
"text": "def assume_bottom_queue_position\n update_attribute(queue_position_column, bottom_queue_position_in_queue(self).to_i + 1)\n end",
"title": ""
},
{
"docid": "48ba37d90f4e052d78d7e9b8b9444c1a",
"score": "0.51054275",
"text": "def test_and_enque_for_time!(time)\n # should this job be enqued?\n return unless should_enque?(time)\n\n enque!\n end",
"title": ""
},
{
"docid": "66886ed25552a91191a35354a821dbad",
"score": "0.50937045",
"text": "def name\n @queue_string\n end",
"title": ""
},
{
"docid": "9f966689e41b5310446da884d6380dd6",
"score": "0.50914735",
"text": "def instance_queue\n @instance_queue ||= sqs.queue(instance_id)\n return @instance_queue\n end",
"title": ""
},
{
"docid": "590b5d4e95ecb2a5ae9b97c0fe4933d8",
"score": "0.5086238",
"text": "def add_task(interval, &block)\n tasks << Task.new(interval, block)\n end",
"title": ""
},
{
"docid": "33560bc17ed958d55650e179f0af9999",
"score": "0.5078934",
"text": "def hbsend_interval\n @connection.hbsend_interval\n end",
"title": ""
},
{
"docid": "cf5f4f0f192cdb86876e09165aeb764e",
"score": "0.50748026",
"text": "def push(x)\n @queue << x\n end",
"title": ""
},
{
"docid": "f713288877cdc283bde905a7dc05b3fe",
"score": "0.5073963",
"text": "def perform_in_helper(item, interval, *args)\n int = interval.to_f\n now = Time.now.to_f\n ts = (int < 1_000_000_000 ? now + int : int)\n\n item.merge!('class' => self, 'args' => args, 'at' => ts)\n\n # Optimization to enqueue something now that is scheduled to go out now or in the past\n item.delete('at') if ts <= now\n\n client_push(item)\n end",
"title": ""
},
{
"docid": "07fc601c5a34c846964b6cc1e419d126",
"score": "0.50720197",
"text": "def queue_pending\n \"resque:queue:prgov_cap\"\n end",
"title": ""
},
{
"docid": "f41c5d2ef8387db955541e04104a87d8",
"score": "0.50690305",
"text": "def ticker(interval)\n loop do\n sleep(interval)\n @q.push(:nudge)\n end\n end",
"title": ""
},
{
"docid": "22a932a7baad4877efe01ce9199d9cf8",
"score": "0.50637126",
"text": "def interval\n config_get('bfd_global', 'interval', @get_args)\n end",
"title": ""
},
{
"docid": "406af28e02ae833e5a10ca71056e42b4",
"score": "0.50633746",
"text": "def add_to_queue(data)\n fail ThreadError if @current_size.value >= @max_size\n\n @queue.push(data)\n\n @current_size.increment\n end",
"title": ""
},
{
"docid": "5cb4785446aba76430aa1115f7ebcb39",
"score": "0.50622326",
"text": "def delayed_push(timestamp, item)\n redis.zadd(:delayed_queue, timestamp.to_i, encode_with_nonce(item))\n end",
"title": ""
},
{
"docid": "31c411125421e4394ae638d6931d69a9",
"score": "0.50602365",
"text": "def initialize(*)\n super\n @queues = Hash.new{|h,k| h[k] = Array.new } # autovivifying\n end",
"title": ""
},
{
"docid": "d2bec7ddbe5b92f67da466201cbc5adc",
"score": "0.50506747",
"text": "def chan(len = 1)\n SizedQueue.new(len)\n end",
"title": ""
},
{
"docid": "65815b4e055c9663bc7fb12922b64804",
"score": "0.5050046",
"text": "def queue_size(queue)\n prioritized?(queue) ? z_queue_size(queue) : super\n end",
"title": ""
},
{
"docid": "66662323466d5e16f118dea5b3f2c11c",
"score": "0.5049232",
"text": "def set_queue_delay\n new_delay = params[:delay].to_f\n if new_delay == 0\n head :bad_request\n else\n Rails.application.config.queue_delay = new_delay\n render :get_queue_delay\n end\n end",
"title": ""
},
{
"docid": "d947fbd21f77490f3735172f4fa3405e",
"score": "0.50468993",
"text": "def queue_select_limit\n (\n options[:queue_select_limit] ||\n rails_config[:queue_select_limit] ||\n env['GOOD_JOB_QUEUE_SELECT_LIMIT']\n )&.to_i\n end",
"title": ""
},
{
"docid": "32d57c2f0b540215d95ecc7ff9f5c7b1",
"score": "0.5044647",
"text": "def apply_async!(queue: 'eventually')\n super\n end",
"title": ""
},
{
"docid": "935e796e2b40a319d432dd07ce5be2b6",
"score": "0.5044264",
"text": "def enqueue(el)\n @queue << el\n el\n end",
"title": ""
},
{
"docid": "3b1741c62353523f501e13a9f21b0c5e",
"score": "0.50437045",
"text": "def enqueue_task(task)\n default_queue << task\n end",
"title": ""
},
{
"docid": "4202e91b1d2b6f66ad8e3ad7adc70724",
"score": "0.50408274",
"text": "def push_queue_push val\n return nil if self.push_queue_names.length == 0\n key = self.push_queue_names[rand(self.push_queue_names.length - 1)]\n self.debug_out \"pushing data onto push queue #{key}\"\n @redis.lpush key, Marshal.dump(val)\n key\n end",
"title": ""
},
{
"docid": "99bfb8d0c8d0066e28c7ba5eaf11e85e",
"score": "0.5039313",
"text": "def queue_length\n mutex.synchronize { running? ? @queue.length : 666 }\n end",
"title": ""
},
{
"docid": "9d5159fcda167262010c87dff4196d12",
"score": "0.50369316",
"text": "def queue_latency\n created_at - scheduled_at\n end",
"title": ""
},
{
"docid": "1dcfc5e93b3fe94ba7a9c05f0cab3e73",
"score": "0.5031132",
"text": "def configuration\n { :count => pool_manager.config.fetch(queues, 0), }\n end",
"title": ""
},
{
"docid": "3a68b4de030b0c3ff9bbfeb2fd226203",
"score": "0.5031078",
"text": "def enter_queue(time)\n self.entered_queue_at = time\n end",
"title": ""
},
{
"docid": "f3b0b17b139cf136d620a8fb13d41894",
"score": "0.5028554",
"text": "def waiting_queue_name\n @waiting_queue_name\n end",
"title": ""
}
] |
40d040d5d64efe41fe9dc5ec2d4fa136
|
The most acceptable format requested, e.g. +:json+.
|
[
{
"docid": "41a7e3f58037bd5b69c03bbddf247cf7",
"score": "0.6319306",
"text": "def format\n return @format if defined? @format\n media_type = request.accepts.best_of Util.media_types config[:formats]\n @format = config[:formats].find { |f| Util.media_type(f) == media_type }\n end",
"title": ""
}
] |
[
{
"docid": "10ec0f1a0bb8e743946c613672561da4",
"score": "0.7128684",
"text": "def formats\n JSON_FORMATS\n end",
"title": ""
},
{
"docid": "12ddfd0a2fd119d8a1416125a603fc50",
"score": "0.6959054",
"text": "def verif_format\n raise ActionController::RoutingError.new(\"Invalid format\") unless [\"json\", \"xml\"].include? params[:format]\n end",
"title": ""
},
{
"docid": "7f5b7e10ed2d2ff4f2af09bb9323fa01",
"score": "0.6893679",
"text": "def check_json_format\n head :not_acceptable if request.format != Mime::JSON\n end",
"title": ""
},
{
"docid": "a9aff79ad00e61bbfc772821c1901ae1",
"score": "0.6887136",
"text": "def default_format\n \"json\"\n end",
"title": ""
},
{
"docid": "f6fefe57c3eb11814673e52434bd5ecf",
"score": "0.68643343",
"text": "def format_of(data)\n if data.is_a?(Hash)\n :obj\n elsif data =~ /\\A\\s*</\n :xml\n elsif data =~ /\\A\\s*[{\\[]/\n :json\n end\n end",
"title": ""
},
{
"docid": "45a69307e92d9ec4cb8f659c96bd064a",
"score": "0.6851622",
"text": "def format\n :json\n end",
"title": ""
},
{
"docid": "d6dcc37a32193d7d8504ee1bc57f735a",
"score": "0.68252224",
"text": "def format_of(data)\n if data.is_a?(Hash)\n :hash\n elsif data =~ /^\\s*</\n :xml\n elsif data =~ /^\\s*[{\\[]/\n :json\n end\n end",
"title": ""
},
{
"docid": "71d7cabda391fd76ec08b6e671fee191",
"score": "0.6817849",
"text": "def accepted_response_formatter_or_json_for(model_class, request)\n request.response_formatters_for(model_class.supported_formats, \"application/json\").first\n end",
"title": ""
},
{
"docid": "e228999ac3156d25f7562d29a58a5e50",
"score": "0.68156964",
"text": "def get_format(env)\n case env['HTTP_ACCEPT']\n when JSON_ENCODED then :json\n when HTML_ENCODED then :html\n when XML_ENCODED then :xml\n end\n end",
"title": ""
},
{
"docid": "3bc815cc6fce9c584c69fdc2e0d21cd4",
"score": "0.6801684",
"text": "def format\n f = params.fetch(:format, 'json').downcase\n ['jsonld', 'n3', 'ntriples'].include?(f) ? f : 'json'\n end",
"title": ""
},
{
"docid": "1f5ab6416edecfea6bdae95d3e3a1437",
"score": "0.67932916",
"text": "def check_api_format!\n format = params[:format] || params[:default][:format]\n unless format.present? && API_FORMATS.include?(format.to_sym)\n raise Api::NotAcceptable\n end\n end",
"title": ""
},
{
"docid": "a3a43cca721f79b8516351b583a7dba3",
"score": "0.67864877",
"text": "def request_format\n format = @options[:format]\n format = \"json\" if !format || format == \"hash\"\n format\n end",
"title": ""
},
{
"docid": "4dd7af4e86e6f467eb003176724cd950",
"score": "0.67843646",
"text": "def validate_requested_format!\n return if request.format.respond_to?(:symbol) && ACCEPTABLE_FORMATS.include?(request.format.symbol)\n\n raise Errors::FormatError, 'Requested media format is not acceptable'\n end",
"title": ""
},
{
"docid": "2152cc57557c3e9be517ecaa36d77577",
"score": "0.67556316",
"text": "def format_param\n \"format=json\"\n end",
"title": ""
},
{
"docid": "6fc3f01bd0fa8983da1b6d88957ffe4e",
"score": "0.67545086",
"text": "def request_format\n format = @options[:format]\n format && format != \"hash\" ? format : 'json'\n end",
"title": ""
},
{
"docid": "32d4b398436e20b9098cb53dadfe180f",
"score": "0.67374337",
"text": "def supports_json?; end",
"title": ""
},
{
"docid": "afc4f8ef7f1932f12b4c144b55b59de7",
"score": "0.67295104",
"text": "def content_types_accepted\n [[\"application/json\", :from_json]]\n end",
"title": ""
},
{
"docid": "8ae97910ec6100fd59c88ea249445992",
"score": "0.6687729",
"text": "def accept_json\n \"#{self}&format=json\"\n end",
"title": ""
},
{
"docid": "78a3fc85f75ce32737d899f285482b0f",
"score": "0.6671474",
"text": "def accepted_api_formats\n @accepted_api_formats || [:xml, :json]\n end",
"title": ""
},
{
"docid": "ccfbfaee76b641ee1e7b4076d6a4b8c8",
"score": "0.6630453",
"text": "def format\n content.strip.start_with?('{') ? :json : :yaml\n end",
"title": ""
},
{
"docid": "138a4a642b8570b1cd293cb408e6c4ec",
"score": "0.66261846",
"text": "def legacy_json_format; end",
"title": ""
},
{
"docid": "e27f38ad2ba8e6a8f28247ff47d09212",
"score": "0.66062117",
"text": "def guess_format(str)\n case str\n when /\\A\\s*[\\[\\{]/ then :json\n when /\\A\\s*</ then :xml\n when /\\A---\\s/ then :yaml\n end\n end",
"title": ""
},
{
"docid": "f80dc0ed44cae0b0be80da0ce72a35f6",
"score": "0.6591077",
"text": "def validate_requested_format!\n return if ALL_FORMATS.include?(request.format.symbol)\n render_error :not_acceptable, 'Requested media format is not acceptable'\n end",
"title": ""
},
{
"docid": "06aa25abacf889b1f185e5410e6255ce",
"score": "0.65666425",
"text": "def default_format_json\n request.format = 'json' unless params[:format]\n end",
"title": ""
},
{
"docid": "de44421cd68975f19eced6ea366a2058",
"score": "0.65633273",
"text": "def json?\n format == 'json'\n end",
"title": ""
},
{
"docid": "f16cdee02d7d87a1f7094d18d08692d1",
"score": "0.6550409",
"text": "def expects_json?\n # Must be stringified, as preffered_type returns Sinatra::Request::AcceptEntry object\n request.preferred_type.to_s == mime_type(:json)\n end",
"title": ""
},
{
"docid": "d80ba0410744a28bed2abb2ec16e0e5b",
"score": "0.6539964",
"text": "def default_format\n\t request.format = \"json\"\n\tend",
"title": ""
},
{
"docid": "6dd6e4a395edb2d2a187ac943b0b398a",
"score": "0.6520672",
"text": "def api_valid_format?\n return true if params.has_key?(\"format\") && (params[:format].downcase == \"json\" || params[:format].downcase == \"xml\")\n api_set_error_response(449)\n render :json => @api.to_json\n return false\n end",
"title": ""
},
{
"docid": "166a3a89d8c9fbca8600d30789fccccf",
"score": "0.65189767",
"text": "def badFmt(fmt)\n raise ArgumentError, %<Unsupported JSONable format \"#{fmt}, use \"java\" or \"scala\"\">\n end",
"title": ""
},
{
"docid": "93b1c87a66c0df703981be62e612fde3",
"score": "0.6510849",
"text": "def enforce_json_format\n return if request.format == :json\n render_json_error 415, 'JSON only api. Use json extension or set content type application/json'\n end",
"title": ""
},
{
"docid": "f730e7df0f74e4990923b6eccfe47664",
"score": "0.6504593",
"text": "def get_response_format\n @json = (params.key? :format and params[:format] == \"json\")\n end",
"title": ""
},
{
"docid": "f730e7df0f74e4990923b6eccfe47664",
"score": "0.6504593",
"text": "def get_response_format\n @json = (params.key? :format and params[:format] == \"json\")\n end",
"title": ""
},
{
"docid": "f730e7df0f74e4990923b6eccfe47664",
"score": "0.6504593",
"text": "def get_response_format\n @json = (params.key? :format and params[:format] == \"json\")\n end",
"title": ""
},
{
"docid": "f730e7df0f74e4990923b6eccfe47664",
"score": "0.6504593",
"text": "def get_response_format\n @json = (params.key? :format and params[:format] == \"json\")\n end",
"title": ""
},
{
"docid": "f730e7df0f74e4990923b6eccfe47664",
"score": "0.6504593",
"text": "def get_response_format\n @json = (params.key? :format and params[:format] == \"json\")\n end",
"title": ""
},
{
"docid": "742dd3f436e5f778ffef8e520db22be1",
"score": "0.6494786",
"text": "def formats\n ['String']\n end",
"title": ""
},
{
"docid": "0c1b22d21e25fa62bada7d6e653cabac",
"score": "0.6494229",
"text": "def get_format_new(env, options)\n accepted = options[:accept] || [:json]\n requested = env['HTTP_ACCEPT'].to_s.split(',')\n requested.each do |request|\n parts = request.split(';')\n mime = parts[0]\n p = get_parser_from_type(mime)\n fmt = p&._format\n return fmt if fmt && (accepted.include?(fmt.to_sym) || accepted.include?(fmt.to_s))\n end\n nil\n end",
"title": ""
},
{
"docid": "5ab46dc7b21d16e3983c5fc78548dcf8",
"score": "0.6465438",
"text": "def json_format?\n 'json'.freeze.eql?(output)\n end",
"title": ""
},
{
"docid": "dc729c0efb7817d37d3f55ab5c566842",
"score": "0.64437324",
"text": "def verify_requested_format!; end",
"title": ""
},
{
"docid": "c8b6d3d1e411c0211d0e24a6b083e5e4",
"score": "0.6431012",
"text": "def validate_format\n return unless content\n return validate_format_json if format == 'json'\n validate_format_yaml\n end",
"title": ""
},
{
"docid": "c8b6d3d1e411c0211d0e24a6b083e5e4",
"score": "0.6431012",
"text": "def validate_format\n return unless content\n return validate_format_json if format == 'json'\n validate_format_yaml\n end",
"title": ""
},
{
"docid": "a9b24d1977bcfacf01513aa5d774b673",
"score": "0.64299256",
"text": "def request_style\n :json\n end",
"title": ""
},
{
"docid": "7f538929e184d23ff018e510b46f8173",
"score": "0.6429182",
"text": "def json?\n raw_options[:format] == :json\n end",
"title": ""
},
{
"docid": "88f4365c6c62fb90a758f2c0368e928c",
"score": "0.6426453",
"text": "def parse_format(method)\n if method.to_s == 'json' or method.to_s == 'json?'\n :json\n elsif method.to_s == 'text' or method.to_s == 'text?'\n :text\n end\n end",
"title": ""
},
{
"docid": "5fd3c7683a9725db0c776b7647938eba",
"score": "0.64177155",
"text": "def check_format(format)\n format && [:json].include?(format.to_sym) or\n raise ApiException.unsupported_format(format)\n format\n end",
"title": ""
},
{
"docid": "0d92446cd29c4789c4d97fe47e6959a2",
"score": "0.6412945",
"text": "def validate_format\n return unless content\n return validate_format_json if format == :json\n validate_format_yaml\n end",
"title": ""
},
{
"docid": "2e1b046ebd8ae3221e39faf75cc69e1c",
"score": "0.64030385",
"text": "def ensure_json\n\t\t\tif ((request.headers[\"HTTP_ACCEPT\"].nil? && params[:format].nil?) ||\n\t\t\t\t(request.headers[\"HTTP_ACCEPT\"].include?(\"*/*\") && params[:format].nil?) ||\n\t\t\t\t(params[:format].downcase.eql?(\"json\")) ||\n\t\t\t\t(request.headers[\"HTTP_ACCEPT\"].include?(\"application/json\")))\n\t\t\t\t@content_type = 'application/json; charset=utf-8'\n\t\t\telse\n\t\t\t\t# TODO: fix this since it does not work perfectly\n\t\t\t\trender :nothing => true, :status => 406\tand return\n\t\t\tend \t\t\t \t\t\t\n\t\tend",
"title": ""
},
{
"docid": "0a3b82f944d2bafe0e7136b952ad87c0",
"score": "0.63925487",
"text": "def json?\n val = @gapi.configuration.load.source_format\n val == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "6e086e0f992ea1cc699da8d1e4c6b3b5",
"score": "0.63908094",
"text": "def format\n content.strip.start_with?('{') ? 'json'.freeze : 'yaml'.freeze\n end",
"title": ""
},
{
"docid": "6e086e0f992ea1cc699da8d1e4c6b3b5",
"score": "0.63908094",
"text": "def format\n content.strip.start_with?('{') ? 'json'.freeze : 'yaml'.freeze\n end",
"title": ""
},
{
"docid": "96e4626819e3d5cfb759b29cfc0ec382",
"score": "0.63864094",
"text": "def determine_in_format\n\n ct = request.env['CONTENT_TYPE'] || ''\n\n return 'form' if ct.index('form-')\n return 'json' if ct.index('application/json')\n return 'yaml' if ct.index('application/yaml')\n\n 'xml'\n end",
"title": ""
},
{
"docid": "fed85ab6f3cfde003dd75fe4e68ac2ff",
"score": "0.6381615",
"text": "def validate_provided_format!\n return if request.content_mime_type.respond_to?(:symbol) && ACCEPTABLE_FORMATS.include?(request.content_mime_type.symbol)\n\n raise Errors::FormatError, 'Provided media format is not acceptable'\n end",
"title": ""
},
{
"docid": "42bf77882e5aa872a712badef6664e52",
"score": "0.6356832",
"text": "def format_json?\n request.format.json?\n end",
"title": ""
},
{
"docid": "2b8546ebac55b2f2e16e77a2e31ae03f",
"score": "0.6352788",
"text": "def formats; end",
"title": ""
},
{
"docid": "2b8546ebac55b2f2e16e77a2e31ae03f",
"score": "0.6352788",
"text": "def formats; end",
"title": ""
},
{
"docid": "022f70f6ad892199e44203eafcd6e47c",
"score": "0.6349944",
"text": "def json?(type)\n format_type(type) == :json\n end",
"title": ""
},
{
"docid": "4ee5db9f370de6ec930c339cd5e96f55",
"score": "0.6349099",
"text": "def set_format\n request.format = :json\nend",
"title": ""
},
{
"docid": "0fe66862de54900d9d8d048588963466",
"score": "0.63389826",
"text": "def description\n \"be a valid JSON string\"\n end",
"title": ""
},
{
"docid": "33aed8274192363d23e62736b19b8f7b",
"score": "0.6328572",
"text": "def render_format\n :json\n end",
"title": ""
},
{
"docid": "ec40bed419b1e9b7b863053c77849c52",
"score": "0.6314588",
"text": "def json?\n val = @gapi.configuration.extract.destination_format\n val == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "d5a5ae9efa7b1f5606f1c0a10d02ec05",
"score": "0.6311074",
"text": "def json_request? #:doc:\n request.format.to_s =~ /^(application\\/)?json$/i\n end",
"title": ""
},
{
"docid": "705923efb2b33c6a01b95ad9907e3196",
"score": "0.63043374",
"text": "def format\n request.format\n end",
"title": ""
},
{
"docid": "705923efb2b33c6a01b95ad9907e3196",
"score": "0.63043374",
"text": "def format\n request.format\n end",
"title": ""
},
{
"docid": "636f9b7eb36934b87348521282b3f2ac",
"score": "0.6294895",
"text": "def json?; end",
"title": ""
},
{
"docid": "02a96795cd961ff95d07d2807276222b",
"score": "0.62913716",
"text": "def check_format\n # This allows us to support content negotiation\n if request.headers['HTTP_ACCEPT'].nil? || request.format == '*/*'\n request.format = 'xml'\n end\n\n request_format = request.format.symbol\n if request_format != :xml && request_format != :json\n # 406 is the default status code when the format is not support\n head :not_acceptable\n end\n end",
"title": ""
},
{
"docid": "23ee9c2c630ab8f2d3d76edb900c92ab",
"score": "0.628028",
"text": "def validate_provided_format!\n return if request.content_mime_type && FULL_FORMATS.include?(request.content_mime_type.symbol)\n render_error :not_acceptable, 'Provided media format is not acceptable'\n end",
"title": ""
},
{
"docid": "ff51637d0663d9d890008f99ef8459c4",
"score": "0.62713236",
"text": "def default_format\n # If we have a pattern, ignore the format system by default. If we\n # have string content, it's just raw content by default.\n return 'text' if pattern || content.is_a?(String)\n case path\n when /\\.json$/\n 'json'\n when /\\.ya?ml$/\n 'yaml'\n else\n 'text'\n end\n end",
"title": ""
},
{
"docid": "4c21102c6b7d374738adac8c419f3f6a",
"score": "0.6258115",
"text": "def enforce_json_format\n return if request.format == :json\n render status: 415, json: {error: 'JSON only api. Use json extension or set content type application/json'}\n end",
"title": ""
},
{
"docid": "250c21c87c6faaa1c9c31eebf9e8a28c",
"score": "0.6246424",
"text": "def additional_response_formats(_); end",
"title": ""
},
{
"docid": "250c21c87c6faaa1c9c31eebf9e8a28c",
"score": "0.6246424",
"text": "def additional_response_formats(_); end",
"title": ""
},
{
"docid": "fbaa0bc4ff8f3b31d3103a092bc92bd3",
"score": "0.6242069",
"text": "def not_acceptable\n return standard_error if content_type == :json\n render\n end",
"title": ""
},
{
"docid": "e8d95a51780d87c2a6b47037d901ecc0",
"score": "0.6223517",
"text": "def accept_header?\n return request.headers['Accept']&.include?('application/fhir+json') if params.permit(:_format)[:_format].nil?\n\n ['json', 'application/json', 'application/fhir+json'].include?(params.permit(:_format)[:_format]&.downcase)\n end",
"title": ""
},
{
"docid": "e8d95a51780d87c2a6b47037d901ecc0",
"score": "0.6223517",
"text": "def accept_header?\n return request.headers['Accept']&.include?('application/fhir+json') if params.permit(:_format)[:_format].nil?\n\n ['json', 'application/json', 'application/fhir+json'].include?(params.permit(:_format)[:_format]&.downcase)\n end",
"title": ""
},
{
"docid": "e8d95a51780d87c2a6b47037d901ecc0",
"score": "0.6223517",
"text": "def accept_header?\n return request.headers['Accept']&.include?('application/fhir+json') if params.permit(:_format)[:_format].nil?\n\n ['json', 'application/json', 'application/fhir+json'].include?(params.permit(:_format)[:_format]&.downcase)\n end",
"title": ""
},
{
"docid": "8f05c04937ef1c340716959c9c8102f1",
"score": "0.6220175",
"text": "def rendering_json?(opt)\n ((opt[:format].to_s.downcase == 'json') if opt.is_a?(Hash)) ||\n (request.format.json? if defined?(request))\n end",
"title": ""
},
{
"docid": "084c24d4eb97653ada17dfa2e6499b0e",
"score": "0.6211485",
"text": "def json?\n @gapi.source_format == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "0b65c594670f0c4937d10334914da824",
"score": "0.62066287",
"text": "def format\n return @format if defined? @format\n formats = Util.media_types config[:formats]\n media_type = Rack::Utils.best_q_match accepts, formats\n @format = config[:formats].find { |f| Util.media_type(f) == media_type }\n end",
"title": ""
},
{
"docid": "1bd9650777df4635eba8d10aecb0bf31",
"score": "0.6187549",
"text": "def respond_with_json_by_default\n request.format = :json unless params[:format]\n end",
"title": ""
},
{
"docid": "a91b04620c322d0771f28d0982b584ec",
"score": "0.6185347",
"text": "def set_default_format\n # No matter what format is requested, we force to handle it as json.\n # If needed, we can write logic to determine how we handle other formats.\n request.format = :json\n end",
"title": ""
},
{
"docid": "7df6013eb0e84da39c1444e501c801dd",
"score": "0.6178882",
"text": "def ensure_json_request\n return if request.format.blank? || request.format == :json\n head :not_acceptable\n end",
"title": ""
},
{
"docid": "562973b21300460753492e52d3c496cd",
"score": "0.61744213",
"text": "def not_acceptable! message = nil, **data\n @format ||= config[:formats].first\n media_types = Util.media_types config[:formats]\n error! :not_acceptable, message, data.merge(accepts: media_types)\n end",
"title": ""
},
{
"docid": "562973b21300460753492e52d3c496cd",
"score": "0.61744213",
"text": "def not_acceptable! message = nil, **data\n @format ||= config[:formats].first\n media_types = Util.media_types config[:formats]\n error! :not_acceptable, message, data.merge(accepts: media_types)\n end",
"title": ""
},
{
"docid": "6fe06d4f23b23457de7adc32e5908a43",
"score": "0.61723626",
"text": "def json?\n @gapi.configuration.load.source_format == \"NEWLINE_DELIMITED_JSON\"\n end",
"title": ""
},
{
"docid": "38ee31901eab1c0d99ebdcc4734819ed",
"score": "0.6161585",
"text": "def is_json_raw_type?(value); end",
"title": ""
},
{
"docid": "a4b05d6285daf8ddda93d2d9628ed2c0",
"score": "0.6150831",
"text": "def validate_format\n JSON.parse(data) && nil if data.present?\n rescue JSON::ParserError => err\n err.message\n end",
"title": ""
},
{
"docid": "e3cc892758d7e4288f03d3731c3a8179",
"score": "0.61346585",
"text": "def request_format(scope)\n params = scope.respond_to?(:params) ? scope.params : {}\n format = params.has_key?(:format) ? params[:format] : nil\n if request = scope.respond_to?(:request) && scope.request\n format ||= request.format.to_sym.to_s if request.respond_to?(:format)\n end\n format && self.respond_to?(\"to_#{format}\") ? format : \"json\"\n end",
"title": ""
},
{
"docid": "53c3a139aad4b005dee59f98cbf46a58",
"score": "0.6134506",
"text": "def unacceptable\n respond_to do |format|\n format.html { render status: 422 }\n format.json { render json: { error: 'Input unacceptable' }, status: 422 }\n format.any { head :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "18866ed82d8efa6c3c4150de327f8b8f",
"score": "0.6123742",
"text": "def json_mime?(mime)\n !(mime =~ /\\Aapplication\\/json(;.*)?\\z/i).nil?\n end",
"title": ""
},
{
"docid": "18866ed82d8efa6c3c4150de327f8b8f",
"score": "0.6123742",
"text": "def json_mime?(mime)\n !(mime =~ /\\Aapplication\\/json(;.*)?\\z/i).nil?\n end",
"title": ""
},
{
"docid": "18866ed82d8efa6c3c4150de327f8b8f",
"score": "0.6123742",
"text": "def json_mime?(mime)\n !(mime =~ /\\Aapplication\\/json(;.*)?\\z/i).nil?\n end",
"title": ""
},
{
"docid": "18866ed82d8efa6c3c4150de327f8b8f",
"score": "0.6123742",
"text": "def json_mime?(mime)\n !(mime =~ /\\Aapplication\\/json(;.*)?\\z/i).nil?\n end",
"title": ""
},
{
"docid": "a6321b05b17e94eb645801ada62fcff9",
"score": "0.6122252",
"text": "def json?\n true\n end",
"title": ""
},
{
"docid": "dec673450d3ec0d09d1abc72f9547d42",
"score": "0.6103925",
"text": "def format\n @format ||= case content_type\n when *ContentTypes[:json]\n :json\n when *ContentTypes[:xml]\n :xml\n when *ContentTypes[:html]\n :html\n when *ContentTypes[:yaml]\n :yaml\n else\n :plain\n end\n end",
"title": ""
},
{
"docid": "43a3a6a17fc5f2d6c3eb495d26f776b6",
"score": "0.61021924",
"text": "def check_format\n # support only plain text, xml and json\n if request.format.symbol != :text and request.format.symbol != :xml and request.format.symbol != :json\n # 406 is the default status code when the format is not support\n render :nothing => true, :status => 406\n end\n end",
"title": ""
},
{
"docid": "e699fb9846771399fb6976994f4ebf1d",
"score": "0.6101438",
"text": "def verify_request_format!; end",
"title": ""
},
{
"docid": "5474a750f8b6d6e67e8ea8396c1c0c92",
"score": "0.6077316",
"text": "def requested_json?\n return request.format == \"application/json\"\n end",
"title": ""
},
{
"docid": "02fc45b117ec9f583a8e09c52a5e5991",
"score": "0.6072887",
"text": "def is_request_json?\n request.format == Mime::JSON\n end",
"title": ""
},
{
"docid": "dec50af779893e145eec052f6e115c16",
"score": "0.606178",
"text": "def format\n (params['format'] || '').downcase\n end",
"title": ""
},
{
"docid": "880c319383ac17374c4a6d7446558dc9",
"score": "0.6058936",
"text": "def verify_requested_format!\n mimes = collect_mimes_from_class_level\n collector = ActionController::MimeResponds::Collector.new(mimes, request.variant)\n\n unless collector.negotiate_format(request)\n raise ActionController::UnknownFormat\n end\n end",
"title": ""
},
{
"docid": "0efb0f49e63ac98954740789c0d15140",
"score": "0.6042644",
"text": "def accept_only_json\n respond_to do |format|\n format.json do\n begin\n yield\n rescue ActiveRecord::RecordNotFound => e\n render json: { :error => \"Resource not found\"}, status: 404\n rescue ActiveRecord::RecordInvalid => e\n render json: { :error => e.to_s || \"Invalid attributes\"}, status: 409\n rescue Exception => e\n render json: { :error => e.to_s }, status: 400\n end\n end\n format.any { render params[:format].to_sym => { :error => 'Api accepts only json'}, :status => 415 }\n end\n end",
"title": ""
}
] |
7139a966f4562acd906f7cc5b5dbd3ee
|
=begin rdoc Todo/Fixme is called again =end
|
[
{
"docid": "cfe552d5f0347501b9cf11a6204e6863",
"score": "0.0",
"text": "def call()\r\n @logger.info([@type, \"#{@codeline}(#{@count}) #{@shortdescription} (temporary: #{@result.inspect})\"])\r\n @count += 1\r\n end",
"title": ""
}
] |
[
{
"docid": "d557db54e52a71749409a130c88eadaa",
"score": "0.67518234",
"text": "def metodo\n #corpo do metodo\n puts 'corpo do metodo'\n end",
"title": ""
},
{
"docid": "d557db54e52a71749409a130c88eadaa",
"score": "0.67518234",
"text": "def metodo\n #corpo do metodo\n puts 'corpo do metodo'\n end",
"title": ""
},
{
"docid": "d557db54e52a71749409a130c88eadaa",
"score": "0.67518234",
"text": "def metodo\n #corpo do metodo\n puts 'corpo do metodo'\n end",
"title": ""
},
{
"docid": "cacde804f321523cb7452ead5caf27a6",
"score": "0.6672864",
"text": "def todo\n flunk \"test not written\"\n end",
"title": ""
},
{
"docid": "f2327595f46494892732f769bef253ee",
"score": "0.6550935",
"text": "def metodo\n puts 'metodo'\n end",
"title": ""
},
{
"docid": "ed463e2299a9d20771e81c540c211a04",
"score": "0.65084183",
"text": "def process_fix\n super\n end",
"title": ""
},
{
"docid": "7626b6e6830af39da264bb7864a0e339",
"score": "0.62925065",
"text": "def default()\n fail_todo\n end",
"title": ""
},
{
"docid": "b449373df0abea2cf827b607405908fb",
"score": "0.6174739",
"text": "def todo_reset\n @generated_todo = false\n @downloaded_a_page = false\n end",
"title": ""
},
{
"docid": "8af32bf6b695f6c125abf0a016d18e67",
"score": "0.6091456",
"text": "def bug\n end",
"title": ""
},
{
"docid": "8ddc8d1709c57645e8cc520e7613ff97",
"score": "0.60625696",
"text": "def read_todo\n update\n end",
"title": ""
},
{
"docid": "f05674e57c92078bff42a73d03c9a8b4",
"score": "0.60557747",
"text": "def after_lint; end",
"title": ""
},
{
"docid": "2cc9969eb7789e4fe75844b6f57cb6b4",
"score": "0.60153407",
"text": "def refutal()\n end",
"title": ""
},
{
"docid": "8262c478a5e304bf2044de184e9332f1",
"score": "0.5998334",
"text": "def exec_fix\n super\n end",
"title": ""
},
{
"docid": "633cb5fd72a767f1a673c07fad923d5a",
"score": "0.59957993",
"text": "def metodo\n puts \"Hola metodo 2\"\nend",
"title": ""
},
{
"docid": "ea0bbcd53d5171a0a1253878b0ef940a",
"score": "0.59841985",
"text": "def faint; end",
"title": ""
},
{
"docid": "ea0bbcd53d5171a0a1253878b0ef940a",
"score": "0.59841985",
"text": "def faint; end",
"title": ""
},
{
"docid": "1b2d830b0d7d5d38a2e11f952e616646",
"score": "0.5902447",
"text": "def faq\n end",
"title": ""
},
{
"docid": "1b2d830b0d7d5d38a2e11f952e616646",
"score": "0.5902447",
"text": "def faq\n end",
"title": ""
},
{
"docid": "57657de131abcef72e4b43ff2ebdbe27",
"score": "0.58875686",
"text": "def faq\n\n end",
"title": ""
},
{
"docid": "207500d2d846be37e4b08f0931bec23a",
"score": "0.58534896",
"text": "def doc_task; end",
"title": ""
},
{
"docid": "ae5d6f4d4ca368e1accbb916d23434d6",
"score": "0.58099145",
"text": "def clear_todo\n @todo = nil\n end",
"title": ""
},
{
"docid": "f0d5c8d87698caae65592cf3e3cd8b20",
"score": "0.5806278",
"text": "def complete_todo\n cli.die \"That task is already completed!\" if @todo.completed?\n @todo.complete!\n puts \"#{@todo.label}: '#{@todo.todo}' marked as completed at #{@todo.stop}\"\n end",
"title": ""
},
{
"docid": "6248820351b76feb41765634b35b82c4",
"score": "0.5790837",
"text": "def macro_todo(message)\n\t\t\tdraft = Glyph['document.draft']\n\t\t\tGlyph['document.draft'] = true unless draft\n\t\t\tres = interpret \"![#{message}]\"\n\t\t\tGlyph['document.draft'] = false unless draft\n\t\t\tres\n\t\tend",
"title": ""
},
{
"docid": "6248820351b76feb41765634b35b82c4",
"score": "0.5790837",
"text": "def macro_todo(message)\n\t\t\tdraft = Glyph['document.draft']\n\t\t\tGlyph['document.draft'] = true unless draft\n\t\t\tres = interpret \"![#{message}]\"\n\t\t\tGlyph['document.draft'] = false unless draft\n\t\t\tres\n\t\tend",
"title": ""
},
{
"docid": "b30638c1b756d1dbbe9f8b16a53a7d7f",
"score": "0.57436013",
"text": "def doc_task=(_arg0); end",
"title": ""
},
{
"docid": "05f4a5946b3e6c6a05a8476318dedf51",
"score": "0.57066303",
"text": "def clobber_task_description\n \"Remove RDoc HTML files\"\n end",
"title": ""
},
{
"docid": "95a2b097c595268088365f851cf47f9d",
"score": "0.5632887",
"text": "def before_lint; end",
"title": ""
},
{
"docid": "eae44d68a107a1dee14f3ddfdd0c2b23",
"score": "0.5606074",
"text": "def donizetti; end",
"title": ""
},
{
"docid": "53a4ac136ab0daa45ef778b18c6caa07",
"score": "0.5588109",
"text": "def read_auto_clean_up=(_arg0); end",
"title": ""
},
{
"docid": "08ffdb1e3ff4af2f39d7c2525d67eafe",
"score": "0.55756384",
"text": "def complete\n # 'Completed' is a bad commit message\n end\n\n def tests\n # 'Tests' is also a bad message\n end\n\n def rename_variable\n # 'Rename variable' is also a bad message\n end\n\n def style_cops\n # you get the idea\n end\nend",
"title": ""
},
{
"docid": "d27d91c2dcdceaea51bf31126346ed72",
"score": "0.5557586",
"text": "def ensure_deletion_fixes \n # TO DO\n end",
"title": ""
},
{
"docid": "a312acaf0d16352ae2be38827bd4e96f",
"score": "0.55545115",
"text": "def notes; end",
"title": ""
},
{
"docid": "a312acaf0d16352ae2be38827bd4e96f",
"score": "0.55545115",
"text": "def notes; end",
"title": ""
},
{
"docid": "a312acaf0d16352ae2be38827bd4e96f",
"score": "0.55545115",
"text": "def notes; end",
"title": ""
},
{
"docid": "b08d09ac3bd8f9779d3ec33aab195054",
"score": "0.5528886",
"text": "def hotfix_information\n super\n end",
"title": ""
},
{
"docid": "37d225061b951ff372b3d5fd55b4894f",
"score": "0.55144536",
"text": "def need_help \n end",
"title": ""
},
{
"docid": "3bdae0a49b70ab4d0b2b1f184229c235",
"score": "0.55128455",
"text": "def mark_done\n choose do |menu|\n menu.prompt = \"What have you completed?\"\n Toodoo::Item.where{:todo_id => todo.id, finished => false}.each do |x|\n menu.choice(x.item, \"Choose this task\"){x.update(finished => true)}\n x.save\n end\n menu.choice(:back)\n end\n\n def change_due_date\n # TODO: This should display the todos on the current list in a menu\n # similarly to pick_todo_list. Once they select a todo, the menu choice block\n # should update the due date for the todo. You probably want to use\n # `ask(\"foo\", Date)` here.\n end\n\n def edit_task\n choose do |menu|\n menu.prompt = \"What item would you like to edit?\"\n Toodoo::Item.wehere{:list_id => list_id, finished => false}.each do |x|\n menu.choice(x.item, \"Edit this task\") {x.update(item: get_new_item)}\n x.save\n end\n end\n end\n\n def show_overdue\n # TODO: This should print a sorted list of todos with a due date *older*\n # than `Date.now`. They should be formatted as follows:\n # \"Date -- Eat a Cookie\"\n # \"Older Date -- Play with Puppies\"\n end\n\n def run\n puts \"Welcome to your personal TooDoo app.\"\n loop do\n choose do |menu|\n menu.layout = :menu_only\n menu.shell = true\n\n # Are we logged in yet?\n unless @user\n menu.choice(:new_user, \"Create a new user.\") { new_user }\n menu.choice(:login, \"Login with an existing account.\") { login }\n end\n\n # We're logged in. Do we have a todo list to work on?\n if @user && !@todos\n menu.choice(:delete_account, \"Delete the current user account.\") { delete_user }\n menu.choice(:new_list, \"Create a new todo list.\") { new_todo_list }\n menu.choice(:pick_list, \"Work on an existing list.\") { pick_todo_list }\n menu.choice(:remove_list, \"Delete a todo list.\") { delete_todo_list }\n end\n\n # Let's work on some todos!\n if @todos\n menu.choice(:new_task, \"Add a new task.\") { new_task }\n menu.choice(:mark_done, \"Mark a task finished.\") { mark_done }\n menu.choice(:move_date, \"Change a task's due date.\") { change_due_date }\n menu.choice(:edit_task, \"Update a task's description.\") { edit_task }\n menu.choice(:show_done, \"Toggle display of tasks you've finished.\") { @show_done = !!@show_done }\n menu.choice(:show_overdue, \"Show a list of task's that are overdue, oldest first.\") { show_overdue }\n menu.choice(:back, \"Go work on another Toodoo list!\") do\n say \"You got it!\"\n @todos = nil\n end\n end\n\n menu.choice(:quit, \"Quit!\") { exit }\n end\n end\n end\nend",
"title": ""
},
{
"docid": "048ee61d9bd098d56596eb394690e040",
"score": "0.5511654",
"text": "def mark_as_done(todo)\n @data_object.aff_to_do &= ~todo\n end",
"title": ""
},
{
"docid": "e0a729458adaebaa3ab147c5f62bf0b0",
"score": "0.5449984",
"text": "def todo() \n if $active\n $active=ask(\"Already Active ?!\") \n return if $active\n end\n $todo=eval File.read($todoName) if File.exists?($todoName)\n $active=true\n todo1()\n end",
"title": ""
},
{
"docid": "da74a9b5b00e3fec359a36ac69ce8342",
"score": "0.5439599",
"text": "def cancel_todo todo_content\n switch_to_man_frame \n sleep 2\n cancel_todo_data_list todo_content\n sleep 2\n switch_out_frame\n end",
"title": ""
},
{
"docid": "3d93296ba98b07a1426cf9a167ef69d9",
"score": "0.5426206",
"text": "def fix!# {{{\n self.checksum!\n end",
"title": ""
},
{
"docid": "31a65f681671f087d9d4c2d08385daf5",
"score": "0.5415705",
"text": "def set_what_fixed_to_do\n @what_fixed_to_do = WhatFixedToDo.find(params[:id])\n end",
"title": ""
},
{
"docid": "baeea4f7c40df0a0759a78e187899e7a",
"score": "0.54088813",
"text": "def replace_update_me\n end",
"title": ""
},
{
"docid": "f3fbf8bf0bfac5585bb9ce0c69166aa8",
"score": "0.54075164",
"text": "def contact_update(args)\n super # placeholder so that I can add some doc\n end",
"title": ""
},
{
"docid": "f3fbf8bf0bfac5585bb9ce0c69166aa8",
"score": "0.54075164",
"text": "def contact_update(args)\n super # placeholder so that I can add some doc\n end",
"title": ""
},
{
"docid": "a27123b0f9486bf5bec51475b2f20b83",
"score": "0.54031324",
"text": "def read_auto_clean_up; end",
"title": ""
},
{
"docid": "283ccd42ad6eccee4cf3061429b11877",
"score": "0.5402536",
"text": "def todos\n output = `bin/rails notes`\n return if output&.empty?\n\n heading('TODO\\'s', output)\n end",
"title": ""
},
{
"docid": "5b1812c2f5299c888b86e43b14c9a797",
"score": "0.54016083",
"text": "def todo_tag(text); end",
"title": ""
},
{
"docid": "949258df127353d596dc51a94454c810",
"score": "0.5379784",
"text": "def add_todo\n puts\n desc = description('Todo description (required):')\n return if desc.nil?\n due = due_date\n priority = item_priority\n @list.add('todo',desc, { due: due, priority: priority})\n puts\n end",
"title": ""
},
{
"docid": "f937b998cf689080ac1227a6e3bcc7cd",
"score": "0.53726035",
"text": "def fix_offenses!\n run \"rubocop -a --format=simple\"\n end",
"title": ""
},
{
"docid": "cf72502a4e2c0f68e18d6476b6e4a919",
"score": "0.5369176",
"text": "def buzzword; end",
"title": ""
},
{
"docid": "cf72502a4e2c0f68e18d6476b6e4a919",
"score": "0.5369176",
"text": "def buzzword; end",
"title": ""
},
{
"docid": "23ca5756f165dbee957ec6dda67c3481",
"score": "0.5361973",
"text": "def fix args #id, fix\n id = args.shift\n unless id\n id = ask(\"Issue Id? \", Integer)\n end\n db, row = validate_id id\n if !args.empty?\n text = args.join(\" \")\n if row['fix']\n die \"Sorry. I already have a fix, pls edit ... #{row['fix']}\"\n end\n else\n # XXX give the choice of using vim\n if row['fix']\n text = Cmdapp.edit_text row['fix']\n else\n message \"Enter a fix (. to exit): \"\n text = Cmdapp.get_lines\n end\n end\n # FIXME: what if user accidentally enters a fix, and wants to nullify ?\n die \"Operation cancelled\" if text.nil? or text.empty?\n message \"fix is: #{text}.\"\n message \"Adding fix to #{id}: #{row['title']}\"\n _fix db, id, text\n 0\n end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5357274",
"text": "def anchored; end",
"title": ""
},
{
"docid": "24773adef2fa203ab03620d3690f5b82",
"score": "0.5356862",
"text": "def start_todo\n cli.die \"That task is already started!\" if @todo.started?\n @todo.start!\n puts \"#{@todo.label}: '#{@todo.todo}' marked as started at #{@todo.start}\"\n end",
"title": ""
},
{
"docid": "0b47c7bbf158a08945a18c5355a04daf",
"score": "0.53543746",
"text": "def usage; end",
"title": ""
},
{
"docid": "0b47c7bbf158a08945a18c5355a04daf",
"score": "0.53543746",
"text": "def usage; end",
"title": ""
},
{
"docid": "b7382c1183767bbbba99b966a7805b56",
"score": "0.5352917",
"text": "def forgot\r\n \r\n end",
"title": ""
},
{
"docid": "6b22c1887e254fb2397556f5f1904282",
"score": "0.5346565",
"text": "def how_it_works\r\n end",
"title": ""
},
{
"docid": "8f704622b8bb52eb18bfc5dbb6be9f89",
"score": "0.53373337",
"text": "def culprit\n @culprit\n end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.5333395",
"text": "def suivre; end",
"title": ""
},
{
"docid": "facffb13e3eb99f00b41623525ff5a35",
"score": "0.53332704",
"text": "def incomplete\r\n\r\n end",
"title": ""
},
{
"docid": "0991f5918c169a4166b0c0aa2daa73a3",
"score": "0.5330131",
"text": "def done\n end",
"title": ""
},
{
"docid": "0991f5918c169a4166b0c0aa2daa73a3",
"score": "0.5330131",
"text": "def done\n end",
"title": ""
},
{
"docid": "626e1a0eb7574502992b5efe0a5b6b8a",
"score": "0.53240204",
"text": "def change_to_todo\n @task = Task.find(params[:id])\n @task.done = false\n @task.save\n redirect_to root_path\nend",
"title": ""
},
{
"docid": "078c24eb1ce704a7023b1aa3e7ee7992",
"score": "0.5316981",
"text": "def task_case(task, todo)\n system \"clear\"\n case task\n when '-c'\n toggle_complete(todo, true)\n when '-u'\n toggle_complete(todo, false)\n when '-d'\n system \"clear\"\n puts \"Deleted Todo: #{todo.content}\"\n todo.delete\n edit_menu\n when '-e'\n system \"clear\"\n puts \"Please submit your changes: \"\n todo.content = check_for_exit(gets.chomp)\n todo.save\n\n system \"clear\"\n puts \"Updated todo to #{todo.content}\"\n edit_menu\n\n when '-da'\n system \"clear\"\n puts \"Deleted all todos\".red\n Todo.delete_all\n main_menu\n when '-m'\n system \"clear\"\n main_menu\n when 'q'\n system \"clear\"\n exit\n end\nend",
"title": ""
},
{
"docid": "7f81885631836f35c1ddffeac4c9f856",
"score": "0.5301188",
"text": "def custom_fix! held_page\n self.custom_fix.call held_page unless self.custom_fix.nil?\n end",
"title": ""
},
{
"docid": "9b58472e3803c90a29f67a1841e25410",
"score": "0.52802235",
"text": "def fix_for_toc_entry(elements); end",
"title": ""
},
{
"docid": "cb23ed265bee25ac3f8c6834508ba973",
"score": "0.5279762",
"text": "def mark_all_undone\n self.each { |todo| todo.undone! }\n end",
"title": ""
},
{
"docid": "d900e7e1d663e7fe6761b233e966f48f",
"score": "0.5272948",
"text": "def modified?; end",
"title": ""
},
{
"docid": "a6d2e276d02c66970a03a21e13d8cf37",
"score": "0.52687687",
"text": "def patch; end",
"title": ""
},
{
"docid": "a6d2e276d02c66970a03a21e13d8cf37",
"score": "0.52687687",
"text": "def patch; end",
"title": ""
},
{
"docid": "348a333c36b6ab37185f80e2e1f4a288",
"score": "0.5263853",
"text": "def pick_todo\n if Todo.allTodos.empty?\n system \"clear\"\n puts 'Please add todos, before you can edit them.'.yellow\n return main_menu\n end\n\n puts 'What todo?'\n Todo.display_todos\n todo_index = check_for_exit(gets.chomp).to_i\n Todo.new(Todo.allTodos[todo_index]);\n\nend",
"title": ""
},
{
"docid": "7b10bcb5e09e3262fdd938e7a96031d0",
"score": "0.5260202",
"text": "def usage\n puts 'Usage: %s.rb [--fix]' % NAME\n puts ' fix Try to fixup meta issues'\n puts 'Script checks consistency of the .META. table. It reports if .META. has missing entries.'\n puts 'If you pass \"--fix\", it will try looking in the filesystem for the dropped region and if it'\n puts 'finds a likely candidate, it will try pluggin the .META. hole.'\n exit!\nend",
"title": ""
},
{
"docid": "4c69984f1afad95d7d6a7f0dfdde93f7",
"score": "0.5254593",
"text": "def clean_up\n end",
"title": ""
},
{
"docid": "4c69984f1afad95d7d6a7f0dfdde93f7",
"score": "0.5254593",
"text": "def clean_up\n end",
"title": ""
},
{
"docid": "4e7f63d2e8327143b97af38c6fce7a24",
"score": "0.5252633",
"text": "def original; end",
"title": ""
},
{
"docid": "69fd9514e0ddc0b7b3630966791fe38b",
"score": "0.5247014",
"text": "def recall; end",
"title": ""
},
{
"docid": "6e0c33a0d2a843720817a2e706bbc2c3",
"score": "0.5245567",
"text": "def docstring; end",
"title": ""
},
{
"docid": "6e0c33a0d2a843720817a2e706bbc2c3",
"score": "0.5245567",
"text": "def docstring; end",
"title": ""
},
{
"docid": "defe7658086081e9aa15ddcf7d2ad2aa",
"score": "0.52445227",
"text": "def updateDeps(rakeTask)\n\t\t#no-op\n\tend",
"title": ""
},
{
"docid": "b92837ba0e483a3be7fc842ea160934a",
"score": "0.524365",
"text": "def docstring_hash_flag; end",
"title": ""
},
{
"docid": "d4b1693c1df48494742de9f77d3c94b0",
"score": "0.5239326",
"text": "def mark_all_done\n self.each { |todo| todo.done! }\n end",
"title": ""
},
{
"docid": "470ad6ed6a3184ea5d1aed5cee420b97",
"score": "0.5233221",
"text": "def dirty; end",
"title": ""
},
{
"docid": "239b8bd42052f4aa75fea301dc42e6f0",
"score": "0.52322865",
"text": "def done!\n @todos.each {|todo| todo.done! }\n end",
"title": ""
},
{
"docid": "ff43c8fe6eb2bc0a880d3c7b1e279677",
"score": "0.52242875",
"text": "def corrections; end",
"title": ""
},
{
"docid": "1fed3007d2a372c0e489d80e3625dbed",
"score": "0.5223255",
"text": "def deferred(name, content)\n @todo ||= []\n @todo << [name, content]\n end",
"title": ""
},
{
"docid": "d0ebef02968e7605c10d8a7e26b3ce5b",
"score": "0.52180773",
"text": "def done(item)\n @todo_list.each { |todo| todo.update_status if todo.description == item }\n end",
"title": ""
},
{
"docid": "9a98d6371685622399b0b759a46a4be3",
"score": "0.52157706",
"text": "def temporary_patch_delete_me_later\n # This is a temporary patch to fix an issue with one of the pt-BR translations\n # in the DMPRoadmap translation.io\n #\n # It overrides the application_controller.rb :success_message function\n format(_('Successfully %{action} the %{object}.'), object: obj_name_for_display(obj), action: action || 'save')\n end",
"title": ""
},
{
"docid": "ef11845bbf0e54f32aea61c59dd854c5",
"score": "0.5214244",
"text": "def manual_add\n self.metadata[:todos] ||= []\n end",
"title": ""
},
{
"docid": "5a8eff0ec420d4ae6f45b53a2300da26",
"score": "0.5210666",
"text": "def fix_suggestion\n backup_error_obj.fix_hint rescue 'Please help us debug this error by forwarding this email to backup-errors@eternos.com'\n end",
"title": ""
},
{
"docid": "b1614d354ad1edfa1a0e2fc97a4bfc17",
"score": "0.52077335",
"text": "def todo( comment, type = :ToDo, &block)\r\n codeline = caller[1].split(':in').first\r\n codelinekey = \"#{codeline} (#{type})\"\r\n\r\n if @codelines[codelinekey] #2nd or more calls\r\n @codelines[codelinekey].call\r\n else #First occurence?\r\n @codelines[codelinekey] = Todo.new(codeline, type, comment, @logger, &block)\r\n end \r\n @codelines[codelinekey].result\r\n end",
"title": ""
},
{
"docid": "0eaa3ea031b0e4ec904b8b8acc647f8b",
"score": "0.520642",
"text": "def undo\n\t\t\n\tend",
"title": ""
},
{
"docid": "0eaa3ea031b0e4ec904b8b8acc647f8b",
"score": "0.520642",
"text": "def undo\n\t\t\n\tend",
"title": ""
},
{
"docid": "83e9a7757aeca4ca38f69912a19d935d",
"score": "0.52053565",
"text": "def problem_14\nend",
"title": ""
},
{
"docid": "4ad19d3270d712a0b1427d62090e5438",
"score": "0.520329",
"text": "def ibu; end",
"title": ""
},
{
"docid": "abb7c9b8863e261a4cc8f31a4b5be004",
"score": "0.5202211",
"text": "def docstring_hash_flag=(_arg0); end",
"title": ""
},
{
"docid": "e8259cd15b7cd967fcf0ed819fb27ba0",
"score": "0.52007943",
"text": "def backlog; end",
"title": ""
},
{
"docid": "e8259cd15b7cd967fcf0ed819fb27ba0",
"score": "0.52007943",
"text": "def backlog; end",
"title": ""
},
{
"docid": "861641c42d4d95f801581eda3e4800c7",
"score": "0.51885164",
"text": "def test_the_application_can_update_a_previous_item_description_on_our_to_do_list\n #Implement the test\n #Implement the controller action\n end",
"title": ""
},
{
"docid": "6f0e293b8861d6664568d8f31a25abfc",
"score": "0.51854426",
"text": "def do()\r\n\tend",
"title": ""
}
] |
8ed00556d4122e3eccfd9b5389522ebd
|
PUT /users/1 PUT /users/1.json
|
[
{
"docid": "6d1120b664bd7c4e5bc28e9ef198989b",
"score": "0.0",
"text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n \n end",
"title": ""
}
] |
[
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.7438286",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
"title": ""
},
{
"docid": "bb443a428f2563539f43b17c71594928",
"score": "0.7251369",
"text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "1ebfa5c43a28c0c6ae3c7116c2834ee3",
"score": "0.72068095",
"text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "060d1f9e03ff05ffa8c109da1c913458",
"score": "0.71391344",
"text": "def update\n @user.update!(user_params)\n render json: @user\n end",
"title": ""
},
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.7114921",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end",
"title": ""
},
{
"docid": "699d9259b5511ca444c672d0fdd17ed2",
"score": "0.70365673",
"text": "def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"title": ""
},
{
"docid": "0b4c2960540c3a0c5e7102619705473d",
"score": "0.70167965",
"text": "def update_user( name, data )\n response = put(\"#{@config['url']}/api/2.1/rest/users/#{name}\", data, {accept: :json, :cookies => cookies})\n return response.code\n end",
"title": ""
},
{
"docid": "072e5b03e910a6eec48902b51969403c",
"score": "0.69694865",
"text": "def update \n @user = User.find(params[:id])\n if @user.update(user_params)\n render json: @user \n else \n render status: 400, nothing: true \n end \n end",
"title": ""
},
{
"docid": "832c248ba3eb8c446af4c6ce62926569",
"score": "0.69656366",
"text": "def update\n if @api_v1_user.update(api_v1_user_params)\n render json: @api_v1_user\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "385ac3bc89323aa86c512d98dcdd5ca2",
"score": "0.69633806",
"text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api_v1, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "0cb46e242a339293232b4f53c37d1deb",
"score": "0.6954546",
"text": "def update_user(opts = {})\n put 'user', opts\n end",
"title": ""
},
{
"docid": "568a6defa7393f06936468d8c0b16b0a",
"score": "0.6915363",
"text": "def update\n user = find_user\n user.update(user_params)\n render json: user\n end",
"title": ""
},
{
"docid": "d8054e3c41b8df3c2ec3d070c63961f3",
"score": "0.6909374",
"text": "def update\n puts params[:id]\n user = User.find(params[:id])\n user.update(name: params[:name], email: params[:email])\n render json: {success: \"Successful updating\"}\n end",
"title": ""
},
{
"docid": "ccf9ed09d600e760d6f263e0380c88ca",
"score": "0.6859365",
"text": "def update\n update_resource(@user)\n end",
"title": ""
},
{
"docid": "ccf9ed09d600e760d6f263e0380c88ca",
"score": "0.6859365",
"text": "def update\n update_resource(@user)\n end",
"title": ""
},
{
"docid": "9701fa7622582362b473432231ef2840",
"score": "0.68466485",
"text": "def update\n\t\tuser = find_user\n\t\tuser.update(user_params)\n\t\trender json: user\n\tend",
"title": ""
},
{
"docid": "c0f436afe080be01e3d9a900ae80f8ab",
"score": "0.68338895",
"text": "def update\n head :no_content\n # @api_v1_user = Api::V1::User.find(params[:id])\n\n # if @api_v1_user.update(api_v1_user_params)\n # head :no_content\n # else\n # render json: @api_v1_user.errors, status: :unprocessable_entity\n # end\n end",
"title": ""
},
{
"docid": "759be2484912d28bb67ffe03d6a24228",
"score": "0.6833536",
"text": "def update\n user = User.find(params[:id])\n\n if user.update_attributes(user_params)\n render json: user.to_json, status: 200\n else\n render json: {error: \"User update failed\", status: 400}, status: 400\n end\n end",
"title": ""
},
{
"docid": "c77c61632e7a5655fa8215c4d35a24f0",
"score": "0.68258655",
"text": "def update\n @user = User.find_by_name(params[:id])\n @user.update_attributes(params[:user])\n \n respond_with @user, :stautus => :ok\n end",
"title": ""
},
{
"docid": "d0a9ca650949efc2e171cbc48421587b",
"score": "0.6822829",
"text": "def update\n update_user(users_path)\n end",
"title": ""
},
{
"docid": "47f1b8bbb51dc45ffacf38d5030fd63d",
"score": "0.68002295",
"text": "def update\n user = User.find_by!(id: params[:id])\n if user \n user.name = params[:name]\n user.surname = params[:surname]\n user.role_id = params[:role_id]\n user.phone = params[:phone]\n user.job = params[:job]\n user.email = params[:email]\n user.adress = params[:adress]\n user.confirmed = params[:confirmed]\n user.save\n render json: user, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "488fbded3c7b2d58be882d2aa457befb",
"score": "0.6791412",
"text": "def update\n @user = User.find(params[:id])\n @user.name= params[:user][:name]\n @user.email = params[:user][:email]\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { render :json => @user }\n end\n\n end",
"title": ""
},
{
"docid": "4dcb9429c1396178cff3eed0c55252a1",
"score": "0.6784876",
"text": "def update\n current_user.update!(user_params)\n render json: current_user\n end",
"title": ""
},
{
"docid": "d190f524c5924d87588ecb666cbf5cc4",
"score": "0.6768373",
"text": "def update\n @user = User.find(params[:id])\n \n if @user.update(user_params)\n render json: @user, status: :ok \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8cade912083e3e018feeeaaf930f4cf1",
"score": "0.676715",
"text": "def update_user id, payload\n\t\t\t\t\t(@connection.put USERS, id, payload).code\n\t\t\t\tend",
"title": ""
},
{
"docid": "018e1818e03cc3d12f1b20effb2bc0a8",
"score": "0.6761313",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "018e1818e03cc3d12f1b20effb2bc0a8",
"score": "0.6761313",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "018e1818e03cc3d12f1b20effb2bc0a8",
"score": "0.6761313",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "08157edea9cb74ae2a3906e7f885a93d",
"score": "0.6758149",
"text": "def update \n @user = User.find(params[:id])\n if @user.update_attributes(user_params) \n render json: @user, status: :updated\n else \n render json: @user.errors, status: :unprocessable_entity \n end \n end",
"title": ""
},
{
"docid": "ef6c6cbfc7de8fe531f74bc52240477b",
"score": "0.67570984",
"text": "def update\n user = User.find(params[:user][:user_id])\n params[:user].delete(:user_id)\n user.update(update_params)\n render json: { message: 'user updated' }\n end",
"title": ""
},
{
"docid": "999ac837f35b530d4bd762c41f60ff19",
"score": "0.67475224",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "063187b2898d88021d86c92b397ed77c",
"score": "0.6732597",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(resource_params)\n render json: @user, status: :created, location: user_url(@user)\n else\n render json: {\n errors: @user.errors\n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8a4badd6a01a0bcfec7ca6e8d84e14bf",
"score": "0.67323476",
"text": "def update\n\t\tuser_id = params[:id]\n\t\t@user = User.find(user_id)\n\t\tif @user.update(user_params)\n\t\t\trender json: @user\n\t\telse\n\t\t\trender json: {\n\t\t\t\terror: {\n\t\t\t\t\tmessage: @user.errors.full_messages.to_sentence\n\t\t\t\t}\n\t\t\t}\n\t\tend\n end",
"title": ""
},
{
"docid": "29ffafd0a884c0baaf0c44106d79b94e",
"score": "0.67277527",
"text": "def update\n if @user.update(user_params)\n render json: @user \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "52120d456f84e9bcd29d003142e95e92",
"score": "0.6722102",
"text": "def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: user, status: :ok\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "2dc50f32a6a1be907e61d6655f19f1ba",
"score": "0.67097217",
"text": "def update\n user = User.find(params[:id])\n user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a0d52b546f97d92c94f2906309376f8b",
"score": "0.6687499",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { errors: @user.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f2311cf292680016035c4213cc419c6d",
"score": "0.6687018",
"text": "def update_user(id, options)\n patch(\"/users/#{id}\", options)\n end",
"title": ""
},
{
"docid": "85554d9b1b0279f5b254674ca18b848d",
"score": "0.6681372",
"text": "def update\n user = current_user\n\n if user.update(user_params)\n render json: user, status: 200, location: [:api, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "b669a7cf098d6fee10b940cf572f5fb0",
"score": "0.66730917",
"text": "def update\n username = Username.new(username_params)\n username.update\n render json: username\n end",
"title": ""
},
{
"docid": "c5694c8d217cc016ffb3ea0daa9befc5",
"score": "0.6669934",
"text": "def update( params={ })\n normalize! params\n filter! DEFAULT_USER_OPTIONS, params\n\n put_request(\"/1.0/user\", DEFAULT_USER_OPTIONS.merge(params))\n\n end",
"title": ""
},
{
"docid": "b8dcd2491b197c0c62a8f6716a37c05a",
"score": "0.6667268",
"text": "def update\n # Atualiza as informações o usuário\n \tif @user.update(users_params) \n \t\trender json: :success, status: 200\n \telse\n \t\trender json: @user.errors, status: :unprocessable_entity\n \tend\n end",
"title": ""
},
{
"docid": "25b787bcfdea3803945cd20447f2f4bb",
"score": "0.66671634",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render :json => @user.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f372faa6dbb1d6bc23f764dc3d392f5f",
"score": "0.66617274",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fc0f39f918df73dd51cfeaa86b3a4b50",
"score": "0.6654586",
"text": "def update\n # retrieve user data from request (params)\n email = params[:email]\n\n # query DB for the specific user \n user = User.where(:email => email)\n\n @user = user.update(user_params) #update the user \n json_response(@user) # return created user, to signify that the user was updated\n end",
"title": ""
},
{
"docid": "0df19676c7bc4da905ce423b3a17f004",
"score": "0.6653578",
"text": "def update\n if @user.update(user_params)\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0df19676c7bc4da905ce423b3a17f004",
"score": "0.6653578",
"text": "def update\n if @user.update(user_params)\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "257b82e17e5b1f88db9df740805e6185",
"score": "0.6652782",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { status: 400, msg: 'Something went wrong' }\n end\n end",
"title": ""
},
{
"docid": "224d657a0871919d0f25b180f9c2446d",
"score": "0.6646385",
"text": "def update\n respond_with User.update(params[:id], params[:user])\n end",
"title": ""
},
{
"docid": "f2232536d3cf1f3f02bc5b90475f4ef0",
"score": "0.6636416",
"text": "def update\n authorize @user\n\n if @user.update(user_params)\n render json: { status: :ok, user: @user }\n else\n render json: { errors: @user.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "ee5a6d46ae0ee543c53228f424ad8451",
"score": "0.6627491",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "691e3bde861cbda7d0bb533fcbb31672",
"score": "0.6625279",
"text": "def update\n user = User.find(params[:id])\n if user.update(params_user)\n render json: user, status: 200\n else\n render json: user.errors, status: 422\n end\n\n end",
"title": ""
},
{
"docid": "bb6685f93098d590da8a15e2e3160b60",
"score": "0.6621819",
"text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "a07e54b88d6350f77a698b6a706b1572",
"score": "0.66213304",
"text": "def update\n\t\tif @user.update(user_params)\n\t\t\trender json: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cd5963d908b40b1b87884d30b85d7a1e",
"score": "0.661804",
"text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api, user]\n else\n failed_to_update(user, \"user\")\n end\n end",
"title": ""
},
{
"docid": "f2f8c20b7eef84bb400714fdc59a8b0e",
"score": "0.66176337",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:User])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f40637d728484ec41ef659e304a15a44",
"score": "0.6614916",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f40637d728484ec41ef659e304a15a44",
"score": "0.6614916",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ef86e31e230f2cf2499d83448f680ebc",
"score": "0.661172",
"text": "def update\n respond_with User.update(params[:id],params[:user])\n end",
"title": ""
},
{
"docid": "80e7b0afa5cc4038fef85a7d7967666c",
"score": "0.66096765",
"text": "def update\n @user = User.find(params[:id])\n\t\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1efa38cd3f293b88dcc2c6766709ede9",
"score": "0.66087455",
"text": "def update\n @user = User.find(params[:id])\n @user.update(user_params)\n if @user.save\n render json: @user, status: :accepted\n else\n render json: { errors: @user.errors.full_messages }, status: :unprocessible_entity\n end\n end",
"title": ""
},
{
"docid": "d002d44210be9632166f45081da464a5",
"score": "0.6607135",
"text": "def update\n @user.update(user_params)\n if @user.errors.any? \n render json: @user.errors, status: :unprocessable_entity\n else \n render json: @user, status: 201\n end \n end",
"title": ""
},
{
"docid": "0c1d88a6a4cf4a5aff00bdd4b67eed08",
"score": "0.6591768",
"text": "def update\n if @user.update(user_params)\n render(json: @user.as_json, status: :ok) \n else\n render(json: {error: \"Erro ao atualizar usuário\"}, status: :ok) \n end\n end",
"title": ""
},
{
"docid": "7343e1d74a3d2f17fb1c4621860bce96",
"score": "0.65895",
"text": "def update\n if @user.update(user_params)\n render json:@user, status: :ok, serializer: UserSerializer\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7343e1d74a3d2f17fb1c4621860bce96",
"score": "0.65895",
"text": "def update\n if @user.update(user_params)\n render json:@user, status: :ok, serializer: UserSerializer\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f76cfbf4fd1722162b7a9e96fe471b14",
"score": "0.6588285",
"text": "def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: { status: 200, msg: 'User details have been updated.' }\n end\n end",
"title": ""
},
{
"docid": "48c8f2e79ce951be44e74f43cd9ecf3b",
"score": "0.6585606",
"text": "def update\n @user = User.find(params[:id]) # for practice assessment, no update method \n if @user.update(user_params) # but you have to build it yourself\n redirect_to user(@user) # know the difference between create and update \n else\n render json:@user.errors.full_messages, status: unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cd593b8d281f9ba376a1bc786702fe2f",
"score": "0.6581255",
"text": "def update(*args)\n arguments(args) do\n permit VALID_USER_PARAMS_NAMES\n end\n\n patch_request(\"/user\", arguments.params)\n end",
"title": ""
},
{
"docid": "2963118f3ea04813a21d6d6a6bf0d05f",
"score": "0.6580528",
"text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update(user_update_params)\n format.json { render json: @user, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96d6039ed862a309382ea5a83efcec51",
"score": "0.6570835",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.json { render @user, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8883f8815a6b9292435769a8a84d49f6",
"score": "0.65678954",
"text": "def update\n @user = User.patch(params[:id], params[:user])\n respond_with(@user)\n end",
"title": ""
},
{
"docid": "d93b3aa6659ae62851c0e2c5b2aff72c",
"score": "0.656618",
"text": "def update\n @user_1 = User1.find(params[:id])\n\n respond_to do |format|\n if @user_1.update_attributes(params[:user_1])\n format.html { redirect_to @user_1, notice: 'User 1 was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0726961d8a40f7ef0082defff7e07181",
"score": "0.6562387",
"text": "def update\n @user = User.find(params[:id])\n\n if params[:tag] != nil\n @user.tag = params[:tag]\n @user.save\n end\n\n if params[:name] != nil\n if User.where(\"name = ?\", params[:name]).first == nil\n @user.name = params[:name]\n @user.save\n end\n\n respond_to do |format|\n format.html { render json: @user }\n format.json { render json: @user }\n end\n end\n end",
"title": ""
},
{
"docid": "adfff4175048d9c7f39b404371ccdaa6",
"score": "0.6560061",
"text": "def update\n @user = User.friendly.find(params[:id])\n # render json: @user\n # render json: params\n # render json: user_params\n # render json: params['user']\n\n respond_to do |format|\n if @user.update(user_params)\n @user.name = \"#{@user.first_name} #{@user.last_name}\"\n @user.slug = nil\n @user.save!\n format.html { redirect_to user_path(@user), notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84d001a77df4c6c16e42ac2b0f89b9c6",
"score": "0.6552784",
"text": "def update\n update_and_respond(@user, user_params)\n end",
"title": ""
},
{
"docid": "748ea080c08e00cbdc2f345f8393af81",
"score": "0.65518224",
"text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"title": ""
},
{
"docid": "67f08b8d6f982f4805b13cd8d6b1e2c1",
"score": "0.65491796",
"text": "def update\n @user.name = params[:user][:name]\n @user.email = params[:user][:email].downcase\n @user.nickname = params[:user][:nickname]\n\n respond_to do |format|\n if @user.update\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fbdfe5c2d8dc0cf9b6a2bc65f049e93",
"score": "0.6545136",
"text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_to do |format|\n format.html\n format.js\n format.json { render :json => @users }\n end\n end",
"title": ""
},
{
"docid": "0fd24b7eb0a8328a3ded207dd05ca359",
"score": "0.65374637",
"text": "def update\n @user = User.find_by_sim_serial_number(params[:id])\n\n params = user_params\n params.delete_if {|k,v| !params[k].present?}\n\n if @user.update(params)\n render json: @user\n .to_json(only: [:id, :sim_serial_number, :username, :role, :phone_number, :email, :first_name, :last_name, :address, :cached_votes_up, :cached_votes_down])\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6530534",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6530534",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6530534",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6530534",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6530534",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f97b9af2d44b331cfb3d2025b2c29702",
"score": "0.6523527",
"text": "def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "582a4114e6a316d15f1cf1f545eb22d5",
"score": "0.6519265",
"text": "def update\n @user = User.find(session[:user_id])\n @user.update(user_params)\n render :json => @user\n end",
"title": ""
},
{
"docid": "18f12a44d2646af9dc7f75ae3e4b8b0e",
"score": "0.65189654",
"text": "def update\n @user.update(user_params)\n head :no_content\n end",
"title": ""
},
{
"docid": "03317a83bf1cd4ed4e1e182144ce524e",
"score": "0.65120107",
"text": "def update\n if @user.update_attributes(user_params)\n head :no_content, status: 200\n end\n end",
"title": ""
},
{
"docid": "c31cddefe755689a414c32259c1602fe",
"score": "0.6509967",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { error: @user.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6e330994c9e2d5c3f2ffe71077b0f26b",
"score": "0.6493632",
"text": "def update\n params.permit!\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User #{@user.name} was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c54a2b6c1d4b8ac5c8b393c83bf8043f",
"score": "0.64920384",
"text": "def update\n @user = User.get(params[:id])\n \n respond_to do |format|\n if @user.update(params[:user])\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n else\n format.json { render :text => \"Could not update user\", :status => :unprocessable_entity } \n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74870cc0f50d816f3c4d728651fe7d3e",
"score": "0.6479132",
"text": "def update\n\t user = User.find(params[:id])\n\t if user.update(user_params)\n\t render json: { status: 200, msg: 'User details have been updated.' }\n\t end\n\tend",
"title": ""
},
{
"docid": "a0b2e460320b934ac4d9a3d77a5fa079",
"score": "0.6479048",
"text": "def update\n if @user.update(user_params)\n \trender :json => @user, status: :created\n else\n \trender :json => @user.errors.as_json(full_messages: true), status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ca5a9b4918333eb8cfd2505d5f1391c4",
"score": "0.6476941",
"text": "def update\n @user = User.find(params[:id])\n if current_user != @user\n respond_to do |format|\n format.json { render json: {}, status: :forbidden }\n end\n return\n end\n @user.update!(user_params)\n respond_to do |format|\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "2783f0a71c40a342f49a3bbc7fd8f1db",
"score": "0.6469628",
"text": "def update_user(id, options={})\n payload = {user: options}\n request = put \"/1/users/#{id}\", payload\n Hashie::Mash.new request\n end",
"title": ""
},
{
"docid": "10515feb4bbf952534156179641733d7",
"score": "0.64681506",
"text": "def update\n @user.update(user_params)\n render json: { notice: 'Usuario actualizado exitosamente' }\n end",
"title": ""
},
{
"docid": "84c54b6cbf328b20e141f5ad495a7e3c",
"score": "0.64680237",
"text": "def create\n @user = current_api_v1_user\n if @user.update(user_params)\n render json: index\n else\n render json: { status: 400, message: 'Could not update profile' }\n end\n end",
"title": ""
},
{
"docid": "302fd13d7fd5b632d7924e0c6a21e2fd",
"score": "0.6467437",
"text": "def update_user(options)\n patch \"user\", options\n end",
"title": ""
},
{
"docid": "d25a98492709b07b6951f4fdabc78603",
"score": "0.646332",
"text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(users_url, notice: \"User #{@user.name} was successfully updated.\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fad9f9a5663ff3109aa1ca711458461e",
"score": "0.64552915",
"text": "def user_update(username,options)\n make_request(:update,user_url(username),options)\n end",
"title": ""
},
{
"docid": "4ca1914328cc71b605f6951f6b137fb1",
"score": "0.6449248",
"text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\nend",
"title": ""
}
] |
e44c10f911531f88d2232bb51f5aa58a
|
GET /conges/1 GET /conges/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "7039486a6d4738672720a0a274f1f5ab",
"score": "0.6857474",
"text": "def index\n @conges = Conge.all\n end",
"title": ""
},
{
"docid": "379ac40af1b4dffb8b1f9480b3da8ca8",
"score": "0.6386985",
"text": "def show\n @con = Con.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @con }\n end\n end",
"title": ""
},
{
"docid": "229e90929026a813fe6f7a130e3f67cf",
"score": "0.6327302",
"text": "def index\n @convos = Convo.all\n render json: @convos\n end",
"title": ""
},
{
"docid": "c0e8539c32054f76726ffd497440930f",
"score": "0.62835866",
"text": "def show\n @goconcert = Goconcert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @goconcert }\n end\n end",
"title": ""
},
{
"docid": "2988a938068b403c89b7eaeaeebbe7af",
"score": "0.6234494",
"text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concert }\n end\n end",
"title": ""
},
{
"docid": "2988a938068b403c89b7eaeaeebbe7af",
"score": "0.6234494",
"text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concert }\n end\n end",
"title": ""
},
{
"docid": "06c9ce31988484422b7c6bbac88ca36c",
"score": "0.6199914",
"text": "def index\n render json: Concierge.where(stay_id: params[:stay_id])\n end",
"title": ""
},
{
"docid": "1bb4006362489b157306ff5d9c207c1e",
"score": "0.61988366",
"text": "def index\n @connections = current_user.connections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @connections }\n end\n end",
"title": ""
},
{
"docid": "c099f1d7501b2d606453d5da2fc1fdd4",
"score": "0.61884934",
"text": "def index\n @concesses = Concess.all.order(:created_at)\n render json: @concesses\n end",
"title": ""
},
{
"docid": "3b250cc49b9b48532e5c11e19cc9efa4",
"score": "0.61859554",
"text": "def show\n @condo = Condo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condo }\n end\n end",
"title": ""
},
{
"docid": "3391527f87f64dd379570730a8ca17ae",
"score": "0.6175143",
"text": "def index\n @conductors = Conductor.all\n render :json => @conductors\n end",
"title": ""
},
{
"docid": "8d71d3ca198cce8b3b8e4a188d0a81ab",
"score": "0.61553603",
"text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @concert }\n end\n end",
"title": ""
},
{
"docid": "c39e743cb80f0c03229c714b5f968cb8",
"score": "0.6137519",
"text": "def show\n @collection_connection = CollectionConnection.find(params[:id])\n\n render json: @collection_connection\n end",
"title": ""
},
{
"docid": "8e1abd1795c29bc436d5ced01a91a98d",
"score": "0.6117777",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend",
"title": ""
},
{
"docid": "7828499b659774071e431998b094d573",
"score": "0.6095492",
"text": "def show\n @conversazione = Conversazione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversazione }\n end\n end",
"title": ""
},
{
"docid": "33f0fd4af51aa3ae87dada22c67df8ee",
"score": "0.6087631",
"text": "def index\n\t\tquery = params[:name]\n \t@clients = Client.ci_where('name', query)\n \trender json: @clients\n end",
"title": ""
},
{
"docid": "c005817a26c9e7f89e3062e951dcab32",
"score": "0.6071275",
"text": "def index\n @cages = Cage.where(query_params)\n render json: @cages\n end",
"title": ""
},
{
"docid": "9785a53787d06159ccfe514704dbb332",
"score": "0.6048544",
"text": "def show\n @congregacion = Congregacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @congregacion }\n end\n end",
"title": ""
},
{
"docid": "9dbf5fb2a97b4f327febb0800f2385d4",
"score": "0.6045149",
"text": "def show\n @convo = Convo.find_by(id: params[:id])\n render json: @convo\n end",
"title": ""
},
{
"docid": "8e8fccfa1de91b21649883246b0e8ba9",
"score": "0.60342336",
"text": "def get_detail\n render :json => ClientCertification.find(params[:id])\n end",
"title": ""
},
{
"docid": "14951277a5e6edfa021adf16904a0b05",
"score": "0.60313714",
"text": "def get(path)\n JSON.parse(@consul_host.get(\"/#{CONSUL_VERSION}/#{path}\").body)\n end",
"title": ""
},
{
"docid": "79a4d3097a5cc5e23c7e251885c50e64",
"score": "0.6020812",
"text": "def index\n @congties = Congty.paginate(:page => params[:page]).order('tenct ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @congties }\n end\n end",
"title": ""
},
{
"docid": "553de7ba39755d4dda912801b95dd961",
"score": "0.5963442",
"text": "def info\n CouchRest.get \"#{@uri}/\"\n end",
"title": ""
},
{
"docid": "10c54dd62ea6b47b5b8f6515f4d7c0cc",
"score": "0.5941141",
"text": "def getCounchDBData \n url = URI.parse(\"http://con.iriscouch.com/_utils/\") \n server = Couch::Server.new(url.host, url.port) \n res = server.get(\"/conferences/count\") \n json = res.body \n json = JSON.parse(json) \nend",
"title": ""
},
{
"docid": "0e6618cc070555e9bbee40ccb8764e02",
"score": "0.5921228",
"text": "def show\n @congty = Congty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @congty }\n end\n end",
"title": ""
},
{
"docid": "521d2d619fc768cf5888210268be00b5",
"score": "0.5892901",
"text": "def my_pet_pros \n @person = Person.find(params[:person_id])\n @pro_connections = @person.person_connections.where(:category => ['Dog Walk Client', 'Groomer Client', 'Boarding Client', 'Veterinary Client'])\n @clients = []\n @pro_connections.each do |pc|\n @clients << Person.find(pc.person_b_id)\n end\n logger.debug(\"@clients.size = #{@clients.size}\")\n\n render json: {:person => @person, :clients => @clients }, :layout => false\n end",
"title": ""
},
{
"docid": "c0ffa931d98d5ce1e2041a93d545d9ea",
"score": "0.58906853",
"text": "def index\n @clients = Client.all\n\n render json: @clients\n end",
"title": ""
},
{
"docid": "11367d36e4c90c8a0de89176b3b870a4",
"score": "0.58775544",
"text": "def index\n @clients = current_user.clients\n render json: @clients\n end",
"title": ""
},
{
"docid": "aa4cb0368db3bd8b8f4425c85893eac2",
"score": "0.5877212",
"text": "def show\n @connection = Connection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @connection }\n end\n end",
"title": ""
},
{
"docid": "5e9fa03ad0f82507abd24decbd655024",
"score": "0.5871458",
"text": "def show\n @client = Client.where(:id => params[:id]).first\n if @client.nil?\n render json: '', status: :gone\n return\n end\n\n authorize! :read, @client\n\n render json: get_json(@client.serialize_references)\n end",
"title": ""
},
{
"docid": "a573e4b028012e3999e3b0f80d068377",
"score": "0.58670855",
"text": "def show\n @consumidor = Consumidor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consumidor }\n end\n end",
"title": ""
},
{
"docid": "2cb7d8771f5bb3e27929c3d911f8b621",
"score": "0.58408624",
"text": "def index\n @clients = User.find(current_user.id).clients\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients } \n end\n end",
"title": ""
},
{
"docid": "373172abf9130f962b43e0594b1c5f22",
"score": "0.5815675",
"text": "def show\n @concertsuser = ConcertsUser.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @concertsuser }\n end\n end",
"title": ""
},
{
"docid": "2bdf9bc9e23a44f3ca97397d40dc7ffe",
"score": "0.58086365",
"text": "def index\n @councils = Council.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @councils }\n end\n end",
"title": ""
},
{
"docid": "9adf822a9513072109be1d8dceabdcd1",
"score": "0.58038247",
"text": "def show\n @concession = Concession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concession }\n end\n end",
"title": ""
},
{
"docid": "d144515f40616fcd4071bc6074af11d5",
"score": "0.5796246",
"text": "def index\n @clientes = Cliente.all\n render json: @clientes\n end",
"title": ""
},
{
"docid": "c019514688050937d9bd66c9eae292a7",
"score": "0.5789108",
"text": "def index\n @clientes = Cliente.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clientes }\n end\n end",
"title": ""
},
{
"docid": "8b19c1d4fc777fb74bdac85bd75ee1e3",
"score": "0.577779",
"text": "def index\n @api_v1_badges = Api::V1::Badge.all\n end",
"title": ""
},
{
"docid": "c63d01cc01f0073cce98ca85347cb7b7",
"score": "0.57775754",
"text": "def info\n CouchRest.get \"#{@uri}/\"\n end",
"title": ""
},
{
"docid": "e20cb5d393eed5c1f06427d628bcdeff",
"score": "0.5776647",
"text": "def index\n # @composers = Composer.all\n @composers = @category.composers \n\n render json: @composers \n end",
"title": ""
},
{
"docid": "a5ab191e08f7d1efba591714ff33822b",
"score": "0.5775438",
"text": "def info\n CouchSpring.get \"#{uri}/\"\n end",
"title": ""
},
{
"docid": "3f2bc1b7b9e5e7bd6d50024a6c5e51a0",
"score": "0.5775008",
"text": "def show\n @badges_scout = BadgesScout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @badges_scout }\n end\n end",
"title": ""
},
{
"docid": "b8cbeeb9a014a87e2a5af794c4fc3294",
"score": "0.57742983",
"text": "def index\n puts 'about to get all crimes'\n @crimes = Crime.all\n puts 'finished with crimes'\n @crimes.to_json\n end",
"title": ""
},
{
"docid": "33ac6b3fba5ad8ce226ec63c5efea4a5",
"score": "0.57721907",
"text": "def show\n @connection = Connection.find(params[:id])\n\n respond_to do |format|\n# format.html # show.html.erb\n format.json { render json: @connection }\n end\n end",
"title": ""
},
{
"docid": "64cbd1b2682636e7f520612565d71662",
"score": "0.5766898",
"text": "def index\n @clients = Client.where(user_id: current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"title": ""
},
{
"docid": "9a746ad62d24844353e22eacc1e40ce4",
"score": "0.5764631",
"text": "def index\n @cones = Cone.all\n end",
"title": ""
},
{
"docid": "0a6b74780bd02ea789b137effa5e95c9",
"score": "0.576259",
"text": "def show\n @name_concert = NameConcert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @name_concert }\n end\n end",
"title": ""
},
{
"docid": "877f75dab60d86dedb547dd72e9a16a7",
"score": "0.5746361",
"text": "def show\n @procon = Procon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @procon }\n end\n end",
"title": ""
},
{
"docid": "6133c6e5391c9a23eb3e63272fc0b343",
"score": "0.57427454",
"text": "def index\n @cgus = Cgu.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cgus }\n end\n end",
"title": ""
},
{
"docid": "74dfd66739d440d87ebb4cfe9f622695",
"score": "0.5736606",
"text": "def caverne\n self.class.get('/monstre_caverne.json')\n end",
"title": ""
},
{
"docid": "fd9ebcc697fb371b778f6ad375009c71",
"score": "0.5734689",
"text": "def get_all_apps_with_categories \n get(\"/appcon.json/\")\nend",
"title": ""
},
{
"docid": "b93b2c12f8de7c7dba26ddbdf70ecc2e",
"score": "0.57296854",
"text": "def index\n @counselors = Counselor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @counselors }\n end\n end",
"title": ""
},
{
"docid": "db4507a55bf39ff3e173a6c1e1347f31",
"score": "0.5724998",
"text": "def for_camp\n puts \"COUNSELOR FOR CAMP - #{params.inspect}\"\n @counselor = Counselor.find_by_camp_id(params[:camp_id])\n respond_to do |format|\n format.json { render json: @counselor }\n end\n end",
"title": ""
},
{
"docid": "e18eb38522d3864677f2d3404db73210",
"score": "0.5722521",
"text": "def set_conge\n @conge = Conge.find(params[:id])\n end",
"title": ""
},
{
"docid": "06443b5a7e002b7717fdab58628ad43b",
"score": "0.5717731",
"text": "def index\n @cocktails = Cocktail.all\n #render json: @cocktails\n end",
"title": ""
},
{
"docid": "d418c9d86878680532dbdf72e2ac5d0d",
"score": "0.5715594",
"text": "def index\n get_clients\n end",
"title": ""
},
{
"docid": "a529c1389f6445b472c49562bb63ffae",
"score": "0.5709923",
"text": "def show\n @cage = Cage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cage }\n end\n end",
"title": ""
},
{
"docid": "1defcbff000b893f8c7809f89e4428b6",
"score": "0.57061553",
"text": "def show\n @concert = Concert.find(params[:id])\n\trespond_with @concert\n end",
"title": ""
},
{
"docid": "fd1a2af1e62aaf49bce4570518f5cb2d",
"score": "0.5705011",
"text": "def index\n @coins = Coin.all\n render json: @coins\n end",
"title": ""
},
{
"docid": "97ae08b9041304c1aaa5d0de04309248",
"score": "0.57041705",
"text": "def get_applications_by_category(args = {}) \n get(\"/clients.json/stats/category\", args)\nend",
"title": ""
},
{
"docid": "bc98ff2e683c566b944791f94ec9cba1",
"score": "0.57038903",
"text": "def index\n @concerts = Concert.all\n end",
"title": ""
},
{
"docid": "bc98ff2e683c566b944791f94ec9cba1",
"score": "0.57038903",
"text": "def index\n @concerts = Concert.all\n end",
"title": ""
},
{
"docid": "a0cfed2bb43037dc7b70dfeab1a65395",
"score": "0.5692319",
"text": "def show\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coment }\n end\n end",
"title": ""
},
{
"docid": "a0cfed2bb43037dc7b70dfeab1a65395",
"score": "0.5692319",
"text": "def show\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coment }\n end\n end",
"title": ""
},
{
"docid": "c7725222cd59e4ba95fb9f8b5349c652",
"score": "0.5686858",
"text": "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"title": ""
},
{
"docid": "c7725222cd59e4ba95fb9f8b5349c652",
"score": "0.5686858",
"text": "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"title": ""
},
{
"docid": "c7725222cd59e4ba95fb9f8b5349c652",
"score": "0.5686858",
"text": "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"title": ""
},
{
"docid": "1a6389f2ed32a2e3fc32a05f54b3a3de",
"score": "0.56793296",
"text": "def index\n @collages = Collage.order(\"created_at DESC\").all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @collages }\n end\n end",
"title": ""
},
{
"docid": "726f6d684241da1527f0dd30ff26bd79",
"score": "0.56665677",
"text": "def index\n @config1s = Config1.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @config1s }\n end\n end",
"title": ""
},
{
"docid": "b31695038e29f533d478527a0f1694db",
"score": "0.5666041",
"text": "def index\n @badges = Badge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges }\n end\n end",
"title": ""
},
{
"docid": "cebef86fb1c0735e79d534311750c6c7",
"score": "0.56642026",
"text": "def show\n @curly = Curly.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curly }\n end\n end",
"title": ""
},
{
"docid": "df84a2267dafc5254ed9cd6b5de0256f",
"score": "0.5661821",
"text": "def index\n @connections = Connection.all\n respond_with(@connections)\n end",
"title": ""
},
{
"docid": "c188204e2896acb9ecbe54058eaa515f",
"score": "0.56564355",
"text": "def index\n @chores = Chore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chores }\n end\n end",
"title": ""
},
{
"docid": "362dad29e24fddde02abc845e1f86569",
"score": "0.56559616",
"text": "def show\n @breadcrumb = 'read'\n @complaint_status = ComplaintStatus.find(params[:id])\n @complaints = @complaint_status.complaints.by_no\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint_status }\n end\n end",
"title": ""
},
{
"docid": "30afb1360ccd49ab9af28538fedf0da9",
"score": "0.5655109",
"text": "def index\n @con_vets = ConVet.all\n end",
"title": ""
},
{
"docid": "efb294f4388b1f1edb2318d03b57de66",
"score": "0.56543905",
"text": "def show\n @connectiontype = Connectiontype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @connectiontype }\n end\n end",
"title": ""
},
{
"docid": "1fbab3f860e20810d8b675cb7f98e035",
"score": "0.5649442",
"text": "def index\n @concerts = Concert.all\n @user = User.find_by_id(params[:format])\n end",
"title": ""
},
{
"docid": "fc7bc2577decb95c50b312279039b90f",
"score": "0.5646146",
"text": "def show\n @chocolatier = Chocolatier.find(params[:id])\n @chocolates = Chocolate.find_all_by_chocolatier_id(@chocolatier.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chocolatier }\n end\n end",
"title": ""
},
{
"docid": "29ee532f706d649c1727651c525de459",
"score": "0.56432074",
"text": "def index\n render json: client.list\n end",
"title": ""
},
{
"docid": "766bbd1e6cd9047fac0bdf3bec54c612",
"score": "0.5635498",
"text": "def fromage\n @produits = Produit.find_all_by_id_cat (1)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end",
"title": ""
},
{
"docid": "30bdd9412ef2949d9d77bbe390686f65",
"score": "0.5633627",
"text": "def index\n @cites = Cite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cites }\n end\n end",
"title": ""
},
{
"docid": "5c20fdfe7d8d87c51225f3da410d112d",
"score": "0.56252754",
"text": "def show\n @concourse = Concourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concourse }\n end\n end",
"title": ""
},
{
"docid": "656cb8e53a06a0fe0e157fcf85d6cfe5",
"score": "0.5624009",
"text": "def show\n @coin = Coin.find(params[:id])\n render json: @coin\n end",
"title": ""
},
{
"docid": "6b6620f8689b7940fceba617d6f98a81",
"score": "0.56233",
"text": "def index\n @climbers = Climber.all\n\n render json: @climbers\n end",
"title": ""
},
{
"docid": "e9e961b63105e47006a70571f12f6c32",
"score": "0.56222653",
"text": "def show\n @consignado = Consignado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consignado }\n end\n end",
"title": ""
},
{
"docid": "97750def90019b1325e45eb5b64db360",
"score": "0.56191313",
"text": "def index\n @badges = Badge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges.to_json }\n end\n end",
"title": ""
},
{
"docid": "334d97fd56c67961ccba150060ea518c",
"score": "0.5619024",
"text": "def show\n @connection_category = ConnectionCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @connection_category }\n end\n end",
"title": ""
},
{
"docid": "1945f36528d833e24d02acb7c3d412f0",
"score": "0.5617704",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\n end",
"title": ""
},
{
"docid": "31031c01e68a92c93c4cb0575766b78b",
"score": "0.56154853",
"text": "def show\n\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comic }\n end\n end",
"title": ""
},
{
"docid": "2edc7867bdfeb1f39d766edd7356658f",
"score": "0.56108445",
"text": "def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"title": ""
},
{
"docid": "97fd7dca5149b67249f0e2df86c1607b",
"score": "0.5603383",
"text": "def index\n @connections = params[:ids].present? ? Connection.where(id: params[:ids].split(',')) : Connection.order(\"user_id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @connections }\n end\n end",
"title": ""
},
{
"docid": "d9a1f8698e02fc5375052370f3d92d70",
"score": "0.559453",
"text": "def show\n @counselor = Counselor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @counselor }\n end\n end",
"title": ""
},
{
"docid": "a213135f274ce6ebaeab0f98c93aa87a",
"score": "0.55926156",
"text": "def show\n @convenio = Convenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @convenio }\n end\n end",
"title": ""
},
{
"docid": "5d3dfb1dea0c0c31122717b5dc6773b1",
"score": "0.5591474",
"text": "def show\n @conjugation = Conjugation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conjugation }\n end\n end",
"title": ""
},
{
"docid": "d866928f3b66cbec5f2f10b79fd51ecc",
"score": "0.55905175",
"text": "def index\n @cryps = Cryp.all\n #require 'net/http'\n #require 'json'\n\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_cryps = JSON.parse(@response)\n end",
"title": ""
},
{
"docid": "34d0e6291e27491054aa87f106ea440a",
"score": "0.55897516",
"text": "def show\n @breadcrumb = 'read'\n @water_connection_contract = WaterConnectionContract.find(params[:id])\n @water_connection_contract_items = @water_connection_contract.water_connection_contract_items.paginate(:page => params[:page], :per_page => per_page).order('id')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @water_connection_contract }\n end\n end",
"title": ""
},
{
"docid": "d503333cac06d92ccbc313f86e2f8f19",
"score": "0.55780727",
"text": "def show\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curso }\n end\n end",
"title": ""
},
{
"docid": "b5eb7d53fc652e4acf9723af66a14e9d",
"score": "0.5577165",
"text": "def show\n @carpool = Carpool.find(params[:id])\n render json: @carpool, status: 200\n end",
"title": ""
},
{
"docid": "b5a8036e25c77c3c93cd0e13df85eacd",
"score": "0.55760133",
"text": "def index\n @colleges = College.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colleges }\n end\n end",
"title": ""
},
{
"docid": "8cceb8b0fbc82a2e50bd2eb542520a86",
"score": "0.55757725",
"text": "def show\n @contum = Contum.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contum }\n end\n end",
"title": ""
},
{
"docid": "c494f29f7bc8f755faa481b8ecc613a1",
"score": "0.55734557",
"text": "def index\n \t\t@concerts = Concert.where(user_id: @current_user.id)\n \tend",
"title": ""
}
] |
018f97d539ae15a76a74d74aaad21a5f
|
=== >Ajout d'un message dans le stack de BattleEngine ===
|
[
{
"docid": "9bac77049bd05dfee52d906d7a5d4eaf",
"score": "0.0",
"text": "def _mp(msg)\n ::BattleEngine._mp(msg)\n end",
"title": ""
}
] |
[
{
"docid": "b4e39ce441360889614c6db6972ab8e3",
"score": "0.7106952",
"text": "def add_message (text)\n @@message << text.to_s << \"\\n\"\n text.to_s\n end",
"title": ""
},
{
"docid": "46b7dc92f07f994fb244ed2da9d379b0",
"score": "0.6779331",
"text": "def set_message\n end",
"title": ""
},
{
"docid": "6d538882d42a35bfcc7f2e325d9fd82b",
"score": "0.67651904",
"text": "def set_message\n \n end",
"title": ""
},
{
"docid": "a0f96f2353b75beb3c1f8b48af397d64",
"score": "0.67516595",
"text": "def msg(message)\n end",
"title": ""
},
{
"docid": "44e15ed5ec3644ff63e8b8465c9004e3",
"score": "0.6747924",
"text": "def message(message); end",
"title": ""
},
{
"docid": "8c563f76fc8652a20d5f9e7e3ec8de82",
"score": "0.67237556",
"text": "def add (identifier)\n#puts identifier.to_s + '~~~'\n#puts Message.text(identifier).to_s + '****'\n @@message = @@message + Message.text(identifier).to_s + \"\\n\"\n#@message << identifier\n @@message\n end",
"title": ""
},
{
"docid": "ee03708e9acb233e2a29f3caa97e5991",
"score": "0.6720601",
"text": "def add_message( msg )\n @messages.unshift( msg )\n \n if @messages.length > MAX_MESSAGES\n @messages.pop\n end\n end",
"title": ""
},
{
"docid": "3352579f7fc26c4a332a740bd3edbbda",
"score": "0.6671998",
"text": "def msg(message); end",
"title": ""
},
{
"docid": "3352579f7fc26c4a332a740bd3edbbda",
"score": "0.6671998",
"text": "def msg(message); end",
"title": ""
},
{
"docid": "57ae2ce7c44bd53e75515356c3b2a81b",
"score": "0.6655898",
"text": "def add_message(message)\n @messages[message.id] = message unless message.nil?\n end",
"title": ""
},
{
"docid": "7da183e185916dc130fc8eb41d9d45db",
"score": "0.6649151",
"text": "def message(m)\n @messages << m\n end",
"title": ""
},
{
"docid": "f2d8e38cef304f9ed63e7e7d3a0f224d",
"score": "0.65925634",
"text": "def run\n # #insert_components is an instance-exec, so this won't be available\n # as an instance variable.\n m = @message\n\n environment.insert_components('/') do\n constant :message, m, :message\n end\n end",
"title": ""
},
{
"docid": "a3b87faeb005ea0443d6fae621fb284b",
"score": "0.65753424",
"text": "def add_message(content, user)\n Message.new(content, self, user)\n end",
"title": ""
},
{
"docid": "696e3bd261e9c10f337a781938766c92",
"score": "0.6562452",
"text": "def add_message(message)\n db.execute \"INSERT INTO messages (message) VALUES (?)\", [message]\n end",
"title": ""
},
{
"docid": "ae876a0df0030bb50e70a3a6e1ab2fda",
"score": "0.6553267",
"text": "def init_message\n\n end",
"title": ""
},
{
"docid": "eeee47a8e89767b54cab5077e0acea57",
"score": "0.6542951",
"text": "def add_to_message_queue(msg_type, sprite)\n @messages << \"#{msg_type}|#{sprite.uuid}|#{sprite.type}|#{sprite.sprite_image}|#{sprite.player}|#{sprite.x}|#{sprite.y}|#{sprite.angle}|#{sprite.points}|#{sprite.color}\"\n end",
"title": ""
},
{
"docid": "ecc8306968f5474e37922dbe9beeb87f",
"score": "0.6515607",
"text": "def create_message(data); end",
"title": ""
},
{
"docid": "406aabd2799c6aaf2de1875a21febbb5",
"score": "0.65058964",
"text": "def put_message text\n \tbuttons\n \t@message.text(text)\n \t@message.place(50,150, 500, 450)\n\n \tmessage_timer = TetrisTimer.new\n \tmessage_timer.start(400, (lambda { |x| @cover.place(50,150, 500, 450)}))\n end",
"title": ""
},
{
"docid": "ea9499818a47379dcd7322f1016666e2",
"score": "0.6461797",
"text": "def non_intrusive_message(msg)\n {\n message: {\n type: 1,\n text: msg\n }\n }\n end",
"title": ""
},
{
"docid": "7c0a2565bb33cf6a250ed6f068193768",
"score": "0.64611036",
"text": "def msg(message)\n output[:messages] << message\n end",
"title": ""
},
{
"docid": "73cfc0c391aaca552965f2374038272d",
"score": "0.64498335",
"text": "def new_message!(data)\n message = Message.new(data)\n message.container = self\n @messages[message.text] = message\n return message\n end",
"title": ""
},
{
"docid": "2fb7eb4c8d6fd69b6b6a2fde1867e328",
"score": "0.64285135",
"text": "def add(msg)\n @messages ||= []\n @messages << msg\n end",
"title": ""
},
{
"docid": "474af427f26c5cdf58bfaeef539f06c5",
"score": "0.6420886",
"text": "def message(type, message)\n if session[:messages].nil?\n session[:messages] = []\n end\n session[:messages] << { :type => type, :text => message }\n end",
"title": ""
},
{
"docid": "e98cc854d9d39ab07630174caafc3721",
"score": "0.64158285",
"text": "def add_message(field, message)\n @messages.push({field.to_sym => message})\n end",
"title": ""
},
{
"docid": "986ac54c9010d490cc65dd64291e9b83",
"score": "0.6369655",
"text": "def set_message(msg)\n @mesg = msg.to_str\n end",
"title": ""
},
{
"docid": "94b0b437a43ba1c140775debd3da116d",
"score": "0.63641566",
"text": "def add_to_message_list( symbol, message )\n session[:messages] = {} if ( session[:messages].nil? )\n session[:messages][symbol] = [] if (session[:messages][symbol].nil?)\n session[:messages][symbol] << message;\n end",
"title": ""
},
{
"docid": "9127ebcfc70c970b92eb6c1f217ac5ab",
"score": "0.6340343",
"text": "def message( message )\n\t\t#TODO: Send these messages to the player's console, puts for now\n\t\tputs message\n\tend",
"title": ""
},
{
"docid": "71c48b8ec016f984506f223c03dceaa4",
"score": "0.63389754",
"text": "def add(message)\n @messages << message\n end",
"title": ""
},
{
"docid": "5d13cc25c58221f2a7ee7daa110a2cc8",
"score": "0.6337284",
"text": "def add_message(message)\n post_data('/messages', { message: message })\n end",
"title": ""
},
{
"docid": "5dc52223ddca6131d32f8326c2b6f96e",
"score": "0.6319832",
"text": "def _msgp(*args)\n ::BattleEngine._msgp(*args)\n end",
"title": ""
},
{
"docid": "5dc52223ddca6131d32f8326c2b6f96e",
"score": "0.6319832",
"text": "def _msgp(*args)\n ::BattleEngine._msgp(*args)\n end",
"title": ""
},
{
"docid": "d99b6a5867be39c6c1a68cb0d6f8f0ca",
"score": "0.63121134",
"text": "def add_msg(msg, room)\n if room == :notice\n room = :current\n end\n dispatch(:display_line, msg, room)\n @window.room_append(room, msg)\n end",
"title": ""
},
{
"docid": "f84a9519c42d4b2e3c80810461779376",
"score": "0.628795",
"text": "def message(message)\n send_message(message)\n end",
"title": ""
},
{
"docid": "b800490b6d32d611e5e744272359b4fc",
"score": "0.62831473",
"text": "def add_message(hash)\n if hash['message']\n message = hash['message']\n if message.kind_of? String\n if is_command?(message)\n @service_manager.process_command(hash)\n\n elsif contains_bad_language?(message)\n message = filter_message(message)\n MESSAGES << message\n puts \"ChatManager: message: #{message}\".foreground(:yellow) if $debug\n else\n MESSAGES << message\n puts \"ChatManager: message: #{message}\".foreground(:yellow) if $debug\n end\n true\n end\n else\n false\n # raise ChatManager::MessageError\n end\n end",
"title": ""
},
{
"docid": "b1b136c0b912018e5b94eae8cf38ab89",
"score": "0.6274177",
"text": "def add_message(type, text, id=nil)\n @messages ||= []\n @messages.push({type: type, text: text, id: id})\n end",
"title": ""
},
{
"docid": "adf1f4a9f6b98116698868eabafaa632",
"score": "0.6270454",
"text": "def append_message\n component = MessageComponent.new(message: self)\n Rails.logger.debug(\"Append Message Message commited #{MessageChannel.channel_name}\")\n cable_ready[MessageChannel.channel_name].insert_adjacent_html(\n selector: dom_id(channel, :messages),\n html: render(component)\n )\n end",
"title": ""
},
{
"docid": "52a7da5866bc8f5fbc3259ba5607e48b",
"score": "0.62693703",
"text": "def message\n end",
"title": ""
},
{
"docid": "6dc5182df5c393971180e4d86d7cc311",
"score": "0.6264335",
"text": "def message text\n @message.value = text\n end",
"title": ""
},
{
"docid": "a32f7c876b4b2c9bb58cd9c67c0ebcb7",
"score": "0.62396616",
"text": "def add_message sender_type, message\n if !self.messages.empty? && !self.messages.last.valid?\n raise \"add_message invalid message: #{self.messages.last.errors.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "fe47ecb1972b74f339b8ce87ca200b05",
"score": "0.62353516",
"text": "def insert(message)\n self.messages.push message\n self.messages = self.messages.last(settings.channel_message_limit)\n self.save\n end",
"title": ""
},
{
"docid": "41b92b258d5a57e46d0723cf95fc8a88",
"score": "0.6229228",
"text": "def add_message(message, time=nil)\n message['run_at'] = [time.to_f, (Time.now + 900).to_i].min if time\n\n defer do\n client.messages_create(message)\n end\n end",
"title": ""
},
{
"docid": "ee540a4055a9d5011390b3f81a900e74",
"score": "0.62197113",
"text": "def message(type, head, color, msg, level=0)\n write(TupleSpace::MessageTuple.new(type: type, head: head, color: color, contents: msg, level: level))\n rescue NoMethodError\n MESSAGE_QUEUE.push \"%s%s %s\" % [\" \"*level, (\"%5s\" % head).color(color), msg]\n end",
"title": ""
},
{
"docid": "ae946a38ac4fb10d64c45ccf3d060861",
"score": "0.62085164",
"text": "def set_message\n @message = {type: params[:type], title: params[:title], msg: params[:msg]} if display_message?\n logger.info \"HAy mensaje? = #{@message}\"\n end",
"title": ""
},
{
"docid": "67792ee51709fd771f7a9425a490e136",
"score": "0.6200169",
"text": "def message(msg)\n event Appdash::Event::Message.new(msg)\n end",
"title": ""
},
{
"docid": "1890b763d53d140c29194f043de583ae",
"score": "0.6196263",
"text": "def info(msg)\n super(msg) unless self.messages.include?(msg)\n self.messages.push(msg)\n end",
"title": ""
},
{
"docid": "49eaa7f6969dd0266e429034db61d7e6",
"score": "0.6192337",
"text": "def message\n dispatch(:message)\n end",
"title": ""
},
{
"docid": "49eaa7f6969dd0266e429034db61d7e6",
"score": "0.6192337",
"text": "def message\n dispatch(:message)\n end",
"title": ""
},
{
"docid": "e3c8858cb8697f4bc9e2fa74f755a7ef",
"score": "0.61774373",
"text": "def add_message msg\n if msg.nil?\n return false\n end\n\n return self.add_message_id msg.id\n end",
"title": ""
},
{
"docid": "f35acafbf89ed3111851c7d9695ca06b",
"score": "0.61739856",
"text": "def create_msg_bubble()\n #@msg_bubble.img_src = @img_src\n @msg_bubble = Sprite_msg_bubble.new()\n @msg_bubble.x = $game_troop.members[$game_variables[28]].screen_x - 32\n @msg_bubble.y = Graphics.height / 2 - 32 #$game_troop.members[$game_variables[28]].screen_y\n @msg_bubble.z = 500\n @msg_bubble.visible = true\n end",
"title": ""
},
{
"docid": "1ba4e340a018273846b31e74cfba335f",
"score": "0.6172785",
"text": "def message=(value)\n @message = value\n end",
"title": ""
},
{
"docid": "1ba4e340a018273846b31e74cfba335f",
"score": "0.6172785",
"text": "def message=(value)\n @message = value\n end",
"title": ""
},
{
"docid": "ea74c4a58a1abd4ae2d06f536d09754e",
"score": "0.6164993",
"text": "def add(name, message)\n @messages.has_key?(name) ? @messages[name].push(message) : @messages[name] = [message]\n end",
"title": ""
},
{
"docid": "a35fb5c6df01a852a71d4a824a9a3fbe",
"score": "0.6164076",
"text": "def create_message(r, m)\n\n # self.thankyous_sent.create(message: \"test message\", sender_id: self.id, recipient_id: r.id)\n self.thankyous_sent.create(message: m, sender: self, recipient: r)\n\n end",
"title": ""
},
{
"docid": "2b7d480605f90c7f44c9dbbc27452ad0",
"score": "0.615415",
"text": "def build_message(msg, add)\n msg ? \"#{msg}\\n#{add}\" : add\n end",
"title": ""
},
{
"docid": "319e93316327c9dfa81d3407c3fd1595",
"score": "0.6149934",
"text": "def add_to_base msg\n add(:base, msg)\n end",
"title": ""
},
{
"docid": "fb4330667b7d28239ebb9429bf68aac6",
"score": "0.61415094",
"text": "def add_to_message_queue(msg_type, object)\n message = [msg_type] # Cria o array de mensagens\n # Verificar todos os objetos em comum e partilhar entre os jogadores\n [:uuid, :x, :y, :angle].each do |instance|\n # Pega cada instancia do objeto e adiciona na mensagem \n message.push(object.instance_variable_get(\"@#{instance}\"))\n end\n @messages << message.join('|')\n end",
"title": ""
},
{
"docid": "e9c39cf67bb90b6b5182069def2c0662",
"score": "0.6139389",
"text": "def add_message user, room, message\r\n\t\t#adds message to DB\r\n\t\tcols = words_in_double_brackets(\"SENDER, ROOM, TEXT, TIME\".split(\", \")).join(\", \")\r\n\t\tvalues = ( \"'#{user}', '#{room}', '#{message.gsub(\"'\",\"''\").gsub(\"\\\"\",\"\\\"\\\"\")}', '#{Time.now}'\")\r\n\t\tConn.exec(\"INSERT INTO \\\"MESSAGES\\\" (#{cols}) VALUES (#{values});\")\r\n\tend",
"title": ""
},
{
"docid": "a7d964af8dcdcb5b1c7dc43605f23628",
"score": "0.6132558",
"text": "def message(options)\n\t\t@sent_messages << options[:text]\n\tend",
"title": ""
},
{
"docid": "19c153b83c444122bf42f7ad31a09fc5",
"score": "0.6132028",
"text": "def message\n m = super.dup\n m << \" #{text}\" if text\n m << \" (#{code}, #{description.inspect})\"\n end",
"title": ""
},
{
"docid": "3d59cf339700869e39424bb46f2196e7",
"score": "0.61214197",
"text": "def create\n @nickname ||= session[:nickname]\n \n text_message = process_message message_params[:message]\n \n @message = Message.new(message: text_message, nickname: message_params[:nickname])\n\n respond_to do |format|\n if @message.save\n Pusher['presence-room1'].trigger('new_message', {\n message: @message.message,\n nickname: @nickname,\n time: @message.created_at.to_formatted_s(:short)\n })\n \n \n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render action: 'show', status: :created, location: @message }\n format.js\n else\n format.html { render action: 'new' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
},
{
"docid": "e645915e946fed44d3b1bec04579e9d3",
"score": "0.6119748",
"text": "def message; end",
"title": ""
}
] |
16dbddc8fb813746e775a63ca6197cad
|
Doubler Write a `doubler` method that takes an array of integers and returns an array with the original elements multiplied by two.
|
[
{
"docid": "e869f03930764d9df9b030cefab7ef5b",
"score": "0.7908842",
"text": "def doubler(array)\n array.map{ |n| n * 2 }\nend",
"title": ""
}
] |
[
{
"docid": "5e87699415ca75635b45de4d07827af5",
"score": "0.7932969",
"text": "def doubler(array)\n array.map { |el| el * 2 }\nend",
"title": ""
},
{
"docid": "2453dd45ed79fafe02a42438aafd361f",
"score": "0.79032135",
"text": "def doubler(array)\n array.map{|el| el * 2}\nend",
"title": ""
},
{
"docid": "809fb7539b6b3a4b2bea296ed649d72c",
"score": "0.78700626",
"text": "def doubler(array)\n array.map {|el| el * 2 }\nend",
"title": ""
},
{
"docid": "51f9092285a4801634f28a772bf29e40",
"score": "0.7825237",
"text": "def doubler(array)\n array.map { |ele| ele * 2 }\nend",
"title": ""
},
{
"docid": "11733aedcd73d2bc4b99ab2ae63dbba6",
"score": "0.7803208",
"text": "def doubler(array)\n array.map { |num| num * 2 }\nend",
"title": ""
},
{
"docid": "337805e5fb263bb16cd03f39b8db893b",
"score": "0.77003515",
"text": "def doubler(numbers)\n double_arr = []\n \n iterator = 0\n while iterator < numbers.length\n double_arr << numbers[iterator] * 2\n iterator = iterator + 1\n end\n return double_arr\nend",
"title": ""
},
{
"docid": "d721a9aa528b26bc72087f37f9753d66",
"score": "0.76992184",
"text": "def doubler(array)\n array.map {|el| el*2}\nend",
"title": ""
},
{
"docid": "984b9b8f87b0be5cd92f40258b7c2ca1",
"score": "0.76879793",
"text": "def doubler(array)\n array.map{|el| el*2}\nend",
"title": ""
},
{
"docid": "30a1f9c73221ceab60c0202d1d453247",
"score": "0.7682967",
"text": "def doubler(array)\n new_array = []\n array.each do |ele|\n new_array << ele * 2\n end\n new_array\nend",
"title": ""
},
{
"docid": "97fc8bd580b589b988359b2507989bee",
"score": "0.7675485",
"text": "def double(array)\n i = 0\n new_arr = []\n while i < array.length\n new_arr << array[i] * 2\n i += 1\n end\n return new_arr\nend",
"title": ""
},
{
"docid": "eb99839de1172e294b71e3f617a3f15f",
"score": "0.7647178",
"text": "def doubled(array)\nnewArr = []\n i = 0\nwhile i < array.length\n newArr << array[i] * 2\n\n i+=1\nend\nreturn newArr\nend",
"title": ""
},
{
"docid": "6c898b41f3549308d683766559616d38",
"score": "0.75988",
"text": "def doubler(numbers)\n doubled_nums = []\n i = 0\n while i < numbers.length\n old_num = numbers[i]\n new_num = old_num * 2\n doubled_nums << new_num\n\n i += 1\n end\n return doubled_nums \nend",
"title": ""
},
{
"docid": "2dd20bdb31cb499222ec9e8b5516f57a",
"score": "0.7574932",
"text": "def double_array(array)\n array * 2\nend",
"title": ""
},
{
"docid": "2dd20bdb31cb499222ec9e8b5516f57a",
"score": "0.7574932",
"text": "def double_array(array)\n array * 2\nend",
"title": ""
},
{
"docid": "4fdfe08b4a6f7226b083285d2981138f",
"score": "0.75415945",
"text": "def doubler(numbers)\n new_arr = []\n i = 0\n while i < numbers.length\n new_arr << numbers[i] * 2\n i += 1\n end\n return new_arr\nend",
"title": ""
},
{
"docid": "02d1a847adffcb8e8f0f58e74a6988f5",
"score": "0.7530905",
"text": "def doubler(numbers)\n new_array = []\n i = 0\n while i < numbers.length\n new_array << numbers[i] * 2\n i += 1\n end\n\n return new_array\nend",
"title": ""
},
{
"docid": "a01191902e3e164df31b381a4d923e12",
"score": "0.7518782",
"text": "def double_array(array)\n array*2\nend",
"title": ""
},
{
"docid": "dd4a5b4532ad451f50428745b49aaf44",
"score": "0.75125575",
"text": "def doubler(numbers)\n new_arr = []\n i = 0\n while i < numbers.length\n old_numbers = numbers[i]\n new_numbers = old_numbers * 2\n new_arr << new_numbers\n i += 1\n end\n return new_arr\nend",
"title": ""
},
{
"docid": "9cd0fecc9c7fb37249af65be4623799b",
"score": "0.7467415",
"text": "def double_numbers(array)\n new_array = []\n\n array.each do |number|\n new_array << number *= 2\n end\n return new_array\nend",
"title": ""
},
{
"docid": "e278dfd97dd7294f9a17da8597f0b8ca",
"score": "0.7413532",
"text": "def double_array(array)\n array.map do |number|\n number * 2\n end\nend",
"title": ""
},
{
"docid": "600e9188d9fba135ef3cf749beeb7a4e",
"score": "0.7393963",
"text": "def double(array)\n new_array = [];\n for el in array do\n new_array.push(el * 2)\n end\n return new_array\nend",
"title": ""
},
{
"docid": "49b6515cc91c893593d56fae3fe3ecdb",
"score": "0.7387969",
"text": "def doubler(numbers)\n doubled_nums = []\n\n i = 0\n while i < numbers.length / 2.0\n doubled_nums << numbers[i] * 2\n\n i += 1 \n end\n return doubled_nums\nend",
"title": ""
},
{
"docid": "35a650f319c6340489411258785fa9c8",
"score": "0.7363102",
"text": "def doubler(array) # 3 times \n array.map { |num| num * 2 }\nend",
"title": ""
},
{
"docid": "8e0cda417f95dac0c52e7a03f4e061ff",
"score": "0.73246104",
"text": "def calculate_doubles!(arr)\n return arr.map! { |int| int * 2 }\nend",
"title": ""
},
{
"docid": "7415be895008dc04ab1c0b4b6e7d092e",
"score": "0.73126733",
"text": "def doubler(numbers)\n numbers.map{|num| num * 2}\nend",
"title": ""
},
{
"docid": "906a5275f66fdc63b760785b2d909d2d",
"score": "0.7246232",
"text": "def doubler(nums)\n return nums.map { |num| num * 2 }\nend",
"title": ""
},
{
"docid": "7523d91aa763e1e4e8440a720d78435b",
"score": "0.7177174",
"text": "def mult2 (arr)\n i = 0\n newArr = []\n arr.length.times do\n newArr << arr[i] * 2\n i = i + 1\n end\n return newArr\nend",
"title": ""
},
{
"docid": "a67a82a3bc413d9f6a48ccf0b9acc6ff",
"score": "0.71663237",
"text": "def calculate_doubles!(arr)\n arr.map! {|int| int*2}\nend",
"title": ""
},
{
"docid": "e0d29a2c3438fc49669d5a28aae370bc",
"score": "0.71407694",
"text": "def map_to_double(array)\n l = array.length \n new_array = []\n counter = 0 \n while counter < l \n new_array.push(array[counter]*2)\n counter += 1\n end \n new_array\nend",
"title": ""
},
{
"docid": "0c9c5c00caec6564cea1a8cd381ea71d",
"score": "0.7139023",
"text": "def double(arr)\n counter = 0\n selected_array = []\n\n loop do\n break if counter == arr.length\n\n current_number = arr[counter]\n current_number *= 2 if counter.odd?\n selected_array << current_number\n\n counter += 1\n end\n\n selected_array\nend",
"title": ""
},
{
"docid": "c5fbaeeaf1ca9ff6b18c972f18213549",
"score": "0.71385866",
"text": "def map_to_double(array)\n #iterate through array and double all elements\n index = 0\n while index < array.length do\n array[index] *= 2\n index += 1\n end\n return array\nend",
"title": ""
},
{
"docid": "ffd7ef5197a29f07784ec74eb9dba769",
"score": "0.71344113",
"text": "def calculate_doubles(arr)\n return arr.map { |int| int * 2 }\nend",
"title": ""
},
{
"docid": "b621a28952e64b2fb56e397287601dd1",
"score": "0.71306914",
"text": "def map_to_double(array)\n current_element = 0\n new_array = []\n while current_element < array.length \n new_array << array[current_element]*2\n current_element +=1\nend\n new_array\nend",
"title": ""
},
{
"docid": "cb4d0c9b0b38d6791b5ef3ea48afd04e",
"score": "0.7126243",
"text": "def calculate_doubles!(arr)\n arr.map! { |ele| ele * 2 }\nend",
"title": ""
},
{
"docid": "175a8d6a31112968bc05023c9ec213c5",
"score": "0.71145",
"text": "def double_array(array)\n\t[array*2].flatten\nend",
"title": ""
},
{
"docid": "d2f413e4c48fdf065f91df39eb3f4a96",
"score": "0.71106505",
"text": "def doubled_numbers!(numbers)\n counter = 0\n\n loop do \n break if counter == numbers.size\n \n numbers[counter] *= 2\n\n counter += 1\n end\n\n numbers\nend",
"title": ""
},
{
"docid": "aec6d1bdf2bbb353fa9f07b182d1f79c",
"score": "0.71070194",
"text": "def map_to_double(array)\n double_array = []\n counter = 0\n\n while counter < array.length do\n double_array.push(array[counter] * 2)\n counter += 1\n end\n\n double_array\nend",
"title": ""
},
{
"docid": "71ff1e09095968eb4220b9ef7cd13ff5",
"score": "0.70859706",
"text": "def calculate_doubles!(arr)\n arr.map! {|el| el * 2}\nend",
"title": ""
},
{
"docid": "fecda730bbad22095168edbb91fa12b9",
"score": "0.7069918",
"text": "def calculate_doubles(arr)\n arr.map { |n| n * 2 }\nend",
"title": ""
},
{
"docid": "15eeedab6e6837b247e6ff1f46ad77bc",
"score": "0.7059595",
"text": "def double_numbers(numbers)\n doubled_numbers = []\n counter = 0\n loop do\n break if counter == numbers.size\n current_number = numbers[counter]\n doubled_numbers << current_number * 2\n counter += 1\n end\n doubled_numbers\nend",
"title": ""
},
{
"docid": "5a84b03ca8ad32b8a6bb1794a2a95620",
"score": "0.70011365",
"text": "def double_numbers(numbers)\n doubled_numbers = []\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n doubled_numbers << current_number * 2\n\n counter += 1\n end\n\n doubled_numbers\nend",
"title": ""
},
{
"docid": "5a84b03ca8ad32b8a6bb1794a2a95620",
"score": "0.70011365",
"text": "def double_numbers(numbers)\n doubled_numbers = []\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n doubled_numbers << current_number * 2\n\n counter += 1\n end\n\n doubled_numbers\nend",
"title": ""
},
{
"docid": "4145f9bdc0020114c4a5fe24f4f0416f",
"score": "0.6999136",
"text": "def double_numbers(arr)\n arr.map!{|num| num*2}\nend",
"title": ""
},
{
"docid": "700f6b271149567d8d103ad632729991",
"score": "0.6995456",
"text": "def double_numbers!(int_arr)\n counter = 0\n\n loop do\n int_arr[counter] *= 2\n\n counter += 1\n break if counter == int_arr.size\n end\nend",
"title": ""
},
{
"docid": "245cc1003804f02ebe86174e10283da8",
"score": "0.69858974",
"text": "def doubler(array)\n\tfor i in array\n\t\tyield i * 2\n\tend\nend",
"title": ""
},
{
"docid": "3369d2165554bd04a4d5a2ab75f75d47",
"score": "0.698325",
"text": "def calculate_doubles!(array)\n array.map! { |e| e * 2}\nend",
"title": ""
},
{
"docid": "809356e2d9810b27615df6c500f9912a",
"score": "0.69824475",
"text": "def double_it(numbers)\n numbers.map {|number| number * 2}\nend",
"title": ""
},
{
"docid": "3c5577d54202b0c9dfbd863b52a86e54",
"score": "0.697932",
"text": "def calculate_doubles(arr)\n arr.map { |ele| ele * 2 }\nend",
"title": ""
},
{
"docid": "946b3ec2a1d2b578f5400431a18bb8a8",
"score": "0.6963717",
"text": "def calculate_doubles(arr)\n arr.map {|el| el * 2}\nend",
"title": ""
},
{
"docid": "3ed0c4576c82fb93e3529739b98713ab",
"score": "0.6963379",
"text": "def calculate_doubles!(arr)\n arr.map! { |e| e * 2 }\nend",
"title": ""
},
{
"docid": "da66b6378a6f9c92cf2717c40bd31f26",
"score": "0.69627964",
"text": "def array_times_two(array)\n result = []\n i = 0\n\n while i < array.length\n result << array[i] * 2\n i += 1\n end\n\n result\nend",
"title": ""
},
{
"docid": "b1d7393cebefc8ba9a8afe187fc1bfed",
"score": "0.69555175",
"text": "def calculate_doubles!(arr)\n\tarr.map!{|x| x*2}\nend",
"title": ""
},
{
"docid": "66d6d56eeace2b86a38074a676489336",
"score": "0.69491076",
"text": "def double_numbers(numbers)\n doubled_numbers = []\n counter = 0\n \n loop do\n break if counter == numbers.size\n \n current_number = numbers[counter]\n doubled_numbers << current_number * 2\n \n counter += 1\n end\n \n doubled_numbers\nend",
"title": ""
},
{
"docid": "f50122defa2d79fe3279e5c7cde1ab52",
"score": "0.69467795",
"text": "def doubler(array)\n array.map { |el| el + el }\nend",
"title": ""
},
{
"docid": "1d810cfd3ad4fd80064e293be3985386",
"score": "0.6939507",
"text": "def calculate_doubles(arr)\n\tarr.map{|x| x*2}\nend",
"title": ""
},
{
"docid": "a835d2cdc6c33947f4b1b9d4300a32b9",
"score": "0.69351476",
"text": "def array_times_two(array)\n array.map { |el| el * 2 }\nend",
"title": ""
},
{
"docid": "03b55e4fc53e771cba2fedfc9af547fa",
"score": "0.6926976",
"text": "def array_times_two!(array)\n i = 0\n\n while i < array.length\n array[i] = array[i] * 2\n i += 1\n end\n\n array\nend",
"title": ""
},
{
"docid": "9310ba780f8c7dc0d3e29134a98d9cd6",
"score": "0.6919449",
"text": "def array_times_two(arr)\r\n result = []\r\n\r\n i = 0\r\n while i < arr.length\r\n result << arr[i] * 2\r\n i += 1\r\n end\r\n result\r\nend",
"title": ""
},
{
"docid": "8472d7c6b4999283314642936c2f807a",
"score": "0.69132835",
"text": "def calculate_doubles(arr)\n arr.map { |x| x * 2 }\nend",
"title": ""
},
{
"docid": "7a4b635f8cb5907415951da37def257f",
"score": "0.6907146",
"text": "def double_numbers(arr)\n counter = 0\n loop do\n break if counter == arr.size\n \n arr[counter] = arr[counter] * 2\n\n counter += 1\n end\n\n arr\nend",
"title": ""
},
{
"docid": "43faa8830c06dc5760236347302ba332",
"score": "0.69044614",
"text": "def double_numbers!(numbers)\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n numbers[counter] = current_number * 2 # two lines can be condensed into numbers[counter] *= 2\n\n counter += 1\n end\n\n numbers\nend",
"title": ""
},
{
"docid": "7cb761b4ae97f0a8591383e386986bba",
"score": "0.6889322",
"text": "def double_numbers!(numbers)\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n numbers[counter] *= 2\n\n counter += 1\n end\n numbers\nend",
"title": ""
},
{
"docid": "f1da31a89fbac1b71597c8dc9d3e21f1",
"score": "0.6887575",
"text": "def double_numbers!(numbers)\n \n counter = 0\n\n loop do\n break if counter == numbers.size\n numbers[counter] *= 2\n counter += 1\n end\nend",
"title": ""
},
{
"docid": "5ff31c4017a543a814a0421ede3023ae",
"score": "0.6881877",
"text": "def double_numbers!(numbers_arr)\n # new_arr = [] \n counter = 0\n \n loop do\n break if counter == numbers_arr.size\n \n current_value = numbers_arr[counter]\n numbers_arr[counter] = current_value *= 2\n \n counter += 1\n end\n \n numbers_arr\nend",
"title": ""
},
{
"docid": "21cee009febe469435557e682536866b",
"score": "0.68808985",
"text": "def double_every_other(numbers)\n new_array = []\n counter = 0\n\n loop do \n break if counter == numbers.size\n\n current_number = numbers[counter]\n current_number *= 2 if counter.odd?\n new_array << current_number\n\n counter += 1\n end\n new_array\nend",
"title": ""
},
{
"docid": "e5fdbe5a6d34e43e4895e49f54dc8ced",
"score": "0.6863755",
"text": "def double_eles(arr)\n arr.map do |ele|\n ele * 2\n end\nend",
"title": ""
},
{
"docid": "e5fdbe5a6d34e43e4895e49f54dc8ced",
"score": "0.6863755",
"text": "def double_eles(arr)\n arr.map do |ele|\n ele * 2\n end\nend",
"title": ""
},
{
"docid": "ebb1f6e7a9fb4643ae2bd52a36ee3a29",
"score": "0.68611604",
"text": "def array_times_two!(array)\n array.map! { |num| num * 2 }\nend",
"title": ""
},
{
"docid": "a0df982c20495757171af89afca19410",
"score": "0.68593013",
"text": "def double(arr)\n arr.map { |param| return param * 2 }\nend",
"title": ""
},
{
"docid": "38b32345858ada21ed223d7258a8ca76",
"score": "0.6854215",
"text": "def double_array\n @array_new.each_index do |index|\n if index % 2 != 0\n @array_new[index] = @array_new[index] * 2\n end\n end\nend",
"title": ""
},
{
"docid": "6596df6b1d014a867fa7dd06d3ff042c",
"score": "0.6853546",
"text": "def double_numbers(double_numbers)\n array = []\n double_numbers.each do |number|\n number = number * 2\n array << number \n end\n return array\nend",
"title": ""
},
{
"docid": "d1c294f4ecb781027c2ddb37a4ce6769",
"score": "0.6848204",
"text": "def double_numbers!(numbers)\n counter = 0\n \n loop do\n break if counter == numbers.size\n\n numbers[counter] *= 2\n \n counter += 1\n end\n\n numbers\nend",
"title": ""
},
{
"docid": "4c36fc3a4191c67b73da3bb7c056f187",
"score": "0.68427855",
"text": "def double_numbers!(numbers)\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n numbers[counter] = numbers[counter] * 2\n counter += 1\n end\n\n numbers\nend",
"title": ""
},
{
"docid": "d9285e528b72e8c00d3b586cb316691e",
"score": "0.6840751",
"text": "def double_some_nums(numbers)\n counter = 0\n result = []\n loop do \n break if counter == numbers.size\n current_num = numbers[counter]\n if counter.odd?\n current_num *= 2\n result << current_num\n else \n result << current_num\n end \n counter += 1\n end \n result\nend",
"title": ""
},
{
"docid": "fdfe1f1f68f7da15ec358b855837bee8",
"score": "0.6837716",
"text": "def array_times_two(array)\n array.map { |x| x * 2}\nend",
"title": ""
},
{
"docid": "aa84d8ad7b35668f6245271b84d52337",
"score": "0.683381",
"text": "def double_odd_numbers(nums)\n doubled = []\n counter = 0\n\n loop do\n break if counter == nums.size\n\n current_num = nums[counter]\n current_num *= 2 if current_num.odd? # transforms and selects\n doubled << current_num\n\n counter += 1\n end\n\n doubled\nend",
"title": ""
},
{
"docid": "c37d16ed96fb4a3a2fcd56d5c851fde4",
"score": "0.6830251",
"text": "def calculate_doubles(arr)\n arr.map {|int| int*2 }\n\nend",
"title": ""
},
{
"docid": "2eed087da736bbbf5e298a911b17d5ac",
"score": "0.6821276",
"text": "def array_times_two(arr)\n\n # create an empty array, result\n # iterate thru the given array\n # multiply each el by 2\n # push the multiplied el to new array\n array = Array.new\n arr.each {|el| array << el * 2}\n array\nend",
"title": ""
},
{
"docid": "2eed087da736bbbf5e298a911b17d5ac",
"score": "0.6821276",
"text": "def array_times_two(arr)\n\n # create an empty array, result\n # iterate thru the given array\n # multiply each el by 2\n # push the multiplied el to new array\n array = Array.new\n arr.each {|el| array << el * 2}\n array\nend",
"title": ""
},
{
"docid": "2faab04101815264adca50a0c6875f92",
"score": "0.6804378",
"text": "def auth_doubler\n @doubled_array = @array_of_digits.each_with_index.map do |value, index|\n if index.even?\n value * 2\n else\n value\n end\n end\n end",
"title": ""
},
{
"docid": "5b29b10830db215515257df831187bf8",
"score": "0.67805535",
"text": "def calculate_doubles(array)\n array.map { |e| e * 2}\nend",
"title": ""
},
{
"docid": "dc2337241680df06bfdd1bab17fa08f0",
"score": "0.67750734",
"text": "def double_numbers!(numbers)\n count = 0\n \n loop do\n break if count == numbers.size\n\n numbers[count] *= 2\n\n count += 1\n end\n\n numbers\nend",
"title": ""
},
{
"docid": "9be63b305897604f5c24967d7547becb",
"score": "0.6772311",
"text": "def multiply_by_two array\n array.map { |el| el * 2 }\nend",
"title": ""
},
{
"docid": "d888f7f996c9ad32f4ed067e40ff9b21",
"score": "0.67443186",
"text": "def array_times_two(array)\nend",
"title": ""
},
{
"docid": "68cd287da9bc38443ae92ab69ade1e23",
"score": "0.67242926",
"text": "def mult2 array\n array.map do |value|\n value * 2\n end\nend",
"title": ""
},
{
"docid": "5cdbe50348962f4688b1fc5c0d820626",
"score": "0.6721316",
"text": "def double_odd_numbers(numbers)\n doubled_number = []\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n current_number *= 2 if counter.odd?\n doubled_number << current_number\n\n counter += 1\n end\n doubled_number\nend",
"title": ""
},
{
"docid": "b8453157687e62a2c0cd592eea228559",
"score": "0.6701625",
"text": "def double_numbers!(numbers)\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n numbers[counter] = current_number * 2\n\n counter += 1\n end\n\n numbers\nend",
"title": ""
},
{
"docid": "b8453157687e62a2c0cd592eea228559",
"score": "0.6701625",
"text": "def double_numbers!(numbers)\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n numbers[counter] = current_number * 2\n\n counter += 1\n end\n\n numbers\nend",
"title": ""
},
{
"docid": "106008e0dc10c5f33419b3dd8838855f",
"score": "0.669421",
"text": "def array_times_two!(arr)\n arr.map! do |e|\n e * 2\n end\nend",
"title": ""
},
{
"docid": "13161f7075d5c507fe8abcaef6020034",
"score": "0.66828585",
"text": "def array_times_two!(arr)\r\n\r\n arr.map! {|el| el*2}\r\n arr\r\n\r\nend",
"title": ""
},
{
"docid": "2e3cb8f1c7b24de2b306adbeb0a0ea0a",
"score": "0.6666002",
"text": "def doubler(array)\nend",
"title": ""
},
{
"docid": "2e3cb8f1c7b24de2b306adbeb0a0ea0a",
"score": "0.6666002",
"text": "def doubler(array)\nend",
"title": ""
},
{
"docid": "a7c8e5e65f93502bf12ada884b2339b5",
"score": "0.66576356",
"text": "def array_times_two(array)\n\nend",
"title": ""
},
{
"docid": "66bef4f6d65091dde4a4b8109c658006",
"score": "0.6654262",
"text": "def array_times_two!(arr)\n\n arr.map! {|x| 2 * x}\n\nend",
"title": ""
},
{
"docid": "c5aa4879307ac6fa2e3c5a582a87d255",
"score": "0.6651517",
"text": "def double_odd_numbers(numbers)\n doubled_numbers = []\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n current_number *= 2 if counter.odd?\n doubled_numbers << current_number\n\n counter += 1\n end\n\n doubled_numbers\nend",
"title": ""
},
{
"docid": "c5aa4879307ac6fa2e3c5a582a87d255",
"score": "0.6651517",
"text": "def double_odd_numbers(numbers)\n doubled_numbers = []\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n current_number *= 2 if counter.odd?\n doubled_numbers << current_number\n\n counter += 1\n end\n\n doubled_numbers\nend",
"title": ""
},
{
"docid": "c5aa4879307ac6fa2e3c5a582a87d255",
"score": "0.6651517",
"text": "def double_odd_numbers(numbers)\n doubled_numbers = []\n counter = 0\n\n loop do\n break if counter == numbers.size\n\n current_number = numbers[counter]\n current_number *= 2 if counter.odd?\n doubled_numbers << current_number\n\n counter += 1\n end\n\n doubled_numbers\nend",
"title": ""
},
{
"docid": "2fd367f273fd3022191ba257cb3810f0",
"score": "0.66371965",
"text": "def double_it(numbers)\n numbers.map{ |x| x*2}\nend",
"title": ""
},
{
"docid": "12f8e4873ad2a03893bce214cfc35aea",
"score": "0.6635356",
"text": "def array_times_two!(array)\nend",
"title": ""
},
{
"docid": "e1f7a01a9a0cb02770c7b76cd7915ed5",
"score": "0.6627551",
"text": "def array_times_two(arr)\n arr.map do |e|\n e * 2\n end\nend",
"title": ""
}
] |
29f8b1f2ad8798c6e270a06d10bf7734
|
Searches for teaching events, returning grouped by type. Searches for teaching events. Optionally limit the results by distance (in miles) from a postcode, event type and start date.
|
[
{
"docid": "587dd59125c5dfe375bc2007dcd9b1e4",
"score": "0.64111346",
"text": "def search_teaching_events_grouped_by_type(opts = {})\n data, _status_code, _headers = search_teaching_events_grouped_by_type_with_http_info(opts)\n data\n end",
"title": ""
}
] |
[
{
"docid": "13f27b1cf59b47ac8d688e7e093b268a",
"score": "0.59530866",
"text": "def index\n\n @events = Event.order(\"starts_at ASC\")\n\n if !params[:start].blank? and !params[:end].blank?\n start_date = Date.strptime(params[:start], '%s')\n end_date = Date.strptime(params[:end], '%s')\n\n @events = @events.where(\"starts_at <= ? AND ends_at >= ?\", end_date, start_date)\n\n end\n\n unless params[:distance] == \"All\"\n\n if !params[:zipcode].blank?\n @events = @events.near(params[:zipcode], params[:distance]) | @events.where([\"major_convention = ? AND major_convention_approved IS NOT NULL\", true])\n elsif request.location\n @events = @events.near([request.location.latitude, request.location.longitude], params[:distance]) | @events.where([\"major_convention = ? AND major_convention_approved IS NOT NULL\", true])\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json # index.json.jbuilder\n end\n end",
"title": ""
},
{
"docid": "f9a4ff119e4a4aa21af7e78cb7a279c2",
"score": "0.58426005",
"text": "def search_teaching_events_grouped_by_type_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeachingEventsApi.search_teaching_events_grouped_by_type ...'\n end\n # resource path\n local_var_path = '/api/teaching_events/search_grouped_by_type'\n\n # query parameters\n query_params = {}\n query_params[:'Postcode'] = opts[:'postcode'] if !opts[:'postcode'].nil?\n query_params[:'Radius'] = opts[:'radius'] if !opts[:'radius'].nil?\n query_params[:'TypeId'] = opts[:'type_id'] if !opts[:'type_id'].nil?\n query_params[:'StartAfter'] = opts[:'start_after'] if !opts[:'start_after'].nil?\n query_params[:'StartBefore'] = opts[:'start_before'] if !opts[:'start_before'].nil?\n query_params[:'StatusIds'] = @api_client.build_collection_param(opts[:'status_ids'], :csv) if !opts[:'status_ids'].nil?\n query_params[:'quantityPerType'] = opts[:'quantity_per_type'] if !opts[:'quantity_per_type'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])\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 => 'Array<TeachingEventsByType>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeachingEventsApi#search_teaching_events_grouped_by_type\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "39202c7a87edad7101767aef477082a1",
"score": "0.5727351",
"text": "def index\n if params[:field].present? && params[:keyword].present?\n @events = Event.all.where([\"#{params[:field]} like ?\", \"%#{params[:keyword]}%\"]).per_page_kaminari(params[:page]).per(params[:per])\n else\n @events = Event.all.per_page_kaminari(params[:page]).per(params[:per])\n end\n end",
"title": ""
},
{
"docid": "f3c84b5a9ddccaac222ada8cd28f2ab7",
"score": "0.56614345",
"text": "def search\n if params[:query]\n respond_with Event\n .fulltext_search(params[:query])\n .includes(:categories, :organization, :location)\n else\n Event\n .order(\"updated_at DESC\")\n .includes(:categories, :organization, :location)\n end\n end",
"title": ""
},
{
"docid": "9f32af180ef20cbc75e27ba4232c45e9",
"score": "0.5643494",
"text": "def index\n \n @events = Event.order('created_at desc').page(params[:page]).per(params[:limit] || 10) \n \n if params[:type]\n @events = @events.where('poi_type_id = ?', params[:type])\n end\n \n if params[:search]\n search = \"%\" + params[:search].sub(\" \", \"%\") + \"%\"\n @events = @events.where('title like ? OR title_eu like ?', search, search)\n end\n \n @verfied = Event.where('is_verified = ?', true)\n @top_events = Event.order('rating desc').limit(4)\n @last_events = Event.order('created_at desc').limit(4)\n @next_events = Event.where('ends_at > ?', Time.now).order('starts_at asc').limit(8)\n @last_photos = Photo.where(is_visible_on_index: true).order('created_at desc').limit(8)\n @last_comments = Comment.order('created_at desc').limit(10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "d5a3cc64ee02a7a12d920d4839067687",
"score": "0.56362695",
"text": "def search_time_sheet_events(options={})\n days = {}\n method = 'search.messages'\n max_cnt = 15\n cnt = 0\n cur_date = options[:start]\n total_hours = 0.0\n\n loop do\n entries = []\n fdate = cur_date.strftime('%Y-%m-%d')\n printf \"\\n>>> processing #{fdate}\"\n \n query = \"in:engineering from:me on:#{fdate} biab\"\n matches = self.class.get(\"/#{method}\", query: { token: @token, query: query }).tap do |response|\n printf \"v\"\n raise \"error searching for #{query} from #{method}: #{response.fetch('error', 'unknown error')}\" unless response['ok']\n end.fetch(\"messages\").fetch(\"matches\")\n\n entries.concat matches.map{|x| \n printf \".\"\n x['ts'] = DateTime.strptime(x['ts'],'%s').to_time\n {state: :off, ts: x['ts'], permalink: x['permalink'], text: x['text']}\n }\n\n query = \"in:engineering from:me on:#{fdate} brb\"\n matches = self.class.get(\"/#{method}\", query: { token: @token, query: query }).tap do |response|\n printf \"v\"\n raise \"error searching for #{query} from #{method}: #{response.fetch('error', 'unknown error')}\" unless response['ok']\n end.fetch(\"messages\").fetch(\"matches\")\n\n entries.concat matches.map{|x| \n printf \".\"\n x['ts'] = DateTime.strptime(x['ts'],'%s').to_time\n {state: :off, ts: x['ts'], permalink: x['permalink'], text: x['text']}\n }\n \n query = \"in:engineering from:me on:#{fdate} back\"\n matches = self.class.get(\"/#{method}\", query: { token: @token, query: query }).tap do |response|\n printf \"v\"\n raise \"error searching for #{query} from #{method}: #{response.fetch('error', 'unknown error')}\" unless response['ok']\n end.fetch(\"messages\").fetch(\"matches\")\n\n entries.concat matches.map{|x| \n printf \".\"\n x['ts'] = DateTime.strptime(x['ts'],'%s').to_time\n {state: :on, ts: x['ts'], permalink: x['permalink'], text: x['text']}\n }\n \n query = \"in:engineering from:me on:#{fdate} good\"\n matches = self.class.get(\"/#{method}\", query: { token: @token, query: query }).tap do |response|\n printf \"v\"\n raise \"error searching for #{query} from #{method}: #{response.fetch('error', 'unknown error')}\" unless response['ok']\n end.fetch(\"messages\").fetch(\"matches\")\n\n entries.concat matches.map{|x| \n printf \".\"\n x['ts'] = DateTime.strptime(x['ts'],'%s').to_time\n state = (x['text'] =~ /evening|night/) ? :off : :on\n {state: state, ts: x['ts'], permalink: x['permalink'], text: x['text']}\n }\n\n entries = entries.sort_by { |h| h[:ts] }\n days[fdate] = {entries: entries}\n\n start_entry = nil\n last_entry = nil\n seconds = 60*15\n total_time_for_day = 0.0\n start = nil\n entries.each do |entry|\n begin\n printf \".\"\n entry[:diff] = 0\n\n if(entry[:state] == :off)\n stop = Time.at((entry[:ts].to_f / seconds).round * seconds)\n start = nil\n entry[:ts] = stop\n next unless start_entry\n\n diff = entry[:ts] - start_entry[:ts]\n start_entry[:diff] = (diff/(60*60))\n\n total_time_for_day += start_entry[:diff]\n start_entry = nil\n else\n time = Time.at((entry[:ts].to_f / seconds).round * seconds)\n entry[:ts] = time\n\n start_entry = entry if start_entry.nil?\n end\n rescue Exception => e\n puts \"Problem with entry: #{entry.inspect}\nstart_entry: #{start_entry.inspect}\n\"\n raise e\n end\n last_entry = entry\n end\n\n if(start_entry)\n today = Time.now.strftime(\"%Y%m%d\")\n process_day = start_entry[:ts].strftime(\"%Y%m%d\")\n\n if(today == process_day)\n time = Time.at((Time.now.to_f / seconds).round * seconds)\n\n diff_work = time - start_entry[:ts]\n start_entry[:diff] = diff_work/(60*60)\n total_time_for_day += start_entry[:diff]\n \n entries << {state: :pending, ts: time, text: \"still working\"}\n\n else\n entries << {state: :off, ts: last_entry[:ts], text: \"good day/evening (you never checked out?)\"}\n end\n end\n\n if entries.length > 0\n entries[entries.length-1][:diff] = 0.0 \n days[fdate][:hours] = total_time_for_day\n total_hours += days[fdate][:hours]\n printf \"=> #{days[fdate][:hours]} for day; #{total_hours} for range\"\n end\n\n break unless(cnt > max_cnt or cur_date < options[:stop])\n\n # go to next day\n cur_date += (60*60*24)\n cnt += 1\n end\n\n days[:hours] = total_hours\n report = {report: days}\n puts \"\\n>>> DONE!\"\n report\n end",
"title": ""
},
{
"docid": "a6819fc86a3449fa295d9265d6eed422",
"score": "0.5625957",
"text": "def get_matches_on_event(event_type)\n if has_matches_on_event?(event_type)\n @matches = @local_swimmer.meeting_programs\n .sort_by_date('DESC')\n .joins(:meeting, :event_type)\n .includes(:meeting, :event_type)\n .where([\n 'meeting_events.event_type_id = ? and exists (select 1 from meeting_individual_results mir join swimmers s on s.id = mir.swimmer_id where s.id = ? and mir.meeting_program_id = meeting_programs.id)',\n event_type.id,\n visitor_swimmer.id\n ])\n end\n end",
"title": ""
},
{
"docid": "cf9911bea0913e76abb0c4f826e3d26d",
"score": "0.5503211",
"text": "def find_events_by_type(tag, &block)\n find_by_terms(:event).xpath(\"//event[@type='#{tag}']\").each do |node|\n block.call(node['who'], Time.parse(node['when']), node.content)\n end\n end",
"title": ""
},
{
"docid": "ab0785d94c7e0ca7b532e41f2dfc5932",
"score": "0.5455069",
"text": "def collect_event_bests\n # TODO\n # Limit the results to the season older than the target one\n\n MeetingIndividualResult\n .for_season_type(@season_type)\n .for_gender_type(@gender_type)\n .for_category_code(@category_type.code)\n .for_pool_type(@pool_type)\n .for_event_type(@event_type)\n .for_date_range(Date.new(0), @season.begin_date - 1)\n .sort_by_timing\n .limit(@bests_to_be_ignored + @max_results)\n\n # TODO\n # Verify where for_category_type scope is used!!!\n end",
"title": ""
},
{
"docid": "4c025e2f2b05d843333120a356b65942",
"score": "0.5433117",
"text": "def index\n party_results = Event.party(params[:event], params[:location],\n params[:time], params[:category])\n @results = JSON.parse(party_results)\n\n # twitter_results = Event.twitter_search(params[:event])\n # @twitter_results = Event.twitter_search(response)\n # Event.create\n end",
"title": ""
},
{
"docid": "2e04c24f824a81abcca9bf0c6fef8771",
"score": "0.5429986",
"text": "def index\n if params[:term]\n @events = Event.search_by_date(params[:term])\n if params[:term] == ''\n @events = Event.all.order(:eventDate)\n end\n else\n @events = Event.all.order(eventDate: :desc).page(params[:page]).per_page(15)\n \n end\n end",
"title": ""
},
{
"docid": "3142b587e01c716d685626614c942191",
"score": "0.54069024",
"text": "def index\n @results = {}\n\n if TeSS::Config.solr_enabled\n SEARCH_MODELS.each do |model_name|\n model = model_name.constantize\n @results[model_name.underscore.pluralize.to_sym] = Sunspot.search(model) do\n fulltext search_params\n\n with('end').greater_than(Time.zone.now) if model_name == 'Event'\n\n\n # Hide failing records\n if model.method_defined?(:link_monitor)\n unless current_user && current_user.is_admin?\n without(:failing, true)\n end\n end\n\n if model.attribute_method?(:user_requires_approval?)\n # TODO: Fix this duplication!\n # Hide shadowbanned users' events, except from other shadowbanned users and administrators\n unless current_user && (current_user.shadowbanned? || current_user.is_admin?)\n without(:shadowbanned, true)\n end\n\n # Hide unverified users' things, except from curators and admins\n unless current_user && (current_user.is_curator? || current_user.is_admin?)\n without(:unverified, true)\n end\n end\n end\n end\n \n end\n\n @results.reject! { |_, result| result.total < 1 }\n end",
"title": ""
},
{
"docid": "5d9ed803a4d0605b1ea5fd3216b751bc",
"score": "0.53960705",
"text": "def index\r\n if params[:page].blank?\r\n session[:search_type] = nil\r\n session[:search_query] = nil\r\n end\r\n\r\n contexts = session[:search_type] == \"all\" ? [\"organization\", \"location\", \"arena\", \"geographic_scope\", \"connection_dialog\", \"affiliation\", \"tag\"] : session[:search_type]\r\n\r\n if session[:search_query].blank?\r\n @events = Event.all \r\n elsif session[:search_type].include?(\"page\") || session[:search_type].include?(\"project\") || session[:search_type] == \"name\"\r\n @events = Event.find(:all, :conditions => [\"#{session[:search_type]} LIKE ?\", \"%#{session[:search_query]}%\"], :include => [:page, {:page => :project}])\r\n elsif session[:search_type] == \"all\"\r\n @events = Event.tagged_with(\"#{session[:search_query]}%\", :any => true)\r\n else\r\n @events = Event.tagged_with(\"#{session[:search_query]}%\", :on => \"#{session[:search_type]}\", :any => true)\r\n end\r\n\r\n @events = @events.paginate(:per_page => session[:per_page], :page => params[:page])\r\n\r\n if request.xhr?\r\n respond_to do |format|\r\n format.js do\r\n render :update do |page|\r\n page.replace_html 'table', :partial => \"list_events\"\r\n end\r\n end\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "26f9e67ae7ad4075e1014069f6ea071e",
"score": "0.53564686",
"text": "def index\n @events = Event.all\n# if params[:term].present?\n# @events = Eventbrite::Event.search({q: params[:term]}).events\n# else\n# @events = Eventbrite::Event.search({q: 'Miami'}).events\n# end\n # @event = Eventbrite::Event.search({q: 'Community Service'})\n # @events = Eventbrite::Event.search({q: params[:term]}).events\n # @events = Event.all\n # @events = if params[:term]\n # Event.where('name LIKE ?', \"%#{params[:term]}%\")\n # else\n # Event.all\n # end\n\n\n # @events = if params[:term]\n # Event.where('name LIKE ?', \"%#{params[:term]}%\")\n\n\n\n\n end",
"title": ""
},
{
"docid": "31ce2382edbbe7633d4f554d33bf62f2",
"score": "0.52035505",
"text": "def index\n @event_types = EventType.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "21fcdd91a9aa1c62e35ef24116e357f5",
"score": "0.5199271",
"text": "def index\n if params[:search].present?\n search_string = \"%#{params[:search]}%\"\n @events = Event.joins(:taggings, :tags).where([\"events.name LIKE ? OR events.city_name LIKE ? \", search_string, search_string]).page(params[:page]).per(10)\n else\n # @events = Event.recent.page(params[:page]).per(10)\n @events = Event.page(params[:page]).per(10)\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "8d4db54a396a0a33e58150810499468a",
"score": "0.5192983",
"text": "def search_tweets(result_type, number_of_responses)\n \n searchORstring = @searchArray.map { |hashtagElement| hashtagElement.to_s + \" OR\"}.join(\" \")\n search = @twitter_client.search(searchORstring, result_type: result_type).take(number_of_responses)\n\n if search.empty? == false\n search.each do |tweet|\n @tweets << tweet\n end\n else\n raise('Your search returned no tweets')\n end\n @tweets\n end",
"title": ""
},
{
"docid": "183b5450735898aa2fa2130ceff9e47f",
"score": "0.5187587",
"text": "def index\n @events = Event.paginate_all(params[:page], params[:search], sort_column + ' ' + sort_direction)\n end",
"title": ""
},
{
"docid": "0fb6d66d7e6ac717a3e962e77e235993",
"score": "0.5180245",
"text": "def index\n\n if params[:type] == 'event_user'\n @events = Event.search_not_have_publisher(params[:search], params[:page])\n else\n @events = Event.search_has_publisher(params[:search], params[:page])\n end\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @events }\n format.js {\n render :update do |page|\n page.replace_html 'results', :partial => 'events_list'\n end\n }\n end\n end",
"title": ""
},
{
"docid": "b965df4a5178f5a012622e0304879dc7",
"score": "0.51758265",
"text": "def day_events(date, events)\n events.select { |e| e.start_time.to_date == date }.sort_by { |e| e.start_time }\n end",
"title": ""
},
{
"docid": "a238e65902bc0348bca5cea14fd1667c",
"score": "0.51698095",
"text": "def events(publisher: nil, keywords: nil, start: nil, ongoing: nil, sort: \"start_time\")\n keywords = keywords.join(\",\") if keywords.is_a?(Array)\n\n result = fetch(\n \"event\",\n # Undocumented `event_type` parameter used at tapahtumat.hel.fi\n event_type: \"general\",\n # Types used at tapahtumat.hel.fi, removes the recurring super events\n # which have their own occurrences for each event day. Otherwise the\n # list might show duplicates during the first occurrence of the event.\n super_event_type: \"umbrella,none\",\n publisher: publisher.presence,\n keyword: keywords.presence,\n start: start.presence,\n all_ongoing_AND: ongoing.presence,\n sort: sort.presence\n )\n return [] unless result\n\n result[\"data\"] || []\n end",
"title": ""
},
{
"docid": "09c5da8d6da969f801340f567e1c560f",
"score": "0.51592165",
"text": "def all_events(start, finish, include_assignments = false, child = nil) # last param used in student & teacher\r\n tracks = school.current_term.tracks\r\n (universal_events(start, finish, tracks) + \r\n Event.where([\"invitable_type = 'Staff' AND invitable_id = ? AND date BETWEEN ? AND ?\", school_id, start, finish]) + \r\n Event.where([\"invitable_type = 'Teachers' AND creator_id = ? AND date BETWEEN ? AND ?\", id, start, finish])).sort_by{|event|event.date} \r\n #(audience_type == Group && groups.map(&:id).include?(audience_id)\r\n end",
"title": ""
},
{
"docid": "f7a7e1e3ac4b3b6ed03c8152311fc01a",
"score": "0.51535726",
"text": "def find_events(query)\n event_lookup(\"?q=#{query}\")\n end",
"title": ""
},
{
"docid": "f7a7e1e3ac4b3b6ed03c8152311fc01a",
"score": "0.51535726",
"text": "def find_events(query)\n event_lookup(\"?q=#{query}\")\n end",
"title": ""
},
{
"docid": "830019c5f7317793059d2804515cf663",
"score": "0.515137",
"text": "def index\n\n if params[\"search\"].present?\n @conn = Faraday.new(url: \"http://api.eventful.com\")\n search_term = params[\"search\"]\n location = params[\"location\"]\n stop = params[\"stop_time\"]\n start = params[\"start_time\"]\n venue_url = params[\"venue_url\"]\n\n response = @conn.get do |req|\n req.url \"/rest/events/search?location=#{location}&keywords=#{search_term}&app_key=ZFL4M9WfctW6Sv8G\"\n req.headers['Content-Type'] = 'application/json'\n end\n\n data = Hash.from_xml(response.body).to_json\n \n # @ events is an array of event hashes\n if JSON.parse(data).first[1][\"events\"] == nil\n @events = \"No events Found\"\n else\n @events = JSON.parse(data).first[1][\"events\"][\"event\"]\n\n @hash = Gmaps4rails.build_markers(@events) do |event, marker|\n marker.lat event[\"latitude\"]\n marker.lng event[\"longitude\"]\n if event[\"title\"]&& event[\"venue_address\"].present?\n marker.infowindow \"<h3>\" + event[\"title\"] + \"</h3><p>\" + event[\"venue_address\"] + \"</p>\"\n else\n marker.infowindow \"<h3>\" + event[\"title\"] + \"</h3><p>\" + \"No address found\" + \"</p>\"\n marker.title event[\"title\"]\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "584bbf3af91c0337be872d28e03623b4",
"score": "0.5122963",
"text": "def index \n @event_type_id = params[:event_type_id]\n @event_type_id ||= 1\n @post_results = Rails.cache.fetch(\"index_#{@class_name}_type#{@event_type_id}_#{@school}\") do\n PostEvent.paginated_post_conditions_with_option(params, @school, @event_type_id)\n end\n @posts = @post_results.paginate({:page => params[:page], :per_page => 10})\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "d1b4dfb842ad648096e087c8355d2491",
"score": "0.51210266",
"text": "def index\r\n q, n = params[:q], params[:n]\r\n \r\n @event_count = Event.count\r\n begin\r\n @limit = Integer(n.to_s)\r\n rescue ArgumentError => e\r\n # in very small repositories, only show 20% of events (mostly for demoing overview timelines)\r\n @limit = [500, @event_count / 5].min\r\n @limit = [25, @limit].max\r\n end\r\n \r\n if q.blank?\r\n @timelines = Timeline.recent(7)\r\n @top_events = Event.where(\"rank > #{RANK_CUTOFF}\").order('rank DESC').limit(@limit).all\r\n else\r\n # TODO. integrate our event / timeline rank value with fulltext hit ranking\r\n @search_term = q\r\n @timelines = Timeline.search(q, :order => 'rank DESC', :limit => 20) \r\n @total_timelines = Timeline.search(q).size\r\n @top_events = Event.search(q, :order => 'rank DESC', :limit => @limit)\r\n @total_events = Event.search(q).size\r\n end\r\n end",
"title": ""
},
{
"docid": "7b3fd27086d9ad485165f1a25c6d861f",
"score": "0.51043993",
"text": "def query_events(params)\n events = Event.all\n\n #Allows the input and output parameters like time and date.\n if params[:date].present?\n date = params[:date].to_date\n events = events.where('date >= ?', date)\n else \n events = Event.where('date >= ?', Date.today)\n end\n\n if params[:food].present?\n if params[:food] != 'Any'\n events = events.where(food_type: params[:food])\n end\n end\n\n #allows for the selection of vegetarian options\n if params[:restrictions] == 'Vegetarian'\n events = events.where(vegetarian: true)\n end\n #allows for selection of vegan options\n if params[:restrictions] == 'Vegan'\n events = events.where(vegan: true)\n end\n\n if params[:time].present?\n \t#allows you to select the times\n events = events.where('time >= ?', params[:time])\n end\n\n events\n end",
"title": ""
},
{
"docid": "4af9f4bd8f87adc6741c86cf7c7ffcf6",
"score": "0.5099047",
"text": "def index\r\n @events = Event.search(params[:search]).paginate(page: params[:page], per_page: 25).order(sort_column + \" \" + sort_direction)\r\n # allows partials to adjust if necessary to render slightly differently if the index or a user's list of events\r\n @index = true\r\n end",
"title": ""
},
{
"docid": "e92c1e4f6c4ae2730315b7e17b7e0829",
"score": "0.5093819",
"text": "def index\n if params[:teachers]\n @events = Event.find(:all, :order => 'updated_at DESC', :conditions => {:open => true}).paginate(:page => params[:page], :per_page => 15)\n else\n @events = Event.find(:all, :order => 'scheduled_time ASC', :conditions => ['scheduled_time >= ? AND open = false', DateTime.now]).paginate(:page => params[:page], :per_page => 15)\n end\n end",
"title": ""
},
{
"docid": "1e89711fae867a4ffac14377a63c4d2e",
"score": "0.5067253",
"text": "def all\n params[:order] = params[:order] ? params[:order].to_i : 0\n \n @events = Event\n \n if params[:title] && !params[:title].empty?\n search = \"%\" + params[:title].sub(\" \", \"%\") + \"%\"\n @events = @events.where('title like ? OR title_eu like ?', search, search)\n end\n \n if params[:type] && params[:type] != \"null\" && !params[:type].empty?\n @events = Event.where('poi_type_id = ?', params[:type])\n end\n\n if params[:order] == 0\n @events = @events.order('created_at desc')\n else\n @events = @events.order('rating desc')\n end\n \n @events = @events.page(params[:page]).per(8) \n\n respond_to do |format|\n format.html # all.html.erb\n format.js # all.js.erb\n end\n end",
"title": ""
},
{
"docid": "3ccf068a7d5eb5b112513672a877a983",
"score": "0.5062775",
"text": "def index\n if logged_in?\n\n @places = Event.order('created_at DESC')\n @events_ordered = Event.order('startdate ASC')\n filter_by_city(params[\"city\"])\n @categories = Category.all\n filter_by_category(params[\"category\"])\n search_results\n # Search by city for paginate\n if params[\"city\"] != nil\n city_events = []\n @events_by_city.each do |e|\n city_events << @events_ordered.find(e)\n end\n @events = city_events.paginate(page: params[:page], per_page: 12)\n else\n # Search by category for paginate\n if params[\"category\"] != nil\n cat_events = []\n @events_by_category.each do |e|\n cat_events << @events_ordered.find(e)\n end\n @events = cat_events.paginate(page: params[:page], per_page: 6)\n else\n @events = @events_ordered.paginate(page: params[:page], per_page: 12)\n end\n end\n\n else\n flash[:danger] = \"You don't have permission to perform this action.\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "e1bc80d6a97ffc79600e20d7766c3ac2",
"score": "0.50627255",
"text": "def search(keyword: nil, near: nil, radius: 10, type: :all, published_within: :all_dates,\n country: nil, exclude_visited: false, exclude_my: false, sort_by: :closest)\n\n @web.get('https://www.waymarking.com/wm/search.aspx') do |page|\n form = page.form_with(action: '/wm/search.aspx') do |f|\n f['ctl00$ContentBody$FilterControl1$txtKeyword'] = keyword.to_s\n f['ctl00$ContentBody$FilterControl1$uxSearchLocation'] = near.to_s\n f['ctl00$ContentBody$FilterControl1$ddlRadius'] = radius.to_s\n # TODO: support all paramters\n end\n result = form.click_button(form.button_with(name: 'ctl00$ContentBody$FilterControl1$btnUpdate'))\n\n #pp result\n\n #puts result.parser\n raise MalformedRequest, '' if result.title.strip != 'Waymark Search Results'\n\n\n return SearchQuery.new(@web, result)\n end\n end",
"title": ""
},
{
"docid": "e0704675d43bf40b42de374c2342ef98",
"score": "0.5059829",
"text": "def events_for target, event_types\n url = GITHUB_EVENT_API_END_POINT % target\n etag = @etag_hash[target]\n last_event = @last_event_hash[target]\n\n events_to_send = []\n page = 1\n while page <= 10\n result = @clnt.get(url, {client_id: @client_id, client_secret: @client_secret}, {\"If-None-Match\" => etag})\n break unless result.status_code == 200\n events = JSON.load result.body\n if page == 1 # etag and last event should be set when querying the very first page\n @etag_hash[target] = result.header[\"etag\"]\n @last_event_hash[target] = events[0]\n end\n\n events.each do |event|\n return events_to_send if last_event == event # no need to proceed\n events_to_send << event if event_types.accept? event\n end\n\n page += 1\n end\n\n events_to_send\n end",
"title": ""
},
{
"docid": "68f2bf16a5d769c4d22cee8afbbb4c4d",
"score": "0.5039276",
"text": "def search\n if params[:query]\n query = \"%#{params[:query].downcase}%\"\n @events = Event.where(\"lower(title) LIKE :query or lower(description) LIKE :query\", :query => query)\n end\n\n respond_to do |format|\n format.html\n format.json { render 'events/index' }\n end\n end",
"title": ""
},
{
"docid": "bebdc64db87b560448935a2ad4a524f2",
"score": "0.5038986",
"text": "def search\n searcher = @admin || @user\n query = params[:query]\n if query.blank?\n redirect_to(:action => 'index', :admin_id => @admin.id)\n else\n query.strip!\n\n case params[:type]\n when 'student' then\n @students = Student.students_of_teacher(searcher).search_data(query, filtered_params)\n when 'teacher' then\n @teachers = searcher.children.unblocked.search_data(query, filtered_params)\n else\n @students = Student.students_of_teacher(searcher).search_data(query, filtered_params)\n @teachers = searcher.children.unblocked.search_data(query, filtered_params)\n end\n end\n end",
"title": ""
},
{
"docid": "93bacc1da2a66829c7c58cf37f64b126",
"score": "0.50368327",
"text": "def search_events(query, version = DEFAULT_API_VERSION)\n options = {:params => {:q => query},\n :api_version => version}\n api_call(:get, 'events', options)\n end",
"title": ""
},
{
"docid": "52bd54985c2be95d4e8b548825ec186c",
"score": "0.503216",
"text": "def events_request(max_pages=100)\n results = []\n max_pages.times do |page|\n # Repeatedly request events, page by page, until we reach the final page\n # of results (or for some maximum number of pages)\n req = MobilizeAmericaRequest.new(@api_key, @org_id, page+1)\n results += req.results\n break if req.last_page?\n end\n results\n end",
"title": ""
},
{
"docid": "604f233de66e7941e2a2f1160156cbb2",
"score": "0.50216675",
"text": "def search(query,types=nil,never_or=nil,extras=nil,start=nil,count=nil)\n result = search_json query,types,never_or,extras,start,count\n return result if not result\n results = result['results'] || []\n api = self\n #\n # This start out nil, because we need to reference classes in\n # types.rb and this gets loaded after this file. There's\n # probably a better way to do this.\n #\n if not @@types2classes\n @@types2classes = {\n 'r' => Artist,\n 'a' => Album,\n 's' => User,\n 't' => Track,\n 'p' => Playlist\n }\n end\n results.map {|o| @@types2classes[o['type']].new(api).fill o}\n end",
"title": ""
},
{
"docid": "d091932900006396770e044cb298047a",
"score": "0.49996537",
"text": "def match_event(query); end",
"title": ""
},
{
"docid": "827fcc6737958f11c16096fc149771ac",
"score": "0.49954504",
"text": "def search_time_sheet_activities(options={})\n cur_date = options[:start]\n method = 'search.messages'\n entries = []\n cnt = 0\n max_cnt = 15\n\n loop do\n fdate = cur_date.strftime('%Y-%m-%d')\n printf \"\\n>>> gathering activities for #{fdate}\"\n \n query = \"in:engineering from:me on:#{fdate}\"\n matches = self.class.get(\"/#{method}\", query: { token: @token, query: query }).tap do |response|\n printf \"v\"\n raise \"error searching for #{query} from #{method}: #{response.fetch('error', 'unknown error')}\" unless response['ok']\n end.fetch(\"messages\").fetch(\"matches\")\n\n entries.concat matches.map{|x| \n printf \".\"\n x['ts'] = DateTime.strptime(x['ts'],'%s').to_time\n {ts: x['ts'], permalink: x['permalink'], text: x['text']}\n }\n\n break unless(cnt > max_cnt or cur_date < options[:stop])\n \n cur_date += (60*60*24)\n cnt += 1\n end\n\n entries = entries.sort_by { |h| h[:ts] }\n end",
"title": ""
},
{
"docid": "b45db5694b966578202233260e0710a6",
"score": "0.4990014",
"text": "def index\n @all_events = Event.where.not(venue_id: $ids_to_exclude).or(Event.where(venue_id: nil))\n\n # if params[:day]\n # @day = Date.parse(params[:day])\n # @events = Event\n # .where.not(venue_id: $ids_to_exclude).or(Event.where(venue_id: nil))\n # .where(:start_time => @day.beginning_of_day..@day.end_of_day)\n # .paginate(page: params[:page])\n # else\n # @events = Event\n # .where.not(venue_id: $ids_to_exclude).or(Event.where(venue_id: nil))\n # .where(:start_time => DateTime.now..DateTime::Infinity.new)\n # .order(:start_time).paginate(page: params[:page])\n # end \n end",
"title": ""
},
{
"docid": "b07713a55468a284eed4fa868c98c9d8",
"score": "0.49628842",
"text": "def index\n \n if (params[:start] && params[:end])\n\n if session[:role_type] == \"Admin\"\n eventsList1 = Event.where(event_date: params[:start]..params[:end], school_id: session[:school_id])\n elsif session[:role_type] == \"Teacher\"\n eventsList1 = Event.where(school_user_id: session[:user_id],event_date: params[:start]..params[:end], school_id: session[:school_id]) \n elsif session[:role_type] == \"Parent\"\n \n studentIds = []\n \n session[:kids_list].each do |kid| \n studentIds.push(kid[\"id\"])\n end\n \n eventsList1 = Event.where(\"classroom_id IN (\"+studentIds * \",\" +\")\") \n\n end\n\n eventsList = Array.new\n \n eventsList1.each do |event|\n events = OpenStruct.new\n events.id = event.id\n events.event_title = event.event_title\n events.event_description = event.event_description\n events.event_time = event.event_time\n events.event_location = event.event_location\n events.school_user_id = event.school_user_id\n events.classroom_id = event.classroom_id\n events.date = event.event_date.to_s + \" \" + event.event_time.to_s\n \n events.date = Time.parse(events.date)\n eventsList.push(events)\n @eventsList = eventsList\n end\n \n end\n \n \n end",
"title": ""
},
{
"docid": "0268082b39cf81ae07e2989505ea953a",
"score": "0.49581623",
"text": "def index\n @events = Event.all\n\t if params[:search]\n\t\t @events = Event.where('lower(name) LIKE ? OR lower(description) LIKE ? OR lower(\"ort\") LIKE ?',\n\t\t\t \"%#{params[:search].downcase}%\", \"%#{params[:search].downcase}%\", \"%#{params[:search].downcase}%\")\n\t end\n end",
"title": ""
},
{
"docid": "97e5c02730792d4ebd5fefb0022f11a6",
"score": "0.49562877",
"text": "def index\n update_events_hash\n render_or_redirect\n @sort_key = sort_key\n @query_key = query_key\n @events = Event.search_description(@query_key, @sort_key)\n end",
"title": ""
},
{
"docid": "893f129bd91a9827154a568535be0c34",
"score": "0.49506366",
"text": "def next_events\n self.around_events.select{|event|\n event.location.present? && event.start_time > self.end_time\n }.sort{|a,b| a.start_time <=> b.start_time}\n end",
"title": ""
},
{
"docid": "041e5cfac4d897ff470592f6f15467e5",
"score": "0.49215916",
"text": "def search\n @results = Tool.ordered_by(params[:order])\n\n if params[:q].present?\n @results = @results.search(params[:q])\n end\n\n if Tool::ALLOWED_TYPES.include?(params[:type])\n @results = @results.where(type: params[:type])\n end\n\n @results = @results.offset(@start).limit(@items)\n\n @total = @results.count(:all)\n end",
"title": ""
},
{
"docid": "f612a1bb5ea936be04c34a02020f3a0a",
"score": "0.49182278",
"text": "def events_in_range(start_date_time, end_date_time, home_time_zone = \"UTC\")\n # fetch not repeating events first\n event_instances = events.where(date: start_date_time...end_date_time, repeat: nil).to_a\n\n # then repeating events\n events.includes(:repeat_exceptions, category: :repeat_exceptions).where.not(repeat: nil).each do |rep_event| # get all repeating events\n event_instances.concat(rep_event.events_in_range(start_date_time, end_date_time, home_time_zone)) # and add them to the event array\n end\n\n event_instances = event_instances.sort_by(&:date) # and of course sort by date\n\n event_instances # and return\n end",
"title": ""
},
{
"docid": "ed9075242a079fb5133ef6eccaf5bd64",
"score": "0.49138257",
"text": "def index\n if params[:search]\n @events = Event.where(name: params[:search])\n else\n @events = Event.all\n end\n end",
"title": ""
},
{
"docid": "7ef8017c6986c3e423da0f58e643da53",
"score": "0.49063647",
"text": "def index\n #Trying to pick sitecity based on closest sitecity to user. \n #user_location = request.location\n #@sitecity = Sitecity.near([user_location.latitude, user_location.longitude], 100).order(\"distance\").first\n\n if params[:tag]\n @events = Event.tagged_with(params[:tag]).order(\"startdatetime asc\").page(params[:page]).per_page(20)\n else\n if params[:sitecity]\n @events = Event.where(sitecity_id: Sitecity.find_by_url(params[:sitecity])).order(\"startdatetime asc\").page(params[:page]).per_page(20)\n else\n if params[:location]\n @events = Event.where(location_id: Location.find_by_url(params[:location])).order(\"startdatetime asc\").page(params[:page]).per_page(20)\n else\n #if Sitecity.near([user_location.latitude, user_location.longitude], 50).any?\n # @events = Event.where(sitecity_id: @sitecity_id).order(\"startdatetime asc\").page(params[:page]).per_page(20)\n #else\n @events = Event.order(\"startdatetime asc\").page(params[:page]).per_page(20)\n #end\n end \n end\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "12a94450bd08db171ead44280b9e460b",
"score": "0.48930162",
"text": "def index\n @events = Event.all\n if params[:search]\n @events= Event.search(params[:search])\n \n end\n \n end",
"title": ""
},
{
"docid": "98d406533259740200c4b037dceaa63e",
"score": "0.48891255",
"text": "def index\n \n #@search = Event.search(params[:search]) \n # @events = @search.all \n #@events = Event.near(yourLocation)\n #@events = Event.near(params[:yourLocation])\n #respond_with @events\n#@events = Event.near(Gmaps.map.userLocation, 2)\n#@events = Event.near([request.location.coordinates], 2)\n#userLocation = params[:latitude], params[:longitude]\n#@events = Event.near(userLocation,2)\n#@json = (Event.near(userLocation,2)).to_gmaps4rails\n#@events = Event.near(userLocation,2)\n#@events = Event.near(params[:latitude], params[:longitude],2)\n#@events = Event.scoped\n#@events = Event.near('Patricks Street, Dublin 8, Ireland', 2)\n#@events = Event.near([\"53.3395715\",\"-6.272263199999998\"], 2)\n#@events = @nearest.nearbys(30)\n@events = Event.all\n#render :stream => true\n\n \n#@events = Event.search(params[:search])\n#@events = Event.near(params[:yourLocation], 2)\n@json = @events.to_gmaps4rails\n#@json = Event.near([\"53.3395715\",\"-6.272263199999998\"], 2).to_gmaps4rails\n # @center = yourLocation.to_gmaps4rails\n\n #@events = Event.order(:title)\n\n respond_to do |format|\n format.html # index.html.erb\n #format.js {render json: @events, content_type: 'text/json' }\n format.json { render :json => @json}\n # format.json { render :file => \"index.json.erb\", :content_type => 'application/json' }\n end\n end",
"title": ""
},
{
"docid": "85947c9287c38fe3af398b13a0b32c68",
"score": "0.4884704",
"text": "def index\n\n @events = Event.where(nil)\n\n @events = @events.search(params[:search]) if params[:search].present?\n\n if params[:price_desc]\n @events = @events.ordered_by_price_desc\n elsif params[:price_asc]\n @events = @events.ordered_by_price_asc\n elsif params[:date_asc]\n @events = @events.ordered_by_date_asc\n elsif params[:date_desc]\n @events = @events.ordered_by_date_desc\n end\n\n if current_user && current_user.admin\n @events\n else\n @events = @events.select {|event| !archived_event(event)}\n end\n\n end",
"title": ""
},
{
"docid": "d5b899d0b119553107ddc0762031f85a",
"score": "0.48810077",
"text": "def future_events(person_or_type = nil)\n conditions_filters = { :date_filter => Time.now.midnight }\n conditions_string = \"date >= :date_filter \"\n if person_or_type\n aud = Event.process_audience(person_or_type)\n conditions_string << \"AND show_for_#{aud.to_s.downcase.pluralize} = :audience_filter\"\n conditions_filters[:audience_filter] = true\n end\n events.find(:all, :conditions => [conditions_string, conditions_filters])\n end",
"title": ""
},
{
"docid": "4c566614b7e497781da8c9d152b184ef",
"score": "0.48620757",
"text": "def index\n @search = Tutorial.search(params[:q])\n @tutorials = @search.result.where(suggestion: false).page(params[:page]).per(5).order('created_at DESC')\n @suggestions = @search.result.where(suggestion: true).page(params[:page]).per(5).order('created_at DESC')\n end",
"title": ""
},
{
"docid": "b3025b611ed2ac52b57f9131610eacbc",
"score": "0.4838791",
"text": "def select_for_event\n \n \t@eventtypes = Eventtype.find(:all, :conditions => [ 'LOWER(description) LIKE ?', '%' + params[:q].downcase + '%' ], :order => 'description ASC', :limit => 8)\n \n \t@eventtypes_hash = @eventtypes.collect! { |x| {\"name\" => x.description, \"id\" => x.id } }\n \n render :partial => \"eventtypes/list_for_select\" \n end",
"title": ""
},
{
"docid": "b5e030e4daa1fb5da09004eb46c1331e",
"score": "0.4831805",
"text": "def search\n @query = params[:q]\n @ads = Ad.within(@city, 30)\n @ads = @ads.fulltext_search(@query).group_by { |x| x.created_at.to_date }\n end",
"title": ""
},
{
"docid": "c75527c2f34503171409292c89da421c",
"score": "0.4813753",
"text": "def nearbyEvents(dist)\n @es = []\n @ufEvents = Event.all\n @ufEvents.each do |e|\n if coordsSet(current_user.id, \"u\") && coordsSet(e.id, \"e\")\n if userDist(current_user.id, e) <= dist.to_i\n @es.push(e)\n end\n #if addrSet(current_user.id, \"u\") && addrSet(e.id, \"e\")\n # if User.find_by(id: current_user.id).country == Event.find_by(id: e.id).country &&\n # User.find_by(id: current_user.id).state == Event.find_by(id: e.id).state\n # @es.push(e)\n # end\n end\n end\n return @es\n end",
"title": ""
},
{
"docid": "d65b9f4872a915441738ab7563599d08",
"score": "0.48088345",
"text": "def index\r\n # @events = HTTParty.get('https://api.meetup.com/find/events/?allMeetups=false&keywords=University+of+Memphis&radius=50&userFreeform=Memphis%2C+TN&mcId=z37501&mcName=Memphis%2C+TN&eventFilter=my',\r\n # :headers =>{'Content-Type' => 'application/json'})\r\n #@categories = Category.all\r\n #@events = Event.where(start: params[:start]..params[:end])\r\n @events = Event.where(\"title LIKE ? OR description LIKE ?\", \"%#{params[:search]}%\", \"%#{params[:search]}%\")\r\n\r\n @hash = Gmaps4rails.build_markers(@events) do |event, marker|\r\n marker.lat event.latitude\r\n marker.lng event.longitude\r\n end\r\n\r\n #@event = Event.find(params[:id])\r\n # @events.each do |event|\r\n # respond_to do |format|\r\n # format.html\r\n # format.json\r\n # format.pdf do\r\n # pdf = EventPdf.new(event)\r\n # send_data pdf.render, filename: \"event_#{event.id}.pdf\", type: 'application/pdf', disposition: \"inline\"\r\n # return false\r\n # end\r\n # end\r\n # end\r\n #commontator_thread_show(@events)\r\n end",
"title": ""
},
{
"docid": "e1e55b1df9f4d8ca33a47a357ba5f417",
"score": "0.4808183",
"text": "def index\n event_queries = {}\n stu_queries = {}\n cur_page = 1\n per_page = 8\n rule_cate = \"\"\n @page_count = 0\n\n #当有查询参数的时候\n if params[:event]\n if !params[:event][:start].blank? && !params[:event][:end].blank?\n start_time = params[:event][:start] + \" 00:00:00\"\n end_time = params[:event][:end] + \" 23:59:59\"\n event_queries.merge!(:created_at=>start_time..end_time)\n end\n #当有违纪类型作为筛选条件的时候\n event_queries.merge!({:rule_type=>params[:event][:rule_type]}) if !params[:event][:rule_type].blank?\n stu_queries.merge!({:grade=>params[:event][:grade]}) if !params[:event][:grade].blank?\n stu_queries.merge!({:class_num=>params[:event][:class_num]}) if !params[:event][:class_num].blank?\n stu_queries.merge!({:name=>params[:event][:stu_name].strip}) if !params[:event][:stu_name].blank?\n # stu_queries.merge!({:grade=>1..6})\n cur_page = params[:page]\n rule_cate = params[:event][:rule_cate] if !params[:event][:rule_cate].blank?\n \n #当上一个操作是删除的时候\n elsif session[:from_destory] == \"yes\"\n event_queries = session[:event_queries]\n stu_queries = session[:stu_queries]\n cur_page = session[:page]\n rule_cate = session[:rule_cate]\n session[:from_destory] = \"no\"\n else\n #其他时候\n event_queries = {:created_at=>Time.now.midnight..(Time.now.midnight + 1.day)}\n cur_page = params[:page]\n end\n\n\n #检查一下当前页数是否因为删除操作而需要-1\n @events = case rule_cate\n when \"n\" then Event.normal\n when \"s\" then Event.serious\n when \"l\" then Event.leave\n when \"late\" then Event.late\n else Event\n end\n\n @page_count = @events.includes(:student).where(\n :students=>stu_queries,\n :events=>event_queries\n ).count\n\n if cur_page && (@page_count.to_f / per_page.to_f) == (cur_page.to_i - 1).to_f\n cur_page = cur_page.to_i - 1\n end\n\n if @page_count > 0\n\n @events_paginate = @events.includes(:student).where(\n :students=>stu_queries,\n :events=>event_queries\n ).paginate(\n :page => cur_page,\n :per_page =>per_page\n )\n end\n \n #保存查询数据。在删除操作完成后,可以恢复之前的查询结果。\n session[:stu_queries] = stu_queries\n session[:event_queries] = event_queries\n session[:page] = cur_page\n session[:rule_cate] = rule_cate\n\n respond_to do |format|\n format.html {}\n format.json { render json: @events }\n format.csv do\n csv_string = CSV.generate do |csv|\n # header row\n csv << [\"学号\", \"学生\", \"班别\",\"事件类型\", \"记录时间\"]\n # data rows\n \n @events_excel = @events.includes(:student).where(\n :students=>stu_queries,\n :events=>event_queries\n )\n \n @events_excel.each do |event|\n student = event.student\n if student\n csv << [\" \" + student.num + \" \",\n student.name,\n student.class_info,\n Event.format_rule_type(event.rule_type),\n event.created_at.strftime(\"%y-%m-%d %I:%M%p\")]\n end\n end\n end\n # send it to the browsah\n send_data csv_string.encode(\"GB18030\"),\n :type => 'text/csv; charset=GB18030; header=present',\n :disposition => \"attachment; filename=#{DateTime.now.strftime(\"%y-%m-%d %I:%M%p\")}.csv\"\n end\n end\n \n end",
"title": ""
},
{
"docid": "be34fca947c8b438516b25bdec765f24",
"score": "0.48052812",
"text": "def index\n #if show/all?tag=tagName\n if !params[:tag].nil?\n events = Event\n .joins(events_tags: :tag)\n .where(tags: {name: params[:tag]})\n\n if !@offset.nil?\n events = events.drop(@offset)\n events = events.take(@limit)\n end\n\n response = {offset: @offset,\n limit: @limit,\n count: events.count,\n data: events}\n\n render json: response, include: [:tags, :creator, :position], status: :ok\n\n #if show/all?search=searchQuery\n #search in name or message of the events\n elsif !params[:search].nil?\n\n events = Event.where(\n \"message LIKE ?\n OR name LIKE ?\",\n \"%#{params[:search]}%\", \"%#{params[:search]}%\")\n response = {query: params[:search],\n count: events.count,\n data: events}\n render json: response, include: [:tags, :creator, :position], status: :ok\n\n # show all events\n else\n events = Event.order(\"updated_at DESC\").all\n if !events.nil?\n\n if !@offset.nil?\n events = events.drop(@offset)\n events = events.take(@limit)\n end\n\n response = {offset: @offset,\n limit: @limit,\n count: events.count,\n data: events}\n render json: response, include: [:tags, :creator, :position], status: :ok\n else\n render json: events.errors, status: :ok\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "8b8bf5607d3a348ea5e2728f55a0a245",
"score": "0.47998223",
"text": "def index\n if (Time.now - @@last_gcalendar_update).to_i > 3600\n Thread::start do\n load_events_from_calendar(\"/calendar/ical/enkarplan.org_j2njaqb2eapip42l32br00afgo%40group.calendar.google.com/public/basic.ics\")\n \n load_events_from_calendar(\"/calendar/ical/enkarplan.org_bhfbtue1pklla91t4u97m9ggno%40group.calendar.google.com/public/basic.ics\")\n \n load_events_from_calendar(\"/calendar/ical/enkarplan.org_5up3mopev5gkg9k17rcijrj0p4%40group.calendar.google.com/public/basic.ics\")\n end\n end\n \n if params[:near]\n near = params[:near].split(',')\n latitude = near[0].to_f\n longitude = near[1].to_f\n \n params[:page] = params[:page] || 0\n params[:limit] = params[:limit] || 10\n \n @pois = Poi.find_by_sql [\"select *, abs(latitude-(?))+abs(longitude-(?)) as 'distance' from pois order by distance asc limit ?, ?;\", latitude, longitude, (params[:page].to_i - 1) * params[:limit].to_i, params[:limit].to_i]\n else\n @pois = Poi.order('created_at desc').page(params[:page]).per(params[:limit] || 10) \n end\n \n if params[:type]\n @pois = @pois.where('poi_type_id = ?', params[:type])\n end\n \n if params[:search]\n search = \"%\" + params[:search].sub(\" \", \"%\") + \"%\"\n @pois = @pois.where('title like ? OR title_eu like ?', search, search)\n end\n \n @verfied = Poi.where('is_verified = ?', true)\n @top_pois = Poi.order('rating desc').limit(4)\n @last_pois = Poi.order('created_at desc').limit(4)\n @next_events = Event.where('ends_at > ?', Time.now).order('starts_at asc').limit(8)\n @last_photos = Photo.where(is_visible_on_index: true).order('created_at desc').limit(8)\n @last_comments = Comment.order('created_at desc').limit(10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pois }\n end\n end",
"title": ""
},
{
"docid": "c0294e7a87cca0b65810cd84f663bfdc",
"score": "0.47892565",
"text": "def fetch_new_tweets(search_query, search_type)\n # max_id is inclusive\n new_tweets = method(\"search_tweets_by_#{search_type}\").call(search_query)\n end",
"title": ""
},
{
"docid": "04cdb049bb0315abe70c89904dc6c770",
"score": "0.47886616",
"text": "def index\n @events = Event.where('event_start >= ?', Date.today).order(:event_start, :time_begin)\n @date_events_hash = @events.group_by(&:event_start)\n end",
"title": ""
},
{
"docid": "35d433ae16df60978b632f1282b80985",
"score": "0.4783529",
"text": "def index\n @organizing_future_events = get_user_organizing_future_events\n @attending_future_events = get_user_attending_future_events\n @nearby_events = get_upcoming_nearby_events_within_radius(5)\n end",
"title": ""
},
{
"docid": "f3e1bb6291819b94d6f177cb84625a7f",
"score": "0.4782687",
"text": "def searchEvents(word)\n @w = word.downcase()\n @ufEvents = Event.all\n @es = []\n @ufEvents.each do |e|\n if e.name.to_s.downcase().include?(@w) ||\n e.description.to_s.downcase().include?(@w) ||\n e.street.to_s.downcase().include?(@w) ||\n e.city.to_s.downcase().include?(@w) ||\n e.state.to_s.downcase().include?(@w) ||\n e.country.to_s.downcase().include?(@w) ||\n User.find_by(id: e.user_id).username.downcase().include?(@w)\n @es.push(e)\n end\n end\n return @es\n end",
"title": ""
},
{
"docid": "92acf989de701176ffc61dc063004c6f",
"score": "0.47710842",
"text": "def find_all_events\n\n\t@event_searches = EventSearch.order('\"bandName\" ASC')\n\tj = 0\n\t\n\twhile j < @event_searches.length\n\tes = @event_searches[j]\n\t\n\tRails.logger.debug \"*****************\" \n\tRails.logger.debug(j)\n\tRails.logger.debug(es.bandName)\n\t\n\t#take this out in production\n\t#es = nil_fields_to_empty_strings(es)\n\t\n\tdo_search(es)\n\t\n\tRails.logger.debug \"*****************\" \n\tj += 1\n\n\tend\n end",
"title": ""
},
{
"docid": "c8258d6300a950dc95788c0303762e2e",
"score": "0.47678825",
"text": "def search\n if params[:key] == AUTHORIZATION_TOKEN && params[:q] == \"discover\"\n @google_places = discover\n @places = PLACES.select do |place|\n (place[:coordinates][:latitude].between?(average_location - 0.01, average_location + 0.01))\n end\n elsif params[:key] == AUTHORIZATION_TOKEN && params[:q]\n params_hash = {\n q: params[:q],\n type: params[:type] || \"bar\"\n }\n @google_places = call(params_hash)\n @places = PLACES.select do |place|\n (place[:name].downcase.include? (params[:q].downcase)) || (place[:coordinates][:latitude].between?(average_location - 0.01, average_location + 0.01))\n end\n\n render_error(\"empty\") if @google_places.empty? && @places.empty?\n elsif params[:q]\n render_error\n else\n render_error(\"missing_params\")\n end\n end",
"title": ""
},
{
"docid": "7b340758172b1487aa2d6bd624b39306",
"score": "0.4765334",
"text": "def send_query(event, page: nil)\n initial = page.nil?\n msg = fetch_message(event, initial)\n lvl = parse_highscoreable(msg, partial: true, array: true)\n format_level_matches(event, msg, page, initial, lvl, 'search')\nrescue => e\n lex(e, \"Error performing query.\", event: event)\nend",
"title": ""
},
{
"docid": "9ca47698c9c16b7c658a223bbd8c4c07",
"score": "0.47625104",
"text": "def get_events\n # conditions = \"starttime >= '#{Time.at(params['start'].to_i).to_formatted_s(:db)}' AND endtime <= '#{Time.at(params['end'].to_i).to_formatted_s(:db)}'\"\n conditions = \"starttime >= '#{params['start'].to_time}' AND endtime <= '#{(params['end']+\" 23:59:59\").to_time}'\"\n if @profile\n @events = @profile.events.where conditions\n else\n conditions += \" AND profile_type = '#{event_params[:profile_type]}'\"\n @events = Event.where conditions\n end\n\n events = []\n @events.each do |event|\n events << {:id => event.id, :title => event.title, :description => event.description || \"Some cool description here...\", :start => \"#{event.starttime.iso8601}\", :end => \"#{event.endtime.iso8601}\", :allDay => event.all_day, :recurring => (event.event_series_id) ? true : false}\n end\n set_profile\n render :text => events.to_json\n end",
"title": ""
},
{
"docid": "fac84c7436a52a537a87ae3ca1338f15",
"score": "0.47593045",
"text": "def search_results(game_type)\n CombinedReplayData.search do\n all do\n any_of do\n with(:p1_rank).between(1..5)\n without(:p1_legend_rank, nil)\n end\n any_of do\n with(:p2_rank).between(1..5)\n without(:p2_legend_rank, nil)\n end\n end\n with(:played_at).greater_than(5.days.ago)\n with(:game_type, game_type)\n facet :p1_class_and_archetype\n facet :p2_class_and_archetype\n end\n end",
"title": ""
},
{
"docid": "fd14c2ce57ddf5219285a19cf0618ab0",
"score": "0.47588342",
"text": "def index\n \tflash[:error]=\"\"\n flash[:alert]=\"\"\n\n logged_in_user = User.find(session[:session_user])\n\n if params[:search]\n \tif(logged_in_user.city_id == 25) #National \n \t\t@events = Event.where(\"event_name LIKE ?\", \"%#{params[:search]}%\")\n @events = @events.paginate(:per_page => 5, :page => params[:page])\n \telse\n \t\t@events = Event.where(:city_id => logged_in_user.city_id).where(\"event_name LIKE ?\", \"%#{params[:search]}%\")\n @events = @events.paginate(:per_page => 5, :page => params[:page])\n \tend\n \n event_count = @events.length\n if event_count < 1\n flash[:alert] = \"No event found\"\n end\n else\n \tif(logged_in_user.city_id == 25) #National\n if (params[:sort] && params[:direction])\n \t\t @events = Event.order(params[:sort] + ' ' + params[:direction])\n @events = @events.paginate(:per_page => 5, :page => params[:page])\n else\n @events = Event.all\n @events = @events.paginate(:per_page => 5, :page => params[:page])\n end\n \telse\n \t\t@events = Event.where(:city_id => logged_in_user.city_id)\n @events = @events.paginate(:per_page => 5, :page => params[:page])\n \tend\n end\n end",
"title": ""
},
{
"docid": "84b22a83a1f29b3e798fa2adfae451b0",
"score": "0.4758538",
"text": "def by_target_type(events)\n return events unless Event::TARGET_TYPES[params[:target_type]]\n\n events.where(target_type: Event::TARGET_TYPES[params[:target_type]].name)\n end",
"title": ""
},
{
"docid": "ab3fb6976af784069e5ee2acf9495385",
"score": "0.47549918",
"text": "def get_results(offset, limit)\n result = Hash.new\n if params[:conditions].blank?\n total = UserInteraction.count\n events = UserInteraction.limit(limit).offset(offset).order(\"updated_at ASC\")\n else\n conditions = JSON.parse(params[:conditions])\n total = build_query(conditions).count\n events = build_query(conditions).limit(limit).offset(offset).order(\"user_interactions.updated_at ASC\")\n end\n result['total'] = total\n result['elements'] = events\n return result\n end",
"title": ""
},
{
"docid": "e8416d0fd3277812d9479f09f51aabf6",
"score": "0.47500402",
"text": "def events_for( class_code )\n Event.select{ |e| e.school_class.class_code == class_code }\n .sort_by{ |e| e[:event_begin_date] }\n .sort_by{ |e| e[:event_begin_time] }\n end",
"title": ""
},
{
"docid": "e819b718e412a1d2e382768dfd735da2",
"score": "0.47484565",
"text": "def process_events events\n @events = Hash.new\n\n # Organize the event based on type\n # http://developer.github.com/v3/activity/events/types/ lists event types.\n events.each do |event|\n @events[event.type] ||= Array.new\n @events[event.type] << event\n end\n @event_types = Hash.new\n @events.each do |key,value|\n @event_types[key.underscore.humanize.sub(' event', '')] = value.count\n end\n end",
"title": ""
},
{
"docid": "d058ed9c8e4a0f877a4372d3ddc167e1",
"score": "0.474639",
"text": "def index\n @result = request.location\n if user_signed_in?\n # @location = GeoIP.new('lib/GeoLiteCity.dat').city(current_user.current_sign_in_ip)\n @location = GeoIP.new('lib/GeoLiteCity.dat').city('110.136.133.185')\n if params[:tag]\n @events = Event.where('city = ? OR country = ?', @location.city_name, @location.country_name).near([@result.latitude, @result.longitude], 5, :units => :km).tagged_with(params[:tag])\n else\n @events = Event.where('city = ? OR country = ?', @location.city_name, @location.country_name).near([@result.latitude, @result.longitude], 5, :units => :km)\n end\n else\n @events = Event.all.near([@result.latitude, @result.longitude], 5, :units => :km)\n end\n end",
"title": ""
},
{
"docid": "ffb3af6c8536c7ddc6c623d9731a7579",
"score": "0.47460383",
"text": "def events_by_date(date)\n date_url = date.strftime(\"%Y/%B/%-d\")\n puts \"events_by_date: #{date_url}\"\n base_url = 'http://events.stanford.edu'\n page_url = base_url + '/' + date_url\n \n page = Nokogiri::HTML(open(page_url))\n event_items = page.css('div.eventItem')\n \n count = 1\n events_parsed = []\n event_items.each do |item|\n href = item.css('div.eventItemText a')[0]['href']\n puts \"\\t Event #{count}: #{href}\"\n event_url = base_url + href\n begin\n event_page = Nokogiri::HTML(open(event_url, HEADERS_HASH))\n rescue Exception=>e\n puts \"\\t\\t Error opening event URL: #{e}\"\n sleep 5\n else\n puts \"\\t\\t ...Parsing\"\n event_content = event_page.css('div#record')[0]\n event = {}\n event[:title] = event_content.css('h1')[0].text\n img = event_content.css('div#sidebar div.image img')\n event[:image_url] = base_url + img[0]['src'] unless img.empty?\n desc = event_content.css('p').select{|p| p.css_path().split('>').length == 4}\n event[:short_desc] = \"\"\n if desc then \n short_desc = desc[0].text.strip\n words = short_desc.split\n if words.length > SHORT_DESC_WORD_COUNT then\n for i in 0..(SHORT_DESC_WORD_COUNT-2) do\n event[:short_desc] += words[i] + \" \"\n end\n event[:short_desc] += \"...\"\n else\n event[:short_desc] = short_desc\n end\n end\n event[:long_desc] = \"\"\n desc.each do |p|\n event[:long_desc] += '<p>' + p.text.strip + '</p>'\n end\n \n dt = event_content.css('dt')\n dd = event_content.css('dd')\n min = [dt.length, dd.length].min\n is_ongoing_event = false\n has_error = false;\n for i in 0..(min-1) do\n if dt[i].text == \"When:\" then\n if (dd[i].text.match(\"Ongoing\")) then\n is_ongoing_event = true\n else\n start_date = DateTime.parse(dd[i].text.sub('.', ','))\n event[:start_date] = start_date\n event[:end_date] = start_date + Rational(2, 24) # assuming 2-hour events\n end\n elsif dt[i].text == \"Where:\" then\n event[:address] = dd[i].text.sub(/\\(Map\\)/, ' ').strip\n elsif dt[i].text == \"Sponsor:\" then\n event[:long_desc] += \"<p>\" + dt[i].text + \" \" + dd[i].text.strip + \"</p>\"\n elsif dt[i].text == \"Contact:\" then\n event[:long_desc] += \"<p>\" + dt[i].text + \" \" + dd[i].text.strip + \"</p>\"\n elsif dt[i].text == \"Admission:\" then\n event[:long_desc] += \"<p>\" + dt[i].text + \" \" + dd[i].text.strip + \"</p>\"\n if is_ongoing_event then\n time_str = dd[i].text[/\\d+(:\\d{2}){0,1}(am|pm) - \\d+(:\\d{2}){0,1}(am|pm)/]\n if !time_str then\n has_error = true \n break \n end\n times = time_str.split('-')\n event[:start_date] = DateTime.parse(date.to_s + ', ' + times[0])\n event[:end_date] = DateTime.parse(date.to_s + ', ' + times[1])\n end\n elsif dt[i].text == \"Audience:\" then\n event[:long_desc] += \"<p>\" + dt[i].text + \" \" + dd[i].text.strip + \"</p>\"\n elsif dt[i].text == \"Permalink:\" then\n event[:long_desc] += \"<p> Link: \" + dd[i].text.strip + \"</p>\"\n if event[:short_desc] == \"\" then\n event[:short_desc] += \"<p> Link: \" + dd[i].text.strip + \"</p>\"\n end\n elsif dt[i].text == \"Tags:\" then\n if dd[i].text == \"\" then\n event[:tags] = COMMON_TAGS\n else\n event[:tags] = dd[i].text.strip + ', ' + COMMON_TAGS\n end\n end\n end # done: dt/dd elements\n if !has_error then\n events_parsed << event\n puts event\n count += 1\n end\n ensure\n sleep 1.0 + rand\n end # done: begin/rescue\n \n end # done: event_items.each\n return events_parsed\nend",
"title": ""
},
{
"docid": "ec7a47f4cf8013f60d23dcfac63e9897",
"score": "0.4743418",
"text": "def search_result\n klass.where(\"object_id = ? AND object_type = ? AND timestamp <= ?\", object_id, object_type, timestamp).order(:timestamp)\n end",
"title": ""
},
{
"docid": "a88b6b368fa7e21d922407df4a7e4258",
"score": "0.47395778",
"text": "def imported_events\n# ImportedEvent.new.search(summary)\n ImportedEvent.find_by_term_and_date(summary,date)\n end",
"title": ""
},
{
"docid": "8886888cb4a63f0cb5e11b775b27108b",
"score": "0.47341946",
"text": "def index\n \n\t@events = Event.order(sort_column + \" \" + sort_direction)\n\t#@events = Event.where(deleted: false)\n\t\n\tif params[:name]\n\t\t@events = @events.where(\"name LIKE ?\", \"%#{params[:name]}%\")\n\tend\n\t\n\tif params[:category_id]\n\t\t@events = @events.where(\"category_id = ?\", params[:category_id])\n\tend\n\t\n\tif params[:venue]\n\t\t@events = @events.where(\"venue LIKE ?\", \"%#{params[:venue]}%\")\n\tend\n\t\n\tif params[:from_date]\n day = params[:from_date][\"written_on(3i)\"];\n \n\t if day.length != 0\n if day.length < 2\n day = \"0\" + day\n end\n\n month = params[:from_date][\"written_on(2i)\"];\n if month.length < 2\n month = \"0\" + month\n end\n date_string = params[:from_date][\"written_on(1i)\"] + \"-\" + month + \"-\" + day;\n \n\t\t@events = @events.where(\"from_date >= ?\", date_string)\n end\n end\n\t\n\tif params[:to_date]\n day = params[:to_date][\"written_on(3i)\"];\n \n\t if day.length != 0\n if day.length < 2\n day = \"0\" + day\n end\n\n month = params[:to_date][\"written_on(2i)\"];\n if month.length < 2\n month = \"0\" + month\n end\n date_string = params[:to_date][\"written_on(1i)\"] + \"-\" + month + \"-\" + day;\n \n\t\t@events = @events.where(\"to_date <= ?\", date_string)\n end\n end\n\t\n\t# limit records to 10 per page\n @events = @events.paginate(page: params[:page], per_page: 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "7c194bf4ddc5ae9233ba41dd88847363",
"score": "0.47277707",
"text": "def get_events_with_records(pool_type, gender_type, team_distinct_best)\n valid_events = []\n @event_types.each do |event_type|\n valid_events << event_type if team_distinct_best.has_record_for?(pool_type.code, gender_type.code, event_type.code, nil)\n end\n valid_events.sort { |n, p| n.style_order <=> p.style_order }\n end",
"title": ""
},
{
"docid": "2d3eb3d767e00ece6df58eddee433383",
"score": "0.4726938",
"text": "def all_events\n @unreads = current_user.unreads\n search_params = params.except(:utf8, :commit, :controller, :action, :page)\n if search_params.present?\n @events = Event.search(search_params, @unreads).order(\"created_at DESC\")\n @events = @events.paginate(:page => params[:page], :per_page => 5)\n else\n @events = Event.all.order(created_at: :desc).paginate(:page => params[:page], :per_page => 5)\n end\n end",
"title": ""
},
{
"docid": "c4d8c3a1e99ac2cebe19ba716c480603",
"score": "0.47260404",
"text": "def search(type, query='*:*', args={}, &block)\n raise ArgumentError, \"Type must be a string or a symbol!\" unless (type.kind_of?(String) || type.kind_of?(Symbol))\n\n sort = args.include?(:sort) ? args[:sort] : 'X_CHEF_id_CHEF_X asc'\n start = args.include?(:start) ? args[:start] : 0\n rows = args.include?(:rows) ? args[:rows] : 1000\n query_string = \"search/#{type}?q=#{escape(query)}&sort=#{escape(sort)}&start=#{escape(start)}&rows=#{escape(rows)}\"\n if args[:keys]\n response = @rest.post_rest(query_string, args[:keys])\n response_rows = response['rows'].map { |row| row['data'] }\n else\n response = @rest.get_rest(query_string)\n response_rows = response['rows']\n end\n if block\n response_rows.each { |o| block.call(o) unless o.nil?}\n unless (response[\"start\"] + response_rows.length) >= response[\"total\"]\n nstart = response[\"start\"] + rows\n args_hash = {\n :keys => args[:keys],\n :sort => sort,\n :start => nstart,\n :rows => rows\n }\n search(type, query, args_hash, &block)\n end\n true\n else\n [ response_rows, response[\"start\"], response[\"total\"] ]\n end\n end",
"title": ""
},
{
"docid": "9abe3b7541e503cc1ad6af804c5a8c69",
"score": "0.47237846",
"text": "def find_events_by_city\n\n locations = EventScraperCli::Location.cities\n\n cities_choices = locations.map do |location|\n {name: \"#{location.city}, #{location.country}\", value: location}\n end\n\n location = @prompt.select('Choose a City to View Events: ', cities_choices, per_page: 30)\n\n show_events_by_location(location)\n\n end",
"title": ""
},
{
"docid": "020c3a9428a0eb54015d563f03b3c506",
"score": "0.4723103",
"text": "def day_events(date, events)\n events.select { |e| e.start_time.to_date == date }\n end",
"title": ""
},
{
"docid": "020c3a9428a0eb54015d563f03b3c506",
"score": "0.4723103",
"text": "def day_events(date, events)\n events.select { |e| e.start_time.to_date == date }\n end",
"title": ""
},
{
"docid": "4f815d7d6307b0eafd79745c88ceb7e9",
"score": "0.47179985",
"text": "def event_types\n meeting_events.includes(:event_type).map(&:event_type)\n end",
"title": ""
},
{
"docid": "473feceb1dc2ed67d4f0db049aec03f1",
"score": "0.47093397",
"text": "def set_search_results(type = nil)\n valid_values = SearchModesHelper::SEARCH_RESULTS\n set_search_feature(:results, type, valid_values, meth: __method__)\n end",
"title": ""
},
{
"docid": "6704177917acce72fa40fe5b12792a32",
"score": "0.47043595",
"text": "def all_posts( opts={} )\n @loc = geo_locate(opts[:location])\n results = []\n 15.times do |page|\n results << geocode(:lat => @loc[:lat], :lng => @loc[:lng], :distance => (opts[:distance] || 10), :per_page=>100, :page=>page+1 ) if @loc and not opts[:keyword]\n results << keyword(:keyword=>opts[:keyword], :per_page=>100, :page=>page+1) if opts[:keyword] and not @loc\n results << geocode_and_keyword(:keyword=>opts[:keyword], :lat => @loc[:lat], :lng => @loc[:lng], :distance => (opts[:distance] || 10), :per_page=>100, :page=>page+1 ) if @loc and opts[:keyword]\n end\n results.flatten!\n\n # get text for each tweet\n @tweets = []\n results.each{ |result| result.each { |t| @tweets << t } }\n\n # get time range of tweets\n @first_time = @tweets.sort!{|a,b| a.created_at <=> b.created_at}.last.created_at\n @last_time = @tweets.first.created_at \n return [@tweets, @first_time, @last_time]\n end",
"title": ""
},
{
"docid": "e3a1c5d8cda62247072209e0b174f32f",
"score": "0.47037137",
"text": "def index\n \n respond_to do |format|\n format.json {\n render json: EventDatatable.new(view_context, @current_account.id)\n }\n format.html {\n @events = @current_account.events.where{ (title =~ my{\"%#{params[:search]}%\"} )}\n .order('starts_at desc')\n .page(params[:page])\n .per(10)\n }\n end\n \n end",
"title": ""
},
{
"docid": "a74acf7b5ba1976c0d08213c6248700e",
"score": "0.47034684",
"text": "def events\n\n @events = Event.where(:enabled => true).includes(:performances)\n @events = @events.where(\"performances.starts_at >= ?\", Time::parse(params[:start])) if params[:start]\n @events = @events.where(\"performances.starts_at <= ?\", Time::parse(params[:end])) if params[:end]\n @events = @events.tagged_with_all(params[:tag]) if params[:tag]\n @events = @events.where(:id => params[:id]) if params[:id] \n respond_to do |format|\n format.xml { render :xml => @events.to_xml( :skip_types => true, :include => ( :performances if params[:include_performances] ) ) }\n end\n \n end",
"title": ""
},
{
"docid": "9ec48fdd9d3c4a0dedf6ccad59bf28f3",
"score": "0.47031572",
"text": "def index\n manage_filter_state\n worker = params[:Worker]\n from = params[:From]\n to = params[:To]\n type = params[:Type]\n code = params[:Code]\n\n # Sunspot re-index is on ag2_timerecord_controller\n if session[:reindex] == true\n timerecord_reindex\n session[:reindex] = nil\n end\n\n @search = TimeRecord.search do\n if !worker.blank?\n with :worker_id, worker\n end\n if !from.blank?\n any_of do\n with(:timerecord_date).greater_than(from)\n with :timerecord_date, from\n end\n end\n if !to.blank?\n any_of do\n with(:timerecord_date).less_than(to)\n with :timerecord_date, to\n end\n end\n if !type.blank?\n with :timerecord_type_id, type\n end\n if !code.blank?\n with :timerecord_code_id, code\n end\n data_accessor_for(TimeRecord).include = [:worker, :timerecord_type, :timerecord_code]\n order_by :timerecord_date, :desc\n order_by :timerecord_time, :desc\n paginate :page => params[:page] || 1, :per_page => per_page\n end\n # @time_records = @search.results.sort_by{ |record| [ record.timerecord_date, record.timerecord_time ] }\n #@time_records = TimeRecord.paginate(:page => params[:page], :per_page => per_page).order(:timerecord_date, :timerecord_time)\n @time_records = @search.results\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @time_records }\n format.js\n end\n end",
"title": ""
},
{
"docid": "ec8fc170e31473ae71d79cdc422cd4d8",
"score": "0.4703079",
"text": "def find_events_by_country\n\n countries = EventScraperCli::Location.countries\n\n events_hash = countries.map do |country|\n {name: country.country, value: country}\n end\n location = @prompt.select('Choose a Country to View Events: ', events_hash, per_page: 30)\n\n events = EventScraperCli::Event.get_events_by_country(location.country)\n\n events_hash = events.map do |event|\n {name: event.name, value: event}\n end\n\n @prompt.select(\"Select a Event: \", events_hash, per_page: 30)\n\n end",
"title": ""
},
{
"docid": "655c4f37a1cc45c7491e6e13ba2b5770",
"score": "0.46966922",
"text": "def index\n @exclude_events = Attendee.select('event_id').where(\"user_id = ?\",current_user.id)\n if(params.has_key?(:tag_id))\n @events = Event.includes(:location)\n .includes(:tag).where(\"date > ? AND tag_id = ? AND events.id NOT IN (?)\", DateTime.now, params[:tag_id], @exclude_events)\n .paginate(page: params[:page],per_page:10)\n # @events = Event.joins(:location).joins(:tag).where(\"date > ? AND tag_id = ? AND events.id NOT IN (?)\", DateTime.now, params[:tag_id],@exclude_events)\n # .paginate(page: params[:page],per_page:10)\n elsif(params.has_key?(:location_id))\n @events = Event.includes(:location).includes(:tag).where(\"date > ? AND location_id = ? AND events.id NOT IN (?)\", DateTime.now,\n params[:location_id],@exclude_events).paginate(page: params[:page],per_page:10)\n else\n @events = Event.includes(:location).includes(:tag).where(\"date > ? AND events.id NOT IN (?)\", DateTime.now, @exclude_events).paginate(page: params[:page],per_page:10)\n end\n @tags = Tag.all\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "a9332a8656cd43fcb4b0ebba8014f110",
"score": "0.46954426",
"text": "def search query, num, offset\n threads = perform :search, :args => [query, num, offset] do |resp|\n resp.map { |t| ThreadSummary.new t }\n end\n end",
"title": ""
},
{
"docid": "7c3ab3c7fae1a2316d7c8bd61858afb1",
"score": "0.4691697",
"text": "def index\n @events_grid = initialize_grid(Event, include: [:customer, :therapist, :location, :room, :service], order: 'events.starts_at')\n @events = Event.all\n @events = Event.between(params['start'], params['end']) if (params['start'] && params['end'])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end",
"title": ""
},
{
"docid": "1e0d80812a559db34ca104ef3427b295",
"score": "0.46846655",
"text": "def index\n @events = Event.all\n if params[:filter] == \"Past\"\n @events = @events.where('start_time < ?', DateTime.now)\n elsif params[:filter] ==\"Future\"\n @events = @events.where('start_time > ?', DateTime.now)\n end\n @events = @events.order('created_at ASC').paginate(:page => params[:page], :per_page => 12)\n end",
"title": ""
},
{
"docid": "91581c7c1f891d52ea7ef637affa0725",
"score": "0.46810856",
"text": "def search_loyalty_events(body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/loyalty/events/search'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.post(\n _query_url,\n headers: _headers,\n parameters: body.to_json\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end",
"title": ""
},
{
"docid": "d275f59980c798df4616acc58832ded1",
"score": "0.46560258",
"text": "def find_best_for_event(event_type, pool_type)\n @swimmer.meeting_individual_results.for_pool_type(pool_type).for_event_type(event_type).is_not_disqualified.exists? ?\n @swimmer.meeting_individual_results.for_pool_type(pool_type).for_event_type(event_type).is_not_disqualified.sort_by_timing('ASC').first.get_timing_instance :\n nil\n end",
"title": ""
}
] |
49b1760c96b30d9dfbd753f52a7f6ead
|
Public: Gets the messages for this timeline. options Hash of options to filter the message output. :max_count Fixnum specifying the number of commits to show. Default: 30. :skip Fixnum specifying the number of commits to skip. :page Fixnum of the current page. This is used to implicitly calculate the :skip option. Default: 1 Returns an Array of Grit::Commit instances.
|
[
{
"docid": "8702c833c0167e3daab836d70cb481e4",
"score": "0.58843404",
"text": "def messages(options = nil)\n @repo.messages(self, MessagesOptions.fill(options))\n end",
"title": ""
}
] |
[
{
"docid": "f37b35865a16f1147e0a2ea76a99005f",
"score": "0.7243516",
"text": "def messages(options = {})\n options[:no_merges] = true\n options[:max_count] ||= 30\n options[:skip] ||= begin\n options[:max_count] * ([options.delete(:page).to_i, 1].max - 1)\n end\n @grit.log(@user, nil, options).\n delete_if { |commit| commit.parents.size != 1 }\n end",
"title": ""
},
{
"docid": "738f57239032dae77025f2e44f6e68f9",
"score": "0.65233153",
"text": "def get_commit_messages(repo,time)\n \t@commits = @client.commits_since(repo, time )\n \treturn @commits\n end",
"title": ""
},
{
"docid": "b76f0a804160e4f4d568733673de63ba",
"score": "0.61147225",
"text": "def messages(options = {})\n messages = self.connection(:comments, options)\n messages.map! do |message|\n Message.new(message[:id], message.merge(\n :access_token => options[:access_token] || self.access_token\n ))\n end\n end",
"title": ""
},
{
"docid": "33ef448e5aacc1add38575671daf9ff0",
"score": "0.5936579",
"text": "def messages(opts = {})\n messages = connection.get(connection.build_url(\"messages\", opts)).body\n messages.map!{|hash| hash.values.first}\n end",
"title": ""
},
{
"docid": "6830c23795605e1ab5de8f52609b348c",
"score": "0.59351766",
"text": "def messages\n ret = Array.new\n while msg = pop_message\n ret << msg\n end\n ret\n end",
"title": ""
},
{
"docid": "2983bd740f097e950b8da6b08c8538ae",
"score": "0.5910878",
"text": "def commits_list(repo)\n puts \"#{Time.now}: Get commit messages on github:#{repo}, rate limit: #{@client.rate_limit}\"\n\n # check the rate limitaion of GitHub API\n check_rate_limit_and_sleep\n\n # for the first page\n first_response = @client.commits(repo, :per_page => 100)\n # extract necessary data from response\n commits = parse_commits(repo, first_response)\n # output to file\n puts_file commits\n\n # for the next page\n last_response = @client.last_response\n while last_response && last_response.rels[:next]\n # each page\n last_response = last_response.rels[:next].get\n last_commits = parse_commits(repo, last_response.data)\n puts_file last_commits\n\n # adjust request speed on each page\n sleep 1\n end\n\n end",
"title": ""
},
{
"docid": "e63badbcb8d0a50771a1ef05b72066ce",
"score": "0.588942",
"text": "def peek_messages(options)\n (options[:count] || 1).times.map do |x|\n opts = options.dup\n opts[:message_position] = (opts[:message_position].to_i + x + 1).to_s\n peek_message(opts)\n end.compact\n end",
"title": ""
},
{
"docid": "f6000d6dde6f74bcbab120ec7c31ae86",
"score": "0.5862012",
"text": "def get_commit_messages_by_commit_times (tailTime, headTime = nil)\n raise ArgumentError, 'Tail time parameter is nil' if tailTime.nil?\n \n headCommit = @repository.commits.tip\n headCommitDate = headCommit.date\n \n if headTime.nil?\n headTime = headCommitDate.to_time\n else\n headTime = date_converter(headTime.to_s)\n end\n tailTime = date_converter(tailTime.to_s)\n \n commit_messages = []\n \n @repository.commits.each do |commit|\n if headTime >= date_converter(commit.date.to_s) && date_converter(commit.date.to_s) >= tailTime\n commit_messages.push(commit.message)\n end\n end\n \n commit_messages\n end",
"title": ""
},
{
"docid": "bb5ca8a3e24287f34dc29e0055c9f2e7",
"score": "0.58439445",
"text": "def get_messages(arg = nil)\n if arg.nil? #if no page number specified - get total number of messages\n response = self.class.get(\"/message_threads\", headers: { \"authorization\" => @auth_token })\n #make as many requests as there are pages, +1 to round up\n @messages = (1..(response[\"count\"]/10 + 1)).map do |n|\n self.class.get(\"/message_threads\", body: { page: n }, headers: { \"authorization\" => @auth_token })\n end\n pp @messages\n else\n response = self.class.get(\"/message_threads\", body: { page: arg }, headers: { \"authorization\" => @auth_token })\n @messages = JSON.parse(response.body)\n pp @messages\n end\n end",
"title": ""
},
{
"docid": "84714090e2498b39938d69be78623918",
"score": "0.58354574",
"text": "def get_messages(opts = {})\n data, _status_code, _headers = get_messages_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "cc02c3d9f5eacabf244c44b1f0b7218c",
"score": "0.58279216",
"text": "def commit_messages\n revisions.map do |revision|\n commit = repo.lookup(revision)\n commit.message\n end\n end",
"title": ""
},
{
"docid": "73da9c08adb6533b10d634f3279d5507",
"score": "0.58222044",
"text": "def messages(auth, channel_id, amount, before = nil, after = nil, around = nil)\n MijDiscord::Core::API.request(\n :channels_cid_messages,\n channel_id,\n :get,\n \"#{MijDiscord::Core::API::APIBASE_URL}/channels/#{channel_id}/messages?limit=#{amount}#{\"&before=#{before}\" if before}#{\"&after=#{after}\" if after}#{\"&around=#{around}\" if around}\",\n Authorization: auth\n )\n end",
"title": ""
},
{
"docid": "59c72ba2f2ae8d756931985185f09fcb",
"score": "0.57951695",
"text": "def get_messages(page = 1)\n options = @options\n options[:query] = { page: page }\n response = self.class.get(\"/message_threads\", options)\n @messages = JSON.parse(response.body)\n puts JSON.pretty_generate(@messages, { indent: \" \" })\n end",
"title": ""
},
{
"docid": "a2e0e987decd452f05d202f47ffce9f4",
"score": "0.57933",
"text": "def messages count = 50\n ids = Padrino.cache.smembers self.key\n ids = [] if ids.nil?\n\n return Message.where(:id => ids).order(:created_at).limit(count)\n end",
"title": ""
},
{
"docid": "12e1f4d934622a948122fd823f52268c",
"score": "0.5758709",
"text": "def messages(timeline, struct)\n Entry.from(@grit.log(timeline.user, nil, struct.to_options).\n delete_if { |commit| commit.parents.size != 1 })\n end",
"title": ""
},
{
"docid": "c88da697f0f78e734d34cc585768cc06",
"score": "0.5724503",
"text": "def retrieve_commits\n log = execute(git_cmd('log', '--notes=tinyci*', '--format=%H %ct %N§§§', '--reverse'))\n lines = log.split('§§§')\n\n lines.map { |l| format_commit_data(l) }.select { |c| c[:result].nil? }\n end",
"title": ""
},
{
"docid": "bdd020015fbd95876e04b4d0f293f5cb",
"score": "0.5699844",
"text": "def fetch_messages(opts = {}, &block)\n opts[:since] = opts[:since].to_i if opts[:since].kind_of?(Time)\n filter = opts.delete(:search)\n if filter\n filter = Regexp.new(filter.split(/\\s+/).join(\"|\"), Regexp::IGNORECASE)\n end\n\n feed = @client.get_connections(opts.delete(:page_id), \"feed\", opts)\n loop do\n feed.each do |item|\n if !item['message']\n next\n end\n\n message_data = {\n :id => item['id'],\n :source => 'facebook',\n :thread => item['id'],\n :body => item['message'],\n :sender_name => item['from']['name'],\n :sender => item['from']['id']\n }\n\n if !filter\n block.call Message.build(message_data)\n elsif message_data[:body] =~ filter\n block.call Message.build(message_data)\n end\n\n end\n feed = feed.next_page\n\n break if feed.nil?\n end\n end",
"title": ""
},
{
"docid": "898f1387774ea8d8405ea89e68cdb343",
"score": "0.5687562",
"text": "def messages\n return @messages\n end",
"title": ""
},
{
"docid": "898f1387774ea8d8405ea89e68cdb343",
"score": "0.5687562",
"text": "def messages\n return @messages\n end",
"title": ""
},
{
"docid": "898f1387774ea8d8405ea89e68cdb343",
"score": "0.5687562",
"text": "def messages\n return @messages\n end",
"title": ""
},
{
"docid": "c7ed46beb7aac849c6ef1caf458a9316",
"score": "0.5685663",
"text": "def messages\n @messages ||= @message_list.map.with_index do |payload, index|\n Message.new(payload, starting_channel_sequence + index)\n end\n end",
"title": ""
},
{
"docid": "4059aeee4d76b2cbe6a926ae82a4022c",
"score": "0.56766945",
"text": "def get_messages(page_num = nil)\r\n if page_num == nil\r\n response = self.class.get(\"/message_threads\", headers: { \"authorization\" => @auth_token })\r\n else\r\n response = self.class.get(\"/message_threads?page=#{page_num}\", headers: { \"authorization\" => @auth_token })\r\n end\r\n @messages = JSON.parse(response.body)\r\n end",
"title": ""
},
{
"docid": "28c6dc3ea679e531846810ccd5dec03d",
"score": "0.5670891",
"text": "def messages\n @messages ||= Sumo::Collection.new(\n :get_values => proc { |hash| self.get_messages(hash) },\n :get_status => proc { self.status },\n :count_key => 'messageCount'\n ).each\n end",
"title": ""
},
{
"docid": "b971654300fc5de28d80a0a8fb17cdcc",
"score": "0.5661958",
"text": "def chat_messages *args\n other_user_id, page, per_page, options = TibbrResource.extract_params(args)\n thread_key = options[:thread_key]\n messages_since = options[:messages_since]\n TibbrResource.paginate_collection(get(:chat_messages,\n :params => {:other_user_id => other_user_id,\n :thread_key => thread_key,\n :messages_since => messages_since,\n :page=>page, :per_page=>per_page}), Message)\n end",
"title": ""
},
{
"docid": "a18e1c4f3387051174fb9b2bbbb2c119",
"score": "0.56435114",
"text": "def chat_messages(start_index=nil, end_index=nil)\n messages = @instance.client.getChatHistory(:padID => @id, :start => start_index, :end => end_index)[:messages]\n messages.map do |msg|\n attrs = {padID: @id}.merge(msg)\n ChatMessage.new(@instance, attrs)\n end\n end",
"title": ""
},
{
"docid": "d8d043181d054a2119f594805aacc46a",
"score": "0.5638738",
"text": "def messages\n @messages ||= []\n end",
"title": ""
},
{
"docid": "d8d043181d054a2119f594805aacc46a",
"score": "0.5638738",
"text": "def messages\n @messages ||= []\n end",
"title": ""
},
{
"docid": "b9ce2654fb94a2b7378a405ed81cc1a7",
"score": "0.5633256",
"text": "def messages\n Mail::IMAP.new(retriever_settings).all(:delete_after_find => true)\n end",
"title": ""
},
{
"docid": "a1573b08dbae966baa7d140a1cd6dedb",
"score": "0.5613535",
"text": "def validate_messages\n unless @importer.commits.all? { |c| c.message.present? }\n return ['one or more commits are missing a message']\n end\n\n []\n end",
"title": ""
},
{
"docid": "98dd0e702e9970d735cfc7100a1837df",
"score": "0.56033826",
"text": "def get_repo_commits(repo, limit)\n commits = []\n response = get_github_api(repo, 'commits')\n response.each do |commit|\n commits << {\n 'sha' => commit['sha'],\n 'date' => commit['commit']['author']['date'],\n }\n break if limit == 1\n end\n puts \" - Commits: #{commits.length}\" if commits.length > 0\n commits\n end",
"title": ""
},
{
"docid": "7f9136bc43ba4b913080a9e24ed65f30",
"score": "0.557259",
"text": "def get_messages(chat, options = {})\n with_history(chat) do |history|\n messages = history.dup\n\n if options.has_key?(:from)\n messages.keep_if { |msg| msg.from_name =~ /#{options[:from]}/i }\n end\n\n if options.has_key?(:to)\n messages.keep_if { |msg| msg.to =~ /#{options[:to]}/i }\n end\n\n messages\n end\n end",
"title": ""
},
{
"docid": "bf4064027e75750ac15ab06ad8932d1f",
"score": "0.5552497",
"text": "def messages(options={})\n search = {:campaignId => id}.merge(options)\n Message.all(search)\n end",
"title": ""
},
{
"docid": "110c332b579f3a35cf52c79c13af51f5",
"score": "0.5546608",
"text": "def get_important_messages\n # TODO load more messages using :offset\n @a.messages.get(count: MAX_MSG_GET_COUNT, filters: 8)[\"items\"]\n end",
"title": ""
},
{
"docid": "dedbd6fe33a21968ed32a42b38bb1307",
"score": "0.55349153",
"text": "def messages\n []\n end",
"title": ""
},
{
"docid": "910197c5b6739b3872ff63e1c1410781",
"score": "0.54988384",
"text": "def list_courier_messages(opts = {})\n data, _status_code, _headers = list_courier_messages_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "9cc0c2dbbc6a67aca783192e932ec8c3",
"score": "0.5490991",
"text": "def messages\n @messages_with_timestamps.map{|m,t| m }\n end",
"title": ""
},
{
"docid": "93dd4e3208d0032e13c10c9f84fdc533",
"score": "0.5488434",
"text": "def most_recent_messages\n\t\tmessages(true).map(&:get_current_message)\n\tend",
"title": ""
},
{
"docid": "fb46a6523902b8728fd9c2a8696baf3b",
"score": "0.5471039",
"text": "def messages(options = {})\n messages = get_messages(options[:mailbox_type])\n\n if options[:read] == false || options[:unread]\n messages = messages.unread #(notifiable)\n end\n\n messages\n end",
"title": ""
},
{
"docid": "d453294cac7de2b333d6d276b9a6eab0",
"score": "0.5448421",
"text": "def get_commit_messages_by_tag_name(tailTagName, headTagName=nil)\n raise ArgumentError, 'Tail tag name is nil' if tailTagName.nil?\n \n commit_messages = []\n @repository.commits.each do |commit|\n if commit.tags_names.include? tailTagName\n commitTailTagDate = commit.date.to_s\n @commitTailTagDate = commitTailTagDate\n end\n if commit.tags_names.include? headTagName\n commitHeadTagDate = commit.date.to_s\n @commitHeadTagDate = commitHeadTagDate\n end\n end\n \n result = get_commits_by_time_with_hours(@commitTailTagDate,@commitHeadTagDate)\n return result\n end",
"title": ""
},
{
"docid": "5b33a829f629056bd43a957ce27eae4b",
"score": "0.5444508",
"text": "def commits(start = 'master', max_count = 10, skip = 0)\n options = {:max_count => max_count,\n :skip => skip}\n\n Commit.find_all(self, start, options)\n end",
"title": ""
},
{
"docid": "bbcdf186cbdeb42cfe9b7f2d5969fc8f",
"score": "0.5431506",
"text": "def messages(fields, limit)\n raise NotImplementedError, 'Implement this method in a child class - messages'\n end",
"title": ""
},
{
"docid": "7955ed0162c556d997c69040f0ab385e",
"score": "0.5420488",
"text": "def messages\n messages = []\n parse(MSG_REGEX) do |info|\n messages << info.first\n end\n messages\n end",
"title": ""
},
{
"docid": "01648f6ff8d44522c52f90a587add8b6",
"score": "0.54181373",
"text": "def messages\n Message.all\n end",
"title": ""
},
{
"docid": "db8f6b21357ab517ddb928435e292418",
"score": "0.5413906",
"text": "def list(options, params={})\n Rails.logger.info \">> Gihub commits API: #{options[:user]} #{options[:repo]}\"\n path = \"/repos/#{options[:user]}/#{options[:repo]}/commits\"\n\n Rails.logger.info \">> Gihub commits API: path: #{path}\"\n @connection.get(path, params).map do |commit_data|\n GitHubApi::Commit.new(self, commit_data)\n end\n end",
"title": ""
},
{
"docid": "ec39993150c98dcc5b858f9fc1f2104b",
"score": "0.5413632",
"text": "def messages\n @set.map(&:message).sort\n end",
"title": ""
},
{
"docid": "01436ab6bc252f3d3993b42feb551e5a",
"score": "0.54059505",
"text": "def commits(start = 'master', max_count = 10, skip = 0)\n options = {:max_count => max_count,\n :skip => skip}\n \n Commit.find_all(self, start, options)\n end",
"title": ""
},
{
"docid": "19a528213825c0d7b9b497c22113bfe3",
"score": "0.5397011",
"text": "def query_messages(options = nil)\n require_relative 'message'\n @api.cursor(Message, get_base_api_path() + \"/messages\", options)\n end",
"title": ""
},
{
"docid": "19a528213825c0d7b9b497c22113bfe3",
"score": "0.5397011",
"text": "def query_messages(options = nil)\n require_relative 'message'\n @api.cursor(Message, get_base_api_path() + \"/messages\", options)\n end",
"title": ""
},
{
"docid": "19a528213825c0d7b9b497c22113bfe3",
"score": "0.5397011",
"text": "def query_messages(options = nil)\n require_relative 'message'\n @api.cursor(Message, get_base_api_path() + \"/messages\", options)\n end",
"title": ""
},
{
"docid": "19a528213825c0d7b9b497c22113bfe3",
"score": "0.5397011",
"text": "def query_messages(options = nil)\n require_relative 'message'\n @api.cursor(Message, get_base_api_path() + \"/messages\", options)\n end",
"title": ""
},
{
"docid": "05d0d6e29da528f3539807e9b169b9da",
"score": "0.53967905",
"text": "def last_n_messages n = 1\n messages(:per_page => n, :page => 1)\n end",
"title": ""
},
{
"docid": "294de9400a1942bfa57f6ef43b7af1f2",
"score": "0.539515",
"text": "def get_messages\n ensure_client & ensure_uri\n response = @client.rest_get(\"#{self['uri']}/messages\")\n @client.response_handler(response)\n end",
"title": ""
},
{
"docid": "0875a84fd48707c30fb5bbae61df2592",
"score": "0.53880525",
"text": "def messages\n object.messages\n end",
"title": ""
},
{
"docid": "436b838e976a315f9ba8558c15569c12",
"score": "0.5378869",
"text": "def all_messages\n # @comments = Comment.all.order(created_at: :asc)\n @comments = Comment.all.order(created_at: :asc).paginate(:page => params[:page], :per_page => 20)\n end",
"title": ""
},
{
"docid": "f70342d29616a942e7aa50c86d51da87",
"score": "0.53744143",
"text": "def branch_commits\n commits = log(log_size_limit).entries\n commits\n end",
"title": ""
},
{
"docid": "9a7516a5a390ab176d352281710ab159",
"score": "0.5373105",
"text": "def messages\n return [] if data['messages'].nil?\n \n result = []\n \n data['messages'].each do |message|\n result << OpenStruct.new({\n :address => address,\n :time => Thimbl::Utils.parse_time( message['time'] ),\n :text => message['text']\n })\n end\n \n result = result.sort { |a,b| a.time <=> b.time }\n \n return result\n end",
"title": ""
},
{
"docid": "24f2b42a19dfa83a259aff25d9a7f16f",
"score": "0.5352054",
"text": "def recent_messages\n twilio_client.account.messages.list || []\n rescue StandardError => e\n e.message\n end",
"title": ""
},
{
"docid": "b74f84cfc93c64537de07529fb4f1969",
"score": "0.5340221",
"text": "def message_log\n @messages = current_account.marketing_messages.manual.paginate({\n :page => params[:page], \n :per_page => PER_PAGE, \n :order => \"created_at DESC\" })\n end",
"title": ""
},
{
"docid": "0c4adb4a66ff982ceee2552b48d28597",
"score": "0.5334322",
"text": "def messages\n @messages ||= Message.new(self)\n end",
"title": ""
},
{
"docid": "ca0ed5c49b1ee6a2f3728cfc7b9f2ac7",
"score": "0.5331606",
"text": "def get(options={})\n res = @client.parse_response(@client.get(path(options), options))\n ret = []\n res[\"messages\"].each do |m|\n ret << Message.new(self, m, options)\n end\n if options[:n] || options['n']\n return ret\n else\n if ret.size > 0\n return ret[0]\n else\n return nil\n end\n end\n end",
"title": ""
},
{
"docid": "f02c8ab97901b0ae05798772441e6077",
"score": "0.53268176",
"text": "def messages\n message_names.collect {|name| message_content(name) }\n end",
"title": ""
},
{
"docid": "22f04b56a8fcca458e6f784e78a21c85",
"score": "0.5315956",
"text": "def getNewMessages\n newmessages = @messages[@lastMessageRead..@messages.length]\n @lastMessageRead = @messages.length\n return newmessages\n end",
"title": ""
},
{
"docid": "330aa25c88df171fa52b7db2ef0c2803",
"score": "0.5304075",
"text": "def list_messages(scope)\n\t\tRails.logger.info('Gmail list messages called - scope: ' + scope)\n\t\tmessages = []\n\t\tnext_page_token = nil\n\t\tloop do\n\t\t\tresults = list_messages_page(scope, next_page_token)\n\t\t\tmessages += results['messages'] if results['messages']\n\t\t\tnext_page_token = results['nextPageToken']\n\t\t\tbreak if results['nextPageToken'].nil?\n\t\tend\n\t\tRails.logger.info('Gmail list messages complete - results count: ' + messages.count.to_s)\n\t\tnotify_slack(scope) if messages.count == 0\n\t\tmessages\n\tend",
"title": ""
},
{
"docid": "8b8b00919f53da57e232df4c6ea025c9",
"score": "0.5301368",
"text": "def messages\r\n []\r\n end",
"title": ""
},
{
"docid": "21452d5968f37d615748e197bb184af2",
"score": "0.5301259",
"text": "def get_messages(page, page_size, opts = {})\n data, _status_code, _headers = get_messages_with_http_info(page, page_size, opts)\n data\n end",
"title": ""
},
{
"docid": "11fad328d55b0a468ed6139976ce78b1",
"score": "0.5299279",
"text": "def get_messages\n @connection.select(@in_folder)\n # Fetch only un-fetched messages if sync_messages option is set, all otherwise\n query = @sync_messages ? 'UNKEYWORD $fetched' : ['ALL']\n @connection.uid_search(query).each do |uid|\n msg = @connection.uid_fetch(uid,'RFC822').first.attr['RFC822']\n begin\n process_message(msg)\n add_to_processed_folder(uid) if @processed_folder\n rescue\n Rails.logger.info(\"Fetcher: Message processing failed:\")\n Rails.logger.info($!)\n handle_bogus_message(msg)\n end\n # Mark message as fetched\n @connection.uid_store(uid, \"+FLAGS\", ['$fetched']) if @sync_messages\n # Mark message as deleted \n @connection.uid_store(uid, \"+FLAGS\", [:Seen, :Deleted]) unless @keep_messages\n end\n end",
"title": ""
},
{
"docid": "40689910f1ca60a66acf1c4c71a77f5c",
"score": "0.52947617",
"text": "def get_messages(query, opts = {})\n data, _status_code, _headers = get_messages_with_http_info(query, opts)\n return data\n end",
"title": ""
},
{
"docid": "f6591646cdbc62780b2add43f1621d14",
"score": "0.529276",
"text": "def get_conversation_canned_messages(opts = {})\n data, _status_code, _headers = get_conversation_canned_messages_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "1a7a2465a1979d45296042abb0c50448",
"score": "0.52832735",
"text": "def all\n @messages\n end",
"title": ""
},
{
"docid": "4afae230d44d661f57f11956736f1808",
"score": "0.52772456",
"text": "def all_messages\n @entries.find_all{ |entry_| entry_.type == :message }\n end",
"title": ""
},
{
"docid": "6b8cb5665c1285bf0d15c6d370472409",
"score": "0.5253393",
"text": "def parse_messages(messages)\n output = []\n\n messages.map do |message|\n message.scan(MESSAGE_REGEX).map do |file, line, type, msg|\n type = MESSAGE_TYPE_CATEGORIZER.call(type)\n text = \" #{file}:#{line}\\n #{msg}\"\n output << Overcommit::Hook::Message.new(type, file, line.to_i, text)\n end\n end\n\n output\n end",
"title": ""
},
{
"docid": "a9c37ce388dce55569daf8ae55c6d721",
"score": "0.5252504",
"text": "def direct_messages( since_id = nil, max_id = nil , count = nil, page = nil )\n\t\tbegin\n\t\t\tparams = (\n\t\t\t\t{ :since_id => since_id, :max_id => max_id, :count => count, :page => page }.collect { |n| \"#{n[0]}=#{n[1]}\" if n[1] }\n\t\t\t).compact.join('&')\n\t\t\tresponse = access_token.get('/direct_messages.json' + ( params.empty? ? '' : '?' + params ) )\n\t\t\tcase response\n\t\t\twhen Net::HTTPSuccess\n\t\t\t\tmessages=JSON.parse(response.body)\n\t\t\t\traise TwitterOauth::UnexpectedResponse unless messages.is_a? Array\n\t\t\t\tmessages\n\t\t\telse\n\t\t\t\traise TwitterOauth::APIError\n\t\t\tend\n\t\trescue => err\n\t\t\tputs \"Exception in direct_messages: #{err}\"\n\t\t\traise err\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a62933f887fa83bfeceeb92ed56c39cf",
"score": "0.52435356",
"text": "def get_messages(last_received)\n last_received ||= -1\n @messages[(last_received+1..last_message_num)]\n end",
"title": ""
},
{
"docid": "fcf6ce5a40a6592099f1a460cd722541",
"score": "0.52278",
"text": "def next_messages\n Array.new.tap do |messages|\n while msg = next_message do\n messages << msg\n end\n end\n end",
"title": ""
},
{
"docid": "c65fb7aedeaa46705c1d3f7819ebe324",
"score": "0.52265394",
"text": "def messages\n\t\tMessage.with(self.id)\n\tend",
"title": ""
},
{
"docid": "cb7154ea9e9caf6758479490cb0d5292",
"score": "0.52200705",
"text": "def messages\n query = Stat.ivr_message_query(branch_ids, started, ended)\n # where(\"entries.is_active=1\").\n # where(\"entries.is_private=1\").\n # where([\"entries.branch_id in (?) \", branch_ids]).\n # where(\"entries.forum_session_id > 0 \").\n # where(\"entries.created_at\"=>started..ended)\n\n numbers = query.select(\"branch_id, count(entries.id) AS total\").\n group(:branch_id)\n hsh = set_hash(numbers)\n \n sorted = SortedEntry.includes(:branch).\n where([\"entry_id in (?) AND rank>0\", query.all.map{|a| a.id}])\n hsh[:new] = hsh[:total] - sorted.size\n hsh\n end",
"title": ""
},
{
"docid": "81bf1d7b46502a5ca4765fa5128e89ac",
"score": "0.52199715",
"text": "def messages\n message.text\n end",
"title": ""
},
{
"docid": "9d609ea8adb30367598d3f9386cb7e83",
"score": "0.5219008",
"text": "def messages\n self.class.messages\n end",
"title": ""
},
{
"docid": "118564c3c18fcdc3d519a3267bd64bc1",
"score": "0.52174324",
"text": "def release_commit_messages\n last_commit_url = Rails.configuration.x.release[:commit_url]\n commit_msgs = Rails.configuration.x.release[:commit_msgs].split(/\\n/)\n parent_commit_indicator = \"%5E\" # URL-encoded '^' char\n commit_msgs_html = \"<div class='gh-commit-msgs'>\"\n commit_msgs.each_with_index do |commit_msg, index|\n commit_msgs_html += \"<a target='_blank' href='#{last_commit_url}\" +\n \"#{parent_commit_indicator * index}'>#{commit_msg}</a><br>\"\n end\n commit_msgs_html += \"</div>\"\n end",
"title": ""
},
{
"docid": "2455b2f782f98d74facff54347dfac98",
"score": "0.5214169",
"text": "def get_more_messages\n @messages = @conversation.get_messages_before(params[:before]).reverse\n @has_more_messages = @conversation.has_messages_before?(@messages.first)\n end",
"title": ""
},
{
"docid": "2455b2f782f98d74facff54347dfac98",
"score": "0.5214169",
"text": "def get_more_messages\n @messages = @conversation.get_messages_before(params[:before]).reverse\n @has_more_messages = @conversation.has_messages_before?(@messages.first)\n end",
"title": ""
},
{
"docid": "9af5bbe35434a2b5c1d6f46c720a687a",
"score": "0.52137715",
"text": "def organization_mail_messages(id:, **args)\n params = parameters(args) do\n optional_params :start, :limit\n end\n request(:get, \"organizations/#{id}/mailMessages\", params)\n end",
"title": ""
},
{
"docid": "8de28c9d7dd1533e8603475c0ab83787",
"score": "0.52032053",
"text": "def getSentMessages *args\n options=fill_args [:count,:page],[],*args\n request \"/Message/getSentMessages.json\", options\n end",
"title": ""
},
{
"docid": "9f441b98ba376ee41085af5105bd43bb",
"score": "0.52000827",
"text": "def commits(options={})\n return enum_for(:commits,options) unless block_given?\n\n arguments = [\n '--name-only',\n '--pretty=format:%H~|~%P~|~%T~|~%at~|~%an~|~%ae~|~%s~|~%b~|~'\n ]\n\n if options[:limit]\n arguments << \"-#{options[:limit]}\"\n end\n\n if (options[:commit] || options[:branch])\n arguments << (options[:commit] || options[:branch])\n end\n\n if options[:paths]\n arguments += ['--', *options[:paths]]\n end\n\n commit = nil\n parent = nil\n tree = nil\n date = nil\n author = nil\n email = nil\n summary = nil\n\n io = popen('log',*arguments)\n\n until io.eof?\n line = io.readline.chomp\n\n commit, parent, tree, date, author, email, summary, body, files = line.split('~|~',9)\n\n message = [summary, '', body].join($/)\n files = readlines_until(io)\n\n yield Commits::Git.new(\n commit,\n parent,\n tree,\n Time.at(date.to_i),\n author,\n email,\n summary,\n message,\n files\n )\n end\n end",
"title": ""
},
{
"docid": "83dca0cc2ffbdbd9ea5d5da2c01c082e",
"score": "0.51879054",
"text": "def get_conversations(mailbox_id, page = 1, modified_since = nil)\n options = {\n query: {\n page: page,\n modifiedSince: modified_since,\n }\n }\n\n get(\"mailboxes/#{mailbox_id}/conversations\", options)\n end",
"title": ""
},
{
"docid": "05cd4e5a4eb81c5b6c9ee70f53c82bdc",
"score": "0.5184298",
"text": "def get_messages()\n hash_list = SQLQuery.new.get('groups_messages', ['*']).where.if('group_id', @id).send\n list = []\n hash_list.each do |hash|\n list << Message.get(hash['id'], 'group')\n end\n return list\n end",
"title": ""
},
{
"docid": "8f8bf9ae86a4f7dd8d32c31fcbb70d15",
"score": "0.5182904",
"text": "def messages(*args)\n Message.find(self, *args)\n end",
"title": ""
},
{
"docid": "2fa24f18ff10e07e00cd6cc516c2b434",
"score": "0.518251",
"text": "def index\n @messages = Message.order(created_at: :desc).page(params[:page]).per(NUM_PER_PAGE)\n end",
"title": ""
},
{
"docid": "5d68cf5734306f9ba506fa3618731f77",
"score": "0.5177895",
"text": "def github_status_messages\n get(STATUS_ROOT).rels[:messages].get.data\n end",
"title": ""
},
{
"docid": "5cdd696dc0b199ce0ccd33b2e6d21baa",
"score": "0.5162002",
"text": "def getMessages()\r\n @client.api.account.messages.list\r\nend",
"title": ""
},
{
"docid": "1e9768875734354805efa4c863cb6404",
"score": "0.51591116",
"text": "def get\n return messages\n end",
"title": ""
},
{
"docid": "4e091ce8aa86c7d9f08b48f5ef9e1dde",
"score": "0.5158942",
"text": "def chat_history(options = {})\n history = []\n\n Storage.with_storage do |store|\n if options.has_key?(:chat)\n # history for some other chat\n history = store[KEY][options[:chat]]\n else\n # history for this chat\n history = store[KEY][@msg.chat]\n end\n\n if options.has_key?(:from)\n # messages from someone\n history = history.select do |msg|\n msg.from_name =~ /#{options[:from]}/i rescue false\n end\n end\n\n if options.has_key?(:to)\n # messages to someone\n history = history.select do |msg|\n msg.to =~ /#{options[:to]}/i rescue false\n end\n end\n end\n\n history || []\n\n rescue Exception => ex\n $stderr.puts \"Exception getting chat history. options: #{options.inspect}; exception: #{ex}.\"\n return []\n end",
"title": ""
},
{
"docid": "43871c512ca60f92aeb6089afbeeda2d",
"score": "0.51493746",
"text": "def all_messages(options = {})\n #:type => nil is a hack not to give Messages as Notifications\n messages = Alerter::Message.receipts(@notifiable).where(:type => nil).order(\"alerter_messages.created_at DESC\")\n if options[:read] == false || options[:unread]\n messages = messages.unread\n end\n\n messages\n end",
"title": ""
},
{
"docid": "7114598cbb4ac1bd748df2e0d6b57e7b",
"score": "0.5144092",
"text": "def messages\n @mapped_messages ||= Basecamp3::Message.all(bucket.id, id)\n end",
"title": ""
},
{
"docid": "65e0a7a73e2b07214630d934ab126286",
"score": "0.51417685",
"text": "def get_channel_messages(channel_id, limit: nil, around: nil, before: nil, after: nil)\n query = URI.encode_www_form({limit: limit, around: around, before: before, after: after}.compact)\n response = request(\n :channels_cid_messages, channel_id,\n :get,\n \"channels/#{channel_id}/messages?#{query}\",\n )\n\n Rapture::Message.from_json_array(response.body)\n end",
"title": ""
},
{
"docid": "6072ae7f5e126ba08be89242b262f8a6",
"score": "0.5126012",
"text": "def getMessageList(count, opts={})\n url = \"#{@fqdn}#{SERVICE_URL}\"\n\n #acceptable optional values\n optional = {\n :offset => (opts[:offset] || 0).to_i,\n :messageIds => opts[:messageIds],\n :isUnread => opts[:isUnread],\n :isFavorite => opts[:isFavorite],\n :type => opts[:type],\n :keyword => opts[:keyword],\n :isIncoming => opts[:isIncoming],\n }\n\n count = MAX_COUNT if count.to_i > MAX_COUNT\n url << \"?limit=#{count.to_i}\"\n\n optional.each do |key, value|\n # append to url, convert our values to a comma separated list if an array\n url << %(&#{key}=#{CGI.escape(Array(value).join(\",\"))}) unless value.nil?\n end\n \n headers = {\n :Accept => \"application/json\",\n }\n\n begin\n response = self.get(url, headers)\n rescue RestClient::Exception => e\n raise(ServiceException, e.response || e.message, e.backtrace)\n end\n Model::MessageList.createFromJson(response)\n end",
"title": ""
},
{
"docid": "abe4c9908e6fac565c1c61f3d21b0b5c",
"score": "0.5118867",
"text": "def messages\n current_user.mark_read_messages(@conversation) if (params[:page] || '1') == '1'\n @messages = @conversation.messages.includes(:sender).order(created_at: :desc).page(params[:page]).per(params[:per_page] || 20)\n unless @conversation.is_group_conversation? # exclude anonymous messages\n other_user = @conversation.decorate.other_participant\n @messages = @messages.where('messages.created_at > ?', other_user.get_last_anonymity_status.start_time) if other_user.is_anonymity?\n end\n render partial: 'api/v2/pub/conversations/messages', locals: {messages: @messages}\n end",
"title": ""
},
{
"docid": "fc9bbba9273af46cca86442adeeb137a",
"score": "0.51155597",
"text": "def recent(options = {})\n options = { :limit => 10, :since_message_id => nil }.merge(options)\n # Build url manually, faraday has to be 8.0 to do this\n url = \"#{room_url_for(:recent)}?limit=#{options[:limit]}&since_message_id=#{options[:since_message_id]}\"\n\n connection.get(url)['messages'].map do |msg|\n parse_message(msg)\n end\n end",
"title": ""
},
{
"docid": "3c65b3a8c6edd15df8a45de4b656ebf7",
"score": "0.51092213",
"text": "def messages\n @collection.map { |param| param.message }.join('')\n end",
"title": ""
},
{
"docid": "c03474e32e9dc6739b715d71d87f9beb",
"score": "0.5103726",
"text": "def getSelectedMessages\n pp [:got_get_selected_messages] if $DEBUG\n HttpRequestResponseList.new(__getSelectedMessages)\n end",
"title": ""
}
] |
4d9e3687c9e8b49d93406a8153fba2cb
|
Converts and returns the file size in a 0.00 float, based upon a given multiplier
|
[
{
"docid": "4863473bc4568bb13348d05db23b3b5d",
"score": "0.81533086",
"text": "def size_to_f( multiplier = KILOBYTE )\n '%.2f' % ( size.to_f / multiplier )\n end",
"title": ""
}
] |
[
{
"docid": "cf12b2faa3cf1e22d62ec54c97817044",
"score": "0.6321749",
"text": "def readable_file_size(size, precision)\n case\n #when size == 1 : \"1 B\"\n when size < KILO_SIZE then \"%d B\" % size\n when size < MEGA_SIZE then \"%.#{precision}f K\" % (size / KILO_SIZE)\n when size < GIGA_SIZE then \"%.#{precision}f M\" % (size / MEGA_SIZE)\n else \"%.#{precision}f G\" % (size / GIGA_SIZE)\n end\nend",
"title": ""
},
{
"docid": "cf12b2faa3cf1e22d62ec54c97817044",
"score": "0.6321749",
"text": "def readable_file_size(size, precision)\n case\n #when size == 1 : \"1 B\"\n when size < KILO_SIZE then \"%d B\" % size\n when size < MEGA_SIZE then \"%.#{precision}f K\" % (size / KILO_SIZE)\n when size < GIGA_SIZE then \"%.#{precision}f M\" % (size / MEGA_SIZE)\n else \"%.#{precision}f G\" % (size / GIGA_SIZE)\n end\nend",
"title": ""
},
{
"docid": "59065d5f1914078711c6f61a26bb52d7",
"score": "0.6209032",
"text": "def readable_file_size(size, precision)\n case\n #when size == 1 : \"1 B\"\n when size < KILO_SIZE then \"%d B\" % size\n when size < MEGA_SIZE then \"%.#{precision}f K\" % (size / KILO_SIZE)\n when size < GIGA_SIZE then \"%.#{precision}f M\" % (size / MEGA_SIZE)\n else \"%.#{precision}f G\" % (size / GIGA_SIZE)\n end\n end",
"title": ""
},
{
"docid": "0d95b68982ad54682719163b7ee0e6e4",
"score": "0.62045",
"text": "def converted_file_size(size:)\n return { size: nil, unit: 'mb' } unless size.present? && size.is_a?(Numeric) && size.positive?\n return { size: size / 1.petabytes, unit: 'pb' } if size >= 1.petabytes\n return { size: size / 1.terabytes, unit: 'tb' } if size >= 1.terabytes\n return { size: size / 1.gigabytes, unit: 'gb' } if size >= 1.gigabytes\n return { size: size / 1.megabytes, unit: 'mb' } if size >= 1.megabytes\n\n { size: size, unit: '' }\n end",
"title": ""
},
{
"docid": "2229a40b3cb765adcb24ce3f80f8f049",
"score": "0.6202422",
"text": "def readable_file_size(size, precision)\n case\n #when size == 1 then \"1 B\"\n when size < KILO_SIZE then \"%d B\" % size\n when size < MEGA_SIZE then \"%.#{precision}f K\" % (size / KILO_SIZE)\n when size < GIGA_SIZE then \"%.#{precision}f M\" % (size / MEGA_SIZE)\n else \"%.#{precision}f G\" % (size / GIGA_SIZE)\n end\n end",
"title": ""
},
{
"docid": "56b7817fc0ae1447a5c4ddbb0ba96dbd",
"score": "0.6185764",
"text": "def volume_size\n # If not user-specified, I'm using a fudge factor of 1.5 on the volume size -- arbitrarily chosen\n @volume_size || (`du -x #{volume_to_bundle}`.split(/\\n/)[-1].split[0].to_f * 1.5 / 1024).ceil\n end",
"title": ""
},
{
"docid": "e0b92adc86e3379592dfd4f059ef4275",
"score": "0.61604184",
"text": "def total_file_size_human_readable\n total = self.total_file_size\n ActiveSupport::NumberHelper::NumberToHumanSizeConverter.convert( total, precision: 3 )\n end",
"title": ""
},
{
"docid": "46aca257acccb72c283cbff4e79143c5",
"score": "0.6108996",
"text": "def size\n size = File.size(@path).to_i\n case\n when size.to_i == 1; \"1 byte\"\n when size < 1024; \"%d bytes\" % size\n when size < (1024*1024); \"%.2f kilobytes\" % (size / 1024.0)\n else \"%.2f megabytes\" % (size / (1024 * 1024.0))\n end.sub(/([0-9])\\.?0+ /, '\\1 ' )\n end",
"title": ""
},
{
"docid": "0376edd6d851e02f614a3d90ee7bd662",
"score": "0.6077931",
"text": "def get_file_size_in_mb\n mb = ::ApplicationController.helpers.number_to_human_size(self.file_size, precision: 2) \n return mb\n end",
"title": ""
},
{
"docid": "d606695be1f00e343816bf15481749cc",
"score": "0.60762715",
"text": "def readable_file_size(size, precision = 1)\n case\n when size == 1 : \"1 Byte\"\n when size < KILO_SIZE : \"%d Bytes\" % size\n when size < MEGA_SIZE : \"%.#{precision}f KB\" % (size / KILO_SIZE)\n when size < GIGA_SIZE : \"%.#{precision}f MB\" % (size / MEGA_SIZE)\n else \"%.#{precision}f GB\" % (size / GIGA_SIZE)\n end\n end",
"title": ""
},
{
"docid": "76262770eab30c078fe8ae177baa5601",
"score": "0.6075201",
"text": "def readable_file_size size, precision\n if size < KILO_SIZE then format('%d B', size)\n elsif size < MEGA_SIZE then format(\"%.#{precision}f K\", (size / KILO_SIZE))\n elsif size < GIGA_SIZE then format(\"%.#{precision}f M\", (size / MEGA_SIZE))\n else format(\"%.#{precision}f G\", (size / GIGA_SIZE))\n end\nend",
"title": ""
},
{
"docid": "0254818544e7e03ff5a7f5a107ecf3fd",
"score": "0.6074038",
"text": "def readable_file_size(size, precision)\n case\n when size == 1 : \"1 Byte\"\n when size < KILO_SIZE : \"%d B \" % size\n when size < MEGA_SIZE : \"%.#{precision}f KB\" % (size / KILO_SIZE)\n when size < GIGA_SIZE : \"%.#{precision}f MB\" % (size / MEGA_SIZE)\n else \"%.#{precision}f GB\" % (size / GIGA_SIZE)\n end\n end",
"title": ""
},
{
"docid": "9fecfab726abd2cf561c54225aaa26c1",
"score": "0.6066608",
"text": "def to_filesize(size)\n # size = '0' if size.nil?\n size = size.to_s\n\n units = {\n 'B' => 1.0 / (1024 * 1024),\n 'K' => 1.0 / 1024,\n 'M' => 1,\n 'G' => 1024,\n 'T' => 1024 * 1024\n }\n\n unit = size[-1]\n unit = 'B' unless units.key?(unit)\n\n \"#{size[0..-1].to_f * units[unit]}M\"\n end",
"title": ""
},
{
"docid": "5f8a2423c258685f28ca7b5e44b2329f",
"score": "0.60189885",
"text": "def file_size\n number_to_human_size(super)\n end",
"title": ""
},
{
"docid": "895ab657959a9335fa51fa95f2a33432",
"score": "0.6015973",
"text": "def size\n ['o', 'k', 'G'].inject(super.to_f) do |s, unit|\n # recusively divide by 1024 until...\n if s.is_a?(Float) && s >= 1024\n s = s / 1024\n # we format it here with the unit\n elsif !s.is_a?(String)\n s = \"#{s.to_s.gsub(/(\\.\\d{3})\\d+$/, \"\\\\1\")} #{unit}\"\n end\n s\n end\n end",
"title": ""
},
{
"docid": "0959cc7a1b0d9ae629f573fd515d5873",
"score": "0.60005355",
"text": "def getFileSize()\n getRealFileSize(file) / MEGABYTE\n end",
"title": ""
},
{
"docid": "a287828fe100bebaa83060b8674e861f",
"score": "0.59553134",
"text": "def interpret_size(size)\n case size\n when /k$/i then size.to_i * 1024\n when /m$/i then size.to_i * 1024 * 1024\n when /g$/i then size.to_i * 1024 * 1024 * 1024\n else size.to_i\n end\n end",
"title": ""
},
{
"docid": "a7d162209b3d10f144b57926f58abb60",
"score": "0.594766",
"text": "def img_size(image_size, new_size)\n decrease = new_size.fdiv(image_size)\n return decrease\nend",
"title": ""
},
{
"docid": "96e14fa44722e8141fcf72e38ddb3d50",
"score": "0.59321105",
"text": "def nice_size size\n number_to_human_size size, :precision => 0\n end",
"title": ""
},
{
"docid": "e0f9ca93a75b035ce4c5a666df027035",
"score": "0.5926768",
"text": "def interpret_size(size)\n case size\n when /k$/i then size.to_i * 1024\n when /m$/i then size.to_i * 1024 * 1024\n when /g$/i then size.to_i * 1024 * 1024 * 1024\n else size.to_i\n end\n end",
"title": ""
},
{
"docid": "f10307ea2de790702466cf009191d843",
"score": "0.5866114",
"text": "def file_size_string(fs)\n # n cuts off all decimal places after the second\n n = lambda{|f| f.to_s[/.*\\..{0,2}/] } \n if fs < 1024\n \"#{n.call(fs)} Bytes\"\n elsif fs <= 1024**2\n \"#{n.call(fs/1024.0)} KBytes\"\n elsif fs <= 1024**3\n \"#{n.call(fs/1024.0**2)} MBytes\"\n elsif fs <= 1024**4\n \"#{n.call(fs/1024.0**3)} GBytes\"\n end\n end",
"title": ""
},
{
"docid": "4c85e8b523f880d34d4840d7157a61f1",
"score": "0.5840183",
"text": "def calc_size\n @input_size = File.size(@original_filepath)\n @output_size = File.size(@min_filepath)\n @diff_size = @input_size - @output_size\n end",
"title": ""
},
{
"docid": "d9386c876d64d6b2e54ed3821314a96c",
"score": "0.58215725",
"text": "def format_size(bytes)\n sprintf \"%0.1fG\", bytes.to_f / 10**9\nend",
"title": ""
},
{
"docid": "8831bb91801ce134e87c0446a7e78237",
"score": "0.58180845",
"text": "def display_size\n # (1.9 ** @magnitude) / 3.0 + 2.5\n (2.15 ** @magnitude) / 3.6 + 2.5\n end",
"title": ""
},
{
"docid": "f63e6b7f7bca00c96655bb6ccd9c8e3f",
"score": "0.5811455",
"text": "def human_filesize(filename)\n size = File.size(filename)\n case\n when size < 2**10 then '%d bytes' % size\n when size < 2**20 then '%.1fK' % (1.0 * size / 2**10)\n when size < 2**30 then '%.1fM' % (1.0 * size / 2**20)\n else '%.1fG' % (1.0 * size / 2**30)\n end\nend",
"title": ""
},
{
"docid": "fb2c9a9e0c9c56ea6e37c5bcd68ac490",
"score": "0.5810229",
"text": "def filesize_format\n FILESIZE_FORMAT.each do |format, size|\n return format % (self.to_f / size) if self >= size\n end\n\n self.to_s\n end",
"title": ""
},
{
"docid": "db17bb92148e750c3582c0e05f452856",
"score": "0.57827675",
"text": "def human_size\n number_to_human_size size\n end",
"title": ""
},
{
"docid": "ecfd8114ae955636913282646f2522c1",
"score": "0.57433784",
"text": "def convertsize(str)\n\t\t\t\tif(str.kind_of?(Numeric))\n\t\t\t\t\treturn(str)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tstr.strip!()\n\t\t\t\tregex = /^([0-9]+(?:\\.[0-9]+)?)\\s*([gmk])b?$/i\n\t\t\t\tmatch = regex.match(str)\n\t\t\t\tif(match == nil)\n\t\t\t\t\traise(ArgumentError, \"Unable to parse size of \\\"#{str}\\\"\")\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tsize = match[1].to_f()\n\t\t\t\t\n\t\t\t\tcase(match[2].downcase())\n\t\t\t\twhen('g')\n\t\t\t\t\tsize = size * 1024 * 1024 * 1024\n\t\t\t\twhen('m')\n\t\t\t\t\tsize = size * 1024 * 1024\n\t\t\t\twhen('k')\n\t\t\t\t\tsize = size * 1024\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn(size)\n\t\t\tend",
"title": ""
},
{
"docid": "4c904fd51b7a8c60a1a73e4a9612f115",
"score": "0.57365817",
"text": "def human_readable_file_size(num, type='file')\n string = ''\n factor = 1024\n suffixes = ['KB', 'MB', 'GB', 'TB']\n if type == 'base10'\n factor = 1000\n suffixes = ['', 'K', 'M', 'B']\n end\n\n if num < factor\n string = \"#{num}#{suffixes[0]}\"\n elsif num < factor**2\n string = \"#{((num) / factor).round(1)}#{suffixes[1]}\"\n elsif num < factor**3\n string = \"#{((num) / (factor*factor)).round(1)}#{suffixes[2]}\"\n else\n string = \"#{((num) / (factor*factor*factor)).round(1)}#{suffixes[3]}\"\n end\n\n return string\nend",
"title": ""
},
{
"docid": "40626abb917c632c31d0739b98f46421",
"score": "0.5706734",
"text": "def readable_file_size(size, precision)\n\t\tcase\n\t\t\twhen size < KILO_SIZE\n\t\t\t\t\"%d B\" % size\n\t\t\twhen size < MEGA_SIZE\n\t\t\t\t\"%.#{precision}f Kb\" % (size / KILO_SIZE)\n\t\t\twhen size < GIGA_SIZE\n\t\t\t\t\"%.#{precision}f Mb\" % (size / MEGA_SIZE)\n\t\t\telse \"%.#{precision}f Gb\" % (size / GIGA_SIZE)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a6f63ed8326090445d35670107a8991c",
"score": "0.57060635",
"text": "def load_factor\n @count.fdiv(size)\n end",
"title": ""
},
{
"docid": "2b06f5c80c8eb21dd6e371d2c501facf",
"score": "0.56964296",
"text": "def current_size\n @multiplier ||= 1.0\n @multiplier *= 0.99\n [@multiplier, @multiplier]\n end",
"title": ""
},
{
"docid": "6a371dd7db3c87e1aa57f5ff1341af18",
"score": "0.5695281",
"text": "def current_size\n @multiplier ||= 2.0\n @multiplier *= 0.97\n [@multiplier, @multiplier]\n end",
"title": ""
},
{
"docid": "6a371dd7db3c87e1aa57f5ff1341af18",
"score": "0.5695281",
"text": "def current_size\n @multiplier ||= 2.0\n @multiplier *= 0.97\n [@multiplier, @multiplier]\n end",
"title": ""
},
{
"docid": "6a371dd7db3c87e1aa57f5ff1341af18",
"score": "0.5695281",
"text": "def current_size\n @multiplier ||= 2.0\n @multiplier *= 0.97\n [@multiplier, @multiplier]\n end",
"title": ""
},
{
"docid": "4c5c56214595b8915ca4c2355acae296",
"score": "0.56932944",
"text": "def size_mb \n return size / 1048576 # (1024 * 1024) \n end",
"title": ""
},
{
"docid": "4e2b6db196f9e1cc5e27b29d7a4a28f4",
"score": "0.566687",
"text": "def load_factor\n Float(@num_items) / size\n end",
"title": ""
},
{
"docid": "e78ae7a4dbd6845524285a5c6a91c6d7",
"score": "0.56621045",
"text": "def human_filesize(value)\n {\n 'B' => 1024,\n 'KB' => 1024 * 1024,\n 'MB' => 1024 * 1024 * 1024,\n 'GB' => 1024 * 1024 * 1024 * 1024,\n 'TB' => 1024 * 1024 * 1024 * 1024 * 1024\n }.each_pair { |e, s| return \"#{(value.to_f / (s / 1024)).round(1)} #{e}\" if value.to_i < s }\n end",
"title": ""
},
{
"docid": "d3abea5466f7b2a507978058feaa5b82",
"score": "0.5640286",
"text": "def unit_converter(value, input_unit, output_unit)\n\t\treturn 0 if value == 0\n\t\treturn value if input_unit.downcase == output_unit.downcase\n\n\t\tif input_unit.downcase == 'gb'\n\t\t\tif output_unit.downcase == 'mb'\n\t\t\t\treturn value * 1024\n\t\t\tend\n\t\telse\n\t\t\tif input_unit.downcase == 'mb'\n\t\t\t\tif output_unit.downcase == 'gb'\n\t\t\t\t\treturn value / 1024\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif input_unit.downcase == 'tb'\n\t\t\t\t\tif output_unit.downcase == 'gb'\n\t\t\t\t\t\treturn value * 1024\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6859e684c9f82c87b1b6ad3caa519999",
"score": "0.56359446",
"text": "def file_size\n # pretty value\n attachments.order(position: 'asc').first.file_size\n rescue StandardError => exc\n logger.error(\"Message for the log file #{exc.message}\")\n 0\n end",
"title": ""
},
{
"docid": "b0685d923313db90b3726a4f9e54b5ca",
"score": "0.5621926",
"text": "def convert_size(block_size,blocks)\n size = block_size * blocks\n if size > SIZE_GB\n return [(size / SIZE_GB).to_i,\"GB\"]\n else\n return [(size / SIZE_MB).to_i,\"MB\"]\n end\n end",
"title": ""
},
{
"docid": "03a66af788cccdc411db169132b32329",
"score": "0.56209964",
"text": "def convert_ft_per_min_to_m_per_sec(value)\n value = (value.to_f * 0.00508).round(2)\n return value\nend",
"title": ""
},
{
"docid": "ec6709894f3e370170a96ff1655db896",
"score": "0.5594588",
"text": "def formatted_size\n Helpers.rcompact(@formats)\n sz = size\n fs = @formats.size\n fs > sz ? fs : sz\n end",
"title": ""
},
{
"docid": "5073687c4bb2fd6ae7df3f70c1a9f31d",
"score": "0.55875856",
"text": "def filesize(value)\n merge(filesize: value.to_s)\n end",
"title": ""
},
{
"docid": "f3d3295d43ddba6c5205fd068c736591",
"score": "0.55833584",
"text": "def load_factor\n return (@total_items.fdiv(size))\n end",
"title": ""
},
{
"docid": "1a37be051a677f814956669bdd47eace",
"score": "0.5572739",
"text": "def mp_rate\r\n mmp > 0 ? @mp.to_f / mmp : 0\r\n end",
"title": ""
},
{
"docid": "d5ad2f3fcbee3602a355e385d5f4e5d8",
"score": "0.5569259",
"text": "def recalculate_filesize\n @filesize = @collection.reduce(0) {|sum,asset| sum + asset.size}\n end",
"title": ""
},
{
"docid": "499285b72e32224531a17cf2c79f9aaa",
"score": "0.5556561",
"text": "def size\n size = popen(%W(du -s), full_path).first.strip.to_i\n (size.to_f / 1024).round(2)\n end",
"title": ""
},
{
"docid": "3637f3925e1577f1fe9efe72047cfca2",
"score": "0.5545858",
"text": "def file_size\n @file_size ||= 0\n end",
"title": ""
},
{
"docid": "c30f6d0273555c2694b76185aa803b98",
"score": "0.55232394",
"text": "def size_in_bytes\n ( file_length * 16 ) / 8\n end",
"title": ""
},
{
"docid": "93ff838cdb1a70f3a447a88d963f311b",
"score": "0.55151194",
"text": "def to_human_size(options = {})\n number = Float(self)\n\n storage_units_format = \"%n %u\"\n\n if number.to_i < 1024\n unit = UNIT_NAMES[:byte][:other]\n storage_units_format.gsub(/%n/, number.to_i.to_s).gsub(/%u/, unit)\n else\n max_exp = STORAGE_UNITS.size - 1\n exponent = (Math.log(number) / Math.log(1024)).to_i # Convert to base 1024\n exponent = max_exp if exponent > max_exp # we need this to avoid overflow for the highest unit\n number /= 1024 ** exponent\n\n unit_key = STORAGE_UNITS[exponent]\n unit = UNIT_NAMES[unit_key.to_sym]\n\n formatted_number = \"%.02f\" % number\n storage_units_format.gsub(/%n/, formatted_number).gsub(/%u/, unit)\n end\n end",
"title": ""
},
{
"docid": "4cb77ae1450a7c561a68b659cd0ec4de",
"score": "0.55139095",
"text": "def calc_generator_size(val1= chp_salable_elec, val2 = 364 * 24)\n\t\t(val1 / val2).round 3\n\tend",
"title": ""
},
{
"docid": "4c6a5d7befe53d6e3d4bf2b678b86cc8",
"score": "0.5502593",
"text": "def byte_spec_to_int(s)\n if s =~ /([0-9 ]+)\\s*([kKMGT])B?/\n num = $1\n multiplier = $2\n num = num.gsub(' ', '').to_i\n multiplier =\n case multiplier\n when 'k', 'K'\n 1024\n when 'M'\n 1024 * 1024\n when 'G'\n 1024 * 1024 * 1024\n when 'T'\n 1024 * 1024 * 1024 * 1024\n else\n raise \"Unrecognized multiplier in size specification: #{$2}\"\n end\n num * multiplier\n else\n raise \"Unrecognized size specification: #{s}\"\n end\n end",
"title": ""
},
{
"docid": "6c9962d09712e4659f46f58cfb5b0539",
"score": "0.5498338",
"text": "def size_from_bytes(qty, unit)\n qty = qty.to_i\n case unit.downcase\n when \"b\", \"bytes\"\n qty.to_s\n when \"kb\", \"kilobytes\"\n (qty / 1000).to_s\n when \"kib\", \"kibibytes\"\n (qty / 1024).to_s\n when \"mb\", \"megabytes\"\n (qty / 1000000).to_s\n when \"m\", \"mib\", \"mebibytes\"\n (qty / 1048576).to_s\n when \"gb\", \"gigabytes\"\n (qty / 1000000000).to_s\n when \"g\", \"gib\", \"gibibytes\"\n (qty / 1073741824).to_s\n else\n raise ArgumentError, \"Unknown unit #{unit}\"\n end\n end",
"title": ""
},
{
"docid": "d6636e530c7d0c961ba8678d2e5fb0c3",
"score": "0.5485694",
"text": "def byte_rate\n Rational(size,duration)\n end",
"title": ""
},
{
"docid": "616f5758817f20ec2d37b4dc6b8e1bb8",
"score": "0.5474479",
"text": "def compression_ratio\n return @compressed_file_size / @original_file_size\n end",
"title": ""
},
{
"docid": "53ca8eee594b5b0e279f075d0bf632df",
"score": "0.5466514",
"text": "def load_factor\n @count.to_f / size.to_f\n end",
"title": ""
},
{
"docid": "516df1ed741fffcba4507fef8a4a2664",
"score": "0.5461109",
"text": "def price_unit_factor\n return 1 if unit_id == price_unit_id\n return pack_size || 1 if price_unit_id == pack_unit_id\n return (pack_size || 1) * (subpack_size || 1) if price_unit_id == subpack_unit_id\n return 1\n end",
"title": ""
},
{
"docid": "7e8f4fc47bcff522adaec4afeb108821",
"score": "0.54578155",
"text": "def bytes_from_kb kb\n\tb = (kb * 1024.0).round\nend",
"title": ""
},
{
"docid": "cc81cdacccfb1b978cac5485f83f1865",
"score": "0.5451848",
"text": "def load_factor\n @item_count / size.to_f\n end",
"title": ""
},
{
"docid": "cee0632e9de4fe5328c6bddc65f5b3c6",
"score": "0.5442253",
"text": "def filesize(file)\n '%.2f' % (File.size(file).to_f / 2**20)\n end",
"title": ""
},
{
"docid": "318214a9781b8dc38ca809ed03abcacc",
"score": "0.54365975",
"text": "def file_total_size_gb\n ((total_ram_mb.to_f * 2).to_f / 1024).ceil\n end",
"title": ""
},
{
"docid": "fa5edeea58d9c4088ebb5a3e9e9207f3",
"score": "0.5436414",
"text": "def calculate_size(a_size)\n\tres = 0\n\tif(a_size == \"small\")\n\t\tres = 1\n\telsif(a_size == \"medium\")\n\t\tres = 2\t\n\telsif(a_size == \"large\")\n\t\tres = 3\t\n\tend\n\tres\n end",
"title": ""
},
{
"docid": "caee3b0b1cc1dd8ac5eeda3c905b356f",
"score": "0.5415973",
"text": "def file_size\n 1000 # temporarily disable file size calculation\n # TODO: fix this in production env (perhaps zencoder is not replacing target file?)\n # self.file.size\n end",
"title": ""
},
{
"docid": "5cad4ee783bc4638f93956ef0f1bf6ab",
"score": "0.5411276",
"text": "def file_size(file_name)\n size = File.size?(file_name)\n size = 0 if size.nil?\n LoggerHelper.print_to_log(\"Size of file '#{file_name}' is #{size}\")\n size\n end",
"title": ""
},
{
"docid": "b58d0cb3c8a1680c1960a41d0fb15556",
"score": "0.54108554",
"text": "def to_mb\n self / 1048576\n end",
"title": ""
},
{
"docid": "624c7d0965223ef5db0012b5a755fd64",
"score": "0.5386569",
"text": "def filesize_format(int)\n int\n end",
"title": ""
},
{
"docid": "339e3d68091f62e66029526d1d7e0b5b",
"score": "0.53834885",
"text": "def size\n Float::MAX.to_i\n end",
"title": ""
},
{
"docid": "b8797107a5283788c0364310b8e7ec34",
"score": "0.5370635",
"text": "def size_in_bytes\n files.inject(0) do |sum, f|\n path = File.join self.path, f\n sum + File.size(path)\n end\n end",
"title": ""
},
{
"docid": "3cef204482347a1336e1f6078517239d",
"score": "0.53679967",
"text": "def to_level raw_size\n\t\t\tMath.log2(1.0 * raw_size / @unit_size).ceil\n\t\tend",
"title": ""
},
{
"docid": "18f756ed334ee9f37c1f47d6bb77d1b3",
"score": "0.5365513",
"text": "def display_size\n s = self.body.size\n\n if s > 1024 * 1024\n return sprintf(\"%.1f\", s.to_f / 1024 / 1024) + 'M'\n else\n return (s / 1024).to_s + 'K'\n end\n end",
"title": ""
},
{
"docid": "972cceb5be03d0773f527e650b2d52ab",
"score": "0.535839",
"text": "def convert_to_bytes(size, unit)\n size.to_f * UNITS_FACTOR[unit]\n end",
"title": ""
},
{
"docid": "07819f42b0a073cf5b32108edf8fda61",
"score": "0.53443086",
"text": "def number_to_human_size(number)\n base = 1024\n\n if number.to_i < base\n \"#{number} bytes\"\n else\n number = number.to_f\n max_exp = STORAGE_UNITS.size - 1\n exponent = (Math.log(number) / Math.log(base)).to_i # Convert to base\n exponent = max_exp if exponent > max_exp # we need this to avoid overflow for the highest unit\n number /= base ** exponent\n\n unit_key = STORAGE_UNITS[exponent]\n\n \"#{number.round(2)} #{unit_key.to_s}\"\n end\n\n end",
"title": ""
},
{
"docid": "b62279f7ff16b10acea311e617ed6589",
"score": "0.5336995",
"text": "def file_size\n self.file_file_size\n end",
"title": ""
},
{
"docid": "9140d83ac0d03d97c4e6d5dcecd62fba",
"score": "0.5325846",
"text": "def vsize\n (weight.to_f / 4).ceil\n end",
"title": ""
},
{
"docid": "974ce1d5d90ba3954af91f3917a88974",
"score": "0.5316173",
"text": "def number_to_human_size(number, options = {})\n SitemapGenerator::Utilities.symbolize_keys!(options)\n\n number = begin\n Float(number)\n rescue ArgumentError, TypeError\n if options[:raise]\n raise InvalidNumberError, number\n else\n return number\n end\n end\n\n defaults = {\n :separator => \".\",\n :delimiter => \",\",\n :precision => 3,\n :significant => false,\n :strip_insignificant_zeros => false\n }\n human = {\n :delimiter => \"\",\n :precision => 3,\n :significant => true,\n :strip_insignificant_zeros => true\n }\n defaults = defaults.merge(human)\n options = SitemapGenerator::Utilities.reverse_merge(options, defaults)\n #for backwards compatibility with those that didn't add strip_insignificant_zeros to their locale files\n options[:strip_insignificant_zeros] = true if not options.key?(:strip_insignificant_zeros)\n\n storage_units_format = \"%n %u\"\n\n if number.to_i < 1024\n unit = number.to_i > 1 || number.to_i == 0 ? 'Bytes' : 'Byte'\n storage_units_format.gsub(/%n/, number.to_i.to_s).gsub(/%u/, unit)\n else\n max_exp = STORAGE_UNITS.size - 1\n exponent = (Math.log(number) / Math.log(1024)).to_i # Convert to base 1024\n exponent = max_exp if exponent > max_exp # we need this to avoid overflow for the highest unit\n number /= 1024 ** exponent\n\n unit_key = STORAGE_UNITS[exponent]\n units = {\n :byte => \"Bytes\",\n :kb => \"KB\",\n :mb => \"MB\",\n :gb => \"GB\",\n :tb => \"TB\"\n }\n unit = units[unit_key]\n formatted_number = number_with_precision(number, options)\n storage_units_format.gsub(/%n/, formatted_number).gsub(/%u/, unit)\n end\n end",
"title": ""
},
{
"docid": "fb020d8d1ed83a3c02ea7fecf50b766d",
"score": "0.53077745",
"text": "def convert_bytes_to_unit(data:, unit:)\n case unit\n when 'kb' then @usage = data.to_i / 1024\n when 'mb' then @usage = data.to_i / 1024 / 1024\n when 'gb' then @usage = data.to_i / 1024 / 1024 / 1024\n end\n end",
"title": ""
},
{
"docid": "6c436ae67d4b69002e6fe6e07c8ad55c",
"score": "0.53058374",
"text": "def original_file_size\n return @original_file_size\n end",
"title": ""
},
{
"docid": "3eba9c55057a290a2e40339e18305be1",
"score": "0.5295087",
"text": "def format_size(sz)\n if (emptyval?(sz))\n EMPTYVAL\n else\n case\n when sz < KB then \"#{sz}B\"\n when sz >= KB && sz < MB then \"#{sz/KB}KB\"\n when sz >= MB && sz < GB then \"#{sz/MB}MB\"\n when sz >= GB && sz < TB then \"#{sz/GB}GB\"\n when sz >= TB && sz < PB then \"#{sz/TB}TB\"\n else\n XXL_SIZE\n end\n end\n end",
"title": ""
},
{
"docid": "6b339ff49577bd0b4ac99026cca85791",
"score": "0.5282474",
"text": "def size\n\n @population_density/50\n\n mod_factor = 0.0\n if @population_density >= 200\n mod_factor = 4.0\n elsif @population_density >= 150\n mod_factor = 3.0\n elsif @population_density >= 100\n mod_factor = 2.0\n elsif @population_density >= 50\n mod_factor = 1.0\n else\n mod_factor = 0.5\n end\n return mod_factor\n end",
"title": ""
},
{
"docid": "0215a68557aa7cc39d42956b82ff32cf",
"score": "0.5273557",
"text": "def normalized_size\n\t\t\ttile_size(max_level) * @unit_size\n\t\tend",
"title": ""
},
{
"docid": "805194239e3dee954a12665cb4e8d34a",
"score": "0.52635837",
"text": "def upload_usage_fraction\n # Show in megabytes\n used = (self.upload_size_this_month.to_f / 1024.0 / 1024.0).round(2).to_s\n limit = (Rails.application.secrets.monthly_upload_byte_limit / 1024 / 1024).to_s\n \"#{used} MB / #{limit} <span title='megabytes'>MB</span>\".html_safe\n end",
"title": ""
},
{
"docid": "2e13b19db5c2ac83bade144f01b44738",
"score": "0.5244082",
"text": "def serving_ratio(serving_amt = self.serving_size)\n ratio = 1.0\n #have to transform to float to maintain decimal precision\n if self.serving_size && serving_amt && self.serving_size > 0 && serving_amt > 0\n ratio = serving_amt/self.serving_size.to_f\n end\n ratio\n end",
"title": ""
},
{
"docid": "dcdcd54e653b7270afbf0d0d05452eea",
"score": "0.5243964",
"text": "def get_file_size!(f)\n size = File.size?(f)\n #print(\"#{size},\")\n end",
"title": ""
},
{
"docid": "4087978c51646afe4d99046273b9815b",
"score": "0.52388257",
"text": "def newton_float_size\n MSPhysics::Newton.get_float_size\n end",
"title": ""
},
{
"docid": "44f3ee169745b99db66fe749f4465268",
"score": "0.52375317",
"text": "def load_factor\n puts \"load_factor: #{@values} / #{@size}\"\n (@values + 0.0) / @size\n end",
"title": ""
},
{
"docid": "4d8c9a6a0eb0cf29555c102af60b5953",
"score": "0.5237428",
"text": "def file_size_field\n Solrizer.solr_name(:file_size, CurationConcerns::FileSetIndexer::STORED_INTEGER)\n end",
"title": ""
},
{
"docid": "4209fa6f9729bd2daad2afeab57c98fb",
"score": "0.52262366",
"text": "def compute_image_size_length(original_size_value)\n\n\t\timage_size_length = 0\n\n\t\toriginal_image_size_length = original_size_value.slice(original_size_value.index(\"x\") + 2..-1)\n\n\t\tif original_image_size_length.include?('/')\n\n\t\t\tlength_fraction_numerator = original_image_size_length.slice(original_image_size_length.index(\"/\") - 1).to_f\n\t\t\tlength_fraction_denominator = original_image_size_length.slice(original_image_size_length.index(\"/\") + 1).to_f\n\t\t\t\n\t\t\timage_size_length += length_fraction_numerator/length_fraction_denominator\n\n\t\tend\n\n\t\tif original_image_size_length.include?('.')\n\t\t\timage_size_length += original_image_size_length[0,5].to_f\n\t\telse\n\t\t\timage_size_length += original_image_size_length[0,2].to_f\n\t\tend\n\n\t\treturn image_size_length\n\n\tend",
"title": ""
},
{
"docid": "04ebfcff000b033c6610b04a13427363",
"score": "0.5223864",
"text": "def calc_FPKM(weight_per_kb, total_num_read)\n\treturn weight_per_kb * 1_000_000 / total_num_read\nend",
"title": ""
},
{
"docid": "bb0c2061d43ece1bf10780dbde7db4b2",
"score": "0.5222079",
"text": "def load_factor\n puts \"Load Factor: #{new_load_factor = @item_count / @size.to_f}\"\n return new_load_factor\n end",
"title": ""
},
{
"docid": "e0c95e9f3fffddd377d86979764c0654",
"score": "0.5215875",
"text": "def size\n chunk_size = nil\n File.open(@file_name) do |file|\n file.seek(@offset + 4, IO::SEEK_CUR)\n case @size_length\n when 4\n chunk_size = file.read(@size_length).unpack('L').first\n when 2\n chunk_size = file.read(@size_length).unpack('S').first\n else\n raise \"Can't decode size field of length #{@size_length}\"\n end\n end\n chunk_size + @data_size_correction\n end",
"title": ""
},
{
"docid": "af6a26938e06e39dbbdb46827969fac9",
"score": "0.52074754",
"text": "def blocks_to_bytes(block_size, qty)\n size = ( block_size / 1024 ) * qty\n if size < 1000\n output = \"#{size} KB\"\n elsif size < 1000000\n output = \"#{size / 1000} MB\"\n elsif size < 1000000000\n output = \"#{size / 1000000} GB\"\n else\n output = \"#{size / 1000000000} TB\"\n end\n\n return output\nend",
"title": ""
},
{
"docid": "baed064642113aabaf9578430a493ecf",
"score": "0.5206456",
"text": "def human_size\n count = 0\n n = size\n while n >= 1024 and count < 4\n n /= 1024.0\n count += 1\n end\n format(\"%.1f\",n) + %w(B kB MB GB TB)[count]\n end",
"title": ""
},
{
"docid": "adf09bccc70f7e76e0eebfc415cd4b13",
"score": "0.519544",
"text": "def getFileSize\r\n\t\t\t\t\treturn @fileSize\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "4c82f4bc66f955dd6db9920f27c7ed2d",
"score": "0.5192172",
"text": "def fast_size2\n c_size = 0\n $postgres.exec_prepared('wsfile_size_multi', [self.id]).each do |row|\n c_size += row.except('id').map{|k,v| v.to_i}.inject(:+)\n end\n c_size\n end",
"title": ""
},
{
"docid": "30d29a692cc5bd3328c5b8c507528044",
"score": "0.5187732",
"text": "def convert_inches_to_cm length\n in_to_cm = 2.54\n length * in_to_cm\nend",
"title": ""
},
{
"docid": "30d29a692cc5bd3328c5b8c507528044",
"score": "0.5187732",
"text": "def convert_inches_to_cm length\n in_to_cm = 2.54\n length * in_to_cm\nend",
"title": ""
},
{
"docid": "30d29a692cc5bd3328c5b8c507528044",
"score": "0.5187732",
"text": "def convert_inches_to_cm length\n in_to_cm = 2.54\n length * in_to_cm\nend",
"title": ""
},
{
"docid": "0c48f4010be351be2c3fed8dd4f47964",
"score": "0.5182938",
"text": "def file_size_field\n Solrizer.solr_name(:file_size, CurationConcerns::CollectionIndexer::STORED_LONG)\n end",
"title": ""
},
{
"docid": "0c48f4010be351be2c3fed8dd4f47964",
"score": "0.5182938",
"text": "def file_size_field\n Solrizer.solr_name(:file_size, CurationConcerns::CollectionIndexer::STORED_LONG)\n end",
"title": ""
}
] |
9bcdec58e5e95698b925b6b465752d33
|
Get a list of the time periods a variable could represent. A variable period is period of time represented by the measurement. For example, monthly precipitation has a variable period of months.
|
[
{
"docid": "f62fcfaaa3c49d9c2c9c0768e3c0e1d9",
"score": "0.0",
"text": "def get_variable_period_types_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#get_variable_period_types ...\"\n end\n \n # resource path\n local_var_path = \"/variablePeriodTypes\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'variablePeriodTypeId'] = opts[:'variable_period_type_id'] if opts[:'variable_period_type_id']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GenericResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#get_variable_period_types\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "1a85342c83aae168193e720a195cb447",
"score": "0.71090823",
"text": "def periods\n self.count_intervals.times.map do |i| get_period(i) end\n end",
"title": ""
},
{
"docid": "f1a2c0720840338ae223f34016e2a161",
"score": "0.6807848",
"text": "def get_list_of_time_periods(time_period)\r\n\t\ttoReturn = []\r\n\t\tif time_period == 'day'\r\n\t\t\t24.downto(0) do |i|\r\n\t\t\t\ttoReturn << i.hours.ago.strftime('%a %d %H:00')\r\n\t\t\tend\r\n\t\telsif time_period == 'week'\r\n\t\t\t7.downto(0) do |i|\r\n\t\t\t\ttoReturn << i.days.ago.strftime('%A %d')\r\n\t\t\tend\r\n\t\telsif time_period == 'month'\r\n\t\t\t31.downto(0) do |i|\r\n\t\t\t\ttoReturn << i.days.ago.strftime('%b %d')\r\n\t\t\tend\r\n\t\telsif time_period == 'year'\r\n\t\t\t12.downto(0) do |i|\r\n\t\t\t\ttoReturn << i.months.ago.strftime(\"%B ('%y)\")\r\n\t\t\tend\r\n\t\telsif time_period == 'all_time'\r\n\t\t\t3.downto(0) do |i|\r\n\t\t\t\ttoReturn << i.years.ago.strftime('%Y')\r\n\t\t\tend\t\t\r\n\t\tend\r\n\r\n\t\ttoReturn\r\n\tend",
"title": ""
},
{
"docid": "29caf6c451f0ad90ff3e41bc2dcfbb0d",
"score": "0.66638154",
"text": "def periods\n periods = []\n _start_time = start_time.in_time_zone('Paris')\n _end_time = end_time.in_time_zone('Paris')\n\n TIME_SLOTS.keys.each do |key|\n slot = TIME_SLOTS[key]\n if _start_time.hour.in?(slot[:start_time]..slot[:end_time])\n periods << slot[:short_name]\n end\n\n if _end_time.hour.in?(slot[:start_time]..slot[:end_time])\n periods << slot[:short_name]\n end\n end\n\n periods.uniq\n end",
"title": ""
},
{
"docid": "589662caa16ed7b24216e2d9b4d96125",
"score": "0.6623272",
"text": "def date_to_periods(time: nil)\n periods = []\n Stock.all.map(&:fish_year_month).uniq.each {|mth| periods << determine_period(fish_year_month: mth, on: time) }\n periods\n end",
"title": ""
},
{
"docid": "9cf4ecc894adaa6d8b4bf3c967f18b17",
"score": "0.64739233",
"text": "def get_periods(periods = [:present, :past])\n periods_table = [[:SELECTED, 'Wybrane z menu']]\n periods_table += Date::ACTUAL_PERIODS if periods.include?(:present)\n periods_table += Date::PAST_PERIODS if periods.include?(:past)\n periods_table += Date::FUTURE_PERIODS if periods.include?(:future)\n return periods_table\n end",
"title": ""
},
{
"docid": "71818835eee6d791532e830bd1fc9b42",
"score": "0.63865",
"text": "def last_periods(num_months, year, month)\n # Array of [year, month] elements\n periods = []\n\n num_months.times do\n if month > 1\n month -= 1\n else\n month = 12\n year -= 1\n end\n periods << [year, month]\n end\n periods\n end",
"title": ""
},
{
"docid": "f2d4112f02d1bc0d301bea2d5aa982f9",
"score": "0.62706685",
"text": "def time_periods\n Array(self.datastreams[\"descMetadata\"].temporals).map do |dscv_s|\n Temporal.from_dcsv(dscv_s)\n end\n end",
"title": ""
},
{
"docid": "0eb1acde08a9f82063d60eee107e08f9",
"score": "0.6234673",
"text": "def dates_to_periods\n \n period = period_from..period_to\n\n multi_month = lambda { |u,x| u.month % x == 0 ? u.month/x : nil }\n\n all_periods=[]\n case frecuency\n when Settings.frecuency.daily\n period.each { |u| all_periods.push(u) }\n when Settings.frecuency.weekly\n period.each { |u| all_periods.push(u.strftime(\"%W\")+\"-\"+u.year.to_s) }\n when Settings.frecuency.monthly\n period.each { |u| all_periods.push(u.month.to_s+\"-\"+u.year.to_s) }\n when Settings.frecuency.bimonthly, Settings.frecuency.three_monthly, Settings.frecuency.four_monthly\n period.each do |u|\n all_periods.push(multi_month.call(u,frecuency).to_s+\"-\"+u.year.to_s) unless\n multi_month.call(u,frecuency).nil?\n end\n when Settings.frecuency.yearly\n period.each { |u| all_periods.push(u.year) }\n end\n\n if all_periods.empty? \n []\n else\n all_periods.uniq\n end\n end",
"title": ""
},
{
"docid": "5548fe6ea7676d27047a7af0cdc296d4",
"score": "0.6206744",
"text": "def get_periods(first_start, first_end) \n\t\tperiods = []\n\n\t\tnot_ends = \n\t\t\t(@until.is_a? Fixnum) ?\n\t\t\tlambda {|i,d| i < @until} :\n\t\t\tlambda {|i,d| d < @until}\n\n\t\tduration = first_end - first_start\n\t\tcurrent_start = first_start\n\n\t\tcurrent_start = get_next_day(current_start) if (@weekdays.index current_start.wday).nil?\n\n\t\ti = 0\n\t\twhile not_ends.call(i, current_start)\n\t\t\tperiods << [current_start, current_start + duration]\n\n\t\t\tcurrent_start = get_next_day(current_start)\n\t\t\ti +=1\n\t\tend\n\n\t\tperiods\t\t\n\tend",
"title": ""
},
{
"docid": "0d9c25536aab98381aeae64ca6e9c1e6",
"score": "0.6101643",
"text": "def actual_periods(length)\n from = Date.today\n to = from + length\n periods.select do |p|\n p.price > 0 && from <= p.end_date && p.start_date <= to\n end\n end",
"title": ""
},
{
"docid": "920ea04aa29f4fac43831998318c1de0",
"score": "0.6090404",
"text": "def get_variable_period_types(opts = {})\n data, status_code, headers = get_variable_period_types_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "5c84eabdc596a8d9dad6451f78e3638f",
"score": "0.5931956",
"text": "def extract_periods( expression )\n\t\tpositive_periods = []\n\t\tnegative_periods = []\n\n\t\texpression.strip.downcase.split( /\\s*,\\s*/ ).each do |subexpr|\n\t\t\thash, negative = self.extract_period( subexpr )\n\t\t\tif negative\n\t\t\t\tnegative_periods << hash\n\t\t\telse\n\t\t\t\tpositive_periods << hash\n\t\t\tend\n\t\tend\n\n\t\treturn positive_periods, negative_periods\n\tend",
"title": ""
},
{
"docid": "530f9dd4900839f51815b0da4c158eb5",
"score": "0.59301686",
"text": "def get_months\n result = []\n\n unless @begin_time.nil?\n curr = @begin_time\n while date_in_range?( curr ) \n result << curr\n curr = curr.next_month\n end\n end\n\n result \n end",
"title": ""
},
{
"docid": "dcb6e900dc4f82f5d04a217dbbbeadf5",
"score": "0.5921113",
"text": "def months\n (Periods::Month.for(start_date)..Periods::Month.for(end_date)).to_a\n end",
"title": ""
},
{
"docid": "cf04871d85514765719d1f026c9e6ff8",
"score": "0.59088284",
"text": "def periods_from_start(date)\n (date - cf.min_date) / cf.period\n end",
"title": ""
},
{
"docid": "ff89ae1aa5da090f3cf37b39f766a388",
"score": "0.5905078",
"text": "def periods\n \"#{period}s\".to_sym\n end",
"title": ""
},
{
"docid": "b5b9df7c0165b58000faadba61c6e0ce",
"score": "0.5895618",
"text": "def periods_for_local(local)\n info.periods_for_local(local)\n end",
"title": ""
},
{
"docid": "b5b9df7c0165b58000faadba61c6e0ce",
"score": "0.5895618",
"text": "def periods_for_local(local)\n info.periods_for_local(local)\n end",
"title": ""
},
{
"docid": "03a1f48f77d6d3818fe6d937dd117f8f",
"score": "0.5895496",
"text": "def period\n tilikausi_alku..tilikausi_loppu\n end",
"title": ""
},
{
"docid": "c6627761e44145116825022261ac0adc",
"score": "0.58704543",
"text": "def periods_for_local(local); end",
"title": ""
},
{
"docid": "c6627761e44145116825022261ac0adc",
"score": "0.58704543",
"text": "def periods_for_local(local); end",
"title": ""
},
{
"docid": "c6627761e44145116825022261ac0adc",
"score": "0.58704543",
"text": "def periods_for_local(local); end",
"title": ""
},
{
"docid": "c6627761e44145116825022261ac0adc",
"score": "0.58704543",
"text": "def periods_for_local(local); end",
"title": ""
},
{
"docid": "c6627761e44145116825022261ac0adc",
"score": "0.58704543",
"text": "def periods_for_local(local); end",
"title": ""
},
{
"docid": "c6627761e44145116825022261ac0adc",
"score": "0.58704543",
"text": "def periods_for_local(local); end",
"title": ""
},
{
"docid": "875507e5acc5dd0616d9783f1694c093",
"score": "0.58560383",
"text": "def periods_for_local(local)\n real_timezone.periods_for_local(local)\n end",
"title": ""
},
{
"docid": "875507e5acc5dd0616d9783f1694c093",
"score": "0.58560383",
"text": "def periods_for_local(local)\n real_timezone.periods_for_local(local)\n end",
"title": ""
},
{
"docid": "9acb085b65c305a07d052c3754efe781",
"score": "0.58555835",
"text": "def evaluation_periods\n data.evaluation_periods\n end",
"title": ""
},
{
"docid": "4d3fdc77eb5665705101f3f5075ac2c9",
"score": "0.5793188",
"text": "def periods_per_month\n case self.pay_period\n when \"WEEKLY\"\n 4\n when \"BIWEEKLY\"\n 2\n when \"MONTHLY\"\n 1\n end\n end",
"title": ""
},
{
"docid": "9815e3b40f407ac58674198942546c3d",
"score": "0.5779497",
"text": "def annual_periods_for_user(periods)\n _periods = []\n current_month = 1\n current_period = 0\n\n while current_month < 13\n if periods[current_period] && periods[current_period].start_date.month == current_month\n _periods << periods[current_period]\n current_month += periods[current_period].duration\n current_period += 1\n else\n _periods << nil\n current_month += 1\n end\n end\n\n _periods\n end",
"title": ""
},
{
"docid": "71be857b5b9efd383dd2028acf397798",
"score": "0.5732708",
"text": "def split\n\t\t\t[Duration.new(@seconds, 0), Duration.new(0, @months)]\n\t\tend",
"title": ""
},
{
"docid": "d4d680a7b733906aa98e6a07cb910a9a",
"score": "0.5714497",
"text": "def fetch_periods( num )\n result = Array.new( num )\n i = @idx\n num.times do |j|\n i = prev_index( i )\n result[j] = @periods[i]\n end\n result\n end",
"title": ""
},
{
"docid": "bf41888a2963587edca27c7db3ea0359",
"score": "0.56980413",
"text": "def get_period(i)\n start = get_period_start(i)\n return start..(start + self.interval.days - 1.seconds)\n end",
"title": ""
},
{
"docid": "efd7978f68fdfde267095268df4bd9d6",
"score": "0.5690404",
"text": "def period(arg=nil)\n arg ||= @given_period\n { post: Post.where(created_at: 1.send(arg).ago .. Time.now).size, comment: Comment.where(created_at: 1.send(arg).ago .. Time.now).size }\n end",
"title": ""
},
{
"docid": "9df57d529f996c9c99cd192be2ee4668",
"score": "0.5647473",
"text": "def period_symbols\n periods_sorted = self.periods.sort! { |x, y| x.number <=> y.number }\n periods_sorted.map { |period| period.symbol }.uniq\n end",
"title": ""
},
{
"docid": "f54412ae926753d3e4c4f32abaad157c",
"score": "0.5627088",
"text": "def months\n find_period :months\n end",
"title": ""
},
{
"docid": "b51c298fd6f92b546e96f7c54141354d",
"score": "0.562431",
"text": "def get_weeks_from_period(time_period)\n # time_period (string), that maps to a early or late period of a month\n # returns an array of integers that converts the time_period to series\n # of week numbers in a 52-week year.\n\n # data source:\n # http://www.simplesteps.org/eat-local/state/\n\n case time_period\n when \"Early January\"\n return [1, 2]\n when \"Late January\"\n return [3, 4]\n when \"Early February\"\n return [5, 6]\n when \"Late February\"\n return [7, 8]\n when \"Early March\"\n return [9, 10]\n when \"Late March\"\n return [11, 12]\n when \"Early April\"\n return [13, 14]\n when \"Late April\"\n return [15, 16]\n when \"Early May\"\n return [17, 18]\n when \"Late May\"\n return [19, 20]\n when \"Early June\"\n return [21, 22]\n when \"Late June\"\n return [23, 24]\n when \"Early July\"\n return [25, 26]\n when \"Late July\"\n return [27, 28]\n when \"Early August\"\n return [29, 30]\n when \"Late August\"\n return [31, 32]\n when \"Early September\"\n return [33, 34]\n when \"Late September\"\n return [35, 36]\n when \"Early October\"\n return [37, 38]\n when \"Late October\"\n return [39, 40]\n when \"Early November\"\n return [41, 42]\n when \"Late November\"\n return [43, 44]\n when \"Early December\"\n return [45, 46]\n when \"Late December\"\n return [47, 48]\n end\nend",
"title": ""
},
{
"docid": "cfb6eb98b26da88b334ff5d668788aa6",
"score": "0.56212866",
"text": "def months\r\n ((@period % A_YEAR.to_r)/A_MONTH.to_r).to_i\r\n end",
"title": ""
},
{
"docid": "3cd5594b57ee4ce58dd78443dc41170f",
"score": "0.56031346",
"text": "def years\n years = []\n year = Periods::Year.for(start_date)\n while year.end_date <= end_date\n years << year\n year = year.next\n end\n years\n end",
"title": ""
},
{
"docid": "844710a3d3c5bd0c54ed569ffbff086f",
"score": "0.5601615",
"text": "def main_company_periods\n periods\n end",
"title": ""
},
{
"docid": "7e1ec54600c944be95dc6d31111c4f49",
"score": "0.5596398",
"text": "def get_weeks_from_period(time_period)\n\t# time_period (string), that maps to a early or late period of a month\n\t# returns an array of integers that converts the time_period to series\n\t# of week numbers in a 52-week year.\n\n\t# data source:\n\t# http://www.simplesteps.org/eat-local/state/\n\n\tcase time_period\n\twhen \"Early January\"\n\t\treturn [1, 2]\n\twhen \"Late January\"\n\t\treturn [3, 4]\n\twhen \"Early February\"\n\t\treturn [5, 6]\n\twhen \"Late February\"\n\t\treturn [7, 8]\n\twhen \"Early March\"\n\t\treturn [9, 10]\n\twhen \"Late March\"\n\t\treturn [11, 12]\n\twhen \"Early April\"\n\t\treturn [13, 14]\n\twhen \"Late April\"\n\t\treturn [15, 16]\n\twhen \"Early May\"\n\t\treturn [17, 18]\n\twhen \"Late May\"\n\t\treturn [19, 20]\n\twhen \"Early June\"\n\t\treturn [21, 22]\n\twhen \"Late June\"\n\t\treturn [23, 24]\n\twhen \"Early July\"\n\t\treturn [25, 26]\n\twhen \"Late July\"\n\t\treturn [27, 28]\n\twhen \"Early August\"\n\t\treturn [29, 30]\n\twhen \"Late August\"\n\t\treturn [31, 32]\n\twhen \"Early September\"\n\t\treturn [33, 34]\n\twhen \"Late September\"\n\t\treturn [35, 36]\n\twhen \"Early October\"\n\t\treturn [37, 38]\n\twhen \"Late October\"\n\t\treturn [39, 40]\n\twhen \"Early November\"\n\t\treturn [41, 42]\n\twhen \"Late November\"\n\t\treturn [43, 44]\n\twhen \"Early December\"\n\t\treturn [45, 46]\n\twhen \"Late December\"\n\t\treturn [47, 48]\n\tend\nend",
"title": ""
},
{
"docid": "ada6ca9c8c872783383b7316d8f138b3",
"score": "0.55649",
"text": "def dar_periodos()\n periodos = []\n result_set = self.estudiantemateria.find_by_sql(\"SELECT distinct periodo_id FROM estudiantemateria GROUP BY periodo_id,id\")\n result_set.each do |estudiante_materium|\n periodos.push(estudiante_materium.periodo)\n end\n return\n end",
"title": ""
},
{
"docid": "8d83332d8f6b1d054e21a421f950720b",
"score": "0.5561816",
"text": "def daily_time_periods\r\n daily_time_periods = []\r\n @daily_usage_charges = self.daily_usage_charges\r\n @daily_usage_charges.each do |daily_usage_charge|\r\n daily_time_periods << {start_time: daily_usage_charge.start_time, end_time: daily_usage_charge.end_time}\r\n end\r\n return daily_time_periods\r\n end",
"title": ""
},
{
"docid": "b16db84cd6fbe02faf55afd407703e6b",
"score": "0.55496615",
"text": "def Period(value); end",
"title": ""
},
{
"docid": "25a4eb985b9670df438d495b4204a4eb",
"score": "0.5546421",
"text": "def combined_periods(*args)\r\n effective_periods = effective_periods(*args)\r\n start_dates = effective_periods.map(&:start).uniq.sort\r\n end_dates = effective_periods.map(&:end).uniq.sort\r\n combined_dates = (start_dates + end_dates).uniq.sort\r\n combined_periods = []\r\n\r\n combined_dates.size.times.each do |idx|\r\n break if combined_dates[idx+1].nil?\r\n combined_periods.push(Period[combined_dates[idx],combined_dates[idx+1]])\r\n end\r\n\r\n combined_periods\r\n end",
"title": ""
},
{
"docid": "65876fb08858b0c8c89b01c74d4d6884",
"score": "0.55412763",
"text": "def periods_for_local(local)\n @linked_timezone.periods_for_local(local)\n end",
"title": ""
},
{
"docid": "306ef5886bd51e3a23e8f42a468a778d",
"score": "0.55385935",
"text": "def fetch_periods(movie)\n schedule.select { |period| period.matches?(movie) }\n end",
"title": ""
},
{
"docid": "9deffe496bff2572e57e22f267800f3e",
"score": "0.55272794",
"text": "def period_pairs_for(age_in_seconds)\n years_remainder = age_in_seconds % SECONDS_IN_A_YEAR\n\n months_remainder = years_remainder % SECONDS_IN_A_MONTH\n\n weeks_remainder = months_remainder % SECONDS_IN_A_WEEK\n\n [\n [age_in_seconds / SECONDS_IN_A_YEAR, \"year\"],\n [years_remainder / SECONDS_IN_A_MONTH, \"month\"],\n [months_remainder / SECONDS_IN_A_WEEK, \"week\"],\n [weeks_remainder / SECONDS_IN_A_DAY, \"day\"],\n ]\n end",
"title": ""
},
{
"docid": "911b8726e5c88befdc1b0d6a80e62be2",
"score": "0.5497052",
"text": "def period_count\n @periods.length\n end",
"title": ""
},
{
"docid": "bd6db6ddf4289f1fc9232ad6116c9528",
"score": "0.54637814",
"text": "def available_periods(start, stop, exclusions)\n if exclusions.count == 0 \n [[start, stop]]\n elsif start == stop\n []\n else\n a = []\n exclusions.sort!\n #for i in (0..(exclusions.count-1))\n i = 0\n e_count = exclusions.count\n while i < e_count\n e = exclusions[i]\n if e[0] <= start \n start = e[1] < start ? start : e[1]\n i = i + 1\n else\n a << [start, e[0] > stop ? stop : e[0]]\n if e[1] > stop \n start = stop # To prevent last array enlarging (*)\n break\n else\n start = e[1]\n end\n end\n end\n # (*)\n if start < stop\n a << [start, stop]\n end\n a\n end\n end",
"title": ""
},
{
"docid": "abfac2804e94e53f46f9a28d393a82e7",
"score": "0.5405518",
"text": "def all\n stat = {}\n [:year, :month, :week, :day].map{|i| stat[i] = period(i)}\n\n return stat\n end",
"title": ""
},
{
"docid": "e37d1aec6480fd3d33d12feb51e655d7",
"score": "0.54051113",
"text": "def predictable_billing_periods\r\n time_periods = []\r\n #decide the increment time period\r\n if self.billing_interval == \"Monthly\"\r\n incrementBy = 1.month\r\n elsif self.billing_interval == \"Quarterly\"\r\n incrementBy = 3.months\r\n else\r\n return \"No billing interval record!\"\r\n end\r\n\r\n #get the first period of the predictable period list\r\n currentStartDate = self.invoices.where(actable_type: ImportedInvoice).last[:end_date] + 1.day\r\n currentEndDate = currentStartDate + incrementBy\r\n time_periods << {:start_date => currentStartDate, :end_date => currentEndDate}\r\n\r\n #calculate the end of the NEXT Financial year\r\n currentYear = currentStartDate.year\r\n eonfy = Date.new(currentYear,06,30)\r\n if (currentStartDate - 1.day).month <= 6\r\n eonfy = eonfy + 1.year\r\n else\r\n eonfy = eonfy + 2.year\r\n end\r\n\r\n #insert the remain periods of the predictable period \r\n while currentEndDate < eonfy\r\n currentStartDate = currentEndDate + 1.day\r\n currentEndDate = currentEndDate + incrementBy\r\n time_periods << {:start_date => currentStartDate, :end_date => currentEndDate}\r\n end\r\n\r\n return time_periods\r\n end",
"title": ""
},
{
"docid": "d8699f7b86587f8cb5efbb96d8055719",
"score": "0.5395088",
"text": "def periods_for_local(local)\n unless @transitions.empty?\n local = TimeOrDateTime.wrap(local)\n index = transition_index(local.year, local.mon)\n \n result = []\n \n start_index = transition_after_start(index - 1) \n if start_index && @transitions[start_index].local_end_at > local\n if start_index > 0\n if @transitions[start_index - 1].local_start_at <= local\n result << TimezonePeriod.new(@transitions[start_index - 1], @transitions[start_index])\n end\n else\n result << TimezonePeriod.new(nil, @transitions[start_index])\n end\n end\n \n end_index = transition_before_end(index + 1)\n \n if end_index \n start_index = end_index unless start_index\n \n start_index.upto(transition_before_end(index + 1)) do |i|\n if @transitions[i].local_start_at <= local\n if i + 1 < @transitions.length\n if @transitions[i + 1].local_end_at > local\n result << TimezonePeriod.new(@transitions[i], @transitions[i + 1])\n end\n else\n result << TimezonePeriod.new(@transitions[i], nil)\n end\n end\n end\n end\n \n result\n else\n raise NoOffsetsDefined, 'No offsets have been defined' unless @previous_offset\n [TimezonePeriod.new(nil, nil, @previous_offset)]\n end\n end",
"title": ""
},
{
"docid": "c7f622351105983ee9eda0dce96f5433",
"score": "0.53773993",
"text": "def fund_times(day) \n times = []\n \n periods_per_day(day).to_i.times do |i| \n times[i] = (day.start_time + (i * day.period_length * 60)).to_time\n end\n\n return times\n end",
"title": ""
},
{
"docid": "e5af97b5941da1f5b1f00586bc8c8075",
"score": "0.53616035",
"text": "def months_with_dividends\n dividends.map { |d| [d.last_day.month, d.last_day.year] }.uniq.size\n end",
"title": ""
},
{
"docid": "993448af2cc420a1c382c19227d6f39f",
"score": "0.5352941",
"text": "def halfyears\n halfyears = []\n halfyear = Periods::Halfyear.for(start_date)\n while halfyear.end_date <= end_date\n halfyears << halfyear\n halfyear = halfyear.next\n end\n halfyears\n end",
"title": ""
},
{
"docid": "0567a5246e0d838dcc817556700bcb28",
"score": "0.53481704",
"text": "def pagy_calendar_period(collection)\n collection.minmax.map(&:in_time_zone)\n end",
"title": ""
},
{
"docid": "46aec4d25206e798d85aa6f88274cd22",
"score": "0.53269863",
"text": "def period\n data.period\n end",
"title": ""
},
{
"docid": "de98269c90c7996ede582b9e45afd497",
"score": "0.53180987",
"text": "def available_periods(type)\n company_type_select.select(type)\n wait_until_plans_loaded(type)\n period_labels.map{ |ele| ele.text}\n end",
"title": ""
},
{
"docid": "89d5a81534264c42963a876d72e7f2c2",
"score": "0.53180397",
"text": "def testPeriods\n expected = [ 70, 60, 50 ]\n sm = StatsMachine.new( @dots )\n \n # push initial state of 50\n sm.update\n \n # set to 60 and push\n @dots[1] = @dot_dark.clone\n sm.update\n \n # set to 70 and push\n @dots[3] = @dot_dark.clone\n sm.update\n \n actual = sm.periods( 3 )\n\t\tassert_not_nil( actual, \"periods method shouldn't be returning nil\" )\n assert_equal( expected, actual, \"LIFO not as we know it\" )\n end",
"title": ""
},
{
"docid": "64ac6987105996b6c31ddd0fd12f022c",
"score": "0.5290141",
"text": "def evaluation_periods\n @alarm.evaluation_periods\n end",
"title": ""
},
{
"docid": "e53e5bbe3b1b2fd977645ec7aa9b3dec",
"score": "0.5288113",
"text": "def period\n DateDefaults::MIN..at_time.to_date\n end",
"title": ""
},
{
"docid": "aa5f3a6f80c11a36486efd148705a9c5",
"score": "0.52853346",
"text": "def periods_for_local(local)\n raise_not_implemented('periods_for_local')\n end",
"title": ""
},
{
"docid": "e0dfc5ad9c7e706141e4ebc5bc4d9b53",
"score": "0.52606666",
"text": "def periods_per_day(day)\n hours_per_day = day.end_time.to_time.hour - day.start_time.to_time.hour\n periods_per_hour = 60 / day.period_length\n \n periods_per_day = hours_per_day * periods_per_hour\n end",
"title": ""
},
{
"docid": "742cefba1f9ab5d6d13356eb8412436c",
"score": "0.5257411",
"text": "def periods_for_local(_local)\n [OffsetTimezonePeriod.new(@offset)]\n end",
"title": ""
},
{
"docid": "0815479c2d8173e0b36101f09a272b02",
"score": "0.5255879",
"text": "def period_by_range(range)\n diff = (range.last - range.first).round\n period = nil\n Steps.each_with_index do |step,i|\n if diff <= step\n period = @periods[i] \n break\n end\n end\n #if not found => fallback\n period ||= ( @periods[Steps.length] || @periods.last ) \n end",
"title": ""
},
{
"docid": "586f705ef0f2c55fa492c12b03f6b9d8",
"score": "0.52484137",
"text": "def array_of_period_products\n period_products.to_a\n end",
"title": ""
},
{
"docid": "a9bca75192c8856a90d20d916d9cc6e5",
"score": "0.52258354",
"text": "def periods_for_local(local)\n local = local.to_ri_cal_date_time_value\n candidate_standard = last_before_local(standard, local)\n candidate_daylight = last_before_local(daylight, local)\n if candidate_daylight && candidate_daylight.swallows_local?(local, candidate_standard)\n [] # Invalid local time\n elsif candidate_standard\n if candidate_daylight\n if candidate_daylight.dtstart > candidate_standard.dtstart\n [candidate_daylight]\n elsif candidate_standard.ambiguous_local?(local)\n [candidate_daylight, candidate_standard]\n else\n [candidate_standard].compact\n end\n else\n [candidate_standard].compact\n end\n end\n end",
"title": ""
},
{
"docid": "a850c1a79244bf2657ece02d130638f9",
"score": "0.5191836",
"text": "def num_of_periods(params)\n \t\tperiods = (3..15).to_a\n \t\tif params[:num_period]\n \t\t\treturn params[:num_period].to_i, periods\n \t\telse\n \t\t\treturn 13, periods\n \t\tend\n \tend",
"title": ""
},
{
"docid": "06a8211d8fc5693c8c80b6c78a6a864d",
"score": "0.5176071",
"text": "def get_phase_weeks(phases)\n phase_weeks = []\n count = 0\n phases.each do |x|\n weeks = get_weeks(x)\n phase_weeks[count] = weeks\n count += 1\n end\n return phase_weeks\n end",
"title": ""
},
{
"docid": "f54fdc0968a19ad1261ccefac0ea4611",
"score": "0.5174629",
"text": "def calculated_dates\n [period1_from_date,period1_end_date,\n period2_from_date, period2_end_date] \n end",
"title": ""
},
{
"docid": "ee776521995ae6b66bb8ec1dd592427e",
"score": "0.5174388",
"text": "def periods_for_local(local_timestamp)\n raise_not_implemented('periods_for_local')\n end",
"title": ""
},
{
"docid": "f55771eb77019d952fe3562779992d4d",
"score": "0.51617473",
"text": "def get_periods(id, starts: nil, ends: nil, threshold: nil, operation: nil)\n params = { start: starts, end: ends, threshold: threshold, op: operation }\n @client.http_get(\"/#{@resource}/#{ERB::Util.url_encode(id)}/periods?\" + encode_params(params))\n end",
"title": ""
},
{
"docid": "39354ce65fe61e4afdf7b886094218b2",
"score": "0.5161156",
"text": "def months\n Volt::Duration.new(self.to_i * 30.days, [[:months, self.to_i]])\n end",
"title": ""
},
{
"docid": "cc6d2184f074de9a04b06133797badfa",
"score": "0.51565915",
"text": "def optimize_periods\n periods = self.clone_periods\n optimized = []\n i=0\n while i < periods.length\n p1 = periods[i]\n optimized << p1\n j= i+1\n while j < periods.length\n p2 = periods[j]\n if p1.contains? p2\n periods.delete p2\n elsif p1.overlap? p2\n p1.period_start = [p1.period_start,p2.period_start].min\n p1.period_end = [p1.period_end,p2.period_end].max\n periods.delete p2\n else\n j += 1\n end\n end\n i+= 1\n end\n optimized.sort { |a,b| a.period_start <=> b.period_start}\n end",
"title": ""
},
{
"docid": "4f94d63bc76c0420eb9cca9098b2d950",
"score": "0.5144937",
"text": "def period_with_data(sdate,edate,agent,settings)\n \n #we only retrieve data for whole months, so change start date to first of month\n nsdate = sdate\n nsdate -= ( sdate.day + 1 ) if sdate.day > 1\n\n days = []\n ((nsdate..edate).select { |d| d.day == 1 }).map do |d|\n days << days_with_data(d,agent,settings)\n end\n days.flatten!(1) \n days.map! { |a| DateTime.new(*a) }\n days.reject! { |d| d < sdate or d > edate }\n\n return days\nend",
"title": ""
},
{
"docid": "133a4a9a5c744d69d2b4721939db9e6b",
"score": "0.5144396",
"text": "def generate_week_periods\n end",
"title": ""
},
{
"docid": "a74ea5e2c9f979d519dc4d279472710f",
"score": "0.514392",
"text": "def periods # needs list of periods for all subscriptions\n \n end",
"title": ""
},
{
"docid": "878f26c8f689b0527f0db16fa815c6dc",
"score": "0.5127184",
"text": "def as_months\r\n (@period/A_MONTH.to_r).to_f\r\n end",
"title": ""
},
{
"docid": "fac330901d855e2df2bacc20b8de8d67",
"score": "0.51242507",
"text": "def period; end",
"title": ""
},
{
"docid": "fac330901d855e2df2bacc20b8de8d67",
"score": "0.5123009",
"text": "def period; end",
"title": ""
},
{
"docid": "fac330901d855e2df2bacc20b8de8d67",
"score": "0.5123009",
"text": "def period; end",
"title": ""
},
{
"docid": "fac330901d855e2df2bacc20b8de8d67",
"score": "0.5123009",
"text": "def period; end",
"title": ""
},
{
"docid": "41d27815efd24e17dd4d889e824bbe68",
"score": "0.51150775",
"text": "def period_length\n ((range_time.first - range_time.last) / 60).abs.to_i\n end",
"title": ""
},
{
"docid": "91dfe683399cfbfef7e8eec9555c08df",
"score": "0.5106126",
"text": "def period\n @period\n end",
"title": ""
},
{
"docid": "9c00f7f4a5f4be59bcc3a41cc964528c",
"score": "0.5100325",
"text": "def dates_a_for_periods(num_periods, end_date, period_type)\n all_dates = []\n # rails has pre-defined date functions\n # depending on the period type tell me the beginning_function \n # i.e. given a date, how do I get the start date of that period\n # eg. Given 3rd December 2016, I want the start date of the month i.e. 1st December 2016\n # my beginning function is :beginning_of_month\n # similarly last_function gives the last date in the period\n beginning_function, last_function = period_date_functions(period_type)\n\n # Orders table needs the date of the next day of the date you want the calculation to end at\n all_dates.push(end_date.next_day)\n all_dates.push(end_date.send(beginning_function))\n return (all_dates + get_last_periods_date(num_periods - 1, end_date.send(beginning_function), last_function)).sort \n end",
"title": ""
},
{
"docid": "21f71c359958b2af9f89bf2401a7cdf6",
"score": "0.50924236",
"text": "def collect_period_dates(query, date_from, date_to)\n dates = []\n periods = query.between_dates(date_from, date_to).all.to_a\n periods.each do |period|\n (period.from .. period.to).each do |date|\n dates.push(date) if date >= date_from && date <= date_to\n end\n end\n\n dates\n end",
"title": ""
},
{
"docid": "602f289f5d6c094568a0008d1a9be44a",
"score": "0.5082088",
"text": "def quarters\n quarters = []\n quarter = Periods::Quarter.for(start_date)\n while quarter.end_date <= end_date\n quarters << quarter\n quarter = quarter.next\n end\n quarters\n end",
"title": ""
},
{
"docid": "a40ee166a201a1a2eb0ab233edacbfc9",
"score": "0.50728995",
"text": "def intersect_periods( left, right )\n\t\tnew_periods = []\n\t\texplode( left ).product( explode(right) ) do |p1, p2|\n\t\t\tnew_period = {}\n\t\t\tcommon_scales = p1.keys & p2.keys\n\n\t\t\t# Keys exist on both sides, diff+merge identical values\n\t\t\tcommon_scales.each do |scale|\n\t\t\t\tvals = p1[ scale ] & p2[ scale ]\n\t\t\t\tnew_period[ scale ] = Schedulability::Parser.coalesce_ranges( vals, scale )\n\t\t\tend\n\t\t\tnext if new_period.values.any?( &:empty? )\n\n\t\t\t# Keys exist only on one side, sync between sides because\n\t\t\t# the other side is implicitly infinite.\n\t\t\t(p1.keys - common_scales).each do |scale|\n\t\t\t\tnew_period[ scale ] = Schedulability::Parser.coalesce_ranges( p1[scale], scale )\n\t\t\tend\n\t\t\t(p2.keys - common_scales).each do |scale|\n\t\t\t\tnew_period[ scale ] = Schedulability::Parser.coalesce_ranges( p2[scale], scale )\n\t\t\tend\n\n\t\t\tnew_periods << new_period\n\t\tend\n\n\t\treturn new_periods\n\tend",
"title": ""
},
{
"docid": "15a8d39d423030bd76781898eac7ecb3",
"score": "0.50718176",
"text": "def days\r\n ((@period % A_MONTH.to_r)/A_DAY.to_r).to_i\r\n end",
"title": ""
},
{
"docid": "08b22efb32312d92d8fa963bfe0d296a",
"score": "0.50714093",
"text": "def period_field\n :period\n end",
"title": ""
},
{
"docid": "ad2c81c4599805b6476cf631118bd2a6",
"score": "0.50685006",
"text": "def possible_cohorts\n [:january, :february, :march, :april, :may, :june, :july,\n :august, :september, :october, :november, :december]\nend",
"title": ""
},
{
"docid": "f69dd232a17ccfaad44dea57518a9f10",
"score": "0.50675577",
"text": "def time_slices(max_slices = 3)\n today = Date.today\n starting_point = partition_range == :day ?\n today - 1.day : today.beginning_of_month - 1.month\n (1..max_slices).map do |i|\n [starting_point + (i - 1).send(partition_range),\n starting_point + i.send(partition_range)]\n end\n end",
"title": ""
},
{
"docid": "5c062f173958753560759e9d0bbcb29d",
"score": "0.5061956",
"text": "def periods_for_local(local)\n raise_unknown_timezone\n end",
"title": ""
},
{
"docid": "f294e9c3a147afd9e757825b05609e8b",
"score": "0.505745",
"text": "def count_period(period)\n return unless Von.config.period_defined_for?(@field, period)\n\n _counts = []\n _period = Von.config.periods[@field][period]\n now = DateTime.now.beginning_of_hour\n\n _period.length.times do\n this_period = now.strftime(_period.format)\n _counts.unshift(this_period)\n now = _period.hours? ? now.ago(3600) : now.send(:\"prev_#{_period.time_unit}\")\n end\n\n keys = Von.connection.hgetall(\"#{hash_key}:#{period}\")\n _counts.map { |date| { date => keys.fetch(date, 0) }}\n end",
"title": ""
},
{
"docid": "5d4f492aa01e132a8f23887c02a1126d",
"score": "0.5047393",
"text": "def populate_periods\n is_high = true\n periods = []\n period_index = 0\n @data.each do |frame|\n if frame.abs < amplitude_threshold # if pulse is low\n is_high = false\n else\n # pulse is high\n if !is_high # last frame, the pulse was low\n # move to next period if length is past minimum\n if periods[period_index] >= min_period_length\n is_high = true\n period_index += 1\n end\n end\n end\n # count period length\n periods[period_index] ||= 0\n periods[period_index] += 1\n end\n prune_periods(periods)\n @periods = periods\n end",
"title": ""
},
{
"docid": "683d93144500553cb3b1e5ab62f50c31",
"score": "0.5037799",
"text": "def months\n (1..12).to_a\n end",
"title": ""
},
{
"docid": "f77fc975af0de84aad2bc4af94f993f3",
"score": "0.50198954",
"text": "def loop_weeks\n date_start = Time.zone.today.beginning_of_week\n date_end = date_start + @period.months\n\n date_start.upto(date_end).map do |date|\n beginning_of_week = date.beginning_of_week\n beginning_of_week = Time.zone.today if beginning_of_week == date_start\n week = Week.new(date)\n\n [\n week.human,\n week.compact,\n beginning_of_week,\n date.end_of_week,\n ]\n end.uniq\n end",
"title": ""
},
{
"docid": "0b34896c4bd660f2d73a6c7c463dbfab",
"score": "0.5017488",
"text": "def count(time_unit)\n return if @periods.empty?\n\n counts = []\n _period = @periods.select { |p| p.time_unit == time_unit }.first\n\n _period.length.times do |i|\n this_period = _period.prev(i)\n counts.unshift(this_period)\n end\n\n keys = hgetall(hash_key(time_unit))\n counts.map { |date| { timestamp: date, count: keys.fetch(date, 0).to_i }}\n end",
"title": ""
},
{
"docid": "bceccbdc7bb2b813a9fc24685e3f64ed",
"score": "0.5011368",
"text": "def periods_for_local(local)\n raise NotImplementedError, 'Subclasses must override periods_for_local'\n end",
"title": ""
},
{
"docid": "00d6ce77a8083f8d9574a80094613f39",
"score": "0.5007114",
"text": "def get_all_data_period\n send_request(FUNCTION_GET_ALL_DATA_PERIOD, [], '', 4, 'L')\n end",
"title": ""
}
] |
efa6cbabbacf8568ca6d9b3ae15f1eda
|
increment and decrement operations
|
[
{
"docid": "72cdfe99fbbead52d4dcc2cafaf8ff01",
"score": "0.0",
"text": "def _dec\n @data = @_p_nz = (@data - 1) & 0xff\n end",
"title": ""
}
] |
[
{
"docid": "39c457361fe57f319eb49a844aad1db0",
"score": "0.71065086",
"text": "def decrement\n @counter = @counter - 1\n end",
"title": ""
},
{
"docid": "20840d152cf74899d3ce6373e22a91e2",
"score": "0.69738495",
"text": "def decrement\n @value -= 1\n end",
"title": ""
},
{
"docid": "9a2b895bcd71fafe2b029179517c325e",
"score": "0.69409764",
"text": "def decrease(counter)\r\n counter - 1\r\nend",
"title": ""
},
{
"docid": "b1b6f1462964339d743453c3957bd739",
"score": "0.68605775",
"text": "def somaDecrementa\n\t# regiao critica\n\t$var1 += 1\n\t$var2 -= 1\nend",
"title": ""
},
{
"docid": "eabf04ac382d52716303c87b8ea0326e",
"score": "0.68602216",
"text": "def decrement!\n @value -= @increment\n \n self\n end",
"title": ""
},
{
"docid": "afc3845daf9db4013349b9d917e5749b",
"score": "0.6859809",
"text": "def decrease(counter)\n counter - 1\nend",
"title": ""
},
{
"docid": "afc3845daf9db4013349b9d917e5749b",
"score": "0.6859809",
"text": "def decrease(counter)\n counter - 1\nend",
"title": ""
},
{
"docid": "afc3845daf9db4013349b9d917e5749b",
"score": "0.6859809",
"text": "def decrease(counter)\n counter - 1\nend",
"title": ""
},
{
"docid": "afc3845daf9db4013349b9d917e5749b",
"score": "0.6859809",
"text": "def decrease(counter)\n counter - 1\nend",
"title": ""
},
{
"docid": "afc3845daf9db4013349b9d917e5749b",
"score": "0.6859809",
"text": "def decrease(counter)\n counter - 1\nend",
"title": ""
},
{
"docid": "af41e186e29482e1902a29fe0e7233e6",
"score": "0.68027467",
"text": "def increment\n @value += 1\n end",
"title": ""
},
{
"docid": "a4eed4ce0170a14dcf9b9bae5396bb0e",
"score": "0.6782201",
"text": "def decrease(counter)\n counter -= 1\nend",
"title": ""
},
{
"docid": "55895d74384f6da108227430ea839af3",
"score": "0.6736369",
"text": "def incr(x) x + 1 end",
"title": ""
},
{
"docid": "d04f39339ba43cf2e3ff813e8f72b2bc",
"score": "0.6686658",
"text": "def incr\n add(1)\n end",
"title": ""
},
{
"docid": "56c9147bbeada025daf933a894f7d33f",
"score": "0.66625035",
"text": "def increment\n @counter = @counter + 1\n end",
"title": ""
},
{
"docid": "d0a68376df5630e31c2c721fd5ed1e81",
"score": "0.6644963",
"text": "def increment \n\t\t@counter = @counter + 1\n\tend",
"title": ""
},
{
"docid": "29c16fded08fbaf778caba8bf1dc032b",
"score": "0.6607439",
"text": "def decrement\n with_update { with_progressables(:decrement) }\n end",
"title": ""
},
{
"docid": "4209dcedb5e23984e543f00e7aa9dc2c",
"score": "0.65212154",
"text": "def increment\n curr_value = counter\n self.counter = curr_value + 1\n save\n curr_value\n end",
"title": ""
},
{
"docid": "8022bbb201394aa9b759c2e8655b9750",
"score": "0.6507995",
"text": "def increment!\n @value += @increment\n \n self\n end",
"title": ""
},
{
"docid": "96e50168644deab436eecf7dc16b6d9a",
"score": "0.63959676",
"text": "def decrby(key, decrement); end",
"title": ""
},
{
"docid": "96e50168644deab436eecf7dc16b6d9a",
"score": "0.63959676",
"text": "def decrby(key, decrement); end",
"title": ""
},
{
"docid": "a390b4c8a6ff640fde82b1186544f8d5",
"score": "0.6360305",
"text": "def decrement element\n element.perform :decrement\n end",
"title": ""
},
{
"docid": "539d3b9c58cff9c3e0282c1f69b46e69",
"score": "0.63091886",
"text": "def decrease(counter)\n counter[0] -= 1\nend",
"title": ""
},
{
"docid": "2c8e0cc613e2b62056f86e0064de4e62",
"score": "0.62615526",
"text": "def increment_order!\n @current += 1\n end",
"title": ""
},
{
"docid": "b66d309ab8ecc068251506eb99410d58",
"score": "0.62446946",
"text": "def decrement(att, count = 1)\n increment(att, -count)\n end",
"title": ""
},
{
"docid": "726b72bd5f3ee5601427f436ee2f5eef",
"score": "0.62249416",
"text": "def increment_or_decrement(incr_or_decr)\n if @owned.find_by(id: params[:card_id])\n incrementing?(incr_or_decr) ? increment : decrement_or_destroy\n else\n add_card_to_collection\n end\n end",
"title": ""
},
{
"docid": "64550eb44247f125e78dbf3d1a6198fd",
"score": "0.6112779",
"text": "def decrement_count(current_count)\n current_count.to_i - 1\n end",
"title": ""
},
{
"docid": "7b745306c9f296493694ebb2744d08a5",
"score": "0.61122596",
"text": "def decrement(stat, sample_rate=1); count stat, -1, sample_rate end",
"title": ""
},
{
"docid": "732722d371c46ed87c5f27b40418b256",
"score": "0.60898554",
"text": "def increment(start, inc)\n\t\t\t\tProc.new{start +=inc}\nend",
"title": ""
},
{
"docid": "feb572c15d4ed27dbec2680d58d0a4db",
"score": "0.6075198",
"text": "def increment\n self.class.increment(self)\n end",
"title": ""
},
{
"docid": "ae050884304bf426bb4ec37eabdc34b5",
"score": "0.60644907",
"text": "def run\n puts case @action\n when \"increment\" then @count.increment\n when \"decrement\" then @count.decrement\n when \"reset\" then @count.reset\n end\n exit(0)\n end",
"title": ""
},
{
"docid": "ae050884304bf426bb4ec37eabdc34b5",
"score": "0.60644907",
"text": "def run\n puts case @action\n when \"increment\" then @count.increment\n when \"decrement\" then @count.decrement\n when \"reset\" then @count.reset\n end\n exit(0)\n end",
"title": ""
},
{
"docid": "596809836796a80b33b42a8bc8048464",
"score": "0.60637355",
"text": "def up num=(($multiplier.nil? or $multiplier == 0) ? 1 : $multiplier)\n #@oldindex = @current_index if num > 10\n @current_index -= num\n #unless is_visible? @current_index\n #if @prow > @current_index\n ##$status_message.value = \"1 #{@prow} > #{@current_index} \"\n #@prow -= 1\n #else\n #end\n #end\n $multiplier = 0\n end",
"title": ""
},
{
"docid": "8b86d43f5b4ae5dbaa7379ec8daa04ef",
"score": "0.60498977",
"text": "def increment(a)\n a = a + 1\nend",
"title": ""
},
{
"docid": "c228a2efbcafcc465a5273d523559e49",
"score": "0.6043229",
"text": "def test_assignment_sample02\n x = 0; y = 0\n x += 1; y -= 1\n assert_equal(1, x, \"increment x: note Ruby does not have ++\")\n assert_equal(-1, y, \"decrement y: no -- operator, either\")\n end",
"title": ""
},
{
"docid": "c339439c852602bdce25faae6248dcb6",
"score": "0.6011116",
"text": "def succ\n return self + 1\n end",
"title": ""
},
{
"docid": "896152979e48da9ea73441110978c7d9",
"score": "0.6011101",
"text": "def decrement_counter(counter_name, id)\n update_all \"#{counter_name} = #{counter_name} - 1\", \"#{primary_key} = #{id}\"\n end",
"title": ""
},
{
"docid": "57a7881c1bc86877a1c3b614793e823f",
"score": "0.60067594",
"text": "def vm_do_increment\r\n inc_raw = self.pop\r\n\r\n unless (inc_value = inc_raw.to_foorth_n)\r\n error \"F40: Cannot convert a #{inc_raw.foorth_name} to a Numeric instance\"\r\n end\r\n\r\n if inc_value > 0\r\n inc_value\r\n else\r\n error \"F41: Invalid loop increment value: #{inc_value}\"\r\n end\r\n end",
"title": ""
},
{
"docid": "9da827ddc98aa80599e03daa584c013d",
"score": "0.6002966",
"text": "def succ\n end",
"title": ""
},
{
"docid": "ca1507b4306d595a71ba47ad088e8523",
"score": "0.599522",
"text": "def increment_operator\n incremented = false\n i = 0\n while (incremented == false && i<(@operator_value.size) && @operator_increment_completed==false)\n if @operator_value[i] < (@operators.size-1)\n @operator_value[i] += 1\n incremented = true\n else\n @operator_value[i] = 0\n i+=1\n end\n end\n incremented\n end",
"title": ""
},
{
"docid": "d67a28a7363aaef48dfafcf59c870124",
"score": "0.5972042",
"text": "def INC\n operand = unwrap_integer evaluation_stack.pop\n evaluation_stack.push operand + 1\n end",
"title": ""
},
{
"docid": "b69717fe564ff0c5cd957406e5265ab1",
"score": "0.59690166",
"text": "def increment(name)\n update(name)\n end",
"title": ""
},
{
"docid": "f3bc59db842f8ccb673af3a0637895bf",
"score": "0.5944268",
"text": "def decrement(by: 1)\n return increment(by: -by.to_i)\n end",
"title": ""
},
{
"docid": "4178c9e1ad9de9916880a72fd667099d",
"score": "0.59376913",
"text": "def incr major, minor\n incr_by major, minor, 1\n end",
"title": ""
},
{
"docid": "908a5867eb1b956ed424325ba0edd734",
"score": "0.593396",
"text": "def succ() end",
"title": ""
},
{
"docid": "908a5867eb1b956ed424325ba0edd734",
"score": "0.593396",
"text": "def succ() end",
"title": ""
},
{
"docid": "908a5867eb1b956ed424325ba0edd734",
"score": "0.593396",
"text": "def succ() end",
"title": ""
},
{
"docid": "d13e96b37a7386214bd422e930636ca9",
"score": "0.5932125",
"text": "def inc\n $i + 1\n end",
"title": ""
},
{
"docid": "d40ef0a5e40f52ef4d5ceb2147a584fc",
"score": "0.59161484",
"text": "def advance\n @current += 1 unless at_end?\n return previous\n end",
"title": ""
},
{
"docid": "bfdcc5d38c914fe700c3d62d016f1f36",
"score": "0.5909751",
"text": "def up num=(($multiplier.nil? or $multiplier == 0) ? 1 : $multiplier)\n @oldindex = @current_index if num > 10\n @current_index -= num\n unless is_visible? @current_index\n if @prow > @current_index\n #$status_message.value = \"1 #{@prow} > #{@current_index} \"\n @prow -= 1\n else\n end\n end\n $multiplier = 0\n end",
"title": ""
},
{
"docid": "5948ea65ef5d4992b43a91663aa0bb8e",
"score": "0.5905738",
"text": "def increment(node)\n change_by node, 1\n end",
"title": ""
},
{
"docid": "c3cf737bc9787b85c515bf7bc89fc138",
"score": "0.5905145",
"text": "def incrementing?(incr_or_decr)\n incr_or_decr == \"increment\"\n end",
"title": ""
},
{
"docid": "ec93a748608a49e5a81532b11b699723",
"score": "0.5900812",
"text": "def decrement(node)\n change_by node, -1\n end",
"title": ""
},
{
"docid": "b2890e2f3b67d5f15343b31616b57bc8",
"score": "0.58804137",
"text": "def inc_value(iIncrement = 1)\n super\n end",
"title": ""
},
{
"docid": "f55cf5543568836bb7eacd1f58b0b4d5",
"score": "0.5880222",
"text": "def inc_e\n end",
"title": ""
},
{
"docid": "071b2c7db6831a9388ce6ce1babfd822",
"score": "0.5871401",
"text": "def incr(key); end",
"title": ""
},
{
"docid": "071b2c7db6831a9388ce6ce1babfd822",
"score": "0.5871401",
"text": "def incr(key); end",
"title": ""
},
{
"docid": "820b03aa242acc93003db731262d85c1",
"score": "0.5870771",
"text": "def decrement(records)\n records.update_all(['position = position - 1'])\n end",
"title": ""
},
{
"docid": "7e8fc0f1e1c93228b459876d41f2666a",
"score": "0.5865833",
"text": "def inc(v = 1)\n sync { @v += v }\n end",
"title": ""
},
{
"docid": "fc8afe70ce496d5a6c4a13e454d38edf",
"score": "0.58628076",
"text": "def prev_number(number)\n return number -= 1\nend",
"title": ""
},
{
"docid": "f147439e130f7f60acd8c99bca8447f0",
"score": "0.5844472",
"text": "def increment element\n element.perform :increment\n end",
"title": ""
},
{
"docid": "e5fadb246c444cd9b92ff4e52e0c01cb",
"score": "0.58275336",
"text": "def __to_inc__\n self\n end",
"title": ""
},
{
"docid": "3dd8e2a91dee1b7268ff9b7981e6f2c0",
"score": "0.58215624",
"text": "def decr_counter!(name, decr = 1)\n counter = self.send(name.to_sym)\n counter.decr(val)\n save\n counter.reconcile!\n end",
"title": ""
},
{
"docid": "13b63bf68813050d5f03968dbc029f01",
"score": "0.58028644",
"text": "def decrement(field, amount = 1)\n increment(field, -amount)\n end",
"title": ""
},
{
"docid": "3eef3d88344e19faaf7719a6ceca8c26",
"score": "0.57959133",
"text": "def increment\n if @type == :switch\n toggle\n else\n set_switch(true)\n self.value += @distance\n if :variable\n self.value = 0 if self.value > @max\n else\n self.value = @max if self.value > @max\n end\n end\n end",
"title": ""
},
{
"docid": "c5a0eb8074d91a020f1ea88129bc7d9e",
"score": "0.57945955",
"text": "def inc(incs)\n view.update_many(\"$inc\" => collect_operations(incs))\n end",
"title": ""
},
{
"docid": "afe60600640070351f7a1d1e5fdb03c7",
"score": "0.5788375",
"text": "def create_counter\n i = 0\n obj = Object.new\n (class << obj; self ; end ).class_eval {\n define_method(:inc, lambda { i += 1 } )\n define_method(:dec, lambda { i -= 1 } )\n }\n obj\nend",
"title": ""
},
{
"docid": "9633e38ad53d03f634b04a45068e48ae",
"score": "0.57879883",
"text": "def inc(key)\n \n end",
"title": ""
},
{
"docid": "d0d59c7ef3ab3e049918da6c31eb2bf8",
"score": "0.5786237",
"text": "def incrby(key, increment); end",
"title": ""
},
{
"docid": "d0d59c7ef3ab3e049918da6c31eb2bf8",
"score": "0.5786237",
"text": "def incrby(key, increment); end",
"title": ""
},
{
"docid": "c66f6e6a8e6e89f3a4bab2307ef3ae69",
"score": "0.57826144",
"text": "def incr_count\n @count ||= 0\n @count += 1\n end",
"title": ""
},
{
"docid": "e6ddbdf9ccdb820817d6c67c0df0096b",
"score": "0.577136",
"text": "def decrement(k, amount = 1, ignored_options = nil)\n increment k, -amount\n end",
"title": ""
},
{
"docid": "9d67e5985c5074fc51629e22a8dfac49",
"score": "0.57591224",
"text": "def inc_b\n end",
"title": ""
},
{
"docid": "c3a20370f893d197e36110927512f819",
"score": "0.57517654",
"text": "def decrement_counter(following)\n User.decrement_counter(:followings_count,following.user_id)\n User.decrement_counter(:inverse_followings_count,following.follower_id) \n end",
"title": ""
},
{
"docid": "b54a631c59b654c891b9419093baaf5c",
"score": "0.5751508",
"text": "def inc_a\n end",
"title": ""
},
{
"docid": "d44913c26656a0f5723436f5e9cde275",
"score": "0.57514596",
"text": "def increment_counter(counter)\n\tcounter += 1\n\treturn counter\nend",
"title": ""
},
{
"docid": "8a55a3064f159bf3d01546a147352ab7",
"score": "0.5730939",
"text": "def _inc(key,value)\n _set(key, (_get(key) || 0) + value)\n end",
"title": ""
},
{
"docid": "4ec25e6038850f631c2e107fcb4f3a38",
"score": "0.5715668",
"text": "def _dec(key,value)\n _set(key, (_get(key) || 0) - value)\n end",
"title": ""
},
{
"docid": "b40db4f097cc79a66b8dd86f8195ea47",
"score": "0.5695901",
"text": "def inc(n)\n n+1\nend",
"title": ""
},
{
"docid": "1cd31e6d250dd8ebc283c55e963d6664",
"score": "0.56954986",
"text": "def inc_d\n end",
"title": ""
},
{
"docid": "669a39b4fdbaabcab5ea29c1e2f3fef7",
"score": "0.56867605",
"text": "def decrement(key, amount = 1, options = {})\n increment(key, -amount, options)\n end",
"title": ""
},
{
"docid": "6eab01208ddc4940a9d08066754d62cd",
"score": "0.56850076",
"text": "def increment *args\n accumulators.incr(scope(*args))\n end",
"title": ""
},
{
"docid": "af1e34014a05bd7f9ca7227b2234e752",
"score": "0.5675201",
"text": "def on_inc\n end",
"title": ""
},
{
"docid": "a80ee59dbc267de68e1724df9d311472",
"score": "0.5674891",
"text": "def W\n @x -= 1\n end",
"title": ""
},
{
"docid": "950e5b61f21f78007c380ba14e536645",
"score": "0.56746805",
"text": "def increase_index\n @i +=1\n end",
"title": ""
},
{
"docid": "92f73ffb4891ab2e063eeed964d4bb55",
"score": "0.5674086",
"text": "def increment!\n\t\t\t\t@vertices += 1\n\t\t\t\t@count += 1\n\t\t\tend",
"title": ""
},
{
"docid": "55a7f5e1d8377ebe38cc1d636d888090",
"score": "0.5668212",
"text": "def decrease(rectangle, player, decrement=1)\n # Decrement counter\n increase(rectangle, player, -decrement)\n end",
"title": ""
},
{
"docid": "4274e260eadb8f1944dc82648a7e87c5",
"score": "0.5654351",
"text": "def DEC\n operand = unwrap_integer evaluation_stack.pop\n evaluation_stack.push operand - 1\n end",
"title": ""
},
{
"docid": "2c3fcf7a08e22906ba9fae2e8ad4d0a2",
"score": "0.565057",
"text": "def mutate(num)\n num += 1\n end",
"title": ""
},
{
"docid": "436d1156c0350fd09f06a2876c3b2057",
"score": "0.56491876",
"text": "def increment(n = 1)\n @quantity += n\n end",
"title": ""
},
{
"docid": "6692a71e6bc32879eb7d4b41b61bed09",
"score": "0.5633334",
"text": "def down\n self.x = (x+1)%10\n end",
"title": ""
},
{
"docid": "13bb272b0c306e4c07518cb44f0bf1c7",
"score": "0.56284636",
"text": "def meth1(start, inc)\n start -= inc\n lambda{ start += inc }\nend",
"title": ""
},
{
"docid": "3d00209ba86c302139e2be70d5cf3b23",
"score": "0.561808",
"text": "def decrement_counter(counter_name, id)\n rec = collection.findOne({:_id => id})\n rec[counter_name] -= 1\n collection.save(rec)\n end",
"title": ""
},
{
"docid": "194fd48cb5c82feded4454671cff3147",
"score": "0.5606261",
"text": "def inc_c\n end",
"title": ""
},
{
"docid": "1a3f35aface41d1798669f816f088f25",
"score": "0.5604886",
"text": "def increment_quantity\n @quantity += 1\n end",
"title": ""
},
{
"docid": "1b56b39ffc9e5c45670212367172c796",
"score": "0.56030977",
"text": "def zincrby(key, increment, member); end",
"title": ""
},
{
"docid": "1b56b39ffc9e5c45670212367172c796",
"score": "0.56030977",
"text": "def zincrby(key, increment, member); end",
"title": ""
},
{
"docid": "cf33ccc4518364d72fb79585b3e93ca2",
"score": "0.5591887",
"text": "def increment_counter\n unless self.count.nil?\n self.count += 1\n else\n self.count = 1\n end\n end",
"title": ""
},
{
"docid": "d6c909f98d71b79dc67bc77b1385d12c",
"score": "0.5590396",
"text": "def E\n @x += 1\n end",
"title": ""
},
{
"docid": "efc1d60b178e951d27f2b19d8c8f9b11",
"score": "0.5590335",
"text": "def succ!() end",
"title": ""
},
{
"docid": "8b2ee5832cc61c729439ccea747332b5",
"score": "0.558939",
"text": "def succ\n self + ONE\n end",
"title": ""
}
] |
e749bd61f5bcbba39ef6954e30c52d06
|
Create an instance of `Hyrax::AdministrativeSet` with the suggested_id if supported.
|
[
{
"docid": "34eb41414975701fd9a93a6f002f5730",
"score": "0.8219818",
"text": "def create_admin_set(suggested_id:, title:)\n if suggested_id.blank? || Hyrax.config.disable_wings || !Hyrax.metadata_adapter.is_a?(Wings::Valkyrie::MetadataAdapter)\n # allow persister to assign id\n Hyrax::AdministrativeSet.new(title: Array.wrap(title))\n else\n # use suggested_id\n Hyrax::AdministrativeSet.new(id: suggested_id, title: Array.wrap(title))\n end\n end",
"title": ""
}
] |
[
{
"docid": "45288c3467fada6c93903b83aab55178",
"score": "0.65313554",
"text": "def set_administrative\n @administrative = Administrative.find(params[:id])\n end",
"title": ""
},
{
"docid": "5ad5284e699d2ea421b4e1410883a9d5",
"score": "0.612553",
"text": "def set_administrative_region\n @administrative_region = AdministrativeRegion.find(params[:id])\n end",
"title": ""
},
{
"docid": "0a86f2efc758f42830a8fba96bd1bfdc",
"score": "0.5945812",
"text": "def create_default_admin_set!(admin_set_id: DEFAULT_ID, title: DEFAULT_TITLE)\n admin_set = create_admin_set(suggested_id: admin_set_id, title: title)\n admin_set = new(admin_set: admin_set, creating_user: nil, default_admin_set: true).create!\n default_admin_set_persister.update(default_admin_set_id: admin_set.id) if save_default?\n admin_set\n end",
"title": ""
},
{
"docid": "bd187adbf011a1004385b6e5ecb2d767",
"score": "0.58997405",
"text": "def set_task_administrative\n @task_administrative = TaskAdministrative.find(params[:id])\n end",
"title": ""
},
{
"docid": "be21e6d688b70ed33d982c814257281f",
"score": "0.5787724",
"text": "def assign_admin_set(school = self.school, department = self.department)\n as = AdminSet.where(title_sim: determine_admin_set(school, department)).first\n self.admin_set = as\n as\n end",
"title": ""
},
{
"docid": "be21e6d688b70ed33d982c814257281f",
"score": "0.5787724",
"text": "def assign_admin_set(school = self.school, department = self.department)\n as = AdminSet.where(title_sim: determine_admin_set(school, department)).first\n self.admin_set = as\n as\n end",
"title": ""
},
{
"docid": "090cc5f0cd60218ba9d6eb58edf2c918",
"score": "0.57828504",
"text": "def administrative=(value)\n @administrative = value\n end",
"title": ""
},
{
"docid": "090cc5f0cd60218ba9d6eb58edf2c918",
"score": "0.57828504",
"text": "def administrative=(value)\n @administrative = value\n end",
"title": ""
},
{
"docid": "e38c12d1729e112f1fff3be76590f5a7",
"score": "0.5662239",
"text": "def set_default_admin_set\n @default_admin_set = DefaultAdminSet.find(params[:id])\n end",
"title": ""
},
{
"docid": "79a72beabf0cf771559a4a10054b8b15",
"score": "0.55615026",
"text": "def determine_admin_set(school = self.school, department = self.department)\n as_name = AdminSetChooser.new.determine_admin_set(school, department)\n raise \"Cannot find admin set config where school = #{school.first} and department = #{department.first}\" unless as_name\n as_name\n end",
"title": ""
},
{
"docid": "eff97fc0e31c729df73fb66e25ad9ed5",
"score": "0.5544738",
"text": "def determine_admin_set(school = self.school, department = self.department)\n return \"Default Admin Set\" if migrated?\n as_name = AdminSetChooser.new.determine_admin_set(school, department)\n raise \"Cannot find admin set config where school = #{school.first} and department = #{department.first}\" unless as_name\n as_name\n end",
"title": ""
},
{
"docid": "c928098fcdfafab366c0729e342b183b",
"score": "0.53286695",
"text": "def set_administrative_function\n @administrative_function = AdministrativeFunction.find(params[:id])\n end",
"title": ""
},
{
"docid": "61de5c8860e62bda113ddf8de1ab40c6",
"score": "0.53040373",
"text": "def set_location_admin\n @location_admin = LocationAdmin.find(params[:id])\n end",
"title": ""
},
{
"docid": "ad8f5770971c783d702d6fad997c0d7f",
"score": "0.5242116",
"text": "def set_administrative_process\n @administrative_process = AdministrativeProcess.find(params[:id])\n end",
"title": ""
},
{
"docid": "c03f1d6cb00b0d8693d1765d56620d4d",
"score": "0.52323824",
"text": "def build_administrative\n Cocina::Models::Administrative.new(cocina.administrative.to_h\n .except(:partOfProject)\n .merge(releaseTags: ReleaseTags.for(cocina_object: cocina)))\n end",
"title": ""
},
{
"docid": "56e2aeda7eaea405f36e930d5a0300f1",
"score": "0.5193978",
"text": "def set_admin_location\r\n @admin_location = AdminLocation.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "6d33f40a29193aa80517aa6790bcd7bc",
"score": "0.51880336",
"text": "def set_admin_location\n @admin_location = Admin::Location.find(params[:id])\n end",
"title": ""
},
{
"docid": "1cbb6c6fa0560d177ff38b28830fc09e",
"score": "0.5177022",
"text": "def set_admin_classified\n @admin_classified = Classified.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "ddd4c937968cd8e071c0859faed1d161",
"score": "0.5148844",
"text": "def admin_set_id\n AdminSet::DEFAULT_ID\n end",
"title": ""
},
{
"docid": "c4616e955ea5bd4c765ab6f82aeb3f45",
"score": "0.51094884",
"text": "def administrative_scope\n as = @nodeset.search('.//xmlns:administrativeScope').first\n Placemaker::Location.new(as) unless as.nil?\n end",
"title": ""
},
{
"docid": "315061af3df603d1c31857f2b2744c14",
"score": "0.50883234",
"text": "def set_ministry\n @ministry = Ministry.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "5e24d6041e4e54b6161ef2707a6ac03f",
"score": "0.5046843",
"text": "def set_geoset\n @geoset = Geoset.find(params[:id])\n end",
"title": ""
},
{
"docid": "ebdd8be612e3ffced9b2e026a44c4e45",
"score": "0.5043926",
"text": "def create\n @administrative = Administrative.new(administrative_params)\n\n respond_to do |format|\n if @administrative.save\n format.html { redirect_to @administrative, notice: 'Administrative was successfully created.' }\n format.json { render :show, status: :created, location: @administrative }\n else\n format.html { render :new }\n format.json { render json: @administrative.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8538da4b97742eed82f6aec7c0224a38",
"score": "0.5006143",
"text": "def ensure_admin_set_attribute!(env)\n # These logical hoops copy the prior behavior of the code;\n # With a small logical caveat. If the given curation_concern\n # has an admin_set_id, we now verify that that admin set is\n # well formed.\n given_admin_set_id = env.attributes[:admin_set_id].presence || env.curation_concern.admin_set_id.presence\n admin_set_id = ensure_well_formed_admin_set_service.call(admin_set_id: given_admin_set_id)\n env.attributes[:admin_set_id] = given_admin_set_id || admin_set_id\n end",
"title": ""
},
{
"docid": "c04b7dd3e3310656b4a99476250ab6b8",
"score": "0.49929428",
"text": "def set_administrator_hotel\n @administrator_hotel = Hotel.find(params[:id])\n end",
"title": ""
},
{
"docid": "511c7ecd6c89d18a8f03ed69b05b793c",
"score": "0.49765193",
"text": "def set_suggestedintel\n @suggestedintel = Suggestedintel.find(params[:id])\n end",
"title": ""
},
{
"docid": "925a8834a185c69cd1bcf5ac43efd658",
"score": "0.49491662",
"text": "def set_adminstrator\n @adminstrator = Adminstrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "8ff200f83a19e841487ee8af80400407",
"score": "0.49340996",
"text": "def set_suggesthost\n @suggesthost = Suggesthost.find(params[:id])\n end",
"title": ""
},
{
"docid": "e72d90c5344f0ae59e427edadff49d7d",
"score": "0.49075735",
"text": "def create_dummy_administrator!\n return Administrator.find_or_create_by!({\n name: \"宮本 茂\",\n organization: \"Nintendo\",\n email: \"someone@example.com\",\n })\n end",
"title": ""
},
{
"docid": "2f49623599b180648723106502f62e96",
"score": "0.4892132",
"text": "def add\n # check if it exists\n as = get\n if !as.nil?\n OOLog.info(\"Availability Set #{as.name} exists in the #{as.location} region.\")\n else\n # need to create the availability set\n OOLog.info(\"Creating Availability Set\n '#{@as_name}' in #{@location} region\")\n avail_set = get_avail_set_props\n begin\n response =\n @client.availability_sets.create_or_update(@rg_name,\n @as_name,\n avail_set).value!\n return response\n rescue MsRestAzure::AzureOperationError => e\n OOLog.fatal(\"Error adding an availability set: #{e.body}\")\n rescue => ex\n OOLog.fatal(\"Error adding an availability set: #{ex.message}\")\n end\n end\n end",
"title": ""
},
{
"docid": "362cf206c1177a2752254271dcb66385",
"score": "0.48549983",
"text": "def administrative_scope\n as = @nodeset.search('.//xmlns:administrativeScope', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema').first\n Placemaker::Location.new(as) unless as.nil?\n end",
"title": ""
},
{
"docid": "c2e6700352343ab0a2f5ce395b320199",
"score": "0.48523676",
"text": "def set_admin_answer\n @admin_answer = Answer.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "47b9d3b917dd5ae00b98c29e70244306",
"score": "0.48486856",
"text": "def find_unsaved_default_admin_set\n admin_set = Hyrax.query_service.find_by(id: DEFAULT_ID)\n default_admin_set_persister.update(default_admin_set_id: DEFAULT_ID) if save_default?\n admin_set\n rescue Valkyrie::Persistence::ObjectNotFoundError\n # a default admin set hasn't been created yet\n end",
"title": ""
},
{
"docid": "0773723025c0053475be3e1ee587300f",
"score": "0.48428935",
"text": "def set_admin_zone\n @admin_zone = AdminZone.find(params[:id])\n end",
"title": ""
},
{
"docid": "1cca9088de05581c13d5c5b6ef89ee81",
"score": "0.4836821",
"text": "def new_input_set()\n return SearchLocationsInputSet.new()\n end",
"title": ""
},
{
"docid": "cab909654fdc91e563d1806e189c8912",
"score": "0.4835374",
"text": "def set_tour_set_admin\n @tour_set_admin = TourSetAdmin.find(params[:id])\n end",
"title": ""
},
{
"docid": "d8a696be616a2d14e5ddc307e6dca20f",
"score": "0.48252013",
"text": "def set_admin_area\n @admin_area = Admin::Area.find(params[:id])\n end",
"title": ""
},
{
"docid": "0f38419fe8866aa43644e1dc64f9e9ed",
"score": "0.4822354",
"text": "def set_admin \n @admin = Admin.friendly.find(params[:admin_id])\n end",
"title": ""
},
{
"docid": "cff494f5e5bbf86f816dcc7de534a4cb",
"score": "0.4819302",
"text": "def set_admin_country\n @admin_country = Admin::Country.find(params[:id])\n end",
"title": ""
},
{
"docid": "26bf6bdfe746ae6e98f344391d1c089e",
"score": "0.48141766",
"text": "def create\n Deprecation.warn(\"'##{__method__}' will be removed in Hyrax 4.0. \" \\\n \"Warning: This method may hide runtime errors. \" \\\n \"Instead, use 'Hyrax::AdminSetCreateService.create!'. \")\n create!.persisted?\n rescue RuntimeError => _err\n false\n end",
"title": ""
},
{
"docid": "b4665eebccd055d7adee7acadf9b4b7a",
"score": "0.48055768",
"text": "def set_admin_geofence\n @admin_geofence = AdminGeofence.find(params[:id])\n end",
"title": ""
},
{
"docid": "96993aa8d28eb37f82272fafa163eaf9",
"score": "0.47829822",
"text": "def set_admin \n @admin = Admin.friendly.find(params[:admin_id])\n end",
"title": ""
},
{
"docid": "23cfaa105946902f782f37e89574c7af",
"score": "0.47672",
"text": "def find_or_create_theater!\n existing = self.theater || ::Theater.find_by_short_name_and_coordinates(short_name, coordinates)\n return existing if existing\n ::Theater.create! name: name, address: address, coordinates: coordinates\n end",
"title": ""
},
{
"docid": "2d47451096057a03d6cd2ca9b8b67f99",
"score": "0.47546852",
"text": "def new_input_set()\n return FederalGrantsInputSet.new()\n end",
"title": ""
},
{
"docid": "8d17a6c04f6b25e52d1e987e3376c4b3",
"score": "0.47488734",
"text": "def set_adminagentfamily\n @adminagentfamily = Adminagentfamily.find(params[:id])\n end",
"title": ""
},
{
"docid": "56769235f9c75449aa79fb54b5721fca",
"score": "0.4745886",
"text": "def set_admin_zone\n @admin_zone = Zone.find(params[:id])\n end",
"title": ""
},
{
"docid": "bc63f1700cdc886dc0e2ccdab508df28",
"score": "0.47368765",
"text": "def create_availability_set\n t = Time.new\n puts \"#{t.hour}:#{t.min}:#{t.sec}\"\n puts \"\"\n puts \"Creating AvailabilitySet for Backend pool of Loadbalancer\"\n puts \"\"\n params = AvailabilitySet.new\n params.platform_update_domain_count = 5\n params.platform_fault_domain_count = 2\n params.managed = true\n params.location = \"CentralIndia\"\n promise = client.availability_sets.create_or_update(\"#{config[:resource_group]}\", \"#{config[:env]}_availability_set\", params)\n puts \"name = #{promise.name}\"\n puts \"id = #{promise.id}\"\n return promise.name\n end",
"title": ""
},
{
"docid": "5715aee9e62cde994d9deebec1a01f7e",
"score": "0.47263783",
"text": "def set_admin_region\n @admin_region = Admin::Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "5715aee9e62cde994d9deebec1a01f7e",
"score": "0.47261477",
"text": "def set_admin_region\n @admin_region = Admin::Region.find(params[:id])\n end",
"title": ""
},
{
"docid": "89e280ce65cac754ba9b8dc43366cdf3",
"score": "0.47254634",
"text": "def create\n @task_administrative = TaskAdministrative.new(task_administrative_params)\n\n respond_to do |format|\n if @task_administrative.save\n format.html { redirect_to @task_administrative, notice: 'Task administrative was successfully created.' }\n format.json { render :show, status: :created, location: @task_administrative }\n else\n format.html { render :new }\n format.json { render json: @task_administrative.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e25e4a26859fd23e3b2119ee42e23e24",
"score": "0.47148767",
"text": "def set_admin_restaurant\n @admin_restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "ea0c94ebeb74c99f9805aa467e8ecb6d",
"score": "0.47127137",
"text": "def set_admin_administrator\n @admin_administrator = Admin::Administrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "43912dd7cdece5b3bf7300345b79896f",
"score": "0.47053882",
"text": "def set_admin_address\n @admin_address = AdminAddress.find(params[:id])\n end",
"title": ""
},
{
"docid": "c982f49b2b84e906dc1c32ec1a72576e",
"score": "0.47042602",
"text": "def set_suggested_post\n @suggested_post = SuggestedPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "cca6e7508a05a7dc6ea0fbde4213b93f",
"score": "0.47028902",
"text": "def create\n @associated_set = AssociatedSet.new(associated_set_params)\n\n respond_to do |format|\n if @associated_set.save\n format.html { redirect_to @associated_set, notice: 'Associated set was successfully created.' }\n format.json { render :show, status: :created, location: @associated_set }\n else\n format.html { render :new }\n format.json { render json: @associated_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66aabf44998b9f0134bece015b0a430f",
"score": "0.46865335",
"text": "def set_institute_and_admin\n @institute = Institute.friendly.find(params[:institute_id])\n @admin = current_admin\n end",
"title": ""
},
{
"docid": "532bc1726ea68a752e86919231f922ba",
"score": "0.46828493",
"text": "def set_admin_franchise\n @franchise = FranchiseLocation.find(params[:id])\n end",
"title": ""
},
{
"docid": "73941149ff99d974571474cca3480063",
"score": "0.46773347",
"text": "def set_home_owner_administrator\n @home_owner_administrator = HomeOwnerAdministrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "af7c109e799fc79a607bccf17003825d",
"score": "0.4675506",
"text": "def set_hr_config_ministry\n @hr_config_ministry = Hr::Config::Ministry.find(params[:id])\n end",
"title": ""
},
{
"docid": "1f852b3323842020ebf239556fb2254e",
"score": "0.4664669",
"text": "def set_location\n @location = Location.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "7ddbe92eff0dccf66c44d3763f54aede",
"score": "0.4662784",
"text": "def set_admin_provider\n @admin_provider = Admin::Provider.find(params[:id])\n end",
"title": ""
},
{
"docid": "3a2acbb69164088e796556729c01d10f",
"score": "0.46532246",
"text": "def set_hunting_amenity\n @hunting_amenity = HuntingAmenity.find(params[:id])\n end",
"title": ""
},
{
"docid": "ed267542e1974823ef5d776237835d9c",
"score": "0.46467295",
"text": "def create\n\t\t@housing_set = HousingSet.new(housing_set_params)\n\n\t\trespond_to do |format|\n\t\t\tif @housing_set.save\n\t\t\t\tformat.html { redirect_to housing_sets_path, notice: 'Housing set was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @housing_set }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @housing_set.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f272ce585a18b123b5943e7b46cc1a79",
"score": "0.46421996",
"text": "def ensure_admin_set_attribute!(env)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"env.attributes[:admin_set_id]=#{env.attributes[:admin_set_id]}\",\n \"\" ] if default_admin_set_actor_debug_verbose\n # begin new hyrax v3 code\n # # These logical hoops copy the prior behavior of the code;\n # # With a small logical caveat. If the given curation_concern\n # # has an admin_set_id, we now verify that that admin set is\n # # well formed.\n # given_admin_set_id = env.attributes[:admin_set_id].presence || env.curation_concern.admin_set_id.presence\n # admin_set_id = ensure_well_formed_admin_set_service.call(admin_set_id: given_admin_set_id)\n # env.attributes[:admin_set_id] = given_admin_set_id || admin_set_id\n # end new hyrax v3 code\n\n if env.attributes[:admin_set_id].present?\n ensure_permission_template!(admin_set_id: env.attributes[:admin_set_id])\n elsif env.curation_concern.admin_set_id.present?\n env.attributes[:admin_set_id] = env.curation_concern.admin_set_id\n ensure_permission_template!(admin_set_id: env.attributes[:admin_set_id])\n else\n AdminSet.find_each do |admin_set|\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"admin_set=#{admin_set}\",\n \"admin_set.title=#{admin_set&.title}\",\n \"\" ] if default_admin_set_actor_debug_verbose\n unless ( (admin_set.id.eql? Rails.configuration.default_admin_set_id) &&\n (admin_set&.title&.first != Rails.configuration.data_set_admin_set_title) )\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"assigning admin set id=#{admin_set.id}\",\n \"\" ] if default_admin_set_actor_debug_verbose\n env.attributes[:admin_set_id] = admin_set.id\n break\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6df78616281b6850fcb24d6338daae57",
"score": "0.46364632",
"text": "def create\n @administrative_region = AdministrativeRegion.new(administrative_region_params)\n\n respond_to do |format|\n if @administrative_region.save\n format.html { redirect_to @administrative_region, notice: 'Administrative region was successfully created.' }\n format.json { render :show, status: :created, location: @administrative_region }\n else\n format.html { render :new }\n format.json { render json: @administrative_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f879013b416032460772ef4cc867cd8f",
"score": "0.46306637",
"text": "def create(tags:)\n resp = connection.post do |req|\n req.url \"#{api_version}/objects/#{object_identifier}/administrative_tags\"\n req.headers['Content-Type'] = 'application/json'\n req.body = { administrative_tags: tags }.to_json\n end\n raise_exception_based_on_response!(resp, object_identifier) unless resp.success?\n\n true\n end",
"title": ""
},
{
"docid": "1ba7e84b67d470daf3f35c806f3503b8",
"score": "0.4625337",
"text": "def set_district_hefan\n @district_hefan = DistrictHefan.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce88a847ca465188746fb4d09ce0bd76",
"score": "0.4625271",
"text": "def create\n @geoset = Geoset.new(geoset_params)\n\n respond_to do |format|\n if @geoset.save\n format.html { redirect_to @geoset, notice: \"Geoset was successfully created.\" }\n format.json { render :show, status: :created, location: @geoset }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @geoset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca25ee871fb8f96008f34bb1f986f78a",
"score": "0.4620804",
"text": "def set_lego_set\n @lego_set = LegoSet.find(params[:id])\n end",
"title": ""
},
{
"docid": "bf56a824d8c034a225535723ce4bda34",
"score": "0.46182364",
"text": "def set_suggested_lesson\n @suggested_lesson = SuggestedLesson.find(params[:id])\n end",
"title": ""
},
{
"docid": "d9490235ecc326292d092327bdb4a7eb",
"score": "0.4616192",
"text": "def new_input_set()\n return FindLocationByNameInputSet.new()\n end",
"title": ""
},
{
"docid": "5997d18a4f0b3d0f3da3e25d289cc45b",
"score": "0.4614004",
"text": "def set_administrador\n @administrador = Administrador.find(params[:id])\n end",
"title": ""
},
{
"docid": "5997d18a4f0b3d0f3da3e25d289cc45b",
"score": "0.4614004",
"text": "def set_administrador\n @administrador = Administrador.find(params[:id])\n end",
"title": ""
},
{
"docid": "5997d18a4f0b3d0f3da3e25d289cc45b",
"score": "0.4614004",
"text": "def set_administrador\n @administrador = Administrador.find(params[:id])\n end",
"title": ""
},
{
"docid": "5997d18a4f0b3d0f3da3e25d289cc45b",
"score": "0.4614004",
"text": "def set_administrador\n @administrador = Administrador.find(params[:id])\n end",
"title": ""
},
{
"docid": "5997d18a4f0b3d0f3da3e25d289cc45b",
"score": "0.4614004",
"text": "def set_administrador\n @administrador = Administrador.find(params[:id])\n end",
"title": ""
},
{
"docid": "b2149127533d643939e3e192f9f45142",
"score": "0.46131122",
"text": "def set_admins_area_code\n @admins_area_code = Admins::AreaCode.find(params[:id])\n end",
"title": ""
},
{
"docid": "9eeae998179a2986c07d30f44f806b91",
"score": "0.46116546",
"text": "def make_admin_set_from_config(admin_set_title)\n config = admin_set_config(admin_set_title)\n config[\"workflow\"] || config[\"workflow\"] = \"emory_one_step_approval\"\n admin_set = make_mediated_deposit_admin_set(admin_set_title, config[\"workflow\"])\n approving_users = []\n config[\"approving\"].each do |approver_uid|\n u = ::User.find_or_create_by(uid: approver_uid)\n u.password = \"123456\" if set_default_password?\n u.provider = \"shibboleth\"\n u.ppid = approver_uid # temporary ppid, will get replaced when user signs in with shibboleth\n u.save\n approving_users << u.to_sipity_agent\n end\n approval_role = Sipity::Role.find_by!(name: 'approving')\n workflow = admin_set.active_workflow\n workflow.update_responsibilities(role: approval_role, agents: (approving_users.concat users_in_role(admin_set, \"approving\")))\n if workflow.workflow_roles.map { |workflow_role| workflow_role.role.name }.include?(\"reviewing\")\n reviewing_role = Sipity::Role.find_by!(name: 'reviewing')\n workflow.update_responsibilities(role: reviewing_role, agents: (approving_users.concat users_in_role(admin_set, \"reviewing\")))\n end\n admin_set\n end",
"title": ""
},
{
"docid": "1ea39e276e1563c45825985ce4db049c",
"score": "0.46080494",
"text": "def set_administrador\n @administrador = Administradores.in_centros_medicos(params[:id]).find(params[:idu])\n end",
"title": ""
},
{
"docid": "9c2b9e15db1408e1c53595ee2e2b1b27",
"score": "0.46062744",
"text": "def set_up_locations\n set_up('locations')\n end",
"title": ""
},
{
"docid": "613d6ec8653dde774a20ec7fad9d186d",
"score": "0.4599639",
"text": "def set_ag_household_apartment\n @ag_household_apartment = Ag::HouseholdApartment.find(params[:id])\n end",
"title": ""
},
{
"docid": "eadf7b8307008953b23d03ca04331c0e",
"score": "0.45993966",
"text": "def set_adminagentgenu\n @adminagentgenu = Adminagentgenu.find(params[:id])\n end",
"title": ""
},
{
"docid": "68a9a94af39dcef43fc95734a329215f",
"score": "0.45991737",
"text": "def new_input_set()\n return AssociateAddressInputSet.new()\n end",
"title": ""
},
{
"docid": "0ed2266b2c2f70bb2f19ad22222f8f08",
"score": "0.45975196",
"text": "def set_food_place\n @food_place = FoodPlace.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "0556b18b9d26dd5efa834feae8f9b89e",
"score": "0.45942575",
"text": "def set_legislator\n @legislator = params[:id] ? Legislator.includes({elections: [:ad, :party]}).find(params[:id]) : Legislator.new(legislator_params)\n end",
"title": ""
},
{
"docid": "06b0b2341aa3475b82668794aa92d61b",
"score": "0.45914188",
"text": "def set_admin_banner_placement\n @admin_banner_placement = Admin::BannerPlacement.find(params[:id])\n end",
"title": ""
},
{
"docid": "1ff397f94dcb3b2db83eefab7b25c7c9",
"score": "0.4590423",
"text": "def find_or_create!\n existing = self.class.find_by_external_id(external_id)\n return existing if existing\n theater = location.find_or_create_theater!\n self.class.create! theater: theater, external_id: external_id\n end",
"title": ""
},
{
"docid": "4e430d738ec04c89a516b43cd38a8fa0",
"score": "0.4587546",
"text": "def set_admin_address\n @admin_address = Admin::Address.find(params[:id])\n end",
"title": ""
},
{
"docid": "c25268205aa1cb23eb4de89b445e1be0",
"score": "0.458023",
"text": "def set_alkalinity\n @alkalinity = Alkalinity.find(params[:id])\n end",
"title": ""
},
{
"docid": "6928603d9e9e83fde2b8b9846990f2be",
"score": "0.45800585",
"text": "def set_test_adminlte\n @test_adminlte = TestAdminlte.find(params[:id])\n end",
"title": ""
},
{
"docid": "0f836b131117a5c877168241869008c0",
"score": "0.45792118",
"text": "def new_set(data = {})\n data ||= {}\n data[:account_id] ||= self.id\n campaign = Zuck::AdSet.new(Zuck.graph, data, self) \n return campaign\n end",
"title": ""
},
{
"docid": "02dc8aed4fde75aff97b7085f39b05ec",
"score": "0.45766747",
"text": "def set_administrator\n @administrator = Administrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "02dc8aed4fde75aff97b7085f39b05ec",
"score": "0.45766747",
"text": "def set_administrator\n @administrator = Administrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "02dc8aed4fde75aff97b7085f39b05ec",
"score": "0.45766747",
"text": "def set_administrator\n @administrator = Administrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "02dc8aed4fde75aff97b7085f39b05ec",
"score": "0.45766747",
"text": "def set_administrator\n @administrator = Administrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "02dc8aed4fde75aff97b7085f39b05ec",
"score": "0.45766747",
"text": "def set_administrator\n @administrator = Administrator.find(params[:id])\n end",
"title": ""
},
{
"docid": "a7f1727aebc62431f2c4fc18bd57f7c3",
"score": "0.4575188",
"text": "def set_admin_regional_prosecution\n @regional_prosecution = RegionalProsecution.find(params[:id])\n end",
"title": ""
},
{
"docid": "9bef5210357e78e098dd1179006c5c30",
"score": "0.45696813",
"text": "def set_location\n @location = Location.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "9c17303871f9b58996e2059ec9a48a7a",
"score": "0.45652083",
"text": "def set_admin_school\n @school = School.find(params[:id])\n end",
"title": ""
},
{
"docid": "63d5ed3aa17b5083a19c381a8413d7e3",
"score": "0.45625135",
"text": "def set_housing_set\n\t\t@housing_set = HousingSet.find(params[:id])\n\tend",
"title": ""
}
] |
af630984682f1a0b5a68e6092af0d102
|
Update properties of this object
|
[
{
"docid": "779bc2457bb9a72b9a47500a8c1e4f9e",
"score": "0.0",
"text": "def update!(**args)\n @bounds = args[:bounds] if args.key?(:bounds)\n @point = args[:point] if args.key?(:point)\n @point_source = args[:point_source] if args.key?(:point_source)\n end",
"title": ""
}
] |
[
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "37ae8a386fde14c02d7021605aa72f45",
"score": "0.67403597",
"text": "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "47bbd8b88b35da987fc3775b82211e56",
"score": "0.6618882",
"text": "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "c3b6fccdeb696de5e9dbc38a9486b742",
"score": "0.65386343",
"text": "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"title": ""
},
{
"docid": "bb403006cc5423d9b1820fe684a7c5a5",
"score": "0.65178275",
"text": "def update\n # TODO: implement update\n end",
"title": ""
},
{
"docid": "1ee90e4f66e82aec13076a98b288a2d1",
"score": "0.6394807",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "3f85752da065340d4ca70ce879a3b23d",
"score": "0.63328",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6319025",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.6283673",
"text": "def refresh\n set_attributes\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "7a41bc9d5a07220fb8626d1fa90d2d79",
"score": "0.62639254",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "29c22ae2290ffca9b9682a5f20f48103",
"score": "0.62410724",
"text": "def update_resource object, attributes\n object.update attributes\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.62152076",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "1c12f310aca206a2cefff8c291007668",
"score": "0.6210263",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "85a79fb5c3cc199e689344861658b09b",
"score": "0.62021106",
"text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"title": ""
},
{
"docid": "5d229ea224b1dfa7ac9ce6808ca63fc4",
"score": "0.62017816",
"text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"title": ""
},
{
"docid": "549a7eef6c18558dea47a8e8d72df295",
"score": "0.62017",
"text": "def update\n @objects.map(&:update);\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b76d372399abbb21b748df3ae7b06470",
"score": "0.6159277",
"text": "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"title": ""
},
{
"docid": "01219537b43bd1cf8341e0f00e27d4c8",
"score": "0.6156169",
"text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "f3dea89f306804c3f2aa813c06584d06",
"score": "0.6125433",
"text": "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "44756fd86dd095556580199f7e78936f",
"score": "0.61241156",
"text": "def modified_properties=(value)\n @modified_properties = value\n end",
"title": ""
},
{
"docid": "593de84fa9950baa68153e4fa9b6e17c",
"score": "0.6121413",
"text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"title": ""
},
{
"docid": "ea25adea5b43c27e6c84f27ad88c3d9f",
"score": "0.6110477",
"text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"title": ""
},
{
"docid": "147138a710a0ff53e9288ae66341894f",
"score": "0.6105694",
"text": "def update\n\t\t\n\t\tend",
"title": ""
},
{
"docid": "7b1d2242b1a6bd8d3cad29be97783a80",
"score": "0.61016303",
"text": "def set_props(props)\n @props.merge!(props)\n end",
"title": ""
},
{
"docid": "cb2162d3a1fd3434effd12aa702f250f",
"score": "0.60845226",
"text": "def update() end",
"title": ""
},
{
"docid": "231370ed2400d22825eba2b5b69e7a67",
"score": "0.6084427",
"text": "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "86ff97cc222b987bff78c1152a1c8ee1",
"score": "0.6065455",
"text": "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"title": ""
},
{
"docid": "0f6ea4c54f9bc18020c08410f67289cd",
"score": "0.6059506",
"text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"title": ""
},
{
"docid": "453da6bb915596261c5b82f2d17cabf8",
"score": "0.6054869",
"text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "874639781ed80ae451fbdd6ebbef2218",
"score": "0.60413384",
"text": "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"title": ""
},
{
"docid": "d175f5bedd91a8daf191cad42b04dc0c",
"score": "0.6030853",
"text": "def update_attributes(attrs)\n super({})\n end",
"title": ""
},
{
"docid": "b8d1a7cd8f443ee5f30b5085aadff479",
"score": "0.6022535",
"text": "def update\n @dirty = true\n end",
"title": ""
},
{
"docid": "d7d62f9c97f629ef8c88e56d3d1ce8ee",
"score": "0.6015561",
"text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"title": ""
},
{
"docid": "71750bae7e3d6bdde2b60ec30e70949a",
"score": "0.59932375",
"text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"title": ""
},
{
"docid": "73fe9bc31bfeeab4d84483e2fa65cbbb",
"score": "0.59898263",
"text": "def update\n super\n end",
"title": ""
},
{
"docid": "a98ac99e6e5115383e9148202286ff9e",
"score": "0.5976479",
"text": "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "fb14f35e7fab31199053a7b87ef451a4",
"score": "0.5973787",
"text": "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"title": ""
},
{
"docid": "6441b3fa93c3dfd974c66a975adb9d9c",
"score": "0.59678394",
"text": "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"title": ""
},
{
"docid": "51a59f953548d1eff10532bdffdd8df9",
"score": "0.5963291",
"text": "def properties=(value)\n @properties = value\n end",
"title": ""
},
{
"docid": "e7a3d5504fcc6e382b06845ede0d5fd8",
"score": "0.5962048",
"text": "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"title": ""
},
{
"docid": "c7a2880c3da02b3708afc43c48d37f2e",
"score": "0.5961157",
"text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "5ca2caa1a207739e77f437de35e41cf1",
"score": "0.59500545",
"text": "def update ; end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "879f1214e030bb2d9e43a0aedb1bc3ea",
"score": "0.593523",
"text": "def update_with(attributes)\n assign_attributes(attributes)\n end",
"title": ""
},
{
"docid": "10b1cb39dbb1f67820e37bb6d2632986",
"score": "0.5926413",
"text": "def update\n # don't need to update; hash is shared\n end",
"title": ""
},
{
"docid": "51982942bd4f09be3f7adc59da4cf104",
"score": "0.5924831",
"text": "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"title": ""
},
{
"docid": "f0dd489c52fa73b1c3846fa43727c29e",
"score": "0.592427",
"text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "32ed734ad4f899f0ee9ec74a760ca1d0",
"score": "0.5921224",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "900f4c147e0916b2e9270373fb83c7e2",
"score": "0.59144294",
"text": "def update_attributes attributes\n @attributes.merge! attributes\n end",
"title": ""
},
{
"docid": "f63de190ae582620103d96f60d684114",
"score": "0.59142506",
"text": "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"title": ""
},
{
"docid": "512d9095b05a696270730ee09c640773",
"score": "0.58887535",
"text": "def update\r\n end",
"title": ""
},
{
"docid": "5b1f6d40d29f0afb908434d0a6404ac8",
"score": "0.58854496",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "efcb8c985b9e7911a606a9149b4ab171",
"score": "0.5883008",
"text": "def update\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "65f67197ac4544cbebca350d889922ee",
"score": "0.58792305",
"text": "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "10e162e857be9c47150e8eccd327cad9",
"score": "0.58744955",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "389ac4585e8143f353e2535499a23085",
"score": "0.5857968",
"text": "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"title": ""
},
{
"docid": "c202a823016f05ee2fc4aade77320497",
"score": "0.5845542",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "dc268f568dcb7aca1d3905736d2477af",
"score": "0.5841629",
"text": "def update attributes, collection #:nodoc:\n 0\n end",
"title": ""
},
{
"docid": "9763ac25d7fdf4b4f35a971609f70b04",
"score": "0.58363605",
"text": "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"title": ""
},
{
"docid": "541550458a4c8f94afeb6b10c0cb2293",
"score": "0.5829255",
"text": "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"title": ""
},
{
"docid": "49a282f2ce0c099a5ced60524a492b4f",
"score": "0.582919",
"text": "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"title": ""
},
{
"docid": "f6c4eafa4f48a0c81157fb03ff350901",
"score": "0.5822138",
"text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"title": ""
},
{
"docid": "524a6a969929f9af4bad05dbd9c8f935",
"score": "0.58208305",
"text": "def update\n set_deltatime\n set_last_update_at\n end",
"title": ""
}
] |
1c408574307cbf1ba74ec448bea022fb
|
Creates address book entries.
|
[
{
"docid": "eff1b115672c0a0aeaccc3ce72db36f0",
"score": "0.0",
"text": "def initialize(name)\n\n @name = name # The name of the entry\n\n end",
"title": ""
}
] |
[
{
"docid": "53621de130a39bc2f1fcf6e0755ece29",
"score": "0.6913276",
"text": "def create_entry\n system \"clear\"\n puts \"New AddressBloc Entry\"\n print \"Name: \"\n name = gets.chomp\n print \"Phone number: \"\n phone = gets.chomp\n print \"Email: \"\n email = gets.chomp\n\n address_book.add_entry(name, phone, email)\n\n system \"clear\"\n puts \"New entry created\"\n end",
"title": ""
},
{
"docid": "2df0e2ae3831b6afde2c8ecf08ef32fa",
"score": "0.6884696",
"text": "def create_address_book(principal_uri, url, properties)\n end",
"title": ""
},
{
"docid": "21499e538cf40fb9d345c8fe95f38490",
"score": "0.6862655",
"text": "def manual_add_entry\n address_book.add_entry(enter_name, enter_phone, enter_email)\n end",
"title": ""
},
{
"docid": "bbaa652f7a1b2ff5595586e20b96af23",
"score": "0.67503023",
"text": "def create_new_entry()\n\tputs \"You are adding a new entry.\"\n\tentry = {}\n\tputs \"First name:\"\n\tentry[:first_name] = gets().chomp\n\tputs \"Last name:\"\n\tentry[:last_name] = gets().chomp\n\tputs \"Phone number:\"\n\tentry[:phone_number] = gets().chomp\n\tputs \"Email:\"\n\tentry[:email] = gets().chomp\n\t# entry.each do |entry_field, value|\n\t# \tputs \"Enter the person's #{entry_field}:\"\n\t# \tvalue = gets.chomp\n\t# \tputs entry.inspect\n\t# \tputs \"---\"\n\t# end\n\tentry_name = entry[:last_name] + \", \" + entry[:first_name]\n\tAddr_book[entry_name] = entry\n\tputs Addr_book.inspect\n\t# Exit workflow and return to main menu.\nend",
"title": ""
},
{
"docid": "27e57b6c8f54bfe1d174fbed4838b64a",
"score": "0.6661936",
"text": "def create_entry\n\t#creates initial address entry\n\tputs \"Please enter first name: \"\n\tfname = gets.chomp.to_s\n\n puts \"Please enter last name: \"\n \tlname = gets.chomp.to_s \n\n \tentry = Addressentry.create({first_name: fname, last_name: lname})\n\n \t\t#phone number entry\n \tputs \"Would you like to give this entry a phone number? Enter Y or N \\n\"\n \tphone_response = gets.chomp.upcase\n \t\n\t\t#loops until user inputs N\n \tuntil phone_response == \"N\" do\n \t\tp = create_phone()\n \t\tentry.phonenumbers.push p\n \t\tputs \"Would you like to add another number?\"\n \t\tphone_response = gets.chomp.upcase\n \tend\n\n \t\t#email entry\n \tputs \"Would you like to add an email? Enter Y or N\\n\"\n \temail_response = gets.chomp.upcase\n\n \tuntil email_response == \"N\" do \n \t\te = create_email()\n \t\tentry.emails.push e\n \t\tputs \"Would you like to add another email?\"\n \t\temail_response = gets.chomp.upcase\n \tend\n\n \tentry.save!\n \tputs \"entry saved!\"\nend",
"title": ""
},
{
"docid": "c9d04a6ba7f5ecd7a26aa176ba3c352c",
"score": "0.63511866",
"text": "def create_address\n create_resource :address, {}\n end",
"title": ""
},
{
"docid": "908672a51606c98effa66bf0dad76ae4",
"score": "0.600167",
"text": "def create\n create_entry\n end",
"title": ""
},
{
"docid": "ef23349f4434a6a98805a2f492deba65",
"score": "0.60000616",
"text": "def create\n @addresses = Address.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n @address = Address.create(params[:address])\n end",
"title": ""
},
{
"docid": "6b56c3f064cf37e9e7f34ae956341579",
"score": "0.59809685",
"text": "def add_address(addresses, address)\n address[:postcode] = postcode\n addresses.push(AddressSummary.new_from_search(address))\n end",
"title": ""
},
{
"docid": "741927edf7d223c7789d03d1fbd27b2b",
"score": "0.59450537",
"text": "def add_contacts\n \tap \"adding contacts\"\n # asking whether we are already authorized\n AddressBook.request_authorization unless AddressBook.authorized?\n\n \n if AddressBook.authorized?\n 25.times do\n person = AddressBook::Person.create(\n :first_name => Forgery::Name.first_name, \n :last_name => Forgery::Name.last_name, \n :email => [{ :value => Forgery(:internet).email_address , :label => 'Home'}], :phones => [{ :value => rand(10 ** 10).to_s, :label => 'Mobile'}])\n end\n else\n #ap \"This app is not authorized to access the address book.\"\n end\n #enVd\n end",
"title": ""
},
{
"docid": "be35bfeb82cb4220dfe682d98435ae89",
"score": "0.58596164",
"text": "def create\n @address = Address.new(address_params)\n @num = 1\n while Address.where([\"address_id = ?\", @num]).size > 0\n @num = @num+1\n end\n @address.address_id = @num\n @address.user_email = current_user.email\n respond_to do |format|\n if @address.save\n format.html { redirect_to home_path, notice: 'Address was successfully created.' }\n format.json { render :show, status: :created, location: @address }\n else\n format.html { render :new }\n format.json { render json: @address.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ade483e85932ccfc9cbc99bb6b845bb",
"score": "0.5839944",
"text": "def add_entry(name, phone, email)\n new_entry = Entry.new(name, phone, email)\n entries << new_entry\n end",
"title": ""
},
{
"docid": "271e44343d2edd6d0aec1ebb06559e74",
"score": "0.57870984",
"text": "def create\n\t\t@address = current_user.addresses.new(address_params)\n\t\t@earring = Earring.find(@address.detail.earring_id)\n\n\t\trespond_to do |format|\n\t\t\tif @address.save\n\t\t\t\tformat.html { redirect_to \"/confirm\" }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @address }\n\t\t\telse\n\t\t\t\tformat.html { redirect_to \"/addresses/new?d=#{@address.detail.id}\" }\n\t\t\t\tformat.json { render json: @address.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7cc5c64af530d946b8b745d1e76ff138",
"score": "0.5777741",
"text": "def create_entry(options = {title: '', description: '', principal_balance: 0, interest_income_balance: 0, from_installment: nil })\n\n\t\t\taccounting_entry = accounting_entries.build()\n accounting_entry.title = options[:title]\n accounting_entry.entry_date = Date.current\n accounting_entry.principal_balance = options[:principal_balance]\n accounting_entry.interest_income_balance = options[:interest_income_balance]\n accounting_entry.description = options[:description]\n accounting_entry.from_installment =options[:from_installment]\n accounting_entry.save\n accounting_entry\n\n\tend",
"title": ""
},
{
"docid": "4db3a7e1cb016af17dd58134babcd278",
"score": "0.5772074",
"text": "def create_address(params)\n EasyPost::Address.create(params)\n end",
"title": ""
},
{
"docid": "0b002b84dad09f4206f79ae859fcba1a",
"score": "0.57320315",
"text": "def create_entry!(*args)\n delegate_to_entry('create!', args)\n end",
"title": ""
},
{
"docid": "1b223d902c8364b52ed287d7a89b88d3",
"score": "0.57179135",
"text": "def populate_address_data\n @address_summary = AddressSummary.new(search_params)\n @address_detail = Address.new(address_params)\n end",
"title": ""
},
{
"docid": "7dd066c30d9582da031ce7a457c18ff2",
"score": "0.5705699",
"text": "def create\n @address_book = AddressBook.new(params[:address_book])\n\n respond_to do |format|\n if @address_book.save\n flash[:notice] = :address_book_created.l\n format.html { redirect_to(address_books_url) }\n format.xml { render :xml => @address_book, :status => :created, :location => @address_book }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @address_book.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72475f19d22c58f3d5d74ccfd505e663",
"score": "0.5622077",
"text": "def create_contact(name, phonenumber)\n contact = {\n name: \"#{name}\",\n phone: \"#{phonenumber}\",\n }\n @contact_book << contact\n #p @contact_book #print confirmation of adding to the hash \nend",
"title": ""
},
{
"docid": "5722f2f9b792ec2eb07867137501a879",
"score": "0.56069535",
"text": "def add_address(kind, street_1, street_2, city, state, postal_code)\n #instanciamos\n address = Address.new\n #y le damos los atributos\n address.kind = kind\n address.street_1 = street_1\n address.street_2 = street_2\n address.city = city\n address.state = state\n address.postal_code = postal_code\n #se lo enchumamos al array, no hay que poner add\n addresses.push(address)\n end",
"title": ""
},
{
"docid": "afb245a04aaba352a55cf55daa184286",
"score": "0.5600553",
"text": "def create_entries(opts = {})\n data, _status_code, _headers = create_entries_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "55133519d50f521ee7b439c9c656d934",
"score": "0.5579397",
"text": "def create\n @address_book = AddressBook.new(address_book_params)\n\n respond_to do |format|\n if @address_book.save\n format.html { redirect_to @address_book, notice: 'Address book was successfully created.' }\n format.json { render :show, status: :created, location: @address_book }\n else\n format.html { render :new }\n format.json { render json: @address_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2befac216f383f9c60ab4cb117717bfd",
"score": "0.5570445",
"text": "def create_easypost_address\n EasyPost::Address.create(\n name: full_name,\n street1: street,\n street2: street2,\n city: city,\n state: state,\n zip: postal_code,\n country: 'US',\n verify_strict: ['delivery']\n )\n end",
"title": ""
},
{
"docid": "cb32b84ca040e5239e1aad2e4c134568",
"score": "0.5565179",
"text": "def create\n @address_book = current_user.address_books.build(address_book_params)\n\n respond_to do |format|\n if @address_book.save\n format.html { redirect_to @address_book, notice: 'Address book was successfully created.' }\n format.json { render :show, status: :created, location: @address_book }\n else\n format.html { render :new }\n format.json { render json: @address_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2adfc0cda7a47f2f9aae8ed511ccfe8",
"score": "0.552537",
"text": "def create(address, options={})\n \tparams = {:address => address}\n Mailgun.submit :post, list_url, params.merge(options)\n end",
"title": ""
},
{
"docid": "db56f2bb6a19f5eedb71963b4a9504bd",
"score": "0.55037236",
"text": "def call\n begin\n context[:organization_addresses].each do |address|\n address = context.organization.organization_addresses.new(\n city: address[:city],\n street: address[:street],\n house_number: address[:house_number],\n phone: address[:phone])\n address.save\n end\n rescue => e\n context.fail!(message: e)\n end\n end",
"title": ""
},
{
"docid": "3dafc586b9e5e746c4e3f2522f836267",
"score": "0.5502841",
"text": "def create\n @user_address_book_item = UserAddressBookItem.new(params[:user_address_book_item])\n\n unless @user_address_book_item.save\n logger.debug \"UserAddressBookItem there`s problem to save #{self.name} #{self.email} user_id==#{user_id}\"\n end\n end",
"title": ""
},
{
"docid": "fc43306ab0d28e6a9446e56062e7de87",
"score": "0.5493966",
"text": "def make_reservation_address(first_name, last_name, street_address, zip, city, country_code, house_number = nil)\n # {\n # :fname => first_name,\n # :lname => last_name,\n # :street => street_address,\n # :zip => zip,\n # :city => city,\n # :country => ::Klarna::API.id_for(:country, country_code),\n # :house_number => house_number\n # }.with_indifferent_access\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "cb6820cd9fede92eeaabfcc63d19b808",
"score": "0.5489034",
"text": "def create_entries\n existing_mappings = site.mappings.where(path: canonical_paths)\n\n records = canonical_paths.map do |canonical_path|\n entry = BulkAddBatchEntry.new(path: canonical_path)\n entry.mappings_batch = self\n entry.mapping = existing_mappings.detect { |mapping| mapping.path == canonical_path }\n entry\n end\n\n BulkAddBatchEntry.import(records, validate: false)\n end",
"title": ""
},
{
"docid": "7cf03c7f4fd1a260a48370f301220031",
"score": "0.5474872",
"text": "def create \n @address = Address.new()\n @address.addressable_type = params[:address][:addressable_type]\n @address.addressable_id = params[:address][:addressable_id]\n @address.number = params[:address][:number]\n @address.street = params[:address][:street]\n @address.suburb = params[:address][:city]\n @address.state = params[:address][:state]\n @address.country = params[:address][:country]\n @address.postcode = params[:address][:postcode]\n if @address.save\n redirect_to home_path\n else\n flash[:alert] = \"Opps, something went wrong when creating your review\"\n redirect_to items_path \n end \n end",
"title": ""
},
{
"docid": "385155b5bad0dbff5e46367b89b62f17",
"score": "0.54660183",
"text": "def add_address # rubocop:disable Metrics/AbcSize\n return unless @bib.place.any?\n\n reg = @bib.place[0].region[0].name if @bib.place[0].region.any?\n addr = [@bib.place[0].name, @bib.place[0].city, reg]\n @item.address = addr.compact.join(\", \")\n end",
"title": ""
},
{
"docid": "f6b92377b4102f680fcd72af105a982b",
"score": "0.54641193",
"text": "def add_address(type, street_1, street_2, city, state, zipcode)\n #Initialize a new instance of the Address class (why)\n address = Address.new\n #then set all of the ATTRIBUTES to the ARGUEMENTS of this METHOD\n address.type = type\n address.street_1 = street_1\n address.street_2 = street_2\n address.city = city\n address.state = state\n address.zipcode =zipcode\n #then append this to the internal array of addresses-since addresses is a attr_reader we do not have to use the @ sign\n addresses.push(address)\n end",
"title": ""
},
{
"docid": "b6e09661d03a88bd694ac8f871dee900",
"score": "0.54424936",
"text": "def create\n super\n if resource.save\n \t\taddress.attributes = address_params\n \t\taddress.user_id = resource.id \n \t\taddress.save\n end\n end",
"title": ""
},
{
"docid": "09522c6cf3bb87f7f7a131e99d1fdb1a",
"score": "0.54281986",
"text": "def create_spree_address\n @spree_address = Spree::Address.new(address_attributes)\n @spree_address.save(validate: false)\n end",
"title": ""
},
{
"docid": "f7d7a19776244d890adfdfd0249bf09c",
"score": "0.5400599",
"text": "def create_address\n if @ok\n @mailing_list_address = MailingListAddress.new\n @mailing_list_address.group_id = @mailing_list_group.id\n @mailing_list_address.heading = params[:heading]\n @mailing_list_address.email = params[:email]\n @ok = @mailing_list_address.save\n end\n render 'update_addresses'\n end",
"title": ""
},
{
"docid": "cd06e4f13a3572ba066001818d7ce426",
"score": "0.5381589",
"text": "def add_entry(name, phone_number, email)\n # try to place entries in order by alphabet\n index = 0\n entries.each do |entry|\n if name < entry.name\n break\n end\n index += 1\n end\n # insert entry into array\n entries.insert(index, Entry.new(name, phone_number, email))\n end",
"title": ""
},
{
"docid": "6efbafd159e97c3939ca8b49365636f4",
"score": "0.53353506",
"text": "def look_up_addresses\n if postcode.present?\n address_finder = AddressFinderService.new(postcode)\n self.temp_addresses = address_finder.search_by_postcode\n else\n self.temp_addresses = []\n end\n end",
"title": ""
},
{
"docid": "49be6e8a94a368cc080920e6e75a5850",
"score": "0.53178686",
"text": "def create_entries entries\n out = []\n\n entries.each do |entry, items|\n out << RDoc::Markup::Heading.new(3, entry)\n out << RDoc::Markup::BlankLine.new\n\n out << create_items(items)\n end\n\n out\n end",
"title": ""
},
{
"docid": "49be6e8a94a368cc080920e6e75a5850",
"score": "0.53178686",
"text": "def create_entries entries\n out = []\n\n entries.each do |entry, items|\n out << RDoc::Markup::Heading.new(3, entry)\n out << RDoc::Markup::BlankLine.new\n\n out << create_items(items)\n end\n\n out\n end",
"title": ""
},
{
"docid": "7d6bddebd567dd4dd50d72b4ec8c2ad8",
"score": "0.53149664",
"text": "def fill_in_with_multiple_addresses!\n expect(page).to have_content(CHOOSE_EXISTING)\n page.first('#button-new-address').trigger('click')\n fill_in_checkout_address!\n page.first('.addresses__address-use a').trigger('click')\n end",
"title": ""
},
{
"docid": "1d297d49c7890b50f3b3f01d6a722b36",
"score": "0.52917844",
"text": "def view_all_entries\n # #14 - iterate through all entries in AddressBook\n address_book.entries.each do |entry|\n system \"clear\"\n puts entry.to_s\n # #15 call entry_submenu to display submenus for each entry\n entry_submenu(entry)\n end\n\n system \"clear\"\n puts \"End of entries\"\n end",
"title": ""
},
{
"docid": "159d7aac22dcedfbed2b1001bedc1574",
"score": "0.5262361",
"text": "def create_entries(doc)\n return nil\n end",
"title": ""
},
{
"docid": "e14374cce0bd0a0896f554576c442c27",
"score": "0.5257679",
"text": "def create_contact(name, telephone, email)\n\tcontact_list = {\n\t\tname: name,\n\t\ttelephone: telephone,\n\t\temail: email\n\t}\n\tcontacts = []\n\tcontacts << contact_list\nend",
"title": ""
},
{
"docid": "94e1872357baaa0b6552e7277679863e",
"score": "0.5255723",
"text": "def view_entries\n address_book.entries.each do |entry|\n system 'clear'\n entry.display_entry\n puts\n hold_screen\n end\n end",
"title": ""
},
{
"docid": "6f32750a7e1386412593e208ba3f18a7",
"score": "0.524695",
"text": "def create_entries_for_user(_user)\n entries = []\n (0..30).each do |_number|\n entries << EntryBuilder.new(number).entry\n end\n end",
"title": ""
},
{
"docid": "e881dbd45dd5bab965b2a5374b3369ea",
"score": "0.5242878",
"text": "def create\n user_id = @current_user.id\n input_address = params[:address].delete(\" \").delete(\",\").capitalize # removes all spaces and comma's from the newly entered address.\n address = @current_user.addresses\n address_arr = []\n address.each do |a|\n address_arr.push(a.address.delete(\" \").delete(\",\").capitalize)\n end\n # checks whether the address entered already exists for the current user\n unless (address_arr.include?(input_address))\n if (address.empty?) # if user have no address, address created first should be the delivery address.\n new_address = Address.create!(\n :user_id => user_id,\n :address => params[:address],\n :delivery_address => true,\n )\n else\n new_address = Address.create!(\n :user_id => user_id,\n :address => params[:address],\n )\n end\n else\n flash[:error] = \"Already Existing Address!!!\"\n end\n redirect_to cart_items_path\n end",
"title": ""
},
{
"docid": "4e893d391adaabdb3adea2b1e92e45fc",
"score": "0.52424777",
"text": "def create_entries(doc, id_map = {})\n @id_map = id_map\n allergy_list = []\n entry_elements = doc.xpath(@entry_xpath)\n entry_elements.each do |entry_element|\n allergy = Allergy.new\n extract_codes(entry_element, allergy)\n extract_dates(entry_element, allergy)\n extract_e2e_description(entry_element, allergy)\n extract_negation(entry_element, allergy)\n extract_e2e_status(entry_element, allergy)\n extract_e2e_type(entry_element, allergy)\n extract_e2e_reaction(entry_element, allergy)\n extract_e2e_severity(entry_element, allergy)\n allergy_list << allergy\n end\n allergy_list\n end",
"title": ""
},
{
"docid": "fa8637e3091d418232ca6e9196ff6eea",
"score": "0.5242419",
"text": "def create_a_new_address(addressable_entity)\n\n addr = Address.new(addressable: addressable_entity,\n city: FFaker::AddressSE.city,\n street_address: FFaker::AddressSE.street_address,\n post_code: FFaker::AddressSE.zip_code,\n region: @regions[FFaker.rand(0..(num_regions - 1))],\n kommun: @kommuns[FFaker.rand(0..(num_kommuns - 1))],\n visibility: 'street_address')\n tell \" Creating a new address: #{addr.street_address} #{addr.city}. (Will geolocate when saving it)\"\n addr.save\n addr\n end",
"title": ""
},
{
"docid": "2bf5e6755776fea2cb5c5aae311d34d3",
"score": "0.522044",
"text": "def build_for_creation(address, path, script, xpubs = [])\n build_inputs([address])\n total, fee = build_fee(:create)\n output_amount = total - fee.to_i\n create(inputs: @inputs,\n path: path,\n address: address,\n output_amount: output_amount,\n script: script,\n xpubs: xpubs)\n end",
"title": ""
},
{
"docid": "3c0e4c7b17435507fe7dfb495eae9f51",
"score": "0.5193825",
"text": "def create\n @address_book_item = AddressBookItem.new(params[:address_book_item])\n\n respond_to do |format|\n if @address_book_item.save\n format.html { redirect_to(@address_book_item, :notice => 'AddressBookItem was successfully created.') }\n format.xml { render :xml => @address_book_item, :status => :created, :location => @address_book_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @address_book_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aad6f341808d920ec165363712d61a7",
"score": "0.51768124",
"text": "def add_entry(db, book_name, year_pubished, genre, author, rating, read)\n\tdb.execute(\"INSERT INTO books (book_name, year_pubished, genre, author, rating, read) VALUES (?, ?, ?, ?, ?, ?)\", [book_name, year_pubished, genre, author, rating, read])\nend",
"title": ""
},
{
"docid": "5ceeb35e7544ccc879c01551e5a0e92e",
"score": "0.5142191",
"text": "def process_addresses(params)\n assign_attributes(params)\n save(validate: false)\n add_email!\n add_addresses!\n save\n end",
"title": ""
},
{
"docid": "4cb2a5652d92e18f6aca8d97b86a6955",
"score": "0.5139366",
"text": "def populate_address_list_from_params\n @address_list = []\n params.each do |key, value|\n next unless key.start_with? 'address_list_'\n\n address = Address.new.from_json(value)\n @address_list << address\n end\n end",
"title": ""
},
{
"docid": "e4123f0457e0460f3cecdde3b0bc1dff",
"score": "0.51107365",
"text": "def create(attributes)\n entry = new(attributes)\n entry.save\n entry\n end",
"title": ""
},
{
"docid": "12e4fbd54e64bc3c0e9b584de9c485da",
"score": "0.5109876",
"text": "def test_add_address_helper\n contact = create_test_contact\n assert_equal(1, contact.addresses.size)\n\n new_values = {\n :address_type => 'POBOX',\n :line_1 => 'NEW LINE 1',\n :line_2 => 'NEW LINE 2',\n :line_3 => 'NEW LINE 3',\n :line_4 => 'NEW LINE 4',\n :city => 'NEW CITY',\n :region => 'NEW REGION',\n :post_code => '5555',\n :country => 'Australia'\n }\n contact.add_address(new_values)\n\n assert_equal(2, contact.addresses.size)\n assert_kind_of(XeroGateway::Address, contact.addresses.last)\n new_values.each { |k,v| assert_equal(v, contact.addresses.last.send(\"#{k}\")) }\n end",
"title": ""
},
{
"docid": "49889aa5003bee641c79c82577c22245",
"score": "0.50946957",
"text": "def add_address\n \n params[:place]\n address = ReceiverAddress.new(:label => params[:place], \n :city_id => params[:city_id], \n :address => params[:address])\n @receive.document = \"234\"\n @receiver.receiver_addresses << address\n respond_to do |format|\n format.html { render @receiver, action ='new'}\n end\n end",
"title": ""
},
{
"docid": "ad763f3ac6d01a45eab11e1e18e3f950",
"score": "0.5093121",
"text": "def index\n @address_books = AddressBook.all\n end",
"title": ""
},
{
"docid": "ad763f3ac6d01a45eab11e1e18e3f950",
"score": "0.5093121",
"text": "def index\n @address_books = AddressBook.all\n end",
"title": ""
},
{
"docid": "ad763f3ac6d01a45eab11e1e18e3f950",
"score": "0.5093121",
"text": "def index\n @address_books = AddressBook.all\n end",
"title": ""
},
{
"docid": "22702d3f54ab1643b1f51b30c609fec7",
"score": "0.50910044",
"text": "def add_entries(entries, entry_id)\n entries.each do |entry|\n data = ::RssFeedDatum.where(url: entry.url).first_or_create(rss_feed_keyword_id: entry_id, guid: entry.id, name: entry.title, published_at: entry.published, blurb: get_html_content(\"#{entry.url}\"))\n end\n end",
"title": ""
},
{
"docid": "0737bb5808c09b688e0277247cf39108",
"score": "0.5090453",
"text": "def index\n @post_addresses = PostAddress.all\n end",
"title": ""
},
{
"docid": "8e593ccf9dfa9093c0156c61fb42d008",
"score": "0.50895286",
"text": "def create_eth_address_in_db\n\n ClientAddress.create(\n client_id: @client_id,\n ethereum_address: @encrypted_eth_address,\n hashed_ethereum_address: @hashed_eth_address,\n address_salt: @address_salt[:ciphertext_blob],\n status: GlobalConstant::ClientAddress.active_status\n )\n\n CacheManagement::ClientAddress.new([@client_id]).clear\n\n success\n\n end",
"title": ""
},
{
"docid": "8b0ece5e71e082716ff4f04619b6f624",
"score": "0.5087961",
"text": "def index\n @addresses = current_user.addresses\n @address = Address.new\n end",
"title": ""
},
{
"docid": "c09b6a98b96a16b044317a578c92e780",
"score": "0.5080632",
"text": "def create\n puts \"In entries#create, params=#{params}\"\n entity_id = params[:entity_id]\n=begin\n @entity = Entity.find(entity_id)\n template_name = @entity.template.name\n\n @entry = EntryManager.initialize_entry(@entity)\n=end\n @entity = Entity.find(entity_id)\n @entry = Entry.new({:entity_id => entity_id})\n \n @context = {:display_mode => 'new' \n }\n \n template = \"/templates/predefined/#{@entity.template.name}.html.erb\"\n entry_html = render_to_string(:template=>template, \n :layout=>false,\n )\n\n \n @entry[:html] = entry_html\n @entry[:attr_values] = @entry.attr_values\n @entry[:attrs] = @entity.attrs\n\n render :json => {\n :entry => @entry\n\n }\n end",
"title": ""
},
{
"docid": "091dee797b3621a442e9a3010de89bbc",
"score": "0.5080274",
"text": "def account_address(address_details)\n self.address = Address.new(\n address_line1: address_details[:address_line1], address_line2: address_details[:address_line2],\n address_line3: address_details[:address_line3], address_line4: address_details[:address_line4],\n town: address_details[:address_town_or_city], county: address_details[:address_county_or_region],\n postcode: address_details[:address_postcode_or_zip], country: address_details[:address_country_code]\n )\n end",
"title": ""
},
{
"docid": "1a143b120a375ac5fa897c8b1e9e2b8d",
"score": "0.50730264",
"text": "def create_person_address_association(person_id, address_id)\n\n logger.debug \"Creating people_addresses record for person ID: #{person_id} \" \\\n \"and address ID: #{address_id}\"\n\n person_address_association = PeopleAddress.create(\n person_id: person_id,\n address_id: address_id\n )\n\n logger.debug \"people_addresses record created with ID: #{person_address_association.id}\"\n\n person_address_association\n\n end",
"title": ""
},
{
"docid": "fccd32ac227ab7c377092a2c9ef6f8ba",
"score": "0.5069193",
"text": "def build_addresses(v)\n # only create on address\n if v.kind_of? Hash\n return [Address.new(v)]\n # create multiple addresses\n elsif v.kind_of? Array\n # todo: multiple addresses\n end\n end",
"title": ""
},
{
"docid": "4ecadf03155bd2e129b5a208a9d0a55b",
"score": "0.5067742",
"text": "def init() \n\n address_create()\n\n employee_create(\"Nicolas\", \"Genest\", \"CEO\", 'roc-kets', \"nicolas.genest@codeboxx.biz\")\n employee_create(\"Nadya\", \"Fortier\", \"Director\", \"roc-kets\", \"nadya.fortier@codeboxx.biz\")\n employee_create(\"Martin\", \"chantal\", \"Director Assistant\", \"roc-kets\", \"martin.chantal@codeboxx.biz\")\n employee_create(\"Mathieu\", \"Houde\", \"Captain\", \"roc-kets\", \"mathieu.houde@codeboxx.biz\")\n employee_create(\"David\", \"Boutin\", \"Engineer\", \"roc-kets\", \"david.boutin@codeboxx.biz\")\n employee_create(\"Mathieu\", \"Lortie\", \"Engineer\", \"roc-kets\", \"mathieu.lortiet@codeboxx.biz\")\n employee_create(\"Thomas\", \"Carrier\", \"Engineer\", \"roc-kets\", \"thomas.carriert@codeboxx.biz\")\n employee_create(\"Admin1\", \"Admin1\", \"Admin1\", \"roc-kets\", \"admin1@admin1.com\")\n employee_create(\"Admin\", \"Admin\", \"Admin\", \"roc-kets\", \"admin@admin.com\")\n\n\n 25.times do \n customer_create(\n Faker::Company.name,\n Faker::Name.name,\n Faker::PhoneNumber.cell_phone,\n Faker::Internet.email,\n \"Description\",\n Faker::Name.name,\n Faker::PhoneNumber.cell_phone,\n Faker::Internet.email\n ) \n end\n\n 40.times do\n intervention_create(\n Faker::Number.between(from: 1, to: 9),\n Faker::Number.between(from: 1, to: 25),\n Faker::Number.between(from: 1, to: 40),\n Faker::Number.between(from: 1, to: 40),\n Faker::Number.between(from: 1, to: 40),\n Faker::Number.between(from: 1, to: 200),\n Faker::Number.between(from: 1, to: 9),\n Faker::Date.between(from: '2019-02-23', to: '2020-2-25'),\n Faker::Date.between(from: '2020-02-25', to: '2021-3-15'),\n ['Success', 'Failure', 'Incomplete'].sample,\n \"Nothing to report\",\n ['Pending', 'InProgress', 'Interrupted' , 'Resumed', 'Complete'].sample\n )\n end\n\n\n 50.times do\n pl = [\"Standard\", \"Premium\", \"Excelium\"]\n bt = [\"Residential\", \"Commercial\", \"Corporate\", \"Hybrid\"]\n Quote.create(\n install_fees: Faker::Number.between(from: 500, to: 2000),\n total_price: Faker::Number.between(from: 50000, to: 200000),\n product_line: (pl.sample),\n number_of_apartments: Faker::Number.between(from: 50, to: 200),\n number_of_floors: Faker::Number.between(from: 10, to: 70),\n number_of_basements: Faker::Number.between(from: 1, to: 10),\n number_of_corporations: Faker::Number.between(from: 1, to: 100),\n elevator_amount: Faker::Number.between(from: 1, to: 100),\n quotes_name: Faker::Name.name,\n quotes_email: Faker::Internet.email,\n quotes_company_name: Faker::Company.name,\n building_type: (bt.sample),\n final_price: Faker::Number.between(from: 50000, to: 800000),\n number_of_companies: Faker::Number.between(from: 1, to: 5),\n number_of_parking: Faker::Number.between(from: 50, to: 200),\n maximum_occupancy: Faker::Number.between(from: 50, to: 200),\n business_hours: Faker::Number.between(from: 0, to: 24),\n number_of_elevators: Faker::Number.between(from: 1, to: 15),\n unit_price: Faker::Number.between(from: 11000, to: 15000),\n # updated_at: dateCreationUpdate,\n created_at:Faker::Date.between(from: '2018-02-23', to: '2021-2-25')\n )\n end\nend",
"title": ""
},
{
"docid": "b94594504f5be91f7519bd172354c80d",
"score": "0.5058928",
"text": "def needed_appointments(db, business_name, address)\n db.execute(\"INSERT INTO reminders (business_name, address) VALUES (?, ?)\", [business_name, address])\nend",
"title": ""
},
{
"docid": "595fa00eadad9454b18dde3848f7c5b5",
"score": "0.5045072",
"text": "def generate_address(user_id)\n a = Address.new\n a[:user_id] = user_id\n a[:street_address] = Faker::Address.street_address\n a[:city_id] = City.pluck(:id).sample\n a[:state_id] = State.pluck(:id).sample\n a[:zip_code] = Faker::Address.zip.to_i\n a.save! #just to check if anything fails here\nend",
"title": ""
},
{
"docid": "297a005363ab7bac3de09b42873279cc",
"score": "0.50443035",
"text": "def view_existing_entry()\n\t# Print overview of existing entries\n\tentry_valid = 0\n\taddr_book_array = []\n\tAddr_book.each do |entry_name, entry|\n\t\taddr_book_array.push entry_name\n\tend\n\tputs \"---\"\n\taddr_book_array.each_with_index do |element, index|\n\t\tputs index.to_s + \" \" + element\n\tend\n\t# Prompt user for entry\n\twhile entry_valid == 0\n\t\tputs \"Which entry would you like to view? <0, 1, 2, etc.>\"\n\t\tentry_to_view = gets.chomp.to_i\n\t\tentry_name = addr_book_array[entry_to_view]\n\t\tif Addr_book.key?(entry_name) == true\n\t\t\tAddr_book[entry_name].each do |key, value|\n\t\t\t\tputs key.to_s + \": \" + value\n\t\t\tend\n\t\t\tputs \"---\"\n\t\t\tentry_valid = 1\n\t\telse \n\t\t\tputs \"That entry is bogus. Try again.\"\n\t\tend\n\tend\n\t# Exit this workflow and return to main menu\nend",
"title": ""
},
{
"docid": "57ab81cef6b9b9ced8c3080b8bbb6df2",
"score": "0.5042249",
"text": "def build_and_create_address\n\t\tbegin\n\t\t\t@address = Address.new(\n\t\t\t\tstreet_address: params[:address][:street_address],\n\t\t\t\textended_address: params[:address][:extended_address],\n\t\t\t\tlocality: params[:address][:locality],\n\t\t\t\tregion: params[:address][:region],\n\t\t\t\tpostal_code: params[:address][:postal_code],\n\t\t\t\tphone: params[:address][:phone],\n\t\t\t\temail: params[:address][:email]\n\t\t\t\t)\n\n\t\t\tunless @address.save\n\t\t\t\trender status: 422, json: {\n error: \"Could not create address\"\n }\n end\n rescue ActiveRecord::ActiveRecordError\n render status: 422, json: {\n error: \"Could not create address\"\n }\n end\n end",
"title": ""
},
{
"docid": "7aeb4492a88d298ba81f721c44051de6",
"score": "0.5042149",
"text": "def create_new_addr_bounds(addr_codes)\n\t\t\taddr_codes.each do |ac|\n\t\t\t\t@address.addr_bounds.create(addr_code: ac)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "6913070709ebe7f658fe04653f432671",
"score": "0.5037431",
"text": "def insert_entry(params)\n Entry.create(params)\n end",
"title": ""
},
{
"docid": "ae295dfc7a3e9cdf132a5aa2475f1dae",
"score": "0.503427",
"text": "def create_elasticsearch_addressbase_data(title_address_data)\n id = title_address_data[:uprn]\n uri = URI.parse(\"#{$ELASTIC_SEARCH_ENDPOINT}\")\n conn = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new \"/#{$ELASTICSEARCH_ADDRESSBASE}/#{$ELASTICSEARCH_POSTCODE_SEARCH}/#{id}\"\n request['Content-Type'] = 'application/json'\n request.body = title_address_data.to_json\n conn.request(request)\nend",
"title": ""
},
{
"docid": "62227fbcf6d131806d17c90142b4e1f9",
"score": "0.5031102",
"text": "def set_Addresses(value)\n set_input(\"Addresses\", value)\n end",
"title": ""
},
{
"docid": "62227fbcf6d131806d17c90142b4e1f9",
"score": "0.5031102",
"text": "def set_Addresses(value)\n set_input(\"Addresses\", value)\n end",
"title": ""
},
{
"docid": "62227fbcf6d131806d17c90142b4e1f9",
"score": "0.5031102",
"text": "def set_Addresses(value)\n set_input(\"Addresses\", value)\n end",
"title": ""
},
{
"docid": "02433e49ce942000b9ec7732bdfa35ea",
"score": "0.50306517",
"text": "def new\n @user_address_book_item = UserAddressBookItem.new\n end",
"title": ""
},
{
"docid": "12817498e97a320efaa947da7f4d8f51",
"score": "0.5030447",
"text": "def add_address(options)\n address = options[:billing_address]\n\n post = {}\n post['Address 1'] = address[:address1] unless empty?(address[:address1])\n post['Address 2'] = address[:address2] unless empty?(address[:address2])\n post['City'] = address[:city] unless empty?(address[:city])\n post['State or Province'] = address[:state] unless empty?(\n address[:state]\n )\n post['ZIP or Postal Code'] = address[:zip] unless empty?(address[:zip])\n post['Country'] = address[:country] unless empty?(address[:country])\n\n post\n end",
"title": ""
},
{
"docid": "adca33135b540f0c9a25899dedbeab36",
"score": "0.5028958",
"text": "def record()\n street = @street_name_source.record() \n house_number = @house_number_source.record()\n postal_code_and_town = @postal_town_source.record()\n # Very fragile / relies on proper input data file:\n postal_code, town = postal_code_and_town.match(/(\\w+)\\s+(.+)/)[1,2]\n Address.new( house_number, street, postal_code, town )\n end",
"title": ""
},
{
"docid": "2ba0c00243aa761597798f03859a6ce0",
"score": "0.5026306",
"text": "def create_bookmarks(results, opts = {})\n created = 0\n skipped = 0\n total = opts[:total] || results.count\n\n user = User.new\n post = Post.new\n\n results.each do |result|\n params = yield(result)\n\n # only the IDs are needed, so this should be enough\n if params.nil?\n skipped += 1\n else\n user.id = user_id_from_imported_user_id(params[:user_id])\n post.id = post_id_from_imported_post_id(params[:post_id])\n\n if user.id.nil? || post.id.nil?\n skipped += 1\n puts \"Skipping bookmark for user id #{params[:user_id]} and post id #{params[:post_id]}\"\n else\n result = PostActionCreator.create(user, post, :bookmark)\n created += 1 if result.success?\n skipped += 1 if result.failed?\n end\n end\n\n print_status(created + skipped + (opts[:offset] || 0), total, get_start_time(\"bookmarks\"))\n end\n\n [created, skipped]\n end",
"title": ""
},
{
"docid": "9f323c5df7363ae8bc0ae357a880489e",
"score": "0.50238097",
"text": "def create_entries(doc,id_map = {})\n @id_map = id_map\n allergy_list = []\n entry_elements = doc.xpath(@entry_xpath)\n entry_elements.each do |entry_element|\n allergy = Allergy.new\n extract_codes(entry_element, allergy)\n extract_dates(entry_element, allergy)\n extract_description(entry_element, allergy, id_map)\n extract_negation(entry_element, allergy)\n \n extract_status(entry_element, allergy)\n allergy.type = extract_code(entry_element, @type_xpath)\n allergy.reaction = extract_code(entry_element, @reaction_xpath)\n allergy.severity = extract_code(entry_element, @severity_xpath)\n \n allergy_list << allergy\n end\n allergy_list\n end",
"title": ""
},
{
"docid": "6d3f75d0556cb17b8dde5a661c25a396",
"score": "0.502294",
"text": "def make_entry()\n\n seq_id = @filehandler.readline.chomp\n puts seq_id\n sequence = @filehandler.readline.chomp\n identifier = @filehandler.readline.chomp\n quality = @filehandler.readline.chomp\n\n Entry.new(seq_id, sequence, identifier, quality)\n end",
"title": ""
},
{
"docid": "b24a7ef771919864e61e436de675d05f",
"score": "0.5022457",
"text": "def set_address_book\n @address_book = AddressBook.find(params[:id])\n end",
"title": ""
},
{
"docid": "b24a7ef771919864e61e436de675d05f",
"score": "0.5022457",
"text": "def set_address_book\n @address_book = AddressBook.find(params[:id])\n end",
"title": ""
},
{
"docid": "b24a7ef771919864e61e436de675d05f",
"score": "0.5022457",
"text": "def set_address_book\n @address_book = AddressBook.find(params[:id])\n end",
"title": ""
},
{
"docid": "83a2c1e7c8eeb5dab94fdcd31b3c1e24",
"score": "0.5021352",
"text": "def add_contact\n print \"First name:\"\n first_name = gets.chomp\n\n print \"Last Name:\"\n last_name = gets.chomp\n\n print \"Email:\"\n email = gets.chomp\n\n print \"Notes:\"\n notes = gets.chomp\n\n Contact.create(first_name, last_name, { email: email, notes: notes })\n end",
"title": ""
},
{
"docid": "d02a7801b5471a043638f1742f68b29b",
"score": "0.50171137",
"text": "def create\n @ag_address = Ag::Address.new(ag_address_params)\n\n respond_to do |format|\n if @ag_address.save\n format.html { redirect_to @ag_address, notice: 'Address was successfully created.' }\n format.json { render :show, status: :created, location: @ag_address }\n else\n format.html { render :new }\n format.json { render json: @ag_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0e7d567425c33d9dcaa51243d273f73",
"score": "0.5011219",
"text": "def create_address(order_or_user, expect_success, values, type=nil)\n visit_addresses(order_or_user)\n\n expect(page).to have_css('#new_address_link')\n click_link 'new_address_link'\n expect(current_path).to eq(spree.new_admin_address_path)\n\n fill_in_address(values, type)\n\n click_button Spree.t('actions.create')\n\n if expect_success\n expect_address_collection_path(order_or_user)\n expect(page).to have_content(Spree.t(:successfully_created, resource: Spree::Address.model_name.human))\n else\n expect(path_with_query).to eq(spree.admin_addresses_path(user_id: @user_id, order_id: @order_id))\n expect(page).to have_no_content(Spree.t(:successfully_created, resource: Spree::Address.model_name.human))\n end\n end",
"title": ""
},
{
"docid": "ffe163e7d2a7339534055bf4da66bc93",
"score": "0.5009764",
"text": "def entry!\n description = customer_or_supplier \\\n proc { customer.name },\n proc { supplier.name }\n\n unless e = self.entry\n e = business_account.add_entry amount, \\\n commodity_account, amount_net,\n tax_account, amount_tax\n e.description = description\n e.code = number.to_s\n e.flag = '!'\n end\n\n e\n end",
"title": ""
},
{
"docid": "4e91805d4077c3dd4ca689defdaa8961",
"score": "0.50037134",
"text": "def create_full_address\n \"#{address_line1}, #{city}, #{state} #{zip}\"\n end",
"title": ""
},
{
"docid": "37a3c126280fd50112373c53785a8f2f",
"score": "0.49996686",
"text": "def initialize(*attributes)\n @addresses = [Address.new(kind: 'home'), Address.new(kind: 'mailing')]\n @same_with_primary = \"true\"\n super\n end",
"title": ""
},
{
"docid": "e67ae0c0727fbab55384eaecdaa10778",
"score": "0.499796",
"text": "def addContact(fname,lname,email)\n\t\t@dataArray.push(Struct::ContactEntry.new(fname,lname,email))\n\tend",
"title": ""
},
{
"docid": "32772c674517e90da66e4a2d348bf41c",
"score": "0.49959198",
"text": "def save\n order = Order.create(user_id: user_id, item_id: item_id)\n Address.create(post_code: post_code,area_id: area_id ,city: city, address: address, house_number: house_number, phone_number: phone_number, order_id: order.id)\n end",
"title": ""
},
{
"docid": "82ebd67f6906e716ee7dbfa9e763eff4",
"score": "0.49937493",
"text": "def create_additional_addresses(amount)\n amount.times do\n profile = UserProfile.all.sample\n Address.create fake_address(profile_id: profile.id)\n end\nend",
"title": ""
},
{
"docid": "6783ba4a2fe07ff579845cea8979d1b4",
"score": "0.49855122",
"text": "def create\n logger.info \"Creating Entry\"\n @entry = Entry.new(params[:entry])\n logger.info \"Entry Created\"\n\n respond_to do |format|\n if @entry.save\n format.html { redirect_to(entries_url, :notice => 'Entry was successfully created.') }\n format.xml { render :xml => @entry, :status => :created, :location => @entry }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e4df600724991d6a816f2ad1cdc8fe8",
"score": "0.49833202",
"text": "def add_address(address)\n @addresses << address\n end",
"title": ""
},
{
"docid": "152ec17e94dbe2987ddff999a7e41a2a",
"score": "0.4982904",
"text": "def create_address_objects\n\n # Initialize vars\n a_addresses = Array.new\n a_prefix_lists = Array.new\n config = String.new\n filterused = nil\n\n\n # Combining ipv4 and ipv6 filters to a single hash to process both simultaneously\n filters = $h_filters.merge($h_filters6)\n\n filters.each_key do |filtername|\n\n # check_if_filter_used returns 1 if this filter is used by an interface 0 if not\n filterused = check_if_filter_used(filtername)\n\n unless filterused\n p \"create_address_objects: filter is not used by an interface. skipping filtername: #{filtername}\"\\\n if $opts[:debug]\n next\n end\n\n filters[filtername].each_key do |termname|\n filters[filtername][termname][:source].each do |sourcename, sourcetype|\n if sourcetype == :'source-address' || sourcetype == :'destination-address'\n\n # Adding all to new hash in order to remove duplicates\n a_addresses << sourcename\n end\n\n # For rules reference prefix-lists need to find the prefix list and iterate through all of the\n # defined addressses, creating an address object for each\n if sourcetype == :'source-prefix-list' ||\\\n sourcetype == :'destination-prefix-list' ||\\\n sourcetype == :'prefix-list'\n a_prefix_lists << sourcename\n a_prefix_lists.uniq.each do |prefixlist|\n if $h_prefix_lists.has_key?(prefixlist)\n $h_prefix_lists[prefixlist].each do |prefixadds|\n a_addresses << prefixadds\n end\n else\n p \"create_address_objects: Referenced prefix #{sourcename} could not be found.\\\\\n Filter: #{filtername}, term: #{termname}\"\n end\n end\n end\n end\n end\n end\n\n # create a fg config entry for each uniq address identified\n config += \"#### Address Objects ####\\n\"\n config += \"config firewall address\\n\"\n a_addresses.uniq.each do |x|\n\n fgaddress = <<-EOS\n edit #{x}\n set type subnet\n set subnet #{x}\n next\n EOS\n\n # Add each output from Herdoc above to config var (will pass this back to main)\n config += fgaddress\n end\n\n config += \"end\\n\"\n config += \"#### Addresses Groups###\\n\"\n config += \"config firewall addrgroup\\n\"\n\n $h_prefix_lists.each do |prefixlist, prefixadds|\n\n # Convert array to string usable in addrgroup config\n adds = String.new\n prefixadds.each {|x| adds += \"#{x.to_s} \"}\n\n fggroups = <<-EOS\n edit #{prefixlist}\n set member #{adds}\n next\n EOS\n\n config += fggroups\n end\n\n # Return this pieces of FG config to main for additional methods to add to it\n config += \"end\\n\\n\"\n\nend",
"title": ""
},
{
"docid": "2cfc0a783583c6b44f957745f18d626e",
"score": "0.4978733",
"text": "def build_signup_address(attrs={})\n self.signup_address = Address.new(attrs)\n end",
"title": ""
},
{
"docid": "94c4d69695a5a9169d5ecbaa99d9496c",
"score": "0.49655727",
"text": "def add_book(book_title)\n @books << {\n title: book_title,\n rental_details: {\n student_name: \"\",\n date: \"\"\n }\n }\n end",
"title": ""
}
] |
69beaa3e957d1fc356539d0314d703e1
|
Custom attribute writer method checking allowed values (enum).
|
[
{
"docid": "718923bf18fdb643e40d338a2c1b049a",
"score": "0.0",
"text": "def polarity=(polarity)\n validator = EnumAttributeValidator.new('String', [\"CREDIT\", \"DEBIT\", \"PENDING_CREDIT\", \"PENDING_DEBIT\"])\n unless validator.valid?(polarity)\n fail ArgumentError, \"invalid value for \\\"polarity\\\", must be one of #{validator.allowable_values}.\"\n end\n @polarity = polarity\n end",
"title": ""
}
] |
[
{
"docid": "8146b840a980695b919bbb80892fcc0c",
"score": "0.6161179",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n return false unless type_validator.valid?(@type)\n state_validator = EnumAttributeValidator.new('String', [\"PENDING\", \"CLEARED\", \"COMPLETION\", \"DECLINED\", \"ERROR\", \"ALL\"])\n return false unless state_validator.valid?(@state)\n true\n end",
"title": ""
},
{
"docid": "6b0b457cb8436385a5e9979b4ce7a15c",
"score": "0.61435664",
"text": "def enum(allowed_values)\n allowed_values = allowed_values.to_a if allowed_values.is_a? Set\n assert_array allowed_values, minimum: 1, unique: true\n set enum: allowed_values\n end",
"title": ""
},
{
"docid": "d9dcaa35507d9793fd3b833edd3f91e1",
"score": "0.61418885",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n true\n end",
"title": ""
},
{
"docid": "50bdc5024eb33d5cc47a16805de2bcde",
"score": "0.6077904",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"title": ""
},
{
"docid": "07d1438832b26069a882c2a09375301c",
"score": "0.60417545",
"text": "def render_enums\n # get likely enum attributes\n enums = model_attributes.select{ |attr| field_is_enum?(attr) }\n\n # for each enum, create a constant, an enum field, and validation\n enums.map{ |attr|\n <<-code\n #{attr.name.pluralize.upcase} = { active: 'Active', inactive: 'Inactive' }\n enum #{attr.name}: #{attr.name.pluralize.upcase}.keys\n validates :#{attr.name}, presence: true\n\n code\n }.join\n end",
"title": ""
},
{
"docid": "bdba344ee3068b68a1dd124382ad1a28",
"score": "0.60138696",
"text": "def attrib_bits_valid=(value); end",
"title": ""
},
{
"docid": "30c46b971aa93fa1f09b3b39a63b38a1",
"score": "0.60057545",
"text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end",
"title": ""
},
{
"docid": "450ccd97c49a359ffcded93bd336a796",
"score": "0.6000713",
"text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end",
"title": ""
},
{
"docid": "dacfc418c94e13c05e3d69169aedd306",
"score": "0.5939183",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"gpa.credit\", \"gpa.credit.pending\", \"gpa.credit.pending.reversal\", \"gpa.credit.reversal\", \"gpa.credit.networkload\", \"gpa.credit.networkload.reversal\", \"gpa.debit.networkload\", \"gpa.debit\", \"gpa.debit.pending\", \"gpa.debit.pending.reversal\", \"gpa.grant\", \"gpa.credit.issueroperator\", \"gpa.debit.issueroperator\", \"gpa.credit.chargeback\", \"gpa.credit.chargeback.reversal\", \"gpa.credit.billpayment\", \"gpa.credit.authorization.billpayment\", \"gpa.credit.authorization.billpayment.reversal\", \"msa.credit.pending\", \"msa.credit.pending.reversal\", \"msa.credit.reversal\", \"msa.credit\", \"msa.debit.pending\", \"msa.debit.pending.reversal\", \"msa.debit\", \"msa.credit.chargeback\", \"msa.credit.chargeback.reversal\", \"authorization\", \"authorization.advice\", \"authorization.reversal\", \"authorization.clearing\", \"authorization.reversal.issuerexpiration\", \"dispute.credit\", \"dispute.debit\", \"authorization.clearing.chargeback\", \"authorization.clearing.chargeback.reversal\", \"refund\", \"pindebit.atm.withdrawal\", \"pindebit.balanceinquiry\", \"pindebit.cashback\", \"pindebit\", \"programreserve.credit\", \"programreserve.debit\", \"fee.charge.pending\", \"fee.charge\", \"fee.charge.pending.refund\", \"funds.expire\", \"reward.earn\", \"transfer.peer\", \"transfer.fee\", \"account.credit\", \"account.debit\", \"balanceinquiry\", \"authorization.atm.withdrawal\", \"authorization.clearing.atm.withdrawal\", \"authorization.cashback\", \"authorization.clearing.cashback\", \"transfer.program\", \"authorization.quasi.cash\", \"authorization.clearing.quasi.cash\", \"authorization.incremental\", \"gpa.credit.authorization\", \"gpa.credit.authorization.reversal\", \"gpa.debit.reversal\", \"original.credit.authorization\", \"original.credit.authorization.reversal\", \"original.credit.authorization.clearing\", \"original.credit.auth_plus_capture\", \"original.credit.auth_plus_capture.reversal\", \"refund.authorization\", \"refund.authorization.advice\", \"refund.authorization.clearing\", \"refund.authorization.reversal\", \"token.activation-request\", \"token.advice\", \"pindebit.authorization\", \"pindebit.authorization.clearing\", \"pindebit.authorization.reversal\", \"pindebit.authorization.reversal.issuerexpiration\", \"authorization.standin\", \"authorization.clearing.chargeback.completed\", \"authorization.clearing.chargeback.provisional.credit\", \"authorization.clearing.chargeback.provisional.debit\", \"authorization.clearing.chargeback.writeoff\", \"directdeposit.credit\", \"directdeposit.credit.pending\", \"directdeposit.credit.reject\", \"directdeposit.credit.pending.reversal\", \"directdeposit.credit.reversal\", \"directdeposit.debit\", \"directdeposit.debit.pending\", \"directdeposit.debit.reject\", \"directdeposit.debit.reversal\", \"directdeposit.debit.pending.reversal\", \"fee.charge.reversal\", \"pindebit.chargeback\", \"pindebit.chargeback.completed\", \"pindebit.chargeback.provisional.credit\", \"pindebit.chargeback.provisional.debit\", \"pindebit.chargeback.reversal\", \"pindebit.chargeback.writeoff\", \"pindebit.credit.adjustment\", \"pindebit.quasicash\", \"pindebit.refund\", \"pindebit.refund.reversal\", \"pindebit.reversal\", \"pindebit.transfer\", \"pushtocard.debit\", \"pushtocard.reversal\", \"unknown\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"title": ""
},
{
"docid": "75d6e889813df1b5e0b4c2647f24c0a2",
"score": "0.5851587",
"text": "def check_enum(key, val, validation)\n return false if !validation[:required] && val.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(val)\n\n val = 'nothing' if val.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{val}\"\n true\n end",
"title": ""
},
{
"docid": "6d289fb843de67072e3ccd10998f1799",
"score": "0.5803463",
"text": "def valid?\n return false if !super\n style_validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n return false unless style_validator.valid?(@style)\n true\n end",
"title": ""
},
{
"docid": "68017d41b549e3ed8f9626d46579ace9",
"score": "0.57846975",
"text": "def validate_enum(option, enum)\n values = options[option]\n values.all? { |a| enum.include?(a) } || raise(ArgumentError, \"The --#{option} argument must consist of one or more space separated values from #{enum}. Got: #{values}\")\n end",
"title": ""
},
{
"docid": "d80ba89cf3b6bd399ca742031726f20a",
"score": "0.57566047",
"text": "def valid?\n legal_form_validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n return false unless legal_form_validator.valid?(@legal_form)\n legal_annual_turn_over_validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n return false unless legal_annual_turn_over_validator.valid?(@legal_annual_turn_over)\n legal_net_income_range_validator = EnumAttributeValidator.new('String', ['', '0-4', '5-9', '10-49', '50-149', '150-499', '500-*'])\n return false unless legal_net_income_range_validator.valid?(@legal_net_income_range)\n legal_number_of_employee_range_validator = EnumAttributeValidator.new('String', ['', '0', '1-9', '10-99', '100-249', '250-*'])\n return false unless legal_number_of_employee_range_validator.valid?(@legal_number_of_employee_range)\n status_validator = EnumAttributeValidator.new('String', ['D', 'N', 'I', 'A', 'C', 'T', 'S', 'L', 'O'])\n return false unless status_validator.valid?(@status)\n true\n end",
"title": ""
},
{
"docid": "71e396ecd3fe724dfdc8a3e319ab3533",
"score": "0.57389516",
"text": "def validate_enum(enum_class, item)\n case item\n when String, Symbol, Integer\n enum_class[item].present?\n when Hash\n name = item[:name]\n if (e = enum_class[name]).present?\n item.all?{ |attribute, value|\n e.send(attribute) == value\n }\n else\n false\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "6631a2651ae0f1379b4c6086d7c060e9",
"score": "0.57388884",
"text": "def valid?\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n return true\n end",
"title": ""
},
{
"docid": "01ae05766f20de61607b667fad9a6158",
"score": "0.5708027",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "0bc1128f4beb4af030e8814b0da2d801",
"score": "0.5700165",
"text": "def enum_validator(sym, values, opts=nil)\r\n opts ||= {}\r\n default = (opts.key?(:default)) ? opts[:default] : values[0]\r\n message = opts[:message] || \"should be one of #{values.join ', '}\"\r\n allow_nil = opts[:allow_nil] || false\r\n\r\n my_const_set sym, 'ENUM_VALUES', values\r\n my_const_set sym, 'ENUM_DEFAULT', default\r\n my_const_set sym, 'VALIDATION_MESSAGE', message\r\n my_const_set sym, 'DB_OPTS', { :limit => values, :null => allow_nil, :default => default }\r\n\r\n validates_inclusion_of sym, :in => values, :message => message, :allow_nil => allow_nil\r\n end",
"title": ""
},
{
"docid": "f392c181864a13ef6567e80e653689de",
"score": "0.5698631",
"text": "def legal_form=(legal_form)\n validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n unless validator.valid?(legal_form)\n fail ArgumentError, 'invalid value for \"legal_form\", must be one of #{validator.allowable_values}.'\n end\n @legal_form = legal_form\n end",
"title": ""
},
{
"docid": "f741c9ca645e5667a9637cbdd35ef98b",
"score": "0.567808",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"arity\", @arity)\n writer.write_enum_value(\"multivaluedComparisonType\", @multivalued_comparison_type)\n writer.write_collection_of_object_values(\"supportedAttributeTypes\", @supported_attribute_types)\n end",
"title": ""
},
{
"docid": "ef543a39cb61fc92dc80acd0cd8c67da",
"score": "0.56777334",
"text": "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end",
"title": ""
},
{
"docid": "c328fd8345a69d9ffb9f63b4db1acb76",
"score": "0.56698906",
"text": "def valid?\n currency_code_validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_code_validator.valid?(@currency_code)\n return true\n end",
"title": ""
},
{
"docid": "bf3d36bad4e5502df67ae10502525859",
"score": "0.5652725",
"text": "def attr_status(*statuses)\n statuses.each do |status|\n define_method(\"#{status}!\".to_sym) { status!(status.to_sym) }\n define_method(\"#{status}?\".to_sym) { status?(status.to_sym) }\n protected \"#{status}!\".to_sym\n end\n end",
"title": ""
},
{
"docid": "488932cbd8336d7c1006b95ab09ef24d",
"score": "0.56496996",
"text": "def has_enumerated?(attribute)\n return false if attribute.nil?\n enumerated_attributes.include? attribute.to_s\n end",
"title": ""
},
{
"docid": "dab1835cab11879f4568621b568e25d8",
"score": "0.5647114",
"text": "def validates_acceptance_of(*attr_names); end",
"title": ""
},
{
"docid": "dab1835cab11879f4568621b568e25d8",
"score": "0.5647114",
"text": "def validates_acceptance_of(*attr_names); end",
"title": ""
},
{
"docid": "bc381d220261d0c14294b0afffdd2a1a",
"score": "0.5631377",
"text": "def attrib_bits_valid; end",
"title": ""
},
{
"docid": "488c2884dcbb7c7fee190768699077e1",
"score": "0.5608338",
"text": "def integer_enums=(enums)\n if self.atype == Atype_Integer_Enum\n attribute_ranges.clear\n enums.each_with_index do |ar, ix|\n priority = nil\n if ar[:single]\n ar_low = ar[:single]\n else\n ar_low = ar[:low]\n priority = ar[:priority]\n end\n priority = ix + 1 if priority.blank?\n begin\n ar_low = Integer(ar_low)\n rescue\n next\n end\n attribute_ranges << \n AttributeRange.new(:integer_val_low => ar_low,\n :units_low => ar[:units_low], :priority => priority)\n end\n end\n end",
"title": ""
},
{
"docid": "ade632ea1adb24e5cc374e365a4d9255",
"score": "0.5606849",
"text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n self.class_eval do\n define_method(\"#{attribute}\") { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n end",
"title": ""
},
{
"docid": "799c558ea31390693a8eb16b0563ae17",
"score": "0.55755025",
"text": "def validate_enum!(enum)\n raise IncorrectTraversalStrategyError, enum unless enum.respond_to? :each\n end",
"title": ""
},
{
"docid": "d9bc9ced5940fecaff78acf47a5c6158",
"score": "0.55721456",
"text": "def style=(style)\n validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n unless validator.valid?(style)\n fail ArgumentError, 'invalid value for \"style\", must be one of #{validator.allowable_values}.'\n end\n @style = style\n end",
"title": ""
},
{
"docid": "977c18580a3b1ddadf71ecf8af2fc24f",
"score": "0.5508693",
"text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n class_eval do\n define_method(attribute.to_s) { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "718b23940a620946bc84a2b0e1a210a1",
"score": "0.54985684",
"text": "def bad_attribute(attribute, values)\n \"#{attribute} must be one of #{values.map(&:inspect).join(\", \")}\"\n end",
"title": ""
},
{
"docid": "dce9facac4a142349af44f00a92abc9a",
"score": "0.5497108",
"text": "def it_should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = self.described_type\n good_values.each do |v|\n describe \"allows #{attribute} to be set to #{v.inspect}\" do\n assert_good_value(klass, attribute, v)\n end\n end\n end",
"title": ""
},
{
"docid": "c27b19e88fdd6da71c27e54ef6aa85cf",
"score": "0.54969",
"text": "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = model_class\n klass = model_class\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, get_instance_of(klass)\n end\n end\n end",
"title": ""
},
{
"docid": "61d3f6fcb634b4dcf4de166cba3324ff",
"score": "0.54938996",
"text": "def validates_attr(name, options = {})\n name = :\"attribute_#{name}\"\n\n if (choices = options.delete(:choices))\n supported_choices = choices.map do |c|\n c.is_a?(String) ? c.to_sym : c.to_s\n end.concat(choices)\n\n choices = choices.map(&:inspect).to_sentence(last_word_connector: \", or \")\n message = \"\\\"%<value>s\\\" is not valid. Options include: #{choices}.\"\n\n options.merge!(inclusion: { in: supported_choices, message: message })\n end\n\n validates(name, options)\n end",
"title": ""
},
{
"docid": "c25a6cf764135f341117cbdb179eb6a8",
"score": "0.5490385",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"cloudAppSecurityType\", @cloud_app_security_type)\n end",
"title": ""
},
{
"docid": "8be2f363738b2de37fd7cdb9a36bdb67",
"score": "0.5481565",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"type\", @type)\n end",
"title": ""
},
{
"docid": "b567cfe3d53ce0cee192e447edb4f550",
"score": "0.54563075",
"text": "def validate_enum(current_schema, data, fragments)\n if !current_schema.schema['enum'].include?(data)\n message = \"The property '#{build_fragment(fragments)}' did not match one of the following values:\"\n current_schema.schema['enum'].each {|val|\n if val.is_a?(NilClass)\n message += \" null,\"\n elsif val.is_a?(Array)\n message += \" (array),\"\n elsif val.is_a?(Hash)\n message += \" (object),\"\n else\n message += \" #{val.to_s},\"\n end\n }\n message.chop!\n raise ValidationError.new(message, fragments, current_schema)\n end\n end",
"title": ""
},
{
"docid": "4720ede289047948698982892c450ba1",
"score": "0.54559237",
"text": "def define_enum_setter(enum_name)\n method_name = \"#{ enum_name }=\"\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do |*values|\n enumeration = rd_bitwise_enumerations[enum_name][:values].select{ |k,v| values.flatten.include?(k) }\n instance_variable_name = \"@#{ enum_name }\".to_sym\n\n ## Using a Bitwise \"|\" (OR) we will combine all of our flags\n ## to create the value to be stored.\n ##\n instance_variable_set instance_variable_name.to_sym, enumeration.map{ |k,v| v }.reduce(0) { |result, n| result | n }\n end\n end",
"title": ""
},
{
"docid": "a5247474e69ad6546ee0119b7968dd7b",
"score": "0.5445337",
"text": "def valid_attributes\n [:default_value, :format, :list, :required, :type, :values]\n end",
"title": ""
},
{
"docid": "06bfe8bd8c28b7b57ee3090d2a804ebf",
"score": "0.54292357",
"text": "def check_ranged_param(ranged_param, allowed)\n 🔞 = ranged_param.keys.map(&:to_sym) - allowed.map(&:to_sym)\n raise InvalidRangeException, \"Attributes #{🔞.map(&:to_s).to_sentence} doesn't exists or aren't rangeables. Available ranges are: #{allowed.to_sentence}\" if 🔞.any?\n end",
"title": ""
},
{
"docid": "2a27a0daa7c74798cc6f47a01e3affbb",
"score": "0.5417384",
"text": "def valid_attribute?(tag, attribute)\n if LIMITED_ATTRIBUTES.key?(attribute.to_sym)\n return LIMITED_ATTRIBUTES[attribute.to_sym].include?(tag.to_sym)\n end\n return !FORBIDDEN_ATTRIBUTES.include?(attribute)\n end",
"title": ""
},
{
"docid": "9c046178bf04c989733be8cad495b654",
"score": "0.5416686",
"text": "def attribute(name, type = Type::Value.new, *args, **options)\n arg_options = args.each_with_object({}) { |arg, hsh| hsh[arg.to_sym] = true }\n options = arg_options.merge options\n\n type = check_allowed_type type\n options[:of] = check_allowed_type(options[:of]) if options.key?(:of)\n\n attribute_metadata name, type, options\n\n build_attribute_aliases name, options\n\n options = Validations.build_for(self, name)\n\n super(name, type, **options)\n end",
"title": ""
},
{
"docid": "2a28378335565698a8d97c2e9ca62f13",
"score": "0.54132265",
"text": "def do_validate(_name, value, errors)\n errors.add(\"invalid type '#{value}'\") unless @allowed_values.include?(value)\n end",
"title": ""
},
{
"docid": "55b7551ca2a16c905eb7c3a540be4ea3",
"score": "0.5411249",
"text": "def define_active_enum_write_method(attribute)\n old_method = \"#{attribute}_without_enum=\"\n define_method(\"#{attribute}_with_enum=\") do |arg|\n enum = self.class.enum_for(attribute)\n if arg.is_a?(Symbol)\n value = enum[arg]\n send(old_method, value)\n else\n send(old_method, arg)\n end\n end\n\n alias_method_chain \"#{attribute}=\".to_sym, :enum\n end",
"title": ""
},
{
"docid": "a34fd2533b915aa938ed0963f3ae7b79",
"score": "0.5400308",
"text": "def all_values\n attr = attribute\n vals = values_methods\n\n enum_klass = subtype.klass\n model_klass = klass\n\n # TODO: Rewrite these as string\n enum_module.module_eval do\n vals.each do |val, list|\n # scope :disabled, -> { where(status: 'disabled') }\n model_klass.scope list[0], -> do\n where(enum_klass.scope(arel_table[attr], val))\n end\n\n # def disabled? status.disabled? end\n define_method(list[1]) { send(attr).public_send(\"#{val}?\") }\n\n # def disabled!\n # changed = send(attr).public_send(\"#{val}!\")\n # save! if changed && enum_save_on_bang\n # true\n define_method(list[2]) do\n changed = send(attr).public_send(\"#{val}!\")\n return save! if changed && enum_save_on_bang\n true\n end\n end\n end\n end",
"title": ""
},
{
"docid": "26732fa1c8bfc5d6f163fcfe9a286583",
"score": "0.5393772",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"None\", \"Area\", \"Arrow\", \"Distance\", \"Ellipse\", \"Link\", \"Point\", \"Polyline\", \"ResourcesRedaction\", \"TextField\", \"TextHighlight\", \"TextRedaction\", \"TextReplacement\", \"TextStrikeout\", \"TextUnderline\", \"Watermark\", \"Image\", \"TextSquiggly\"])\n if type.to_i == 0\n unless validator.valid?(type)\n # raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n @type = validator.allowable_values[type.to_i]\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end",
"title": ""
},
{
"docid": "9ca3e42b86b1d357fc5bdf80a9b8d9cb",
"score": "0.53840685",
"text": "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end",
"title": ""
},
{
"docid": "d935a0603851a101823039c5e5bdf695",
"score": "0.53678125",
"text": "def validates_acceptance_of(*attr_names)\n configuration = { :message => ActiveRecord::Errors.default_error_messages[:accepted], :on => :save }\n configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)\n\n for attr_name in attr_names\n attr_accessor(attr_name)\n class_eval(%(#{validation_method(configuration[:on])} %{errors.add('#{attr_name}', '#{configuration[:message]}') unless #{attr_name}.nil? or #{attr_name} == \"1\"}))\n end\n end",
"title": ""
},
{
"docid": "9c088abf83d514d7a2552c2120dfa025",
"score": "0.5365301",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"mode\", @mode)\n end",
"title": ""
},
{
"docid": "e920ed00ab3733a5e7b6e9b884733a9c",
"score": "0.5359162",
"text": "def role_enum=(role)\n write_attribute(:role, role)\n end",
"title": ""
},
{
"docid": "f187aca54cfe93d01eefb4eb3e43f331",
"score": "0.535419",
"text": "def ticket_status=(val)\r\n\r\nself.ticket_status__index_was = self.ticket_status__index\r\ncase val\r\nwhen nil\r\n write_attribute(:ticket_status, nil)\r\nwhen 1..11 # index\r\n write_attribute(:ticket_status, val)\r\nwhen \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\" # index as string\r\n write_attribute(:ticket_status, val.to_i)\r\nwhen *(self.ticket_status__potential_values) # value\r\n write_attribute(:ticket_status, self.ticket_status__potential_values.index(val) + 1)\r\nwhen *LOCALIZED_TICKET_STATUSES # localized value\r\n write_attribute(:ticket_status, LOCALIZED_TICKET_STATUSES.index(val) + 1)\r\nelse\r\n write_attribute(:ticket_status, nil)\r\nend\r\nend",
"title": ""
},
{
"docid": "ffa2a8f8afc3c428fef0c1509c6c1a41",
"score": "0.5343541",
"text": "def validate_with_definition value, param\n sx = []\n case type\n when :enum\n enum = self.enum\n if enum.key?(value)\n value.replace(enum[value]) if enum[value] != value\n else\n sx.push \"#{vernacular} must be {#{enum.keys.sort.join('|')}}, not #{value.inspect}\"\n end\n when :integer ; /\\A-?\\d+\\z/ =~ value or\n sx.push(\"#{vernacular} must be an integer, not #{value.inspect}\")\n when :float ; /\\A-?\\d+(?:\\.\\d+)?\\z/ =~ value or\n sx.push(\"#{vernacular} must be a float, not {value.inspect}\")\n when :string, :file ; # string: nothing, all data is string data from our perspective\n else; fail(\"not yet, maybe one day timmy: #{type.inspect}\")\n end\n sentence_join sx\n end",
"title": ""
},
{
"docid": "56e1d37d049e3d7fbbaa610f8be6b1f9",
"score": "0.5342304",
"text": "def attrib_bits=(value); end",
"title": ""
},
{
"docid": "5df8b13d444ed10628dbc6b9d1afa674",
"score": "0.533128",
"text": "def check_enum(str)\n buf = String.new\n ar = (str.split('('))\n ar[1].chomp!(')')\n limit = ar[1].split(',')\n buf << \", :limit => [\"\n limit.each do |option|\n buf << ':' << option.tr(\"'\",\"\") << ','\n end\n buf.chomp!(',') # remove the last comma\n buf << ']' # end the options array \n end",
"title": ""
},
{
"docid": "6e84adb3711bdbf84923e64ee61b24e0",
"score": "0.53229517",
"text": "def enum hash\n key = hash.keys.first\n (self.enums ||= {}).merge! hash\n define_attribute_methods if !attribute_methods_generated?\n class_eval %{\n def #{key}\n missing_attribute('#{key}', caller) unless @attributes.has_key?('#{key}')\n self.class.enums[:#{key}][@attributes['#{key}']]\n end\n def #{key}=(val)\n write_attribute('#{key}', Fixnum === val ? val : self.class.enums[:#{key}].index val.to_s\n end\n }\n end",
"title": ""
},
{
"docid": "6ece11983f7f07b25217cd0ce22063c8",
"score": "0.5321647",
"text": "def currency_code=(currency_code)\n validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency_code)\n fail ArgumentError, \"invalid value for 'currency_code', must be one of #{validator.allowable_values}.\"\n end\n @currency_code = currency_code\n end",
"title": ""
},
{
"docid": "586494cb36b3d47597bc00c4bef5caf8",
"score": "0.53116965",
"text": "def valid?\n entity_type_validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n return false unless entity_type_validator.valid?(@entity_type)\n return true\n end",
"title": ""
},
{
"docid": "fcf257c078c19338e239395fe52d1bf7",
"score": "0.529121",
"text": "def required_numeric_attributes\n enum? ? [] : %i[min max default]\n end",
"title": ""
},
{
"docid": "8744b6f6ec057efddfe190f0250661c2",
"score": "0.5290592",
"text": "def scope(attribute, value)\n attribute.contains(::Arel.array(value, cast: enum_source.type_name))\n end",
"title": ""
},
{
"docid": "e7ed1f76c1df15f1da65493bac971b91",
"score": "0.52896464",
"text": "def enum_is_valid(mapper, enum_value)\n if enum_value.is_a?(String) && !enum_value.empty?\n model = get_model(mapper[:type][:module])\n model.constants.any? { |e| model.const_get(e).to_s.downcase == enum_value.downcase }\n else\n false\n end\n end",
"title": ""
},
{
"docid": "7063c0729003125904b123f1afb4047a",
"score": "0.52855855",
"text": "def valid?\n return false if !super\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Title', 'Text', 'TwoColumnText', 'Table', 'TextAndChart', 'ChartAndText', 'Diagram', 'Chart', 'TextAndClipArt', 'ClipArtAndText', 'TitleOnly', 'Blank', 'TextAndObject', 'ObjectAndText', 'Object', 'TitleAndObject', 'TextAndMedia', 'MediaAndText', 'ObjectOverText', 'TextOverObject', 'TextAndTwoObjects', 'TwoObjectsAndText', 'TwoObjectsOverText', 'FourObjects', 'VerticalText', 'ClipArtAndVerticalText', 'VerticalTitleAndText', 'VerticalTitleAndTextOverChart', 'TwoObjects', 'ObjectAndTwoObject', 'TwoObjectsAndObject', 'SectionHeader', 'TwoTextAndTwoObjects', 'TitleObjectAndCaption', 'PictureAndCaption', 'Custom'])\n return false unless type_validator.valid?(@type)\n true\n end",
"title": ""
},
{
"docid": "c93e6e74c7ca8e3ec937ebaf83b2a76f",
"score": "0.52768075",
"text": "def attribute_value_allowed?(attribute_name, value)\n allowed_values = Hash(defined_attributes).fetch(attribute_name, {})[:allowed_values]\n\n value.nil? || allowed_values.nil? || allowed_values.include?(value)\n end",
"title": ""
},
{
"docid": "0e7f6415a6d39d26b0d04e00bc265c9b",
"score": "0.5266651",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"AP\", \"AR\", \"EE\", \"EI\", \"EO\", \"IA\", \"IT\", \"P\", \"PF\", \"R\", \"RA\", \"RD\", \"RE\", \"RP\", \"ST\", \"SD\", \"ET\", \"RM\", \"FT\", \"PT\"])\n return false unless type_validator.valid?(@type)\n expense_class_validator = EnumAttributeValidator.new('String', [\"NonReimbursable\", \"Reimbursable\", \"Personal\"])\n return false unless expense_class_validator.valid?(@expense_class)\n return true\n end",
"title": ""
},
{
"docid": "6f2bdf88da66c4e515a530f51c13c388",
"score": "0.5266496",
"text": "def enum_types; end",
"title": ""
},
{
"docid": "f4293acbc9bf8b16c2e3724403116f39",
"score": "0.5264632",
"text": "def allowed_values(type, field, workspace = nil)\n rally_workspace_object(workspace)\n \n type_def = get_typedef_for(type, workspace)\n allowed_vals = {}\n type_def[\"Attributes\"].each do |attr|\n next if attr[\"ElementName\"] != field\n attr[\"AllowedValues\"].each do |val_ref|\n val = val_ref[\"StringValue\"]\n val = \"Null\" if val.nil? || val.empty?\n allowed_vals[val] = true\n end\n end\n allowed_vals\n end",
"title": ""
},
{
"docid": "980f1ecce12cb6af88aea60e530e6082",
"score": "0.5254619",
"text": "def attr_allowed(attribute, *args)\n opt = args.last.is_a?(Hash) ? args.pop : {}\n vals = {}\n args.flatten.map { |v| vals[v.to_sym] = v.to_s }\n defn = Definition.new(attribute, vals, opt)\n easy_attribute_accessors(attribute, defn)\n end",
"title": ""
},
{
"docid": "7d42bd6632b5674e48aa4039d3b8ccee",
"score": "0.5251053",
"text": "def entity_type=(entity_type)\n validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n unless validator.valid?(entity_type)\n fail ArgumentError, \"invalid value for 'entity_type', must be one of #{validator.allowable_values}.\"\n end\n @entity_type = entity_type\n end",
"title": ""
},
{
"docid": "cb5074b4e936a2db2c33d0ad25a62fdf",
"score": "0.52493125",
"text": "def privilege_required=(privilege_required)\n validator = EnumAttributeValidator.new('String', ['N', 'L', 'H'])\n unless validator.valid?(privilege_required)\n fail ArgumentError, 'invalid value for \"privilege_required\", must be one of #{validator.allowable_values}.'\n end\n @privilege_required = privilege_required\n end",
"title": ""
},
{
"docid": "6630708f3097fe961a4387771ec75898",
"score": "0.5247862",
"text": "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'Pdf16', 'Pdf17', 'PdfA1b', 'PdfA1a', 'PdfA2b', 'PdfA2a', 'PdfA3b', 'PdfA3a', 'PdfUa', 'PdfA2u'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end",
"title": ""
},
{
"docid": "f26eec2ae4be71069d63afdafd26f153",
"score": "0.52447504",
"text": "def rewrite_enum_defaults; end",
"title": ""
},
{
"docid": "2f3caf89293d72fac9358347684cc788",
"score": "0.5230009",
"text": "def allowed_values(value, pdef)\n if pdef.include?(value)\n true\n else\n \"Not an allowed value: #{pdef.join(\", \")}\"\n end\n end",
"title": ""
},
{
"docid": "319a3a450dd9ecea8d2d82c7a2b61adb",
"score": "0.5224236",
"text": "def attribute_allowed?(attr)\n opts.fetch(:all_attributes, config[:all_attributes], allowed_attributes.include?(attr))\n end",
"title": ""
},
{
"docid": "d723220910558b7a1c37d87921066b14",
"score": "0.52220035",
"text": "def valid?\n return false if !super\n limit_location_validator = EnumAttributeValidator.new('String', ['NotDefined', 'UnderOver', 'SubscriptSuperscript'])\n return false unless limit_location_validator.valid?(@limit_location)\n true\n end",
"title": ""
},
{
"docid": "a5b84d23fe44fecd0d339a41afe7dcb4",
"score": "0.5221673",
"text": "def validate!\n if options[:required] && blank?\n raise \"'#{name}' attribute is required\"\n elsif options[:required_if]\n req_if = options[:required_if]\n if req_if.is_a?(Symbol) && (respond_to?(req_if, true) ? send(req_if) : req_if) && blank?\n raise \"'#{name}' attribute is required, because `required_if` is given (`#{req_if}`)\"\n end\n end\n\n if !value.is_a?(type)\n raise \"Value of attribute '#{name}' is not a #{type}\"\n end\n end",
"title": ""
},
{
"docid": "6d9a7f4204ef963e52d948b0ce5dd80a",
"score": "0.52203035",
"text": "def error_type=(error_type)\n validator = EnumAttributeValidator.new('String', [\"INCORRECT_NUMBER_OF_COLUMNS\", \"INVALID_OBJECT_ID\", \"INVALID_ASSOCIATION_IDENTIFIER\", \"NO_OBJECT_ID_FROM_ASSOCIATION_IDENTIFIER\", \"MULTIPLE_COMPANIES_WITH_THIS_DOMAIN\", \"PROPERTY_DEFINITION_NOT_FOUND\", \"PROPERTY_VALUE_NOT_FOUND\", \"COULD_NOT_FIND_OWNER\", \"MULTIPLE_OWNERS_FOUND\", \"COULD_NOT_FIND_BUSINESS_UNIT\", \"COULD_NOT_PARSE_NUMBER\", \"COULD_NOT_PARSE_DATE\", \"COULD_NOT_PARSE_TERM\", \"OUTSIDE_VALID_TIME_RANGE\", \"OUTSIDE_VALID_TERM_RANGE\", \"COULD_NOT_PARSE_ROW\", \"INVALID_ENUMERATION_OPTION\", \"AMBIGUOUS_ENUMERATION_OPTION\", \"FAILED_VALIDATION\", \"FAILED_TO_CREATE_ASSOCIATION\", \"FILE_NOT_FOUND\", \"INVALID_COLUMN_CONFIGURATION\", \"INVALID_FILE_TYPE\", \"INVALID_SPREADSHEET\", \"INVALID_SHEET_COUNT\", \"FAILED_TO_PROCESS_OBJECT_WITH_EMPTY_PROPERTY_VALUES\", \"UNKNOWN_BAD_REQUEST\", \"GDPR_BLACKLISTED_EMAIL\", \"DUPLICATE_ASSOCIATION_ID\", \"LIMIT_EXCEEDED\", \"INVALID_ALTERNATE_ID\", \"INVALID_EMAIL\", \"INVALID_DOMAIN\", \"DUPLICATE_ROW_CONTENT\", \"INVALID_NUMBER_SIZE\", \"UNKNOWN_ERROR\", \"FAILED_TO_OPT_OUT_CONTACT\", \"INVALID_REQUIRED_PROPERTY\", \"MISSING_REQUIRED_PROPERTY\", \"DUPLICATE_ALTERNATE_ID\", \"DUPLICATE_OBJECT_ID\", \"DUPLICATE_UNIQUE_PROPERTY_VALUE\", \"BLANK_VALUE_PROVIDED\", \"UNKNOWN_ASSOCIATION_RECORD_ID\", \"INVALID_RECORD_ID\", \"DUPLICATE_RECORD_ID\", \"INVALID_CUSTOM_PROPERTY_VALIDATION\", \"CREATE_ONLY_IMPORT\", \"UPDATE_ONLY_IMPORT\", \"COLUMN_TOO_LARGE\"])\n unless validator.valid?(error_type)\n fail ArgumentError, \"invalid value for \\\"error_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @error_type = error_type\n end",
"title": ""
},
{
"docid": "fe6b9841a175c460b83a392a86e9a4ac",
"score": "0.5215364",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"allowedValues\", @allowed_values)\n writer.write_string_value(\"attributeSet\", @attribute_set)\n writer.write_string_value(\"description\", @description)\n writer.write_boolean_value(\"isCollection\", @is_collection)\n writer.write_boolean_value(\"isSearchable\", @is_searchable)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"status\", @status)\n writer.write_string_value(\"type\", @type)\n writer.write_boolean_value(\"usePreDefinedValuesOnly\", @use_pre_defined_values_only)\n end",
"title": ""
},
{
"docid": "446494fcb3efd8f352acaca7c4a6d047",
"score": "0.52149403",
"text": "def create_enum(name, values); end",
"title": ""
},
{
"docid": "79d03bfb9f000170105261083051cd19",
"score": "0.52118015",
"text": "def valid?\n side_validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n return false unless side_validator.valid?(@side)\n pt_validator = EnumAttributeValidator.new('String', [\"L\", \"P\", \"MOC\"])\n return false unless pt_validator.valid?(@pt)\n ot_validator = EnumAttributeValidator.new('String', [\"L\", \"LOC\", \"MOC\"])\n return false unless ot_validator.valid?(@ot)\n status_validator = EnumAttributeValidator.new('String', [\"E\", \"EC\"])\n return false unless status_validator.valid?(@status)\n return true\n end",
"title": ""
},
{
"docid": "9f71a66000c11a6d5f116fa9095577fa",
"score": "0.5202486",
"text": "def validate!\n validations.each do |v|\n value = send v[:attr_name]\n unless validate_value(value, v[:condition])\n raise ArgumentError, \"#{v[:attr_name]} validation failed, #{v[:condition]} missmatch\"\n end\n end\n end",
"title": ""
},
{
"docid": "1e923cb61bf776a06ba32052325ed514",
"score": "0.51983684",
"text": "def define_enum_tests(enum_name)\n enumeration = rd_bitwise_enumerations[enum_name][:values]\n\n enumeration.each do |name, value|\n method_name = \"#{ name }?\".to_sym\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do\n current_value = instance_variable_get \"@#{ enum_name }\"\n current_value | value == current_value\n end\n end\n end",
"title": ""
},
{
"docid": "cc8b1fff0b0710ccdcc2397bc24114be",
"score": "0.5186405",
"text": "def allowed_values=(value)\n @allowed_values = value\n end",
"title": ""
},
{
"docid": "634d57b32c5043b783dd4c8cf18001d0",
"score": "0.5175521",
"text": "def value_acceptable?\n self.allowed_values.blank? || self.allowed_values.include?(self.value)\n end",
"title": ""
},
{
"docid": "c68d3dab8fc6a202b2ef083d686986af",
"score": "0.5174282",
"text": "def validate!\n VALID_RANGES.include?(self.value.to_i)\n end",
"title": ""
},
{
"docid": "602f8ac854b2a536ca5e9e4cae0c354c",
"score": "0.5172977",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes', 'Treemap', 'Sunburst', 'Histogram', 'ParetoLine', 'BoxAndWhisker', 'Waterfall', 'Funnel', 'Map'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "a4520abf5f6d779b6fb201a1b817d260",
"score": "0.5165406",
"text": "def legal_annual_turn_over=(legal_annual_turn_over)\n validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n unless validator.valid?(legal_annual_turn_over)\n fail ArgumentError, 'invalid value for \"legal_annual_turn_over\", must be one of #{validator.allowable_values}.'\n end\n @legal_annual_turn_over = legal_annual_turn_over\n end",
"title": ""
},
{
"docid": "dbedd61f66b340a99e72d5cc697d6928",
"score": "0.51612365",
"text": "def test_bad_value\n row = Enumeration.new\n row.color = :violet\n row.string_field = 'test'\n assert !row.save\n \n assert row.errors\n assert_equal ['is not included in the list'], row.errors['color']\n end",
"title": ""
},
{
"docid": "19f9af10736a3af55177dd4c0d0b4c36",
"score": "0.51487315",
"text": "def side=(side)\n validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n unless validator.valid?(side)\n fail ArgumentError, \"invalid value for 'side', must be one of #{validator.allowable_values}.\"\n end\n @side = side\n end",
"title": ""
},
{
"docid": "b9a0d8742e3a4d9c8531bab0aa937aa9",
"score": "0.5143194",
"text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end",
"title": ""
},
{
"docid": "b9a0d8742e3a4d9c8531bab0aa937aa9",
"score": "0.5143194",
"text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end",
"title": ""
},
{
"docid": "4b656e823f1023cdcfc7123acf4549b9",
"score": "0.5142558",
"text": "def invalid_attribute_value(klass, value)\n raise ArgumentError,\n \"Declared attribute was #{klass}, received #{value}\"\n end",
"title": ""
},
{
"docid": "728825a97d6143ec1d1ba0b555b074b4",
"score": "0.5142094",
"text": "def supported_attribute_types=(value)\n @supported_attribute_types = value\n end",
"title": ""
},
{
"docid": "3166f88ed8e7b3071fc74b28818b2cf5",
"score": "0.51374906",
"text": "def define_writer(name, options = {})\n values = extract_values_from(options)\n format = extract_format_from(options)\n types = extract_types_from(options)\n\n define_method(\"#{name}=\") do |value|\n raise InvalidAttributeValue.new(value, values) if values && !values.include?(value)\n\n raise InvalidAttributeFormat.new(value, format) if !format.nil? && value !~ format\n\n raise InvalidAttributeType.new(value, types) if value && types && types.none? { |klass| value.is_a?(klass) }\n\n instance_variable_set(:\"@#{name}\", value)\n end\n end",
"title": ""
},
{
"docid": "18a1aac9f6fd98fc6e91c763811a885b",
"score": "0.51369256",
"text": "def it_should_not_allow_values_for(attribute, *bad_values)\n message = get_options!(bad_values, :message)\n message ||= default_error_message(:invalid)\n klass = self.described_type\n bad_values.each do |v|\n describe \"doesn't allow #{attribute} to be set to #{v.inspect}\" do\n assert_bad_value(klass, attribute, v, message)\n end\n end\n end",
"title": ""
},
{
"docid": "e1b6f0832f47b970d86ee6bbe0069165",
"score": "0.5131753",
"text": "def enum_values\n return if $enums.empty?\n\n filename = File.join \"#{$app_root}/app/models\", \"#{$name}.rb\"\n File.open(filename, \"r\") {|file| @lines = file.readlines; }\n\n $enums.each_with_index do |enum, index|\n @lines.each do |line|\n# if line.include?('enum') && line.include? \"#{enum}:\"\n if line.match('enum' && \"#{enum}:\")\n $enums_qty[index] = line.count(',') + 1 # Number of commas + 1\n end\n end\n end\n\n # If no enum statements found in the Model file (NOT NEEEDE now)\n if $enums_qty.empty?\n (0...$enums.count).each do |i|\n $enums_qty[i] = ENUM_DDL_THRESHOLD # All enum attributes to be listed as DDLs\n end\n end\n end",
"title": ""
},
{
"docid": "774a366b9f69fd65cf48be53dd57842f",
"score": "0.5129999",
"text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end",
"title": ""
},
{
"docid": "477daded5fe1fcf4833feef5d28df0b8",
"score": "0.5123942",
"text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end",
"title": ""
},
{
"docid": "9e09e478ffbcd5696adbbac0de32b806",
"score": "0.51167804",
"text": "def check_attribute(attr)\n tag = attr.parent_tag\n\n return warning \"(Tag: #{tag.name}) \"\\\n \"Invalid Attribute '#{attr.name}'\" unless valid_attribute?(tag, attr)\n\n return warning \"(Tag: #{tag.name}, Attribute: #{attr.name})\"\\\n \" Invalid Value '#{attr.value}'\" unless self[tag.name][attr.name]\n .valid?(attr)\n\n true\n end",
"title": ""
},
{
"docid": "184f4ffa6d25c68dad37fb2bd3c2ea24",
"score": "0.5112769",
"text": "def allowable_values(allowable_range)\n\t\traise RuntimeError, \"#{self.class.to_s} does not implement #allowable_values\"\n\t end",
"title": ""
},
{
"docid": "abdee14b197eb02bfd48be4843938a8d",
"score": "0.5112224",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"permissionId\", @permission_id)\n writer.write_string_value(\"permissionName\", @permission_name)\n end",
"title": ""
},
{
"docid": "bdb1fc5342abbce086a370e8721623a6",
"score": "0.51070607",
"text": "def visit_enum(binding_type)\n raise NotImplementedError\n end",
"title": ""
}
] |
189526a854e9568bd50a37e5493a81cb
|
POST /posttags POST /posttags.json
|
[
{
"docid": "3fe847a9dbe0dd7bd474588faf41a796",
"score": "0.6826153",
"text": "def create\n @posttag = Posttag.new(params[:posttag])\n\n respond_to do |format|\n if @posttag.save\n format.html { redirect_to @posttag, :notice => 'Posttag was successfully created.' }\n format.json { render :json => @posttag, :status => :created, :location => @posttag }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @posttag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "94f109a5497034509c0599078c6aa664",
"score": "0.7374036",
"text": "def tag!(params = {})\n self.post params, edge: :tags\n end",
"title": ""
},
{
"docid": "6c7c3ee9278fef6af1ba1dd9a64fef99",
"score": "0.6917392",
"text": "def create\n @tags_post = TagsPost.new(tags_post_params)\n\n respond_to do |format|\n if @tags_post.save\n format.html { redirect_to @tags_post, notice: 'Tags post was successfully created.' }\n format.json { render :show, status: :created, location: @tags_post }\n else\n format.html { render :new }\n format.json { render json: @tags_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f507e6450cf6f7545055c29f3ced5153",
"score": "0.6911861",
"text": "def create\n @post = Post.new(params[:post])\n\n if params['tag_field'] != nil\n tags_array = params['tag_field'].split(\",\")\n tags_array.each do |tag|\n @post.tags << Tag.find_or_create_by_etiqueta_and_post_id(tag.strip, @post.id)\n end\n end\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b45ef4d4463ba73bc3ca11da1376a78",
"score": "0.6816009",
"text": "def add_new_tag\n puts \"******* add_new_tag *******\"\n puts \" ** params: #{params.inspect}\"\n\n @post_id = params[:post_id]\n\n # == create brand new tag; add to Tags\n if params[:new_tag] != \"new\"\n\n # == check if tag already exists\n check_tag = Tag.where(tag_name: params[:new_tag])\n puts \" ** check_tag.length: #{check_tag.length.inspect}\"\n\n # == create new tag if not existing and assign to post\n if check_tag.length == 0\n @tag = Tag.create(tag_name: params[:new_tag], tag_rank: 0)\n @post_tag = PostTag.create(post_id: params[:post_id], tag_id: @tag[:id])\n puts \" ** NEW TAG @post_tag: #{@post_tag.inspect}\"\n end\n end\n\n # == assign existing tag if selected from select box (not \"ng\")\n if params[:tag_id] != \"ng\"\n\n # == check if tag already assigned to post\n check_tag = PostTag.where(post_id: params[:post_id], tag_id: params[:tag_id])\n puts \" ** check_tag.length: #{check_tag.length.inspect}\"\n\n if check_tag.length == 0\n @post_tag = PostTag.create(post_id: params[:post_id], tag_id: params[:tag_id])\n puts \" ** EXISTING TAG @post_tag: #{@post_tag.inspect}\"\n end\n end\n @post_tags = PostTag.where(post_id: params[:post_id])\n @post_tag_ids = @post_tags.map{|pt| pt.tag_id }\n @post_no_tags = Tag.where(\"id NOT IN (?)\", @post_tag_ids)\n @tags = Tag.where(id: @post_tag_ids)\n render json: { tags: @tags, post_no_tags: @post_no_tags, post_id: @post_id}\n end",
"title": ""
},
{
"docid": "5384985af311a09dd891504b4d80a9e2",
"score": "0.6799602",
"text": "def post_tag_params\n params.require(:post_tag).permit(:post_id, :tag)\n end",
"title": ""
},
{
"docid": "84f200235ab691805ad98d374291b8c7",
"score": "0.6779049",
"text": "def tags_post_params\n params.require(:tags_post).permit(:post_id, :tag_id)\n end",
"title": ""
},
{
"docid": "15cee9497ebccff1542e7d027fcff29f",
"score": "0.67710716",
"text": "def create\n @post = Post.new(post_params.except(:tags))\n tags = post_params[:tags].split(',')\n @post.user = current_user\n\n respond_to do |format|\n if @post.save\n @post.add_tags_with_check(tags)\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2acf5e719de76b1dc5f7def86b627189",
"score": "0.6662217",
"text": "def create\n @post = Post.new(params[:post])\n@post.user=current_user\n\tcurrent_user.tag(@post, :with => params[:post][:tag_list], :on => :tags)\n\tputs @post.save\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09e13525b4009d946d3c143f58f7df80",
"score": "0.66462475",
"text": "def post_params\n params.require(:post).permit(:body, {tag_ids: []}, {tag_list: []})\n end",
"title": ""
},
{
"docid": "c9ddac1041c1aace3786b7ab38ed400c",
"score": "0.65494704",
"text": "def postEntityAdvertiserTag( gen_id, entity_id, language, tags_to_add, tags_to_remove)\n params = Hash.new\n params['gen_id'] = gen_id\n params['entity_id'] = entity_id\n params['language'] = language\n params['tags_to_add'] = tags_to_add\n params['tags_to_remove'] = tags_to_remove\n return doCurl(\"post\",\"/entity/advertiser/tag\",params)\n end",
"title": ""
},
{
"docid": "5d335f84e8f11c286331c35c8cae7c66",
"score": "0.6546692",
"text": "def create\n @post = Post.new(params[:post])\n @post.tag_list = params[:tags]\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa3760f78003c3bbfc7b80793c8426c8",
"score": "0.65432197",
"text": "def post_params\n if params[\"post\"][\"tags\"].class == Array\n params[\"post\"][\"tags\"] = params[\"post\"][\"tags\"].join(',')\n end\n params.require(:post).permit(:sub_id, :title, :body, :tags, :created_at, :updated_at)\n end",
"title": ""
},
{
"docid": "4222b01fa774de1237ac72188349395b",
"score": "0.65302336",
"text": "def update\n begin\n entity = Tagger::EntityTag.create_entity_tags(params)\n render json: { \"#{Tagger.tagged_resource}\": entity, tags: entity.tags }, status: 201\n rescue Exception => e\n render json: { error: \"Unprocessable entity\" }, status: 422\n end\n end",
"title": ""
},
{
"docid": "4c79d8683c9e24bf54342a642ce446f9",
"score": "0.65112877",
"text": "def create\n @post = Post.new\n @post.title = params[:title]\n @post.body = params[:body]\n @post.user = current_user if current_user\n @tags = params[:tags].split(',') unless params[:tags].blank?\n\n respond_to do |format|\n\n Post.transaction do\n if @post.save\n create_tags(@post, @tags)\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c86dc2d51c8bbf0f7c9c4f99b6303c10",
"score": "0.6509022",
"text": "def process_tags(post)\n tags_text = params[:post][:tags]\n tag_array = tags_text.split(',')\n tag_array.each do |tag|\n tag_with_context = tag.split('/');\n post.set_tag_list_on(tag_with_context[0].strip, tag_with_context[1].strip)\n end\n return post\n end",
"title": ""
},
{
"docid": "f602f5af934adb256f2e50730a17b78c",
"score": "0.6483024",
"text": "def create\n @post = Post.create(post_params)\n @post.tag_list=(params[:tag_list])\n respond_with @post\n end",
"title": ""
},
{
"docid": "68b3c7f5aab718334a42b9860518c29e",
"score": "0.6481823",
"text": "def create\n @post = Post.new(post_params)\n #@post = process_tags(@post)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e077d2783adf33feba21e65008252179",
"score": "0.6470158",
"text": "def create\n @post_tag = PostTag.new(post_tag_params)\n\n respond_to do |format|\n if @post_tag.save\n format.html { redirect_to @post_tag, notice: 'Tagi lisätty' }\n format.json { render :show, status: :created, location: @post_tag }\n else\n @alert = @post_tag.errors\n format.html { render :new }\n format.json { render json: @post_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96856a6faf651fdcb5bceb2de9957d99",
"score": "0.64646095",
"text": "def post_v1_tags(body, opts = {})\n data, _status_code, _headers = post_v1_tags_with_http_info(body, opts)\n data\n end",
"title": ""
},
{
"docid": "d26360f0420d2f98a729bc1f3f0b0f01",
"score": "0.6454545",
"text": "def create\n #Refactor maybe is this the best way to associate a post with the current user?\n @post = current_user.posts.build(post_params.slice(:content, :user_id, :asset))\n #@post.tag_list = @post.extract_tags\n @post.build_tags(params[:tag_list])\n\n if @post.save\n render json: @post, status: :created\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "66d63b14e70d43701e456e512cd705a3",
"score": "0.64337623",
"text": "def create\n #@tag = params[:post][:tags_attributes]\n\n # shanghai-zhou(105703655) 10:31:32 写的另一种方法\n # tags = ['he', 'll', 'o']\n # @tags = tags.map do |t|\n # if Tag.find_by_name(t).blank?\n # Tag.create(:name=>t)\n # end\n # Tag.find_by_name t\n # end\n # @post.tags = @tags\n # @post.save\n\n @tagarr = params[:post][:tags_attributes][\"0\"][:name].split(\" \")\n @tag = {}\n @tagarr.each_with_index do |tag,i|\n #@tagarr.each do |tag|\n @tag[i] = {:name => tag}\n end\n\n @postreset = params[:post]\n @postreset[\"tags_attributes\"] = @tag\n @post = Post.new(@postreset)\n \n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8693d5774531d053ca433140180aed48",
"score": "0.64335793",
"text": "def create_tags\n\tend",
"title": ""
},
{
"docid": "648ebbed2c5a5d70f46d4b6c7792971e",
"score": "0.64175606",
"text": "def create\n @tag = Tag.new(tag_params)\n if @tag.save\n render json: @tag\n else\n render json: @tag.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "295c07240d8a4dfea393b5dedbd25e6a",
"score": "0.63907737",
"text": "def create\n @post = Post.new(post_params)\n @post.sub_id = @post.default_sub_id\n respond_to do |format|\n if @post.save\n # @post.tag(post_params[:tags], current_user) if post_params[:tags]\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: nil }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9a048a498cf4f74035279e49c279937",
"score": "0.63856584",
"text": "def tag_set(id, tags)\n wf_event_id?(id)\n tags = Array(tags)\n tags.each { |t| wf_string?(t) }\n api.post([id, 'tag'].uri_concat, tags, 'application/json')\n end",
"title": ""
},
{
"docid": "ddad149e47d34251547c90cb47957082",
"score": "0.63731873",
"text": "def post_params\n params.require(:post).permit(:title, :body, :published, :category_id, tags: [tag: :key])\n end",
"title": ""
},
{
"docid": "d49e638b19399e52e5d93aa56b44948f",
"score": "0.6337659",
"text": "def post_tags(*value)\n @value[:post_tags] = value.flatten\n end",
"title": ""
},
{
"docid": "21f87a38f0114630aaa87d09051c3113",
"score": "0.6313416",
"text": "def update_tags(tags)\n rescue_extra_data\n tags = tags.split(\",\").strip\n post_tags = post_type.post_tags\n post_tags = post_tags.where.not(name: tags) if tags.present?\n term_relationships.where(\"term_taxonomy_id in (?)\", post_tags.pluck(\"#{CamaleonCms::TermTaxonomy.table_name}.id\")).destroy_all\n tags.each do |f|\n post_tag = post_type.post_tags.where({name: f}).first_or_create(slug: f.parameterize)\n term_relationships.where({term_taxonomy_id: post_tag.id}).first_or_create\n end\n update_counters(\"tags\")\n end",
"title": ""
},
{
"docid": "cd33ca231115c64c0bda6acd031527de",
"score": "0.6303341",
"text": "def create\n @post = Post.new(params[:post])\n @categories = Category.all\n @tags = Tag.all\n\n @post.created_by = current_user.id\n @post.order_date = Time.current\n\n p_tags = params[:all_tags]\n p_tag_new = params[:tag_new]\n\n @post.category_id = request.POST[:category]\n\n respond_to do |format|\n if @post.save\n if !p_tag_new.empty?\n tag_new = Tag.new(:tag_name => p_tag_new)\n if tag_new.save\n tag_map = PostsTag.new(:post_id => @post.id, :tag_id => tag_new.id)\n tag_map.save\n end\n end\n\n if !p_tags.empty?\n split_tags = p_tags.split(\",\")\n split_tags.each_index do |i|\n tag_id = split_tags[i]\n\n tag_map = PostsTag.new(:post_id => @post.id, :tag_id => tag_id)\n tag_map.save\n end\n end\n\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a291229b50e14daea2e9a2079cbf5faf",
"score": "0.6295628",
"text": "def create\n params[:tag_names].split(',').each do |name|\n @tag = Tag.find_or_create_by_name name.strip\n @tagging = Tagging.new(params[:tagging])\n @tagging.tag = @tag\n @tags_saved = @tagging.save\n end\n \n respond_to do |format|\n if @tags_saved\n format.html { redirect_to @tagging.taggable, notice: 'Tagged.' }\n format.json { render json: @tagging, status: :created, location: @tagging }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tagging.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d09f5614675eeaf0c38deece904bb47",
"score": "0.62919664",
"text": "def set_tags_post\n @tags_post = TagsPost.find(params[:id])\n end",
"title": ""
},
{
"docid": "9dd65e94650799fefde987c8583d9c05",
"score": "0.62729007",
"text": "def create\r\n @tag = Tag.new(tag_params)\r\n\r\n if @tag.save\r\n render json: @tag\r\n else\r\n render json: { error: \"Tag creating error\" }, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "71d08579b66d83c1768467e8ab50e970",
"score": "0.6263168",
"text": "def create(tag)\n api_client.tags.multi_add(resource_hrefs: [api_client.get_instance.href], tags: [tag])\n end",
"title": ""
},
{
"docid": "57e5d400bc63ebbc6f4b19d8abb56077",
"score": "0.6260611",
"text": "def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n\n new_tags = params[:tags].split(',')\n\n new_tags.each do |stag|\n @event.tags.create(tag: stag)\n end\n\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86ea206889efaffdbed838a4e70fa4ef",
"score": "0.62524945",
"text": "def create\n @post = Post.new(post_params)\n check_published\n if(post_params[:tag_ids])\n @post.tags = Tag.find(post_params[:tag_ids])\n end\n respond_to do |format|\n if @post.save\n url = @post.link\n format.html { redirect_to url, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: url }\n else\n get_instance_vars\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8792c7f10210b3aba1b2ed1b241a56e5",
"score": "0.62511253",
"text": "def post_params\n params.require(:post).permit(:title, :body, :tag_list)\n end",
"title": ""
},
{
"docid": "e45fff1c9d5901dcde8c1e95eed1762e",
"score": "0.623173",
"text": "def postEntityTag( entity_id, tag, language)\n params = Hash.new\n params['entity_id'] = entity_id\n params['tag'] = tag\n params['language'] = language\n return doCurl(\"post\",\"/entity/tag\",params)\n end",
"title": ""
},
{
"docid": "2ac5164d1381e2747e8d2fb796723482",
"score": "0.6219179",
"text": "def toggle_tags\n puts \"\\n\\n******* toggle_tags *******\"\n\n # == get post_id and tag_id from combined :ids string (e.g. 1_4)\n ids = params[:ids].split(\"_\")\n @post_id = ids[0]\n tag_id = ids[1]\n\n # == check post for selected tag\n @post_tag = PostTag.where(post_id: @post_id, tag_id: tag_id).first\n\n # == remove previously assigned tag\n if @post_tag\n puts \"******* HAS TAG (delete tag) *******\"\n @post_tag.destroy\n @post_tags = PostTag.where(post_id: @post_id)\n @post_tag_ids = @post_tags.map{|pt| pt.tag_id }\n puts \"@post_tag_ids: \", @post_tag_ids\n if @post_tag_ids.length == 0\n @post_no_tags = Tag.all\n else\n @post_no_tags = Tag.where(\"id NOT IN (?)\", @post_tag_ids)\n end\n puts \"@post_no_tags: \", @post_no_tags\n @tags = Tag.where(id: @post_tag_ids)\n render json: { tags: @tags, post_no_tags: @post_no_tags, post_id: @post_id}\n end\n end",
"title": ""
},
{
"docid": "ca1ab8cabd908e7728d12ff9f86cc6b6",
"score": "0.62052935",
"text": "def create\n \n # special case for multiple tags\n tags = params[\"_json\"]\n if (tags.class.name == 'Array')\n Tag.delete_all\n puts \"this is an array\"\n success = true\n @tag = nil \n tags.each do |tag_hash|\n puts \"params are going from #{tag_hash} to #{tag_in_array_params(tag_hash)}\"\n @tag = Tag.new(tag_in_array_params(tag_hash))\n success &= @tag.save \n break unless success\n end\n respond_to do |format|\n if success\n format.json { render action: 'show', status: :created, location: @tag }\n else\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n return \n else \n puts \"class is #{tags.class}\"\n end\n \n @tag = Tag.new(tag_params)\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to @tag, notice: 'Tag was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tag }\n else\n format.html { render action: 'new' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9e8b05afad549859833defeeb787d07",
"score": "0.6186807",
"text": "def tag_params\n params.permit(:body, :post_id)\n .merge(post_id: params[:post_id])\n end",
"title": ""
},
{
"docid": "10666ad4e0ad6ac1cee5a0550c28cc05",
"score": "0.61774236",
"text": "def tag_params\n params.require(:tag).permit(:name, tag_task_id: [])\n end",
"title": ""
},
{
"docid": "e518fdacde092d4a506ebbbb107523dd",
"score": "0.6176095",
"text": "def create\n tag = @user.tags.new(:location => params[:location])\n\n if tag.save\n render :status => 200,\n :json => tag_as_hash(tag).merge(status: 200)\n else\n render :status => 400,\n :json => {\n status: 400,\n message: \"Bad request\",\n errors: tag.errors,\n }\n end\n end",
"title": ""
},
{
"docid": "75a6f511b1b6ade8a93ed190dd860a4e",
"score": "0.61625284",
"text": "def create\n #...\n params[:cat].permit(...:tag_ids: []) #allow tag_ids and expect it to be an Array\n end",
"title": ""
},
{
"docid": "aea9d28e3beab29eb8b6db42f4abe7ae",
"score": "0.61585104",
"text": "def create(tag)\n validate_type!(tag)\n\n attributes = sanitize(tag)\n _, _, root = @client.post(\"/tags\", attributes)\n\n Tag.new(root[:data])\n end",
"title": ""
},
{
"docid": "df6c0f1b32c6ceeae6ea31e5f799fb4e",
"score": "0.61491",
"text": "def modify_tag tag\n data = {\n \"tag\" => params\n }\n temp = data[\"servers\"]\n data[\"servers\"] = { \"server\" => temp }\n\n json = JSON.generate data\n\n response = put \"tag/#{tag}\", json\n return response unless response.code == 200\n\n body = JSON.parse response.body\n body[\"tag\"]\n end",
"title": ""
},
{
"docid": "fce5d6e9009d78431359b57b35228dc6",
"score": "0.61471355",
"text": "def save_tags(delete_old_tags = true)\n #delete all old tags\n if (delete_old_tags)\n PostTag.delete_all(post_id: @post.id)\n end\n #save new tags\n if (params[:tags].length > 0)\n tags = params[:tags].split(',').uniq\n tags.each do |tag_name|\n tag_name = tag_name.downcase.strip\n tag = Tag.find_or_initialize_by(title: tag_name, for: Tag::TYPE_POST)\n if (tag.save)\n #save linked table\n postTag = PostTag.create(post_id: @post.id, tag_id: tag.id)\n postTag.save\n end\n end\n end\n end",
"title": ""
},
{
"docid": "84f74b7fa57ffe8df9b4609b9100d834",
"score": "0.6147051",
"text": "def ifttt_new_post(title, body, categories, tags)\n # default protocol to respond to a new post is to POST a request to the url as specified in the tags, body is the payload\n HTTParty.post(tags.first, body: body)\n end",
"title": ""
},
{
"docid": "c3e5561ef307bde8f586c31867a46e22",
"score": "0.6139404",
"text": "def post_params\n params.require(:post).permit( :title, :body, :published, :category_id, { :tag_ids => [] } )\n end",
"title": ""
},
{
"docid": "5cbd5c823d027e123e4229b5866504bf",
"score": "0.61377114",
"text": "def post_params\n params.require(:post).permit(:title, :content, :tag_list)\n end",
"title": ""
},
{
"docid": "736478cc1af89115f3d5ec7e36689818",
"score": "0.6133714",
"text": "def create\n @posttag = Posttag.new(params[:posttag])\n #if post.valid?\n # if @post.save\n #redirect_to new_post_path(:id=> @posttag.id)\n #end\n \n\n respond_to do |format|\n if @posttag.save\n format.html { redirect_to @posttag, notice: 'Posttag was successfully created.' }\n format.json { render json: @posttag, status: :created, location: @posttag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @posttag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f647dea1554fb79466d706e4216aa2fc",
"score": "0.6103061",
"text": "def post_params\n params.require(:post).permit(:title, :body, :tag_string)\n end",
"title": ""
},
{
"docid": "dede26dd2d83472a738e800e15694b82",
"score": "0.60863256",
"text": "def create\n @shout = Shout.new(params[:shout])\n\n# params[:tags].split(\" \").each do |tag_word|\n# \t @shout.tags.build(:tag_word => tag_word)\n# \tend\n\t\n respond_to do |format|\n if @shout.save\n format.html { redirect_to @shout, notice: 'Shout was successfully created.' }\n format.json { render json: @shout, status: :created, location: @shout }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shout.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "088253ce8dcd5880029b7555ca833862",
"score": "0.6074643",
"text": "def add_tag_to_server server_uuid, tags\n tag = (tags.respond_to? :join && tags.join(\",\") || tags)\n\n post \"server/#{server_uuid}/tag/#{tag}\"\n end",
"title": ""
},
{
"docid": "9fac4205ba08cf7ef618ae8f0b7ec8d0",
"score": "0.6068017",
"text": "def create\n create_tags = params[:create_tags]\n\t@good = Good.new(params[:good])\n\t\n\tif @good.save\n\t\tif create_tags == '1'\n\t\t\tvalues = params[:good][:name].split(':')\n\t\t\tname = values[values.size-1]\n\t\t\tlasttag = values.size-2\n\t\t\tfor i in 0..lasttag\n\t\t\t\ttag_name = values[i]\n\t\t\t\ttag = Tag.find_or_create_by_name(tag_name)\n\t\t\t\ttag.save\n\t\t\t\tgt = GoodsTag.new(:tag=>tag,:good=>@good)\n\t\t\t\tgt.save\n\t\t\tend\n\t\tend\n\t respond_to do |format|\n\t\t\tformat.html { redirect_to :action=>\"index\" }\n\t\t\tformat.json { render :json => @good, :status => :created, :location => @good }\n\t\tend\n else\n\t\trespond_to do |format|\n\t\t\tformat.html { render :action => \"new\" }\n\t\t\tformat.json { render :json => @good.errors, :status => :unprocessable_entity }\n\t\tend\n end\n end",
"title": ""
},
{
"docid": "872a2ee741ce97e88751bde91d39aed4",
"score": "0.60567874",
"text": "def post_params\n # params.permit(:content, :color, taggings_attributes: [:id, :tag])\n params.permit(:content, :color, tag_ids: [], asset_ids: [])\n end",
"title": ""
},
{
"docid": "415002773a8ac793afff510f771821b1",
"score": "0.60517645",
"text": "def create\n @tag = Tag.new(params[:tag])\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to @tag, notice: 'Tag dodany do bazy tagów' }\n format.json { render json: @tag, status: :created, location: @tag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a41ea5264028f3f96cd60c713479abaa",
"score": "0.6044655",
"text": "def create\n @tag = Tag.new(params[:tag])\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to tags_url, :notice => 'Tag was successfully created.' }\n format.json { render :json => @tag, :status => :created, :location => @tag }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e58a59901d51770b7668e86c91c4700",
"score": "0.6024043",
"text": "def tag_params\n params.require(:tag).permit(:tag)\n end",
"title": ""
},
{
"docid": "9227c0f7a900c743cfa502460d9ca527",
"score": "0.6012319",
"text": "def post_params\n params.require(:post).permit(:title, :body, :category_id, :comment_id, tag_ids: [])\n end",
"title": ""
},
{
"docid": "38f8216c2f178ee8d390a69fad39459b",
"score": "0.59931535",
"text": "def tag_params\n params.require(:tag).permit(:post_id, :sharer,:user_id)\n end",
"title": ""
},
{
"docid": "930f3c817aeb6d4410cf6657d8d3c59e",
"score": "0.5962435",
"text": "def create\n @blog = Blog.create(blog_params)\n params[:tags][:tag_id].each do |p|\n @tagging = Tagging.create(tag_id: p.to_i, blog_id: @blog.id)\n end\n respond_to do |format|\n\n format.html { redirect_to @blog, notice: 'Blog was successfully created.' }\n format.json { render :show, status: :created, location: @blog }\n\n end\nend",
"title": ""
},
{
"docid": "6d13e7b38ca72e32cadcf0dc8bc85635",
"score": "0.59503293",
"text": "def create\n if params[\"theme\"].eql? \"Existing Tags\"\n @temp = Tagg.find(params[:tagg][:id])\n params[:tagg][:name] = @temp.name\n end\n\n @tagg = Tagg.new(params[:tagg])\n @tagg.post_id = params[\"post_id\"]\n @post = Post.find(params[\"post_id\"])\n\n\n respond_to do |format|\n @arr = Tagg.where( \"post_id = ? AND name = ?\", params[\"post_id\"], params[:tagg][:name] )\n if @arr.empty?\n if @tagg.save\n format.html { redirect_to @post, notice: 'Tag was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tagg.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to @post, notice: 'Tag already exists.' }\n format.json { render json: @post, status: :created, location: @post }\n end\n end\n end",
"title": ""
},
{
"docid": "d28962b9761d063083a931264cdb3cfe",
"score": "0.59501314",
"text": "def create\n @tag = Tag.new(tag_params)\n render json: @tag.errors unless @tag.save\n end",
"title": ""
},
{
"docid": "2e340df039dba941bd3f252671be1861",
"score": "0.59497654",
"text": "def tag_params\n params.fetch(:tag, {}).permit(:name, tag_ids: [])\n end",
"title": ""
},
{
"docid": "3dde1cbce5f24d91d6953b0464669873",
"score": "0.5945732",
"text": "def create\n @tag = Tag.new(params[:tag])\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to @tag, :notice => 'Tag was successfully created.' }\n format.json { render :json => @tag, :status => :created, :location => @tag }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8c0602cb7bbd7cf40df769aa788228c",
"score": "0.5942979",
"text": "def tag_params\n params.require(:tag).permit(:id, :name, :description)\n end",
"title": ""
},
{
"docid": "4701ebee839c6c24f520531d96222c99",
"score": "0.59379584",
"text": "def post_tags\n posts.map do |e|\n yaml = YAML::load_file(e)\n [e, yaml['tags']]\n end\n end",
"title": ""
},
{
"docid": "c7b137457ff4a1234e53ca16f1319acb",
"score": "0.5933831",
"text": "def tags_params\n params.require(:tag).permit(:name)\n end",
"title": ""
},
{
"docid": "1bc148db70fa94a2103857c88786eb00",
"score": "0.5933522",
"text": "def add_tag(tag)\n @api.post(\"#{@api.path}/List/#{@id}/Tag\", body: tag)\n end",
"title": ""
},
{
"docid": "7152bdf3ec5799c67c51b0d4f21fe72c",
"score": "0.5932106",
"text": "def post_params\n\t params.require(:post).permit(:title, :body, :tags)\n\tend",
"title": ""
},
{
"docid": "7152bdf3ec5799c67c51b0d4f21fe72c",
"score": "0.5932106",
"text": "def post_params\n\t params.require(:post).permit(:title, :body, :tags)\n\tend",
"title": ""
},
{
"docid": "3bc35dcc4a6bb1f5145e21cff45bfe45",
"score": "0.59309787",
"text": "def post_v1_tags_with_http_info(body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TagApi.post_v1_tags ...'\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling TagApi.post_v1_tags\"\n end\n # resource path\n local_var_path = '/v1/tags'\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(body)\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 => 'SetTagsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TagApi#post_v1_tags\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7cbf95f06c0a89788b29a47ad0e8a866",
"score": "0.5917466",
"text": "def create\n @tag = Tag.new(params[:tag])\n\n if @tag.save\n render json: JSON.parse(@tag.to_json)\n else\n render json: JSON.parse(@tag.errors.to_json)\n end\n end",
"title": ""
},
{
"docid": "3e23ddbe51b6539421bdc5df2393fe88",
"score": "0.5914444",
"text": "def tag_params\n params.require(:tag).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "96eb6a93b7b2e7c64a3e9e744a9fe768",
"score": "0.5910856",
"text": "def topology_tag_post(opts = {})\n data, _status_code, _headers = topology_tag_post_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "caf32619c90fc9239e8d8ca27d569ba3",
"score": "0.5908132",
"text": "def post_params\n params.require(:post).permit(:author, :title, :body, :tags_string)\n end",
"title": ""
},
{
"docid": "28ac19a6f9e5741978f9d6f704e37b14",
"score": "0.59049314",
"text": "def post\n \"\n desc 'create #{resource.singularize}' do\n tags %w[#{resource.singularize}]\n end\n params do\n # TODO: specify the parameters\n end\n post do\n # your code goes here\n end\"\n end",
"title": ""
},
{
"docid": "39bd45c5d8627b2dc2fc93f1b32db4e6",
"score": "0.5901616",
"text": "def post_params\n params.require(:post).permit(:title, :tags, :body)\n end",
"title": ""
},
{
"docid": "894e5817865ef2984b26ebf1dbf66976",
"score": "0.58972454",
"text": "def create\n tag = Tag.new(params.permit(:name))\n \n if tag.save\n render json: tag, status: :created\n else\n render json: tag.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "93fb90098d6553ed15eb9e164ca0cf77",
"score": "0.58946437",
"text": "def create\n\t\tparams[:blog_post][:tags] = params[:blog_post][:tags].split(',').map(&:strip)\n\t\t@blog_post = BlogPost.new(blog_post_params)\n respond_to do |format|\n if @blog_post.save\n format.html { redirect_to @blog_post, notice: 'Blog post was successfully created.' }\n format.json { render :show, status: :created, location: @blog_post }\n else\n format.html { render :new }\n format.json { render json: @blog_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66535023e9db027657cf0cb1426e67e6",
"score": "0.58946174",
"text": "def create\n @question = Question.new(question_params)\n @question.user_id = current_user.id\n @tags = params[:tags].split(',')\n @tagged = []\n\n\n respond_to do |format|\n if @question.save\n @activity = Activity.create(user_id: current_user.id, activity_type: 'Create', target_type: 'Question', target_id: @question.id)\n for tag in @tags\n if !tag.blank?\n @tag = Tag.where(title: tag).first\n if @tag.blank?\n @tag = Tag.create(title: tag, user_id: current_user.id)\n end\n @tagging = Tagging.create(taggable_id: @question.id, taggable_type: 'Question', tag_id: @tag.id)\n end\n end\n format.html { redirect_to \"/questions?question_id=#{@question.id}\", notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79a8dfda7e04bd0310ae9cab7f78bca3",
"score": "0.58834946",
"text": "def tag_params\r\n params.require(:tag).permit(:tag, :task_id)\r\n end",
"title": ""
},
{
"docid": "d6b8624f684044d896a1c7c4171410bf",
"score": "0.5882976",
"text": "def create\n @poem = Poem.new(poem_params)\n @poem.user = current_user\n\n if params[:tags_id].present?\n arr = params[:tags_id].split(',')\n @poem.tags = Tag.find(arr)\n end\n\n respond_to do |format|\n if @poem.save\n format.html { redirect_to @poem, notice: 'Poem was successfully created.' }\n format.json { render :show, status: :created, location: @poem }\n else\n format.html { render :new }\n format.json { render json: @poem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec0f15faa3c89e23d421223a3fb82c1b",
"score": "0.5882626",
"text": "def create\n @api_tag = Api::Tag.new(params[:api_tag])\n\n respond_to do |format|\n if @api_tag.save\n format.html { redirect_to @api_tag, notice: 'Tag was successfully created.' }\n format.json { render json: @api_tag, status: :created, location: @api_tag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @api_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9786766d23104ba7fda9b116ca2d4ad2",
"score": "0.5881074",
"text": "def create\n @joke = Joke.new(params[:joke].except(:tags))\n str_tags = params[:joke][:tags].split(',')\n @tags = str_tags.map {|tag_name|\n Tag.find_or_create_by_name(tag_name)\n }\n @joke.user = current_user\n @joke.tags = @tags\n \n respond_to do |format|\n if @joke.save\n format.html { redirect_to @joke, :notice => 'Joke was successfully created.' }\n format.json { render :json => @joke, :status => :created, :location => @joke }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @joke.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2cb8b7e9dc4c2c26e980b3c4d849f594",
"score": "0.5879889",
"text": "def tag_params\n params.require(:tag).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "9e96b06964b26c0cb2677f62b0a08bdc",
"score": "0.5877695",
"text": "def create\n @tags_of_novel = TagsOfNovel.new(params[:tags_of_novel])\n\n respond_to do |format|\n if @tags_of_novel.save\n format.html { redirect_to @tags_of_novel, notice: 'Tags of novel was successfully created.' }\n format.json { render json: @tags_of_novel, status: :created, location: @tags_of_novel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tags_of_novel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc41754effabde1745ac2e3efbdf589b",
"score": "0.58731264",
"text": "def tags\n @tags = ActsAsTaggableOn::Tag.where(\"tags.name LIKE ?\", \"%#{params[:q]}%\") \n #@tags = Node.tag_counts(:limit => 50, :order => \"count desc\")\n #@tags = Node.tag_counts_on(:tag, :limit => 50, :order => \"count desc\")\n @out = @tags.map{|b| {:id => b.id, :name => b.name }}\n \n\n \n respond_to do |format|\n format.json { render :json => @out }\n end\n\n end",
"title": ""
},
{
"docid": "bd3a1ee643a75ae10e11cc7270f8a8ae",
"score": "0.5872238",
"text": "def create_tag(recipe_id, tags)\n\t\t\t\tdestroy_tags = RecipeTag.where(recipe_id: recipe_id)\n\t\t\t\tif !destroy_tags.blank? \n\t\t\t\t\tdestroy_tags.delete_all\n\t\t\t\tend\n\t\t\t\ttags.each do |recipe_tag|\n\t\t\t\t\ttag = RecipeTag.new\n\t\t\t\t\ttag.recipe_id = recipe_id\n\t\t\t\t\ttag.tag = recipe_tag\n\t\t\t\t\ttag.save!\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "22138ad45ab3cab2bed5258d8bed46c7",
"score": "0.5868464",
"text": "def tag_params\n params.require(:tag).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "07716103c24a8878284f7d58dc6a22d8",
"score": "0.58639944",
"text": "def add_tag\n url = Url.find_by(id: params[:id])\n tag = Tag.find_by(name: params[:tag])\n if tag\n ## TODO: handle tag with url in backend\n # if not url.tags.where(:tag_id => tag.id).any?\n # url.tags << tag\n # end\n url.tags << tag\n else\n tag = Tag.new(name: params[:tag])\n url.tags << tag\n end\n render json: {code: 200, tags: url.tags}\n end",
"title": ""
},
{
"docid": "ce2755dd7e4db8c942baea3b55a23b97",
"score": "0.5863129",
"text": "def post_params\n params.require(:post).permit(:title, :description, :body, :tags)\n end",
"title": ""
},
{
"docid": "fb0014ff6d52a6373fcc01e05ac7e292",
"score": "0.5861403",
"text": "def create_tags(tags)\n tags.each do |tag_name|\n self.tags.create!(name: tag_name.downcase) unless self.tags.find_by(name: tag_name.downcase)\n end\n end",
"title": ""
},
{
"docid": "7106b2e039207e4bf28a1cf66d8aa924",
"score": "0.5858038",
"text": "def tag_params\n params.require(:tag).permit(:tagname)\n end",
"title": ""
},
{
"docid": "b4d876f913f6ea487f7fd1b3f5616e15",
"score": "0.5855186",
"text": "def add_tags(tags)\n rsp = @flickr.send_request('flickr.photos.addTags', {:photo_id => self.id, :tags => tags}, :post)\n true\n end",
"title": ""
},
{
"docid": "da8cfbb1d881bd1caf9dd889cc896829",
"score": "0.5849964",
"text": "def tag_params\n params.require(:tag).permit(:name, :meta_tag_id)\n end",
"title": ""
},
{
"docid": "7ab86058b269a229dd7d55bfc0987a44",
"score": "0.5846521",
"text": "def tag\n params.require(:tag).permit(:example_id, :tag)\n end",
"title": ""
},
{
"docid": "b7d550dc4d6b5389f3d41d3194d54fa7",
"score": "0.58445215",
"text": "def create\n name_normalized = ActsAsTaggableOn::Tag.normalize(params['name'])\n\n if name_normalized.nil? || name_normalized.empty?\n render :nothing => true, :status => 403\n else\n @tag = ActsAsTaggableOn::Tag.find_or_create_by_name(name_normalized)\n @tag_following = current_user.tag_followings.new(:tag_id => @tag.id)\n\n if @tag_following.save\n render :json => @tag.to_json, :status => 201\n else\n render :nothing => true, :status => 403\n end\n end\n end",
"title": ""
},
{
"docid": "718604023a28b8cc477aabe833a31dbe",
"score": "0.584251",
"text": "def posts_by_tags(tags, page = 1, limit = options[:limits][:per_page])\n tags = clean_tags(tags)\n posts_url = self.class::OLD_API ? 'post.json' : 'posts.json'\n do_request(posts_url, tags: tags, page: page, limit: limit)\n end",
"title": ""
},
{
"docid": "2cbe031b02aca5ca04660559eb7ae876",
"score": "0.58353657",
"text": "def create\n @tag = Tag.new(params[:tag])\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to @tag, notice: 'Tag was successfully created.' }\n format.json { render json: @tag, status: :created, location: @tag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
ca6e3d546136dc7386c506539fcdbca4
|
processes a tests/document/context node
|
[
{
"docid": "0949079c7e3739ba98fe6598c1dc0604",
"score": "0.65778375",
"text": "def process_context(doc, context)\n test_context = XPath.match(doc, context.attributes[\"select\"])\n namespaces = context.namespaces\n namespaces.delete(\"var\")\n namespaces = nil if namespaces.empty?\n variables = {}\n var_namespace = \"http://jaxen.org/test-harness/var\"\n XPath.each(context,\n \"@*[namespace-uri() = '#{var_namespace}']\") do |attribute|\n variables[attribute.name] = attribute.value\n end\n XPath.each(context, \"valueOf\") do |value|\n process_value_of(test_context, variables, namespaces, value)\n end\n XPath.each(context,\n \"test[not(@exception) or (@exception != 'true')]\") do |test|\n process_nominal_test(test_context, variables, namespaces, test)\n end\n XPath.each(context,\n \"test[@exception = 'true']\") do |test|\n process_exceptional_test(test_context, variables, namespaces, test)\n end\n end",
"title": ""
}
] |
[
{
"docid": "fc7289786d45dca93a3fbe6abc22abf0",
"score": "0.66184783",
"text": "def eval_context(context, node); end",
"title": ""
},
{
"docid": "42ec39b6be6c181833e74c9c8e5a76f9",
"score": "0.6292433",
"text": "def context(nodes, &block); end",
"title": ""
},
{
"docid": "9948feeea005b9240dcf3856f17dc4c4",
"score": "0.6093152",
"text": "def process\n title = statement.parameters.first.jump(:string_content).source\n\n # nest rspec contexts\n # root context are placed inside RSPEC_NAMESPACE,\n # so that they will be grouped in the docs namespace list\n if owner.is_a? YARD::CodeObjects::RSpec::Context\n context_owner = owner\n else\n context_owner = YARD::CodeObjects::RSpec::RSPEC_NAMESPACE\n end\n\n object = YARD::CodeObjects::RSpec::Context.new(context_owner,title) do |context|\n context.add_file(statement.file,statement.line)\n end\n register(object)\n parse_block(statement.last.last, owner: object)\n end",
"title": ""
},
{
"docid": "110b79e4e80f8056dd25d2c40484c36b",
"score": "0.6080702",
"text": "def process_child_nodes(node); end",
"title": ""
},
{
"docid": "8f135270219ac60b1dacec1ed5450e29",
"score": "0.6040847",
"text": "def process(node)\n return node unless node.is_a?(Parser::AST::Node)\n\n process_node(node)\n end",
"title": ""
},
{
"docid": "b4ccf71aa040bac798d10a72acded3d8",
"score": "0.60407287",
"text": "def process_node(node)\n method(:process).super_method.call(node)\n end",
"title": ""
},
{
"docid": "f1995042a00d963c020179dcea6f57bc",
"score": "0.5869277",
"text": "def _test_text ; process_test_case(\"text\") ; end",
"title": ""
},
{
"docid": "785644e85e75d538693949c90fa6eeb2",
"score": "0.5785384",
"text": "def parse_context; end",
"title": ""
},
{
"docid": "785644e85e75d538693949c90fa6eeb2",
"score": "0.5785384",
"text": "def parse_context; end",
"title": ""
},
{
"docid": "4d25235164120c5450849754f491f3d5",
"score": "0.5777811",
"text": "def node\n @context.node\n end",
"title": ""
},
{
"docid": "70776ac0a9e15833471ba6bfd073ce7e",
"score": "0.5704987",
"text": "def process_node(node, process_text)\n node_text = ''\n if node.element?\n case node.node_name\n when 'p', 'div'\n node_text.concat(process_paragraph_node(node))\n when 'span'\n node_text.concat(process_span_node(node))\n when 'h1','h2','h3','h4','h5','h6','h7','h8','h9'\n node_text.concat(process_header_node(node))\n when 'b', 'strong'\n node_text.concat(process_bold_node(node))\n when 'i', 'em'\n node_text.concat(process_italic_node(node))\n when 'u'\n node_text.concat(process_underline_node(node))\n when 'strike'\n node_text.concat(process_strike_node(node))\n when 'br'\n node_text.concat(process_line_break_node(node))\n when 'hr'\n node_text.concat(process_hrule_node(node))\n when 'table'\n node_text.concat(process_table_node(node))\n when 'tr'\n node_text.concat(process_table_row_node(node))\n when 'td'\n node_text.concat(process_table_data_node(node))\n when 'ul'\n node_text.concat(process_list_node(node, '*'))\n when 'ol'\n node_text.concat(process_list_node(node, '#'))\n when 'li'\n node_text.concat(process_list_item_node(node))\n when 'img'\n node_text.concat(process_image_node(node))\n when 'a'\n node_text.concat(process_link_node(node))\n else\n node.children.each {|n| node_text.concat(process_node(n, process_text))}\n end\n elsif process_text and node.text?\n node_text.concat(process_text_node(node))\n else\n node.children.each {|n| node_text.concat(process_node(n, process_text))}\n end\n node_text\n end",
"title": ""
},
{
"docid": "f5bdfd5ad2004b1d46f9bbcb12fd6db0",
"score": "0.5695387",
"text": "def node\n run_context.node\n end",
"title": ""
},
{
"docid": "f5bdfd5ad2004b1d46f9bbcb12fd6db0",
"score": "0.5695387",
"text": "def node\n run_context.node\n end",
"title": ""
},
{
"docid": "f490c52c6890b07f3335553c8ed2c2f0",
"score": "0.56943136",
"text": "def test_0\n dotest(\n '''<process-definition name=\"con\" revision=\"0\">\n <concurrence>\n <print>a</print>\n <print>b</print>\n </concurrence>\n</process-definition>''',\n [ '''a\nb''',\n '''b\na'''\n ])\n end",
"title": ""
},
{
"docid": "1a9c619986cd368ca4009b06a52c14d6",
"score": "0.5676203",
"text": "def on_type_test_processing_instruction(ast_node, context)\n nodes = XML::NodeSet.new\n\n context.each do |node|\n nodes << node if node.is_a?(XML::ProcessingInstruction)\n end\n\n return nodes\n end",
"title": ""
},
{
"docid": "40510fce914da01847d42d78c34acad0",
"score": "0.56738317",
"text": "def run(node)\n process(node)\n end",
"title": ""
},
{
"docid": "783af774e400a70200c6517048cd7452",
"score": "0.5666307",
"text": "def create_test_node\n parent = @root\n File.open(@file_name, \"r\") do |f|\n f.each_with_index do |line, index|\n \n if index == 0\n @stack = []\n @stack.push(@root)\n end\n line.chomp!\n next if line.empty? || line.nil?\n prelim_whitespace = 0\n line.each_byte do |byte|\n break if byte != 32\n prelim_whitespace += 1\n end\n stripped_line = line.strip\n next if stripped_line.nil? || stripped_line.empty?\n token_line = stripped_line.split\n #accounts for Cucumber colons\n first_token = token_line[0].gsub(/:/,' ').downcase.strip\n last_token = token_line[-1].strip\n\n case stripped_line\n when /^context/, /^describe/, /^Feature:/, /^Feature/, /^RSpec.describe/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^it/, /^Scenario/, /^Scenario:/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n if stripped_line =~ /do$/\n @stack.push(node)\n end\n when /^def/, /do$/, /do.*$/\n node = Tree.new(first_token, prelim_whitespace)\n node.file_name = @file_name\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^end/\n @stack.pop\n else\n end\n end\n end\n @root\n end",
"title": ""
},
{
"docid": "783af774e400a70200c6517048cd7452",
"score": "0.5666307",
"text": "def create_test_node\n parent = @root\n File.open(@file_name, \"r\") do |f|\n f.each_with_index do |line, index|\n \n if index == 0\n @stack = []\n @stack.push(@root)\n end\n line.chomp!\n next if line.empty? || line.nil?\n prelim_whitespace = 0\n line.each_byte do |byte|\n break if byte != 32\n prelim_whitespace += 1\n end\n stripped_line = line.strip\n next if stripped_line.nil? || stripped_line.empty?\n token_line = stripped_line.split\n #accounts for Cucumber colons\n first_token = token_line[0].gsub(/:/,' ').downcase.strip\n last_token = token_line[-1].strip\n\n case stripped_line\n when /^context/, /^describe/, /^Feature:/, /^Feature/, /^RSpec.describe/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^it/, /^Scenario/, /^Scenario:/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n if stripped_line =~ /do$/\n @stack.push(node)\n end\n when /^def/, /do$/, /do.*$/\n node = Tree.new(first_token, prelim_whitespace)\n node.file_name = @file_name\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^end/\n @stack.pop\n else\n end\n end\n end\n @root\n end",
"title": ""
},
{
"docid": "3de4b284e789fbfe688ca5e1ede39539",
"score": "0.5629176",
"text": "def on_path(ast_node, context)\n nodes = XML::NodeSet.new\n\n ast_node.children.each do |test|\n nodes = process(test, context)\n\n if nodes.empty?\n break\n else\n context = nodes\n end\n end\n\n return nodes\n end",
"title": ""
},
{
"docid": "99a69e9bad8817c23aa088d62b35101d",
"score": "0.56264263",
"text": "def process!(document); end",
"title": ""
},
{
"docid": "226afdbb83dea4fac02bae53b5a1d3cb",
"score": "0.5622234",
"text": "def process_xml(string)\n xml_processor_helper(create_document(string))\nend",
"title": ""
},
{
"docid": "58139e4458d69940ca10a4f56ab540d9",
"score": "0.56160647",
"text": "def tests(*args)\n @xml.xpath('./tests/test').collect do |xml_test|\n content = if xml_test.at_xpath('./Paragraph')\n xml_test.at_xpath('./Paragraph').text.split(\"\\n\").collect(&:strip).reject{|line| line.empty?}.join(\"\\n\")\n else\n 'n/a'\n end\n {\n id: xml_test.attributes['id'],\n status: xml_test.attributes['status'],\n content: content\n }\n end\n end",
"title": ""
},
{
"docid": "fdcfb057d71e65eeb859f8c022e83489",
"score": "0.5613242",
"text": "def on_test(ast_node, context)\n nodes = XML::NodeSet.new\n\n context.each do |xml_node|\n nodes << xml_node if node_matches?(xml_node, ast_node)\n end\n\n return nodes\n end",
"title": ""
},
{
"docid": "2dc06979516a607cb20e92d6cbe1ee1f",
"score": "0.55567425",
"text": "def on_test_result(node)\n id, passed, *nodes = *node\n if (passed && !failed_test_ids.include?(id)) ||\n (!passed && failed_test_ids.include?(id))\n process_all(nodes)\n end\n end",
"title": ""
},
{
"docid": "0834022ca953d2667aed33378192a477",
"score": "0.54945815",
"text": "def process(content, context, *args)\n document = Nokogiri::XML(content)\n Processor.process(document, context, *args).to_xml(indent: 0, save_with: 0)\n end",
"title": ""
},
{
"docid": "f8b19898e1c5f1f8b35ff34722b89d71",
"score": "0.54925054",
"text": "def process(parser)\n end",
"title": ""
},
{
"docid": "7299a49f7cce61b2f978b6f4e373d9e9",
"score": "0.5492032",
"text": "def file_context(name, file_name = name, &block)\n context \"for #{name}\" do\n include_context 'Dsl_file', file_name\n\n # Yield to the block to add more tests.\n class_exec(&block) if block\n end\nend",
"title": ""
},
{
"docid": "7299a49f7cce61b2f978b6f4e373d9e9",
"score": "0.5492032",
"text": "def file_context(name, file_name = name, &block)\n context \"for #{name}\" do\n include_context 'Dsl_file', file_name\n\n # Yield to the block to add more tests.\n class_exec(&block) if block\n end\nend",
"title": ""
},
{
"docid": "f77483d0de724adf639b8865992ab946",
"score": "0.54800284",
"text": "def node\n run_context.node\n end",
"title": ""
},
{
"docid": "bc59bdb5d3867b70510d6d31ddefd0ad",
"score": "0.54644096",
"text": "def test_access\n\tdoc = NQXML::TreeParser.new(@rsrc.xml).document\n\n\troot = doc.rootNode\n\tassert_nil(root.parent)\n\tassert_equal('outer', root.entity.name)\n \tassert_equal(8, root.children.length)\n\tassert_instance_of(NQXML::Text, root.firstChild().entity)\n\tassert_instance_of(NQXML::Text, root.lastChild().entity)\n\n\tnode = root.firstChild().nextSibling()\n\tassert_equal(node.parent, root)\n\tassert_equal('<simpleTag>', node.entity.source)\n\tassert_equal(1, node.children.length)\n\tassert_equal('text', node.firstChild().entity.text)\n end",
"title": ""
},
{
"docid": "a3b70ca89e5cb0a37fc64eecbdaa5b00",
"score": "0.5461888",
"text": "def on_type_test_node(ast_node, context)\n nodes = XML::NodeSet.new\n\n context.each do |node|\n if node.is_a?(XML::Node) or node.is_a?(XML::Document)\n nodes << node\n end\n end\n\n return nodes\n end",
"title": ""
},
{
"docid": "e1ef73b02c100a6d5f17f7142e721419",
"score": "0.5457114",
"text": "def process(ast_node, context)\n handler = \"on_#{ast_node.type}\"\n\n return send(handler, ast_node, context)\n end",
"title": ""
},
{
"docid": "90752fb52df341006af7f336384988d6",
"score": "0.54019886",
"text": "def test_documentcreateprocessinginstruction\n doc = nil\n newPINode = nil\n piValue = nil\n piName = nil\n piType = nil\n doc = load_document(\"staff\", true)\n newPINode = doc.createProcessingInstruction(\"TESTPI\", \"This is a new PI node\")\n assert_not_nil(newPINode, \"createdPINotNull\")\n piName = newPINode.nodeName()\n assert_equal(\"TESTPI\", piName, \"name\")\n piValue = newPINode.nodeValue()\n assert_equal(\"This is a new PI node\", piValue, \"value\")\n piType = newPINode.nodeType()\n assert_equal(7, piType, \"type\")\n \n end",
"title": ""
},
{
"docid": "8cd4204418e3219039f8646157a8822c",
"score": "0.53985023",
"text": "def for_node; end",
"title": ""
},
{
"docid": "bbd7a664c93ad2787cdcee420b66d984",
"score": "0.5376844",
"text": "def process(node)\n return if node.nil?\n return node unless node.respond_to?(:to_ast)\n\n node = node.to_ast\n\n # Invoke a specific handler\n on_handler = :\"on_#{node.type}\"\n if respond_to? on_handler\n new_node = send on_handler, node\n else\n new_node = handler_missing(node)\n end\n\n new_node if new_node\n end",
"title": ""
},
{
"docid": "710a1658073ea28621a1a6c99debbefc",
"score": "0.53713",
"text": "def parse\n\t\t\tGlyph.info \"Parsing: #{@context[:source][:name]}\" if Glyph.debug? && @context[:info] && @context[:source][:name]\n\t\t\t@tree = @parser.parse\n\t\t\t@document = Glyph::Document.new @tree, @context\n\t\t\t@document.inherit_from @context[:document] if @context[:document]\n\t\t\t@tree\n\t\tend",
"title": ""
},
{
"docid": "e1cb72a94b285f8b0eae51b5d8afa780",
"score": "0.53629094",
"text": "def on_type_test_text(ast_node, context)\n nodes = XML::NodeSet.new\n\n context.each do |node|\n nodes << node if node.is_a?(XML::Text)\n end\n\n return nodes\n end",
"title": ""
},
{
"docid": "167c947b485099f9e1f6b4a510be0cad",
"score": "0.5290458",
"text": "def test_flatten_process1\r\n proc = @mymodel.node_list.add_node(1, 'proc1', PROCESS)\r\n \r\n assert_equal( { \"name\"=>\"proc1\", \"ident\"=>1, \"type\"=>\"process\",\r\n \"commentary\"=>\"\", \"description\"=>\"\", \"evidence\"=>\"undefined\" },\r\n proc.flatten_data)\r\n end",
"title": ""
},
{
"docid": "3b9b91d3facecd421c28533771e412bd",
"score": "0.52715516",
"text": "def test_participant\n dotest(\\\n'''<process-definition name=\"n\" revision=\"0\">\n <participant ref=\"test-alpha\" />\n</process-definition>''', \"test-alpha\")\n end",
"title": ""
},
{
"docid": "81d6e895745a5ed4daae9b6530be6d3e",
"score": "0.52399147",
"text": "def call(node); end",
"title": ""
},
{
"docid": "80dc74641f57505e468797b82c036b07",
"score": "0.5239304",
"text": "def before(node_or_tags); end",
"title": ""
},
{
"docid": "80dc74641f57505e468797b82c036b07",
"score": "0.5239304",
"text": "def before(node_or_tags); end",
"title": ""
},
{
"docid": "ec2871bfb518f5204fb652035a2cff1b",
"score": "0.5237964",
"text": "def process_nodes(html_nodes, properties); end",
"title": ""
},
{
"docid": "2c44f671d5bbcc666d92963499cf7ce7",
"score": "0.52090836",
"text": "def on_top_level_example_group(_node); end",
"title": ""
},
{
"docid": "c1f1bff06c2242f8b67a12620e20543a",
"score": "0.51995033",
"text": "def process_node(node)\n debug \"Process node: #{node}\"\n hook 'pre_node', node\n return if node.skipped?\n node.poll\n hook 'internal_post_node_poll', node\n hook 'post_node_poll', node\n return unless node.ready?\n ready_task = node.ready_task\n return unless ready_task\n ready_task.run\n hook 'post_node', node\n end",
"title": ""
},
{
"docid": "c2244bafba633ec312dd40740c3b5189",
"score": "0.5188825",
"text": "def visit_node(n); end",
"title": ""
},
{
"docid": "5989c9fea8213fafd5fd4c0ef7c432c3",
"score": "0.5183975",
"text": "def finish(path, document, node)\n end",
"title": ""
},
{
"docid": "33e7ca345ebb63e6ef39507949d1fb1e",
"score": "0.5172135",
"text": "def test_flatten_process2\r\n proc = @mymodel.node_list.add_node(1, 'proc1', PROCESS) \r\n proc.commentary='com'\r\n proc.description='dsc' \r\n proc.evidence=0.23\r\n \r\n assert_equal( { \"name\"=>\"proc1\", \"ident\"=>1, \"type\"=>\"process\",\r\n \"commentary\"=>\"com\", \"description\"=>\"dsc\", \"evidence\"=>[0.23, 0.23] },\r\n proc.flatten_data)\r\n end",
"title": ""
},
{
"docid": "6f5d4fc7bee47daf118f3620fc72e7f1",
"score": "0.51691926",
"text": "def xml_processor_helper(document)\n document.each_element do |element|\n if TAGS.include?(element.name)\n @@LANGS.each do |lang| \n temp_doc = create_document(\"<metadata name='#{element.name}' xml:lang='#{lang}'>#{TEXT}</metadata>\\n\")\n element.parent.add(temp_doc) unless element_exists(element.parent,element.name,lang) \n end\n end\n process_child(element)\n end\n document\nend",
"title": ""
},
{
"docid": "0e2a89dcad58bb5a5fe9365fa1195928",
"score": "0.51630163",
"text": "def process\n #\n # Capture the name of the shared examples, which is the first string parameter\n # \n # @example\n # \n # shared_examples \"a collection\" do # => \"a collection\"\n # \n name = statement.parameters.first.jump(:string_content).source\n\n name = \"EMPTY STRING\" if name.nil? || name == \"\"\n\n log.debug \"Creating [Shared Example]: #{name}\"\n\n #\n # The shared context will be a child of the RSpec Namespace\n # \n \n shared_examples_owner = YARD::CodeObjects::RSpec::RSPEC_NAMESPACE\n \n #\n # Create the shared context object as a child of the Rspec Namespace\n #\n shared_examples_object = YARD::CodeObjects::RSpec::SharedExample.new(shared_examples_owner,name) do |examples|\n examples.value = name\n examples.add_file(statement.file,statement.line)\n end\n \n parse_block(statement.last.last, owner: shared_examples_object)\n rescue YARD::Handlers::NamespaceMissingError\n end",
"title": ""
},
{
"docid": "06ff98785b68cedf8bd2c71594e4c8c9",
"score": "0.5162491",
"text": "def test_load_loads_document\n end",
"title": ""
},
{
"docid": "9e046eb24d5071a01b19ee2d1f702b82",
"score": "0.5142216",
"text": "def _test_message ; process_test_case(\"message\") ; end",
"title": ""
},
{
"docid": "a265882a608079a89761ff23630457e1",
"score": "0.5108557",
"text": "def post_process(doc)\n doc\n end",
"title": ""
},
{
"docid": "3d025eddce4cd1f2a22d9a075d6879ab",
"score": "0.51042956",
"text": "def process\n # Retrieve the currently-active statement and its parameters\n stmt = self.statement\n params = stmt.parameters\n\n # Move the AST pointer to the first parameter that is either a string or\n # an identifier (e.g., inner symbol)\n name = params.first.jump(:tstring_content, :ident).source\n\n # Create a new method object in the namespace with the correct name\n object = YARD::CodeObjects::MethodObject.new(self.namespace, \"test_#{name}\")\n\n # Parse the block between the `test do` and `end` and attribute it to the\n # method object above\n self.parse_block(stmt.last.last, owner: object)\n\n # Annotate it as a dynamic object with custom attributes\n object.dynamic = true\n\n # The options s-exp looks like:\n #\n # s(s(:assoc, s(:label, 'Key1'), s(...)),\n # s(:assoc, s(:label, 'Key2'), s(...))\n # )\n #\n # if one exists (nil otherwise)\n if opts_sexp = params[1]\n object['test_case_attrs'] = opts_sexp.inject(Hash.new) do |hsh, kv|\n key_sexp, value_sexp = kv.jump(:assoc)\n\n if (string_sexp = value_sexp.jump(:tstring_content)) && (string_sexp.type == :tstring_content)\n hsh[key_sexp.first] = string_sexp.first\n elsif (array_sexp = value_sexp.jump(:array)) && (array_sexp.type == :array)\n hsh[key_sexp.first] = array_sexp.first.map { |sexp| sexp.jump(:tstring_content, :ident).first }\n else\n raise ArgumentError, \"Cannot parse and render: #{kv.inspect}\"\n end\n\n hsh\n end\n end\n\n # Register the object\n self.register(object)\n end",
"title": ""
},
{
"docid": "3c4951c2b1722e7748c37ddbdaad3fef",
"score": "0.50995874",
"text": "def test_for_node\n raise \"Failing test #{@name} for #{@node}\" if Node.fail_for.key?(@name) && Node.fail_for[@name].include?(@node)\n\n sleep_time = Node.sleeps.dig(@name, @node)\n sleep sleep_time unless sleep_time.nil?\n Node.runs << [@name, @node]\n end",
"title": ""
},
{
"docid": "62887b1a88c1730ad2f1988211585dfc",
"score": "0.50974196",
"text": "def test_class\n while @traversal.continue_generation?\n yield produce_test \n end\n end",
"title": ""
},
{
"docid": "902b8fadbe630820e316923cd5489a5f",
"score": "0.5096819",
"text": "def tests(context = {})\n run_context(context)\n end",
"title": ""
},
{
"docid": "c594c6a23ee708ba99ea657f3616af81",
"score": "0.50858295",
"text": "def open_node_context(finder, cont = {})\n sub_context = node_context_vars(finder).merge(cont)\n\n with_context(sub_context) do\n yield\n end\n end",
"title": ""
},
{
"docid": "bf6cc111a9a79e42b655fee161db6bc9",
"score": "0.5078277",
"text": "def from_node(node); end",
"title": ""
},
{
"docid": "81523e4d1feda08bad7c8bfec0674b3d",
"score": "0.5078019",
"text": "def create_csharp_test_node\n @stack = []\n @stack.push(@root)\n @test_case_stack = []\n csharp_regex = Regexp.union([/^namespace/, /^public/, /^\\[TestFixture\\]/, /^\\[Test\\]/, /^\\[TestCase/])\n original_file_string = File.read(@file_name)\n lines = original_file_string.split(\"\\n\")\n lines = lines.each do |line|\n line.gsub!(\"()\",\"\") \n line.gsub!(\";\",\"\")\n line.gsub!(\"async\",\"\") \n line.gsub!(\"Task\",\"\")\n line.gsub!(\"void\",\"\")\n line.gsub!(\"class\",\"\")\n line.strip!\n end\n\n relevant_lines_ary = lines.keep_if do |line|\n !csharp_regex.match(line).nil? && line != \"\"\n end\n relevant_lines_ary.each_cons(3) do |previous, current, nekst|\n first_token = current.split[0].strip\n previous_first_token = previous.split[0].strip\n if first_token == 'namespace'\n second_token = current.split[1].strip\n node = Tree.new(second_token)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = 'namespace'\n @stack.push(node)\n elsif first_token == \"[TestFixture]\"\n nekst_second_token = nekst.split[1].strip\n node = Tree.new(nekst_second_token)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = 'test_fixture'\n @stack.push(node)\n elsif first_token == \"[Test]\"\n nekst_second_token = nekst.split[1].strip\n node = Tree.new(nekst_second_token)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = 'test'\n @stack.push(node)\n elsif /^\\[TestCase/ =~ current \n first_token = first_token.gsub!(/[\\[\\]()]|TestCase/,\"\").strip\n node = Tree.new(first_token)\n node.file_name = @file_name\n node.structure_marker = 'test'\n @test_case_stack.push(node)\n if nekst && nekst.split[0]\n nekst_first_token = nekst.split[0].strip\n end\n if !(/^public/ =~ nekst_first_token)\n if nekst.split[1]\n nekst_second_token = nekst.split[1].strip\n end\n parent = Tree.new(nekst_second_token)\n parent.file_name = @file_name\n parent.structure_marker = 'test'\n parent_of_parent = fetch_parent(@stack, parent)\n parent.parent = parent_of_parent\n while !@test_case_stack.empty?\n test_case = @test_case_stack.pop\n parent.children << test_case\n test_case.parent = parent\n end\n end\n elsif( !(/^\\[TestCase/ =~ first_token) && (/^\\[TestCase/ =~ previous_first_token) )\n next\n else\n end\n end\n @root\n end",
"title": ""
},
{
"docid": "81523e4d1feda08bad7c8bfec0674b3d",
"score": "0.5078019",
"text": "def create_csharp_test_node\n @stack = []\n @stack.push(@root)\n @test_case_stack = []\n csharp_regex = Regexp.union([/^namespace/, /^public/, /^\\[TestFixture\\]/, /^\\[Test\\]/, /^\\[TestCase/])\n original_file_string = File.read(@file_name)\n lines = original_file_string.split(\"\\n\")\n lines = lines.each do |line|\n line.gsub!(\"()\",\"\") \n line.gsub!(\";\",\"\")\n line.gsub!(\"async\",\"\") \n line.gsub!(\"Task\",\"\")\n line.gsub!(\"void\",\"\")\n line.gsub!(\"class\",\"\")\n line.strip!\n end\n\n relevant_lines_ary = lines.keep_if do |line|\n !csharp_regex.match(line).nil? && line != \"\"\n end\n relevant_lines_ary.each_cons(3) do |previous, current, nekst|\n first_token = current.split[0].strip\n previous_first_token = previous.split[0].strip\n if first_token == 'namespace'\n second_token = current.split[1].strip\n node = Tree.new(second_token)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = 'namespace'\n @stack.push(node)\n elsif first_token == \"[TestFixture]\"\n nekst_second_token = nekst.split[1].strip\n node = Tree.new(nekst_second_token)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = 'test_fixture'\n @stack.push(node)\n elsif first_token == \"[Test]\"\n nekst_second_token = nekst.split[1].strip\n node = Tree.new(nekst_second_token)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = 'test'\n @stack.push(node)\n elsif /^\\[TestCase/ =~ current \n first_token = first_token.gsub!(/[\\[\\]()]|TestCase/,\"\").strip\n node = Tree.new(first_token)\n node.file_name = @file_name\n node.structure_marker = 'test'\n @test_case_stack.push(node)\n if nekst && nekst.split[0]\n nekst_first_token = nekst.split[0].strip\n end\n if !(/^public/ =~ nekst_first_token)\n if nekst.split[1]\n nekst_second_token = nekst.split[1].strip\n end\n parent = Tree.new(nekst_second_token)\n parent.file_name = @file_name\n parent.structure_marker = 'test'\n parent_of_parent = fetch_parent(@stack, parent)\n parent.parent = parent_of_parent\n while !@test_case_stack.empty?\n test_case = @test_case_stack.pop\n parent.children << test_case\n test_case.parent = parent\n end\n end\n elsif( !(/^\\[TestCase/ =~ first_token) && (/^\\[TestCase/ =~ previous_first_token) )\n next\n else\n end\n end\n @root\n end",
"title": ""
},
{
"docid": "51b80d90c544aecefa70e8bd30cfb150",
"score": "0.5071514",
"text": "def test_forget_0\n dotest(\n'<process-definition name=\"'+name_of_test+'''\" revision=\"0\">\n <sequence>\n <concurrence\n count=\"1\"\n >\n <forget>\n <print>a</print>\n </forget>\n <sequence>\n <sleep for=\"500\" />\n <print>b</print>\n </sequence>\n </concurrence>\n <print>c</print>\n </sequence>\n</process-definition>''',\n \"a\\nc\")\n end",
"title": ""
},
{
"docid": "0d81e3a927c1a85174da620312ccc93a",
"score": "0.50672626",
"text": "def traverseText(node, buf)\n return if node['meta'] == \"yes\" || node['index'] == \"no\"\n node.text? and buf << node.to_s.strip + \"\\n\"\n node.children.each { |child| traverseText(child, buf) }\nend",
"title": ""
},
{
"docid": "2ca14882d0c0c54df122965274bc4706",
"score": "0.5067045",
"text": "def process(node, xmlns: false)\n if node.fragment?\n process_fragment_node(node)\n elsif node.element?\n process_element_node(node, xmlns: xmlns)\n elsif node.text?\n process_text_node(node)\n else\n raise(MalformedTemplateError.new(\"unrecognized node type #{node.class}\", @name, node))\n end\n end",
"title": ""
},
{
"docid": "49143aa477f210e3860713692aa3ac42",
"score": "0.50550866",
"text": "def traverse(node, oid, tags)\n if node.terminal? or node.expression?\n node.source_text\n else\n if node.respond_to?(:condStub) and node.respond_to?(:cond)\n # Preserve opening parenthesis and whitespace before injecting code. This way \n # IF(test) becomes IF(piggly_cond(TAG, test)) instead of IFpiggly_cond(TAG, (test))\n pre, cond = node.cond.expr.text_value.match(/\\A(\\(?[\\t\\n\\r ]*)(.+)\\z/m).captures\n node.cond.source_text = \"\"\n\n tags << node.cond.tag(oid)\n\n node.condStub.source_text = \"#{pre}public.piggly_cond($PIGGLY$#{node.cond.tag_id}$PIGGLY$, (#{cond}))\"\n node.condStub.source_text << traverse(node.cond.tail, oid, tags) # preserve trailing whitespace\n end\n\n if node.respond_to?(:bodyStub)\n if node.respond_to?(:exitStub) and node.respond_to?(:cond)\n tags << node.body.tag(oid)\n tags << node.cond.tag(oid)\n\n # Hack to simulate a loop conditional statement in stmtForLoop and stmtLoop.\n # signal condition is true when body is executed, and false when exit stub is reached\n node.bodyStub.source_text = \"perform public.piggly_cond($PIGGLY$#{node.cond.tag_id}$PIGGLY$, true);#{node.indent(:bodySpace)}\"\n node.bodyStub.source_text << \"perform public.piggly_branch($PIGGLY$#{node.body.tag_id}$PIGGLY$);#{node.indent(:bodySpace)}\"\n\n if node.respond_to?(:doneStub)\n # Signal the end of an iteration was reached\n node.doneStub.source_text = \"#{node.indent(:bodySpace)}perform public.piggly_signal($PIGGLY$#{node.cond.tag_id}$PIGGLY$, $PIGGLY$@$PIGGLY$);\"\n node.doneStub.source_text << node.body.indent\n end\n\n # Signal the loop terminated\n node.exitStub.source_text = \"\\n#{node.indent}perform public.piggly_cond($PIGGLY$#{node.cond.tag_id}$PIGGLY$, false);\"\n elsif node.respond_to?(:body)\n # Unconditional branches (or blocks)\n # BEGIN ... END;\n # ... ELSE ... END;\n # CONTINUE label;\n # EXIT label;\n tags << node.body.tag(oid)\n node.bodyStub.source_text = \"perform public.piggly_branch($PIGGLY$#{node.body.tag_id}$PIGGLY$);#{node.indent(:bodySpace)}\"\n end\n end\n\n # Traverse children (in which we just injected code)\n node.elements.map{|e| traverse(e, oid, tags) }.join\n end\n end",
"title": ""
},
{
"docid": "c5440a976428a09c251045aab890c189",
"score": "0.50503045",
"text": "def test_single_node\n grammar = \"grammar T;\\n\" + \"options {output=AST;}\\n\" + \"a : ID ;\\n\" + \"ID : 'a'..'z'+ ;\\n\" + \"INT : '0'..'9'+;\\n\" + \"WS : (' '|'\\\\n') {$channel=HIDDEN;} ;\\n\"\n tree_grammar = \"tree grammar TP;\\n\" + \"options {ASTLabelType=CommonTree; output=template;}\\n\" + \"s : a {System.out.println($a.st);} ;\\n\" + \"a : ID -> template(x={$ID.text}) <<|<x>|>> ;\\n\"\n found = exec_tree_parser(\"T.g\", grammar, \"TParser\", \"TP.g\", tree_grammar, \"TP\", \"TLexer\", \"a\", \"s\", \"abc\")\n assert_equals(\"|abc|\\n\", found)\n end",
"title": ""
},
{
"docid": "26c656ab5bd6cf41906143afc6cb18b5",
"score": "0.5048892",
"text": "def process_block(line_buffer, test_number)\n if (@custom_processor && @custom_processor.class.method_defined?(:process_testcase))\n @custom_processor.process_testcase line_buffer\n else\n line_buffer\n end\n end",
"title": ""
},
{
"docid": "93537b6c1b47617cacecda917ebd6ec4",
"score": "0.5048018",
"text": "def testNormalWithKnownContent\n initTestCase do\n $Context[:WikiContent] = \"UnknownContent - Line 1\\n=== Current ===\\n\\nUnknownContent - Line 3\"\n $Context[:NewWikiContentRegExp] =\n Regexp.escape(\"UnknownContent - Line 1\\n=== Current ===\\n\\n* <code><small>[\") +\n '....-..-.. ..:..:..' +\n Regexp.escape(\"]</small></code> - Commit DummyCommitID by DummyCommitUser: DummyCommitComment\\nUnknownContent - Line 3\")\n execTest(\n 'DummyUserID',\n [\n 'BranchName',\n 'DummyCommitID',\n 'DummyCommitUser',\n 'DummyCommitComment'\n ]\n )\n end\n end",
"title": ""
},
{
"docid": "bb7ab3fedf55ad1946333ff97d7b4fa8",
"score": "0.50397676",
"text": "def rspec_test(nodes)\n node_manager.assert_known(nodes)\n for node in nodes\n node_manager.find(node).rspec_test\n end\n end",
"title": ""
},
{
"docid": "5a5083483f8215310fb7d3dd339103be",
"score": "0.5038259",
"text": "def compile\n Puppet[:strict_variables] = true\n Puppet[:strict] = :error\n\n # TRANSLATORS, \"For running script\" is not user facing\n Puppet.override( @context_overrides , \"For running script\") do\n\n #TRANSLATORS \"main\" is a function name and should not be translated\n result = Puppet::Util::Profiler.profile(_(\"Script: Evaluated main\"), [:script, :evaluate_main]) { evaluate_main }\n if block_given?\n yield self\n else\n result\n end\n end\n\n rescue Puppet::ParseErrorWithIssue => detail\n detail.node = node_name\n Puppet.log_exception(detail)\n raise\n rescue => detail\n message = \"#{detail} on node #{node_name}\"\n Puppet.log_exception(detail, message)\n raise Puppet::Error, message, detail.backtrace\n end",
"title": ""
},
{
"docid": "23e2d3bf1056f6fe1cae6764c21012fe",
"score": "0.5036439",
"text": "def returns_from(node); end",
"title": ""
},
{
"docid": "23e2d3bf1056f6fe1cae6764c21012fe",
"score": "0.5036439",
"text": "def returns_from(node); end",
"title": ""
},
{
"docid": "63c0aa16c7880d1d7a0b747ad00e2d70",
"score": "0.50336075",
"text": "def setup\n @html_parser = Hatemile::Util::Html::NokogiriLib::NokogiriHTMLDOMParser.new(\n \"<!DOCTYPE html>\n <html>\n <head>\n <title>HaTeMiLe Tests</title>\n <meta charset=\\\"UTF-8\\\" />\n </head>\n <body>\n <section>\n <header></header>\n <article>\n \\n\n </article>\n <footer><!-- Footer --></footer>\n </section>\n <span attribute=\\\"value\\\" data-attribute=\\\"custom_value\\\">\n <!-- Comment -->\n Text node\n <strong>Strong text</strong>\n <hr />\n </span>\n <div></div>\n <p>\n <del>Deleted text</del>\n </p>\n <table>\n <thead><tr>\n <th>Table header</th>\n </tr></thead>\n <tbody>\n <tr>\n <td>Table <ins>cell</ins></td>\n </tr>\n </tbody>\n <tfoot><!-- Table footer --></tfoot>\n </table>\n <ul>\n <li id=\\\"li-1\\\">1</li>\n <li id=\\\"li-3\\\">3</li>\n </ul>\n <ol>\n <li>1</li>\n <li>2</li>\n <li>3</li>\n <li>4</li>\n <li>5</li>\n </ol>\n #{ASIDE_CONTENT}\n <form>\n <label>\n Text:\n <input type=\\\"text\\\" name=\\\"number\\\" />\n </label>\n </form>\n <h1></h1>\n <h2></h2>\n </body>\n </html>\"\n )\n end",
"title": ""
},
{
"docid": "6a96af8e896a3c63b7feb0c4f1768f30",
"score": "0.50319034",
"text": "def parse(filename)\n file = File.open(filename, \"r\").readlines\n\n $root = Node.new('root')\n $context = $root\n\n file.each_with_index do |line, index|\n process_line(line, index) if line.match(/\\S/)\n end\n\n return $root\n\nend",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
},
{
"docid": "28591c192d02897f69d772480c5f7d11",
"score": "0.50307477",
"text": "def node; end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "48f5449044653179fa479c4059ca6903",
"score": "0.0",
"text": "def set_content\n @content = Content.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
2f2c103722a6785bebcce33b5cdd1fd2
|
a method to reverse complement a rich sequence
|
[
{
"docid": "cc4dca227ebe30fb25044b53379a3fdf",
"score": "0.62718636",
"text": "def reverse_complement_rich_sequence(path_to_sequence, sequence_format = nil, output_sequence_format = nil)\n biosequence = biosequence_from_file(path_to_sequence, sequence_format)\n biosequence.reverse_complement!\n\n # now to reverse complement the features\n reverse_complemented_features = Array.new\n sequence_length = biosequence.to_s.length\n source_feature = nil\n\n biosequence.features.each do |feature|\n location = feature.locations.locations.first\n if feature.feature == \"source\"\n source_feature = feature\n else\n new_start = sequence_length - location.to + 1\n new_end = sequence_length - location.from + 1\n location.from = new_start\n location.to = new_end\n location.strand *= -1 # reverse the strand\n\n feature_locations = feature.locations\n feature_locations.locations = [location]\n feature.position = feature_locations.to_s # the location of a feature is based on it's position string, not a Bio:Locations object which is created on the fly (why I have no idea!)\n reverse_complemented_features.unshift(feature)\n end\n end\n reverse_complemented_features.unshift(source_feature)\n biosequence.features = reverse_complemented_features\n\n output_sequence_format ||= guess_sequence_format(path_to_sequence)\n case output_sequence_format\n when :genbank\n output_suffix = \"gbk\"\n when :embl\n output_suffix = \"embl\"\n end\n reverse_complemented_file = File.open(\"#{File.dirname(path_to_sequence)}/#{file_prefix_from_filepath(path_to_sequence)}_rc.#{output_suffix}\", \"w\")\n \n reverse_complemented_file.puts biosequence.output(output_sequence_format)\n reverse_complemented_file.close\nend",
"title": ""
}
] |
[
{
"docid": "e002fbe3beb4f855c8f478aa85c41e16",
"score": "0.75694674",
"text": "def reverse_sequence\n revcom(sequence)\n end",
"title": ""
},
{
"docid": "749a16dffd958eacabf2b484dbdcdef5",
"score": "0.707197",
"text": "def invert() end",
"title": ""
},
{
"docid": "482e0cf01577c15f52986464e29bdaf3",
"score": "0.6931644",
"text": "def reverse!() end",
"title": ""
},
{
"docid": "482e0cf01577c15f52986464e29bdaf3",
"score": "0.6931644",
"text": "def reverse!() end",
"title": ""
},
{
"docid": "2df8f1ab9ad63fa5bac7ff4acd35a3fe",
"score": "0.69304514",
"text": "def reverse() end",
"title": ""
},
{
"docid": "2df8f1ab9ad63fa5bac7ff4acd35a3fe",
"score": "0.69304514",
"text": "def reverse() end",
"title": ""
},
{
"docid": "e80b288273655d3a8d8a6268daa03ad7",
"score": "0.68928",
"text": "def reverse!\n replace(reverse)\n end",
"title": ""
},
{
"docid": "fc1e28a7c779fe52e160906de129ef9b",
"score": "0.6747117",
"text": "def inverse; end",
"title": ""
},
{
"docid": "fc1e28a7c779fe52e160906de129ef9b",
"score": "0.6747117",
"text": "def inverse; end",
"title": ""
},
{
"docid": "d62e2268b7cd03cd39f77c7454b794c8",
"score": "0.67374474",
"text": "def invert; end",
"title": ""
},
{
"docid": "8fa810d20f22d2aec1fb2e089a4394b9",
"score": "0.66012895",
"text": "def reverse\n dup.reverse!\n end",
"title": ""
},
{
"docid": "ce15bf0e8149879f6a53bf5fa12f2d3c",
"score": "0.65463316",
"text": "def complement!\n tmp = self.from\n self.from = self.to\n self.to = tmp\n tmp = self.from_orient\n self.from_orient = (self.to_orient == :+) ? :- : :+\n self.to_orient = (tmp == :+) ? :- : :+\n self.overlap = self.complement_overlap\n return self\n end",
"title": ""
},
{
"docid": "4e10afcc959c00fe3eed774c778a37a4",
"score": "0.65286016",
"text": "def reverse(input); end",
"title": ""
},
{
"docid": "ad39997f48d7ceea7abbfbe810e01f65",
"score": "0.65144163",
"text": "def invert\n end",
"title": ""
},
{
"docid": "8f184a3a53c472fea071685c5ab9a36d",
"score": "0.65012485",
"text": "def inverse\n end",
"title": ""
},
{
"docid": "0467971f871b419534b1a9121f3baa7f",
"score": "0.6474646",
"text": "def reverse; end",
"title": ""
},
{
"docid": "0467971f871b419534b1a9121f3baa7f",
"score": "0.6474646",
"text": "def reverse; end",
"title": ""
},
{
"docid": "aa725868ddfceda772eba33bafe34e75",
"score": "0.6447683",
"text": "def inverse!\n inverse self\n end",
"title": ""
},
{
"docid": "aff6aec064c5d816cc61a6d7737046aa",
"score": "0.63932526",
"text": "def -(other)\n self & other.complement\n end",
"title": ""
},
{
"docid": "f6e77dabe21126da4962dd8241bf77d7",
"score": "0.6323037",
"text": "def complement\n RegLang.new(to_dfa.complement)\n end",
"title": ""
},
{
"docid": "96b821daba69840f9baf3b2713693370",
"score": "0.63081175",
"text": "def reverse_complement(txt)\n comp = []\n txt.chars.each do |ch|\n comp << \"A\" if ch == 'T'\n comp << \"T\" if ch == 'A'\n comp << \"G\" if ch == 'C'\n comp << \"C\" if ch == 'G'\n end\n comp.join.reverse\nend",
"title": ""
},
{
"docid": "e638b21f6b20efb3182a7f29f714b7af",
"score": "0.62986755",
"text": "def inversed; end",
"title": ""
},
{
"docid": "f2fb9bcb2d93aadd713d257cb356f4a4",
"score": "0.62879026",
"text": "def reverse_binary\n binary.reverse\n end",
"title": ""
},
{
"docid": "6558e13e651a18bc9b6b5756975730a8",
"score": "0.6272326",
"text": "def reverse\n end",
"title": ""
},
{
"docid": "6558e13e651a18bc9b6b5756975730a8",
"score": "0.6272326",
"text": "def reverse\n end",
"title": ""
},
{
"docid": "e47b48c8373f765636a4cc0d8fc97a4d",
"score": "0.6264112",
"text": "def complement\n l = self.clone\n l.from = to\n l.from_orient = (to_orient == :+ ? :- : :+)\n l.to = from\n l.to_orient = (from_orient == :+ ? :- : :+)\n l.overlap = complement_overlap\n l\n end",
"title": ""
},
{
"docid": "a92e36aed633622326cc9c48223bf9c7",
"score": "0.62624604",
"text": "def reverse\n self.dup.reverse!\n end",
"title": ""
},
{
"docid": "74082b64a0d03a74823319a286a9486b",
"score": "0.6252714",
"text": "def reverse!\n low = 0\n high = self.__size - 1\n while low < high\n a = self.__at(low)\n b = self.__at(high)\n self.__at_put(high, a)\n self.__at_put(low, b)\n low = low + 1\n high = high - 1\n end\n self\n end",
"title": ""
},
{
"docid": "09242cc6d0b6c504a6eced0fa9b650f2",
"score": "0.6242691",
"text": "def reverse!\n end",
"title": ""
},
{
"docid": "09242cc6d0b6c504a6eced0fa9b650f2",
"score": "0.6242691",
"text": "def reverse!\n end",
"title": ""
},
{
"docid": "614984546429465e32180e7f5ce30395",
"score": "0.6235951",
"text": "def reverse!\n tmp = self.from\n self.from = self.to\n self.to = tmp\n tmp = self.from_orient\n self.from_orient = (self.to_orient == :+) ? :- : :+\n self.to_orient = (tmp == :+) ? :- : :+\n self.overlap = self.reverse_overlap\n return self\n end",
"title": ""
},
{
"docid": "55d19deb12930276f42049394c578edb",
"score": "0.6206502",
"text": "def fliplr\n reverse(1)\n end",
"title": ""
},
{
"docid": "281c57f815a38e9e759cb8106bf8c9b6",
"score": "0.6184585",
"text": "def reverse_inplace(s)\n b = 0\n e = s.length - 1\n reverse_inplace_helper(b,e,s)\n return s\nend",
"title": ""
},
{
"docid": "28cfd42371486ab166bd8b229bc6b546",
"score": "0.61767584",
"text": "def invert!\n @front, @back = @back, @front\n end",
"title": ""
},
{
"docid": "d4353b5916402403826ce38242da31b1",
"score": "0.6173562",
"text": "def rev\n end",
"title": ""
},
{
"docid": "d2647d452f9afff93c42534b6e590164",
"score": "0.6160807",
"text": "def -@\n return self.invert\n end",
"title": ""
},
{
"docid": "d2647d452f9afff93c42534b6e590164",
"score": "0.6160807",
"text": "def -@\n return self.invert\n end",
"title": ""
},
{
"docid": "63c4bcf06f657b8ae58fa94befce8a2f",
"score": "0.61555994",
"text": "def invert\n clone.invert!\n end",
"title": ""
},
{
"docid": "d2de00d109d3f415507a7891ec88c972",
"score": "0.61106974",
"text": "def inverse_of; end",
"title": ""
},
{
"docid": "509526091d6f7dfd03032dd067092a4b",
"score": "0.6106041",
"text": "def reverse_without_hooks!\n\n @without_hooks = true\n\n reverse!\n \n @without_hooks = false\n\n return self\n\n end",
"title": ""
},
{
"docid": "c8e84a752c19bd40224134d998e62c55",
"score": "0.61046815",
"text": "def reverse!(list)\n list.reverse!\n end",
"title": ""
},
{
"docid": "b009a6339c1ce9f9c9a09bee264c8b28",
"score": "0.610359",
"text": "def inverted; invert = true; self; end",
"title": ""
},
{
"docid": "b01702cee91eceb675efc6228f7c8b73",
"score": "0.6098165",
"text": "def -@\n CAS.invert(self)\n end",
"title": ""
},
{
"docid": "68b4cc7453dced63545e4be31d07c1c9",
"score": "0.6085858",
"text": "def reverse\n \"x#{old_reverse}x\"\n end",
"title": ""
},
{
"docid": "9df79d3cef312eae63955290ce182f8c",
"score": "0.60814273",
"text": "def reverse!\n @upwards = !@upwards\n skip!(2)\n end",
"title": ""
},
{
"docid": "360852573b5435b6314f85278f07b421",
"score": "0.6057187",
"text": "def invert!\n @cards.values.each {|c| c.invert! }\n end",
"title": ""
},
{
"docid": "be9161da89a5c9239462591a9646b349",
"score": "0.6055758",
"text": "def backwards(input)\n input.reverse\nend",
"title": ""
},
{
"docid": "4affe7c590e48f92559b5cb54ef3d906",
"score": "0.6045705",
"text": "def reverse_inplace(s)\n # This is a wrapper method\n return reverse_inplace_2(s, 0, s.length - 1)\nend",
"title": ""
},
{
"docid": "b85b850e6825433faba9ba74aa8e026c",
"score": "0.6032687",
"text": "def reverse(string)\n \n string.reverse!\nend",
"title": ""
},
{
"docid": "b99a711abe2e4e2d6e8fd7193d5ff770",
"score": "0.60275066",
"text": "def reverse_inplace(s)\n return reverse_helper(s)\nend",
"title": ""
},
{
"docid": "3d6882aa49969633e7dab1efb4fc3d58",
"score": "0.6025797",
"text": "def reverse(s)\nend",
"title": ""
},
{
"docid": "73f8cf38f0a002b977da8034dc7c6588",
"score": "0.601978",
"text": "def reverse_inplace(s)\n return reverse_helper(s, 0 , s.length - 1) \nend",
"title": ""
},
{
"docid": "a965b949fa7ff59d20cdcf7e7cc4c8ca",
"score": "0.60126114",
"text": "def reverse_inplace(s)\n raise NotImplementedError, \"Method not implemented\"\nend",
"title": ""
},
{
"docid": "0e915b11be0abebbdb7df31ce4ace862",
"score": "0.600393",
"text": "def reverser\nwords=yield.split(\" \")\noutpt=\"\"\nwords.map do\n |w|\noutpt= outpt + w.reverse + \" \"\n end\noutpt [0...-1]\nend",
"title": ""
},
{
"docid": "e108201bcde1585d3845d7cb85297381",
"score": "0.6003404",
"text": "def reverser( &block )\n\n\tblock.call.split(\" \").map { | w | w.reverse }.join(\" \")\n\nend",
"title": ""
},
{
"docid": "4e48ec145b06dbd21170227bc14d0ec9",
"score": "0.59992373",
"text": "def reverse_inplace(s)\n\treturn reverse_helper(s, 0, (s.length - 1))\nend",
"title": ""
},
{
"docid": "09b619742b0bebc74e4ac8eeb2577c29",
"score": "0.5978778",
"text": "def reverse()\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "fb97f51df5d80054c949caf441d7f021",
"score": "0.5975489",
"text": "def reverse_inplace(s)\n return reverse_helper(s, 0, s.length - 1)\nend",
"title": ""
},
{
"docid": "19a419803c1346d58baa20c7dae4219f",
"score": "0.59739983",
"text": "def reverse_inplace(s)\n return reverse_helper(s, 0, s.length-1)\nend",
"title": ""
},
{
"docid": "f730bc28993604eb30d8157ba69d1291",
"score": "0.5969277",
"text": "def reverse_inplace(s)\n return rev_help(s, 0, s.length - 1) \nend",
"title": ""
},
{
"docid": "ab530eb68243f2799c858c03f175d55f",
"score": "0.59690315",
"text": "def reverse_inplace(s)\n raise NotImplementedError, \"Method not implemented\"\nend",
"title": ""
},
{
"docid": "0d3c477eddf17db5f3ceffca6d1dde63",
"score": "0.5962077",
"text": "def reverse_inplace(s)\n return reverse_helper(s, 0, s.length - 1)\nend",
"title": ""
},
{
"docid": "0d3c477eddf17db5f3ceffca6d1dde63",
"score": "0.5962077",
"text": "def reverse_inplace(s)\n return reverse_helper(s, 0, s.length - 1)\nend",
"title": ""
},
{
"docid": "e17ce023c31d7c594e2a61930f3e724c",
"score": "0.59560406",
"text": "def reverse\n l = self.clone\n l.from = to\n l.from_orient = (to_orient == :+ ? :- : :+)\n l.to = from\n l.to_orient = (from_orient == :+ ? :- : :+)\n l.overlap = reverse_overlap\n l\n end",
"title": ""
},
{
"docid": "83e881576ae71b0ee31ff5569c0607c7",
"score": "0.595372",
"text": "def rev(target)\n res = Array(32)\n 16.times do |i|\n a = target[i].ord ^ i ^ (16 * i)\n res[2*i+1] = a & 0xf\n res[2*(15-i)] = a >> 4\n end\n res.map{|c|c.to_s(16)}.join\nend",
"title": ""
},
{
"docid": "506245a6a4560d7ade5abfccfbce335d",
"score": "0.595156",
"text": "def flip\n ->(f) {\n _reverse = ->(xs) {\n xs.length == 1 ? xs : [xs[-1]] + _reverse.(xs[0...-1])\n }\n\n ->(*args) {\n f.(*_reverse.(args))\n }\n }\n end",
"title": ""
},
{
"docid": "033707d7c79b334d35261bd21740573c",
"score": "0.59284943",
"text": "def inverse\n\t\t\treturn self.dup.inverse!\n\t\tend",
"title": ""
},
{
"docid": "7afdebb2c5a264e6468da9ed91f73faa",
"score": "0.59228915",
"text": "def reverse_each(elective_array)\n elective_array.each do |i|\n i.reverse!\n end\n return elective_array\nend",
"title": ""
},
{
"docid": "eda8cc16cec13ed238723e93f528fee2",
"score": "0.59205467",
"text": "def reverse!\n @direction = - @direction\n self\n end",
"title": ""
},
{
"docid": "c8f91370c58c7ae823946d416af49cf8",
"score": "0.5907081",
"text": "def flipud\n reverse(0)\n end",
"title": ""
},
{
"docid": "d02046bbc24edaacf2a8f58e1550163a",
"score": "0.5903177",
"text": "def reverse_inplace(s)\n return helper_reverse(s)\nend",
"title": ""
},
{
"docid": "1f8b0add582f8f7dc9613b0d0b06c552",
"score": "0.5898831",
"text": "def invert(list)\n list.map(&:-@)\nend",
"title": ""
},
{
"docid": "4c35117efd38333af24acb706be0da7b",
"score": "0.5894071",
"text": "def reverse_method\n @reversed_array = @card_integer_array.reverse\n end",
"title": ""
},
{
"docid": "d99c853b9fbe7b4598882766c47bf1a5",
"score": "0.5891474",
"text": "def reverse!(arr)\n arr.each do |element|\n arr.delete(element)\n arr.unshift(element)\n end\nend",
"title": ""
},
{
"docid": "1a24bd0ed54e694e8417e576c502b5d4",
"score": "0.5890935",
"text": "def reverse_array(array)\n array.reverse!\nend",
"title": ""
},
{
"docid": "1a24bd0ed54e694e8417e576c502b5d4",
"score": "0.5890935",
"text": "def reverse_array(array)\n array.reverse!\nend",
"title": ""
},
{
"docid": "299f6ab0d49c96cc3e4285a4a650a609",
"score": "0.5880991",
"text": "def reverse_array(array)\n array.reverse!\n array\nend",
"title": ""
},
{
"docid": "93c8132ff04e04b356730cde36171052",
"score": "0.5877872",
"text": "def using_reverse(array)\narray.reverse\nend",
"title": ""
},
{
"docid": "93c8132ff04e04b356730cde36171052",
"score": "0.5877872",
"text": "def using_reverse(array)\narray.reverse\nend",
"title": ""
},
{
"docid": "7f3b21341a54fada25c4c80aa1978e28",
"score": "0.58726853",
"text": "def reverser\n words= yield.split\n for word in words\n word.reverse!\n end\n words.join(\" \")\nend",
"title": ""
},
{
"docid": "7abe3324cb2bf530e6174c2ea5e1e17f",
"score": "0.5870057",
"text": "def reverse\n new(map { |direction| direction.reverse })\n end",
"title": ""
},
{
"docid": "7b3fa7c6b37657eb4cf98662915ea674",
"score": "0.58676857",
"text": "def reverse_string(s)\n s.reverse!\nend",
"title": ""
},
{
"docid": "2afa7bf251487774c22f1e18bc2f2b19",
"score": "0.58609784",
"text": "def reverse_array(i)\r\n i.reverse!\r\nend",
"title": ""
},
{
"docid": "217b0dee4796c992a679d09b6e347780",
"score": "0.585673",
"text": "def reverse()\r\n self.reduce(List.new) { |new_list, item| new_list.cons(item) }\r\n end",
"title": ""
},
{
"docid": "b9fae4bb740e0ed9d33fee8c232d5ded",
"score": "0.58534527",
"text": "def invert\n c = Anki::Card.new(front: @back.to_s, back: @front.to_s)\n c.front = @back.dup\n c.back = @front.dup\n c\n end",
"title": ""
},
{
"docid": "92669af3c9cd227b279229c04ddfa2e1",
"score": "0.5847884",
"text": "def flip\n sentence_array = @sentence.split\n length = sentence_array.count\n flipped_sentence = length.times.map do |i|\n sentence_array[-i - 1]\n end\n flipped_sentence.join(\" \")\n end",
"title": ""
},
{
"docid": "07935600e350885de1d93a220c96f758",
"score": "0.5846999",
"text": "def reverse_inplace(s)\n return s if s.length <= 1\n return s[-1] + reverse(s[0...-1])\n end",
"title": ""
},
{
"docid": "f3ae52282ac54ba68e737f5cdfe6b5e3",
"score": "0.5843746",
"text": "def reverse_inplace(s)\n return s if s.length == 0\n return s if s.length == 1\n\n reverse_helper(s, 0, s.length - 1)\n return s\nend",
"title": ""
},
{
"docid": "2f4f0dfa2913efe2c743ac7321a3076b",
"score": "0.58389497",
"text": "def reverse_array(array_int)\n array_int.reverse!\nend",
"title": ""
},
{
"docid": "bbd697000637139452325c820bb80dfe",
"score": "0.58297914",
"text": "def reverse\n ->(xs) {\n length.(xs) <= 1 ? xs : concat.(reverse.(xs[1..-1]), [head.(xs)])\n }\n end",
"title": ""
},
{
"docid": "93cb7c445c1b954477a851c25267c541",
"score": "0.5827798",
"text": "def reverse\n @x = -@x\n @y = -@y\n self\n end",
"title": ""
},
{
"docid": "a5b3cd6c2b527b05debffe0e2424f85b",
"score": "0.5826698",
"text": "def reverse_inplace(s)\n if !s || s.length == 0\n return s\n else\n return reverse_inplace(s[1..-1]) << s[0]\n end\nend",
"title": ""
},
{
"docid": "e60b64585bbcff9a439b89f9e3236d1d",
"score": "0.5823498",
"text": "def reverse!\n\t vertices.reverse!\n\t edges.reverse!.map! {|edge| edge.reverse! }\n\t self\n\tend",
"title": ""
},
{
"docid": "7a72c3f99d60e2025ac2c61dd276ed15",
"score": "0.5815198",
"text": "def reverse(s)\n s.reverse\nend",
"title": ""
},
{
"docid": "9b47f0ca4de7fb2bcf2b8e0e99bd7c52",
"score": "0.5812812",
"text": "def reverse\n `return self.split('').reverse().join('');`\n end",
"title": ""
},
{
"docid": "9b47f0ca4de7fb2bcf2b8e0e99bd7c52",
"score": "0.5812812",
"text": "def reverse\n `return self.split('').reverse().join('');`\n end",
"title": ""
},
{
"docid": "1b87bb6225353b8f18df5adbe1fcda0b",
"score": "0.58065194",
"text": "def inverse\n input.aliases.inverse\n end",
"title": ""
},
{
"docid": "1f615744932df830e75de6d6619212a5",
"score": "0.5806369",
"text": "def complement!\n # create a new one, or modify the current one in place,\n # and return it\n newdfa = FiniteAutomaton.new\n newdfa.set_start(@start)\n newdfa.state.merge!(@state)\n newdfa.transition.merge!(@transition)\n \n dead_state = new_state\n\n newdfa.state.keys.each{|key|\n if@transition[key] == {} \n \n @alphabet.each{|letter|\n newdfa.add_transitiondfa(key, dead_state, letter)\n newdfa.add_transitiondfa(dead_state, dead_state, letter)\n }\n else\n \n @alphabet.each{|letter|\n if get_transition(key, letter) == nil\n newdfa.add_transitiondfa(key, dead_state, letter)\n newdfa.add_transitiondfa(dead_state, dead_state, letter)\n end\n }\n end\n }\n newdfa.state.each_key{|state| newdfa.set_final(state, true)}\n @final.each_key{|state| newdfa.set_final(state, false)}\n newdfa.alphabet.concat(@alphabet)\n newdfa\n end",
"title": ""
},
{
"docid": "8d0e32234a5661a1bba9833b962194fc",
"score": "0.5797224",
"text": "def reverse!\n\t\t@order *= -1\n\t\tresort\n\tend",
"title": ""
},
{
"docid": "8a3300de08ad4c1d8ad53cedeba796ea",
"score": "0.5796632",
"text": "def complement?\n @complement\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "fd9345ca5797b5e6d845a7abbf07105d",
"score": "0.0",
"text": "def arc_params\n params.require(:arc).permit(:tag, :name, :description, :date_confirmed, :classification, :arc_profiled, :dev_plan_available, :dev_plan_mainstream, :alda_rating, :faps_coverage)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496716",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956598",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.6922234",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6893534",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67853236",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6744744",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6683278",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6637831",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.662915",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66274196",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65636724",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6490788",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6478456",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6454521",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64013326",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.6383577",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63649726",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.6341358",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.63372284",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63265663",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.6320813",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.6315858",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6315331",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.63070124",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.630166",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.6299529",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.62969804",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62925094",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62925094",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6279755",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6274345",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267809",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.6256392",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62562",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62532043",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.62367487",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6228854",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6228413",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.6228286",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62258255",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.62012124",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.6191875",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61842424",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6178458",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6164992",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6162104",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.6156658",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.61559016",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.6136121",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61345404",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.6120985",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6118153",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6118153",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61144924",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61125064",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6104286",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6104286",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.60988307",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.60988307",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6086679",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60861516",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.60854965",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.60784113",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.6075904",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6069803",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60691726",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.60677636",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60670036",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60642415",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.60642093",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6063699",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.6057904",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6049856",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6049856",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60493153",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6047263",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.60412097",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6035046",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030718",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6027412",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.60227424",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.60212505",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.60179645",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60158634",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60089386",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6007368",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6007368",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006898",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60060626",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60033864",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6002875",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60017014",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60017014",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59998643",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5999541",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5999541",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.599479",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.599417",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59940106",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.5992595",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.5992174",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
}
] |
20e29a269143f7a7e75297d46c5873fc
|
Get deploy keys on a repo Requires authenticated client.
|
[
{
"docid": "1c95a08856826c1b5f491fc03fad6b42",
"score": "0.70876426",
"text": "def deploy_keys(repo, options = T.unsafe(nil)); end",
"title": ""
}
] |
[
{
"docid": "d100a796795069f3c97e3a3fa3733873",
"score": "0.75673884",
"text": "def list_deploy_keys(repo, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "38c57470206f1698c1d013401a9dd9ee",
"score": "0.71641684",
"text": "def deploy_keys(project, options = {})\n get(\"/projects/#{url_encode project}/deploy_keys\", query: options)\n end",
"title": ""
},
{
"docid": "66512a2555adbe765f04e15d394c7448",
"score": "0.6974139",
"text": "def deploy_keys\n @deploy_keys ||= begin\n keys = []\n col = run_context.resource_collection\n it = proc {|r| keys << r if r.is_a?(Chef::Resource::CiDeployKey) }\n # If we are in a subcontext, we want to scan recursively\n if col.respond_to?(:recursive_each)\n col.recursive_each(&it)\n else\n col.each(&it)\n end\n keys\n end\n end",
"title": ""
},
{
"docid": "5b74acc589f86e2371e0d4359004dfc0",
"score": "0.69288486",
"text": "def get_github_authorized_keys(user)\n return [] unless user.github_user_name.present?\n uri = URI(\"https://github.com/#{user.github_user_name}.keys\")\n Net::HTTP.get(uri).split(\"\\n\")\n end",
"title": ""
},
{
"docid": "2125b4eb16ae6fc84f4c479ef49466f2",
"score": "0.6802176",
"text": "def getRepositoryKeys\n return @REPOSITORY.keys\n end",
"title": ""
},
{
"docid": "52de098c6940f2c5e4c3f469b8d08997",
"score": "0.6756306",
"text": "def get_public_key(repo); end",
"title": ""
},
{
"docid": "4cedc1044dc09504677203e4373c7a29",
"score": "0.6543421",
"text": "def deploy_key(project, id)\n get(\"/projects/#{url_encode project}/deploy_keys/#{id}\")\n end",
"title": ""
},
{
"docid": "b9e6a8c2fbf980bc426b63a2e52c55b1",
"score": "0.6322611",
"text": "def get_keys(env)\n list_cmd = %W[gcloud iam service-accounts keys list\n --iam-account=#{env.service_account}\n --project=#{env.project_id}\n --format=json].join(' ')\n stdout, _stderr = Open3.capture2(list_cmd)\n JSON.load(stdout)\n end",
"title": ""
},
{
"docid": "5d873ee3fef7caf10e8c5054a166d8df",
"score": "0.6226845",
"text": "def list_checkout_keys\n CircleCi.request(\"#{base_path}/checkout-key\").get\n end",
"title": ""
},
{
"docid": "f2ca395a888d47a4ca3d10d44fd02da9",
"score": "0.6203007",
"text": "def ssh_keys\n @ssh_keys ||= rest_client.sshkeys\n end",
"title": ""
},
{
"docid": "ae8650085aab9b2ba79fb26d6fc7cb4e",
"score": "0.6196117",
"text": "def deploy_key(repo, id, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "914f83e34a3b5a9d25ff972dc2c13f29",
"score": "0.6163449",
"text": "def available_project_keys\n strong_memoize(:available_project_keys) do\n current_user.project_deploy_keys.with_projects - enabled_keys\n end\n end",
"title": ""
},
{
"docid": "083c10fb10056b34b6e322e82369e49b",
"score": "0.6161351",
"text": "def keys\n @keys ||= ApiFactory.new 'Repos::Keys'\n end",
"title": ""
},
{
"docid": "8759d3406f0fdb08571135ce7f053748",
"score": "0.61584646",
"text": "def keys\n authorized_keys = api.get_config_vars(app).body[\"AUTHORIZED_KEYS\"].to_s.strip\n return display \"No public keys currently authorized\" if authorized_keys.empty?\n display authorized_keys\n end",
"title": ""
},
{
"docid": "f03feb515e8df22bcb1850e8c9a0e549",
"score": "0.6133438",
"text": "def available_keys\n strong_memoize(:available_keys) do\n current_user\n .accessible_deploy_keys\n .id_not_in(enabled_keys.select(:id))\n .with_projects\n end\n end",
"title": ""
},
{
"docid": "133a2fac9a3128a9f744d6d718650169",
"score": "0.60699713",
"text": "def github_deploy_key\n SSHKey.new(read_attribute(:github_deploy_key))\n end",
"title": ""
},
{
"docid": "8ea988898329ecb88dee3b17d0f9618f",
"score": "0.59808683",
"text": "def fetch_aws_keys(auth, base) \n project = base.project \n project_name = base.options[:project] || project.name \n return auth.api.get_config_vars(project_name).body['config']\n end",
"title": ""
},
{
"docid": "943bf2d7dd0c869284733e8b739cd46b",
"score": "0.59403056",
"text": "def authorized_ssh_keys\n @authorized_ssh_keys\n end",
"title": ""
},
{
"docid": "37e7b33f7aced94e3bd3738d2e6fb70f",
"score": "0.59223086",
"text": "def enabled_keys\n strong_memoize(:enabled_keys) do\n project.deploy_keys.with_projects\n end\n end",
"title": ""
},
{
"docid": "e02f1a763526ed38a6c0f9ca13feae28",
"score": "0.59211534",
"text": "def public_key(repo_or_org)\n if repo_or_org.include? '/'\n repo = repo_or_org\n public_keys[repo_or_org] ||= get(\"/repos/#{repo}/actions/secrets/public-key\")\n else\n org = repo_or_org\n public_keys[repo_or_org] ||= get(\"/orgs/#{org}/actions/secrets/public-key\")\n end\n end",
"title": ""
},
{
"docid": "fc65f5960826a55942b7861ed6dd4514",
"score": "0.58982927",
"text": "def index\n @ssh_keys = current_user.ssh_keys.all\n end",
"title": ""
},
{
"docid": "e17277bb59cf2e2273cc144a9171d91c",
"score": "0.58853847",
"text": "def get_admin_keys\n repository(ADMIN_REPO).get \"RW+\"\n end",
"title": ""
},
{
"docid": "5a79b9ed0ccd278ce3491eddc0933315",
"score": "0.587599",
"text": "def get_keys\n key_vault_collection.find\n end",
"title": ""
},
{
"docid": "2726ebbb07e1658e72736098f7768e3c",
"score": "0.5826695",
"text": "def get_gitkit_certs\n if @server_api_key.nil?\n @connection.authorization :Bearer, fetch_access_token\n response = @connection.get(GITKIT_API_URL + 'publicKeys')\n else\n response = @connection.get [GITKIT_API_URL, 'publicKeys?key=',\n @server_api_key].join\n end\n MultiJson.load response.body\n end",
"title": ""
},
{
"docid": "05a7f74b1c0bd40d2081db217eb75019",
"score": "0.5804155",
"text": "def authorized_repos\n @gh_conn.list_installation_repos[\"repositories\"].select { |x| x[\"language\"] == \"Ruby\" }\n end",
"title": ""
},
{
"docid": "4460606ca147ac070d8406eece7a7d32",
"score": "0.57907265",
"text": "def repos\n Git.repo_hash\n end",
"title": ""
},
{
"docid": "4460606ca147ac070d8406eece7a7d32",
"score": "0.57907265",
"text": "def repos\n Git.repo_hash\n end",
"title": ""
},
{
"docid": "21cd91ee071a7b40daf78f980258eed0",
"score": "0.5788129",
"text": "def get_actions_environment_public_key(repo, environment)\n get \"#{Repository.path repo}/environments/#{environment}/secrets/public-key\"\n end",
"title": ""
},
{
"docid": "23f1abc0457acc58b06b10b5f9bf2e22",
"score": "0.57742804",
"text": "def ssh_keys\n # iterate around the keys\n keys = []\n properties.osProfile.linuxConfiguration.ssh.publicKeys.each do |key|\n keys << key.keyData\n end\n keys\n end",
"title": ""
},
{
"docid": "42ce1f8ebf203a2f849be034cac38e59",
"score": "0.5759745",
"text": "def deploy_key\n SSHKey.new(read_attribute(:deploy_key))\n end",
"title": ""
},
{
"docid": "80421be0832829e21407f4a1abcfb6eb",
"score": "0.5715374",
"text": "def get_old_repo\n message = 'pub=%s' % [\n CGI::escape(@conf['PUBLIC_KEY']),\n ]\n\n sig = sign(@conf['PRIVATE_KEY'], message, OpenSSL::Digest.new(@conf['ALGORITHM']))\n url = \"#{@conf['API_URL']}/list/?sig=%s&%s\" % [ CGI::escape(sig), message ]\n data = send_request(url)\n\n data['repoResultList'].each do |repo|\n # name, scm, url, username, password, source, branch\n list = \"#{repo['name']},#{repo['scm']},#{repo['url']},#{repo['username']},#{repo['password']},#{repo['source']},#{repo['branch']}\"\n File.open(@conf['OLD'], 'a+') { |file| file.puts(list) }\n end\n end",
"title": ""
},
{
"docid": "9580962cff5629a323173c49c86108b4",
"score": "0.5698882",
"text": "def SSHKey\n return [@ssh_key_name, @ssh_private_key, @ssh_public_key] if !@ssh_key_name.nil?\n if numKittens(types: [\"Server\", \"ServerPool\", \"ContainerCluster\"]) == 0\n return []\n end\n @ssh_key_name=\"deploy-#{MU.deploy_id}\"\n ssh_dir = Etc.getpwnam(@mu_user).dir+\"/.ssh\"\n\n if !File.directory?(ssh_dir) then\n MU.log \"Creating #{ssh_dir}\", MU::DEBUG\n Dir.mkdir(ssh_dir, 0700)\n if Process.uid == 0 and @mu_user != \"mu\"\n FileUtils.chown Etc.getpwnam(@mu_user).uid, Etc.getpwnam(@mu_user).gid, ssh_dir\n end\n end\n if !File.exist?(\"#{ssh_dir}/#{@ssh_key_name}\")\n MU.log \"Generating SSH key #{@ssh_key_name}\"\n %x{/usr/bin/ssh-keygen -N \"\" -f #{ssh_dir}/#{@ssh_key_name}}\n end\n @ssh_public_key = File.read(\"#{ssh_dir}/#{@ssh_key_name}.pub\")\n @ssh_public_key.chomp!\n @ssh_private_key = File.read(\"#{ssh_dir}/#{@ssh_key_name}\")\n @ssh_private_key.chomp!\n\n# XXX the following mess belongs in cloud layers, probably in their initDeploy\n# methods\n if numKittens(clouds: [\"AWS\"], types: [\"Server\", \"ServerPool\", \"ContainerCluster\"]) > 0\n creds_used = []\n [\"servers\", \"server_pools\", \"container_clusters\"].each { |type|\n next if @original_config[type].nil?\n @original_config[type].each { |descriptor|\n next if descriptor['cloud'] != \"AWS\"\n if descriptor['credentials']\n creds_used << descriptor['credentials']\n else\n creds_used << MU::Cloud::AWS.credConfig(name_only: true)\n end\n }\n }\n creds_used << nil if creds_used.empty?\n\n creds_used.uniq.each { |credset|\n MU::Cloud::AWS.createEc2SSHKey(@ssh_key_name, @ssh_public_key, credentials: credset)\n }\n end\n\n return [@ssh_key_name, @ssh_private_key, @ssh_public_key]\n end",
"title": ""
},
{
"docid": "3ab1394e7d4a51d2a81af8a95b46c8eb",
"score": "0.56780106",
"text": "def repo_names\n @repos.keys\n end",
"title": ""
},
{
"docid": "7083e180f791c5ab7d45202ae268aab9",
"score": "0.5676624",
"text": "def get_keys\n if params[:username].present?\n begin\n user = User.find_by_username(params[:username])\n if user.present?\n render text: user.all_ssh_keys.join(\"\\n\"), content_type: \"text/plain\"\n else\n render_404 and return\n end\n rescue => e\n render text: e.message\n end\n else\n render_404 and return\n end\n end",
"title": ""
},
{
"docid": "359f8e69b41ead84689acba4ae686cae",
"score": "0.56734115",
"text": "def repos(project)\n ret = RestClient.get \"#{@url}/projects/#{project}/repos\", \n { Authorization: \"Basic #{auth_string}\"}\n json = JSON.parse(ret.body)\n\n json['values']\n end",
"title": ""
},
{
"docid": "050c88608baf7549a0b784c11341961b",
"score": "0.5671438",
"text": "def listRepositoryContents\n return @CURRENT_REPOSITORY.keys\n end",
"title": ""
},
{
"docid": "eaa29d217023d9fa4496c644e15b9dd9",
"score": "0.5650346",
"text": "def keys(project_id, req_params = {})\n name = 'Keys'\n params = { query: project_id, req: req_params }\n\n data = endpoint(name: name, params: params).do_get\n\n collection name, data\n end",
"title": ""
},
{
"docid": "8299fa04c1fcf1208721b7b997f17f0d",
"score": "0.5614771",
"text": "def keys\n head.commit.tree.contents.map{|blob| blob.name }\n end",
"title": ""
},
{
"docid": "8e62c5a0b606f29190c1957d084ac23d",
"score": "0.5612842",
"text": "def get_keys\n call(\"get-keys\")\n end",
"title": ""
},
{
"docid": "7d329bfa0d7a153907f610d4c561f6b3",
"score": "0.55971014",
"text": "def get_key\n key = client.ssh_keys.all.entries.first\n puts \"using key : #{key.id} : #{key.name}\"\n return key\n end",
"title": ""
},
{
"docid": "c38832dd446a8e7b143d48941ab430a0",
"score": "0.5594418",
"text": "def keys\n @keys ||= KeySet.new heroku_api\n end",
"title": ""
},
{
"docid": "2d1c29ad3533d0bcbdca693301f93c6f",
"score": "0.5584493",
"text": "def edit_deploy_key(repo, id, options); end",
"title": ""
},
{
"docid": "f1130e8f57aff4c926873a9c4d0934b0",
"score": "0.55831516",
"text": "def fetch_key repo, folder\n KEY_MAP[[repo, folder].join '_']\nend",
"title": ""
},
{
"docid": "60d761a8472842820be2c05713ac8d21",
"score": "0.55810803",
"text": "def list_ssh_keys\n response = api_call('list-sshkeys')\n keys_set = response[\"list-sshkeysresponse\"][\"KeysSet\"]\n if keys_set\n keys_set.values\n else\n []\n end\n end",
"title": ""
},
{
"docid": "c89d0303373eafce76cadb67f960b375",
"score": "0.5577412",
"text": "def keys\n @keys ||= @client.keys_in @name\n end",
"title": ""
},
{
"docid": "cfc1e8ac1b76ad76d4156863201926cd",
"score": "0.55690336",
"text": "def authorize_ci_for_keys\n\ttoken = ENV['GITHUB_KEYS_REPOSITORY_TOKEN']\n\n\t# Ensure an entry for github.com exists in ~/.netrc\n\tnetrc = Netrc.read\n\tunless netrc[\"github.com\"]\n\t\tUI.message \"An entry for github.com was not found in ~/.netrc; setting...\"\n\t\tnetrc[\"github.com\"] = token\n\t\tnetrc.save\n\tend\nend",
"title": ""
},
{
"docid": "4af58914463ff207184863b09d2c770a",
"score": "0.55581766",
"text": "def get_authorized_keys; end",
"title": ""
},
{
"docid": "3220961748605653cd960cb46d819eba",
"score": "0.5547231",
"text": "def get_key(user_name, repo_name, key_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 key_id\n _normalize_params_keys(params)\n\n get(\"/repos/#{user}/#{repo}/keys/#{key_id}\", params)\n end",
"title": ""
},
{
"docid": "de8cc4d8ac200c58469fccb038d435ed",
"score": "0.5545994",
"text": "def get_license_keys(id) path = \"/api/v2/accounts/#{id}/licensekeys\"\n get(path, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "ff4004674ba1ae90f0ecc861d860c160",
"score": "0.55322945",
"text": "def list_keys\n client.make_request('/list-keys', 'get')\n end",
"title": ""
},
{
"docid": "697a8b1dcaf67d8b3138dc2b012136e8",
"score": "0.55259675",
"text": "def update_deploy_key(repo, id, options); end",
"title": ""
},
{
"docid": "77ed6195ece3ac96d34b6c64c12b4634",
"score": "0.552591",
"text": "def user_repo_names\n @client.repos.map(&:full_name)\n end",
"title": ""
},
{
"docid": "43839c20352df0e53d88e1148452f5a1",
"score": "0.5512684",
"text": "def get_keys\n @encrypter.get_keys\n end",
"title": ""
},
{
"docid": "6212704206a5a2c734249d0aab288899",
"score": "0.5509185",
"text": "def github_repos_key\n \"github_repositories_for_user_#{current_user.id}\"\n end",
"title": ""
},
{
"docid": "b14cbc40ac0f6ebcc7e2167fd1e2ba19",
"score": "0.5485503",
"text": "def get_all_gears_sshkeys_action\n gear_map = {}\n\n openshift_users.each do |gear_uuid, _|\n gear_map[gear_uuid] = []\n authorized_keys_file = PathUtils.join(@@config.get('GEAR_BASE_DIR'), gear_uuid, \".ssh\", \"authorized_keys\")\n if File.exists?(authorized_keys_file) and not File.directory?(authorized_keys_file)\n File.open(authorized_keys_file, File::RDONLY) do |key_file|\n key_file.each_line do |line|\n begin\n gear_map[gear_uuid] << \"#{line.split[-1].chomp}::#{Digest::MD5.hexdigest(line.split[-2].chomp)}\"\n rescue\n end\n end\n end\n end\n end\n reply[:output] = gear_map\n reply[:exitcode] = 0\n end",
"title": ""
},
{
"docid": "e574ce2e7e30624fd0c6ba3c8b00f6ea",
"score": "0.5467985",
"text": "def get_repo(key:)\n api_get(\"/repositories/#{key}\").tap { |h| h.delete('key') }\n end",
"title": ""
},
{
"docid": "4b30d1e6d8f99fa0684e93ff926807c8",
"score": "0.5454684",
"text": "def deploy_key_path\n @deploy_key_path ||= if deploy_key_is_local?\n deploy_key\n else\n ::File.expand_path(\"~#{user}/.ssh/id_deploy_#{Zlib.crc32(name)}\")\n end\n end",
"title": ""
},
{
"docid": "a60f3d8d19111e99feca4bdcf5f5968c",
"score": "0.54346275",
"text": "def get_all_gears_sshkeys_action\n gear_map = {}\n #TODO get path from config\n dir = \"c:/openshift/gears/\"\n filelist = Dir.foreach(dir) do |gear_file|\n if File.directory?(dir + gear_file) and not File.symlink?(dir + gear_file) and not gear_file[0] == '.'\n gear_map[gear_file] = {}\n authorized_keys_file = File.join(dir, gear_file, \".ssh\", \"authorized_keys\")\n if File.exists?(authorized_keys_file) and not File.directory?(authorized_keys_file)\n File.open(authorized_keys_file, File::RDONLY) do |key_file|\n key_file.each_line do |line|\n begin\n gear_map[gear_file][Digest::MD5.hexdigest(line.split[-2].chomp)] = line.split[-1].chomp\n rescue\n end\n end\n end\n end\n end\n end\n reply[:output] = gear_map\n reply[:exitcode] = 0\n end",
"title": ""
},
{
"docid": "b3a67035f3fc6f6288ec6e1878562dd5",
"score": "0.5432557",
"text": "def get_project_secrets(node)\n ::Chef_Delivery::ClientHelper.enter_client_mode_as_delivery\n secret_file = Chef::EncryptedDataBagItem.load_secret(Chef::Config[:encrypted_data_bag_secret])\n secrets = Chef::EncryptedDataBagItem.load('delivery-secrets', project_slug(node), secret_file)\n ::Chef_Delivery::ClientHelper.leave_client_mode_as_delivery\n secrets\n end",
"title": ""
},
{
"docid": "a746ae5b160a25e4d034ed4b8efe6c8f",
"score": "0.5415947",
"text": "def project_key_pairs\n if @project_key_pairs.nil?\n project_common_metadata = collector.project_instance_metadata\n @project_key_pairs = parse_compute_metadata_ssh_keys(project_common_metadata)\n end\n @project_key_pairs\n end",
"title": ""
},
{
"docid": "fb0aa30f11fad1f709a9c2d83ff6bdaf",
"score": "0.54068387",
"text": "def user_managed_keys\n raise Inspec::Exceptions::ResourceFailed, \"Service Account #{@display_name} does not exist!\" if not exists?\n @gcp.gcp_iam_client.list_project_service_account_keys(@service_account.name, key_types: ['USER_MANAGED'])\n end",
"title": ""
},
{
"docid": "625627fc763159252c63516637f6f3ff",
"score": "0.54066616",
"text": "def SSHKey\n return [@ssh_key_name, @ssh_private_key, @ssh_public_key] if !@ssh_key_name.nil?\n if numKittens(types: [\"Server\", \"ServerPool\", \"ContainerCluster\"]) == 0\n return []\n end\n @ssh_key_name=\"deploy-#{MU.deploy_id}\"\n ssh_dir = Etc.getpwnam(@mu_user).dir+\"/.ssh\"\n\n if !File.directory?(ssh_dir) then\n MU.log \"Creating #{ssh_dir}\", MU::DEBUG\n Dir.mkdir(ssh_dir, 0700)\n if Process.uid == 0 and @mu_user != \"mu\"\n ssh_dir.chown(Etc.getpwnam(@mu_user).uid, Etc.getpwnam(@mu_user).gid)\n end\n end\n if !File.exists?(\"#{ssh_dir}/#{@ssh_key_name}\")\n MU.log \"Generating SSH key #{@ssh_key_name}\"\n %x{/usr/bin/ssh-keygen -N \"\" -f #{ssh_dir}/#{@ssh_key_name}}\n end\n @ssh_public_key = File.read(\"#{ssh_dir}/#{@ssh_key_name}.pub\")\n @ssh_public_key.chomp!\n @ssh_private_key = File.read(\"#{ssh_dir}/#{@ssh_key_name}\")\n @ssh_private_key.chomp!\n\n if numKittens(clouds: [\"AWS\"], types: [\"Server\", \"ServerPool\", \"ContainerCluster\"]) > 0\n creds_used = []\n [\"servers\", \"server_pools\", \"container_clusters\"].each { |type|\n next if @original_config[type].nil?\n @original_config[type].each { |descriptor|\n if descriptor['credentials']\n creds_used << descriptor['credentials']\n else\n creds_used << MU::Cloud::AWS.credConfig(name_only: true)\n end\n }\n }\n creds_used << nil if creds_used.empty?\n\n creds_used.uniq.each { |credset|\n MU::Cloud::AWS.createEc2SSHKey(@ssh_key_name, @ssh_public_key, credentials: credset)\n }\n end\n\n return [@ssh_key_name, @ssh_private_key, @ssh_public_key]\n end",
"title": ""
},
{
"docid": "abe41f5e723d1a14e12465510b61c8a4",
"score": "0.5403749",
"text": "def rubber_ssh_keys\n Array(ssh_info[:private_key_path]).join(',')\n end",
"title": ""
},
{
"docid": "66807e59b5eb62ec029c8bdc74569c87",
"score": "0.5398364",
"text": "def authorized_ssh_keys\n execute_as_root(\"cat '#{File.join(home_dir, '.ssh', 'authorized_keys')}'\")\n end",
"title": ""
},
{
"docid": "0f7077558947a0c3ccd7119a00393b44",
"score": "0.5384398",
"text": "def access_keys\n AccessKeyCollection.new(:config => config)\n end",
"title": ""
},
{
"docid": "7f5e1d6d9a40144496b31c9ef06abb6c",
"score": "0.53782517",
"text": "def list_keys\n request(:list_keys)\n end",
"title": ""
},
{
"docid": "e4dca0c96e5d02f37bcae16db25ec0ad",
"score": "0.53764963",
"text": "def main\n\n json = run_query(\n json: {query: get_publickeys_query()}.to_json,\n token: ENV.fetch(\"GITHUB_TOKEN\")\n )\n\n members = JSON.parse(json)\n .dig(\"data\", \"organization\", \"team\", \"members\",\"nodes\")\n\n authorized_keys = '' \n members.each do |member|\n authorized_keys += \"# \"+format(member[\"name\"])+\"\\n\"\n member['publicKeys'][\"edges\"].each do |node|\n authorized_keys += node[\"node\"][\"key\"] + \"\\n\"\n end\n end\n\n puts authorized_keys\nrescue NoMethodError # we get this if we call 'dig' on nil\n # Experimental modules may not have any releases, so just return nothing\n nil\nend",
"title": ""
},
{
"docid": "0e0cab2ad9463865eb7e10dea049b15e",
"score": "0.5365663",
"text": "def fetch_public_keys\n json = Net::HTTP.get(team_domain, CERTS_PATH)\n json.empty? ? [] : MultiJson.load(json, symbolize_keys: true).fetch(:keys)\n rescue StandardError\n []\n end",
"title": ""
},
{
"docid": "ba918937a3cce3d54fc7453f2fbc66db",
"score": "0.5358614",
"text": "def list_hmac_keys project_id:\n # [START storage_list_hmac_keys]\n # project_id = \"Your Google Cloud project ID\"\n\n require \"google/cloud/storage\"\n\n storage = Google::Cloud::Storage.new project_id: project_id\n\n # By default Storage#hmac_keys uses the Storage client project_id\n hmac_keys = storage.hmac_keys project_id: project_id\n\n puts \"HMAC Keys:\"\n hmac_keys.all do |hmac_key|\n puts \"Service Account Email: #{hmac_key.service_account_email}\"\n puts \"Access ID: #{hmac_key.access_id}\"\n end\n # [END storage_list_hmac_keys]\nend",
"title": ""
},
{
"docid": "74942af371e304d9b593f0085aff1102",
"score": "0.53569174",
"text": "def remote_authorized_keys\n run_remote_command \"cat \\$HOME/.ssh/authorized_keys\"\n end",
"title": ""
},
{
"docid": "a572fd87edf17db6004ad37ff432c25f",
"score": "0.5356237",
"text": "def authorized_keys_content\n content = []\n rsync_chroot_resources.reduce({}) do |hash, resource|\n if resource.user == new_resource.user && resource.action == :add\n content << authorized_keys_line(\n resource.send('rsync_options'),\n resource.send('directory'),\n resource.send('ssh_options'),\n resource.send('key'),\n resource.send('comment')\n )\n end\n\n content\n end\n end",
"title": ""
},
{
"docid": "8c4897fc17183649160d7193f9945d9c",
"score": "0.5349641",
"text": "def repos\n raise AuthError, 'No auth token present' if @login.nil?\n res = self.class.get('/repos/')\n if res and res.parsed_response.is_a? Array\n return res.parsed_response\n elsif res.code == 403\n elsif res.code == 403 or res.code == 401\n logger.debug res.inspect\n raise AuthError, 'Invalid credentials in repos.'\n else\n logger.debug res.inspect\n raise PermanentError, 'Connection error in repos.'\n end\n end",
"title": ""
},
{
"docid": "e165744ebf83477c706a8763f4603947",
"score": "0.5345134",
"text": "def keys\n RubyKongAuth::KeyAuth.all consumer_id: self.id\n end",
"title": ""
},
{
"docid": "a66091793fbd70dda690f5d5d561409b",
"score": "0.53275144",
"text": "def public_key\n rpc(action: :account_key)[:key]\n end",
"title": ""
},
{
"docid": "9dc4f585eb10c2374afba2205dbb78f7",
"score": "0.5325304",
"text": "def keys\n raise APIError, \n \"To add a key, you must be authenticated\" if @api.read_only?\n\n result = @api.get(\"/user/keys\")\n return unless result and result[\"public_keys\"]\n result[\"public_keys\"].inject([]) { |result, element| result << Key.new(@api, element) }\n end",
"title": ""
},
{
"docid": "28c1fcf8eb74e467e40b37748446ae2c",
"score": "0.5323464",
"text": "def ssh_public_keys\n @ssh_public_keys\n end",
"title": ""
},
{
"docid": "08794296c62fae8a8e53e0e2338e6ba4",
"score": "0.53202844",
"text": "def key(repository_name = default_repository_name)\n properties(repository_name).key\n end",
"title": ""
},
{
"docid": "03e9a9a789bf23b0c643a324bc265b67",
"score": "0.53153354",
"text": "def authorized_keys(username)\n Array.new.tap do |a|\n a << \"# SSH Authorized Keys file generated automatically by Keyman\"\n a << \"# Generated at: #{Time.now.utc} for #{@host}\"\n a << nil\n authorized_users(username).each do |u|\n a << \"# #{u.name}\"\n a << u.key + \"\\n\"\n end\n end.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "94182e13edaec58323f6fd7956f627c8",
"score": "0.531532",
"text": "def masterfile_keys\n ['orgzn', 'acct']\n end",
"title": ""
},
{
"docid": "9b32eb075ebfe8d133c3297ef395f60b",
"score": "0.53133786",
"text": "def find_project_ssh_keys(id, opts = {})\n data, _status_code, _headers = find_project_ssh_keys_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "3ee2c98de75cdf1d102f4e1c8ec0b7f5",
"score": "0.530833",
"text": "def ssh_public_keys\n return [] unless self.ssh_key_id\n matches = self.class.all(:conditions => [\"creds.ptype = ? AND creds.proof ILIKE ?\", \"ssh_pubkey\", \"%#{self.ssh_key_id}%\"])\n matches.select {|c| c.workspace == self.workspace}\n end",
"title": ""
},
{
"docid": "4e832ff8b495973fc258d2ccdd68eb0a",
"score": "0.5305262",
"text": "def index\n # Default is current user\n (params[:user_id]) ? (user_id = params[:user_id]) : (user_id = @user.id)\n @sshkeys = User.includes(:sshkeys).find(user_id).sshkeys\n\n respond_to do |format|\n format.json { render json: @sshkeys, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "56e7a1140e07e5e59f172a1c362c2bcc",
"score": "0.53007686",
"text": "def get_repos\n return @data['repositories']\n end",
"title": ""
},
{
"docid": "8c9f4fd7e446f9b228c81d8193dee9fa",
"score": "0.5300554",
"text": "def project_deploy_tokens(project, options = {})\n get(\"/projects/#{url_encode project}/deploy_tokens\", query: options)\n end",
"title": ""
},
{
"docid": "3b7205a8727f6984072b1fd5543ee257",
"score": "0.5298292",
"text": "def deployments(repo, options = {})\n get(\"#{Repository.path repo}/deployments\", options)\n end",
"title": ""
},
{
"docid": "11262a7ede555491858e4f52222db14b",
"score": "0.5295316",
"text": "def keys(user_id)\n response = @client.get(\"users/#{user_id}/keys\")\n verify response,\n forbidden: 'You do not have permission to generate API keys',\n not_found: 'User does not exist',\n internal_server_error: 'Server failed to change the keys'\n end",
"title": ""
},
{
"docid": "26d33d864b5b3e7ad96c81933f5b2dc8",
"score": "0.5285474",
"text": "def list_hmac_keys max: nil, token: nil, service_account_email: nil,\n project_id: nil, show_deleted_keys: nil,\n user_project: nil, options: {}\n execute do\n service.list_project_hmac_keys \\\n (project_id || @project),\n max_results: max, page_token: token,\n service_account_email: service_account_email,\n show_deleted_keys: show_deleted_keys,\n user_project: user_project(user_project),\n options: options\n end\n end",
"title": ""
},
{
"docid": "3e9bb94a77e89858c524f2bf6f466208",
"score": "0.52838343",
"text": "def keys\n # 2048 76:cb:d7:82:90:92:ad:75:3d:68:6c:a9:21:ca:7b:7f /Users/rye/.ssh/id_rsa (RSA)\n # 2048 7b:a6:ba:55:b1:10:1d:91:9f:73:3a:aa:0c:d4:88:0e /Users/rye/.ssh/id_dsa (DSA)\n #keystr = Rye.shell(\"ssh-add\", '-l')\n #return nil unless keystr\n #keystr.collect do |key|\n # key.split(/\\s+/)\n #end\n Dir.glob(File.join(Rye.sysinfo.home, '.ssh', 'id_*sa'))\n end",
"title": ""
},
{
"docid": "67f421fd3ab41e641d57936c4fbac6bb",
"score": "0.52760303",
"text": "def get_possible_repo_names\n @github_account = GithubAccount.find(params[:github_account_id])\n keys = [:full_name]\n @possible_repos = @github_account.client.repos.map{ |r| r.to_h.select{ |k, v| keys.include?(k) } }\n end",
"title": ""
},
{
"docid": "90ab4a4b03c5be7eeb045a5d4d864b7d",
"score": "0.5273341",
"text": "def repositories\n if !access_token\n return nil\n end\n\n client = Octokit::Client.new(access_token: access_token)\n\n begin\n repos = client.repos({},\n query: {\n sort: \"pushed\",\n per_page: 30,\n })\n repos.map { |repo|\n { repo_name: repo[:full_name],\n clone_url: repo[:clone_url] }\n }\n rescue StandardError => e\n if e.response_status == 401 # unauthorized\n # User revoked permissions via Github UI, destroy it\n destroy!\n end\n nil\n end\n end",
"title": ""
},
{
"docid": "813e058c1710926e8df2b7af2d6d575d",
"score": "0.52675384",
"text": "def repos\n api.list_repos(login)\n end",
"title": ""
},
{
"docid": "fd52340e17fd2e042a9f9256d138d5d9",
"score": "0.526331",
"text": "def keys\n @resource.jiak.client.keys(jiak.bucket)\n end",
"title": ""
},
{
"docid": "29291aa5cd12bc96188be7334e7081f3",
"score": "0.5261518",
"text": "def add_deploy_key\n repo.ensure_salt\n\n # generate ssh-keypair\n key = Security.generate_ssh_key(repo.deploy_key_passphrase)\n\n # save public_key to github API\n deploy_key = client.add_deploy_key(repo.github_full_name, 'Pushbit', key.ssh_public_key)\n\n # save private_key to database\n repo.update_attributes(\n ssh_key: key.encrypted_private_key,\n deploy_key_id: deploy_key.id\n )\n end",
"title": ""
},
{
"docid": "ecc2bc0556e28efd0d2cfb5c4aade566",
"score": "0.5255296",
"text": "def available_public_keys\n strong_memoize(:available_public_keys) do\n DeployKey.are_public.with_projects - enabled_keys\n end\n end",
"title": ""
},
{
"docid": "7362dbb8cce27185907a7547b3e2e710",
"score": "0.52539945",
"text": "def get_repo_contents(repo)\n contents = []\n response = get_github_api(repo, 'contents')\n response.each do |content|\n contents << {\n 'filename' => content['name'],\n 'sha' => content['sha'],\n 'size' => content['size'],\n 'download_url' => content['download_url']\n }\n end\n puts \" - Contents: #{contents.length}\" if contents.length > 0\n contents\n end",
"title": ""
},
{
"docid": "dc6eb2f431a7424b4577dc5d800606c3",
"score": "0.5251243",
"text": "def list_checkout_keys_with_http_info(project_slug, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProjectApi.list_checkout_keys ...'\n end\n # verify the required parameter 'project_slug' is set\n if @api_client.config.client_side_validation && project_slug.nil?\n fail ArgumentError, \"Missing the required parameter 'project_slug' when calling ProjectApi.list_checkout_keys\"\n end\n # resource path\n local_var_path = '/project/{project-slug}/checkout-key'.sub('{' + 'project-slug' + '}', CGI.escape(project_slug.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] || 'CheckoutKeyListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['api_key_header', 'api_key_query', 'basic_auth']\n\n new_options = opts.merge(\n :operation => :\"ProjectApi.list_checkout_keys\",\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: ProjectApi#list_checkout_keys\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1f5681260a892cb8a8f47e1a3cd88457",
"score": "0.5251164",
"text": "def retrieve_keys()\n start.uri('/api/key')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "7fa5102f03e505418dec026ff6ce9f8f",
"score": "0.5250262",
"text": "def retrieve_keys()\n start.uri('/api/key')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "dd7c67e0a7f9db4a14cbdb8177727cc6",
"score": "0.5244833",
"text": "def managed_keys\n resource.managed_keys\n end",
"title": ""
},
{
"docid": "f0f8148f28889b262cd5b959cd5f7ef2",
"score": "0.5243798",
"text": "def keys\n @keys ||= Array.new(@csf::config()::getKeys.collect {|key| key.to_ruby_name})\n end",
"title": ""
}
] |
7bf218c41625e3df28602bdf99b47011
|
Api for world'total and each countries with lat, longitude and flag
|
[
{
"docid": "61b7d7c8d1b38d733c92cfbcfb4f4cdd",
"score": "0.63897216",
"text": "def country_api\n # endpoint = \"https://corona.lmao.ninja/countries\"\n endpoint = 'https://corona.lmao.ninja/v2/countries'\n response = HTTParty.get(endpoint)\n data = JSON.parse response.body\n res = data\n result =[]\n endpoint_all = \"https://corona.lmao.ninja/all\"\n response1 = HTTParty.get(endpoint_all)\n data1 = JSON.parse response1.body\n res1 = data1\n result<<{\n country: \"world\",\n cases: res1[\"cases\"],\n todayCases: res1[\"todayCases\"],\n deaths: res1[\"deaths\"],\n todayDeaths: res1[\"todayDeaths\"],\n recovered: res1[\"recovered\"],\n active: res1[\"active\"],\n critical: res1[\"critical\"],\n casesPerOneMillion: res1[\"casesPerOneMillion\"],\n deathsPerOneMillion: res1[\"deathsPerOneMillion\"],\n tests: res1[\"tests\"],\n testsPerOneMillion: res1[\"testsPerOneMillion\"],\n affectedCountries: res1[\"affectedCountries\"]\n }\n\n res.each do |country|\n result<<{\n country: country[\"country\"],\n lat: country[\"countryInfo\"][\"lat\"],\n long: country[\"countryInfo\"][\"long\"],\n flag: country[\"countryInfo\"][\"flag\"],\n cases: country[\"cases\"],\n todayCases: country[\"todayCases\"],\n deaths: country[\"deaths\"],\n todayDeaths: country[\"todayDeaths\"],\n recovered: country[\"recovered\"],\n active: country[\"active\"],\n critical: country[\"critical\"],\n casesPerOneMillion: country[\"casesPerOneMillion\"],\n deathsPerOneMillion: country[\"deathsPerOneMillion\"],\n tests: country[\"tests\"],\n testsPerOneMillion: country[\"testsPerOneMillion\"]\n }\n end\n render json: result\n end",
"title": ""
}
] |
[
{
"docid": "b7f89ac83728be0eceadead9e0ca0441",
"score": "0.7087945",
"text": "def countries_geo_entity_stats\n countries.present? ? GeoEntityStat.where(geo_entity_id: countries.map(&:id)) : geo_entity_stats\n end",
"title": ""
},
{
"docid": "b76f5e57a30e68149fde81cca6898bb8",
"score": "0.69862634",
"text": "def all_countries_totals\n json_response('/country/all')\n end",
"title": ""
},
{
"docid": "f4a254ebe51f344f049baf03664b524a",
"score": "0.658731",
"text": "def world_totals\n json_response('/totals')\n end",
"title": ""
},
{
"docid": "410be44b5c5b2c9b8f3ef5c88e8b660b",
"score": "0.6358077",
"text": "def geodatos\n end",
"title": ""
},
{
"docid": "2eeada37f4e0e6e1917f00ae33a8601a",
"score": "0.6119522",
"text": "def find_total_population(countries) #function\n population = 0\n\n for country in countries\n population += country[:population]\n country[:population] = 0\n end\n\n return population\n\n end",
"title": ""
},
{
"docid": "0ab772439ff9593b02934ebae25a5e31",
"score": "0.610204",
"text": "def getFlatpackBy_country( country, latitude, longitude)\n params = Hash.new\n params['country'] = country\n params['latitude'] = latitude\n params['longitude'] = longitude\n return doCurl(\"get\",\"/flatpack/by_country\",params)\n end",
"title": ""
},
{
"docid": "d8b601f16d48c1671ee474e7c45bed48",
"score": "0.6094009",
"text": "def all_countries \n\t\tself.class.get('/all')\n\tend",
"title": ""
},
{
"docid": "ef1a8e3641421d28ca8a5ac777e83ed8",
"score": "0.6063452",
"text": "def country_total\n @totals = {}\n (@start_date..@end_date).each do |date|\n key_pattern = params[:country].present? ? \"Country:#{date}:#{params[:country]}*\" : \"Country:#{date}*\"\n keys = REDIS.keys key_pattern\n keys.each do |key|\n value = REDIS.get key\n split_key = key.split ':'\n split_value = value.split ':'\n country = split_key[2]\n currency = split_key[3]\n amount = split_value[0]\n usd_amount = split_value[1]\n total = split_value[2]\n country_name = split_value[3]\n total_key = \"#{country}_#{currency}\"\n @totals[total_key] ||= { currency: currency,\n country_total: 0,\n country_total_usd: 0,\n country_name: country_name,\n total_count: 0,\n arpu: 0 }\n @totals[total_key][:country_total] += amount.to_d.truncate(2).to_money(currency)\n @totals[total_key][:country_total_usd] += usd_amount.to_d.truncate(2).to_money\n @totals[total_key][:total_count] += total.to_i\n @totals[total_key][:arpu] = @totals[total_key][:country_total_usd] / @totals[total_key][:total_count]\n end\n end\n\n @totals = @totals.sort_by { |_key, value| value[:total_count] }.reverse\n @country_total = @totals.map { |_key, total| total[:country_total_usd] }.sum\n @total_count = @totals.map { |_key, value| value[:total_count] }.sum\n\n respond_to do |format|\n format.html do\n end\n format.csv do\n send_data to_csv('country_total', @totals), type: 'text/csv; charset=utf-8; header=present',\n disposition: \"attachment; filename=country_total-#{Time.now.strftime('%Y-%m-%d-%H:%M:%S')}.csv\"\n end\n end\n end",
"title": ""
},
{
"docid": "d19684aa0bedb8a836e85dbdea00155c",
"score": "0.60248226",
"text": "def countries(params = {})\n timeseries = params.is_a?(Timeseries) ? params : Timeseries.new(params)\n table = :\"bitcoinppi_#{timeseries.tick.sub(\" \", \"_\")}\"\n dataset = DB[table]\n .select(:time, :tick, :country, :currency, :bitcoin_price, :bigmac_price, :weight, :local_ppi)\n .where(tick: timeseries.range)\n .order(Sequel.desc(:tick))\n end",
"title": ""
},
{
"docid": "0311091873c075e1a2aeb0027d432ff4",
"score": "0.60142225",
"text": "def country_values\n %w(\n Austria\n Belgium\n Denmark\n Finland\n France\n Germany\n Greece\n Iceland\n Ireland\n Italy\n Netherlands\n Norway\n Portugal\n Spain\n Sweden\n Switzerland\n United Kingdom\n USA\n )\n end",
"title": ""
},
{
"docid": "2f2e7cf11669c508a2c8e086a6c630fb",
"score": "0.60082227",
"text": "def countries\r\n\t\t\tCOUNTRIES\r\n\t\tend",
"title": ""
},
{
"docid": "58c5fbd504ecc7b6e866355ebede62b1",
"score": "0.5974203",
"text": "def filter_countries\n SUPER_COUNTRIES\n end",
"title": ""
},
{
"docid": "d861e7105b26510383bc12ee0fef447c",
"score": "0.5944727",
"text": "def country_list\n get_request( \"/api/v2_1/api/countries\")\n end",
"title": ""
},
{
"docid": "4a1191b0830ed00205ed8de991ab07ce",
"score": "0.5940114",
"text": "def countries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CountriesApi#countries ...\"\n end\n \n # resource path\n local_var_path = \"/countries/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'languageCode'] = opts[:'language_code'] if opts[:'language_code']\n query_params[:'key'] = opts[:'key'] if opts[:'key']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CountryList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CountriesApi#countries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d7856a1a4f9f3bb0713c7dbc6bd0cb75",
"score": "0.5897874",
"text": "def get_country\n @single_city_data[\"sys\"][\"country\"]\n end",
"title": ""
},
{
"docid": "7cb791e6eac4829634967e9fa679ce5b",
"score": "0.5895269",
"text": "def countries\n @countries = Spree::Country.where(name: Spree::Config[:default_address_country])\n zone = Spree::Zone.find_by(name: Spree::Config[:address_zone_name]) if Spree::Config[:address_zone_name]\n @countries = zone.countries.order(:name) if zone.present?\n end",
"title": ""
},
{
"docid": "a5335a0e0c00734ac2d10562bcb88f39",
"score": "0.5831769",
"text": "def location_countries\r\n\t\treturn LocationCountry.find :all, :order=>\"sort_order, name ASC\"\r\n\tend",
"title": ""
},
{
"docid": "a193ca52ce1983ef3313cf423b581333",
"score": "0.58281463",
"text": "def sell_shipping_countries_all (params={})\r\n req = request_params({locale: @locale}.merge(params))\r\n\r\n feed_or_retry do\r\n RestClient.get url, req\r\n end \r\n end",
"title": ""
},
{
"docid": "83c59240d02b41335b1c0f3df2e6357e",
"score": "0.58204573",
"text": "def all\n countries\n end",
"title": ""
},
{
"docid": "b0394c559f13eb4c23bbb9142eca4b00",
"score": "0.5818202",
"text": "def countries\n \tif params[:continent_id].present?\n \t\tputs params[:continent_id]\n \t\tvalor = params[:continent_id]\n \t\tcountries = Country.joins(:country_category).where(status: true, continent_number: [valor]).select(:id,:name,:name_cr,:flag_image,:generic_image,:country_category_id,'country_categories.percentage_profile AS country_category_percentage_profile')\n \trender json: countries\n else\n \trender :json => {:result => 'ERROR'}\n \tend\n end",
"title": ""
},
{
"docid": "1b3554acb764c0353096465015e592c2",
"score": "0.58085907",
"text": "def countries\n countries = YAML.load_file(Rails.root.join('data', 'locale_countries.yml'))\n countries.select! { |_, flag| File.exist? Rails.root.join('app', 'assets', 'images', 'country-flags', \"#{flag.downcase}.png\") }\n # apply potential region values too\n Dir.glob(Rails.root.join('app', 'assets', 'images', 'country-flags', '*.png')).each do |file|\n base = File.basename(file, '.png')\n next if base.starts_with?('_')\n countries[base.upcase] = base\n end\n\n countries.each { |key, flag| countries[key] = view_context.image_path(\"country-flags/#{flag.downcase}.png\") }\n\n render json: countries.to_json\n end",
"title": ""
},
{
"docid": "f8fc274bbd53876cf98770dbec2b376a",
"score": "0.5804792",
"text": "def country; end",
"title": ""
},
{
"docid": "f8fc274bbd53876cf98770dbec2b376a",
"score": "0.5804792",
"text": "def country; end",
"title": ""
},
{
"docid": "f8fc274bbd53876cf98770dbec2b376a",
"score": "0.5804792",
"text": "def country; end",
"title": ""
},
{
"docid": "74014c05f9e2fe75cf636b93c6791336",
"score": "0.58001256",
"text": "def total_members_by(geo, results)\n totals = results.each_with_object(Hash.new(0)) do |res,counts|\n next unless [\"us\",\"ca\"].include?(res.country)\n counts[res.send(geo.to_sym)] += res.members.to_i\n end\n puts \"TOTAL: #{totals.values.inject(:+)}\"\n \n totals = totals.sort_by { |geo,count| -count }\n puts \"Total members by #{geo.to_s}: \"\n totals.each do |k,v|\n puts \"#{k}: #{v}\"\n end\nend",
"title": ""
},
{
"docid": "4063e95f86e07940bff98f20aeed02ec",
"score": "0.57920533",
"text": "def country\n query = create_query(\n :Location, :regexp_search, regexp: \"#{params[:country]}$\"\n )\n show_selected_locations(query, link_all_sorts: true)\n end",
"title": ""
},
{
"docid": "9488c0610e72d5662b309022c2571a6d",
"score": "0.578982",
"text": "def by_country(country='all')\n\n result = [ ['Country', 'Amount'] ]\n country = (country == 'all') ? \"[Nationalities].children\" : \"[Nationalities].[#{country}]\"\n\n r = @connection.from('Gears').\n columns('[Measures].[Players]').\n rows(country).\n nonempty().execute\n\n r.axis_full_names[1].each_with_index {|country, index|\n\n c = TZInfo::Country.get(country.split('.')[1].gsub('[','').gsub(']','')).name\n v = r.values[index][0]\n result << [ c , v ]\n }\n result\n end",
"title": ""
},
{
"docid": "8aef18a10a89886d345231c655418cc0",
"score": "0.5785978",
"text": "def circle_zone(lat, lon, count, options = {})\n url = 'http://api.openweathermap.org/data/2.5/find'\n new(options.merge(lat: lat, lon: lon, cnt: count)).retrieve url\n end",
"title": ""
},
{
"docid": "0f9bdfcced49fbb2ac3e53d1795a0768",
"score": "0.578014",
"text": "def country\n data['country']\n end",
"title": ""
},
{
"docid": "a1f9025cee516e74aae33efb339ddd26",
"score": "0.5779861",
"text": "def geo\n\t\tciudad = params[:id]\n\t\t@ubication = City.where(id: ciudad)\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @ubication }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "054663cb740aa40dbc01de3d2d482aee",
"score": "0.5748003",
"text": "def add_countries\n projects = Project.find_public(:all, :conditions => [\"continent_id=?\", params[:continent_id].to_i])\n @countries = [[ 'All ...', '']]\n projects.each do |project|\n sum = 0\n projects.each do |pj|\n sum += 1 if project.country_id==pj.country_id\n end\n name = \"#{!project.country_id.nil? ? project.nation.name : project.place.country.name} (#{sum})\"\n @countries << [name, project.country_id]\n end\n @countries.uniq!\n respond_to do |format|\n format.js {\n render :update do |page|\n page.replace_html \"country_id_container\", :partial => \"select_countries\"\n end\n }\n end\n end",
"title": ""
},
{
"docid": "ead2658d2f67d7db510e00fe4012c822",
"score": "0.5736456",
"text": "def geo; end",
"title": ""
},
{
"docid": "720f4f30d92b763dbbe9ddfada6e4ef9",
"score": "0.5722239",
"text": "def get_country_code\n Geonames::WebService.country_code @latitude, @longitude\n end",
"title": ""
},
{
"docid": "88f037e28a188d55bc36f5a76638fc70",
"score": "0.57220393",
"text": "def count_population_of_uk(collection_of_countries)\n total_population = 0\n for country in collection_of_countries\n total_population += country[:population]\n end\n return total_population\nend",
"title": ""
},
{
"docid": "5c785808cea39f80da006141cc1d8117",
"score": "0.57159567",
"text": "def country_fr()\n @request_data = {\n\t\t\t\"type\"\t\t=> \"home\",\n \"ip\" => \"178.251.201.141\",\n \"session\" => \"new\",\n \"cuid\" => \"new\",\n \"lang\" => \"en\",\n \"site\" => \"ctshirts\",\n \"currentURI\" => \"http://www.ctshirts.co.uk\",\n \"previousURI\" => \"http://www.ctshirts.co.uk\",\n \"clientToken\" => \"677ab692r2t3u4t\", \n \"recContent\" => \"refCodeOnly\",\n }\n @json_request = \"\"\n @response_times = []\n\t\tend",
"title": ""
},
{
"docid": "9957350e70c904ec5d7df0462c85900e",
"score": "0.57116556",
"text": "def countries\n collection(\"countries\")\n end",
"title": ""
},
{
"docid": "3bc0580eaf27a6a237f16cf05e1f4b6b",
"score": "0.56959975",
"text": "def count_by(geo, results)\n totals = results.each_with_object(Hash.new(0)) do |res,counts|\n # binding.pry\n next unless [\"us\",\"ca\"].include?(res.country)\n counts[res.send(geo.to_sym)] += 1\n end\n puts \"TOTAL: #{totals.values.inject(:+)}\"\n\n totals = totals.sort_by { |geo,count| -count }\n\n puts \"Total groups by #{geo.to_s}: \"\n totals.each do |k,v|\n puts \"#{k}: #{v}\"\n end\nend",
"title": ""
},
{
"docid": "4ef50b2cd9d4b186cedc79585ce5f1f3",
"score": "0.5671578",
"text": "def country_map\n @country_map ||= load_countries\n end",
"title": ""
},
{
"docid": "a69d92a9e53d3282e63d16ee8b6af447",
"score": "0.56594175",
"text": "def country_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.country ...'\n end\n # resource path\n local_var_path = '/country'\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[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<CountryMetadata>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#country\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "afe024a06c3dcc0746903b92e16c9435",
"score": "0.56453544",
"text": "def get_by_lat_lng\n\tend",
"title": ""
},
{
"docid": "29e44710251045d23d74d1d419f0bbe2",
"score": "0.5632487",
"text": "def getFlatpackBy_countryKml( country)\n params = Hash.new\n params['country'] = country\n return doCurl(\"get\",\"/flatpack/by_country/kml\",params)\n end",
"title": ""
},
{
"docid": "6bda3462b97dd933679819bfdb6a3917",
"score": "0.5631521",
"text": "def count_population(country)\n population = 0\n for country in country\n population += country[:population]\n end\n return population\nend",
"title": ""
},
{
"docid": "7b0199aa50e61ae26abdbedad0e1bd07",
"score": "0.5624188",
"text": "def country_us()\n @request_data = {\n\t\t\t\"type\"\t\t=> \"home\",\n \"ip\" => \"12.25.205.51\",\n \"session\" => \"new\",\n \"cuid\" => \"new\",\n \"lang\" => \"en\",\n \"site\" => \"ctshirts\",\n \"currentURI\" => \"http://www.ctshirts.co.uk\",\n \"previousURI\" => \"http://www.ctshirts.co.uk\",\n \"clientToken\" => \"677ab692r2t3u4t\", \n \"recContent\" => \"refCodeOnly\",\n }\n @json_request = \"\"\n @response_times = []\n end",
"title": ""
},
{
"docid": "deadbf63c894e701b2b612cb090c55a5",
"score": "0.56167394",
"text": "def index\n @geo_data = GeoDatum.all\n end",
"title": ""
},
{
"docid": "717f71bc402054d3dc169e8c345e682c",
"score": "0.56034124",
"text": "def country_details(region, input)\n country = @countries[input - 1]\n\n Table.display_as_summary(country)\n browse_online(country)\n end",
"title": ""
},
{
"docid": "30a03179ea0a517e7ce2ab0dc9eef934",
"score": "0.5599929",
"text": "def spot_countries\n now = DateTime.now\n hash_groups = countries(from: now - 24.hours, to: now, tick: \"15 minutes\")\n .select_append { avg(:local_ppi).over(partition: :country, order: Sequel.desc(:tick), frame: :all).as(:avg_24h_local_ppi) }\n .to_hash_groups(:country)\n hash_groups.each { |country, data| hash_groups[country] = data.first }\n hash_groups\n end",
"title": ""
},
{
"docid": "f293ef08b9c8c19c22e400a7863eb419",
"score": "0.55944616",
"text": "def country_gb()\n @request_data = {\n\t\t\t\"type\"\t\t=> \"home\",\n \"ip\" => \"89.187.117.101\",\n \"session\" => \"new\",\n \"cuid\" => \"new\",\n \"lang\" => \"en\",\n \"site\" => \"ctshirts\",\n \"currentURI\" => \"http://www.ctshirts.co.uk\",\n \"previousURI\" => \"http://www.ctshirts.co.uk\",\n \"clientToken\" => \"677ab692r2t3u4t\", \n \"recContent\" => \"refCodeOnly\",\n }\n @json_request = \"\"\n @response_times = []\n end",
"title": ""
},
{
"docid": "38dc104bc8e6999882632b64184ae70c",
"score": "0.5593637",
"text": "def build_areas_from_country_codes\n CSV.read(\"#{@args[:data_directory]}data/external/country_names_and_code_elements.txt\", options = {headers: true, col_sep: ';'}).each do |r|\n @data_index.add_item(\n name: uncapitalize(r['Country Name']),\n parent_names: [@earth.name],\n lvl0: uncapitalize(r['Country Name']),\n source_table: 'country_names_and_code_elements',\n geographic_area_type_name: 'Country',\n is_internal_node: true,\n iso_3166_a2: r['ISO 3166-1-alpha-2 code']\n )\n end\n end",
"title": ""
},
{
"docid": "6ceea5be81817a516b3d86b817646590",
"score": "0.5590251",
"text": "def get_countries\n perform(:get, 'enum/countries', nil, nonauth_headers).body\n end",
"title": ""
},
{
"docid": "3152592c5846c12246f7aeab02bf043d",
"score": "0.55843616",
"text": "def fetch_cities_from_aramex\n response = []\n zones = Spree::ShippingMethod.where(['LOWER(admin_name) like ?', '%aramex%']).map(&:zones).flatten\n if zones.map(&:country_ids).flatten.uniq.include?(params['country_code'].to_i)\n country = Spree::Country.find(params['country_code'])\n response = JSON.parse(fetch_cities(country.iso))['Cities']\n end\n respond_to do |format|\n format.json { render json: response, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "fbb12bc6880a6990404e83896f529b19",
"score": "0.5582204",
"text": "def index\n @areas = Area.with_ordered_countries\n respond_with(@areas)\n end",
"title": ""
},
{
"docid": "eb92296013e9e2a5068f92f78a3c15f8",
"score": "0.5579903",
"text": "def show\n @country = Country.includes(:regions).find(params[:id])\n @tours = Tour.search(params.merge({ region: @country.region_ids}))\n @attractions = @country.regions.map { |i| i.attractions }.flatten\n @hotels = @country.regions.map { |i| i.hotels }.flatten\n @photos = @country.regions.map { |i| i.gallery.photos if i.gallery }.flatten.uniq.compact\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country }\n end\n end",
"title": ""
},
{
"docid": "435e58460c73e943bec5a5ae7b3cacfe",
"score": "0.5579585",
"text": "def identify_countries\n names = YAML.load_file( File.dirname(File.expand_path(__FILE__)) + '/lang/' + @lang + '/countries.yml' )\n names.each do |code,name|\n @svg.gsub!(\"class=\\\"land #{code}\\\"\", \"class=\\\"land #{code}\\\" country-name=\\\"#{name}\\\" country-value=\\\"#{@data[code]}\\\" onmouseover=\\\"worldMapOver(this)\\\" onmouseout=\\\"worldMapOut(this)\\\" onclick=\\\"worldMapClick(this)\\\" ondblclick=\\\"worldMapDblClick(this)\\\"\")\n end\n end",
"title": ""
},
{
"docid": "2681fdf06ca83e609510337865ca6399",
"score": "0.5570927",
"text": "def get_countries\n \tresponse = invoke(\"web:GetCountries\", :soap_action => :none)\n\n \tnode = response.document.xpath('//ns:GetCountriesResult', ns)[0]\n \tparse_country_description(node)\n end",
"title": ""
},
{
"docid": "fa0216f8fa3712eda89ec31ca63b519f",
"score": "0.55696106",
"text": "def index\n @countries = Country.all\n @collected = {}\n @not_collected = {}\n @countries.each do |c|\n @collected[c.id] = c.currencies.count#CountriesCurrencies.collected_in(c.id)\n @not_collected[c.id] = CountriesCurrencies.not_collected_in(c.id)\n end\n end",
"title": ""
},
{
"docid": "7b1c4e00c7034b3f73055aaa89196c53",
"score": "0.55666065",
"text": "def show_countries(countries)\n for country in countries\n puts country[:name]\n end\nend",
"title": ""
},
{
"docid": "792b246b293a6da5eac0454a57f607ba",
"score": "0.55562913",
"text": "def countries(input)\n get_single_method(:countries, input)\n end",
"title": ""
},
{
"docid": "572af35f16c1e994487fce9f628fcdbb",
"score": "0.5547373",
"text": "def country(code, name); end",
"title": ""
},
{
"docid": "f2c46ee4d5d832e97d5c3be5f30dbccc",
"score": "0.55343044",
"text": "def countries_three\n \tcountries = Country.joins(:country_category).where(status: true, id: [46,88,234]).select(:id,:name,:name_cr,:flag_image,:generic_image,:country_category_id,'country_categories.percentage_profile AS country_category_percentage_profile')\n \trender json: countries\n end",
"title": ""
},
{
"docid": "3864057fd7bc9bbb6e5b6461f081257d",
"score": "0.55211794",
"text": "def get_country_statistics_report(country_list, device_access)\n @country_hash = {}\n country_list.each do |country|\n country_count = device_access.where(:access_country => country).count\n @country_hash[country] = country_count \n end\n country_stat = @country_hash.sort_by {|_key, value| value}.reverse\n hash = Hash[*country_stat.flatten]\n end",
"title": ""
},
{
"docid": "50fbde18cb60ab6dd1113f54558b1ab3",
"score": "0.5519802",
"text": "def show\n @countries = [[\"OC Oceania\",\"oc\"],[\"AD Andorra\", \"ad\"],[\"AE United Arab Emirates\", \"ae\"],[\"AF Afghanistan\", \"af\"],[\"AG Antigua and Barbuda\", \"ag\"],[\"AI Anguilla\", \"ai\"],[\"AL Albania\", \"al\"],[\"AM Armenia\", \"am\"],[\"AO Angola\", \"ao\"],[\"AQ Antarctica\", \"aq\"],[\"AR Argentina\", \"ar\"],[\"AS American Samoa\", \"as\"],[\"AT Austria\", \"at\"],[\"AU Australia\", \"au\"],[\"AW Aruba\", \"aw\"],[\"AX Åland Islands\", \"ax\"],[\"AZ Azerbaijan\", \"az\"],[\"BA Bosnia and Herzegovina\", \"ba\"],[\"BB Barbados\", \"bb\"],[\"BD Bangladesh\", \"bd\"],[\"BE Belgium\", \"be\"],[\"BF Burkina Faso\", \"bf\"],[\"BG Bulgaria\", \"bg\"],[\"BH Bahrain\", \"bh\"],[\"BI Burundi\", \"bi\"],[\"BJ Benin\", \"bj\"],[\"BL Saint Barthélemy\", \"bl\"],[\"BM Bermuda\", \"bm\"],[\"BN Brunei Darussalam\", \"bn\"],[\"BO Bolivia, Plurinational State of\", \"bo\"],[\"BQ Bonaire, Sint Eustatius and Saba\", \"bq\"],[\"BR Brazil\", \"br\"],[\"BS Bahamas\", \"bs\"],[\"BT Bhutan\", \"bt\"],[\"BV Bouvet Island\", \"bv\"],[\"BW Botswana\", \"bw\"],[\"BY Belarus\", \"by\"],[\"BZ Belize\", \"bz\"],[\"CA Canada\", \"ca\"],[\"CC Cocos (Keeling) Islands\", \"cc\"],[\"CD Congo, the Democratic Republic of the\", \"cd\"],[\"CF Central African Republic\", \"cf\"],[\"CG Congo\", \"cg\"],[\"CH Switzerland\", \"ch\"],[\"CI Côte d'Ivoire\", \"ci\"],[\"CK Cook Islands\", \"ck\"],[\"CL Chile\", \"cl\"],[\"CM Cameroon\", \"cm\"],[\"CN China\", \"cn\"],[\"CO Colombia\", \"co\"],[\"CR Costa Rica\", \"cr\"],[\"CU Cuba\", \"cu\"],[\"CV Cape Verde\", \"cv\"],[\"CW Curaçao\", \"cw\"],[\"CX Christmas Island\", \"cx\"],[\"CY Cyprus\", \"cy\"],[\"CZ Czech Republic\", \"cz\"],[\"DE Germany\", \"de\"],[\"DJ Djibouti\", \"dj\"],[\"DK Denmark\", \"dk\"],[\"DM Dominica\", \"dm\"],[\"DO Dominican Republic\", \"do\"],[\"DZ Algeria\", \"dz\"],[\"EC Ecuador\", \"ec\"],[\"EE Estonia\", \"ee\"],[\"EG Egypt\", \"eg\"],[\"EH Western Sahara\", \"eh\"],[\"ER Eritrea\", \"er\"],[\"ES Spain\", \"es\"],[\"ET Ethiopia\", \"et\"],[\"FI Finland\", \"fi\"],[\"FJ Fiji\", \"fj\"],[\"FK Falkland Islands (Malvinas)\", \"fk\"],[\"FM Micronesia, Federated States of\", \"fm\"],[\"FO Faroe Islands\", \"fo\"],[\"FR France\", \"fr\"],[\"GA Gabon\", \"ga\"],[\"GB United Kingdom\", \"gb\"],[\"GD Grenada\", \"gd\"],[\"GE Georgia\", \"ge\"],[\"GF French Guiana\", \"gf\"],[\"GG Guernsey\", \"gg\"],[\"GH Ghana\", \"gh\"],[\"GI Gibraltar\", \"gi\"],[\"GL Greenland\", \"gl\"],[\"GM Gambia\", \"gm\"],[\"GN Guinea\", \"gn\"],[\"GP Guadeloupe\", \"gp\"],[\"GQ Equatorial Guinea\", \"gq\"],[\"GR Greece\", \"gr\"],[\"GS South Georgia and the South Sandwich Islands\", \"gs\"],[\"GT Guatemala\", \"gt\"],[\"GU Guam\", \"gu\"],[\"GW Guinea-Bissau\", \"gw\"],[\"GY Guyana\", \"gy\"],[\"HK Hong Kong\", \"hk\"],[\"HM Heard Island and McDonald Islands\", \"hm\"],[\"HN Honduras\", \"hn\"],[\"HR Croatia\", \"hr\"],[\"HT Haiti\", \"ht\"],[\"HU Hungary\", \"hu\"],[\"ID Indonesia\", \"id\"],[\"IE Ireland\", \"ie\"],[\"IL Israel\", \"il\"],[\"IM Isle of Man\", \"im\"],[\"IN India\", \"in\"],[\"IO British Indian Ocean Territory\", \"io\"],[\"IQ Iraq\", \"iq\"],[\"IR Iran, Islamic Republic of\", \"ir\"],[\"IS Iceland\", \"is\"],[\"IT Italy\", \"it\"],[\"JE Jersey\", \"je\"],[\"JM Jamaica\", \"jm\"],[\"JO Jordan\", \"jo\"],[\"JP Japan\", \"jp\"],[\"KE Kenya\", \"ke\"],[\"KG Kyrgyzstan\", \"kg\"],[\"KH Cambodia\", \"kh\"],[\"KI Kiribati\", \"ki\"],[\"KM Comoros\", \"km\"],[\"KN Saint Kitts and Nevis\", \"kn\"],[\"KP Korea, Democratic People's Republic of\", \"kp\"],[\"KR Korea, Republic of\", \"kr\"],[\"KW Kuwait\", \"kw\"],[\"KY Cayman Islands\", \"ky\"],[\"KZ Kazakhstan\", \"kz\"],[\"LA Lao People's Democratic Republic\", \"la\"],[\"LB Lebanon\", \"lb\"],[\"LC Saint Lucia\", \"lc\"],[\"LI Liechtenstein\", \"li\"],[\"LK Sri Lanka\", \"lk\"],[\"LR Liberia\", \"lr\"],[\"LS Lesotho\", \"ls\"],[\"LT Lithuania\", \"lt\"],[\"LU Luxembourg\", \"lu\"],[\"LV Latvia\", \"lv\"],[\"LY Libya\", \"ly\"],[\"MA Morocco\", \"ma\"],[\"MC Monaco\", \"mc\"],[\"MD Moldova, Republic of\", \"md\"],[\"ME Montenegro\", \"me\"],[\"MF Saint Martin (French part)\", \"mf\"],[\"MG Madagascar\", \"mg\"],[\"MH Marshall Islands\", \"mh\"],[\"MK Macedonia, the former Yugoslav Republic of\", \"mk\"],[\"ML Mali\", \"ml\"],[\"MM Myanmar\", \"mm\"],[\"MN Mongolia\", \"mn\"],[\"MO Macao\", \"mo\"],[\"MP Northern Mariana Islands\", \"mp\"],[\"MQ Martinique\", \"mq\"],[\"MR Mauritania\", \"mr\"],[\"MS Montserrat\", \"ms\"],[\"MT Malta\", \"mt\"],[\"MU Mauritius\", \"mu\"],[\"MV Maldives\", \"mv\"],[\"MW Malawi\", \"mw\"],[\"MX Mexico\", \"mx\"],[\"MY Malaysia\", \"my\"],[\"MZ Mozambique\", \"mz\"],[\"NA Namibia\", \"na\"],[\"NC New Caledonia\", \"nc\"],[\"NE Niger\", \"ne\"],[\"NF Norfolk Island\", \"nf\"],[\"NG Nigeria\", \"ng\"],[\"NI Nicaragua\", \"ni\"],[\"NL Netherlands\", \"nl\"],[\"NO Norway\", \"no\"],[\"NP Nepal\", \"np\"],[\"NR Nauru\", \"nr\"],[\"NU Niue\", \"nu\"],[\"NZ New Zealand\", \"nz\"],[\"OM Oman\", \"om\"],[\"PA Panama\", \"pa\"],[\"PE Peru\", \"pe\"],[\"PF French Polynesia\", \"pf\"],[\"PG Papua New Guinea\", \"pg\"],[\"PH Philippines\", \"ph\"],[\"PK Pakistan\", \"pk\"],[\"PL Poland\", \"pl\"],[\"PM Saint Pierre and Miquelon\", \"pm\"],[\"PN Pitcairn\", \"pn\"],[\"PR Puerto Rico\", \"pr\"],[\"PS Palestine, State of\", \"ps\"],[\"PT Portugal\", \"pt\"],[\"PW Palau\", \"pw\"],[\"PY Paraguay\", \"py\"],[\"QA Qatar\", \"qa\"],[\"RE Réunion\", \"re\"],[\"RO Romania\", \"ro\"],[\"RS Serbia\", \"rs\"],[\"RU Russian Federation\", \"ru\"],[\"RW Rwanda\", \"rw\"],[\"SA Saudi Arabia\", \"sa\"],[\"SB Solomon Islands\", \"sb\"],[\"SC Seychelles\", \"sc\"],[\"SD Sudan\", \"sd\"],[\"SE Sweden\", \"se\"],[\"SG Singapore\", \"sg\"],[\"SH Saint Helena, Ascension and Tristan da Cunha\", \"sh\"],[\"SI Slovenia\", \"si\"],[\"SJ Svalbard and Jan Mayen\", \"sj\"],[\"SK Slovakia\", \"sk\"],[\"SL Sierra Leone\", \"sl\"],[\"SM San Marino\", \"sm\"],[\"SN Senegal\", \"sn\"],[\"SO Somalia\", \"so\"],[\"SR Suriname\", \"sr\"],[\"SS South Sudan\", \"ss\"],[\"ST Sao Tome and Principe\", \"st\"],[\"SV El Salvador\", \"sv\"],[\"SX Sint Maarten (Dutch part)\", \"sx\"],[\"SY Syrian Arab Republic\", \"sy\"],[\"SZ Swaziland\", \"sz\"],[\"TC Turks and Caicos Islands\", \"tc\"],[\"TD Chad\", \"td\"],[\"TF French Southern Territories\", \"tf\"],[\"TG Togo\", \"tg\"],[\"TH Thailand\", \"th\"],[\"TJ Tajikistan\", \"tj\"],[\"TK Tokelau\", \"tk\"],[\"TL Timor-Leste\", \"tl\"],[\"TM Turkmenistan\", \"tm\"],[\"TN Tunisia\", \"tn\"],[\"TO Tonga\", \"to\"],[\"TR Turkey\", \"tr\"],[\"TT Trinidad and Tobago\", \"tt\"],[\"TV Tuvalu\", \"tv\"],[\"TW Taiwan, Province of China\", \"tw\"],[\"TZ Tanzania, United Republic of\", \"tz\"],[\"UA Ukraine\", \"ua\"],[\"UG Uganda\", \"ug\"],[\"UM United States Minor Outlying Islands\", \"um\"],[\"US United States\", \"us\"],[\"UY Uruguay\", \"uy\"],[\"UZ Uzbekistan\", \"uz\"],[\"VA Holy See (Vatican City State)\", \"va\"],[\"VC Saint Vincent and the Grenadines\", \"vc\"],[\"VE Venezuela, Bolivarian Republic of\", \"ve\"],[\"VG Virgin Islands, British\", \"vg\"],[\"VI Virgin Islands, U.S.\", \"vi\"],[\"VN Viet Nam\", \"vn\"],[\"VU Vanuatu\", \"vu\"],[\"WF Wallis and Futuna\", \"wf\"],[\"WS Samoa\", \"ws\"],[\"YE Yemen\", \"ye\"],[\"YT Mayotte\", \"yt\"],[\"ZA South Africa\", \"za\"],[\"ZM Zambia\", \"zm\"],[\"ZW Zimbabwe\", \"zw\"]]\n @fullscreen = true\n @match = nil\n # current match\n if @table.matches.where(is_running: true).size > 0\n @match = @table.matches.where(is_running: true).first\n end\n # previous match\n if @table.matches.where(is_running: true).size == 0 && @table.matches.where(is_over: true).size > 0\n @match = @table.matches.where(is_over: true).reorder(\"matches.finished_at DESC\").first\n end\n if @table.banner.blank?\n @banner = false\n else\n @banner = true\n end\n end",
"title": ""
},
{
"docid": "edde5d11d7805f1d309a208de0f98fd3",
"score": "0.55190146",
"text": "def countries(input)\n get_single_method('countries', input)\n end",
"title": ""
},
{
"docid": "fae5df013747f4dfecb8d1b662b62851",
"score": "0.55087537",
"text": "def cities\n CS.get :us, :ca\n end",
"title": ""
},
{
"docid": "e50d135c5f0274ec3b0ca9569aaad35b",
"score": "0.54976493",
"text": "def maps_api_location\n \"#{self.city}+#{self.state.sub(\"International\", \"\")}\".sub(\" \", \"+\")\n end",
"title": ""
},
{
"docid": "daf40e5b129ad5306e1635213f8425b6",
"score": "0.5497434",
"text": "def map\n # expires_in 1.year, public: true\n set_metadata({ 'title' => translate('classes.map_title') })\n\n countries = {\n ru: 'RU',\n cs: 'CZ',\n it: 'IT',\n ko: 'SK',\n }\n\n config = params.permit(:q, :country)\n config[:locale] = I18n.locale unless I18n.locale == :en\n config[:theme] = 'wemeditate'\n config[:country] ||= countries[I18n.locale]\n @atlas_url = \"https://atlas.sydevelopers.com/map/embed.js?key=#{ENV.fetch('ATLAS_KEY')}&#{config.to_query}\"\n @atlas_enabled = ENV['ATLAS_LOCALES'].split(',').include?(I18n.locale.to_s)\n \n render layout: 'minimal'\n end",
"title": ""
},
{
"docid": "1c6361ae492d90bd88a96d67272aeab3",
"score": "0.54954046",
"text": "def index\n @positives = Positive.all\n @positives_json= Positive.all.map(&:lonlat).as_json\n\n\n\n\n\n end",
"title": ""
},
{
"docid": "a77740aa05be807520f4bc9404d63e0c",
"score": "0.5479913",
"text": "def countries\n countries_ids = self.answers.where(answer_type: 'geo_countries').first.try(:text_value).split(',')\n Country.where(:id => countries_ids)\n end",
"title": ""
},
{
"docid": "2e7c57eee9cfffd6db0ffcd0ecd5555b",
"score": "0.5473854",
"text": "def index\n @countryinfos = Countryinfo.all\n end",
"title": ""
},
{
"docid": "acb7896fc13aaee48213783b37783486",
"score": "0.5473247",
"text": "def get_info(lat, lon)\n Net::HTTP.get(URI(\"https://api.3geonames.org/#{lat},#{lon}.json\"))\nend",
"title": ""
},
{
"docid": "af994dce9b97dd9d2156aee49ae0e50a",
"score": "0.5472549",
"text": "def index\n @ag_countries = Ag::Country.all\n end",
"title": ""
},
{
"docid": "c048e8c92021ea1c1b7c614671ffa7ce",
"score": "0.54650474",
"text": "def city_and_country\n \"#{self.location.city} - #{self.location.country}\"\n end",
"title": ""
},
{
"docid": "65485f7163e3e29529c7cf271aaa604d",
"score": "0.5464612",
"text": "def import_counties(options)\n import_places PlaceType::County, options\n end",
"title": ""
},
{
"docid": "60d35cfe30146c2460b6db5f3fd440f3",
"score": "0.54639465",
"text": "def get_flights_costs(country)\n\tcoll = settings.db.collection(\"flights\")\n\tresult = {}\n\tflights = coll.find({\"origin_country\"=>country}).each { |row| result[row['id']] = row }\n\tputs result\n\tdestinations = result[\"destinations\"]\n\treturn destinations\nend",
"title": ""
},
{
"docid": "a2c4fa000cf104e11f8b6c46e8091da6",
"score": "0.54489565",
"text": "def countries\n @data.map { |iso2, data| iso2 }\n end",
"title": ""
},
{
"docid": "90972231f8bdc9fa010c36c606b7b151",
"score": "0.5447116",
"text": "def registered_country; end",
"title": ""
},
{
"docid": "eb3452c674bb7aa73d1545f167241b88",
"score": "0.5446297",
"text": "def country_list\n @countries ||= case kind\n when 'country' then\n zoneables\n when 'state' then\n zoneables.collect(&:country)\n when 'county'\n zone_member.zoneable.country_list\n else\n []\n end.flatten.compact.uniq\n end",
"title": ""
},
{
"docid": "9e22c1c7ee9138c168d8b23857850415",
"score": "0.54462254",
"text": "def find_land world\n count = []\n\n world.each_with_index do |y, y_ind|\n #puts y.index(y_ind)\n world[y_ind].each_with_index do |x, x_ind|\n if world[y_ind][x_ind] == 'land'\n count.push continent_size(world, x_ind, y_ind)\n end\n end\n end\n count\nend",
"title": ""
},
{
"docid": "d7a00146dc0ee5fb13ec4658df0c084c",
"score": "0.5445694",
"text": "def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n assert response.rates.size > 0\n end",
"title": ""
},
{
"docid": "b7758c9c4bfe260ad4ebde2431f97a7b",
"score": "0.5441886",
"text": "def free_countries\r\n\t\t\tCountry.countries.values - ShippingZone.find(:all, :include => :countries).collect { |zone| zone.countries.values.collect { |country| country.name } }.flatten\r\n\t\tend",
"title": ""
},
{
"docid": "8f0522fec9e4b29cc66da32d55d5940a",
"score": "0.544101",
"text": "def find_countries(lat_start, lon_start, lat_end, lon_end)\n\n countries = JSON(File.read(Rails.root.join('lib','prediction','countries.json')))\n countries.each do |country|\n if intersects_polygon?(country['coordinates'], lat_start, lon_start, lat_end, lon_end)\n return false\n end\n end\n\n return true\n end",
"title": ""
},
{
"docid": "c95f37ccd933e7332a242c86303a0e64",
"score": "0.5440971",
"text": "def index\n @public_relations = PublicRelation.all.order(round: :desc, created_at: :desc)\n @countries = countries.collect{|x|x[0]}\n end",
"title": ""
},
{
"docid": "c3e584ddcf1a5fba3034732ede5e9641",
"score": "0.5439803",
"text": "def index\n # @places = Place.get_nearby_places(params[:lat], params[:lon]).paginate(:page => get_page)\n @places = Kaminari.paginate_array(Place.get_close_places(params[:lat], params[:lon], params[:radius])).page(get_page)\n render :json => \n { \n :places => @places.as_json(:lean_list => true),\n :page_info => \n { \n :page => get_page,\n :per_page => Place.per_page,\n :total_entries => @places.total_count \n }\n }\n end",
"title": ""
},
{
"docid": "7e8f6fdb1874f9226fea08933f15326c",
"score": "0.5439756",
"text": "def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n\n assert response.rates.size > 0\n end",
"title": ""
},
{
"docid": "7e8f6fdb1874f9226fea08933f15326c",
"score": "0.5439756",
"text": "def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n\n assert response.rates.size > 0\n end",
"title": ""
},
{
"docid": "7e8f6fdb1874f9226fea08933f15326c",
"score": "0.5439756",
"text": "def test_rates_for_locations_with_only_zip_and_country \n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n\n assert response.rates.size > 0\n end",
"title": ""
},
{
"docid": "445c6a4bd162f49d458a30dc09f7f6ca",
"score": "0.5435546",
"text": "def get_country_name\n subdivision = Geonames::WebService.country_subdivision @latitude, @longitude\n subdivision.country_name\n end",
"title": ""
},
{
"docid": "8e76e19521a7d37d3a7a71a70aa751d7",
"score": "0.5431768",
"text": "def country_list\n return [] if type == \"state\"\n return countries if type == \"country\"\n members.collect { |zone| zone.country_list }.flatten\n end",
"title": ""
},
{
"docid": "db4a2a990300247274ffb79613c9a564",
"score": "0.5427006",
"text": "def points\n locale = Location.create( :address => params[:locale] )\n lat = locale.latitude.to_f\n lng = locale.longitude.to_f\n\n # instagram api request\n url = \"https://api.instagram.com/v1/locations/search.json?lat=#{lat.round(3)}&lng=#{lng.round(3)}&client_id=efea46f4c52542348ced4c529263cf33\"\n\n # creates an instance variable @result with the json object\n @result = HTTParty.get url\n\n # makes the json data available for ajax\n render :json => @result\n end",
"title": ""
},
{
"docid": "44ed3cb3109c70a61772691759aa8d8d",
"score": "0.5426927",
"text": "def continent; end",
"title": ""
},
{
"docid": "60ea5a0886d9c1d8935e8aa40ef55f1e",
"score": "0.54181516",
"text": "def results_by_country\n \tresult = Country.all.map do |c|\n \t\tplaces = { }\n \t\t(1..6).each do |place|\n \t\t\tplaces[place] = c.sporters.joins(:competition_results).where(\"competition_results.place = #{place}\").count\n \t\tend\n \t\t{\n \t\t\tname: c.name,\n \t\t\tdata: places\n \t\t}\n \tend\n \trender json: result\n end",
"title": ""
},
{
"docid": "31fa5b9f44f8a083d3d7b4d85cfc48f6",
"score": "0.5417993",
"text": "def data\n @locais.values\n end",
"title": ""
},
{
"docid": "3b873aebfe0e7df19efbe446c5e40b61",
"score": "0.541605",
"text": "def index\n geo = ip_lookup ( request.remote_ip )\n wind = Wind.new( lat: geo.lat, lng: geo.lng )\n loc = wind.location\n @speed = wind.speed\n @bearing = wind.bearing\n @citystate = \"#{loc.city}, #{loc.state}\"\n end",
"title": ""
},
{
"docid": "96d57f657b2a40d57646dd5b00111c21",
"score": "0.541513",
"text": "def test_rates_for_locations_with_only_zip_and_country \n setup_user\n response = @carrier.find_rates(\n @locations[:bare_beverly_hills],\n @locations[:bare_ottawa],\n @packages.values_at(:wii)\n )\n \n assert response.rates.size > 0\n end",
"title": ""
},
{
"docid": "8f9651e7d7b029b5b4433939a1541189",
"score": "0.54146063",
"text": "def whereAmI\n \n lat = params[:latitud]\n long = params[:longitud]\n \n @donde = Geocoder.search(lat + \",\" + long)[0]\n \n render :json => {:direccion => @donde.address }\n \n end",
"title": ""
},
{
"docid": "a2f8a569fc826292086cbc8714d6f3ec",
"score": "0.541087",
"text": "def show\r\n\t\trender_result(\r\n\t\t\tdata: @addr_country,\r\n\t\t\tmeta: {}\r\n\t\t)\r\n\tend",
"title": ""
},
{
"docid": "b6ad7c1a4697462b90438f41204c824c",
"score": "0.541002",
"text": "def index\n @region_countries = RegionCountry.all\n \n\n end",
"title": ""
},
{
"docid": "5649dde08290d9775e673779f223f2ca",
"score": "0.5406436",
"text": "def show\n\n\n @populationresponse = @country.retrievePopulation(2017)\n\n\n end",
"title": ""
},
{
"docid": "032ad3fafbf3c7e2849399fe86bdcf5e",
"score": "0.54007816",
"text": "def get_localities(query)\n p query_escaped = CGI::escape(query)\n @url = \"#{URLBASE}/feed/search.ashx?key=#{KEY}&q=#{query_escaped}&format=#{FORMAT}&num_of_days=2\"\n\n rawdata = ''\n open(@url).each do |line|\n rawdata << line\n end\n data = JSON.parse(rawdata)\n return data[\"search_api\"][\"result\"]\n \n# @city = data[0][\"areaName\"][0][\"value\"]\n# @country = data[0][\"country\"][0][\"value\"]\n# @latitude = data[0][\"latitude\"]\n# @longitude = data[0][\"longitude\"]\n# @population = data[0][\"population\"]\n# @weatherUrl = data[0][\"weatherUrl\"][0][\"value\"]\n end",
"title": ""
},
{
"docid": "a49402d0ad8b454eb2dc8724ac8d4d48",
"score": "0.5394084",
"text": "def set_country\n @country = Country.find(params[:countryId])\n @average = Player.where(flag: @country.flag).by_country.order(:flag).first\n end",
"title": ""
},
{
"docid": "f8695c66c8a9602d78c09249f6158229",
"score": "0.53936154",
"text": "def initialize\n countries.each do |country|\n\t\t\tRails.cache.fetch(country[:code]) do\n\t\t\t\tJSON.parse(Net::HTTP.get(URI.parse(\"https://api.fitpass.mx/v3/cities.json?country=#{country[:code]}\")))\n\t\t\tend\n end\n\tend",
"title": ""
}
] |
18e7742a169dfcb6f7ac10cf812295d8
|
Entry point for rendering a widget (and all its children). Same as to_s only returns an array, for minor performance improvements when using a Rack server (like Sinatra or Rails Metal). Options: see to_s
|
[
{
"docid": "aad2c124270ea7fef6158315362b36d9",
"score": "0.6013043",
"text": "def to_a(options = {}, &blk)\n _render(options, &blk).to_a\n end",
"title": ""
}
] |
[
{
"docid": "02f9d9401099af07d114ceea60531d70",
"score": "0.6492896",
"text": "def render\n wrap @children.map(&:render).join(\"\\n\")\n end",
"title": ""
},
{
"docid": "1770f331e9d384b1a30870aee7946159",
"score": "0.6298789",
"text": "def to_s(options = {}, &blk)\n raise \"Erector::Widget#to_s now takes an options hash, not a symbol. Try calling \\\"to_s(:content_method_name=> :#{options})\\\"\" if options.is_a? Symbol\n _render(options, &blk).to_s\n end",
"title": ""
},
{
"docid": "ca4cbe182eac475e19e40c6bb472a3cc",
"score": "0.62578905",
"text": "def to_s\n content_tag :div, id: @id, class: container_classes, data: @data do\n @content.call(self)\n end\n end",
"title": ""
},
{
"docid": "5433dd96c77b334584cf7bd69d113273",
"score": "0.62554866",
"text": "def to_s\n render.map(&:to_s).join(\"\\n\")\n end",
"title": ""
},
{
"docid": "92ce193b8b412bb62542cacc99cbc16c",
"score": "0.6222985",
"text": "def render_to_string(*)\n result = super\n if result.respond_to?(:each)\n string = +\"\"\n result.each { |r| string << r }\n string\n else\n result\n end\n end",
"title": ""
},
{
"docid": "cae5fc999cea6e2a2fac6f3934690cb5",
"score": "0.620353",
"text": "def to_html\n __getobj__.join(' ')\n end",
"title": ""
},
{
"docid": "1c3173df42713c4a2c2191f5aa032425",
"score": "0.6196089",
"text": "def render\n div[]\n end",
"title": ""
},
{
"docid": "c7d4793c0b30759bf6725f575add647d",
"score": "0.6184931",
"text": "def to_s\n return \"<#{@name}#{attributes_to_s}/>\" if @content.nil?\n content = @content.is_a?(Array) ? array_to_s : CGI.escape_html(@content)\n \"<#{@name}#{attributes_to_s}>#{content}</#{@name}>\"\n end",
"title": ""
},
{
"docid": "9e89c477129b7e348e42b10c65a83854",
"score": "0.61793417",
"text": "def to_html\n @@renderer.render join(\"\\n\")\n end",
"title": ""
},
{
"docid": "f344cb64fa0d6354550344bda7426db0",
"score": "0.6151095",
"text": "def render_boxes\n content = []\n controller.apotomo_root.children.each do |widget|\n content << render_widget(widget) if widget.is_a?(Boxes::Box)\n end\n content.join.html_safe\n end",
"title": ""
},
{
"docid": "b0b2c4bccf5c38e8494f88ab7fef25d5",
"score": "0.6123247",
"text": "def to_s\n content_tag :div, id: @id, class: \"#{container_class} #{@class}\", data: @data do\n @content.call(self)\n end\n end",
"title": ""
},
{
"docid": "8b20d749f32e8ff3be5a37e2dfb1aa59",
"score": "0.61165327",
"text": "def to_a\n @renders\n end",
"title": ""
},
{
"docid": "f1e84c31f0dd6e7956cf0c41a6c423e7",
"score": "0.6094622",
"text": "def render\n sb = StringIO.new\n append_to_string_builder(sb)\n sb.string\n end",
"title": ""
},
{
"docid": "e39d73ab45b9bfc58b87e63cbc44ee94",
"score": "0.6071562",
"text": "def render_widget_for(widget, opts={}, &block) \n ### DISCUSS: let user pass widget OR/and widget_id ?\n widget = apotomo_root.find_by_path(widget) unless widget.kind_of? Apotomo::StatefulWidget\n \n widget.opts = opts unless opts.empty?\n \n #yield target\n \n content = widget.render_content &block\n \n ### DISCUSS: this happens multiple times when calling #render_widget more than once!\n freeze_apotomo_root!\n \n return content\n end",
"title": ""
},
{
"docid": "b33fc7a48528d23b8d1e8c4513130a71",
"score": "0.6070378",
"text": "def render\n to_s\n end",
"title": ""
},
{
"docid": "76e792bb18426b28683812c1e089c740",
"score": "0.60624444",
"text": "def render\n return to_s\n end",
"title": ""
},
{
"docid": "f8619389ce15485cd7dd3e23aa2d8dcd",
"score": "0.605345",
"text": "def to_s\n content_tag :div, id: @id, class: container_class do\n @content.call(self)\n end\n end",
"title": ""
},
{
"docid": "25398dd56c7e60ab50dba01a92fafe1d",
"score": "0.5997258",
"text": "def to_s\n\t\treturn format @root.render!\n\tend",
"title": ""
},
{
"docid": "1a3d54523dbea86d525976fc721cd1cb",
"score": "0.5989437",
"text": "def render\r\n if self.has_content?\r\n self.to_a.inject(''){|loop_str, i|\r\n loop_str += i.nodes.inject(''){|nodes_str, j|\r\n nodes_str += j.render\r\n } \r\n }\r\n else\r\n ''\r\n end\r\n end",
"title": ""
},
{
"docid": "8234774c049fb3bf6b7ed7f9278e9e3d",
"score": "0.5954284",
"text": "def render\n puts to_s\n end",
"title": ""
},
{
"docid": "5462ca33dd2305337e65c7a644e2d2b4",
"score": "0.5858381",
"text": "def to_s(render_method_name=:render, &blk)\n # The @__to_s variable is used as a cache. \n # If it's useful we should add a test for it. -ac\n return @__to_s if @__to_s\n send(render_method_name, &blk)\n @__to_s = output.to_s\n end",
"title": ""
},
{
"docid": "a8c4f54b10aecd971d3814aebc96ff59",
"score": "0.5855213",
"text": "def to_html\n setup unless @items\n html = ''\n @items.each {|i| html << i.out(@collection, @template, @params) }\n if @options[:container] \n html = @template.content_tag(:div, html, :class => @options[:class])\n end \n html\n end",
"title": ""
},
{
"docid": "deb25325cfc5779a145c6fb54950802f",
"score": "0.58436304",
"text": "def inner_html\n @children.join\n end",
"title": ""
},
{
"docid": "c68d80bccbe1eee2663a2c5a39f91bf8",
"score": "0.5839359",
"text": "def inner_html\n @children.join\n end",
"title": ""
},
{
"docid": "c68d80bccbe1eee2663a2c5a39f91bf8",
"score": "0.5839359",
"text": "def inner_html\n @children.join\n end",
"title": ""
},
{
"docid": "5f9be64e914f0ba2fd4ac11c2f4d8ab5",
"score": "0.5831156",
"text": "def to_html; to_s; end",
"title": ""
},
{
"docid": "16c25440b984148492fb64db5cda4de8",
"score": "0.58285034",
"text": "def all(options = {})\n widgets = []\n \n Dir.new(widgetizer_config[:widget_path_full]).entries.each do |dir|\n next if dir =~ @@dir_regex\n \n Dir.new(widgetizer_config[:widget_path_full] + '/' + dir).entries.each do |file|\n next if file =~ @@dir_regex\n \n widgets << { :name => parse_name(file), :view => get_view_html(dir, file) }\n end\n end\n \n raise widgets.pretty_inspect\n end",
"title": ""
},
{
"docid": "49a7f0a60bce16681d50c6733a040869",
"score": "0.5818564",
"text": "def to_html\n @elements.map{ |e| e.is_a?(String) ? e : e.to_html }.join(\"\")\n end",
"title": ""
},
{
"docid": "80b7a1ca1bbbf45a2af8f48ff2287cd3",
"score": "0.58123124",
"text": "def children_to_html\n array_to_html(@children)\n end",
"title": ""
},
{
"docid": "43448d6a0a82a561779c63dc9064eacd",
"score": "0.5773588",
"text": "def render\n render_labels\n render_dijkstra\n render_greedy\n render_a_star\n end",
"title": ""
},
{
"docid": "1d6cbb993e48e84a35d15bb9ae852445",
"score": "0.57724184",
"text": "def children_as_html\n return \"\" if children.nil?\n children.collect{ |sp| sp.to_html }.join\n end",
"title": ""
},
{
"docid": "335c1e4f10b4c156911cae0622466e66",
"score": "0.57690215",
"text": "def content\n @rendered_children.collect{|e| e.last}.join(\"\\n\").html_safe\n end",
"title": ""
},
{
"docid": "6525d1ddcb75607ccad403137ca6ef31",
"score": "0.5768514",
"text": "def render_to_string(*args, &block); end",
"title": ""
},
{
"docid": "b8ce43b3879498d1f283b7f2a4c8c3c9",
"score": "0.57656264",
"text": "def render!\n\t\t\t@dom.collect{|node| node.respond_to?(:render!) ? node.render! : node}.join('')\n\t\tend",
"title": ""
},
{
"docid": "8b8774c9fb7067ef0fae84ad7824f2ea",
"score": "0.5755489",
"text": "def render\n render_children\n end",
"title": ""
},
{
"docid": "6c3cd4966d79f03508701b7bf02f63bf",
"score": "0.57486093",
"text": "def render_widget_for(*args)\n root.render_widget(*args)\n end",
"title": ""
},
{
"docid": "1708b4ad8f285bd886387849f81fb2f8",
"score": "0.5746621",
"text": "def render\n wrap(@bin_packer.bins).html_safe\n end",
"title": ""
},
{
"docid": "24d1320bc08e966c8e06a35de115543a",
"score": "0.5745448",
"text": "def to_iruby\n ['text/html', render]\n end",
"title": ""
},
{
"docid": "82aca317bf10790f7fe9c71b462af22f",
"score": "0.57412314",
"text": "def displayed_widgets\n self.linger_for_ajax(2)\n list = []\n self.div(:class=>\"fl-container-flex widget-content\").h2s(:class=>\"s3d-contentpage-title\").each do |div|\n list << div.text\n end\n return list\n end",
"title": ""
},
{
"docid": "d07345161dc46013b4e9bb43f080b978",
"score": "0.571395",
"text": "def render_builder\n xml = Builder::XmlMarkup.new(:indent => 2)\n xml.instruct!(:xml, :version => '1.0', :encoding => 'UTF-8')\n\n xml.urlset(XmlSitemap::MAP_SCHEMA_OPTIONS) { |s|\n @items.each do |item|\n s.url do |u|\n u.loc item.target\n\n if item.image_location\n u.image :image do |a|\n a.tag!(\"image:loc\") { |b| b.text! item.image_location }\n a.tag!(\"image:caption\") { |b| b.text! item.image_caption } if item.image_caption\n a.tag!(\"image:title\") { |b| b.text! item.image_title } if item.image_title\n a.tag!(\"image:license\") { |b| b.text! item.image_license } if item.image_license\n a.tag!(\"image:geo_location\") { |b| b.text! item.image_geolocation } if item.image_geolocation\n end\n end\n\n u.lastmod item.lastmod_value\n u.changefreq item.changefreq.to_s\n u.priority item.priority.to_s\n end\n end\n }.to_s\n end",
"title": ""
},
{
"docid": "ed76e0cd7170ad2c3e019944c91bcb6a",
"score": "0.5713495",
"text": "def to_s\n content_tag :div, id: @id, class: @class do\n @content.call(self)\n end\n end",
"title": ""
},
{
"docid": "48d257bbf4e5398df62ac008c4e0f536",
"score": "0.56983095",
"text": "def to_s\n begin\n result = \"\\n<#{@element_tag}\"\n @attributes.each {|key, value| result += (' '+key+'=\"'+value+'\"') }\n if @element_children.size>0 or @element_data\n result += \">\"\n else\n result += \"/>\" \n end\n result += @element_data if @element_data\n @element_children.each_value {|array| array.each {|je| result += je.to_s} }\n result += \"\\n\" if @element_children.size>0\n result += \"</#{@element_tag}>\" if @element_children.size>0 or @element_data\n result\n rescue => exception\n puts exception.to_s\n end\n end",
"title": ""
},
{
"docid": "37dd4ad501bd5a38c91db3ee9b7e4ecd",
"score": "0.5697142",
"text": "def to_s\n begin\n result = \"\\n<#{@element_tag}\"\n @attributes.each {|key, value| result += (' '+key+'=\"'+value+'\"') }\n if @element_children.size>0 or @element_data\n result += \">\"\n else\n result += \"/>\"\n end\n result += @element_data if @element_data\n @element_children.each_value {|array| array.each {|je| result += je.to_s} }\n result += \"\\n\" if @element_children.size>0\n result += \"</#{@element_tag}>\" if @element_children.size>0 or @element_data\n result\n rescue => exception\n puts exception.to_s\n end\n end",
"title": ""
},
{
"docid": "23d5e91057245fd43f50caccd4ba6e9b",
"score": "0.5689203",
"text": "def render_to_string(*args); end",
"title": ""
},
{
"docid": "62b57498e0868fa2d1e8edc14f787d39",
"score": "0.5679282",
"text": "def to_s\n return @content if defined?(@content)\n\n view_context = @parent.send(:view_context)\n\n @content = if defined?(@_component_instance)\n # render_in is faster than `parent.render`\n if defined?(@_content_block)\n view_context.capture do\n @_component_instance.render_in(view_context, &@_content_block)\n end\n else\n view_context.capture do\n @_component_instance.render_in(view_context)\n end\n end\n elsif defined?(@_content)\n @_content\n elsif defined?(@_content_block)\n view_context.capture(&@_content_block)\n end\n\n @content\n end",
"title": ""
},
{
"docid": "220cc4df90735b6fa377aa07dfef8eee",
"score": "0.56569254",
"text": "def to_s\n @builder.interpolated(@elm)\n @elm.outerHTML.to_s\n end",
"title": ""
},
{
"docid": "8db6a68d3daa683d1fadf2c9832cfb92",
"score": "0.56511474",
"text": "def get_markup\n js = @react\n js += sprintf('React.renderToString(%s(%s));', @component, @data)\n @v8.eval(js)\n end",
"title": ""
},
{
"docid": "deaa90798a2bc8af360080f854f67096",
"score": "0.564754",
"text": "def content\n case @context\n when :dlist\n @buffer.map do |dt, dd|\n html_dt = htmlify(dt.content)\n if dd.content.empty?\n html_dd = ''\n else\n html_dd = \"<p>#{htmlify(dd.content)}</p>\"\n end\n html_dd += dd.blocks.map{|block| block.render}.join\n\n [html_dt, html_dd]\n end\n when :oblock\n ''\n when :olist, :ulist, :colist\n @buffer.map do |li|\n htmlify(li.content) + li.blocks.map{|block| block.render}.join\n end\n when :listing\n @buffer.map{|l| CGI.escapeHTML(l).gsub(/(<\\d+>)/,'<b>\\1</b>')}.join\n when :literal\n leading_ws = @buffer.first.match(/^(\\s+)/)[1]\n @buffer.map{|l| htmlify(l.sub(/#{leading_ws}/,''))}.join\n when :verse\n @buffer.map{|l| htmlify(l.strip)}.join(\"\\n\")\n else\n @buffer.map{|l| htmlify(l.lstrip)}.join # (\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "79f4208572958decd0a23859349c532c",
"score": "0.56408095",
"text": "def widget_content\n end",
"title": ""
},
{
"docid": "88bd87a45de74cfc6e738e706ff55d83",
"score": "0.5620578",
"text": "def render_to_string(*args, &block)\n options = _normalize_render(*args, &block)\n render_to_body(options)\n end",
"title": ""
},
{
"docid": "98dccd689a8e16fd46a3e48ea5db57f3",
"score": "0.5619639",
"text": "def html(inner = nil, &blk)\n if inner or blk\n altered!\n case inner\n when Array\n self.children = inner\n else\n self.children = make(inner, &blk)\n end\n reparent self.children\n else\n if respond_to?(:children) and children\n children.map { |x| x.output(\"\") }.join\n else\n \"\"\n end\n end\n end",
"title": ""
},
{
"docid": "e3b404f5cadbcde14d929b2f120b49e7",
"score": "0.55956805",
"text": "def render\n\n # render each entry...\n @entries.each { |entry| render_entry(entry) }\n\n # then finally compile the layout.\n if self.layout_path.nil?\n raise \"html_builder could not find a layout file for #{@layout}\"\n end\n\n compile(SC::RenderEngine::Erubis.new(self), self.layout_path, :_final_)\n return @content_for__final_\n end",
"title": ""
},
{
"docid": "b77bff417e8637784b20cdec7eaeba5a",
"score": "0.5595498",
"text": "def to_html; end",
"title": ""
},
{
"docid": "b77bff417e8637784b20cdec7eaeba5a",
"score": "0.5595498",
"text": "def to_html; end",
"title": ""
},
{
"docid": "b592bf6953eab3c3ae630d7d7277e8b3",
"score": "0.5589653",
"text": "def to_s\r\n @xml = Builder::XmlMarkup.new\r\n @xml.chart do\r\n @xml.license( @license ) unless @license.nil?\r\n if !@type.nil?\r\n @xml.chart_type( @type ) \r\n elsif @options[:chart_types].is_a? Array and ! @options[:chart_types].empty?\r\n @xml.chart_type do \r\n @options[:chart_types].each { |type| @xml.string( type ) } \r\n end\r\n end \r\n setup_lnf\r\n setup_series\r\n end\r\n @xml.to_s.gsub( /<to_s\\/>/, '' )\r\n end",
"title": ""
},
{
"docid": "dc94b4b6ccd421b9b391e783c1e4170f",
"score": "0.55742085",
"text": "def render_multiple(instances)\n instances.to_yaml\n end",
"title": ""
},
{
"docid": "dc94b4b6ccd421b9b391e783c1e4170f",
"score": "0.55742085",
"text": "def render_multiple(instances)\n instances.to_yaml\n end",
"title": ""
},
{
"docid": "28c1a97ce4144695b7b94a76602a800a",
"score": "0.5552439",
"text": "def render(crumbs)\n list(crumbs).html_safe\n end",
"title": ""
},
{
"docid": "fdecfc4ae457176770e91d760d05f9a4",
"score": "0.55146945",
"text": "def to_html\n result = nil\n\n Renderer.html(render_flags) do |renderer|\n result = render(renderer)\n end\n\n return result\n end",
"title": ""
},
{
"docid": "69e4234128c5742aa2d68e96d5d61eb8",
"score": "0.5512489",
"text": "def html\r\n safe_buffer MainContainer.new( unit_list, direction, steps ).to_html\r\n end",
"title": ""
},
{
"docid": "e60f278a1a48efdf588b72cfe16b5d81",
"score": "0.55121374",
"text": "def ruboto_generate_widget(options)\n ruboto_generate_widgets(options)\nend",
"title": ""
},
{
"docid": "98c7c42bb208a7dfe2dc7775eaef61e0",
"score": "0.5511108",
"text": "def inner_html(*args)\n children.map { |x| x.to_html(*args) }.join\n end",
"title": ""
},
{
"docid": "176920c914d930df33c5f5da27fdef42",
"score": "0.5510954",
"text": "def to_html\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "1d04546ff756898e9dc444ed9502584e",
"score": "0.55100685",
"text": "def render(builder, view)\n render_elements(builder, view)\n end",
"title": ""
},
{
"docid": "16d1d29c8371aa7a23d0bb8d51163a21",
"score": "0.5507362",
"text": "def render_content\n content.to_s\n end",
"title": ""
},
{
"docid": "2f7ed3144159aab19c48e0da9c1d9658",
"score": "0.55019766",
"text": "def render(params)\n output = []\n \n unless params.has_key?(:tags)\n params[:tags] = true\n end\n \n output << render_html_partial(params)\n output << render_javascript_partial(params) if params[:javascript]\n output << render_stylesheet_partial(params) if params[:stylesheet]\n \n output.flatten.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "0c3993e896697c1d0487929373cffea5",
"score": "0.54999673",
"text": "def render\n # begin monkey\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"field=#{field}\",\n \"values=#{values}\",\n \"options=#{options}\",\n \"\" ] if attribute_renderer_debug_verbose\n # end monkey\n return '' if values.blank? && !options[:include_empty]\n markup = []\n markup << %(<span itemprop=\"#{options[:itemprop]}\">) if options[:itemprop].present?\n markup << %(<tr><th>#{label}</th>\\n<td><ul class='tabular'>)\n attributes = microdata_object_attributes(field).merge(class: \"attribute attribute-#{field}\")\n Array(values).each do |value|\n # begin monkey\n value_str = ::Deepblue::MetadataHelper.str_normalize_encoding value.to_s\n markup << \"<li#{html_attributes(attributes)}>#{attribute_value_to_html(value_str)}</li>\"\n # end monkey\n end\n markup << %(</ul></td></tr>)\n markup << %(</span>) if options[:itemprop].present?\n markup.join(\"\\n\").html_safe\n end",
"title": ""
},
{
"docid": "94e1a9f38b0891cebd41e955e45ddd18",
"score": "0.54990983",
"text": "def render\n md = ''\n\n @list_items.each do |item|\n md << \"- [ ] #{item.to_s}\\n\"\n end\n\n md\n end",
"title": ""
},
{
"docid": "6a74ae6324898ba54425713eb706fbf4",
"score": "0.54959434",
"text": "def render!\n\t\t\tnodes = collect{|child| child.respond_to?(:render!) ? child.render! : child}.flatten\n\t\t\treplace(nodes)\n\t\tend",
"title": ""
},
{
"docid": "e5eb96dbe6beb7ce5b6631400554370a",
"score": "0.54949605",
"text": "def render_widget(*args)\n @last_invoke = root.render_widget(*args)\n end",
"title": ""
},
{
"docid": "308ae0913af9cc61ea04cf70dfe3a87a",
"score": "0.5487202",
"text": "def to_html(options = {})\n html = []\n self.items.each do |item|\n html << item.to_html(options)\n end\n html.join\n end",
"title": ""
},
{
"docid": "489bc5ada8778f1eec20582aaba1cad9",
"score": "0.5485609",
"text": "def html\n html_array.join\n end",
"title": ""
},
{
"docid": "e86b58238db0c7b4e649c076e4098465",
"score": "0.5484618",
"text": "def render\n return generate_output(@values)\n end",
"title": ""
},
{
"docid": "49bfba58f93a9689eba675468e6efd4b",
"score": "0.5482295",
"text": "def render(view_options=configuration)\n logger.debug \"rendering\"\n result = \"\"\n if template\n logger.debug \"rendering with template : #{template}\"\n view = AppView.new(items, view_options)\n view.template = template\n result = view.render\n else\n items.each_with_index do |item, index|\n result += \"\\n\" unless index == 0\n result += item.name.green + \":\\n\"\n if item.respond_to?(:attributes)\n attributes = item.attributes.deep_clone\n result += attributes.recursively_stringify_keys!.to_conf.gsub(/\\s+$/, '') # strip trailing whitespace from YAML\n result += \"\\n\"\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "ec9b7bd2a8beec4e1239d2e05ba5647e",
"score": "0.54799235",
"text": "def build_html(root, data)\n\t\treturn root.render_output(data)\n\tend",
"title": ""
},
{
"docid": "f03f77e3a7d8f0cc86620a7d24f1ca60",
"score": "0.54750305",
"text": "def to_s( options={} )\n @partial = options[:partial] || false\n @xml = Builder::XmlMarkup.new\n # Forces utf8 encoding on xml stream\n @xml.instruct! :xml, :version => \"1.0\", :encoding => \"UTF-8\"\n @xml.chart do\n @xml.license( @license ) unless @license.nil?\n if render_parents?\n if !@type.nil?\n @xml.chart_type( @type ) \n elsif @options[:chart_types].is_a? Array and ! @options[:chart_types].empty?\n @xml.chart_type do \n @options[:chart_types].each { |type| @xml.string( type ) } \n end\n end\n end\n setup_lnf\n setup_series\n end\n @xml.to_s.gsub( /<to_s\\/>/, '' )\n end",
"title": ""
},
{
"docid": "f03f77e3a7d8f0cc86620a7d24f1ca60",
"score": "0.54750305",
"text": "def to_s( options={} )\n @partial = options[:partial] || false\n @xml = Builder::XmlMarkup.new\n # Forces utf8 encoding on xml stream\n @xml.instruct! :xml, :version => \"1.0\", :encoding => \"UTF-8\"\n @xml.chart do\n @xml.license( @license ) unless @license.nil?\n if render_parents?\n if !@type.nil?\n @xml.chart_type( @type ) \n elsif @options[:chart_types].is_a? Array and ! @options[:chart_types].empty?\n @xml.chart_type do \n @options[:chart_types].each { |type| @xml.string( type ) } \n end\n end\n end\n setup_lnf\n setup_series\n end\n @xml.to_s.gsub( /<to_s\\/>/, '' )\n end",
"title": ""
},
{
"docid": "855c65151f98d12d08773dc3f985f0b5",
"score": "0.5464183",
"text": "def render\n render_buttons\n render_slider\n\n render_background\n render_visited\n render_frontier\n render_walls\n render_star\n end",
"title": ""
},
{
"docid": "e0b399f9605ab68d1f47c43d3a004219",
"score": "0.54457206",
"text": "def to_html\n setup unless @items\n html = ''\n @items.each {|i| html << i.out(@template, @remote_options) }\n if @options[:container] \n html = @template.content_tag :div, html, {:class => @options[:class]}\n end\n @template.params[:page] = @collection.current_page # reset page to current_page\n html\n end",
"title": ""
},
{
"docid": "bea8bce7af9fb9b7125d0b2e71be2d7a",
"score": "0.54325384",
"text": "def to_html\n content = \"<ul id='screens'>\"\n @results.each do |result|\n content << \"<li>#{result[0]}s #{result[1]} screens</li>\"\n end\n content << \"</ul>\"\n content\n end",
"title": ""
},
{
"docid": "d01c050c20b120a585834696b7fd9f7c",
"score": "0.5420103",
"text": "def to_s\n @elems.to_s\n end",
"title": ""
},
{
"docid": "c390463e672b750506d0187c304fbc75",
"score": "0.54139066",
"text": "def to_html *args\n children.to_html(*args)\n end",
"title": ""
},
{
"docid": "854a5149e663e70fb13c545116e977c1",
"score": "0.5412266",
"text": "def render\n items = data_items\n return \"\" if items.empty?\n\n angles = data_angles(items)\n output = []\n\n labels = items.map { |item| item.to_label(legend) }\n label_vert_space = legend_line\n label_horiz_space = legend_left\n label_offset = labels.size / 2\n label_boundry = label_vert_space * label_offset\n labels_range = (-label_boundry..label_boundry).step(label_vert_space)\n\n (-radius..radius).each do |y|\n width = (Math.sqrt(radius * radius - y * y) * aspect_ratio).round\n width = width.zero? ? (radius / aspect_ratio).round : width\n\n output << SPACE_CHAR * (center_x - width) if top.nil?\n (-width..width).each do |x|\n angle = radian_to_degree(Math.atan2(x, y))\n idx = select_data_item(angle, angles)\n item = items[idx] if idx\n if !top.nil?\n output << cursor.move_to(center_x + x, center_y + y)\n end\n if item.nil?\n output << SPACE_CHAR\n elsif item.color\n output << @pastel.decorate(item.fill, item.color)\n else\n output << item.fill\n end\n end\n\n if legend\n if !top.nil?\n output << cursor.move_to(center_x + aspect_ratio * radius +\n label_horiz_space, center_y + y)\n end\n if labels_range.include?(y)\n if top.nil?\n output << SPACE_CHAR * ((center_x - (left.to_i + width)) +\n label_horiz_space)\n end\n output << labels[label_offset + y / label_vert_space]\n end\n end\n\n output << \"\\n\"\n end\n\n output.join\n end",
"title": ""
},
{
"docid": "7e5f9b212687b97fac3032a98b58ca30",
"score": "0.5404984",
"text": "def render_to_string(options = {})\n AbstractController::Renderer.body_to_s(render_to_body(options))\n end",
"title": ""
},
{
"docid": "032bc1b152b10f1165ff338efd42c979",
"score": "0.54033846",
"text": "def render\n if engine.respond_to?(:render)\n engine.render(Object.new, :items => items)\n else\n engine.result(binding)\n end\n end",
"title": ""
},
{
"docid": "bbb7abed816d34c03085915698fe08fd",
"score": "0.53981084",
"text": "def render_to_string(*args, &block)\n controller.send(:render_to_string, *args, &block)\n end",
"title": ""
},
{
"docid": "7a3fba37f296d4adfc0b64db681323f3",
"score": "0.5393208",
"text": "def render\n # \"A string rendered from Crossbeams<br>\" << nodes.map {|s| s.render }.join(\"\\n<!-- End Section -->\\n\")\n <<~HTML\n #{nodes.reject(&:invisible?).map(&:render).join(\"\\n<!-- End Section -->\\n\")}\n HTML\n end",
"title": ""
},
{
"docid": "dfaa8d3266d888de5c6eec887d11f12e",
"score": "0.5379819",
"text": "def to_html\n\t\t\tBlueCloth.new( @content ).to_html\n\t\tend",
"title": ""
},
{
"docid": "2fa8aaaf4ba3e12ae4f574a911c10d13",
"score": "0.5378652",
"text": "def render(data)\n render_lines(data).join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "88f2e92d76c1e940b7e80e06e9670549",
"score": "0.53777874",
"text": "def render_to_string(options = {})\n AbstractController::RenderingController.body_to_s(render_to_body(options))\n end",
"title": ""
},
{
"docid": "fbce6ac86a2473f2d3acf3788e05208b",
"score": "0.5372975",
"text": "def to_s\n @elements.to_s\n end",
"title": ""
},
{
"docid": "6674fbf0507fe10974f38a81629b017a",
"score": "0.5372526",
"text": "def render(method = :string)\n case method\n when :nokogiri\n render_nokogiri\n when :builder\n render_builder\n else\n render_string\n end\n end",
"title": ""
},
{
"docid": "cf2c18fd3733ea1ac922343ebf4e00c6",
"score": "0.537072",
"text": "def render\n render_background\n render_heat_map\n render_walls\n render_path\n render_star\n render_target\n render_labels\n end",
"title": ""
},
{
"docid": "ba268ab032c7c4a14c9ecd63bae76827",
"score": "0.5370378",
"text": "def to_s\n children.to_s\n end",
"title": ""
},
{
"docid": "ba268ab032c7c4a14c9ecd63bae76827",
"score": "0.5370378",
"text": "def to_s\n children.to_s\n end",
"title": ""
},
{
"docid": "ba268ab032c7c4a14c9ecd63bae76827",
"score": "0.5370378",
"text": "def to_s\n children.to_s\n end",
"title": ""
},
{
"docid": "9d4cae6af7a471987153a7869736c2eb",
"score": "0.53679806",
"text": "def render()\n parts = []\n parts << (self.description&.length&.positive? ? self.description.comment.strip : nil)\n parts << (self.parent.nil? ? \"class #{self.class_name()}\" : \"class #{self.class_name()} < #{self.parent}\")\n parts << self.render_attributes()\n parts << self.render_body()\n parts << \"end\"\n if self.modules.length > 0\n body = parts.compact.join(\"\\n\").gsub(/([[:blank:]]+)$/, \"\")\n return Ginny.mod(body, self.modules)\n end\n return parts.compact.join(\"\\n\").gsub(/([[:blank:]]+)$/, \"\")\n end",
"title": ""
},
{
"docid": "7cf17a73a0c0b84f6f639a1f700a1328",
"score": "0.5367799",
"text": "def html\n Shiny::HTML.new(self)\n end",
"title": ""
},
{
"docid": "7d70a52d922804b8f6460a6047df19c5",
"score": "0.5366964",
"text": "def render\n\t\t\tunless @rendered\n\t\t\t\t@is_rendering = true\n\t\t\t\t@rendered = @renderer.render(@container)\n\t\t\t\t@is_rendering = false\n\t\t\tend\n\t\t\treturn @rendered\n\t\tend",
"title": ""
},
{
"docid": "31bd0320240f39ed4fe1a19519007fe3",
"score": "0.5366207",
"text": "def content\n @blocks.map{|block| block.render}.join\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.