query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
caee6c447477629871cdb9daccb0fec2
|
GET /actividads GET /actividads.xml
|
[
{
"docid": "45265ba73f1c7e43f0fccbe7576a80f0",
"score": "0.6412203",
"text": "def index\n cadena = getactividades(params[:id].to_i)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => cadena }\n end\n end",
"title": ""
}
] |
[
{
"docid": "bf318784c6014fa1dd2ede882b91bbdd",
"score": "0.68038064",
"text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad }\n end\n end",
"title": ""
},
{
"docid": "c343aad27ef5a5fc1a9bc734aa986e70",
"score": "0.673919",
"text": "def ads(params, additional_headers = {})\n perform_request(self, @token, 'ads', 'get', params, additional_headers)\n end",
"title": ""
},
{
"docid": "c0c6961801feb0ff340f1f8d6f66ee1a",
"score": "0.67342407",
"text": "def ad_list(ads)\n request(:get, \"/api/ad-get/\", {:ads=>ads}).data\n end",
"title": ""
},
{
"docid": "c0c6961801feb0ff340f1f8d6f66ee1a",
"score": "0.67342407",
"text": "def ad_list(ads)\n request(:get, \"/api/ad-get/\", {:ads=>ads}).data\n end",
"title": ""
},
{
"docid": "49d193e6df7200506d71f447c3a40d01",
"score": "0.6681916",
"text": "def index\n @ads = @campaign.ads\n end",
"title": ""
},
{
"docid": "9ce7f5a8d9d7bd3f859f0516d1333f47",
"score": "0.6604972",
"text": "def ads_xml_document\n x = Builder::XmlMarkup.new\n x.instruct! :xml, :version=>\"1.0\"\n x.matchbox {\n x.last_refreshed Setting.last_refreshed_at\n x.ads {\n ads.each do |ad|\n x << ad.to_xml\n end\n }\n }\n end",
"title": ""
},
{
"docid": "a5b2ef4cc031c84ab21b3a0f4245386e",
"score": "0.6569499",
"text": "def show\n @ad_index = AdIndex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad_index }\n end\n end",
"title": ""
},
{
"docid": "e2a903e93fbc58ba7f90eaa0e85df97e",
"score": "0.6565213",
"text": "def show\n @advertise = Advertise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @advertise }\n end\n end",
"title": ""
},
{
"docid": "6007af344db1b93d0aafb5169f256ca8",
"score": "0.654946",
"text": "def feed\n @ads = Ad.all_active\n \n respond_to do |format|\n format.rss { render :layout => false }\n format.atom # index.atom.builder\n end\n end",
"title": ""
},
{
"docid": "f2e0e588b8d6c4731e26e0a0f08652a1",
"score": "0.6521486",
"text": "def index\n @adils = Adil.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @adils }\n end\n end",
"title": ""
},
{
"docid": "1ceab8cb0112d42a73341e05696887b4",
"score": "0.6508352",
"text": "def index\n @ads = Ad.all\n end",
"title": ""
},
{
"docid": "1ceab8cb0112d42a73341e05696887b4",
"score": "0.6508352",
"text": "def index\n @ads = Ad.all\n end",
"title": ""
},
{
"docid": "1ceab8cb0112d42a73341e05696887b4",
"score": "0.6508352",
"text": "def index\n @ads = Ad.all\n end",
"title": ""
},
{
"docid": "1ceab8cb0112d42a73341e05696887b4",
"score": "0.6508352",
"text": "def index\n @ads = Ad.all\n end",
"title": ""
},
{
"docid": "3546574aacb21b49b4a7fd5122ddfba0",
"score": "0.64826363",
"text": "def index\n @ads = Ad.find(:all)\n end",
"title": ""
},
{
"docid": "b9b1081e2add487026db7e72b6d27bdf",
"score": "0.64715505",
"text": "def index\n @ads = Advertise.all\n end",
"title": ""
},
{
"docid": "f4821079cefafa56e7aef0cae9e983c8",
"score": "0.64594704",
"text": "def index\n @ads = Ad.all\n\n end",
"title": ""
},
{
"docid": "fbb7279b48e378bb0271c5aa6c40c139",
"score": "0.64133775",
"text": "def ads(args = {})\n begin\n do_get(AppFigures::API::ADS, args)\n rescue Exception => e\n puts e.message\n puts e.backtrace\n end\n end",
"title": ""
},
{
"docid": "c6fe61e427dfa0ed537d38c188249e37",
"score": "0.6298733",
"text": "def show\n @advertiser = Advertiser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @advertiser }\n end\n end",
"title": ""
},
{
"docid": "ce298ea3b6fe8a0b4427ff75305d049f",
"score": "0.62793165",
"text": "def show\n @adil = Adil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @adil }\n end\n end",
"title": ""
},
{
"docid": "ce298ea3b6fe8a0b4427ff75305d049f",
"score": "0.6277164",
"text": "def show\n @adil = Adil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @adil }\n end\n end",
"title": ""
},
{
"docid": "706cff29a5f9c20f80c91f8a9bb57f50",
"score": "0.62678885",
"text": "def index\n @ads = current_user.ads\n end",
"title": ""
},
{
"docid": "706cff29a5f9c20f80c91f8a9bb57f50",
"score": "0.62678885",
"text": "def index\n @ads = current_user.ads\n end",
"title": ""
},
{
"docid": "c5ceebcc65643524f5b6f346db524ea0",
"score": "0.62623787",
"text": "def show\n @adresdb = Adresdb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @adresdb }\n end\n end",
"title": ""
},
{
"docid": "34d4deb3ca85e9413bedbcbb373b5c0c",
"score": "0.62622744",
"text": "def show\n @ad_effect_on_consumer = AdEffectOnConsumer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad_effect_on_consumer }\n end\n end",
"title": ""
},
{
"docid": "e46b71e30974c1b027ee07e006fb8184",
"score": "0.62549996",
"text": "def show\n @ad_board = AdBoard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad_board }\n end\n end",
"title": ""
},
{
"docid": "35ca72b780408f14a0160f9949f34dc4",
"score": "0.62389594",
"text": "def show\n @alcalde = Alcalde.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @alcalde }\n end\n end",
"title": ""
},
{
"docid": "dd3e228f6681383c06bccf8ec8081f6b",
"score": "0.6224349",
"text": "def show\n @adscripcion = Adscripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @adscripcion }\n end\n end",
"title": ""
},
{
"docid": "0fab5bae6e62ed2874262dff67360ef9",
"score": "0.6220699",
"text": "def index\n @digiramp_ads = DigirampAd.all\n end",
"title": ""
},
{
"docid": "39584673e691386524b15a194c7d60f8",
"score": "0.6195724",
"text": "def index\n @adcoms = Adcom.all\n end",
"title": ""
},
{
"docid": "d44ee3c778b7881f5c0ff1fb163e7729",
"score": "0.61941063",
"text": "def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"title": ""
},
{
"docid": "d44ee3c778b7881f5c0ff1fb163e7729",
"score": "0.61941063",
"text": "def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"title": ""
},
{
"docid": "4fcd43024436ab8bd193f87834ec6e2e",
"score": "0.618536",
"text": "def show\n @business_ad = BusinessAd.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @business_ad }\n end\n end",
"title": ""
},
{
"docid": "fba4b82fe94231f66e3a18956a379e7e",
"score": "0.61777747",
"text": "def show\n @line_ad = LineAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @line_ad }\n end\n end",
"title": ""
},
{
"docid": "6a4f7607e9b2e7e8e2774d3644e4ff01",
"score": "0.6174284",
"text": "def index\n if is_client_app?\n if params[:external].present?\n @ads = Ad.external.active.limit(params[:limit] || 1).order(\"RAND()\")\n else\n @ads = Ad.announcement.active.limit(3).order(\"RAND()\")\n end\n else\n response.headers['X-Total-Count'] = @ads.count.to_s\n @ads = @ads.page(params[:page]) if params[:page].present?\n @ads = @ads.per(params[:per]) if params[:per].present?\n end\n\n render json: @ads\n end",
"title": ""
},
{
"docid": "6c0d2bb1ad2695aebb4f13ba24340537",
"score": "0.61269057",
"text": "def index\n @ads = Ad.all\n authorize! :read, @ads\n end",
"title": ""
},
{
"docid": "d5900358719d686803ac8ae4cd70de13",
"score": "0.61267954",
"text": "def index\n @actividads = Actividad.all\n end",
"title": ""
},
{
"docid": "a91a0d7878fccfabea699ec3ca083bba",
"score": "0.6118736",
"text": "def show\n @vacacion_antiguedad = VacacionAntiguedad.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vacacion_antiguedad }\n end\n end",
"title": ""
},
{
"docid": "5180e9b7203311985bc11b20415543ed",
"score": "0.61136645",
"text": "def ads(params)\n response = YandexDirect::V5::Request.new(self, @token, 'ads', 'get', params).perform\n @available_units = response[:available_units]\n response[:result]\n end",
"title": ""
},
{
"docid": "389e1871f456eb162a0340be9ddc9d56",
"score": "0.6096936",
"text": "def index\n @ad_requests = AdRequest.all\n end",
"title": ""
},
{
"docid": "7b802e3d09fbe6519721f798a0fb4c99",
"score": "0.6095296",
"text": "def show\n @lead = Lead.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lead }\n end\n end",
"title": ""
},
{
"docid": "8d4d6fe7a0c037440c224d7aba01d64b",
"score": "0.6085979",
"text": "def show\n @ads_entry = AdsEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ads_entry }\n end\n end",
"title": ""
},
{
"docid": "0261b7322dbfd241e27822dc22fcf8d5",
"score": "0.6085811",
"text": "def show\n @advertiser_info = AdvertiserInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @advertiser_info }\n end\n end",
"title": ""
},
{
"docid": "397753e4473df4d73e604f5001dc8ac7",
"score": "0.60821545",
"text": "def index\n render json: @ads = Ad.all\n end",
"title": ""
},
{
"docid": "34aaf8daab6f07a172c674f1df670ba3",
"score": "0.60790014",
"text": "def show\n @advertising_space = AdvertisingSpace.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @advertising_space }\n end\n end",
"title": ""
},
{
"docid": "8fe04a042ef23ab4cc78cdc665180ba3",
"score": "0.6074109",
"text": "def show\n @accordion_lead = AccordionLead.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @accordion_lead }\n end\n end",
"title": ""
},
{
"docid": "c77060f4ae6c86a5dd84349d363ebbff",
"score": "0.60673237",
"text": "def index\n @test_ads = TestAd.all\n end",
"title": ""
},
{
"docid": "9f8c3af3554ff962f6e1f97f9319db9c",
"score": "0.6058504",
"text": "def index\n @daw_actividads = DawActividad.all\n end",
"title": ""
},
{
"docid": "b9d2300f4e54cb3e6d0a6177e85f698d",
"score": "0.60549986",
"text": "def index\n @ad_clicks = AdClick.all\n end",
"title": ""
},
{
"docid": "8792795f69c3df655fc9e3d870fcb917",
"score": "0.60441273",
"text": "def show\n @ad_unit = AdUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad_unit }\n end\n end",
"title": ""
},
{
"docid": "57df8de7591b4431403515596e24f0e1",
"score": "0.6035495",
"text": "def show\n @splash_ad = SplashAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @splash_ad }\n end\n end",
"title": ""
},
{
"docid": "ca105fd47b8aa46791efc5bbdfcb7832",
"score": "0.60325456",
"text": "def index\n @ad_blocks = AdBlock.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ad_blocks }\n end\n end",
"title": ""
},
{
"docid": "6a9a1cecd4f37f610e722faf44c31639",
"score": "0.60259944",
"text": "def index\n @user_ads = UserAd.all\n end",
"title": ""
},
{
"docid": "831ee83cfc941d90038d72b5a074483c",
"score": "0.6020145",
"text": "def show\n @audience = Audience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @audience }\n end\n end",
"title": ""
},
{
"docid": "c9a5eca6e5df875d8a7d1d372c42a71f",
"score": "0.60182434",
"text": "def index\n @click_ads = ClickAd.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @click_ads }\n end\n end",
"title": ""
},
{
"docid": "d2b7343b534c639f489a2ee3e68d639d",
"score": "0.6017712",
"text": "def show\n @adults_online = AdultsOnline.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @adults_online }\n end\n end",
"title": ""
},
{
"docid": "5ef47886a0651d13c511c8256d0e8040",
"score": "0.60162324",
"text": "def ad(id:)\n response = request.get(id)\n\n AdResult.build(response)\n end",
"title": ""
},
{
"docid": "b16ac014c6f2c8a2a61ca21894e06f34",
"score": "0.6014494",
"text": "def show\n @assay = Assay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @assay }\n end\n end",
"title": ""
},
{
"docid": "06facf2b1a671e8222d243f81c5df2a5",
"score": "0.60144436",
"text": "def index\n @leads = @leads.find(:all, :include => [:contact, :agent])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @leads }\n end\n end",
"title": ""
},
{
"docid": "ca40726a07f41a3cf003d616b9cfe0f8",
"score": "0.60108685",
"text": "def show\n @accomodation = Accomodation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @accomodation }\n end\n end",
"title": ""
},
{
"docid": "0ca717049e5ba0e35cbc8d3157dfab43",
"score": "0.59985954",
"text": "def get_tagged_ads\n page = params[:page] || 1\n @ads = Ad.find_by_tag(params[:tag], page)\n render :action => \"index\"\n end",
"title": ""
},
{
"docid": "81f7528bb16e7898138463bb48c710c0",
"score": "0.5980543",
"text": "def index\n @affiliate_links = AffiliateLink.find(:all)\n #@affiliate_setting = AffiliateSetting.find_by_account_id(current_account)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @affiliate_links }\n end\n end",
"title": ""
},
{
"docid": "9d313b4dc3e7bdc8b207f021b4286cc7",
"score": "0.5964765",
"text": "def index\n @ads_entries = AdsEntry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads_entries }\n end\n end",
"title": ""
},
{
"docid": "763e9532a93e7ba8e1666aa2f41e85fd",
"score": "0.5955721",
"text": "def show\n @rangoedad = Rangoedad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rangoedad }\n end\n end",
"title": ""
},
{
"docid": "be19c2173d10cd6028819c12f100d511",
"score": "0.5953782",
"text": "def show\n @ad = Ad.find(params[:id])\n\n render json: @ad\n end",
"title": ""
},
{
"docid": "6268d4f750183f776b625eccb2f020ac",
"score": "0.5941996",
"text": "def show\n @activite = Activite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activite }\n end\n end",
"title": ""
},
{
"docid": "6c2ccbfd673cd114e4a150a41e1a7e65",
"score": "0.5939344",
"text": "def show\n @ead = Ead.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ead }\n end\n end",
"title": ""
},
{
"docid": "0371d17a5812b6da29a11b03321252d9",
"score": "0.59371585",
"text": "def show\n doc = Pismo::Document.new(params[:url]).doc\n\n doc.xpath(\"//*[@*[contains(., 'ad')]]\").each do |e|\n attributes = e.attributes.values.map(&:value).map(&:downcase)\n e.remove if attributes.detect { |v| v.match(BLACKLIST) || v.match(ADS_PATTERN) }\n end\n\n # TODO: solve encoding issue with accents.\n kit = IMGKit.new(doc.to_s.html_safe)\n\n # render inline: doc.to_s.html_safe\n\n send_data(kit.to_png, :type => \"image/png\", :disposition => 'inline')\n end",
"title": ""
},
{
"docid": "08bd7096600ee8c89e7e886b35686109",
"score": "0.59344506",
"text": "def show\n @ad_block = AdBlock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad_block }\n end\n end",
"title": ""
},
{
"docid": "c7bc1420acc3c6c107ea6b5e29d0e0d1",
"score": "0.5932287",
"text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"title": ""
},
{
"docid": "c7bc1420acc3c6c107ea6b5e29d0e0d1",
"score": "0.5932287",
"text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"title": ""
},
{
"docid": "c7bc1420acc3c6c107ea6b5e29d0e0d1",
"score": "0.5932287",
"text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"title": ""
},
{
"docid": "c7bc1420acc3c6c107ea6b5e29d0e0d1",
"score": "0.5932287",
"text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"title": ""
},
{
"docid": "0fb2c86446202f398eb69588087c869d",
"score": "0.5930978",
"text": "def list\n @slug = params[:slug]\n @ads = Ad.all_active_by_slug(params[:slug])\n if !@ads\n flash[:warning] = 'Invalid Request'\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "81533177c73a375bb5ac8397fd53bc4c",
"score": "0.59292406",
"text": "def index\n @eads = Ead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @eads }\n end\n end",
"title": ""
},
{
"docid": "3754f0b93909f31a935fc988dcc3ece2",
"score": "0.59195316",
"text": "def show\n @banner = Banner.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @banner.to_xml }\n end\n end",
"title": ""
},
{
"docid": "49842da59f16f7c04b5102920eefa2b1",
"score": "0.59170604",
"text": "def show\n @account = Account.find(params[:id])\n render :xml => @account\n end",
"title": ""
},
{
"docid": "c325eb864c7bc6ff44c7267cf90702f7",
"score": "0.59095347",
"text": "def index\n @actividads = Actividad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @actividads }\n end\n end",
"title": ""
},
{
"docid": "fff1606152accec9148b6811d3b9faee",
"score": "0.5905975",
"text": "def show\n @analytic = Analytic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @analytic }\n end\n end",
"title": ""
},
{
"docid": "e9196e2c0c47c2879aa25e58ac63106b",
"score": "0.5901135",
"text": "def show\n @campaign = Campaign.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @campaign }\n end\n end",
"title": ""
},
{
"docid": "a8b104e5bc9f356185a8e53bde1033cf",
"score": "0.58985984",
"text": "def show\n @agency = Agency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @agency }\n end\n end",
"title": ""
},
{
"docid": "a8b104e5bc9f356185a8e53bde1033cf",
"score": "0.58985984",
"text": "def show\n @agency = Agency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @agency }\n end\n end",
"title": ""
},
{
"docid": "74b93350f58f613df5e9d50e3e19608c",
"score": "0.5886524",
"text": "def advertisers\n get_collection(\n 'oauth2/advertiser/get/',\n access_token: access_token,\n app_id: Panda.config.app_id,\n secret: Panda.config.app_secret\n )\n end",
"title": ""
},
{
"docid": "a13f2548073d8429e5cdb0aead20c029",
"score": "0.58842653",
"text": "def show\n @adults_license = AdultsLicense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @adults_license }\n end\n end",
"title": ""
},
{
"docid": "fe37191b9b74bb004f28060d520e0d77",
"score": "0.58805394",
"text": "def index\n @advertisements = Advertisement.all\n end",
"title": ""
},
{
"docid": "17fb60f4f538cce49e3d1187646d62f3",
"score": "0.587698",
"text": "def show\n @ad_zone = AdZone.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad_zone }\n end\n end",
"title": ""
},
{
"docid": "9979351b4b8523a7f33a0cdbac4c978e",
"score": "0.5874437",
"text": "def show\n @annonce = Annonce.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @annonce }\n end\n end",
"title": ""
},
{
"docid": "760e06fe34a36ffa8218dccc1246f014",
"score": "0.5848837",
"text": "def show\n @agenda_doc = AgendaDoc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @agenda_doc }\n end\n end",
"title": ""
},
{
"docid": "0c9ad71097f167cec6646309526f534c",
"score": "0.58469874",
"text": "def ads\n self.root.xpath('.//Ad').to_a.collect do |node|\n Ad.create(node)\n end\n end",
"title": ""
},
{
"docid": "88d2b42d7b42d8b9b25748180ae86c68",
"score": "0.58463556",
"text": "def show\n @activist = Activist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activist }\n end\n end",
"title": ""
},
{
"docid": "299c508f13b9c6a916320e544e500b46",
"score": "0.58383524",
"text": "def show\n @letter_campaign = LetterCampaign.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @letter_campaign }\n end\n end",
"title": ""
},
{
"docid": "cd65cdcba26b1ef9fbbd9a93a333f296",
"score": "0.5833733",
"text": "def index\n ads = Ad.all\n render json: AdSerializer.new(ads, options).serialized_json\n end",
"title": ""
},
{
"docid": "374c27b28d553f78299c9865356b8da8",
"score": "0.5816313",
"text": "def show\n @full_banner = FullBanner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @full_banner }\n end\n end",
"title": ""
},
{
"docid": "86d521647b20973dc39bc055124db494",
"score": "0.5811048",
"text": "def index\n @test_attenuations = TestAttenuation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @test_attenuations }\n end\n end",
"title": ""
},
{
"docid": "884fcddb8c3925d4816335d65159730e",
"score": "0.581043",
"text": "def index\n @ad_campaigns = AdCampaign.all\n end",
"title": ""
},
{
"docid": "1d71248a7e4a379a4b2f990670a902b1",
"score": "0.580917",
"text": "def show\n @advertising = Advertising.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertising }\n end\n end",
"title": ""
},
{
"docid": "2a352eee3fc103aa45f5841b3716fff2",
"score": "0.57959116",
"text": "def index\n @linked_accounts = Admin::LinkedAccount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @linked_accounts }\n end\n \n \n end",
"title": ""
},
{
"docid": "103cebfcbd48ab04d77bc7d76e7c3ab7",
"score": "0.5795379",
"text": "def index\n @audiences = Audience.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @audiences }\n end\n end",
"title": ""
},
{
"docid": "ab62ffb3e5f8ccbbed54df757d53afc5",
"score": "0.5793627",
"text": "def index\n @categories = Category.all\n @ads = Ad.published\n end",
"title": ""
},
{
"docid": "e89537f54441f1732ee57c74c9717067",
"score": "0.57852125",
"text": "def index\n @sell_ads = SellAd.all\n end",
"title": ""
}
] |
94cdf1427d552b110c7247bd91bdf0c6
|
Time: O(n^2 e) Space: O(n)
|
[
{
"docid": "57cc7eea65b09402ec20bcdb135202d2",
"score": "0.0",
"text": "def dijkstra(adjacency_matrix, start_node) \n num_nodes = adjacency_matrix.length\n\n # Holds the shortest distances from start_node to node. Each one starts with infinity.\n shortest_distances = Array.new(num_nodes, Float::INFINITY)\n\n # Records if a path to that node has already been discovered. Each one starts as false.\n added = Array.new(num_nodes, false)\n\n # Holds the previous node for each node. Each one starts as nil.\n parent_list = Array.new(num_nodes)\n\n # Set the shortest_distance for start_node to 0 so it is picked first.\n shortest_distances[start_node] = 0\n\n answer = { start_node: start_node, parent_list: parent_list, shortest_distances: shortest_distances }\n\n # Loop the number of nodes - 1 times\n (num_nodes - 1).times do \n current_node = find_next_node(added, shortest_distances)\n\n # Check if graph is unconnected\n if current_node.nil?\n return answer\n end\n\n # Set current_node in added to true\n added[current_node] = true\n\n # Update all the values in shortest_distances for the neighbors of current_node \n # with the minimum of their current value and the distance to the current_node and the weight of the edge connecting them with current_node\n adjacency_matrix[current_node].each_with_index do |distance, index|\n if distance > 0\n if parent_list[current_node]\n distance += shortest_distances[current_node]\n end\n\n if distance < shortest_distances[index]\n shortest_distances[index] = distance\n parent_list[index] = current_node\n end\n end\n end\n end\n return answer\nend",
"title": ""
}
] |
[
{
"docid": "5944c445a0d5d1383cd670cc84d3fc3b",
"score": "0.7071816",
"text": "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend",
"title": ""
},
{
"docid": "2481cbf165330db256eee896a32c82e4",
"score": "0.66186666",
"text": "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend",
"title": ""
},
{
"docid": "5997275b749023c7c7dc4440454f2270",
"score": "0.645516",
"text": "def largest_subsum(list)\n max = list[0] # O(1)\n current_sum = list[0] # O(1)\n\n (1...list.length).each do |i| # O(n)\n # debugger\n if current_sum < 0 # O(1)\n current_sum = 0 # O(1)\n end \n current_sum += list[i] # O(1)\n if current_sum > max # O(1)\n max = current_sum # O(1)\n end\n end\n\n max # O(1)\n\nend",
"title": ""
},
{
"docid": "7162724e546ffdbc8fc6c70b8171ea5c",
"score": "0.6364772",
"text": "def my_min_2(list)\r\n min = 0 # O(1)\r\n \r\n list.each do |ele| # O(n) \r\n if ele < min # O(1)\r\n min = ele # O(1)\r\n end\r\n end\r\n min # O(1) \r\nend",
"title": ""
},
{
"docid": "6e33c10b282141992a38f8fd30d5a452",
"score": "0.63623285",
"text": "def solution(m, a)\n n = a.count\n result = 0\n front = 0\n numbers = Array.new(m + 1, false)\n n.times { |back|\n while front < n and not numbers[a[front] - 1]\n numbers[a[front] - 1] = true\n front += 1\n result += front - back\n return 1_000_000_000 if result >= 1_000_000_000\n end\n numbers[a[back] - 1] = false\n }\n result\nend",
"title": ""
},
{
"docid": "232e8ca0d378cb2032f5857b13d25224",
"score": "0.62470216",
"text": "def fds(n)\n\n # arr = []\n # (n + 1).times.each{|e| arr << e if e > 0}\n # arr.flat_map.reduce(:*)\n # arr.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n (1..n).to_a.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n\nend",
"title": ""
},
{
"docid": "f4137edea4a7492e793e2bae2c232724",
"score": "0.6242387",
"text": "def sorted_squares(nums)\n # This takes O(n)\n nums.map! { |num| num**2 }\n # This can take Ο(n logn)\n bubble_sort(nums)\nend",
"title": ""
},
{
"docid": "3498231278181f6617d9cdd72f12aebd",
"score": "0.62280244",
"text": "def sub_sum(list)\n sub_arr = []\n (0...list.length).each do |i| #O(n)\n (i...list.length).each do |j| #O(n)\n sub_arr << list[i..j] if i <= j\n end\n end\n largest_continuous_sub_sum1(sub_arr)\nend",
"title": ""
},
{
"docid": "91fb28d5aefdaf076348568b5c2ae6f5",
"score": "0.61762404",
"text": "def three_sum_fastest(arr)\n count = 0\n\n (0..arr.length - 2).each { |i|\n set = Set.new\n\n (i + 1..arr.length - 1).each { |j|\n if set.include?(-arr[i] - arr[j])\n count += 1\n end\n\n set.add(arr[j])\n }\n }\n count\nend",
"title": ""
},
{
"docid": "614280f7922bfbaa90687d8ed917a389",
"score": "0.61743927",
"text": "def my_min_2(array)#O(n)\n array.inject do |acc, ele|#O(n)\n if acc < ele\n acc\n else\n ele\n end\n end\nend",
"title": ""
},
{
"docid": "07efb23ec0a15801ca70de38ba6f9068",
"score": "0.61679584",
"text": "def naive(array)\n max = -10000\n for i in (0..array.length - 1)\n for j in (i..array.length - 1)\n total = array[i..j].inject { |m,k| m + k }\n max = total if total > max\n end\n end\n max\nend",
"title": ""
},
{
"docid": "dfb5be4032827a2af66bc204b4eca26c",
"score": "0.6165424",
"text": "def okay_two_sum?(arr, target)\n arr = arr.sort #n log n\n (0...arr.length).each do |i| #n\n search = bsearch(arr, target-arr[i]) # log n\n return true unless search.nil?\n end #n log n\n false\nend",
"title": ""
},
{
"docid": "e9506e5c5be49078757652976ec6068d",
"score": "0.61333144",
"text": "def solution(a)\n n = a.size\n passing_cars = 0\n\n suffix_sums = Array.new(n + 1, 0)\n\n a.reverse.each_with_index do |elem, i|\n suffix_sums[i + 1] = suffix_sums[i] + elem\n end\n suffix_sums.reverse!\n\n a.each_with_index do |car, i|\n if car == 0\n passing_cars += suffix_sums[i]\n end\n end\n\n passing_cars > 1_000_000_000 ? -1 : passing_cars\nend",
"title": ""
},
{
"docid": "6c5cc25c18401701cf3954cc74308e64",
"score": "0.6126681",
"text": "def sieve_of_e(n)\n a = (0...n).to_a\n a[0] = nil\n a[1] = nil\n (2..Math.sqrt(n)).each do |i|\n if a[i]\n it = 0\n j = i * i\n while j <= n\n a[j] = nil\n it += 1\n j = i * i + i * it\n end\n end\n end\n a.select{|i| i}\nend",
"title": ""
},
{
"docid": "9e620a41aa357221f8d5c17d26101086",
"score": "0.6122092",
"text": "def largest_contiguous_subsum_2(list)# [2, 3, -6, 7, -6, 7]\n largest_num = list[0]#2 O(1)\n running_sum = list[0]#2 - 5 after entering loop. O(1)\n\n (1...list.length).each do |i| #O(n) \n running_sum = 0 if running_sum < 0 #O(1)\n running_sum += list[i] #O(1)\n largest_num = running_sum if running_sum > largest_num #O(1)\n end\n return largest_num #O(1)\nend",
"title": ""
},
{
"docid": "f347717a52490b428e11add15eaa0ca4",
"score": "0.60949355",
"text": "def solution_slow_2(n, p, q)\n sieve = sieve_of_erathosteneses(n)\n # puts \"sieve:#{sieve}\"\n semi = semiprimes(n, sieve)\n # puts \"sp:#{semi}\"\n prefix = [0,0,0,0,1]\n 5.upto(n) do |x|\n if semi.include? x \n prefix << prefix.last + 1\n else\n prefix << prefix.last\n end\n end\n # puts \"prefix:#{prefix}\"\n\n queries = [p,q].transpose\n\n\n res = queries.map do |query|\n prefix[query.last] - prefix[query.first - 1]\n end\n\n # puts \"res:#{res}\"\n\n res\n end",
"title": ""
},
{
"docid": "2c5090c0737e63ee23f1300ec3567b3d",
"score": "0.60509044",
"text": "def solution(a)\n # write your code in Ruby 2.2\n sum = a.inject(:+)\n acc = 0\n\n min = 99999999\n a[0..-2].each do |n|\n sum -= n\n acc += n\n\n min = [(acc - sum).abs, min].min\n end\n min\nend",
"title": ""
},
{
"docid": "9504849a215dc694b8e78abdb0e25b8d",
"score": "0.6049761",
"text": "def euler29(n)\n terms = []\n 2.upto(n) do |i|\n 2.upto(n) do |j|\n if terms.include?(i ** j) == false\n terms << i ** j\n end\n end\n end\n \n terms.length\nend",
"title": ""
},
{
"docid": "421ad335e7bf4db6b5282133a19bbb64",
"score": "0.6048627",
"text": "def largest_contiguous_subsum1(list)\n p Time.now\n sub_arrays = []\n list.each_index do |i|\n list.each_index do |j|\n next if j < i\n sub_arrays << list[i..j]\n end\n end\n sub_arrays.map{|numbers| numbers.inject(:+)}.max\n p Time.now\nend",
"title": ""
},
{
"docid": "b5653df4f83d5a2cf413d20a5afa9dff",
"score": "0.6043183",
"text": "def findDiffSquares(n)\n sum = 0\n (1..n).each { |i|\n (1..n).each { |j|\n sum += i*j unless i == j\n }\n }\n sum\nend",
"title": ""
},
{
"docid": "6d05663b17256adbb9564a477bb6f93c",
"score": "0.60421157",
"text": "def solution(a)\n # In production environment this will be my solution:\n # a.uniq.size\n #\n # But since this is a coding challenge, my assumption\n # is that you're looking for a by-hand O(N*logN) solution\n\n return 0 if a.empty?\n\n n = a.size\n ary = a.sort\n uniques = 1\n (1...n).each do |i|\n uniques += 1 if ary[i] != ary[i - 1]\n end\n uniques\nend",
"title": ""
},
{
"docid": "ae5862ea00cac28acf298bd13187f3bf",
"score": "0.6037357",
"text": "def my_min(list) \n\n list.each_with_index do |ele, i| #O(n)\n compare_arr = list[0...i] + list[i+1..-1] # O(2n) \n return ele if compare_arr.all? { |ele2| ele < ele2 } #O(n)\n end\n\n #time complexity = O(n^2) + O(2n)\n\nend",
"title": ""
},
{
"docid": "f36ae726d24d63caab0a0f19ef9925bc",
"score": "0.6026753",
"text": "def seesaw?(arr)\n left_sum = 0\n arr.each_index do |i| #O(n)\n if i > 0\n left_sum = arr[0...i].reduce(:+) #O(n)\n end\n if i < arr.size-1\n right_sum = arr[i+1..-1].reduce(:+); #O(n)\n else\n right_sum = 0\n end\n if left_sum == right_sum\n return true\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "2f5b891d12715980b50b74119d59bced",
"score": "0.6024436",
"text": "def largest_contiguous_subsum(arr) #BigO of O(n)\n max = 0 \n current_sum = 0\n arr.each_with_index do |el,idx|\n if current_sum + el >= el \n current_sum += el \n else \n current_sum = el \n end \n max = current_sum if current_sum > max \n end \n max\nend",
"title": ""
},
{
"docid": "a1fe43060a4407be5a71bafbaa1e36af",
"score": "0.5997701",
"text": "def solve( n = 10_000 )\n (1..n).select {|i| i.amicable?}.reduce( :+ )\n end",
"title": ""
},
{
"docid": "0cd572be862829382e348880049e6589",
"score": "0.5990948",
"text": "def largest_cont_subsum_fast(list)\n # for constant size to be true, you cant create any variables\n # whose memory size depends on the size of the input\n curr_sum = list[0]\n largest_sum = list[0]\n\n # we know there are n^2 potential, so if we ever check all of them\n # it must be n^2\n\n # there must be a way to find the max without checking every subarray\n list[1..-1].each do |ele|\n # debugger\n if curr_sum > largest_sum\n largest_sum = curr_sum\n end\n\n if curr_sum < 0\n curr_sum = 0\n end\n\n curr_sum += ele\n\n end\n\n # debugger\n return [largest_sum, curr_sum].max\n\nend",
"title": ""
},
{
"docid": "e625e8a723f51af4b24bfed22a83a7dd",
"score": "0.5988622",
"text": "def solution(a)\n # write your code in Ruby 2.2\n n = a.length\n \n counter = Array.new(n+1, 0)\n \n a.each do |x|\n counter[x-1] += 1\n end\n \n return counter.index { |x| x == 0 } + 1\nend",
"title": ""
},
{
"docid": "492e936526ebfbffbc3c3b62f458936f",
"score": "0.5986562",
"text": "def solution(a)\n n = a.size\n return 0 unless n > 2\n a.sort!\n\n (2..n - 1).each do |i|\n return 1 if a[i - 2] + a[i - 1] > a[i]\n end\n\n return 0\nend",
"title": ""
},
{
"docid": "365dd8a504169196d1034e8fe4f489cb",
"score": "0.5986146",
"text": "def my_min_2(arr)\n\n smallest_value = arr[0] # O(1)\n\n arr.each do |ele1| # [ 0, 3, 5, 4, -5, 10, 1, 90 ] O(n)\n smallest_value = ele1 if ele1 <= smallest_value #O(1)\n end\n\n smallest_value #O(1)\n\nend",
"title": ""
},
{
"docid": "e616ff371640b6ccde57859a560ece90",
"score": "0.59800786",
"text": "def equil_idcs(a)\n left = 0\n sum = a.inject(:+)\n equils = []\n a.each_with_index do |num, idx|\n sum -= num\n equils << idx if left == sum\n left += num\n end\n equils.empty? ? -1 : equils\nend",
"title": ""
},
{
"docid": "80d2f9b82bfbacb75f63a7203330e7be",
"score": "0.5962478",
"text": "def two_sum?(array, target)\n #O(n)\n hash = Hash.new(0)\n i = 1\n array.each do |ele|\n hash[ele] = i \n i += 1\n end\n hash.each_key do |k|\n return true if hash.has_key?(target - k) && hash[k] != hash[target - k]\n end\n false \nend",
"title": ""
},
{
"docid": "d45d411f74262d41ad851457afd5f575",
"score": "0.595484",
"text": "def problem_57\n ret,n,d = 0,1,1\n 1000.times do |i|\n n,d = (n+2*d),(n+d)\n ret += 1 if n.to_s.length > d.to_s.length\n end\n ret\nend",
"title": ""
},
{
"docid": "1aac635bc730afb7dd151ad142cbd1df",
"score": "0.5944647",
"text": "def solution(a)\n n = a.size\n a.sort!\n\n count = 0\n for i in 0...n-2 do\n k = i+2\n for j in i+1...n-1 do\n while k < n and a[i] + a[j] > a[k] do\n k += 1\n end\n count += k - j - 1\n end\n end\n count\nend",
"title": ""
},
{
"docid": "19b16b0a0e95399f58fc14d8c7723ccb",
"score": "0.5936387",
"text": "def solve( n = 100 )\n n.partition_sieve[-1] - 1\n end",
"title": ""
},
{
"docid": "fb6af3238f062ae1a2ea7e63d90e7151",
"score": "0.59271485",
"text": "def find_amicables(n)\n pairs = []\n sum = 0\n for i in 0..n do \n next if pairs.include? i\n d = sum_proper_divisors(i)\n next if d == i\n p = sum_proper_divisors(d)\n if p == i \n pairs << d\n pairs << i\n sum += d + i\n end\n end\n return sum\nend",
"title": ""
},
{
"docid": "bd329ec2d26f91e6d351152792a72fb9",
"score": "0.5919086",
"text": "def solution(a)\n # write your code in Ruby 2.2\n num_of_elements=a.length\n num_of_zeros=0\n tot_num_car_pairs=0\n a.each do |element|\n if element == 0\n num_of_zeros+=1\n else\n tot_num_car_pairs+=num_of_zeros\n end\n end\n return tot_num_car_pairs>1_000_000_000?-1:tot_num_car_pairs\nend",
"title": ""
},
{
"docid": "500edb8b87052ccb888165ac1d221113",
"score": "0.59153515",
"text": "def fibonacci(n)\n return fib_helper([0, 1], 2, n)\n # if you'd like to test what i THINK is an O(1) space complexity solution.....\n # i did run this through the tests and it SHOULD work:\n # return faster_fib_helper([0, 1], 2, n)\nend",
"title": ""
},
{
"docid": "1af3960e17784e5fc5845eee63332e9e",
"score": "0.59129",
"text": "def amicable_numbers(n)\r\n numbers = Array.new\r\n 2.upto(n) do |x|\r\n y = d(x)\r\n if !numbers.include?(y)\r\n numbers.push(x,y) if d(y) == x && y != x\r\n end\r\n end\r\n return numbers\r\nend",
"title": ""
},
{
"docid": "91ffbaab10094eb21cd05e4275343694",
"score": "0.5903184",
"text": "def find_duplicate_space(nums)\n # sort nums first (lgn), then check for dups by iterate over (n)\n last_seen = 0\n nums.sort!.each do |num|\n return num if last_seen == num\n last_seen = num\n end\nend",
"title": ""
},
{
"docid": "993d2eb5ff5d55be0267c483d0ebb7a3",
"score": "0.59011143",
"text": "def canBeSum(n, array, cache)\n\ti = 0\n\twhile array[i] <= n / 2\n\t\tif cache[n-array[i]] # array.include?(n-array[i]) is OK, but very slow\n\t\t\treturn true\n\t\tend\n\n\t\ti += 1\n\tend\n\n\treturn false\nend",
"title": ""
},
{
"docid": "7bdd1bc6898a99677bc80a4bf4c2ba9a",
"score": "0.5895001",
"text": "def solution(a)\n len = a.size\n unique = {}\n i = 0\n while i < len\n item = a[i]\n if unique.has_key?(item)\n unique[item] += 1\n else\n unique[item] = 1\n end\n i += 1\n end\n pairs = 0\n unique.each do |key,count|\n (1...count).step {|n| pairs += n }\n end\n return pairs > 1_000_000_000 ? 1_000_000_000 : pairs\nend",
"title": ""
},
{
"docid": "ee949a433d5b1a5996d6e25d61cad81d",
"score": "0.58947605",
"text": "def dp_possible_trees(n)\n array = Array.new(n+2) { Array.new(n+1) { 0 } }\n (0...n+2).to_a.each do |i|\n array[i][0] = 1\n end\n\n sum = 0\n (1...n+1).to_a.each do |i|\n sum = 0\n (1..i).to_a.each do |j|\n array[j][i] = array[n+1][i-j] * array[n+1][j-1]\n sum += array[j][i]\n end\n array[n+1][i] = sum\n end\n array[n+1].last\nend",
"title": ""
},
{
"docid": "f53ddbaae50513f65c30d400fc86503f",
"score": "0.58922195",
"text": "def largest_contiguous_subsum2(list)\n # O(N) ==> Time\n # O(1) ==> Space\n largest = list.first\n curr = list.first\n\n len = list.length\n (1...len).each do |i|\n curr = 0 if curr < 0 \n curr += list[i]\n largest = curr if curr > largest\n end\n largest\nend",
"title": ""
},
{
"docid": "fdf3ebf41a319a4d2f15b8cf2969d65a",
"score": "0.5884157",
"text": "def hash_two_sum(arr,target_sum)\n #creates a new hash with each element that is satisfying the target_sum\n hash = Hash.new(0) #{|h,k| h[k] = []}\n (0...arr.length).each { |i| hash[i] = arr[i]} #O(n)\nend",
"title": ""
},
{
"docid": "0d9c1f4a4ed2cf3708374baae3ffa592",
"score": "0.5880875",
"text": "def largest_contiguous_subsum_fast(list)\n start = Time.now\n max_sum = list[0]\n cur_sum = list[0]\n list[1..-1].each do |el|\n if el >= cur_sum && cur_sum < 0\n cur_sum = el\n else\n cur_sum += el\n end\n max_sum = cur_sum if cur_sum > max_sum\n end\n finish = Time.now\n puts \"Runtime: #{finish - start}\"\n return max_sum\nend",
"title": ""
},
{
"docid": "90497aa50e05e44f68c467f8b91a743a",
"score": "0.58798903",
"text": "def find_duplicate(nums)\n if !nums or nums.size == 0\n return nil\n else\n fast = nums[ 0 ]\n slow = nums[ 0 ]\n while true\n fast = nums[ fast ]\n fast = nums[ fast ]\n slow = nums[ slow ]\n if fast == slow\n new_node = nums[ 0 ]\n while new_node != slow\n new_node = nums[ new_node ]\n slow = nums[ slow ]\n end\n return slow\n end\n end\n end\nend",
"title": ""
},
{
"docid": "03e08b1b2be9f1297b1ec11948e1c7c7",
"score": "0.58797616",
"text": "def main\n\n sum = 0\n\n (0..999).each do |i|\n sum += check(i)\n end\n\n puts \"Total - O(n) #{sum}\"\n\n # Needed to refresh following: https://en.wikipedia.org/wiki/Arithmetic_progression\n sum2 = sum_multiples(3, 1000) + sum_multiples(5, 1000) - sum_multiples(15, 1000)\n\n # Refreshed Big O too : http://stackoverflow.com/questions/487258/plain-english-explanation-of-big-o \n puts \"Total - O(1) #{sum2}\"\n\nend",
"title": ""
},
{
"docid": "fc9feae213ebd143657bc41b94d6e46e",
"score": "0.58770555",
"text": "def solution(a)\n min_val = 10_000\n min_pos = 0\n \n sums = [0]\n for i in (0..a.count - 1) \n sums << sums.last + a[i] \n end\n for p in (0..a.count - 2)\n for q in (p + 1..[p + 2, a.count - 1].min)\n s = (sums[q + 1] - sums[p]).to_f / (q - p + 1)\n if s < min_val\n min_val = s\n min_pos = p\n end\n end\n end\n min_pos\nend",
"title": ""
},
{
"docid": "2fd5780f27e1aa7a0e2b25710b0d936c",
"score": "0.58751744",
"text": "def find_missing(array, n)\n i = 0\n\n (1..n).each { |number| i = i ^ number }\n array.each { |number| i = i ^ number }\n\n i\nend",
"title": ""
},
{
"docid": "98ed5a760cfc0a12c218af7adfe0c420",
"score": "0.5870103",
"text": "def solution(a)\n length = a.length\n sum = (length + 1) * (length + 1 + 1) / 2\n\n sum - a.inject(0) { |acc, e| acc += e }\nend",
"title": ""
},
{
"docid": "2594d3e4e7be8008e4ee79d543bd825a",
"score": "0.58621824",
"text": "def solution(a)\n counter = Hash.new(0)\n a.each do |elem|\n counter[elem] += 1\n end\n\n (1..a.size).each do |number|\n return 0 if counter[number] != 1\n end\n\n 1\nend",
"title": ""
},
{
"docid": "8cb56491f863f9070ac3c50d4889baf9",
"score": "0.58589673",
"text": "def stones(n, a, b)\n ar=[0]\n (n-1).times do |val|\n tmp=[]\n ar.each do |v|\n tmp << v+a if !tmp.include?(v+a)\n tmp << v+b if !tmp.include?(v+b)\n end\n ar=tmp\n end\n ar.sort\nend",
"title": ""
},
{
"docid": "40876051aac31effc28301d2496b635a",
"score": "0.58583444",
"text": "def solution(a)\n ((1..a.size + 1).to_a - a).first\nend",
"title": ""
},
{
"docid": "5b391c9852052f31ef29a1429822bf89",
"score": "0.585635",
"text": "def arrayManipulation(n, queries)\n arr = Array.new(n + 2, 0)\n\n queries.each do |a, b, k|\n arr[a] += k\n arr[b + 1] -= k\n end\n\n max_sum = 0\n sum = 0\n arr.filter { |diff| diff != 0 }.each do |diff|\n sum += diff\n max_sum = [max_sum, sum].max\n end\n\n max_sum\nend",
"title": ""
},
{
"docid": "f1f2ef11997fd85f4a03f06ac52beed9",
"score": "0.5855646",
"text": "def two_sum(arr) #o(ns)\n set = Set.new\n arr.each{|el| set << el}\n arr.select{|el| set.include?(-1 * el)}\nend",
"title": ""
},
{
"docid": "bb1820c91cbfb4ca6d6e5861db7c94fb",
"score": "0.585273",
"text": "def efficient_contiguous_subsum(list)\n current_sum = list[0] #0\n largest_sum = list[0] #5\n # debugger\n (1...list.length).each do |i| \n if current_sum + list[i] > 0 \n current_sum += list[i] \n largest_sum = current_sum if current_sum > largest_sum\n else \n current_sum = 0\n end \n end \n largest_sum\nend",
"title": ""
},
{
"docid": "afa78c0247b2ce9b869728a9c1b8da72",
"score": "0.5844765",
"text": "def two_sum_v3?(arr, target) \n hash = Hash.new\n arr.each { |ele| hash[ele] = ele } #o(n)\n arr.each do |ele| #o(n)\n search_value = target - ele\n return true if !hash[search_value].nil? && hash[search_value] != ele\n end\n false\nend",
"title": ""
},
{
"docid": "1f57f9854272d86e4b72449097b9ad6e",
"score": "0.5841549",
"text": "def largest_contiguous_subsum_1(list) \n subs = [] #O(1)\n (0...list.length).each do |start_num| #O(n)\n (start_num...list.length).each do |end_num| #O(n)\n subs << list[start_num..end_num] #O(n)\n end\n end\n subs_sum = [] #O(1)\n subs.each do |sub| #O(n**2)\n sub_sum = 0 #O(1)\n sub.each {|s| sub_sum += s} #O(n)\n subs_sum << sub_sum #O(1)\n end\n subs_sum.inject do |acc,el| #O(n)\n if acc > el #O(1)\n acc #O(1)\n else\n el #O(1)\n end\n end\n end",
"title": ""
},
{
"docid": "2681941780700d012e3c5c3ff966bbea",
"score": "0.5836641",
"text": "def solution(a)\n result = 0\n tmp_count = 0\n a.each_with_index do |val, idx|\n if val.zero?\n tmp_count += 1\n else\n result += tmp_count\n end\n end\n return result > 1000000000 ? -1 : result\nend",
"title": ""
},
{
"docid": "22cb57cc0084d3164f837a7656c38842",
"score": "0.5831821",
"text": "def naive_algorithm(arr)\n\tproduct = 0\n\tarr.each do |i|\n\t arr.each do |j|\n\t \tp = arr[i] * arr[j]\n\t \tproduct = p if product < p\n\t end\t\n\tend\t\t\n\tproduct\nend",
"title": ""
},
{
"docid": "d74fcd08d67e9e25535ad26e2754c032",
"score": "0.582915",
"text": "def removNb(n)\n results = []\n (2..n).each do |a|\n b = (n*(n+1)/2.0-a)/(a + 1)\n results << [a, b.to_i] if b % 1 == 0 && b < n && b > 2\n end\n results\nend",
"title": ""
},
{
"docid": "11d20b3a7e3ac9a2a4800817701e68d0",
"score": "0.5824658",
"text": "def solution(a)\n # write your code in Ruby 2.2\n seen = {}\n\n a.each do |number|\n seen[number] = true\n end\n\n max = a.max\n\n for i in 1..(max + 1)\n return i unless seen[i]\n end\n\n 1\nend",
"title": ""
},
{
"docid": "9194a70d556bbaa3bdc648a43836fe15",
"score": "0.5821224",
"text": "def fast_lcss(arr)\n i_arr = []\n biggest = 0\n max_sub_arr = []\n arr.length.times do |x|\n arr.map do |ele1|\n i_arr += [ele1]\n sum = i_arr.inject(0) do |a, b|\n a + b\n end\n max_sub_arr = i_arr if sum > biggest\n biggest = sum if sum > biggest \n end\n i_arr = []\n arr.shift\n end\n max_sub_arr\nend",
"title": ""
},
{
"docid": "0787a823b277ef7c2eb31fa02ae51cc7",
"score": "0.58146083",
"text": "def find3(a, X)\n # scan through array\n # build hash storing complement in each key\n complements = {}\n a.each_with_index do |val, ind|\n if complements[X - val]\n complements[X - val].push(ind)\n else\n complements[X - val] = [ind]\n end\n end\n\n # scan through the array again\n # get complement\n # for each value scan the remainder of the arrray\n # for a value such taht a + b = the complement\n\n # for each character we have built a dictionary such that, we can find\n # x = a + complement\n\n # [1, 2, 3]\n # 1 + 2 = 3\n # 1 + 3 = 4 =>\n\n # for each value in the array (a) look at all following values (b) and see if a + b\n # is in the dictionary, if it is, check that their indices do not collide with the index\n # stored at dict(a+b)\n\n a.each_with_index do |va, i|\n a.each_with_index do |vb, j|\n break if i == j\n\n complement = va + vb\n indices = complements[complement]\n\n indices.each do |z|\n # every index is unique\n return [i, j, z] unless z == i || z == j\n end\n end\n end\n\n return nil\nend",
"title": ""
},
{
"docid": "459e8c7fa69b32048057e683543abaea",
"score": "0.5810093",
"text": "def equal(arr)\n size = arr.size\n hash = Hash.new{|h,k| h[k] = []}\n (0...size).each do |i|\n (i + 1...size - 1).each do |j|\n sum = arr[i] + arr[j]\n if hash.has_key?(sum)\n values = hash[sum]\n values << i\n values << j\n return values\n else\n hash[sum] = [i, j]\n end\n end\n end\nend",
"title": ""
},
{
"docid": "7e5a7334bf7240feb8ec05c4e99eb0ca",
"score": "0.58021265",
"text": "def sum_upon_sums(array)\n # Step 0: initialize variables => O(1)\n max = -1\n sum = 0\n\n # Step 1: Get Max and Sum => O(n)\n array.each do |num|\n max = num if num >= max\n sum += num\n end\n\n # Step 2: Get summation => O(1)\n summation = max * (max + 1) / 2\n\n # Step 3: Return Missing value by subtracting summation and sum => O(1)\n summation - sum\nend",
"title": ""
},
{
"docid": "b08b734aad1998b7807ec224a999040f",
"score": "0.5799882",
"text": "def josephus_survivor(n,k)\n result = 1\n for i in 1...n + 1\n result = (result + k - 1) % i + 1\n end\n \n result\nend",
"title": ""
},
{
"docid": "91266abbc0608a7b867cb820f7f9667a",
"score": "0.5795719",
"text": "def sturges\n len = array.length\n return 1.0 if len == 0\n\n # return (long)(ceil(Math.log2(n)) + 1);\n return Math.log2(len).ceil + 1\n end",
"title": ""
},
{
"docid": "bad8c0f418df218dfb5433929c7edf28",
"score": "0.5791999",
"text": "def solution(a)\n left = 0\n right = a.sum\n a.each_with_index do |element, index|\n right -= element\n return index if left == right\n left += element\n end\n -1\nend",
"title": ""
},
{
"docid": "f20c4124b3fc6d39867ccf4f6ec2f7e2",
"score": "0.5784635",
"text": "def sub_sum(list)\n array = []\n (0...list.length).each do |idx1|\n (idx1...list.length).each do |idx2|\n array << list[idx1..idx2] #O(n)\n end\n end \n array.map {|sub| sub.length > 1 ? sub.sum : sub.first}.max\nend",
"title": ""
},
{
"docid": "a60dcadfe42e6d9b4693c1f9b0e8bd98",
"score": "0.5784555",
"text": "def sub_sum_better(list)\n largest_sum = list.first\n\n #iterate over once.\n # as you iterate keep a tally of the sum.\n # indexing into an array is O(1)\n # [2, 3, -6, 7, -6, 7]\n\n sub_sum = 0\n list.each do |el|\n sub_sum += el\n largest_sum = sub_sum if sub_sum > largest_sum\n\n sub_sum = 0 if sub_sum < 0\n end\n\n largest_sum\nend",
"title": ""
},
{
"docid": "bfc0e9bb5d0b1dcf555f8d40365c317e",
"score": "0.57841897",
"text": "def josephus_survivor(n,k)\n arr = (1..n).to_a\n\n while arr.length > 1\n idx = k % arr.length\n\n if arr.length > k\n arr = arr.drop(k) + arr.take(k - 1)\n elsif arr.length == k \n arr = arr[0...-1]\n else\n arr = arr.drop(idx) + arr.take(idx - 1)\n end\n end\n \n arr[0]\nend",
"title": ""
},
{
"docid": "9388ff6b62bb7d56ebecdece45b2f486",
"score": "0.5776699",
"text": "def arrayManipulation(n, queries)\n nums = Array.new(n+1, 0)\n queries.each do |query|\n nums[query[0]-1] += query[2]\n nums[query[1]] -= query[2]\n end\n\n max = nums.first\n (1..nums.length-1).each do |i|\n nums[i] += nums[i - 1]\n max = nums[i] if nums[i] > max && i < (nums.size - 1)\n end\n\n max\nend",
"title": ""
},
{
"docid": "034b369a6a4d2fb7b4420415908d3f71",
"score": "0.5776534",
"text": "def solution(n)\n x = (n**0.5).floor\n (1..x).reduce(0) { |s, i| n % i == 0 ? s += (i * i == n ? 1 : 2) : s }\nend",
"title": ""
},
{
"docid": "0cbfdb1cad0fdf742ade5f70a04aaa64",
"score": "0.5768136",
"text": "def sum_to_n? arr, n\n hash = Hash.new\n arr.each do |val|\n if hash.key? val\n return true\n else\n hash[n-val] = val\n end\n end\n return false\nend",
"title": ""
},
{
"docid": "20c7ee0ebe53b3e79acee829579f911f",
"score": "0.57556313",
"text": "def largest_contiguous_subsum(list)\n new_arr = []\n\n (0...list.length).each do |idx1| #O(n)\n (0...list.length).each do |idx2| #O(n)\n if idx2 >= idx1 #O(1)\n new_arr << list[idx1..idx2].sum #O(1)\n end \n end \n \n end \n \n return new_arr.max #O(n)\nend",
"title": ""
},
{
"docid": "279e45886b15f0a0f3153440efa3ffa1",
"score": "0.5747988",
"text": "def process n\n i = 1\n while (2**i <= n)\n i += 1\n end\n n == 2**(i-1)\nend",
"title": ""
},
{
"docid": "fd00c8815e9dde4ba60cfcee2ea39e0b",
"score": "0.5747112",
"text": "def two_sum?(arr, target_sum) # O(N)\n hash = Hash.new(0)\n count = Hash.new(0)\n\n arr.each do |num|\n hash[num] = target_sum - num\n count[num] += 1\n end\n\n hash.each do |key, value|\n if hash.has_key?(value) \n if key == value \n if count[value] > 1\n return true\n end\n else\n return true\n end\n end\n end\n\n false\nend",
"title": ""
},
{
"docid": "2a0a97af3384ad967f688fae6d66e2ba",
"score": "0.5745952",
"text": "def solution(n, a)\n # write your code in Ruby 2.2\n arr = [0] * n\n max_c = 0\n \n a.each_with_index do |value,index|\n if value == n + 1\n arr = [max_c] * n\n else\n arr[value - 1] = arr[value - 1] + 1\n max_c = (arr[value -1] > max_c ? arr[value -1] : max_c)\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "78dbe5c66c3c7dac5a025f544ef86461",
"score": "0.57458985",
"text": "def solution(a)\n s= a.sort\n 0.step(s.size - 1).inject(0) do |result, x|\n z= x+2\n (x+1).step(s.size - 1).inject(result) do |acc, y|\n z+=1 while z < s.size && s[x] + s[y] > s[z]\n acc += z-y-1\n end\n end\nend",
"title": ""
},
{
"docid": "e30145ff17b2668fc7b5ea5c2ca44dbe",
"score": "0.5745351",
"text": "def largest_contiguous_subsum(list) # O(n^2)\n array = []\n list.each_with_index do |ele1, i1| # O(n^2)\n (i1...list.length).each do |i2|\n array << list[i1..i2]\n end\n end\n\n max_sum = array.first.sum\n array[1..-1].each do |subarr| # O(n^2)\n sum = subarr.sum\n if sum > max_sum\n max_sum = sum\n end\n end\n\n max_sum\n\nend",
"title": ""
},
{
"docid": "e499892a596b7a2619d0bd3a69cf6414",
"score": "0.5744163",
"text": "def largest_contiguous_subsum(list)\r\n sub_arr = []\r\n list.each_with_index do |ele1,idx1|\r\n list.each_with_index do |ele2,idx2|\r\n sub_arr<< list[idx1..idx2] if idx2>=idx1\r\n end\r\n end\r\n p sub_arr.size\r\n sub_arr.map{ |sub| sub.sum}.max\r\n #(O(n^2 + m)\r\nend",
"title": ""
},
{
"docid": "75b6bf9aa40a97e861e73bd5d5bba281",
"score": "0.5739495",
"text": "def solution(a)\n n = a.size\n starting = Array.new(n, 0)\n ending = Array.new(n, 0)\n\n (1..n - 2).each {|i| starting[i] = [starting[i - 1] + a[i], 0].max}\n (1..n - 2).reverse_each {|i| ending[i] = [ending[i + 1] + a[i], 0].max}\n\n sum = 0\n (1..n - 2).each {|i| sum = [sum, starting[i - 1] + ending[i + 1]].max}\n sum\nend",
"title": ""
},
{
"docid": "963605a94fcce0ff272f35959fda6f86",
"score": "0.5738512",
"text": "def bad_contig_subsum(arr)\n # n! || n^3 ?\n sub_arrays = []\n arr.each_index do |i|\n (i...arr.length).each do |j|\n sub_arrays << arr[i..j]\n end\n end\n\n # above * n^2 ? << bottleneck\n max = sub_arrays.first.inject(&:+)\n sub_arrays.each do |sub_arr|\n sub_sum = sub_arr.inject(&:+)\n max = sub_sum if sub_sum > max\n end\n max\nend",
"title": ""
},
{
"docid": "d3f7c9a925a63a30d15ca78a19f3aa4e",
"score": "0.5731186",
"text": "def three_sum_fast(arr)\n arr = merge_sort(arr)\n count = 0\n\n (0..arr.length - 1).each { |i|\n (i + 1..arr.length - 1).each { |j|\n if bin_search(arr, -arr[i] - arr[j]) > j\n count += 1\n end\n }\n }\n count\nend",
"title": ""
},
{
"docid": "093e9b005e7a3ce7cf5a9dfcda630341",
"score": "0.5730863",
"text": "def bad_two_sum?(arr, target)\n arr.each_with_index do |num1, idx1| #O(n)\n arr.each_with_index do |num2, idx2| #O(n)\n return true if idx2 > idx1 && num1 + num2 == target #O(1)\n end\n end\n false\nend",
"title": ""
},
{
"docid": "1e714fb051be26f6a14c2bc3b412cfc5",
"score": "0.5721406",
"text": "def solution2\n n = 1000\n\n hsh = Hash.new([])\n\n (1..n).each do |x|\n (1..n).each do |y|\n hsh[x**3 + y**3] += [x, y]\n end\n end\n\n hsh.values\nend",
"title": ""
},
{
"docid": "72acef635bab81840dbbb8c30fa1acc1",
"score": "0.5720941",
"text": "def sorted_squared_array_n_nlogn(values)\n values.collect!{|val| val*val}\n merge_sort(values)\nend",
"title": ""
},
{
"docid": "e5901647671bf63f0799a090e60aa7c3",
"score": "0.5716441",
"text": "def solution(a)\n # we could do radix sort and then loop over all the items in order to find the missing element\n # in the ordered list or use the Gauss theorem: https://study.com/academy/lesson/finding-the-sum-of-consecutive-numbers.html\n #\n # if we use the Gauss theorem we can do:\n # sum = (1 + N+1) * ( N / 2 )\n #\n # if (1 + N+1) % 2 == 1 we need to sum also (n+1+1)/2 + 1\n #\n # then remove every item from the sum: the remainder is the missing number\n len = a.length\n sum = (1 + len + 1) * ((len + 1) / 2)\n sum += ((len + 1) / 2.0).ceil unless (len + 1) % 2 == 0\n\n a.reduce(sum) do |sum, i|\n sum - i\n end\nend",
"title": ""
},
{
"docid": "a28ead081481ff91a42fd25a76c22045",
"score": "0.5715833",
"text": "def okay_two_sum?(arr, target)\n sorted = arr.sort # n log n => quicksort => is nlogn DOMINANT\n sorted.each_with_index do |num, i| # => O(n)\n # return true if sorted[i] + sorted[-1 - i] == target\n return true if sorted[i + 1 .. - 1].bsearch {|number| target - num <=> number} # => O(log(n))\n # ASK TA ABOUT BSEARCH\n # bsearch {|ele| pivot <=> ele}\n end\n false\nend",
"title": ""
},
{
"docid": "bf5676a56113c9b5ed2d83854c5bff57",
"score": "0.5714361",
"text": "def slow_solution(a)\n m = 0\n a.size.times do |i|\n a[i] = a[i].abs\n m = [a[i], m].max\n end\n maxsum = a.sum # sum of absolute val of all nums in array\n # maxsum = a.map(&:abs).sum <- Ruby shortcut\n\n # If dp = 1 at an index, it means some combo of elements in a add up to that index\n dp = [0] * (maxsum + 1)\n dp[0] = 1\n\n a.size.times do |j|\n maxsum.downto(0).each do |possible_sum|\n puts \"a[j]: #{a[j]}, possible sum: #{possible_sum}\"\n if (dp[possible_sum] == 1) and (possible_sum + a[j] <= maxsum)\n\n # if possible_sum + new element a[j] is possible sum, dp = 1!\n dp[possible_sum + a[j]] = 1\n puts \"Mark #{possible_sum + a[j]} as possible sum in dp\"\n end\n end\n puts \"row: #{j}, a[j]: #{a[j]}, dp: #{dp}\"\n puts\n end\n\n min_q_minus_p = maxsum\n\n # Divide array a into 2 parts, where P = sum of part 1 and Q = sum of part 2,\n # P + Q = maxsum, and P <= maxsum / 2 <= Q.\n # We want largest possible P to get smallest possible Q-P.\n\n # loop from 0 to maxsum / 2, covering every possible P, Q division\n (maxsum / 2 + 1).times do |possible_half_sum|\n # puts \"possible_half_sum: #{possible_half_sum}\"\n if dp[possible_half_sum] == 1 # means P or Q = possible_half_sum\n q_minus_p = maxsum - 2 * possible_half_sum\n # puts \"Q - P: #{q_minus_p}\"\n min_q_minus_p = [min_q_minus_p, q_minus_p].min\n # puts \"min Q - P: #{min_q_minus_p}\"\n end\n end\n\n min_q_minus_p\nend",
"title": ""
},
{
"docid": "fa2042a47af557331a79c76eb4952bf7",
"score": "0.5712655",
"text": "def collisions(arr)\n new_arr = []\n result = []\n arr.each do |i|\n if i > 0\n new_arr << i\n else\n if new_arr.empty?\n result << i\n else\n if new_arr[-1] == -(i)\n new_arr.pop\n else\n while !new_arr.empty? && new_arr[-1] < -(i)\n new_arr.pop\n end\n if new_arr.empty?\n result << i\n end\n end\n end\n end\n end\n return (result.concat(new_arr))\nend",
"title": ""
},
{
"docid": "e637456d94903dc45f93fc154b8cd624",
"score": "0.57119",
"text": "def seesaw2?(arr)\n left_sum = 0\n right_sum = arr.size > 1 ? arr[1..-1].reduce(:+) : 0\n\n arr.each_index do |i| #O(n)\n return true if left_sum == right_sum\n left_sum += arr[i]\n i < arr.size-1 ? right_sum -= arr[i+1] : right_sum = 0\n end\n return false\nend",
"title": ""
},
{
"docid": "8177e2338342fbfef778f02d1c1aed4b",
"score": "0.5709845",
"text": "def solution(a)\n # write your code in Ruby 2.2\n binding.pry\n trips = Hash.new {|h,k| h[k]=0}\n start = 0\n ending = 0\n min = nil\n a.each_with_index do |trip,i|\n ending = i\n\n if trips[trip] == 0\n min = ending - start\n end\n trips[trip] += 1\n\n while start < ending\n break if trips[a[start]] - 1 == 0\n trips[start] -= 1\n start += 1\n min = ending - start if ending-start < min\n end\n end\n min\nend",
"title": ""
},
{
"docid": "9a8accf5cd4b8ec522f7dbe0ae9a8a19",
"score": "0.56992185",
"text": "def running_time(array)\n cnt = 0\n (1...(array.length)).each do |x|\n y = x\n while y.positive?\n break unless array[y - 1] > array[y]\n\n temp_num = array[y]\n array[y] = array[y - 1]\n array[y - 1] = temp_num\n cnt += 1\n y -= 1\n end\n end\n cnt\nend",
"title": ""
},
{
"docid": "f695f14b1232768df7cff7a9cf65b97d",
"score": "0.5698004",
"text": "def solution(n, a)\n counters = Array.new(n, 0)\n max = 0\n a.each do |item|\n if item >= 1 && item <= n\n counters[item - 1] += 1\n max = counters[item - 1] if counters[item - 1] > max\n elsif item == n + 1\n counters = Array.new(n, max)\n end\n end\n\n counters\nend",
"title": ""
},
{
"docid": "3e6d4b4da710718ca73021b0599cd327",
"score": "0.56963414",
"text": "def move_zeros(array)\n zero_count = 0\n # O(n)\n array.each do |num|\n\n zero_count += 1 if num == 0\n end\n\n # O(n)\n array = array.select { |num| num != 0 }\n \n # O(1)\n zero_count.times do\n array += [0]\n end\n\n array\nend",
"title": ""
},
{
"docid": "7969f092083a526d5532da4a18b66f2b",
"score": "0.56958854",
"text": "def brute_force_two_sum(array, target)\n indexes = []\n array.each.with_index do |n1, index1|\n array.each.with_index do |n2, index2|\n indexes.push(index1) if target - n1 == n2 && index1 != index2\n end\n end\n indexes\nend",
"title": ""
},
{
"docid": "0cfcd196577e49f6cf45082e254fc111",
"score": "0.5691327",
"text": "def dbl_linear(n)\n result = [1] # base\n\n i = 0 # pointer for 2x + 1\n j = 0 # pointer for 3x + 1\n\n until result.size == n + 1 # because n is an index (size - 1)\n list1 = 2 * result[i] + 1\n list2 = 3 * result[j] + 1\n min = [list1, list2].min\n\n result << min\n\n i += 1 if min == list1\n j += 1 if min == list2\n end\n\n result.last\nend",
"title": ""
},
{
"docid": "c01dc212cf35f21fc9185492933017d7",
"score": "0.5684196",
"text": "def solution(n)\n array = Array.new\n (1..n).each do\n array.push(0)\n end\n while (array.length >= 16)\n (1..16).each do\n array.pop\n end \n end\n array.length\nend",
"title": ""
},
{
"docid": "94ca054db031db4419f18ee99141b16b",
"score": "0.56828505",
"text": "def largest_contiguous_subsum2(list)\n result = list.first\n sum = list.first\n\n list.each_with_index do |n, i|\n next if i == 0\n\n sum = 0 if sum < 0\n\n sum += n\n\n result = sum if sum > result\n end\n\n result\nend",
"title": ""
}
] |
cfdff4a0cbd69f1f469b01ad4f14dd97
|
Resolve Message object from provided args and path This is used internally by contracts when rules are applied If message argument is a Hash, then it MUST have a :text key, which value will be used as the message value
|
[
{
"docid": "e0366afae1a4d9820cb267c2f2c61eca",
"score": "0.58655876",
"text": "def call(message:, tokens:, path:, meta: EMPTY_HASH)\n case message\n when Symbol\n Message[->(**opts) { message(message, path: path, tokens: tokens, **opts) }, path, meta]\n when String\n Message[->(**opts) { [message_text(message, path: path, **opts), meta] }, path, meta]\n when Hash\n meta = message.dup\n text = meta.delete(:text) { |key|\n raise ArgumentError, <<~STR\n +message+ Hash must contain :#{key} key (#{message.inspect} given)\n STR\n }\n\n call(message: text, tokens: tokens, path: path, meta: meta)\n else\n raise ArgumentError, <<~STR\n +message+ must be either a Symbol, String or Hash (#{message.inspect} given)\n STR\n end\n end",
"title": ""
}
] |
[
{
"docid": "f4c64ef8dbee89c73b8234a8efa0aa6b",
"score": "0.59963244",
"text": "def message(*args)\n Message.find_one(self, *args)\n end",
"title": ""
},
{
"docid": "e5aeea7a517f797aa41251c4ac9fe777",
"score": "0.5898873",
"text": "def parse_message(message)\n ROUTERS[message_type(message)].new(bot: bot).route(message)\n end",
"title": ""
},
{
"docid": "1665bb9a752e07eaec254cc5dc767bff",
"score": "0.5772355",
"text": "def message\n return {} unless params[:_message]\n begin\n Marshal.load(Merb::Parse.unescape(params[:_message]).unpack(\"m\").first)\n rescue ArgumentError, TypeError\n {}\n end\n end",
"title": ""
},
{
"docid": "f8945c912c00aaa516f2a92e3d4d1028",
"score": "0.57468253",
"text": "def decode_message(message)\n begin\n msg = MessagePack.unpack(message, options={symbolize_keys: true})\n rescue => ex\n raise InvalidMessageError, \"couldn't unpack message: #{ex}\"\n end\n begin\n klass = Utils::full_const_get msg[:type]\n o = klass.new *msg[:args]\n if o.respond_to? :id and msg[:id]\n o.id = msg[:id]\n end\n o\n rescue => ex\n raise InvalidMessageError, \"invalid message: #{ex}\"\n end\n end",
"title": ""
},
{
"docid": "098b867bb3e5d18d1fe51958cf750885",
"score": "0.56005687",
"text": "def message *args\n case args.size\n when 1\n if args.last.is_a? Hash\n opts = args.last\n name = opts[:name]\n else\n opts = {}\n name = args.last\n end\n when 2\n opts = args.last\n name = args.first\n else\n raise ArgumentError.new\n end\n message = name ? CreateMessageByName(name) : CreateMessageById(opts[:id])\n P2::Message.new opts.merge(:ole => message)\n end",
"title": ""
},
{
"docid": "19debb00718a990671d7226ff9503091",
"score": "0.5563637",
"text": "def dd_messagify(message)\n if message.is_a?(Hash)\n return DripDrop::Message.new(message[:name], :head => message[:head],\n :body => message[:body])\n elsif message.is_a?(DripDrop::Message)\n return message\n else\n return message\n end\n end",
"title": ""
},
{
"docid": "e25c1296741927ce7ae6e7a65d394172",
"score": "0.54874235",
"text": "def parse_message(message, target)\n fail ArgumentError, \"Message was not a Message\" unless message.is_a? Message\n fail ArgumentError, \"Message does not have a verb\" unless message.verb\n\n new_message = ->(h){ Message.new(message.to_h.merge h) }\n message.reply_to ? message : new_message.(replyTo: target.send_queue)\n end",
"title": ""
},
{
"docid": "e210535a570a207708e6709cf8906678",
"score": "0.53573763",
"text": "def parse_message(message)\n Parser.new.parse(message)\n end",
"title": ""
},
{
"docid": "dc9a6200bd30f06998aacddfdd4ea612",
"score": "0.52900946",
"text": "def get_instance_with_attributes(path)\n if path =~ /#/\n raise \"Does not work with messages in the path.\"\n end\n fake_message = \"callingWithAFakeMessage\"\n empty_instance = @evm.instantiate(\"#{path}##{fake_message}\")\n instance_name = empty_instance.name\n @evm.instance_get(instance_name)\n end",
"title": ""
},
{
"docid": "b5e811ebfcbcc72f9e6f89dd02f836ba",
"score": "0.5265833",
"text": "def extract_decode_args(*args)\n message_key, message_value = extract_key_and_value(*args)\n model_key = model_key_for_message(message_key, message_value)\n raise UnexpectedKeyError.new(*model_key) unless model_map.key?(model_key)\n\n [model_map[model_key], message_key, message_value]\n end",
"title": ""
},
{
"docid": "8247b5772f5c0335409fd09727bad890",
"score": "0.52572036",
"text": "def dd_messagify(message,klass=DripDrop::Message)\n if message.is_a?(Hash)\n return klass.from_hash(message)\n elsif message.is_a?(DripDrop::Message)\n return message\n else\n return message\n end\n end",
"title": ""
},
{
"docid": "1443467c9750381c1e332445aaaf5d3a",
"score": "0.52198994",
"text": "def parse(raw_message)\n _params = {:raw_message => raw_message}\n return @master.call 'messages/parse', _params\n end",
"title": ""
},
{
"docid": "b093b377301829ccee372f8128935e33",
"score": "0.52144945",
"text": "def method_missing(name, *args)\n if args.length > 0\n Message.new(name, args)\n else\n name\n end\n end",
"title": ""
},
{
"docid": "b093b377301829ccee372f8128935e33",
"score": "0.52144945",
"text": "def method_missing(name, *args)\n if args.length > 0\n Message.new(name, args)\n else\n name\n end\n end",
"title": ""
},
{
"docid": "1a6fc67ab0c18a2c62bd762511d093ed",
"score": "0.5178496",
"text": "def parse(msg)\n msg\n end",
"title": ""
},
{
"docid": "48843b1d9e6fa4c766c35b1b47ff95c8",
"score": "0.51778674",
"text": "def resolve(path, *args)\n\t\t\tif path.is_a?(Proc)\n\t\t\t\treturn path.call(*args)\n\t\t\telsif path.is_a?(String) || path.is_a?(Symbol)\n\t\t\t\tcallee = @template\n\t\t\t\tpath.to_s.split(\".\").slice(0..-2).each { |path_path| callee = callee.send(path_path.to_sym) }\n\t\t\t\tpath_method = path.to_s.split(\".\").slice(-1).to_sym\n\t\t\t\treturn callee.send(path_method, *args)\n\t\t\telse\n\t\t\t\treturn path\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "8733ca2bfdb8ff1cfc2af57d9f3e172d",
"score": "0.51732713",
"text": "def parse_message(msg)\n hash = json_to_message(msg)\n if (retval = check_message_attr(hash)) < 0\n error(\"attribute error with errno #{retval}\")\n end\n return hash\n end",
"title": ""
},
{
"docid": "9a5f9ef7af6f9747e955af30fb96ecec",
"score": "0.51655847",
"text": "def call\n #sending default message until message handling is added\n begin\n @message.payload.constantize.new(@message).call\n rescue\n MessageReadError.new().call\n end\n\n end",
"title": ""
},
{
"docid": "6ecab22e923c276a05d4471fa502a057",
"score": "0.5145168",
"text": "def dispatch(message)\n return unless recognize?(message)\n @params = {}\n\n if @options[:pattern] && @options[:tokens]\n matches = message.text.match(@options[:pattern])\n @options[:tokens].each_with_index { |token, i| @params[token] = matches[i+1] }\n @params[:text] = (matches[@options[:tokens].length+1] || \"\").strip\n elsif @options[:pattern] && !@options[:tokens]\n @params = message.text.match(@options[:pattern]).to_a[1..-1] || []\n else\n @params[:text] = message.text\n end\n\n handle(message, @params)\n end",
"title": ""
},
{
"docid": "2965f9bd8685e0e358c2127ee9f3edd4",
"score": "0.5120143",
"text": "def real_message\n return @message unless @message.match(/ /).nil?\n path = File.join(Mail::folder_messages, @message)\n return @message unless File.exists? path\n \n case File.extname(@message)\n when '.rb' then load path # => message\n else message = File.read path\n end\n\n return message if data.nil?\n data.each { |k, v| message.gsub!(/\\%\\{#{k}\\}/, v) }\n return message\n end",
"title": ""
},
{
"docid": "a492616d7834ef1ccfd76d3800f4b419",
"score": "0.50988346",
"text": "def message_params\n params.fetch(:message, {})\n end",
"title": ""
},
{
"docid": "a492616d7834ef1ccfd76d3800f4b419",
"score": "0.50988346",
"text": "def message_params\n params.fetch(:message, {})\n end",
"title": ""
},
{
"docid": "36faa69ea5942c16498dda27740d4952",
"score": "0.50978523",
"text": "def decode(message, channel_options)\n raise \"Not yet implemented\"\n end",
"title": ""
},
{
"docid": "a477ccbb61d368d7ffba8bddcba3b128",
"score": "0.50891685",
"text": "def parse(raw_message)\n _params = {:raw_message => raw_message}\n return @master.call 'messages/parse', _params\n end",
"title": ""
},
{
"docid": "e681abcedbdfe596c5e3b9e3bd2b8048",
"score": "0.5081148",
"text": "def decode_message(str)\n @delegate.load(str)\n end",
"title": ""
},
{
"docid": "74ad9da9d3ddf2c3a4391cacd139bdc5",
"score": "0.5071264",
"text": "def receive(message)\n log_debug { \"Received message: \" + JSON.generate(message.to_compact_hash) }\n\n case message\n when Telegram::Bot::Types::Message\n if command? message\n handle_command Command.new(\n name: /^\\/(\\w+)/.match(message.text)[1],\n arg: /^\\/\\w+(?:@\\w+)? ?(.*)$/.match(message.text)[1],\n message: message\n )\n end\n when Telegram::Bot::Types::InlineQuery\n handle_inline_query message\n end\n end",
"title": ""
},
{
"docid": "35f6f2f71343b2a3a81434118cdee622",
"score": "0.5061459",
"text": "def load_message\n\t\tpath = self.message_path\n\t\traise \"Unable to determine message path: %p\" % [ path ] unless path.exist?\n\t\treturn Mail.read( path.to_s )\n\tend",
"title": ""
},
{
"docid": "c344adda4837396cbed9d6123d733ad4",
"score": "0.50464046",
"text": "def decode_message(message)\n if message[0..1].unpack(\"CC\") == [Marshal::MAJOR_VERSION, Marshal::MINOR_VERSION]\n begin\n Marshal.load message\n rescue => ex\n raise InvalidMessageError, \"invalid message: #{ex}\"\n end\n else raise InvalidMessageError, \"couldn't determine message format: #{message}\"\n end\n end",
"title": ""
},
{
"docid": "f04640d3bbf07e7c774f188ac05309fe",
"score": "0.504571",
"text": "def parse_message(room, message)\n send(:on_message, room, message) if respond_to? :on_message\n pattern = self.class.match message.body\n handle_match(room, message, pattern) if pattern\n rescue => e\n @log.error \"Error while parsing message in #{self.class}: #{e.inspect}\"\n end",
"title": ""
},
{
"docid": "7d685d519979abe879389b202c7eb947",
"score": "0.50253636",
"text": "def ask(message)\n @current_message = message\n selected = self.class.response_patterns.select{|patt| message.message[patt[0]]}\n if selected.size > 0\n selected = selected.first\n if selected[0].is_a? Regexp\n # vars =\n # raise \"#{vars}\"\n instance_exec(*message.message.scan(selected[0]).flatten, &selected[1])\n elsif selected[0].is_a? String\n instance_exec &selected[1]\n else\n raise \"unknown pattern match type\"\n end\n else\n message\n end\n end",
"title": ""
},
{
"docid": "3c1a51e7ac7196640a71ba07409289fa",
"score": "0.5008464",
"text": "def match(*args)\n # Localize simple match only if there is no resource scope.\n if @locales and (args.size >= 1) and !parent_resource and\n args.last.is_a?(Hash) # In both variants Hash should be present as last parameter\n\n # Make deep copy of last argument (Hash)\n options = Marshal.load(Marshal.dump(args.last)) # Dump is dirty but how to make deep cloning easily ? :/\n\n # Now handle parameters\n if (args.first.is_a?(Hash))\n path, to = options.find { |name, value| name.is_a?(String) }\n options.merge!(:to => to).delete(path)\n else\n path = args[0]\n options[:as] ||= path\n end\n\n if (options[:as])\n @locales.each do |locale|\n mapping = LocalizedMapping.new(locale, @set, @scope, path, options)\n if mapping.localizable?\n puts(\"[I18n] > localize %-10s: %40s (%s) => %s\" % ['route', options[:as], locale, mapping.path]) if @i18n_verbose\n @set.add_route(*mapping.to_route)\n end\n end\n\n # Now, create the real match :\n return set_localizable_route(options[:as]) do\n super\n end\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "3c9d61d71d5da1092b817fc72f3ffd08",
"score": "0.5003116",
"text": "def complex_command(command)\n if (!command.nil?)\n if (@from_analyzer)\n if command.key?(:FromServer)\n cmd=command[:FromServer]\n else\n raise ProtocolError.new(\"Server Command not supported.#{command.inspect()}\")\n end\n else\n if command.key?(:FromClient)\n cmd=command[:FromClient]\n else\n @logger.error(command.inspect())\n raise ProtocolError.new(\"Client Command not supported.#{command.inspect()}\")\n end\n end\n else\n raise ProtocolError.new(\"I don't recognize command #{command.inspect()} for Msg Type #{msg_label()}\")\n end\n if (cmd.key?(:ParseMsg) )\n return cmd[:ParseMsg].call(self)\n elsif (cmd.key?(:Format) && cmd.key?(:Keys))\n return unpack(cmd)\n else\n raise ProtocolError.new(\"No Way to parse Msg Type #{msg_label()}\")\n end\n end",
"title": ""
},
{
"docid": "8212b78da32fcce4c3b0fcb582fafecf",
"score": "0.49918875",
"text": "def route_and_perform(message)\n type, channel, command = extract_channel_info(message)\n # find matching route unless it is a Faye meta message\n matched = match_route type, channel, command\n\n if matched\n # if there is a matching route then perform the designated action\n processor = instantiate_processor matched.processor, message\n processor.perform_action matched.action\n elsif type != :meta\n # if there is no matching route AND this is not a /meta message, then return an invalid channel error\n message['error'] = bayeux_error :channel_unknown, 'No route found for channel and command', 'simple_faye', type, \"#{channel}#{command ? \"@#{command}\" : ''}\"\n end\n end",
"title": ""
},
{
"docid": "eafa6f37f607bce0da81f719431182e1",
"score": "0.49887782",
"text": "def handle_message(message)\n case message\n when Hash\n #message_handler.handle_message(message)\n message_handler.queue << message\n when String\n message_hash = JSON.parse(message)\n #message_handler.handle_message(message_hash)\n message_handler.queue << message\n else\n puts \"Can't handle messages of class #{message.class}\"\n end\n rescue\n raise \"Runtime error while attempting to parse message: #{message}.\"\n end",
"title": ""
},
{
"docid": "b8e10c65e26fc39ab1172e1555b844ae",
"score": "0.4977184",
"text": "def message_object\n @message\n end",
"title": ""
},
{
"docid": "be8e3787f31a29290080e9b4d48f6437",
"score": "0.49698982",
"text": "def decode_message(payload)\n decoded_payload = payload.nil? ? nil : self.class.decoder.decode(payload)\n return decoded_payload unless Utils::SchemaClass.use?(self.class.config.to_h)\n\n Utils::SchemaClass.instance(decoded_payload,\n self.class.config[:schema],\n self.class.config[:namespace])\n end",
"title": ""
},
{
"docid": "41e2352f20fe4127b635251dfed7f43f",
"score": "0.49676025",
"text": "def resolve(object, args, query_ctx)\n # Unwrap the GraphQL object to get the application object.\n application_object = object.object\n method_receiver = nil\n method_to_call = nil\n method_args = nil\n\n Schema::Validator.validate!(validators, application_object, query_ctx, args)\n\n query_ctx.query.after_lazy(self.authorized?(application_object, args, query_ctx)) do |is_authorized|\n if is_authorized\n with_extensions(object, args, query_ctx) do |obj, ruby_kwargs|\n method_args = ruby_kwargs\n if @resolver_class\n if obj.is_a?(GraphQL::Schema::Object)\n obj = obj.object\n end\n obj = @resolver_class.new(object: obj, context: query_ctx, field: self)\n end\n\n inner_object = obj.object\n\n if !NOT_CONFIGURED.equal?(@hash_key)\n hash_value = if inner_object.is_a?(Hash)\n inner_object.key?(@hash_key) ? inner_object[@hash_key] : inner_object[@hash_key_str]\n elsif inner_object.respond_to?(:[])\n inner_object[@hash_key]\n else\n nil\n end\n if hash_value == false\n hash_value\n else\n hash_value || (@fallback_value != NOT_CONFIGURED ? @fallback_value : nil)\n end\n elsif obj.respond_to?(resolver_method)\n method_to_call = resolver_method\n method_receiver = obj\n # Call the method with kwargs, if there are any\n if ruby_kwargs.any?\n obj.public_send(resolver_method, **ruby_kwargs)\n else\n obj.public_send(resolver_method)\n end\n elsif inner_object.is_a?(Hash)\n if @dig_keys\n inner_object.dig(*@dig_keys)\n elsif inner_object.key?(@method_sym)\n inner_object[@method_sym]\n elsif inner_object.key?(@method_str)\n inner_object[@method_str]\n elsif @fallback_value != NOT_CONFIGURED\n @fallback_value\n else\n nil\n end\n elsif inner_object.respond_to?(@method_sym)\n method_to_call = @method_sym\n method_receiver = obj.object\n if ruby_kwargs.any?\n inner_object.public_send(@method_sym, **ruby_kwargs)\n else\n inner_object.public_send(@method_sym)\n end\n elsif @fallback_value != NOT_CONFIGURED\n @fallback_value\n else\n raise <<-ERR\n Failed to implement #{@owner.graphql_name}.#{@name}, tried:\n\n - `#{obj.class}##{resolver_method}`, which did not exist\n - `#{inner_object.class}##{@method_sym}`, which did not exist\n - Looking up hash key `#{@method_sym.inspect}` or `#{@method_str.inspect}` on `#{inner_object}`, but it wasn't a Hash\n\n To implement this field, define one of the methods above (and check for typos), or supply a `fallback_value`.\n ERR\n end\n end\n else\n raise GraphQL::UnauthorizedFieldError.new(object: application_object, type: object.class, context: query_ctx, field: self)\n end\n end\n rescue GraphQL::UnauthorizedFieldError => err\n err.field ||= self\n begin\n query_ctx.schema.unauthorized_field(err)\n rescue GraphQL::ExecutionError => err\n err\n end\n rescue GraphQL::UnauthorizedError => err\n begin\n query_ctx.schema.unauthorized_object(err)\n rescue GraphQL::ExecutionError => err\n err\n end\n rescue ArgumentError\n if method_receiver && method_to_call\n assert_satisfactory_implementation(method_receiver, method_to_call, method_args)\n end\n # if the line above doesn't raise, re-raise\n raise\n rescue GraphQL::ExecutionError => err\n err\n end",
"title": ""
},
{
"docid": "16fbe2f1531a68a786183a9b380c7925",
"score": "0.4960962",
"text": "def decode(encoded_message)\n # \n type, id, endpoint, data = encoded_message.split(':', 4)\n type = type.to_i\n # \n (SUBCLASSES[type] or UnknownMessage).new(data, endpoint, id, type)\n end",
"title": ""
},
{
"docid": "feab303b1dc3d09f562a5695a873467b",
"score": "0.49592718",
"text": "def convert_message(message)\n raise \"Must override!\"\n end",
"title": ""
},
{
"docid": "44308e994f8fcea306cb7ebaedf68255",
"score": "0.49499276",
"text": "def parse_message(message, team_name)\n case\n when is_scoreboard?(message) then scoreboard\n when is_cipher?(message) then publish(message, team_name)\n when is_listing?(message) then listing\n when is_attempt?(message) then solve(message, team_name)\n else wrong_submission\n end\n end",
"title": ""
},
{
"docid": "363fe8712940736d96a9106bca98832a",
"score": "0.49436492",
"text": "def parse(message)\n message.to_s\n end",
"title": ""
},
{
"docid": "62010170b2d368236cd897796d719dc7",
"score": "0.49360314",
"text": "def execute(message)\n failure_wrap(message) do |payload|\n if(payload.get(:data, :router, :restore))\n payload = restore_payload(payload)\n end\n if(payload.get(:error))\n message.confirm!\n payload.set(:frozen, true)\n process_error(message, payload)\n error \"Message failed processing (#{message}) - #{payload.get(:error)}\"\n else\n if(!payload.get(:data, :account) && (config[:allow_user_routes] || config[:allow_user_destinations]))\n if(payload.get(:data, :router, :validate_requested))\n abort \"Failed to validate message. Forcing message discard (#{message})\"\n end\n payload.set(:data, :router, :validate_requested, true)\n store_payload(payload)\n transmit(:validator, payload)\n message.confirm!\n else\n set_route(payload)\n route_payload(message, payload)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e9d68c396aa93976cdf34f4ddcf33273",
"score": "0.49324387",
"text": "def message\n search_criteria = {}\n\n unless company_name.nil?\n search_criteria[\"#{Creditsafe::Namespace::DAT}:Name\"] = {\n \"@MatchType\" => match_type,\n :content! => company_name,\n }\n end\n\n unless registration_number.nil?\n search_criteria[\"#{Creditsafe::Namespace::DAT}:RegistrationNumber\"] =\n registration_number\n end\n\n search_criteria[\"#{Creditsafe::Namespace::DAT}:Address\"] = {} if province || city || postal_code || street\n\n unless street.nil?\n search_criteria[\"#{Creditsafe::Namespace::DAT}:Address\"].merge!({\n \"#{Creditsafe::Namespace::DAT}:Street\" => street,\n })\n end\n\n unless city.nil?\n search_criteria[\"#{Creditsafe::Namespace::DAT}:Address\"].merge!({\n \"#{Creditsafe::Namespace::DAT}:City\" => city,\n })\n end\n\n unless postal_code.nil?\n search_criteria[\"#{Creditsafe::Namespace::DAT}:Address\"].merge!({\n \"#{Creditsafe::Namespace::DAT}:PostalCode\" => postal_code,\n })\n end\n\n unless province.nil?\n search_criteria[\"#{Creditsafe::Namespace::DAT}:Address\"].merge!({\n \"#{Creditsafe::Namespace::DAT}:Province\" => province,\n })\n end\n\n\n\n build_message(search_criteria)\n end",
"title": ""
},
{
"docid": "9706c7be20cfe6f99fe4f380ae45b135",
"score": "0.49183452",
"text": "def dispatch message, config, *args\n unless message.is_a? Emissary::Message\n raise ArgumentError, \"message is not an Emissary::Message\" \n end\n \n begin\n agent_type = 'Emissary::Agent::' + message.agent.to_s.capitalize\n begin\n require_klass agent_type \n rescue LoadError => e\n begin\n require_klass Emissary::EXTERNAL_AGENTS + '::' + message.agent.to_s.capitalize\n rescue LoadError\n # raise the original exception if we still haven't found the file\n raise e\n end\n end\n rescue Exception => e\n Emissary.logger.error \"Dispatcher Error: #{e.class.name}: #{e.message}\\n\\t#{e.backtrace.join(\"\\n\\t\")}\"\n message = message.error(e)\n agent_type = 'Emissary::Agent::Error'\n end\n \n handler = klass_const agent_type, true\n \n klass = klass_from_handler(Agent, handler, message, config, *args)\n \n Emissary.logger.debug \" [--] Dispatching message to: #{agent_type}\"\n agent = klass.new(message, config, *args)\n block_given? and yield agent\n agent\n end",
"title": ""
},
{
"docid": "eefeff923592d9167909f36fd3cf5c30",
"score": "0.49163586",
"text": "def resolve!(path, **kargs); end",
"title": ""
},
{
"docid": "2a11df07a37f063dcc636f0e39321100",
"score": "0.49139607",
"text": "def route(message)\n init_vars(message)\n raise validation_service.errors.first if validation_service.failure?\n\n actual_command = command.split('/').last\n\n HANDLERS[actual_command].new(bot: bot, chat_id: chat_id, user: user || tg_user).handle\n end",
"title": ""
},
{
"docid": "e2c9da5d5662fb982a1cde749cf7fc00",
"score": "0.49038944",
"text": "def parse_message; end",
"title": ""
},
{
"docid": "e2c9da5d5662fb982a1cde749cf7fc00",
"score": "0.49038944",
"text": "def parse_message; end",
"title": ""
},
{
"docid": "ce2631ed862fb9cb9e1fcbc2ea536fb1",
"score": "0.49036688",
"text": "def route(message)\n @message = message\n init_vars\n\n raise validation_service.errors.first if validation_service.failure?\n\n call_handler_with(command)\n end",
"title": ""
},
{
"docid": "f3cb6990a88b847cd6be4c0e73fcf665",
"score": "0.49032366",
"text": "def resolve(path, **kargs); end",
"title": ""
},
{
"docid": "1119496f4983c7013e511477497fa81a",
"score": "0.48958698",
"text": "def initialize(options)\n self.message = options[:message_hash] if options[:message_hash]\n self.message = options[:message].as_json if options[:message]\n end",
"title": ""
},
{
"docid": "e376553ba790b3a2377ac4a7fe54023e",
"score": "0.48939273",
"text": "def msg_obj()\n source=:FromClient\n if (from_analyzer)\n source= :FromServer\n end\n if @msg_object.nil? || @msg_object.empty?() #else we just return the msg_object\n if !@@msg_types[@msg_type].key?(:ParseMsg) || @@msg_types[@msg_type][:ParseMsg].nil?\n if (@@msg_types[@msg_type].key?(:Format) && @@msg_types[@msg_type].key?(:Keys) )\n @msg_object=unpack(@@msg_types[@msg_type])\n if @msg_object.nil?\n raise ProtocolError.new(\"Unable to build message object\")\n end\n else\n raise ProtocolError.new(\"No Parsing Function or Format defined for #{@msg_type} \")\n end\n else\n parseMsg=@@msg_types[@msg_type][:ParseMsg]\n parseMsg.call(self)\n end\n end\n return @msg_object\n end",
"title": ""
},
{
"docid": "1a73d3b7af7a6c05dea7094781ad85e9",
"score": "0.48899186",
"text": "def load(params)\n # rubocop:enable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity, Metrics/AbcSize\n path = params['path']\n data = params['data']\n ret = { path: path, room_id: data['room_id'] }\n case path\n when 'messages'\n messages = Message.where(room_id: data['room_id']).order('created_at')\n ret['messages'] = messages\n when 'delete_message'\n message = Message.find_by_id(data['message_id'])\n if message.user_id == current_user.id\n message.delete\n ret['message_id'] = message.id\n else\n ret['error'] = \"You can't delete others's message\"\n end\n when 'update_message'\n message = Message.find_by_id(data['message_id'])\n if message.user_id == current_user.id\n message.update(text: data['text'])\n ret['message'] = message\n else\n ret['error'] = \"You can't edit others's message\"\n end\n when 'add_message', 'join_room'\n text = data['text']\n case text\n when %r{^/vote}\n _, title, *choices = text.split(' ')\n message = Message.new(data.merge(user_id: current_user.id, data: {\n email: current_user.email,\n type: 'vote',\n title: title,\n choices: choices.map { |c| [c, []] }\n }))\n else\n message = Message.new(data.merge(user_id: current_user.id, data: { email: current_user.email }))\n end\n ret['message'] = message if message.save\n when 'vote'\n message = Message.find(data['message_id'])\n index = data['index']\n message.data['choices'].each_with_index do |(_, voted_users), i|\n user_id = current_user.id\n included = voted_users.include?(user_id)\n is_index = index == i\n voted_users.delete(user_id) if included && !is_index\n voted_users.push(user_id) if !included && is_index\n end\n return unless message.changed?\n\n message.save\n ret[:message] = message\n ret[:path] = 'update_message'\n end\n RoomsChannel.broadcast_to room, ret\n end",
"title": ""
},
{
"docid": "5a70686bbcb9760bf5749cb5a1042afd",
"score": "0.48891214",
"text": "def handle_message(message, obj)\n response = message.create_inform_reply_message(nil, {}, src: resource_address)\n response.replyto replyto_address(obj, message.replyto)\n\n case message.operation\n when :create\n handle_create_message(message, obj, response)\n when :request\n response = handle_request_message(message, obj, response)\n when :configure\n handle_configure_message(message, obj, response)\n when :release\n handle_release_message(message, obj, response)\n when :inform\n nil # We really don't care about inform messages which created from here\n else\n raise StandardError, <<-ERROR\n Invalid message received (Unknown OMF operation #{message.operation}): #{message}.\n Please check protocol schema of version #{OmfCommon::PROTOCOL_VERSION}.\n ERROR\n end\n response\n end",
"title": ""
},
{
"docid": "59634a6ed063b7ae9016dcb2d2932069",
"score": "0.4885866",
"text": "def maybe_inflate\n message = Registry.get(@original_op_code).allocate\n buf = decompress(@compressed_message)\n\n message.send(:fields).each do |field|\n if field[:multi]\n Message.deserialize_array(message, buf, field)\n else\n Message.deserialize_field(message, buf, field)\n end\n end\n if message.is_a?(Msg)\n message.fix_after_deserialization\n end\n message\n end",
"title": ""
},
{
"docid": "7ee28f3c1b4b89885379cba5a3740f8c",
"score": "0.488208",
"text": "def handle_message m\n @logger.info \"Get a messsage #{m.message_id}, received at #{Time.now}\"\n @logger.info \"Object body: #{m.body}\"\n json = JSON.parse(m.body)\n action = json['message'].downcase\n if json['timestamp']\n @logger.info \"Message was sent at #{json['timestamp']}\"\n end\n if action == 'unfreeze'\n @logger.info \"Launching a command\"\n system(Settings.exec_command)\n @logger.info \"Command execution code: #{$?}\"\n end\n rescue StandardError => e\n log_exception \"Non-fatal error parsing a message\", e\n end",
"title": ""
},
{
"docid": "4c0de572c26e5163b4825428b20b8e3c",
"score": "0.4877191",
"text": "def initialize(theMessage, *theArgs)\n\t\t@message = validated_message(theMessage)\n\t\t@args = theArgs\n\tend",
"title": ""
},
{
"docid": "7f311448393e596625c0aa4f860cb20c",
"score": "0.4865729",
"text": "def unwrap_non_raw_message_format hash\n hash = ActiveSupport::JSON.decode(hash['Message']) if hash.key?('Message')\n hash\n end",
"title": ""
},
{
"docid": "5709f4ea9c9c1cbb751ff24bd21a09ff",
"score": "0.48650002",
"text": "def request(rpc_method, request_args)\n return request_args unless request_args.is_a?(Hash)\n\n message_class = request_type(rpc_method)\n fields = fields_from_attributes(message_class, request_args)\n message_class.new(fields)\n end",
"title": ""
},
{
"docid": "56a3d0f7a1b1143bbd6ee8899dd4a995",
"score": "0.4864234",
"text": "def decodemsg(msg)\n Log.error(\"decodemsg is not implemented in #{self.class}\")\n end",
"title": ""
},
{
"docid": "9155999bea439490fc803aca4b668aa7",
"score": "0.48632872",
"text": "def _process_command(header, msg)\n return ActiveSupport::JSON.decode(msg)\n end",
"title": ""
},
{
"docid": "9155999bea439490fc803aca4b668aa7",
"score": "0.48632872",
"text": "def _process_command(header, msg)\n return ActiveSupport::JSON.decode(msg)\n end",
"title": ""
},
{
"docid": "7c4b114c155782c6ab68c2c6e876c0f1",
"score": "0.48572966",
"text": "def dispatch(message)\n return unless recognize?(message)\n params = {}\n\n if @pattern && @tokens\n matches = message.text.match(@pattern)\n @tokens.each_with_index {|token, i| params[token] = matches[i+1] }\n params[:text] = (matches[@tokens.length+1] || '').strip\n elsif @pattern && !@tokens\n params = message.text.match(@pattern).to_a[1..-1] || []\n else\n params[:text] = message.text\n end\n\n handle(message, params)\n end",
"title": ""
},
{
"docid": "831324577c9ea43eb4d744a2faa147e5",
"score": "0.48413938",
"text": "def raw_msg=(arg)\n tmp = iso_msg_factory\n tmp.unpack arg\n \n self.iso_msg = tmp\n \n arg\n end",
"title": ""
},
{
"docid": "38e381c832c4b550050fe62b8d53501e",
"score": "0.48266667",
"text": "def format_message(m)\n Smash.new(:path => path, :content => m)\n end",
"title": ""
},
{
"docid": "fdbe4118cfcba70376a42a3461afab2f",
"score": "0.4824658",
"text": "def resolve(object, args, query_ctx); end",
"title": ""
},
{
"docid": "34468771bcbd7ae39a298e9229c60fb4",
"score": "0.48241684",
"text": "def message_structure(arg = nil)\n set_or_return(:message_structure, arg, kind_of: String)\n end",
"title": ""
},
{
"docid": "9136b80c12f7115f3df74d46de9863e2",
"score": "0.48214632",
"text": "def resolve(locale, object, subject, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "168ab7172ed8bf1111101d560954c5b5",
"score": "0.47955167",
"text": "def decode_message (message)\n\n o = Base64.decode64(message)\n o = YAML.load(o)\n o = OpenWFE::workitem_from_h(o)\n o\n end",
"title": ""
},
{
"docid": "14ff67c4e21e504a0dc71c468ee718be",
"score": "0.47932634",
"text": "def on_message(message)\n hash = ActiveSupport::JSON.decode(message).symbolize_keys \n logger.debug \"#{self.class}: received #{hash}\" \n raise \"Parameter 'subject_class' is required\" if hash[:subject_class].blank?\n raise \"Parameter 'subject_id' is required\" if hash[:subject_id].blank?\n raise \"Parameter 'associated_class' is required\" if hash[:associated_class].blank?\n\n subject_class = hash[:subject_class]\n subject_id = hash[:subject_id]\n associated_class = hash[:associated_class]\n @workflow_type = AutomationMessage::WORKFLOW_TYPES_HASH.fetch(self.class.name.demodulize)\n\n begin \n purge_cache(subject_class.classify.constantize.find(subject_id), associated_class)\n rescue ActiveRecord::RecordNotFound\n end \n end",
"title": ""
},
{
"docid": "d12d69db09d80a28dedac7abba2cd496",
"score": "0.47861624",
"text": "def find_message\n @message = @conversation.messages.find params[:id]\n end",
"title": ""
},
{
"docid": "a3b6157aafe1e0de8689d450a7c2fa79",
"score": "0.4781954",
"text": "def message_params\n params[:message]\n end",
"title": ""
},
{
"docid": "9f6222392a70d16e4ead55ef228cd4f3",
"score": "0.47800505",
"text": "def parse(args = {})\n if args.is_a?(String)\n return from_json args\n\n elsif args.key?(:gemspec)\n return from_gemspec args[:gemspec]\n\n elsif args.key?(:gem)\n return from_gem args[:gem]\n\n end\n\n new\n end",
"title": ""
},
{
"docid": "09cddfb667a40ec2f88a38e04fc723e2",
"score": "0.4774705",
"text": "def receive(message)\n opts = interpolated(message)\n\n match_results = opts['rules'].map do |rule|\n value_at_path = Utils.value_at(message['payload'], rule['path'])\n rule_values = rule['value']\n rule_values = [rule_values] unless rule_values.is_a?(Array)\n\n if rule['type'] == 'not in'\n !rule_values.include?(value_at_path.to_s)\n elsif rule['type'] == 'field==value'\n rule_values.include?(value_at_path.to_s)\n else\n rule_values.any? do |rule_value|\n case rule['type']\n when 'regex'\n value_at_path.to_s =~ Regexp.new(rule_value, Regexp::IGNORECASE)\n when '!regex'\n value_at_path.to_s !~ Regexp.new(rule_value, Regexp::IGNORECASE)\n when 'field>value'\n value_at_path.to_f > rule_value.to_f\n when 'field>=value'\n value_at_path.to_f >= rule_value.to_f\n when 'field<value'\n value_at_path.to_f < rule_value.to_f\n when 'field<=value'\n value_at_path.to_f <= rule_value.to_f\n when 'field!=value'\n value_at_path.to_s != rule_value.to_s\n else\n raise \"Invalid type of #{rule['type']} in TriggerAgent##{id}\"\n end\n end\n end\n end\n\n return unless matches?(match_results)\n if keep_message?\n payload = message.payload.dup\n payload['message'] = opts['message'] if opts['message'].present?\n else\n payload = { 'message' => opts['message'] }\n end\n\n create_message payload: payload\n end",
"title": ""
},
{
"docid": "d65b5be2ebb98ea1fc678a90898dc250",
"score": "0.47739428",
"text": "def decoded_message\n self.class.decoded([self]).first\n end",
"title": ""
},
{
"docid": "decb24641cc026a3358482566772aa1b",
"score": "0.47695047",
"text": "def format(msg)\n actor = Carnivore::Supervisor.supervisor[name]\n if(actor)\n if(msg.is_a?(Hash) && msg.keys.map(&:to_s).sort == ['content', 'raw'])\n Message.new(\n :message => msg[:raw],\n :content => msg[:content],\n :source => actor.current_actor\n )\n else\n Message.new(\n :message => msg,\n :source => actor.current_actor\n )\n end\n else\n abort \"Failed to locate self in registry (#{name})\"\n end\n end",
"title": ""
},
{
"docid": "7b4c5de8bb6c2fcca57d258490127c64",
"score": "0.4767543",
"text": "def reverse_translate(msg)\n match_res = nil\n matching_str = @translations.keys.find { |k| match_res = k.match(msg) }\n return nil unless matching_str\n pre, param_values, post = match_res\n \n max_untranslated_length = Math.max(pre.length, post.length)\n max_untranslated_length = param_values.values.inject(max_untranslated_length) do |accum, value|\n Math.max(accum, value.length)\n end\n\n translated_msg = pre + @translations[matching_str].substitute_values(param_values) + post\n\n [translated_msg, max_untranslated_length]\n end",
"title": ""
},
{
"docid": "31ddc1c809b9c009a82abd842a2432ad",
"score": "0.47587448",
"text": "def build_from_raw_ami_message_string(ami_message_string)\n parse_state = :looking_for_message_type\n message = nil\n\n ami_message_string.lines.map(&:chomp).each do |line|\n if (match_data = line.match(MESSAGE_LINE_REGEX))\n key_name = match_data.captures[0]\n value = match_data.captures[1]\n\n case parse_state\n when :looking_for_message_type\n class_name = ami_client_class_name_from_asterisk_message_type(value)\n\n message_class =\n begin\n AmiClient::Messages.const_get(class_name)\n rescue NameError\n nil\n end\n\n unless message_class\n warn(\n \"[\\033[0;33mWARNING\\033[0;0m] - \" \\\n \"'#{class_name}' is an unknown type. To fix this add this \" \\\n \"const within AmiClient::Messages.\"\n )\n return nil\n end\n\n message = message_class.new(parsed_from: ami_message_string)\n parse_state = :looking_for_key_values\n when :looking_for_key_values\n attribute_setter_method_name = \"#{asterisk_key_to_ami_client_key(key_name)}=\"\n message&.send(attribute_setter_method_name, value)\n end\n end\n end\n\n message\n end",
"title": ""
},
{
"docid": "c94d1e901a6c16602b3d8c3881ab1b7f",
"score": "0.47580972",
"text": "def handle_message(message); end",
"title": ""
},
{
"docid": "bae65025a6f787633ac85ee22d9d550c",
"score": "0.47558653",
"text": "def decode #:nodoc:\n amqp_headers = header.attributes\n @uuid = amqp_headers[:message_id]\n @timestamp = amqp_headers[:timestamp]\n headers = amqp_headers[:headers].symbolize_keys\n @format_version = headers[:format_version].to_i\n @flags = headers[:flags].to_i\n @expires_at = headers[:expires_at].to_i\n rescue Exception => @exception\n Beetle::reraise_expectation_errors!\n logger.error \"Could not decode message. #{self.inspect}\"\n end",
"title": ""
},
{
"docid": "aee74c9cdefeb42c6033eb8b5dbd18b6",
"score": "0.4754932",
"text": "def custom_message\n @message = Message.where(key: params[:key]).first #check for key value to decrypt message\n end",
"title": ""
},
{
"docid": "dbf83532331a567a341d7f8b72dea71b",
"score": "0.47543344",
"text": "def decode_object (message)\n\n o = Base64.decode64(message.message_body)\n o = YAML.load(o)\n o = OpenWFE::workitem_from_h(o)\n o\n end",
"title": ""
},
{
"docid": "56b76709f78ea1ec4441c6337c0ff529",
"score": "0.47513038",
"text": "def parse(message)\n\t\t# Be prepared for a fatal error in commands\n\t\tbegin\n\t\t\t# This gets the class of the command\n\t\t\t# TODO: Investigate parsing of command name make it better\n\t\t\tcommand = @commands[message.msg.split(\" \", 2).first.upcase]\n\t\t\t# Check the command exists\n\t\t\tunless command\n\t\t\t\t$stderr.puts \"Bad command\"\n\t\t\t\t$stderr.puts message.inspect\n\t\t\t\t# Error message would go here\n\t\t\t\treturn Message.new message.num, \n\t\t\t\t\t\"Your command was invalid. Here are the avaliable commands: \\n\"\\\n\t\t\t\t\t\"#{Command.commands.join \", \"}\"\n\t\t\tend\n\t\t\t# Actually make the command\n\t\t\treturn command.process message\n\t\trescue Exception => e\n\t\t\t# The command encountered a fatal error\n\t\t\t# Spam information to the terminal\n\t\t\t$stderr.puts e.message\n\t\t\t$stderr.puts e.backtrace\n\t\t\t# Tell the user about the failure\n\t\t\treturn Message.new message.num, \n\t\t\t\t\"Sorry, there was a fatal error while processing your command.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "07506da48f83c44d7054438d14836c86",
"score": "0.4746332",
"text": "def lookup_object_by(path)\n path = path.to_s\n resource_name, object_name = path.split(Smooth.config.object_path_separator)\n\n resource_object = resource(resource_name)\n\n case\n when object_name == 'query' || object_name == 'serializer'\n resource_object.fetch(object_name.to_sym, :default)\n when object_name.nil?\n resource_object\n else\n resource_object.fetch(:command, object_name)\n end\n end",
"title": ""
},
{
"docid": "3d4cf4e4cec5f61c395087a5538abc52",
"score": "0.47439775",
"text": "def transform(msg, extended: false)\n return if msg.nil?\n case msg\n when Api::Message\n recs = msg.api_records\n data = {}\n data[:items] = transform_multiple(recs) if recs.present?\n data[:diagnostic] = msg.field_hierarchy if extended\n when LookupService::Data\n data = msg\n else\n data = json_parse(msg)\n end\n if data.nil?\n Log.warn(\"#{self.class}.#{__method__}: #{msg.class}: unexpected\")\n elsif extended && (!data.is_a?(Hash) || !data[:diagnostic].is_a?(Hash))\n Log.warn(\"#{self.class}.#{__method__}: msg[:diagnostic] missing\")\n end\n LookupService::Data.wrap(data)\n end",
"title": ""
},
{
"docid": "1388163ceaf40a1b857fea76d83119ac",
"score": "0.47428253",
"text": "def __getobj__ #:nodoc:\n @obj ||= @text_message_class.send(:new, @text_message_method, *@args)\n end",
"title": ""
},
{
"docid": "95de5181055bdeda87444033c8aa378f",
"score": "0.47415924",
"text": "def unpack_message(format, message)\n pos = 1\n format.split(\"\").collect do |f|\n r = nil\n case f\n when \"B\"\n r = message[pos].ord\n pos += 1\n when \"W\"\n r = message.unpack(\"@#{pos}v\").first\n pos += 2\n when \"L\"\n r = message.unpack(\"@#{pos}V\").first\n pos += 4\n when \"Q\"\n r = message.unpack(\"@#{pos}Q<\").first\n pos += 8\n when \"S\"\n len = message.unpack(\"@#{pos}v\").first\n pos += 2\n r = message[pos .. pos + len - 1]\n pos += len\n when \"I\"\n r = message.unpack(\"@#{pos}CVQ\")\n pos += 13\n else\n raise \"Invalid format specifier #{f}\"\n end\n r\n end\n end",
"title": ""
},
{
"docid": "40bb380da1c6da68d9c2c01fce37d9a5",
"score": "0.47355357",
"text": "def decode(msg)\n ActiveSupport::JSON.decode(msg)\n end",
"title": ""
},
{
"docid": "5a09f984722dbce54fcfb4d41a290984",
"score": "0.4734073",
"text": "def decode_message(message_body)\n JSON.parse(Base64.decode64(message_body))\n end",
"title": ""
},
{
"docid": "f3872f4cdc0608534660c326e968cea4",
"score": "0.47329554",
"text": "def message(object)\n parameters = object.to_hash\n\n parameters.delete(:provider)\n parameters.delete(:ensure)\n parameters.delete(:loglevel)\n parameters.delete(:service_name)\n parameters = convert_underscores(parameters)\n\n parameters\n end",
"title": ""
},
{
"docid": "d10d6722dded89b63de5f923df1bdc5b",
"score": "0.473277",
"text": "def process_message(message)\n end",
"title": ""
},
{
"docid": "20afe53f3ff98405497df9dd5ffe52c9",
"score": "0.47320446",
"text": "def action_for_message\n cmd, args = Commands.command_from_text(payload['text'], bot_username)\n return unless cmd\n [[action_for_command(cmd), type: :command, command: cmd], args]\n end",
"title": ""
},
{
"docid": "a9c053ec308a5a20071f13d7ad92959c",
"score": "0.4731839",
"text": "def decodemsg(msg)\n body = Marshal.load(msg.payload)\n\n if validrequest?(body)\n body[:body] = Marshal.load(body[:body])\n return body\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "65dccf00ef2248daa04e8abfba4edf74",
"score": "0.47282192",
"text": "def parse(message, recipient)\n args = message.split(\" \")\n command = args.delete_at(0)\n # Check that command is one of Parser's available methods before instantiating\n if Parser.method_defined?(command) and not Object.method_defined?(command)\n Parser.new(recipient).send(command, args)\n end\nend",
"title": ""
},
{
"docid": "4738a4d8b5fb7ed038bcd3dd2fc8ba80",
"score": "0.4715669",
"text": "def parse_message(msg)\n type = msg[0,3]\n begin\n data = MultiJson.load(msg[4..-1])\n rescue\n data = MultiJson.load('{}')\n end\n\n @logger.debug(\"<< #{msg}\")\n\n begin\n self.send(\"got_#{type}\",data)\n rescue\n end\n end",
"title": ""
},
{
"docid": "1efac76b6c6ccfff6a5022dfafbb8c73",
"score": "0.47155228",
"text": "def message_text\n if body.is_a?(Hash) && body.key?('message')\n body['message']\n else\n response.reason_phrase\n end\n end",
"title": ""
},
{
"docid": "89b4f2c1cd1ad4bacc4038832005fdf7",
"score": "0.47112018",
"text": "def get_message\n msg=nil\n return nil unless self.message_data.present? #and self.message_data.class == Hash\n return self.message_data[:testimonial] if self.message_data[:testimonial].present?\n \n msg_data = self.message_data[:data]\n return unless msg_data.class == Hash\n if msg_data[:message].present?\n msg_data[:message]\n elsif msg_data[:content].present?\n msg_data[:content]\n elsif msg_data[:name].present?\n \"Program: #{msg_data[:name]}\"\n elsif msg_data[:url_title].present?\n \"msg_data[:url_title]: msg_data[:url]\"\n else\n # self.to_yaml \n end\n end",
"title": ""
},
{
"docid": "14a625773ab8fb38f851a1f042b6c07e",
"score": "0.47075775",
"text": "def initialize(text_message_controller, text_message_method, *args)\n if text_message_controller.kind_of?(TextMessage::Controller)\n @obj = text_message_controller\n @text_message_class = @obj.class\n else\n @text_message_class = text_message_controller.kind_of?(Class) ? text_message_controller : text_message_controller.constantize\n end\n @text_message_method = text_message_method\n @args = args\n end",
"title": ""
},
{
"docid": "aa868654f23b8b25d48faff2d9fa1ca9",
"score": "0.46973127",
"text": "def initialize(message)\n\t\t# Args go here\n\t\t@args = []\n\t\t# Outgoing messages go here\n\t\t@response = nil\n\t\t\n\t\t#Changed delimiter for this to : allowing different group names\n\t\t@delimiter = ':'\n\t\t\n\t\t# Remove the command name from the message\n\t\tmessage.msg.slice! 0..self.class.name.size\n\t\t# Parse the message\n\t\tprocess message\n\tend",
"title": ""
},
{
"docid": "00b0e6b2c6e53fc74ab7c6af6c9062e6",
"score": "0.46904528",
"text": "def message_data(args)\n (args[0].is_a?(Array) ? args.shift : args)\n end",
"title": ""
}
] |
19ef34bdf5c8d88304a94315bc31f6f1
|
Appends the specified unsigned int to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written. Returns a reference to this so multiple operations can be appended together.
|
[
{
"docid": "9caaa46ce1e0c536e54148f9da634165",
"score": "0.66485906",
"text": "def append_unsigned_int(i=nil)\n if i.class == Fixnum && !block_given?\n @j_del.java_method(:appendUnsignedInt, [Java::long.java_class]).call(i)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_unsigned_int(i)\"\n end",
"title": ""
}
] |
[
{
"docid": "4823fb792b0bfaf54b9ced8d67148010",
"score": "0.61895484",
"text": "def append_int(i=nil)\n if i.class == Fixnum && !block_given?\n @j_del.java_method(:appendInt, [Java::int.java_class]).call(i)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_int(i)\"\n end",
"title": ""
},
{
"docid": "1393678594123f1d8eda5e961ac76e63",
"score": "0.58341956",
"text": "def <<(item)\n @buffer << item\n trim_buffer\n self\n end",
"title": ""
},
{
"docid": "6548dbb13fb6c2acc5f04d62be81aab0",
"score": "0.56860334",
"text": "def add(data)\n case data\n when Buffer\n @data.concat(data.data)\n else\n data = data.to_s.dup\n return if data.empty?\n\n @data << data\n end\n @size += data.size\n self\n end",
"title": ""
},
{
"docid": "90725eec23ea343d9d78564c3e6258ec",
"score": "0.5634586",
"text": "def append_unsigned_byte(b=nil)\n if b.class == Fixnum && !block_given?\n @j_del.java_method(:appendUnsignedByte, [Java::short.java_class]).call(::Vertx::Util::Utils.to_short(b))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_unsigned_byte(b)\"\n end",
"title": ""
},
{
"docid": "c87624a367bb608f54e572e956b892de",
"score": "0.54412436",
"text": "def append_0 v\n baos = java.io.ByteArrayOutputStream.new\n baos.write v, 0, v.length\n baos.write 0\n baos.toByteArray\n end",
"title": ""
},
{
"docid": "9e0bb5b646a6ab6b16172f6ede5cef91",
"score": "0.54285914",
"text": "def append!(buffer)\n @str << buffer.to_s\n self\n end",
"title": ""
},
{
"docid": "9e0bb5b646a6ab6b16172f6ede5cef91",
"score": "0.54285914",
"text": "def append!(buffer)\n @str << buffer.to_s\n self\n end",
"title": ""
},
{
"docid": "216d9e694ad21d7a8271fe8f5597db21",
"score": "0.5421018",
"text": "def concat(data)\n @output_buffer << data\n end",
"title": ""
},
{
"docid": "3adf4e49ff7d8e72c45877bfcf605139",
"score": "0.53868204",
"text": "def write(val)\n if val != nil\n raise BufferFullException if @buffer.all? { |val| val != nil }\n @youngest = increment_youngest(@buffer.size)\n @buffer[@youngest] = val\n end\n end",
"title": ""
},
{
"docid": "05403e7ead9e272ad66dfc713a3349f3",
"score": "0.5320869",
"text": "def <<(buf)\n Polyphony.backend_write(self, buf)\n self\n end",
"title": ""
},
{
"docid": "1fc7dcd6a53408fb6698cd4a2054c909",
"score": "0.527894",
"text": "def append_buffer(buff=nil,offset=nil,len=nil)\n if buff.class.method_defined?(:j_del) && !block_given? && offset == nil && len == nil\n @j_del.java_method(:appendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(buff.j_del)\n return self\n elsif buff.class.method_defined?(:j_del) && offset.class == Fixnum && len.class == Fixnum && !block_given?\n @j_del.java_method(:appendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::int.java_class,Java::int.java_class]).call(buff.j_del,offset,len)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_buffer(buff,offset,len)\"\n end",
"title": ""
},
{
"docid": "535328a2dd113373e328011bbcea9d9d",
"score": "0.5257121",
"text": "def append_byte(b=nil)\n if b.class == Fixnum && !block_given?\n @j_del.java_method(:appendByte, [Java::byte.java_class]).call(::Vertx::Util::Utils.to_byte(b))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_byte(b)\"\n end",
"title": ""
},
{
"docid": "e538825c2860b94a7ad84497806ddb73",
"score": "0.5228781",
"text": "def to_buffer\n unsigned_buffer.\n add_varbytes(digest)\n end",
"title": ""
},
{
"docid": "ef983e4420ca2e27b0c02ecd116dfa57",
"score": "0.5201475",
"text": "def append(n)\r\n self.value = self.value.to_s + n.to_s\r\n end",
"title": ""
},
{
"docid": "b5ed4422bd6860e84a8ac9f79d00c2df",
"score": "0.51897556",
"text": "def buffer_concat(txt)\n @_out_buf << txt if buffer?\n end",
"title": ""
},
{
"docid": "dc75e22bb5b72d1c753cd6d86680413c",
"score": "0.5185485",
"text": "def <<(other)\n if other.respond_to?(:to_int)\n return self << ('' << other)\n end\n \n @chain << SubString.new(@size, other)\n @size += other.size\n end",
"title": ""
},
{
"docid": "1ddbce843051fbc2d53d87dcc518a757",
"score": "0.514556",
"text": "def append_to(buffer)\n tempfile.rewind\n\n buf = String.new\n buffer << tempfile.readpartial(65_536, buf) until tempfile.eof?\n\n tempfile.rewind\n\n nil\n end",
"title": ""
},
{
"docid": "28ced7f5f18d123d1265c03f3f766202",
"score": "0.5080892",
"text": "def queue message\n @buffer_semaphore.synchronize do\n @buffer += message\n end\n end",
"title": ""
},
{
"docid": "69f3cc30cb3f1ef2d323992d17b89572",
"score": "0.504631",
"text": "def put_i32(arg)\n @data += [arg].pack(\"N\")\n self\n end",
"title": ""
},
{
"docid": "e71f042ef4197bab75e6ace47fb262c4",
"score": "0.5032382",
"text": "def encode\n [@size].pack(\"N\") + @buffer\n end",
"title": ""
},
{
"docid": "90ec21ef3c3ebd6be123bcf70135e830",
"score": "0.50221163",
"text": "def append!\n self.operation = :append\n end",
"title": ""
},
{
"docid": "99fb91b8b5d28cadd47b185a082c32cd",
"score": "0.50129706",
"text": "def +(n) self.class.from_integer(to_i + n) end",
"title": ""
},
{
"docid": "4bb7e8152473476e1fc06642d25d218e",
"score": "0.49626675",
"text": "def append_unsigned_short(s=nil)\n if s.class == Fixnum && !block_given?\n @j_del.java_method(:appendUnsignedShort, [Java::int.java_class]).call(s)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_unsigned_short(s)\"\n end",
"title": ""
},
{
"docid": "1f156cbdb6ea08e756ef9f81ca14feeb",
"score": "0.49433088",
"text": "def <<(buf)\n return write(buf.to_s)\n end",
"title": ""
},
{
"docid": "c8e13b2a471c76575545313cbf48fad7",
"score": "0.49382055",
"text": "def write_buffer(buf)\n while not buf.empty?\n count = @sock.write(buf)\n buf = buf[count..-1]\n end\n end",
"title": ""
},
{
"docid": "b8f3bea2d349230c6a06ae0cca3ae6bf",
"score": "0.49323514",
"text": "def add_to_buffer( event )\n str = event.instance_of?(::Logging::LogEvent) ?\n layout.format(event) : event.to_s\n return if str.empty?\n\n buffer << str\n flush if buffer.length >= auto_flushing || immediate?(event)\n\n self\n end",
"title": ""
},
{
"docid": "0f4f98bf331b1ec63048b0e109822d5c",
"score": "0.48994994",
"text": "def <<(blob)\n @buf << blob\n buf_flush if @buf.size > BUFFER_SIZE\n self\n end",
"title": ""
},
{
"docid": "52b3bff374a9cf06272118c87e3b140e",
"score": "0.48963284",
"text": "def add_buffer(id)\n buffers[id] ||= []\n DSP[id] = buffers[id]\n end",
"title": ""
},
{
"docid": "dd4ab6c18806ec7a03741bb89c1e2ad6",
"score": "0.48944417",
"text": "def push(val)\n resize! if length == capacity\n self.length += 1\n self[length - 1] = val\n end",
"title": ""
},
{
"docid": "ea17dd0ee54386c94564b4a83a91c39c",
"score": "0.4891784",
"text": "def << data\n buffer << data if data\n parse_loop!\n end",
"title": ""
},
{
"docid": "41afbd43598a4e4b3624787f25fb526d",
"score": "0.48864356",
"text": "def append(val)\n if(@entries != @length)\n @position += 1\n @entries += 1\n @store[@position] = val\n end \n end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.48725468",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.48725468",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.48725468",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9a51ffdff4092fb18cb2961ca66d81cd",
"score": "0.48725468",
"text": "def <<(chunk, last_chunk = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5c16eb047e5ef90b1f06ed3aa651f6be",
"score": "0.48604524",
"text": "def push(val)\n self.concat([val])\n shift if size > @max_size\n end",
"title": ""
},
{
"docid": "18560f589a29a1ee9ea016b24bcfc76b",
"score": "0.4849616",
"text": "def append value\n add_idx = empty? ? 0 : last_key + 1\n self[add_idx] = value\n end",
"title": ""
},
{
"docid": "3fe9d3e172834efb567a6ab90a00967c",
"score": "0.4839101",
"text": "def <<(buf)\n @buffer << buf\n parse\n end",
"title": ""
},
{
"docid": "ba0555b82156c35e282657847ca5cc59",
"score": "0.48366144",
"text": "def write_varint(i, data: nil, stream: nil)\n buf = encode_varint(i)\n data << buf if data\n stream.write(buf) if stream\n buf\n end",
"title": ""
},
{
"docid": "a66cf0b944ace99058ab83c02a1de136",
"score": "0.4828668",
"text": "def push(val)\n resize! if @length == @capacity\n self.length += 1\n self[length - 1] = val\n\n nil\n end",
"title": ""
},
{
"docid": "492b7977b001ccf5e8ac7cb5b021f4ef",
"score": "0.48195982",
"text": "def push_int(n)\n begin\n append_opcode(n)\n rescue ArgumentError\n append_data(Script.encode_number(n))\n end\n self\n end",
"title": ""
},
{
"docid": "97ffe2bdbd7c68ebb7e488421f411f6a",
"score": "0.4819519",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\n end",
"title": ""
},
{
"docid": "44594bdc8bbd3f6bc5d9a23c5ee2174a",
"score": "0.48097238",
"text": "def append_hugeint(value)\n lower, upper = integer_to_hugeint(value)\n _append_hugeint(lower, upper)\n end",
"title": ""
},
{
"docid": "83047560eeceab74f07bb0a3b3e412ed",
"score": "0.47842905",
"text": "def unsigned_buffer\n Octokey::Buffer.new.\n add_uint8(version).\n add_timestamp(timestamp).\n add_ip(client_ip).\n add_varbytes(random)\n end",
"title": ""
},
{
"docid": "a814b428c8b7978fd8c7b29f3a51a8cf",
"score": "0.47820333",
"text": "def fill_buffer num_bytes\n while @buffer.bytesize < num_bytes && more_chunks?\n @buffer << next_chunk\n end\n end",
"title": ""
},
{
"docid": "3eaf5ad2f0aa2948ff8a1d4a919bf3cd",
"score": "0.47750685",
"text": "def shift_write_buffer\n @write_mutex.synchronize { @write_buffer.shift }\n end",
"title": ""
},
{
"docid": "ade396a49535a9fc1fa50cebd907c577",
"score": "0.47731936",
"text": "def write(buf)\n @sendbuf_lock.synchronize {\n @sendbuf += buf\n\n while @sendbuf.size >= @block_size\n send_data(@sendbuf[0..@block_size-1])\n @sendbuf = @sendbuf[@block_size..-1].to_s\n end\n }\n end",
"title": ""
},
{
"docid": "ce465b7d10e8b20c44812ba365240af0",
"score": "0.4755424",
"text": "def Add(val)\n self.value += val\n end",
"title": ""
},
{
"docid": "740aba1d47fce0920770ee0c5be9c630",
"score": "0.47325826",
"text": "def <<(obj)\n if obj.is_a?(Integer)\n push_int(obj)\n elsif obj.is_a?(String)\n append_data(obj)\n elsif obj.is_a?(Array)\n obj.each { |o| self.<< o }\n self\n end\n end",
"title": ""
},
{
"docid": "8bacd3d9d862be2eef57fa2960754aae",
"score": "0.4727387",
"text": "def append_newline\n buffer << \"\\n\"\n @current_line_length = 0\n end",
"title": ""
},
{
"docid": "d0096373913ca8b36001e97dc3a7a629",
"score": "0.47201043",
"text": "def put_int(*ints)\n ints.each { |i| @request << [i].pack('N') }\n self\n end",
"title": ""
},
{
"docid": "566e6166359286f89a5bceab46a00837",
"score": "0.47167638",
"text": "def append_queue\n if free_space > 0 \n free_blocks.times { \n if already_read < current_track.file.size\n buffer_block current_track\n else\n # We've finished this track, on to the next one\n load_next_track\n return\n end\n }\n else\n #puts \"Buffer full\" \n end\n end",
"title": ""
},
{
"docid": "5b5ef51f174cf01d5c0c7f2b950dd1ed",
"score": "0.47164688",
"text": "def concat(string)\n output_buffer << string\n end",
"title": ""
},
{
"docid": "ff3aedce0a56db79b9d13b784fa8bd79",
"score": "0.47046664",
"text": "def push(element)\n if length == @buffer_size\n shift\n end\n\n array_push(element)\n end",
"title": ""
},
{
"docid": "1a05a7acdd38dfd1a388202d08b20317",
"score": "0.46897113",
"text": "def append_long(l=nil)\n if l.class == Fixnum && !block_given?\n @j_del.java_method(:appendLong, [Java::long.java_class]).call(l)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_long(l)\"\n end",
"title": ""
},
{
"docid": "dab2a5217397e98396534bf2f7a89ba2",
"score": "0.46818233",
"text": "def put_i64(arg)\n @data += [(arg >> 32) & UINT_MASK, arg & UINT_MASK].pack(\"NN\")\n self\n end",
"title": ""
},
{
"docid": "e8cb62f01bcda2a5d3eb64a98474c1fa",
"score": "0.46701664",
"text": "def append(id, content, options = AppendOptions.new) end",
"title": ""
},
{
"docid": "26540ec536c9843bf87320453875bde3",
"score": "0.46590054",
"text": "def to_buffer\n validate_binary_operations\n @request.perform(binary: true)\n end",
"title": ""
},
{
"docid": "1baecc217d1119918400458af5ac0f1c",
"score": "0.4651992",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element # Mutates the caller \n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "e41cc167d1f23992a8ea4e77149ad153",
"score": "0.46479264",
"text": "def buffer_size=(value)\n @buffer_size = value\n flush\n end",
"title": ""
},
{
"docid": "51bccda3170e59a7db69f84648ea62b5",
"score": "0.4625861",
"text": "def append(arr, num)\n return arr << num\nend",
"title": ""
},
{
"docid": "51bccda3170e59a7db69f84648ea62b5",
"score": "0.4625861",
"text": "def append(arr, num)\n return arr << num\nend",
"title": ""
},
{
"docid": "51bccda3170e59a7db69f84648ea62b5",
"score": "0.4625861",
"text": "def append(arr, num)\n return arr << num\nend",
"title": ""
},
{
"docid": "3948992b6081d0667a0e22c238ce532f",
"score": "0.46235967",
"text": "def <<(data)\n write(data)\n self\n end",
"title": ""
},
{
"docid": "ad397f9d976520b9e6da0a00c4e0fce4",
"score": "0.46194535",
"text": "def <<(text)\r\n dbg_puts \" Append=#{text.inspect}\"\r\n @buffer << text\r\n rescue NoMethodError\r\n error \"F14: The current mode does not allow code to be appended.\"\r\n end",
"title": ""
},
{
"docid": "495a73fc51e63b47ba33425076ae97be",
"score": "0.46191806",
"text": "def <<(data)\n insert(-1, data)\n end",
"title": ""
},
{
"docid": "a338ee8311df499c448b390e7b3b7ce0",
"score": "0.46128646",
"text": "def push(val)\n resize! if self.length == self.capacity\n self.length += 1 \n self[length - 1] = val \n nil \n end",
"title": ""
},
{
"docid": "eb4059522f9ee8e24fab24f69c3aed63",
"score": "0.4602591",
"text": "def shift_and_add_to(target, long_mailer_id)\n target * 10 ** NUM_DIGITS + to_i\n end",
"title": ""
},
{
"docid": "916bdaa214ac42662cf9f07a00df6680",
"score": "0.4601261",
"text": "def write( event )\n add_to_buffer event\n self\n end",
"title": ""
},
{
"docid": "bbcac1f3cd45b9a961264ab996f8ffb9",
"score": "0.45940426",
"text": "def push element\n if full?\n raise ArgumentError, \"buffer is full, and override_when_full is false\" unless @override_when_full\n \n @buffer[@newest] = element;\n @newest += 1\n @oldest += 1\n else\n @buffer[@newest] = element;\n @newest += 1\n @fill_count += 1 \n end\n\n if @oldest >= @buffer.count\n @oldest = 0\n end\n\n if @newest >= @buffer.count\n @newest = 0\n end\n end",
"title": ""
},
{
"docid": "3af0a9050803790cb303204c54316e37",
"score": "0.45902658",
"text": "def +(b)\n return self if b == 0\n return Int.new(@value + b) if b.is_a? Integer\n b = b.symdescfy\n case b\n when Infinity\n b\n when Ratio, BinaryOp\n b + self\n when Int\n Int.new(@value + b.value)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "bbf35d9e4326e52ba1ded09ea5689458",
"score": "0.4585924",
"text": "def append(value = '')\n @source += value\n end",
"title": ""
},
{
"docid": "40cf8b02d68fb61795de5650437754c2",
"score": "0.45741647",
"text": "def write_int(value, stream = @index)\n stream.write([value].pack('L'))\n end",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "5b3bf09c8b68426debfe9bfe5daad71e",
"score": "0.456715",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size > max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "a1010df2836572468eb4deebbd410dc9",
"score": "0.4563782",
"text": "def append(arr, number)\n arr << number\n return arr\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "9fae04755bd633a71e7129bf85b07d92",
"score": "0.4563024",
"text": "def rolling_buffer1(buffer, max_buffer_size, new_element)\n buffer << new_element\n buffer.shift if buffer.size >= max_buffer_size\n buffer\nend",
"title": ""
},
{
"docid": "8bd0b3d33b8d329da12bd67a18fdf8a3",
"score": "0.45521328",
"text": "def erb_concat(text)\n @_out_buf << text if has_erb_buffer?\n end",
"title": ""
},
{
"docid": "0de7c508e4fa12d257d91221926839db",
"score": "0.45517626",
"text": "def <<(str)\n raise RecordTooLarge.new(str) if str.bytesize >= MAX_BYTES_PER_RECORD\n @buffer << str\n end",
"title": ""
}
] |
2ae30007924e13ceebc1d01995244c6c
|
DELETE /market_sessions/1 DELETE /market_sessions/1.json
|
[
{
"docid": "80b24ab7b8d6b56c8233aa2960eccb07",
"score": "0.765113",
"text": "def destroy\n @market_session.destroy\n respond_to do |format|\n format.html { redirect_to market_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "db4123b54eef63306974799f04f4279c",
"score": "0.690705",
"text": "def deleteSession\n destroy\n @team = Team.find(session[:team_id])\n sessions = @team.sessions.last(5).reverse\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json {render json: sessions}\n end\n end",
"title": ""
},
{
"docid": "8495e13e2969defcd2ce872f0103cb12",
"score": "0.68543553",
"text": "def destroy\n @session = @client.sessions.find(params[:id])\n @session.destroy\n respond_to do |format|\n format.html { redirect_to client_url(@client), notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c0739eaa0d454df9ad8e26d9f40f49c",
"score": "0.6799349",
"text": "def destroy\n @api_supermarket.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "19437e53bf9a4b0fd25f18a431100b17",
"score": "0.6782322",
"text": "def destroy_rest\n @instrument_session = InstrumentSession.find(params[:id])\n @instrument_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_sessions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "15a4438023e1ed2e39884e13d5c9911d",
"score": "0.6755854",
"text": "def delete_session_request\n #Net::HTTP::Delete.new(@uri + \"/session/#{@session_key}\")\n end",
"title": ""
},
{
"docid": "4cf4f296c8c8f94dfc70abb1baf80518",
"score": "0.66744894",
"text": "def delete_sessions()\n path = '/account/sessions'\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'DELETE',\n path: path,\n headers: headers,\n params: params,\n )\n end",
"title": ""
},
{
"docid": "a982be82e5cb3b1363ae75d48efb0501",
"score": "0.66664785",
"text": "def destroy\n @api_v1_mentoring_session.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentoring_sessions_url, notice: 'Mentoring session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5718446ab3ed92a3ad9aaa06e4ec03ab",
"score": "0.6660607",
"text": "def destroy\n @market = Market.find(params[:id])\n @market.destroy\n\n respond_to do |format|\n format.html { redirect_to markets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0f7eca3b75a88e46f6c07dcfb1df721",
"score": "0.6643843",
"text": "def destroy\n @my_studio_session = MyStudio::Session.find(params[:id])\n @my_studio_session.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_sessions_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ec6983706dfb75137dbe8bda45aedf97",
"score": "0.6631568",
"text": "def destroy\n\n if(params[:token].nil?)\n response.status = 400\n render json: {}\n return\n end\n\n session = validate_session(params[:token])\n\n if session.nil?\n response.status = 401\n render json: {}\n return\n end\n\n begin\n obj = TimeSession.find(params[:id])\n\n unless session.user.id == obj.user.id\n response.status = 403\n render json: {}\n return\n end\n\n obj.destroy\n response.status = 204\n rescue ActiveRecord::RecordNotFound => e\n response.status = 404\n render json: {}\n rescue Exception => e\n response.status = 500\n render json: {msg: e}\n end\n\n end",
"title": ""
},
{
"docid": "4817ee133904703ad0d703c6c8a7919b",
"score": "0.66281956",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5700f68f1301121401cd541b536609ec",
"score": "0.662343",
"text": "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa7621ca0d62e5d34472e35213869bc1",
"score": "0.66034716",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa7621ca0d62e5d34472e35213869bc1",
"score": "0.66034716",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa7621ca0d62e5d34472e35213869bc1",
"score": "0.66034716",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa7621ca0d62e5d34472e35213869bc1",
"score": "0.66034716",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa7621ca0d62e5d34472e35213869bc1",
"score": "0.66034716",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3a62018c71a3bee18e78bf65f2909827",
"score": "0.6587207",
"text": "def destroy\n @stock_market = StockMarket.find(params[:id])\n @stock_market.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_markets_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dc1c261633176b0d4247018c669b8fa8",
"score": "0.6550506",
"text": "def destroy\n @experiment_session = ExperimentSession.find(params[:id])\n @experiment_session.destroy\n\n respond_to do |format|\n format.html { redirect_to experiment_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc2c635cc84dde76eed705c7dd8747c8",
"score": "0.65364623",
"text": "def destroy\n @market_type = MarketType.find(params[:id])\n @market_type.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\nend",
"title": ""
},
{
"docid": "d1573d7eb5ad279e2f039811bff5d165",
"score": "0.65042263",
"text": "def destroy\n @learn_session.destroy\n respond_to do |format|\n format.html { redirect_to learn_sessions_url, notice: t('learnSession_delete') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9c539162744afd013e57390f3f7302f8",
"score": "0.65005624",
"text": "def destroy\n @market_comparison = MarketComparison.find(params[:id])\n @market_comparison.destroy\n\n respond_to do |format|\n format.html { redirect_to market_comparisons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f4efbd173b0e24db059b26603b48858",
"score": "0.6499752",
"text": "def destroy\n @v1_instrument_session = V1InstrumentSession.find(params[:id])\n @v1_instrument_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_instrument_sessions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f920a99c4e9c1b49cabf77286d923db7",
"score": "0.6486087",
"text": "def destroy\n @market_order = MarketOrder.get(params[:id])\n @market_order.destroy\n\n respond_to do |format|\n format.html { redirect_to market_orders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ab0d13ef0c04a8f91aca38303d1a94d6",
"score": "0.6483915",
"text": "def destroy\n @interview_session = InterviewSession.find(params[:id])\n @interview_session.destroy\n\n respond_to do |format|\n format.html { redirect_to interview_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "382a1a4b587dfabb25f7407b7ed24b09",
"score": "0.6481479",
"text": "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url, notice: 'Market was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "382a1a4b587dfabb25f7407b7ed24b09",
"score": "0.6481479",
"text": "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url, notice: 'Market was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "382a1a4b587dfabb25f7407b7ed24b09",
"score": "0.6481479",
"text": "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url, notice: 'Market was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "11b1ca40ed168cb5a560c049bf673e01",
"score": "0.6480155",
"text": "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_path, notice: 'Market was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "997e8f2ef81f5d16341c6e2babd858e9",
"score": "0.64770174",
"text": "def destroy\n @tsession = Tsession.find(params[:id])\n @tsession.destroy\n\n respond_to do |format|\n format.html { redirect_to tsessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85f336362e0ff073cd2ba863e4df3880",
"score": "0.64766514",
"text": "def destroy\n @market_order = MarketOrder.find(params[:id])\n @market_order.destroy\n\n respond_to do |format|\n format.html { redirect_to market_orders_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3bd930324846b3bbf94f1260011e374d",
"score": "0.64734167",
"text": "def destroy\n @scrape_session.destroy\n respond_to do |format|\n format.html { redirect_to scrape_sessions_url, notice: 'Scrape session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67b7d9f266555fad706a4ab83d4ac11a",
"score": "0.64728236",
"text": "def destroy\n @training_session = TrainingSession.find(params[:id])\n @training_session.destroy\n\n respond_to do |format|\n format.html { redirect_to training_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bdff442a3c26d5f486da0a9553414190",
"score": "0.64465135",
"text": "def destroy\n @cashier_session = CashierSession.find\n @cashier_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(:login , :notice => 'Goodbye!') }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "278117cefd4e745976f2353d8a31f47b",
"score": "0.64444125",
"text": "def destroy\n @client_session = ClientSession.find(params[:id])\n @client_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(client_sessions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6f9ca952f27ffe0da2e477bea08c665f",
"score": "0.64290625",
"text": "def destroy\n @expensescounter = current_expensescounter\n @expensescounter.destroy\n session[:expensescounter_id] = nil\n\n respond_to do |format|\n format.html { redirect_to store_url, notice: 'Your cart is currently empty' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4221270cff5c9506c1f0ec44d559621a",
"score": "0.6426801",
"text": "def destroy\n @inventory_session = InventorySession.find(params[:id])\n @inventory_session.destroy\n\n respond_to do |format|\n format.html { redirect_to adm_inventory_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ed72a48e14aee3688bdda4a3f3f31f8",
"score": "0.6419916",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to workout_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8cb11fbd77ef6ee0f00008f6af7209f5",
"score": "0.641858",
"text": "def destroy\n @exercise_session = ExerciseSession.find(params[:id])\n @exercise_session.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0661ff25d0ad9c36635b228e8f772e3b",
"score": "0.64184844",
"text": "def destroy\n @telemetry = Telemetry.find(params[:id])\n #path = \"telemetries/IXV/#{@telemetry.database.version}/#{@telemetry.name}_#{@telemetry.version}\"\n delete = %x[rm -R #{@telemetry.path}]\n @telemetry.destroy\n respond_to do |format|\n format.html { redirect_to telemetries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a9e8fab2cb8e31172af9df9b0eebc0d7",
"score": "0.6408936",
"text": "def destroy\n @test_session.destroy\n respond_to do |format|\n format.html { redirect_to test_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fccde4acdf9a7625e080f0ee4fb368f3",
"score": "0.64017344",
"text": "def destroy\n set_session\n\n if @session.destroy\n respond_to do |format|\n format.html { redirect_to batch_connect_sessions_url, notice: t('dashboard.batch_connect_sessions_status_blurb_delete_success') }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to batch_connect_sessions_url, alert: t('dashboard.batch_connect_sessions_status_blurb_delete_failure') }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc147245f3edfaa98b785b234a3e3bca",
"score": "0.63991237",
"text": "def destroy\n @market = Market.find(params[:id])\n @market.destroy\n\n respond_to do |format|\n format.html { redirect_to(markets_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0e5741b66f19e30749c11cff222ab549",
"score": "0.639704",
"text": "def destroy\n @supermarket = Supermarket.find(params[:supermarket_id])\n @supermarket_event = @supermarket.events.find(params[:id])\n @supermarket_event.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "c69587c65721026792b0e50f2d6d4780",
"score": "0.6390711",
"text": "def destroy\n @api_v1_mentorship_session.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentorship_sessions_url, notice: 'Mentorship session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ed472dfd1e74471c6f536f1f0c2674b",
"score": "0.6383659",
"text": "def destroy\n @sessionlog.destroy\n respond_to do |format|\n format.html { redirect_to sessionlogs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "688bc4c4e8ed051c07912e766b23e733",
"score": "0.63790995",
"text": "def destroy\n @user_session = UserSession.find(params[:id])\n @user_session.destroy\n\n respond_to do |format|\n format.html { redirect_to user_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6fa3d8a78cc5c7d872a411b4611d0204",
"score": "0.6352304",
"text": "def deleteSession(name,node=nil)\n Jiocloud::Utils.put(sessionurl + '/destroy/' + getSessionID({:name => name,:node => node}),'')\n end",
"title": ""
},
{
"docid": "197f0cd5dc4783abe5de16dda4e1f406",
"score": "0.63490087",
"text": "def destroy\n admin_only\n @session_review.destroy\n respond_to do |format|\n format.html { redirect_to session_reviews_url, notice: 'Session review was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b58a6cb414aee5270effacc5a31ace8a",
"score": "0.63436717",
"text": "def destroy\n @clubsession = Clubsession.find(params[:id])\n @clubsession.destroy\n\n respond_to do |format|\n format.html { redirect_to clubsessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5af84fe68d9bb38687e24d01647f3922",
"score": "0.63430923",
"text": "def destroy\n @admin_market = Market.find(params[:id])\n @admin_market.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_markets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "94f7544e0a439eda0632172ad25902c5",
"score": "0.6339172",
"text": "def destroy\n @studysession.destroy\n respond_to do |format|\n format.html { redirect_to studysessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2c2b1b3495c4d1357d91ac3d37c1b81c",
"score": "0.63346994",
"text": "def destroy\n # expire auth token\n \n @company=Company.where(:authentication_token=>params[:api_key]).first\n @company.reset_authentication_token!\n render :json => { :message => [\"Session deleted.\"] }, :success => true, :status => :ok\n end",
"title": ""
},
{
"docid": "155aada869e49247a924d73967955c31",
"score": "0.6333185",
"text": "def destroy\n @possession = Possession.find(params[:id])\n @possession.destroy\n\n respond_to do |format|\n format.html { redirect_to possessions_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "567a0c66b105858fb5d084bd0d061373",
"score": "0.63314044",
"text": "def destroy\n session = Session.find(params[:id])\n session.destroy\n @sessions = Session.all\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
},
{
"docid": "db6b3bbdb5f53eeb58683aad3526b0e5",
"score": "0.63283974",
"text": "def delete_purl(id)\n @http.delete(\n '/admin/purl' + id,\n {'Cookie' => 'NETKERNELSESSION=session:' + @session_key}\n ).value\nend",
"title": ""
},
{
"docid": "db6b3bbdb5f53eeb58683aad3526b0e5",
"score": "0.63283974",
"text": "def delete_purl(id)\n @http.delete(\n '/admin/purl' + id,\n {'Cookie' => 'NETKERNELSESSION=session:' + @session_key}\n ).value\nend",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.6321985",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "e467c9931627b542f0c3f45d935bc9cc",
"score": "0.63203686",
"text": "def destroy\n @market_summary.destroy\n respond_to do |format|\n format.html { redirect_to market_summaries_url, notice: 'Market summary was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c5fb64e75c75818497609fb8828afae",
"score": "0.6318087",
"text": "def destroy\n\n sign_out\n redirect_to root_url\n #@session = Session.find(params[:id])\n #@session.destroy\n\n #respond_to do |format|\n # format.html { redirect_to sessions_url }\n # format.json { head :no_content }\n #end\n end",
"title": ""
},
{
"docid": "afb06f7ca270857fad56787d2f236025",
"score": "0.6312537",
"text": "def restHttpDelete(id, format = @format, sessionId = @sessionId)\n # Validate SessionId is not nil\n assert(sessionId != nil, \"Session ID passed into DELETE was nil\")\n\n urlHeader = makeUrlAndHeaders('delete',id,sessionId,format)\n @res = RestClient.delete(urlHeader[:url], urlHeader[:headers]){|response, request, result| response }\n\n puts(@res.code,@res.body,@res.raw_headers) if $SLI_DEBUG\nend",
"title": ""
},
{
"docid": "2c7467141c2a8e54c81ca9a847bbbbcf",
"score": "0.63095355",
"text": "def destroy\n @possession.destroy\n respond_to do |format|\n format.html { redirect_to possessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2360f9dca5bc6595e20667126babc5d",
"score": "0.63025826",
"text": "def destroy\n @user_personal_test_session = UserPersonalTestSession.find(params[:id])\n @user_personal_test_session.destroy\n\n respond_to do |format|\n format.html { redirect_to user_personal_test_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0acd2f42245e75cf855b3ebec8dec3da",
"score": "0.62962526",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "a7bfa3129d0595c7eb50a3fcfc8193b7",
"score": "0.6288704",
"text": "def destroy\n @basket_visit = BasketVisit.find(params[:id])\n @basket_visit.destroy\n\n respond_to do |format|\n format.html { redirect_to pending_basket_visits_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b05e290996de995310c264dfd0dba936",
"score": "0.62870073",
"text": "def destroy\n @frontend_session = FrontendSession.find(params[:id])\n @frontend_session.destroy\n\n respond_to do |format|\n format.html\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f5727d87f1bf560525f687af513ad06f",
"score": "0.6283594",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: \"Session was successfully destroyed.\" }\n # format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5600913b9f556a43cb86e5674b3c2ca5",
"score": "0.6283051",
"text": "def delete_session(req, sid, options); end",
"title": ""
},
{
"docid": "5600913b9f556a43cb86e5674b3c2ca5",
"score": "0.6283051",
"text": "def delete_session(req, sid, options); end",
"title": ""
},
{
"docid": "297ff37fb2e549ef2b1cb3187b31c72a",
"score": "0.62820107",
"text": "def destroy\n @user.sessions.each{|session| session.usersessions.destroy_all}\n session_del_array = @user.sessions.map{|session| Session.find(session.id).destroy.id}\n @user.reviews.destroy_all\n @user.gameowners.destroy_all\n @del_user = @user.destroy\n render json: {user: @del_user, del_sessions: session_del_array} \n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b3e5be0e940a2d851fa13393d28d8ca",
"score": "0.62777716",
"text": "def destroy\n @session.destroy\n respond_to do |format|\n format.html { redirect_to sessions_url, notice: 'Session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bec8b6b4ed52f4fe8490a23b6349eb94",
"score": "0.6274518",
"text": "def destroy\n @carnival_session.destroy\n respond_to do |format|\n format.html { redirect_to carnival_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "add59e1def4942b40f552d1a985a7133",
"score": "0.6256069",
"text": "def sessions_delete\n user_id, session_id = parse_authorization_header\n if user_id\n $pg.with do |pg|\n pg.exec_params('SELECT sessions_delete($1, $2)', [user_id, session_id]) do |r|\n if r.num_tuples == 1\n return [200, '']\n end\n end\n end\n end\n set_www_authenticate_header\n [401, '']\n end",
"title": ""
},
{
"docid": "281a31629930a3be8a55bb2ce2e2102a",
"score": "0.62507063",
"text": "def destroy\n @session_log_entry = SessionLogEntry.find(params[:id])\n @session_log_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to session_log_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "843af3aa9c4970e2622406c1f219218d",
"score": "0.6247073",
"text": "def destroy\n @student_session = StudentSession.find\n @student_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(:login , :notice => 'Goodbye!') }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5ff3ed8a79a47587715c76deee4cae84",
"score": "0.62463325",
"text": "def destroy\n @strategies_market = Strategiesmarket.find(params[:id])\n @strategies_market.destroy\n\n respond_to do |format|\n format.html { redirect_to strategies_markets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fb93c62fde7ae2a2d3c73e01bbc431e4",
"score": "0.62458664",
"text": "def destroy\n self.authenticate_token\n\n Rails.logger.info request.query_parameters.inspect\n api_call_start = Time.now.to_f\n\n # 1. Check to make sure author of snap is current_user\n # 2. Delete Snap with snap_id in params\n # 3. Delete all associated comments and likes\n s = Snap.find(:first, :conditions=> \"id = #{params[:snap_id]} and user_id = #{@current_user.id}\")\n if s.destroy\n Comment.delete_all(:conditions=> \"id = #{params[:snap_id]}\" )\n Like.delete_all(:conditions=> \"id = #{params[:snap_id]}\" ) \n end\n \n # This straight up deletes\n # Snap.delete_all(:conditions => \"id = #{params[:snap_id]} and user_id = #{@current_user.id}\")\n\n api_call_duration = Time.now.to_f - api_call_start\n LOGGING::Logging.logfunction(request,@current_user.id,'snap#destroy',nil,nil,api_call_duration,nil,nil,nil)\n\n response = {:success => \"true\"}\n respond_to do |format|\n format.xml { render :xml => response }\n format.json { render :json => response }\n end\n end",
"title": ""
},
{
"docid": "e209adb1a867b1d9c6302f73cb295292",
"score": "0.6243843",
"text": "def destroy\n @gank_session.destroy\n respond_to do |format|\n format.html { redirect_to gank_sessions_url, notice: 'Gank session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac1d92859c5f0e3005be18d4eb1defb1",
"score": "0.62394047",
"text": "def destroy\n @performance_request = PerformanceRequest.find(params[:id])\n @performance_request.destroy\n\n respond_to do |format|\n format.html { redirect_to performance_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a1a5ef50984724eddb0e7321d18d021",
"score": "0.62365",
"text": "def destroy\n reset_session\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a34ecaa5a2c2003de7267409029181d",
"score": "0.6231751",
"text": "def destroy\n @player_session = PlayerSession.find(params[:id])\n @player_session.destroy\n\n respond_to do |format|\n format.html { redirect_to player_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2985d8c0c8239ad68b9168045c3eb817",
"score": "0.62298906",
"text": "def destroy\n @exercise_session = ExerciseSession.find(params[:id])\n @exercise_session.destroy\n\n respond_to do |format|\n format.html { redirect_to(exercise_sessions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "85d37c3248eb0f3b7fb88a94fb6b4199",
"score": "0.62263244",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to(sessions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "85d37c3248eb0f3b7fb88a94fb6b4199",
"score": "0.62263244",
"text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to(sessions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "240514bc6799d326a5a36b9731fb371b",
"score": "0.62231183",
"text": "def destroy\n @gamesession = Gamesession.find(params[:id])\n @gamesession.destroy\n\n respond_to do |format|\n format.html { redirect_to gamesessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "15b57cb18cd9eca9fa9fbfaa67379c78",
"score": "0.6221625",
"text": "def destroy\n @stolen_session.destroy\n respond_to do |format|\n format.html { redirect_to stolen_sessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7163cfac0060ab89acc07ad7613b0b7d",
"score": "0.6221249",
"text": "def destroy\n @counseling_session.destroy\n respond_to do |format|\n format.html { redirect_to counseling_sessions_url, notice: 'Counseling session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "42483eee3c22bc0f8187bfe41a396cb6",
"score": "0.6220235",
"text": "def destroy\n @intergroup_session = IntergroupSession.find(params[:id])\n @intergroup_session.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_intergroup_sessions_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a9bfa4dcec3bc5313b95b75d827063ad",
"score": "0.62195504",
"text": "def destroy\n @marketdate.destroy\n respond_to do |format|\n format.html { redirect_to marketdates_url, notice: 'Marketdate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d55139144ac5dba02aab7066603890f1",
"score": "0.6216043",
"text": "def destroy\n @exercise_session.destroy\n respond_to do |format|\n format.html { redirect_to exercise_sessions_url, notice: 'Exercise session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7beb943db4385f90cf9294fd77959deb",
"score": "0.6207476",
"text": "def destroy\n @market = Market.find(params[:id])\n @market.destroy\n flash[:notice] = 'Market was successfully deleted.'\n respond_with(@market)\n end",
"title": ""
},
{
"docid": "f896790de9ec777a3d8bc2ac3afddedd",
"score": "0.6190753",
"text": "def destroy\n @marketshare.destroy\n respond_to do |format|\n format.html { redirect_to marketshares_url, notice: 'Marketshare was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
d2cebe48426f518a317ffe2a9631acb2
|
clean_string removes any leading and trailing spaces from the input
|
[
{
"docid": "36004c2e1bdff7862fa951a2fc9df9e9",
"score": "0.73416686",
"text": "def clean_string(input)\n return input if input.nil?\n\n input.to_s.try(:strip)\n end",
"title": ""
}
] |
[
{
"docid": "94da5f8b30cf9edfebdb2105c988111d",
"score": "0.8307635",
"text": "def clean(str); str.gsub(/^\\s{#{str[/\\s+/].length}}/, ''); end",
"title": ""
},
{
"docid": "94da5f8b30cf9edfebdb2105c988111d",
"score": "0.8307635",
"text": "def clean(str); str.gsub(/^\\s{#{str[/\\s+/].length}}/, ''); end",
"title": ""
},
{
"docid": "77df8c4a53762d42c15a22b300a42a2d",
"score": "0.82407695",
"text": "def clean_string(string)\n return string.gsub(/\\s+/, \" \").strip\n end",
"title": ""
},
{
"docid": "b1e642ad2efc0a4ea1b5a4b92be6f88d",
"score": "0.81616753",
"text": "def clean(str)\n str.gsub(/\\s+/, ' ').strip\n end",
"title": ""
},
{
"docid": "5fc1dc6c2ac5f3db54bbef2bbd6cde80",
"score": "0.7780739",
"text": "def clean(string)\n #remove HTML tags, if there are any\n string.gsub!(/<.+?>/, '') unless ((string =~ /<.+?>/) == nil)\n\n #convert into blanks\n string.gsub!(/ /, ' ')\n\n #remove whitespaces\n string.gsub!(/\\r/, '')\n string.gsub!(/\\n/, '')\n string.gsub!(/\\t/, '')\n\n #remove blanks at end\n string.strip!\n\n #convert multiple blanks into single blanks\n string.gsub!(/\\ +/, ' ')\n\n return string\n end",
"title": ""
},
{
"docid": "66ca3e3746526cc4cdd15185646b880d",
"score": "0.7748708",
"text": "def trim_string string\n\n # capture spaces at the begining or end of the string\n pattern = /(^\\s+|\\s+$)/\n\n # strip characters that match the pattern\n string.gsub( pattern, '' )\n end",
"title": ""
},
{
"docid": "c66574a0141e18c4edda4663b52c362d",
"score": "0.7732649",
"text": "def clean!\n @wrapped_string = @wrapped_string.gsub(/\\A\\-|\\-\\z/, \"\").gsub(/\\s+/u, \" \").strip\n end",
"title": ""
},
{
"docid": "70085ba719c5403509769328569988d4",
"score": "0.7727213",
"text": "def remove_extraneous_whitespace(string); end",
"title": ""
},
{
"docid": "70085ba719c5403509769328569988d4",
"score": "0.7727213",
"text": "def remove_extraneous_whitespace(string); end",
"title": ""
},
{
"docid": "70085ba719c5403509769328569988d4",
"score": "0.7727213",
"text": "def remove_extraneous_whitespace(string); end",
"title": ""
},
{
"docid": "7e8088348e7e68adcab2004ababed2f4",
"score": "0.770038",
"text": "def trim_whitespace(str); end",
"title": ""
},
{
"docid": "93ea64734eec3e5a0e6f8987e8292430",
"score": "0.7679937",
"text": "def clean(string)\n cleaned = (string || '').dup\n\n cleaned.gsub!(/[\\n\\s\\t]/, '')\n cleaned.gsub!(/^[a-z]+\\:/,'')\n\n cleaned\n end",
"title": ""
},
{
"docid": "826b0945a63b86d085e73680269fe50d",
"score": "0.76735204",
"text": "def sanitize(string)\n string.gsub(/[\\s]{2,}/, ' ').gsub(/[\\r\\n]/, ' ').strip\n end",
"title": ""
},
{
"docid": "60659be9ddf174842df5b244e2a08b6d",
"score": "0.7664015",
"text": "def treat(string)\n string.gsub(/\\s+/, '')\n end",
"title": ""
},
{
"docid": "60659be9ddf174842df5b244e2a08b6d",
"score": "0.7664015",
"text": "def treat(string)\n string.gsub(/\\s+/, '')\n end",
"title": ""
},
{
"docid": "03670b1b99566314042364ae9c426112",
"score": "0.7615313",
"text": "def cleanup(string)\r\n string = string.gsub(/[^0-9a-z ]/i, '').squeeze(' ')\r\nend",
"title": ""
},
{
"docid": "2a1e1aac8eb2091f1537f8ebaf63db84",
"score": "0.75496954",
"text": "def cleanup(messy_string)\n clean_string = messy_string.gsub(/[\\W]/, ' ').squeeze(' ')\n clean_string\n end",
"title": ""
},
{
"docid": "861b66c449f847c26ffaadb37f781f07",
"score": "0.74903697",
"text": "def clean string\n string.gsub(/^[\\t\\n ]+/, \"\").gsub(/[\\t\\n ]+/, \" \")\nend",
"title": ""
},
{
"docid": "6c0b950051412ddc6f67b328bee8c97a",
"score": "0.74683577",
"text": "def cleanup(dirty_string)\n dirty_string.gsub(/\\W/, ' ').gsub(/\\s+/, ' ')\nend",
"title": ""
},
{
"docid": "77e17a1d973f4a2932a857b1581bd061",
"score": "0.7444956",
"text": "def clean_up_spaces(string)\n string.gsub(\"\\n\", ' ').gsub(/[[:space:]]+/, ' ').strip if string.is_a? String\n end",
"title": ""
},
{
"docid": "ecb468ff5b24efc44d67c673150ae593",
"score": "0.743154",
"text": "def clean(string)\n string = string.gsub(\".\",\"\")\n string = string.gsub(/\\s+/,\" \")\n string = string.downcase\n return string\n end",
"title": ""
},
{
"docid": "65243057eccf0c7fc7859341f32d3554",
"score": "0.73482233",
"text": "def clean!\n gsub!(/[- ]+/, \" \")\n strip!\n to_s\n end",
"title": ""
},
{
"docid": "4c5d78ab4bb72ec7e5a91e6925be842c",
"score": "0.73349273",
"text": "def str_clean(s, white_space = true)\n s.to_s.tr(white_space ? \" \\n\" : \"\\n\", '')\n end",
"title": ""
},
{
"docid": "b7dad47268980a72f0628680733e245e",
"score": "0.7331341",
"text": "def cleanup(string)\n string.gsub(/[^a-z]/i, ' ').gsub(/\\s+/, ' ')\nend",
"title": ""
},
{
"docid": "e6534b18336553f8f2aa99037832cc2c",
"score": "0.7322615",
"text": "def str_clean(s, white_space = true)\n s.to_s.tr(white_space ? \" \\n\" : \"\\n\", '')\n end",
"title": ""
},
{
"docid": "a220b44b206fb0be1cd4cc4c99c74b37",
"score": "0.7311918",
"text": "def cleanup(string)\n almost_clean_array = string.split(\" \").map do |element|\n element.tr('^a-z', ' ')\n end\n\n almost_clean_string = almost_clean_array.join(\" \")\n almost_clean_string.gsub(/\\s+/, ' ') # replaces several spaces w/single space\nend",
"title": ""
},
{
"docid": "1e0e5e590df68d72b845ff12a010e0e0",
"score": "0.7308389",
"text": "def clean_str(string)\n string.mb_chars.tidy_bytes.gsub(/(\\s{2,}|\\u00a0)/, ' ').strip.to_s\n end",
"title": ""
},
{
"docid": "993fe86b90a7d2eda21c24c406c8bd20",
"score": "0.72910684",
"text": "def regular_clean(str)\n str.gsub(/[^a-z]/i, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "80b5c2f572676f284973c6f4c9a382ce",
"score": "0.72891563",
"text": "def cleanup(string)\n string.gsub!(/[^[a-zA-Z]]/, ' ')\n string.squeeze!\nend",
"title": ""
},
{
"docid": "0e70cfdd4b7105f2e161e8f73a88cdf5",
"score": "0.72737545",
"text": "def cleanup(string)\n string.gsub!(/[^a-z ^A-Z]/, \" \").squeeze(\" \")\nend",
"title": ""
},
{
"docid": "a4e3a1ec372d163d6737dca39c65e9d4",
"score": "0.72729725",
"text": "def clean(input)\n ret = input.downcase\n ret.gsub!(/[^0-9a-z ]/i, '').strip!\n\n return ret\n end",
"title": ""
},
{
"docid": "1b985fc842261578ef881eaa8e73c253",
"score": "0.72637194",
"text": "def cleanup(string)\n string.gsub(/[^A-Za-z]/, \" \").squeeze\nend",
"title": ""
},
{
"docid": "2c7575ea0c66f1647e4d97d54c70c0c7",
"score": "0.7243247",
"text": "def cleanup2(string)\n string.gsub!(/[^a-z]/, ' ')\n string.squeeze!\nend",
"title": ""
},
{
"docid": "4698d0d70315e6ad2f57a4648f15fba4",
"score": "0.7240533",
"text": "def cleanup(string)\n string.gsub!(/[^a-z]/i, ' ').squeeze(' ') # incorrectly included numbers in the regexp at first, fixed and now i shows case insensitve\nend",
"title": ""
},
{
"docid": "d9e75f68836e86e42e86fa48e0bbdaa9",
"score": "0.72385967",
"text": "def cleanup(string)\n clean_str = ''\n string.chars.each do |char|\n case char.downcase\n when ('a'..'z') then clean_str << char\n else\n clean_str << ' ' if clean_str[-1] != ' '\n end\n end\n clean_str\nend",
"title": ""
},
{
"docid": "285ef61e14c5ad95f69869aeaf4ef3d0",
"score": "0.72384185",
"text": "def cleanup(string)\n string.gsub(/[^[:alpha:]]/, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "d647447773662d5d11e41aef4419c719",
"score": "0.72244793",
"text": "def clean!\n @wrapped_string = @wrapped_string.gsub(\"-\", \" \").squeeze(\" \").strip\n end",
"title": ""
},
{
"docid": "d647447773662d5d11e41aef4419c719",
"score": "0.72244793",
"text": "def clean!\n @wrapped_string = @wrapped_string.gsub(\"-\", \" \").squeeze(\" \").strip\n end",
"title": ""
},
{
"docid": "715335a36aa1aee043d4e10f2a9fbd4e",
"score": "0.7221422",
"text": "def clean(input)\n ret = input.downcase\n ret.gsub(/[^0-9a-z ]/i, '').strip\n end",
"title": ""
},
{
"docid": "95ccad23e1b9e0f34c5532da12fcb02a",
"score": "0.7215655",
"text": "def clean str\n if str\n return str.gsub(\"\\t\",\" \").gsub(\"\\n\",\" \").strip\n end\n str\n end",
"title": ""
},
{
"docid": "e46f0f2dd5a5790ba6cfe701fbbe4d1a",
"score": "0.72044456",
"text": "def sanitize_string(input)\n unless input.nil?\n input = input.downcase\n input = input.gsub(/[^\\w\\s_-]+/, '-')\n input = input.gsub(/(^|\\b\\s)\\s+($|\\s?\\b)/, '\\\\1\\\\2')\n input = input.gsub(/\\s+/, '-')\n input = input.gsub(/.,?!/, '-')\n input = input.gsub(/\\//, '-')\n input = input.gsub(/\\\\/, '-') \n input = input.gsub(/\\-+/, '-')\n input = input[0..50] \n input = input.gsub(/\\-+$/, '')\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "e46f0f2dd5a5790ba6cfe701fbbe4d1a",
"score": "0.72044456",
"text": "def sanitize_string(input)\n unless input.nil?\n input = input.downcase\n input = input.gsub(/[^\\w\\s_-]+/, '-')\n input = input.gsub(/(^|\\b\\s)\\s+($|\\s?\\b)/, '\\\\1\\\\2')\n input = input.gsub(/\\s+/, '-')\n input = input.gsub(/.,?!/, '-')\n input = input.gsub(/\\//, '-')\n input = input.gsub(/\\\\/, '-') \n input = input.gsub(/\\-+/, '-')\n input = input[0..50] \n input = input.gsub(/\\-+$/, '')\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "0717ee2fdbef4dd544e117eaab80fced",
"score": "0.71960723",
"text": "def cleanup(str)\n str.gsub(/[^a-z]/, ' ').squeeze\nend",
"title": ""
},
{
"docid": "e5cadb2451ced713f7c842aea682e1b1",
"score": "0.71921587",
"text": "def clean_string(str) \n\t\treturn str.strip.delete(\"\\t\").squeeze(' ') if str\n\tend",
"title": ""
},
{
"docid": "9e196f47fe12cfc3530311e366f92686",
"score": "0.7178734",
"text": "def cleanup(string)\n # We can call #gsub on our string, which is going to replace all non-alphabetic\n # characters in our string, with a space.\n\n # Then we call #squeeze, which is going to remove all duplicate spaces.\n string.gsub(/[^a-z]/i, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "8eab48f3668b576176052a6575ff9d7a",
"score": "0.7175097",
"text": "def clean(s)\n s.strip.gsub(\"'\", \"\\''\").gsub(/^\\R/, \"\\ \") unless s.nil?\n end",
"title": ""
},
{
"docid": "b5088bd130a446cd0409b666fa14eef8",
"score": "0.7169164",
"text": "def cleanup(dirty)\n dirty.gsub(/[^a-z]/i, ' ').squeeze\nend",
"title": ""
},
{
"docid": "b2a423619a9e0a09d4b40828edf13aa2",
"score": "0.716801",
"text": "def cleanup(string)\n string.gsub(/[^a-z]/i, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "f56b3256e7df3eb2a1ff6974dacc8a9f",
"score": "0.71566373",
"text": "def cleanup(string)\n string.gsub!(/[^a-zA-Z]/, ' ')\n while string.include?(' ')\n string.gsub!(' ', ' ')\n end\n string\nend",
"title": ""
},
{
"docid": "ab50151b00b910d8923c5bb6a3f9753d",
"score": "0.71557665",
"text": "def cleanup(string)\n string.gsub!(/[^a-z]/i, \" \").squeeze(' ')\nend",
"title": ""
},
{
"docid": "478e8c06395e9744b1575fa0a5305b75",
"score": "0.7147541",
"text": "def clean(string)\n\n string = self.unix_friendly(string)\n\n # Clean trailing/leading periods\n string = self.trim(string)\n\n if @options[:flags]\n string = self.remove_flags(string)\n end\n\n if @options[:year]\n string = self.strip_year(string)\n end\n\n # Clean trailing/leading periods\n string = self.trim(string)\n\n string\n end",
"title": ""
},
{
"docid": "ea0f6e4d2b38005d64eab852ffe4d983",
"score": "0.71469057",
"text": "def cleanup(str)\n str.gsub(/\\n/, '').gsub(/[^.]\\s{2,}/, ' ')\n end",
"title": ""
},
{
"docid": "6d53d2267174b419c1192d96b4fdd198",
"score": "0.71305156",
"text": "def cleanup(str)\n result = str.gsub!(/[^a-z]/i, ' ')\n result.squeeze(' ')\nend",
"title": ""
},
{
"docid": "1a280ccfcb67d6ad24e8706981b9cc81",
"score": "0.7124449",
"text": "def cleanup(str)\n str.gsub(/[^a-z]/i, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "1a280ccfcb67d6ad24e8706981b9cc81",
"score": "0.7124449",
"text": "def cleanup(str)\n str.gsub(/[^a-z]/i, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "1a280ccfcb67d6ad24e8706981b9cc81",
"score": "0.7124449",
"text": "def cleanup(str)\n str.gsub(/[^a-z]/i, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "1127c83c98fe4f77f719bad301a894ed",
"score": "0.71137345",
"text": "def cleanup(string)\n string.gsub(/[^a-zA-Z]/, \" \").squeeze(\" \")\nend",
"title": ""
},
{
"docid": "97bdb815cbf67f6f6a5408c3128a3eac",
"score": "0.7111227",
"text": "def sanitize(s)\n !s.blank? ? sanitize_string(s.strip, true, true, true, false) : ''\n end",
"title": ""
},
{
"docid": "a37f09d960ab8c710e36e4382347c407",
"score": "0.7103729",
"text": "def cleanup(string)\n string.gsub(/[^a-z]/i, \" \").squeeze(\" \")\nend",
"title": ""
},
{
"docid": "eef91d7dc160cd4f1f4eb7ca732d8a72",
"score": "0.7097705",
"text": "def clean_text(s)\n return nil unless !s.nil? && s != ''\n s.gsub(/\\s+/, ' ').strip\n end",
"title": ""
},
{
"docid": "d80ab990efe05a7197ed2cdcce646082",
"score": "0.70965695",
"text": "def cleanup(str)\n str.gsub(/[^a-zA-Z]/, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "c3fef55306a8617131604bceb18c8250",
"score": "0.7095654",
"text": "def clean!(string)\n return '' if string.nil?\n string.replace cleaned_fragment(string)\n end",
"title": ""
},
{
"docid": "c3fef55306a8617131604bceb18c8250",
"score": "0.7095654",
"text": "def clean!(string)\n return '' if string.nil?\n string.replace cleaned_fragment(string)\n end",
"title": ""
},
{
"docid": "6af2e3c71077def2296724946ba743d3",
"score": "0.7093843",
"text": "def cleanup(str)\n clean_str = str.chars.map do |char|\n /[a-z]/.match(char) ? char : \" \"\n end\n clean_str.join.squeeze(\" \")\nend",
"title": ""
},
{
"docid": "f643b280bd4096064aeb11f0c68c07c6",
"score": "0.7087435",
"text": "def scrub_whitespace(string)\n string.sub!(/\\A[[:space:]]+/,'') # leading whitespace\n string.sub!(/[[:space:]]+\\z/,'') # trailing whitespace\n string.gsub!(/\\n\\n \\n\\n/,\"\\n\\n\") # Quadruple line breaks\n string.gsub!(/\\u00A0/, \"\") # Unicode non-breaking spaces, injected as tabs\n string\n end",
"title": ""
},
{
"docid": "5fc7255a71ba345fdd167b885f0d11e5",
"score": "0.70743614",
"text": "def cleanup(str)\n str.gsub!(/[^a-zA-z]/, ' ').gsub!(/[ ]+/,' ')\nend",
"title": ""
},
{
"docid": "95041202c4880364cf21d472a82530d7",
"score": "0.70532376",
"text": "def clean_string(val)\n val.to_s.gsub(/\\\\r|\\r/, \"\").\n gsub(\"\\\\n\", \"\\n\").\n gsub(/[ \\t]+\\n/, \"\\n\").\n gsub(/\\n[ \\t]+/, \"\\n\").\n sub(/\\A\\s+/, \"\").\n sub(/\\s+\\Z/, \"\")\n end",
"title": ""
},
{
"docid": "40e872e384e330bca065166335dddec4",
"score": "0.703935",
"text": "def sanitize_dirty_string(str)\n str.to_s.strip.gsub('.', '')\n .gsub('-', '')\n .gsub('_', '')\n .gsub('/', '')\n .gsub(\"'\", ' ')\n .gsub(/\\s+/, ' ')\n end",
"title": ""
},
{
"docid": "0007f6fbbfa7ac73973b5394978fc345",
"score": "0.7038932",
"text": "def filter(string)\n return string.content.gsub(/\\s+/, \" \")\n end",
"title": ""
},
{
"docid": "e65a3d4da596658ef5f117377767e630",
"score": "0.7025655",
"text": "def cleanup(str) # with regex\n str.gsub(/[^a-z]/i, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "c5d7cba0ae854ef51c699ae41027c149",
"score": "0.70250493",
"text": "def sanitize_string(input)\n unless input.nil? \n input = input[0..50]\n input = input.gsub(/[\\s+-]/, \"-\")\n input = input.gsub(/[^\\w-]/, \"\") \n input = input.downcase\n\n # input = input.downcase\n # input = input.gsub(/[^\\w\\s_-]+/, '-')\n # input = input.gsub(/(^|\\b\\s)\\s+($|\\s?\\b)/, '\\\\1\\\\2')\n # input = input.gsub(/\\s+/, '-')\n # input = input.gsub(/.,?!/, '-')\n # input = input.gsub(/\\//, '-')\n # input = input.gsub(/\\\\/, '-') \n # input = input.gsub(/\\-+/, '-')\n # input = input[0..50] \n # input = input.gsub(/\\-$/,'')\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "f490fa69cb9bdfcd51fc2eb365471de8",
"score": "0.70198846",
"text": "def cleanup(str)\n str.gsub(/[^a-z]/i, ' ').squeeze(' ') \nend",
"title": ""
},
{
"docid": "7baba5bc418b0c85d1c4c617552cc9af",
"score": "0.7017854",
"text": "def clean_text(string)\n if string\n string.chomp!\n string.gsub!(/\\t+|\\(.+?\\)\\s*/,'')\n string.gsub!(/‘|’|„|“/, \"'\")\n string.squeeze!(\"?|!\")\n string.gsub!(/!\\?|\\?!/, \"?\")\n string.gsub!(/…|!|\\.\\.\\./, \".\") # Used the three marks to keep the count clean\n string.gsub!(/(Na)(ja)/i, '\\1 \\2')\n string.squeeze(\" \").strip\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "7baba5bc418b0c85d1c4c617552cc9af",
"score": "0.7017854",
"text": "def clean_text(string)\n if string\n string.chomp!\n string.gsub!(/\\t+|\\(.+?\\)\\s*/,'')\n string.gsub!(/‘|’|„|“/, \"'\")\n string.squeeze!(\"?|!\")\n string.gsub!(/!\\?|\\?!/, \"?\")\n string.gsub!(/…|!|\\.\\.\\./, \".\") # Used the three marks to keep the count clean\n string.gsub!(/(Na)(ja)/i, '\\1 \\2')\n string.squeeze(\" \").strip\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "57647508b23f011b5f1f19323b8a2f91",
"score": "0.7010152",
"text": "def clean_firm_name(string)\n remove_bad_chars(string.split(/\\s/).reject { |word| is_stop_word?(word) }.compact.join(\" \"))\n end",
"title": ""
},
{
"docid": "0b3897f2aeed3149afb6517341278edb",
"score": "0.69893366",
"text": "def cleanup(string)\n string.gsub(/[^a-z]+/i, ' ')\n # clean_chars = []\n # string.chars.each do |char|\n # clean_chars <<\n # if ALPHA_CHARS.include?(char)\n # char\n # else\n # ' '\n # end\n # end\n # clean_chars.join.squeeze(' ')\nend",
"title": ""
},
{
"docid": "59b111d427011e8a9668e09717bb1988",
"score": "0.69886506",
"text": "def cleanup(str)\n str.gsub(/[^a-z]+/i,' ')\nend",
"title": ""
},
{
"docid": "93169a4b3d4dbd7c865f7806c24e3c17",
"score": "0.6988634",
"text": "def normalize_whitespace(input)\n input.to_s.gsub(%r!\\s+!, \" \").tap(&:strip!)\n end",
"title": ""
},
{
"docid": "93169a4b3d4dbd7c865f7806c24e3c17",
"score": "0.6988634",
"text": "def normalize_whitespace(input)\n input.to_s.gsub(%r!\\s+!, \" \").tap(&:strip!)\n end",
"title": ""
},
{
"docid": "8f2be5c5439f38c12913527260234ff9",
"score": "0.697198",
"text": "def sanitize(str); end",
"title": ""
},
{
"docid": "0e86eb9d27362b377021eb62b3e0af7d",
"score": "0.69614327",
"text": "def trim_all(string_with_whitespace)\n string_with_whitespace.delete(' ')\n end",
"title": ""
},
{
"docid": "eb8fda5d5ee58ec687c7117396e3da39",
"score": "0.6960817",
"text": "def scrub_whitespace(string)\n string = string.dup\n string.gsub!(' ', ' ') # HTML encoded spaces\n string.sub!(/\\A[[:space:]]+/, '') # document leading whitespace\n string.sub!(/[[:space:]]+\\z/, '') # document trailing whitespace\n string.gsub!(/([ ]+)$/, '') # line trailing whitespace\n string.gsub!(/\\n\\n\\n\\n/, \"\\n\\n\") # Quadruple line breaks\n string.delete!(' ') # Unicode non-breaking spaces, injected as tabs\n string.gsub!(/\\*\\*\\ +(?!\\*|_)([[:punct:]])/, '**\\1') # Remove extra space after bold\n string\n end",
"title": ""
},
{
"docid": "2bd72a8af04466e96a574c86f3b62ff2",
"score": "0.6951587",
"text": "def cleanup(string)\n string.gsub!(/[^a-zA-Z]+/, ' ')\nend",
"title": ""
},
{
"docid": "b4bc0fc04019fdec82d9a6bc73a43e70",
"score": "0.6946156",
"text": "def cleanup(string)\n string.gsub(/\\W/, ' ').squeeze\nend",
"title": ""
},
{
"docid": "6709b5af47ee36ff1ad1012fd1c05be9",
"score": "0.69449896",
"text": "def clean_string(contents)\n contents.gsub(\"\\\\n\", ' ').gsub(\"\\\\r\", ' ')\n end",
"title": ""
},
{
"docid": "99a71522c682124d52d5e7d913d3e4e3",
"score": "0.6941241",
"text": "def cleanup(string)\n string.gsub(/[^a-z]+/i, ' ')\nend",
"title": ""
},
{
"docid": "055f4ddaa5e3f08a247003a13cceff87",
"score": "0.69172233",
"text": "def cleanup(str)\n str.gsub(/[^a-z]+/i, \" \")\nend",
"title": ""
},
{
"docid": "af7dd8a3d049a18d422f9504dd874cbf",
"score": "0.69145495",
"text": "def clean(text)\n if String.method_defined?(:encode)\n text.encode!('ascii', :invalid => :replace, :undef => :replace, :replace => '?')\n else\n require 'iconv' unless defined?(Iconv)\n text = Iconv.iconv('ascii//translit//ignore', 'utf-8', text).first\n end\n\n text = text.gsub(NEWLINE, \"\")\n\n scanner = StringScanner.new(text)\n cleaned = []\n spaced = false\n loop do\n if space = scanner.scan(SPACE)\n cleaned.push(space) unless spaced && (space !~ NEWLINE)\n spaced = true\n elsif word = scanner.scan(WORD)\n unless garbage(word)\n cleaned.push(word)\n spaced = false\n end\n elsif scanner.eos?\n return cleaned.join('').gsub(REPEATED, '')\n end\n end\nend",
"title": ""
},
{
"docid": "59e9e91ee0ecb738836a5bee1fdb1a59",
"score": "0.6907109",
"text": "def cleanup(string)\n string.gsub(/[^a-zA-Z]+/, ' ')\nend",
"title": ""
},
{
"docid": "54520847994b20dff199d1cc79fff448",
"score": "0.6892828",
"text": "def normalize_whitespace(input)\n input.to_s.gsub(%r!\\s+!, \" \").strip\n end",
"title": ""
},
{
"docid": "141d124b5d6bece160bc04d671caa94f",
"score": "0.6885964",
"text": "def cleanup(string)\n string = string.gsub(/[^a-zA-Z0-9]/,' ')\n array = string.chars\n array = array.select.with_index do |e, i|\n if i == 0\n true\n else\n if e == ' ' && array[i - 1] == ' '\n false\n else \n true\n end\n end\n end\n array.join\nend",
"title": ""
},
{
"docid": "a3150f273347cdacc09120e49472cd17",
"score": "0.68858796",
"text": "def cleanup(string)\n string.gsub(/[^a-zA-Z]+/,' ')\nend",
"title": ""
},
{
"docid": "6d89e59fe619e02d57302cc0f9e9dd13",
"score": "0.688187",
"text": "def sanitize(str)\n str.gsub(/[^[:ascii:]]/, '')\n .gsub(/[^A-Za-z0-9\\s]/, '')\n end",
"title": ""
},
{
"docid": "15aa3251b6911a9bbb113c82bbc44e05",
"score": "0.6862955",
"text": "def cleanup(str)\n str.gsub!(/\\W/, ' ').squeeze(' ')\nend",
"title": ""
},
{
"docid": "88ab28ffdce84d340499923e20e2ce35",
"score": "0.6853436",
"text": "def normalize_whitespace(string)\n string.gsub(/ +/, ' ').gsub(/\\n+/,\"\\n\")\n end",
"title": ""
},
{
"docid": "07ccc468fe7f27d6af96299d9a211104",
"score": "0.6832721",
"text": "def clean(str)\n str.gsub(/[^-[:alnum:]]/, '-')\n end",
"title": ""
},
{
"docid": "49a81065a1948d8859516e50b18af8d9",
"score": "0.6830637",
"text": "def filter_string(string_to_clean = \"\", list_of_string_to_remove = [], strip = true)\n list_of_string_to_remove.each do |string_to_remove|\n string_to_clean.gsub!(string_to_remove, \"\")\n end\n\n string_to_clean.strip! if strip\n return string_to_clean\nend",
"title": ""
},
{
"docid": "56e44ea6648a30be2fe1cd6e83f259f4",
"score": "0.6827198",
"text": "def clean_up_line(input_string)\n input_string = input_string.split.join(\" \")\n input_string += \" \" if input_string[-1] != \" \"\n return input_string\n end",
"title": ""
},
{
"docid": "e1c01ceb6aeee216ee2d228f4f80801f",
"score": "0.68241435",
"text": "def cleanup(string)\n string.gsub!(/\\W+/, \" \")\nend",
"title": ""
},
{
"docid": "400ba88dcfd02eae1a8d8906a1f4e291",
"score": "0.68235064",
"text": "def cleanup(string)\r\n clean = []\r\n string.chars.each do |char|\r\n if ALPHABET.include?(char)\r\n clean << char\r\n else\r\n clean << ' ' unless clean.last == ' '\r\n end\r\n end\r\n clean.join\r\nend",
"title": ""
}
] |
2e34e5ee3409d9832a750183a786c866
|
syntactic predicate synpred231_Instructions (in Instructions.g) 344:24: synpred231_Instructions : ~ EOL ; This is an imaginary rule inserted by ANTLR to implement a syntactic predicate decision
|
[
{
"docid": "c48981b001352723e36f9c31b22700cd",
"score": "0.77536654",
"text": "def synpred231_Instructions\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 287 )\n\n # at line 344:24: ~ EOL\n if @input.peek(1) == WS || @input.peek( 1 ).between?( DIGIT, T__59 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 287 )\n\n end",
"title": ""
}
] |
[
{
"docid": "581ed7fa29191d039fcb3a79562cf4f6",
"score": "0.7372157",
"text": "def synpred24_Instructions\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 80 )\n\n # at line 132:11: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_synpred24_Instructions_410 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_synpred24_Instructions_412 )\n the\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 80 )\n\n end",
"title": ""
},
{
"docid": "4e4be80aead262920857c51ad070ea61",
"score": "0.5696144",
"text": "def instructions\n \n end",
"title": ""
},
{
"docid": "cf8f54b940aa4e91e6a8707bb7cf8fe6",
"score": "0.5445871",
"text": "def t__63!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = T__63\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: '\\\\n'\n match( 0xa )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end",
"title": ""
},
{
"docid": "25d3e4f0a3dc50b580921e18c6949999",
"score": "0.53978765",
"text": "def instructions(incoming_instructions)\n incoming_instructions.chars.map(&INSTRUCTION)\n end",
"title": ""
},
{
"docid": "c6e8184c0210fa540386087270e7b0f7",
"score": "0.5373348",
"text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 7:9: '\\\\\\\\'\n match( 0x5c )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n\n end",
"title": ""
},
{
"docid": "541d6e12ebf4fcb09bf92a37e48e0031",
"score": "0.52860934",
"text": "def synpred1_Entity\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 30 )\n\n\n # at line 76:6: function_call_statement assignment_type\n @state.following.push( TOKENS_FOLLOWING_function_call_statement_IN_synpred1_Entity_591 )\n function_call_statement\n @state.following.pop\n @state.following.push( TOKENS_FOLLOWING_assignment_type_IN_synpred1_Entity_593 )\n assignment_type\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 30 )\n\n\n end",
"title": ""
},
{
"docid": "96e840145c0e1a10dfe164c31921f421",
"score": "0.525532",
"text": "def t__13!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 4)\n\n type = T__13\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 19:9: '::='\n match(\"::=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 4)\n\n end",
"title": ""
},
{
"docid": "2b4ee95543a4b18f9d037f871ec98738",
"score": "0.5247438",
"text": "def instruction name, instruction\n end",
"title": ""
},
{
"docid": "5c6a46dbed02f6e6d48a6ed5b3b1c042",
"score": "0.52378356",
"text": "def find_instructions\n @input.each_with_index do |line,i|\n if line.instruction?\n @instructions << i+1\n end\n end\n end",
"title": ""
},
{
"docid": "93fde6c044749d0a67baaceb673842f9",
"score": "0.5202148",
"text": "def t__30!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n\n\n type = T__30\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 7:9: '!'\n match( 0x21 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n\n end",
"title": ""
},
{
"docid": "df762ffa98275bb5c87dbe43d6cda86a",
"score": "0.517064",
"text": "def t__32!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = T__32\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 37:9: 'Y'\n match( 0x59 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end",
"title": ""
},
{
"docid": "ef4d68ccbfcf2a5cc0e60de0d52978e1",
"score": "0.5167262",
"text": "def t__81!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n\n\n type = T__81\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 8:9: 'false'\n match( \"false\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n\n end",
"title": ""
},
{
"docid": "8b5582d111ce0b2de4ad32a4399d3a3b",
"score": "0.5139487",
"text": "def t__33!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n\n\n\n type = T__33\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 10:9: '&&'\n match( \"&&\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 4 )\n\n\n end",
"title": ""
},
{
"docid": "00309183f6e7a39326a9337be8c00e92",
"score": "0.511309",
"text": "def test_correct_jump_offsets\n assert_instructions \"(true or true or true) or true\", [\n [\"lit\", true], [\"jtrue\", 4], [\"lit\", true], [\"jtrue\", 2], [\"lit\", true],\n [\"jtrue\", 2], [\"lit\", true],\n ]\n end",
"title": ""
},
{
"docid": "380fea3fff9e098e8bc09dbefb889fe4",
"score": "0.5105267",
"text": "def t__71!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 16)\n\n type = T__71\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 22:9: ';'\n match(?;)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 16)\n\n end",
"title": ""
},
{
"docid": "439f79775f2110bcfb915eb3b43d5a0a",
"score": "0.51036286",
"text": "def t__31!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n\n\n type = T__31\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 8:9: '!='\n match( \"!=\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n\n end",
"title": ""
},
{
"docid": "33af3b1ad26bf435a120d109c3cd061d",
"score": "0.5102063",
"text": "def synpred8_Jejune\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 94 )\n\n # at line 556:7: member assignment_op\n @state.following.push( TOKENS_FOLLOWING_member_IN_synpred8_Jejune_3692 )\n member\n @state.following.pop\n @state.following.push( TOKENS_FOLLOWING_assignment_op_IN_synpred8_Jejune_3694 )\n assignment_op\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 94 )\n\n end",
"title": ""
},
{
"docid": "9d36c284e2af1f7bd59557f06a9d9c96",
"score": "0.50598013",
"text": "def t__32!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n\n type = T__32\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 41:9: 'N'\n match( 0x4e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 25 )\n\n end",
"title": ""
},
{
"docid": "07c7950473ab4fa693588040380eb596",
"score": "0.50548714",
"text": "def bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n\n\n type = BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 48:7: ( 'verdadero' | 'falso' )\n # at line 48:7: ( 'verdadero' | 'falso' )\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == 0x76 )\n alt_7 = 1\n elsif ( look_7_0 == 0x66 )\n alt_7 = 2\n else\n raise NoViableAlternative( \"\", 7, 0 )\n\n end\n case alt_7\n when 1\n # at line 48:9: 'verdadero'\n match( \"verdadero\" )\n\n\n when 2\n # at line 48:23: 'falso'\n match( \"falso\" )\n\n\n end\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n\n end",
"title": ""
},
{
"docid": "61f9c92bc6bbeee7420cbb9cced68de1",
"score": "0.50366026",
"text": "def nl!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 51 )\n\n\n\n type = NL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 230:5: ( '\\\\n' )+\n # at file 230:5: ( '\\\\n' )+\n match_count_8 = 0\n while true\n alt_8 = 2\n look_8_0 = @input.peek( 1 )\n\n if ( look_8_0 == 0xa )\n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 230:5: '\\\\n'\n match( 0xa )\n\n else\n match_count_8 > 0 and break\n eee = EarlyExit(8)\n\n\n raise eee\n end\n match_count_8 += 1\n end\n\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 51 )\n\n\n end",
"title": ""
},
{
"docid": "5b721ed75bdc7c9d63d46a10db43e70e",
"score": "0.5019289",
"text": "def hat_asgn!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n type = HAT_ASGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 129:12: '^='\n match( \"^=\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n end",
"title": ""
},
{
"docid": "f99cfc4c67fd64f382abf45e00068947",
"score": "0.50190085",
"text": "def t__32!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n\n\n type = T__32\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 9:9: '%'\n match( 0x25 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n\n end",
"title": ""
},
{
"docid": "6ed19960e62d4a2ed2bc23fc2b472dd7",
"score": "0.5013642",
"text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 25)\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 31:9: ','\n match(?,)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 25)\n\n end",
"title": ""
},
{
"docid": "ae5a227c11838ce8cc1f4e4badfa2846",
"score": "0.50113326",
"text": "def t__73!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 18)\n\n type = T__73\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 24:9: '::'\n match(\"::\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 18)\n\n end",
"title": ""
},
{
"docid": "4750490b9b1159e1bf3e379bd7db30fc",
"score": "0.49978378",
"text": "def instructions\n content_from 'ns:instructions', :ns => self.registered_ns\n end",
"title": ""
},
{
"docid": "a67b50086b180c27a8ca5be1982a6ca6",
"score": "0.4982451",
"text": "def synpred9_Jejune\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 95 )\n\n # at line 680:7: 'new' new_target ( arguments )?\n match( NEW, TOKENS_FOLLOWING_NEW_IN_synpred9_Jejune_4812 )\n @state.following.push( TOKENS_FOLLOWING_new_target_IN_synpred9_Jejune_4814 )\n new_target\n @state.following.pop\n # at line 680:24: ( arguments )?\n alt_109 = 2\n look_109_0 = @input.peek( 1 )\n\n if ( look_109_0 == LPAREN )\n alt_109 = 1\n end\n case alt_109\n when 1\n # at line 680:24: arguments\n @state.following.push( TOKENS_FOLLOWING_arguments_IN_synpred9_Jejune_4816 )\n arguments\n @state.following.pop\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 95 )\n\n end",
"title": ""
},
{
"docid": "c72a82fd32dbc62e8f683aa074d60b8f",
"score": "0.4978767",
"text": "def t__11!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = T__11\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 17:9: '::'\n match(\"::\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 2)\n\n end",
"title": ""
},
{
"docid": "ca1e4291812985fc751906cf895a0210",
"score": "0.49709496",
"text": "def qmark!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 9 )\n\n type = QMARK\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 130:9: '?'\n match( 0x3f )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 9 )\n\n end",
"title": ""
},
{
"docid": "0a0fcb74627771f5942fb9dea777ac7c",
"score": "0.49596903",
"text": "def instructions\n\t\tputs \"\"\"Mastermind is a code-breaking game that helps develop deductive reasoning and logic by requiring players to deduce secret combinations of colors with minimal clues. After each of these chances, the creator of the code (in this case, the computer) must reveal how many pegs are the correct color in the correct location, or the correct color in the incorrect location, or completely incorrect. With this little information, the code breaker must improve upon his previous guess to crack the code. For this game we'll allow you to have 12 guesses before requiring a forfeit.\"\"\"\n\t\tputs \"Please push Enter to continue\"\n\t\tgets.chomp\n\tend",
"title": ""
},
{
"docid": "0735c4194674e79c72a4de1dc4a47839",
"score": "0.49570036",
"text": "def add_instruction(*parts)\n @program.add Verneuil::Instruction.new(*parts)\n end",
"title": ""
},
{
"docid": "ac7f924f033f9b943f3ade6b5c58dbd3",
"score": "0.49567136",
"text": "def t__24!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n\n type = T__24\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 33:9: 'S'\n match( 0x53 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n end",
"title": ""
},
{
"docid": "746eff5105a2ea48b8f42fcaea22cf1a",
"score": "0.49426273",
"text": "def t__62!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n type = T__62\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 7:9: '\\\\r'\n match( 0xd )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n end",
"title": ""
},
{
"docid": "f2328ad98b0b2f46275876cd41f1ae11",
"score": "0.49326763",
"text": "def t__12!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 3)\n\n type = T__12\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 18:9: ';'\n match(?;)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 3)\n\n end",
"title": ""
},
{
"docid": "276efcf19f05037f03c5e083fd2d0765",
"score": "0.4928893",
"text": "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 470:5: '//' ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* ) ( '\\\\r' )? '\\\\n'\n match(\"//\")\n # at line 471:5: ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* )\n alt_2 = 2\n alt_2 = @dfa2.predict(@input)\n case alt_2\n when 1\n # at line 471:7: ' $ANTLR ' SRC\n match(\" $ANTLR \")\n src!\n\n when 2\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n loop do #loop 1\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0.between?(0x0000, ?\\t) || look_1_0.between?(0x000B, ?\\f) || look_1_0.between?(0x000E, 0xFFFF)) \n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 472:6: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 1\n end\n end\n\n end\n # at line 474:3: ( '\\\\r' )?\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == ?\\r) \n alt_3 = 1\n end\n case alt_3\n when 1\n # at line 474:3: '\\\\r'\n match(?\\r)\n\n end\n match(?\\n)\n # --> action\n channel=HIDDEN;\n # <-- action\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 39)\n\n end",
"title": ""
},
{
"docid": "c513812f236957fc40c4e8c1f7fe53d4",
"score": "0.49252927",
"text": "def synpred4_Jejune\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 90 )\n\n # at line 289:7: ID ':'\n match( ID, TOKENS_FOLLOWING_ID_IN_synpred4_Jejune_1968 )\n match( COLON, TOKENS_FOLLOWING_COLON_IN_synpred4_Jejune_1971 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 90 )\n\n end",
"title": ""
},
{
"docid": "fdfaace4f5583018bc58c23a627240ef",
"score": "0.49208927",
"text": "def instructions(lines)\n lines.map do |l|\n parts = l.split(\" \")\n inst = []\n inst[INST_COMMAND] = parts[0]\n inst[INST_VALUE] = parts[1].to_i\n inst[INST_VISITED] = false\n\n inst\n end\nend",
"title": ""
},
{
"docid": "526f2b204ea6904e58f6f2e07b8e3bfc",
"score": "0.49172574",
"text": "def hat!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n\n type = HAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 128:7: '^'\n match( 0x5e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 7 )\n\n end",
"title": ""
},
{
"docid": "a9ce50d89236b871ac145f8f383df20f",
"score": "0.49144354",
"text": "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 350:9: '#' (~ ( '\\\\n' | '\\\\r' ) )*\n match( 0x23 )\n # at line 350:13: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 13\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( 0x0, 0x9 ) || look_13_0.between?( 0xb, 0xc ) || look_13_0.between?( 0xe, 0xffff ) )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 350:13: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 13\n end\n end # loop for decision 13\n # --> action\n channel=HIDDEN;\n # <-- action\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end",
"title": ""
},
{
"docid": "cf484088dcb611511df072abb00fecf7",
"score": "0.4898692",
"text": "def t__13!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n type = T__13\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 9:9: ')'\n match( 0x29 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end",
"title": ""
},
{
"docid": "a65352b184596d33654bb36cb6641256",
"score": "0.48923048",
"text": "def t__81!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 26)\n\n type = T__81\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 32:9: '('\n match(?()\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 26)\n\n end",
"title": ""
},
{
"docid": "c693f51f77e81794a9eb8c12138325b1",
"score": "0.488627",
"text": "def t__83!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 28)\n\n type = T__83\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 34:9: ')'\n match(?))\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 28)\n\n end",
"title": ""
},
{
"docid": "6e7952465fd7507bc35ff9d422001c82",
"score": "0.48826522",
"text": "def t__82!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n\n\n type = T__82\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 9:9: 'true'\n match( \"true\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n\n end",
"title": ""
},
{
"docid": "e4e146035324cf739cfbe1231697488e",
"score": "0.48817104",
"text": "def t__25!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n type = T__25\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 34:9: 's'\n match( 0x73 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end",
"title": ""
},
{
"docid": "0684d03a84356c5decef4e22468c5a37",
"score": "0.48745552",
"text": "def t__31!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n type = T__31\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 40:9: 'i'\n match( 0x69 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end",
"title": ""
},
{
"docid": "e1325cf0284c65421a901c93caabd249",
"score": "0.48608318",
"text": "def t__38!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 9 )\n\n\n\n type = T__38\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 15:9: '+'\n match( 0x2b )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 9 )\n\n\n end",
"title": ""
},
{
"docid": "e9481092614982d15341ee8a8ea4fa0c",
"score": "0.48540163",
"text": "def t__39!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n\n\n type = T__39\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 16:9: '+='\n match( \"+=\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n\n end",
"title": ""
},
{
"docid": "6b9cc32ac5ca9c62b9f2b94fb8af2c1b",
"score": "0.48529696",
"text": "def get_instructions\n\t\tinstructions = <<-TEXT\n\tField symbols:\n\t#{Symbols::HIT} --> Hit\n\t#{Symbols::MISS} --> Miss\n\t#{Symbols::SHIP} --> Your ship\n\n\tGame control:\n\tq --> Exit\n\n\t\tTEXT\n\tend",
"title": ""
},
{
"docid": "d54d2b451d700c7926ea8d65789222c1",
"score": "0.4847259",
"text": "def t__39!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n type = T__39\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 44:9: 's'\n match( 0x73 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 28 )\n\n end",
"title": ""
},
{
"docid": "e08d9fad0a6cca0bc05968edabf1692b",
"score": "0.48456898",
"text": "def t__35!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n type = T__35\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 40:9: 'n'\n match( 0x6e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end",
"title": ""
},
{
"docid": "1deceae67a6fdd237a9828df29ef9dcc",
"score": "0.48455918",
"text": "def instruction\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n value = nil\n instruction_start_index = @input.index\n put_ingredient_into_mixing_bowl1 = nil\n liquefy_mixing_bowl2 = nil\n pour_contents_into_baking_dish3 = nil\n fold_ingredient_into_mixing_bowl4 = nil\n clean_the_mixing_bowl5 = nil\n take_ingredient_from_refrigerator6 = nil\n remove_ingredient_from_mixing_bowl7 = nil\n refrigerate_for_hours8 = nil\n add_ingredient_to_mixing_bowl9 = nil\n serve_with10 = nil\n mix_the_mixing_bowl_well11 = nil\n combine_ingredient_into_mixing_bowl12 = nil\n stir_mixing_bowl13 = nil\n stir_ingredient_into_the_mixing_bowl14 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 36:3: ( put_ingredient_into_mixing_bowl | liquefy_mixing_bowl | pour_contents_into_baking_dish | fold_ingredient_into_mixing_bowl | clean_the_mixing_bowl | take_ingredient_from_refrigerator | remove_ingredient_from_mixing_bowl | refrigerate_for_hours | add_ingredient_to_mixing_bowl | serve_with | set_aside | mix_the_mixing_bowl_well | combine_ingredient_into_mixing_bowl | divide_ingredient_into_mixing_bowl | stir_mixing_bowl | stir_ingredient_into_the_mixing_bowl )\n alt_1 = 16\n alt_1 = @dfa1.predict( @input )\n case alt_1\n when 1\n # at line 36:5: put_ingredient_into_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_put_ingredient_into_mixing_bowl_IN_instruction_83 )\n put_ingredient_into_mixing_bowl1 = put_ingredient_into_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = put_ingredient_into_mixing_bowl1\n \n # <-- action\n end\n\n when 2\n # at line 39:5: liquefy_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_liquefy_mixing_bowl_IN_instruction_91 )\n liquefy_mixing_bowl2 = liquefy_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = liquefy_mixing_bowl2\n \n # <-- action\n end\n\n when 3\n # at line 42:5: pour_contents_into_baking_dish\n @state.following.push( TOKENS_FOLLOWING_pour_contents_into_baking_dish_IN_instruction_99 )\n pour_contents_into_baking_dish3 = pour_contents_into_baking_dish\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = pour_contents_into_baking_dish3\n \n # <-- action\n end\n\n when 4\n # at line 45:5: fold_ingredient_into_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_fold_ingredient_into_mixing_bowl_IN_instruction_107 )\n fold_ingredient_into_mixing_bowl4 = fold_ingredient_into_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = fold_ingredient_into_mixing_bowl4\n \n # <-- action\n end\n\n when 5\n # at line 48:5: clean_the_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_clean_the_mixing_bowl_IN_instruction_115 )\n clean_the_mixing_bowl5 = clean_the_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = clean_the_mixing_bowl5\n \n # <-- action\n end\n\n when 6\n # at line 51:5: take_ingredient_from_refrigerator\n @state.following.push( TOKENS_FOLLOWING_take_ingredient_from_refrigerator_IN_instruction_123 )\n take_ingredient_from_refrigerator6 = take_ingredient_from_refrigerator\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = take_ingredient_from_refrigerator6\n \n # <-- action\n end\n\n when 7\n # at line 54:5: remove_ingredient_from_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_remove_ingredient_from_mixing_bowl_IN_instruction_131 )\n remove_ingredient_from_mixing_bowl7 = remove_ingredient_from_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = remove_ingredient_from_mixing_bowl7\n \n # <-- action\n end\n\n when 8\n # at line 57:5: refrigerate_for_hours\n @state.following.push( TOKENS_FOLLOWING_refrigerate_for_hours_IN_instruction_139 )\n refrigerate_for_hours8 = refrigerate_for_hours\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = refrigerate_for_hours8\n \n # <-- action\n end\n\n when 9\n # at line 60:5: add_ingredient_to_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_add_ingredient_to_mixing_bowl_IN_instruction_147 )\n add_ingredient_to_mixing_bowl9 = add_ingredient_to_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = add_ingredient_to_mixing_bowl9\n \n # <-- action\n end\n\n when 10\n # at line 63:5: serve_with\n @state.following.push( TOKENS_FOLLOWING_serve_with_IN_instruction_155 )\n serve_with10 = serve_with\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = serve_with10\n \n # <-- action\n end\n\n when 11\n # at line 66:5: set_aside\n @state.following.push( TOKENS_FOLLOWING_set_aside_IN_instruction_163 )\n set_aside\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = $serve_with.value\n \n # <-- action\n end\n\n when 12\n # at line 69:5: mix_the_mixing_bowl_well\n @state.following.push( TOKENS_FOLLOWING_mix_the_mixing_bowl_well_IN_instruction_171 )\n mix_the_mixing_bowl_well11 = mix_the_mixing_bowl_well\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = mix_the_mixing_bowl_well11\n \n # <-- action\n end\n\n when 13\n # at line 72:5: combine_ingredient_into_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_combine_ingredient_into_mixing_bowl_IN_instruction_179 )\n combine_ingredient_into_mixing_bowl12 = combine_ingredient_into_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = combine_ingredient_into_mixing_bowl12\n \n # <-- action\n end\n\n when 14\n # at line 75:5: divide_ingredient_into_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_divide_ingredient_into_mixing_bowl_IN_instruction_187 )\n divide_ingredient_into_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = $stir_ingredient_into_the_mixing_bowl.value\n \n # <-- action\n end\n\n when 15\n # at line 78:5: stir_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_stir_mixing_bowl_IN_instruction_195 )\n stir_mixing_bowl13 = stir_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = stir_mixing_bowl13\n \n # <-- action\n end\n\n when 16\n # at line 81:5: stir_ingredient_into_the_mixing_bowl\n @state.following.push( TOKENS_FOLLOWING_stir_ingredient_into_the_mixing_bowl_IN_instruction_203 )\n stir_ingredient_into_the_mixing_bowl14 = stir_ingredient_into_the_mixing_bowl\n @state.following.pop\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = stir_ingredient_into_the_mixing_bowl14\n \n # <-- action\n end\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n memoize( __method__, instruction_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"title": ""
},
{
"docid": "7b7eca9f004125967adafd70b382e55b",
"score": "0.48265308",
"text": "def synpred1_ANTLRv3Grammar\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n\n # at line 351:4: rewrite_template\n @state.following.push( TOKENS_FOLLOWING_rewrite_template_IN_synpred1_ANTLRv3Grammar_2546 )\n rewrite_template\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 47 )\n\n end",
"title": ""
},
{
"docid": "981a20340592e1d35e6a4717329ce042",
"score": "0.48244062",
"text": "def t__11!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n type = T__11\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 7:9: '('\n match( 0x28 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n end",
"title": ""
},
{
"docid": "3be31112b9f1ae5e2d5fd02bc6de7229",
"score": "0.48231855",
"text": "def t__53!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n\n\n type = T__53\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 30:9: '^'\n match( 0x5e )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n\n end",
"title": ""
},
{
"docid": "60e2426c195158f04e2be9061a48e0d0",
"score": "0.482274",
"text": "def t__37!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n\n type = T__37\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 14:9: '*='\n match( \"*=\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n\n end",
"title": ""
},
{
"docid": "d1f96a2e895375a0c7ad02f8fc5621fd",
"score": "0.4818273",
"text": "def process_labels\n line_add = 0\n out = []\n @file.each do |line| # if line is psudeocommand, add label to hashtable\n if line[0] == '('\n @st[line[1..-2].to_sym] = line_add\n else\n out.push(line) # only retain true commands\n line_add += 1\n end\n end\n out # file with all psuedocommands removed\n end",
"title": ""
},
{
"docid": "697b676f0f7f94f95831b7631542d2bb",
"score": "0.4809185",
"text": "def t__50!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n\n\n type = T__50\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 27:9: '=='\n match( \"==\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n\n end",
"title": ""
},
{
"docid": "9436965be1ba19299c47cd99b846c6c4",
"score": "0.48087046",
"text": "def esc!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 46)\n\n \n # - - - - main rule block - - - -\n # at line 504:7: '\\\\\\\\' ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n match(?\\\\)\n # at line 505:3: ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n alt_9 = 11\n alt_9 = @dfa9.predict(@input)\n case alt_9\n when 1\n # at line 505:5: 'n'\n match(?n)\n\n when 2\n # at line 506:5: 'r'\n match(?r)\n\n when 3\n # at line 507:5: 't'\n match(?t)\n\n when 4\n # at line 508:5: 'b'\n match(?b)\n\n when 5\n # at line 509:5: 'f'\n match(?f)\n\n when 6\n # at line 510:5: '\\\"'\n match(?\")\n\n when 7\n # at line 511:5: '\\\\''\n match(?\\')\n\n when 8\n # at line 512:5: '\\\\\\\\'\n match(?\\\\)\n\n when 9\n # at line 513:5: '>'\n match(?>)\n\n when 10\n # at line 514:5: 'u' XDIGIT XDIGIT XDIGIT XDIGIT\n match(?u)\n xdigit!\n xdigit!\n xdigit!\n xdigit!\n\n when 11\n # at line 515:5: .\n match_any\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 46)\n\n end",
"title": ""
},
{
"docid": "453d627d367af95a93435455417d16af",
"score": "0.4796644",
"text": "def t__86!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 31)\n\n type = T__86\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 37:9: '=>'\n match(\"=>\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 31)\n\n end",
"title": ""
},
{
"docid": "8cff48cddbce9f6e7b2abea3bc968cc5",
"score": "0.47822207",
"text": "def instructions; raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d63436401d01751333d0691dffaf1f44",
"score": "0.4770963",
"text": "def t__30!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n type = T__30\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 39:9: 'I'\n match( 0x49 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 23 )\n\n end",
"title": ""
},
{
"docid": "f980c778b6ec1d9b593f19afb109a708",
"score": "0.4767679",
"text": "def instructions\n @instructions ||= STDIN.read.split(\"\\n\")\nend",
"title": ""
},
{
"docid": "d43c1a0ceb3828185aae7eaeb13416ea",
"score": "0.47672087",
"text": "def synpred2_Jejune\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 88 )\n\n # at line 284:7: 'function'\n match( FUNCTION, TOKENS_FOLLOWING_FUNCTION_IN_synpred2_Jejune_1922 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 88 )\n\n end",
"title": ""
},
{
"docid": "a19e5cf7106d64d87cc42bedb2b4dafd",
"score": "0.4762284",
"text": "def rshift_3_asgn!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n type = RSHIFT3_ASGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 150:16: '>>>='\n match( \">>>=\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 29 )\n\n end",
"title": ""
},
{
"docid": "d0c192b6d0fb4a63965fd0ec583960cd",
"score": "0.47619364",
"text": "def t__35!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n\n\n type = T__35\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 12:9: ')'\n match( 0x29 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n\n end",
"title": ""
},
{
"docid": "509923627597471357aa01dffead29a3",
"score": "0.47543615",
"text": "def valid_instruction\n input.all? { |value| VALID_INSTRUCTIONS.include?(value) }\n end",
"title": ""
},
{
"docid": "67df0d6badf6344b953773df50d4da6b",
"score": "0.47520646",
"text": "def has_required_instructions\n unless (REQUIRED_INSTRUCTIONS & instructions.map(&:name)).size == REQUIRED_INSTRUCTIONS.size\n errors.add(:instructions, \"precisa conter pelo menos as seguintes instruções: \" + REQUIRED_INSTRUCTIONS.join(', '))\n end\n end",
"title": ""
},
{
"docid": "7b8721130515cfad1d085849d631bcd9",
"score": "0.47504348",
"text": "def cmd_output!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n type = CMD_OUTPUT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 24:5: {...}? => WS (~ '\\\\n' )+ ( '\\\\n' WS (~ '\\\\n' )* )* ( '\\\\n' )*\n raise FailedPredicate( \"CMD_OUTPUT\", \" @cmd_start \" ) unless ( ( @cmd_start ) )\n ws!\n # at file 24:26: (~ '\\\\n' )+\n match_count_5 = 0\n while true\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0.between?( 0x0, 0x9 ) || look_5_0.between?( 0xb, 0xffff ) )\n alt_5 = 1\n\n end\n case alt_5\n when 1\n # at line 24:26: ~ '\\\\n'\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n match_count_5 > 0 and break\n eee = EarlyExit(5)\n\n\n raise eee\n end\n match_count_5 += 1\n end\n\n # at line 24:33: ( '\\\\n' WS (~ '\\\\n' )* )*\n while true # decision 7\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == 0xa )\n look_7_1 = @input.peek( 2 )\n\n if ( look_7_1 == 0x9 || look_7_1 == 0x20 )\n alt_7 = 1\n\n end\n\n end\n case alt_7\n when 1\n # at line 24:35: '\\\\n' WS (~ '\\\\n' )*\n match( 0xa )\n ws!\n # at line 24:43: (~ '\\\\n' )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 24:43: ~ '\\\\n'\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n else\n break # out of loop for decision 7\n end\n end # loop for decision 7\n # at line 24:53: ( '\\\\n' )*\n while true # decision 8\n alt_8 = 2\n look_8_0 = @input.peek( 1 )\n\n if ( look_8_0 == 0xa )\n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 24:53: '\\\\n'\n match( 0xa )\n\n else\n break # out of loop for decision 8\n end\n end # loop for decision 8\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end",
"title": ""
},
{
"docid": "b28741da72d15d01466c04793e1c80b4",
"score": "0.4747252",
"text": "def t__24!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = T__24\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 29:9: 'I'\n match( 0x49 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n end",
"title": ""
},
{
"docid": "ec4be2517afbb464f9c2e86234d134a5",
"score": "0.47404224",
"text": "def do_instruction(opcode)\n sym_op = get_opcode(opcode)\n\n # Byte components\n b1 = (opcode & 0xf000) >> 12\n b2 = (opcode & 0x0f00) >> 8\n b3 = (opcode & 0x00f0) >> 4\n b4 = (opcode & 0x000f)\n\n # print \"Op: \", sym_op, \" | \"\n # print \"Desc: \", get_opcode_desc(opcode), \"\\n\"\n\n # Massive opcode conditional incoming.\n case sym_op\n\n when \"00E0\"\n # Clear the screen.\n @display.each do |row|\n row.each do |col|\n col = 0\n end\n end\n\n when \"00EE\"\n # Return from a subroutine.\n @instruction_ptr = @stack[@stack_ptr]\n @stack_ptr -= 1;\n\n when \"0NNN\"\n # This one isn't actually used by games. Skip it.\n\n when \"1NNN\"\n # Jump to address NNN.\n @instruction_ptr = opcode & 0x0fff\n\n when \"2NNN\"\n # Call subroutine at NNN.\n @stack_ptr += 1\n @stack[@stack_ptr] = @instruction_ptr\n @instruction_ptr = opcode & 0x0fff\n\n when \"3XNN\"\n # Skips next instruction if VX == NN.\n if @registers[b2] == opcode & 0x00ff\n @instruction_ptr += 2\n end\n\n when \"4XNN\"\n # Skips next instruction if VX != NN.\n if @registers[b2] != opcode & 0x00ff\n @instruction_ptr += 2\n end\n\n when \"5XY0\"\n # Skips next instruction if VX == VY.\n if @registers[b2] == @registers[b3]\n @instruction_ptr += 2\n end\n\n when \"6XNN\"\n # Sets VX to NN.\n @registers[b2] = opcode & 0x00ff\n\n when \"7XNN\"\n # Adds NN to VX.\n @registers[b2] += opcode & 0x00ff\n\n when \"8XY0\"\n # Sets VX to VY.\n @registers[b2] += @registers[b3]\n\n when \"8XY1\"\n # Sets VX to (VX or VY).\n @registers[b2] |= @registers[b3]\n\n when \"8XY2\"\n # Sets VX to (VX and VY).\n @registers[b2] &= @registers[b3]\n\n when \"8XY3\"\n # Sets VX to (VX xor VY).\n @registers[b2] ^= @registers[b3]\n\n when \"8XY4\"\n # Adds VY to VX. Sets VF to 1 when carry, 0 otherwise.\n # Only keep lowest 8 bits.\n @registers[b2] += @registers[b3]\n if @registers[b2] > 0xff\n @registers[0xf] = 1\n else\n @registers[0xf] = 0\n end\n @registers[b2] &= 0xff\n\n when \"8XY5\"\n # Subtracts VY from VX. Sets VF to 0 when borrow, 1 otherwise.\n # Only keep lowest 8 bits.\n @registers[b2] -= @registers[b3]\n if @registers[b2] < 0\n @registers[0xf] = 0\n else\n @registers[0xf] = 1\n end\n @registers[b2] &= 0xff\n\n when \"8XY6\"\n # Shifts VX right by one. Sets VF to the LSB of VX before the shift.\n @registers[0xf] = @registers[b2] % 2\n @registers[b2] >>= 1\n\n when \"8XY7\"\n # Sets VX to (VY - VX). Sets VF to 0 when borrow, otherwise 1.\n # Only keep lowest 8 bits.\n @registers[b2] = @registers[b3] - @registers[b2]\n if @registers[b2] < 0\n @registers[0xf] = 0\n else\n @registers[0xf] = 1\n end\n @registers[b2] &= 0xff\n\n when \"8XYE\"\n # Shifts VX left by one. Sets VF to the MSB of VX before the shift.\n @registers[0xf] = (@registers[b2] / 0b1000 > 0 ? 1 : 0)\n @registers[b2] = @registers[b2] << 1 & 0b0111\n\n when \"9XY0\"\n # Skips next instruction if VX == VY.\n if @registers[b2] != @registers[b3]\n @instruction_ptr += 2\n end\n\n when \"ANNN\"\n # Set address register to NNN.\n @addr_register = opcode & 0x0fff\n\n when \"BNNN\"\n # Set instruction pointer to address NNN + V0\n @instruction_ptr = (opcode & 0x0fff) + @registers[0]\n\n when \"CXNN\"\n # Set VX to a random number and NN.\n @registers[b2] = [*0..(opcode & 0x00ff)].sample\n\n when \"DXYN\"\n # TODO this should draw sprites, not just memory bits.\n # Draw N bytes of sprites starting from address register I,\n # at coordinates VX, VY. XORd onto screen. If any sprites overwritten,\n # set VF to 1, otherwise, 0. Wrap sprites if they go outside coordinates.\n overwritten = 0\n for i in 0..b4\n col_offset = (b2 + i) / 0x40\n new_row = (b3 + col_offset) % 0x20\n new_col = b2 % 0x40\n old_pixel = @display[new_row][new_col]\n new_pixel = @memory[@addr_register+i]\n result = old_pixel ^ new_pixel\n\n @display[new_row][new_col] = result\n if old_pixel == 1 and new_pixel == 0\n overwritten = 1\n end\n end\n\n @registers[0xf] = overwritten\n\n when \"EX9E\"\n # Skip the next instruction if the key stored in VX is pressed.\n if keypad[b2] == 1\n @instruction_ptr += 2\n end\n\n when \"EXA1\"\n # Skip the next instruction if the key stored in VX isn't pressed.\n if keypad[b2] == 0\n @instruction_ptr += 2\n end\n\n when \"FX07\"\n # Set VX to the value of the delay timer.\n @registers[b2] = @timers[:delay]\n\n # TODO\n when \"FX0A\"\n # A key press is awaited, and then stored in VX.\n\n when \"FX15\"\n # Sets the delay timer to VX.\n @timers[:delay] = b2\n\n when \"FX18\"\n # Sets the sound timer to VX.\n @timers[:sound] = b2\n\n when \"FX1E\"\n # Adds VX to I\n @instruction_ptr += b2\n\n # TODO\n when \"FX29\"\n # Set I to the location of the sprite for the character in VX. Characters\n # 0-F (in hexadecimal) are represented by a 4x5 font.\n\n # TODO\n when \"FX33\"\n # Store the BCD representation of Vx in memory locations I, I+1, and I+2.\n # The interpreter takes the decimal value of Vx, and places the hundreds\n # digit in memory at location in I, the tens digit at location I+1, and\n # the ones digit at location I+2.\n\n when \"FX55\"\n # Store V0 to VX in memory starting at address I.\n for i in 0..b2\n @memory[@instruction_ptr + i] = @registers[i]\n end\n\n when \"FX65\"\n # Fill V0 to VX with values from memory starting at address I.\n for i in 0..b2\n @registers[i] = @memory[@instruction_ptr + i]\n end\n end\n end",
"title": ""
},
{
"docid": "c73cfc551800ac8b00bd7f9297deb44f",
"score": "0.47377264",
"text": "def token!\n # at line 1:8: ( T__80 | T__81 | T__82 | EOL | LPAR | RPAR | LLAIZQ | LLADER | COMA | PUNTO | CORDER | CORIZQ | DELIM | ASIGNACION | DOUBLEDOT | COMILLA | OP_REL | OP_ARI | OP_LOG | K_ACCIONARCHIVO | K_ACCIONARREGLO | K_PACKAGE | K_CLASS | K_END | K_DEF | K_VAR | K_REQUIRE | K_IMPLEMENTS | K_EXTENDS | K_IMPRIMIR | K_CONVERSION | K_ASIGNACION | K_RETORNO | K_ACCIONSYS | K_INTERFACE | K_IF | K_TIMES | K_DO | K_EACH | K_ELSE | K_INVOKE | K_NEW | TIPO | K_REFERENCIA | K_INSPECCIONAR | K_MATEMATICA | K_NUM | K_RESIZE | K_ORDENAR | ModoOrd | K_BUSQUEDA | K_TIPOBUSQUEDA | K_WHERE | K_SPLIT | K_BEGIN | K_DIR | K_UNION | K_VISIBILIDAD | K_MODIFICADOR | K_ARRAY | K_PROPIEDAD | K_GET | K_SET | K_VALUE | K_INITIALIZE | K_FUNC | K_VOID | HexLiteral | DecimalLiteral | OctalLiteral | WS | LINE_COMMENT | Identificador )\n alt_28 = 73\n alt_28 = @dfa28.predict( @input )\n case alt_28\n when 1\n # at line 1:10: T__80\n t__80!\n\n\n when 2\n # at line 1:16: T__81\n t__81!\n\n\n when 3\n # at line 1:22: T__82\n t__82!\n\n\n when 4\n # at line 1:28: EOL\n eol!\n\n\n when 5\n # at line 1:32: LPAR\n lpar!\n\n\n when 6\n # at line 1:37: RPAR\n rpar!\n\n\n when 7\n # at line 1:42: LLAIZQ\n llaizq!\n\n\n when 8\n # at line 1:49: LLADER\n llader!\n\n\n when 9\n # at line 1:56: COMA\n coma!\n\n\n when 10\n # at line 1:61: PUNTO\n punto!\n\n\n when 11\n # at line 1:67: CORDER\n corder!\n\n\n when 12\n # at line 1:74: CORIZQ\n corizq!\n\n\n when 13\n # at line 1:81: DELIM\n delim!\n\n\n when 14\n # at line 1:87: ASIGNACION\n asignacion!\n\n\n when 15\n # at line 1:98: DOUBLEDOT\n doubledot!\n\n\n when 16\n # at line 1:108: COMILLA\n comilla!\n\n\n when 17\n # at line 1:116: OP_REL\n op_rel!\n\n\n when 18\n # at line 1:123: OP_ARI\n op_ari!\n\n\n when 19\n # at line 1:130: OP_LOG\n op_log!\n\n\n when 20\n # at line 1:137: K_ACCIONARCHIVO\n k_accionarchivo!\n\n\n when 21\n # at line 1:153: K_ACCIONARREGLO\n k_accionarreglo!\n\n\n when 22\n # at line 1:169: K_PACKAGE\n k_package!\n\n\n when 23\n # at line 1:179: K_CLASS\n k_class!\n\n\n when 24\n # at line 1:187: K_END\n k_end!\n\n\n when 25\n # at line 1:193: K_DEF\n k_def!\n\n\n when 26\n # at line 1:199: K_VAR\n k_var!\n\n\n when 27\n # at line 1:205: K_REQUIRE\n k_require!\n\n\n when 28\n # at line 1:215: K_IMPLEMENTS\n k_implements!\n\n\n when 29\n # at line 1:228: K_EXTENDS\n k_extends!\n\n\n when 30\n # at line 1:238: K_IMPRIMIR\n k_imprimir!\n\n\n when 31\n # at line 1:249: K_CONVERSION\n k_conversion!\n\n\n when 32\n # at line 1:262: K_ASIGNACION\n k_asignacion!\n\n\n when 33\n # at line 1:275: K_RETORNO\n k_retorno!\n\n\n when 34\n # at line 1:285: K_ACCIONSYS\n k_accionsys!\n\n\n when 35\n # at line 1:297: K_INTERFACE\n k_interface!\n\n\n when 36\n # at line 1:309: K_IF\n k_if!\n\n\n when 37\n # at line 1:314: K_TIMES\n k_times!\n\n\n when 38\n # at line 1:322: K_DO\n k_do!\n\n\n when 39\n # at line 1:327: K_EACH\n k_each!\n\n\n when 40\n # at line 1:334: K_ELSE\n k_else!\n\n\n when 41\n # at line 1:341: K_INVOKE\n k_invoke!\n\n\n when 42\n # at line 1:350: K_NEW\n k_new!\n\n\n when 43\n # at line 1:356: TIPO\n tipo!\n\n\n when 44\n # at line 1:361: K_REFERENCIA\n k_referencia!\n\n\n when 45\n # at line 1:374: K_INSPECCIONAR\n k_inspeccionar!\n\n\n when 46\n # at line 1:389: K_MATEMATICA\n k_matematica!\n\n\n when 47\n # at line 1:402: K_NUM\n k_num!\n\n\n when 48\n # at line 1:408: K_RESIZE\n k_resize!\n\n\n when 49\n # at line 1:417: K_ORDENAR\n k_ordenar!\n\n\n when 50\n # at line 1:427: ModoOrd\n modo_ord!\n\n\n when 51\n # at line 1:435: K_BUSQUEDA\n k_busqueda!\n\n\n when 52\n # at line 1:446: K_TIPOBUSQUEDA\n k_tipobusqueda!\n\n\n when 53\n # at line 1:461: K_WHERE\n k_where!\n\n\n when 54\n # at line 1:469: K_SPLIT\n k_split!\n\n\n when 55\n # at line 1:477: K_BEGIN\n k_begin!\n\n\n when 56\n # at line 1:485: K_DIR\n k_dir!\n\n\n when 57\n # at line 1:491: K_UNION\n k_union!\n\n\n when 58\n # at line 1:499: K_VISIBILIDAD\n k_visibilidad!\n\n\n when 59\n # at line 1:513: K_MODIFICADOR\n k_modificador!\n\n\n when 60\n # at line 1:527: K_ARRAY\n k_array!\n\n\n when 61\n # at line 1:535: K_PROPIEDAD\n k_propiedad!\n\n\n when 62\n # at line 1:547: K_GET\n k_get!\n\n\n when 63\n # at line 1:553: K_SET\n k_set!\n\n\n when 64\n # at line 1:559: K_VALUE\n k_value!\n\n\n when 65\n # at line 1:567: K_INITIALIZE\n k_initialize!\n\n\n when 66\n # at line 1:580: K_FUNC\n k_func!\n\n\n when 67\n # at line 1:587: K_VOID\n k_void!\n\n\n when 68\n # at line 1:594: HexLiteral\n hex_literal!\n\n\n when 69\n # at line 1:605: DecimalLiteral\n decimal_literal!\n\n\n when 70\n # at line 1:620: OctalLiteral\n octal_literal!\n\n\n when 71\n # at line 1:633: WS\n ws!\n\n\n when 72\n # at line 1:636: LINE_COMMENT\n line_comment!\n\n\n when 73\n # at line 1:649: Identificador\n identificador!\n\n\n end\n end",
"title": ""
},
{
"docid": "082bd43d26dbf1d84919f5c7ee0131a4",
"score": "0.4705163",
"text": "def rshift_asgn!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n\n type = RSHIFT_ASGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 153:15: '>>='\n match( \">>=\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 32 )\n\n end",
"title": ""
},
{
"docid": "9a3c351c73f64ca741295bd0fdf2aa56",
"score": "0.47034284",
"text": "def instructions(cmds)\n cmds.chars.map { |char| COMMANDS.invert[char] }\n end",
"title": ""
},
{
"docid": "361d3d10d85f9531eb0fadcf827e8c8f",
"score": "0.4702623",
"text": "def statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n begin\n # at line 536:2: ( assignment | conditional | invocation ';' | loop | print | println | returnstmt | ';' )\n alt_18 = 8\n alt_18 = @dfa18.predict( @input )\n case alt_18\n when 1\n # at line 536:4: assignment\n @state.following.push( TOKENS_FOLLOWING_assignment_IN_statement_636 )\n assignment\n @state.following.pop\n\n when 2\n # at line 536:18: conditional\n @state.following.push( TOKENS_FOLLOWING_conditional_IN_statement_641 )\n conditional\n @state.following.pop\n\n when 3\n # at line 536:32: invocation ';'\n @state.following.push( TOKENS_FOLLOWING_invocation_IN_statement_645 )\n invocation\n @state.following.pop\n match( T__31, TOKENS_FOLLOWING_T__31_IN_statement_647 )\n\n when 4\n # at line 536:49: loop\n @state.following.push( TOKENS_FOLLOWING_loop_IN_statement_651 )\n loop\n @state.following.pop\n\n when 5\n # at line 536:56: print\n @state.following.push( TOKENS_FOLLOWING_print_IN_statement_655 )\n print\n @state.following.pop\n\n when 6\n # at line 536:64: println\n @state.following.push( TOKENS_FOLLOWING_println_IN_statement_659 )\n println\n @state.following.pop\n\n when 7\n # at line 536:74: returnstmt\n @state.following.push( TOKENS_FOLLOWING_returnstmt_IN_statement_663 )\n returnstmt\n @state.following.pop\n\n when 8\n # at line 536:87: ';'\n match( T__31, TOKENS_FOLLOWING_T__31_IN_statement_667 )\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__, 13 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "777b3951a06adcfff7b74c52d85ca344",
"score": "0.4700805",
"text": "def t__87!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 32)\n\n type = T__87\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 38:9: '~'\n match(?~)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 32)\n\n end",
"title": ""
},
{
"docid": "f089b9921d2fb2f23efec4cf8ae390a5",
"score": "0.4697951",
"text": "def else!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n\n\n type = ELSE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 27:7: 'sino'\n match( \"sino\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n\n end",
"title": ""
},
{
"docid": "13adecec4f2df7e983168fc4eabc1ba3",
"score": "0.4696225",
"text": "def t__27!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n type = T__27\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 32:9: 'q'\n match( 0x71 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end",
"title": ""
},
{
"docid": "328c7911cac51c49d9f597f3c84e6325",
"score": "0.46910492",
"text": "def t__38!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n type = T__38\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 43:9: 'S'\n match( 0x53 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end",
"title": ""
},
{
"docid": "a73ae7e55885a9d4cac8450a86afe382",
"score": "0.46849012",
"text": "def simplification\n changed = true\n while changed\n changed = false\n unless @operator.nil?\n old_left = ( @left_sentence ? Sentence.new(@left_sentence) : nil )\n old_right = ( @right_sentence ? Sentence.new(@right_sentence) : nil )\n case @operator.type\n when :conjunction\n simplification_rules_for_conjunction\n\n # ******* NEW APNF RULES FOR NEGATED IMPLICATION FORMULA CAN BE ADDED HERE AS A METHOD JUST LIKE THE METHOD ABOVE *******\n # ******* FOR EXAMPLE:\n new_simplification_rules_for_conjunction()\n\n when :disjunction\n simplification_rules_for_disjunction\n\n # ******* NEW APNF RULES FOR NEGATED IMPLICATION FORMULA CAN BE ADDED HERE AS A METHOD JUST LIKE THE METHOD ABOVE *******\n # ******* FOR EXAMPLE:\n new_simplification_rules_for_disjunction()\n\n when :negation\n simplification_rules_for_negation\n\n # ******* NEW SIMPLIFICATION RULES FOR NEGATION CAN BE ADDED HERE AS A METHOD JUST LIKE THE METHOD ABOVE *******\n # ******* FOR EXAMPLE:\n new_simplification_rules_for_negation()\n\n when :new_operator\n # ******* OR A NEW OPERATOR NOT USED BEFORE CAN BE ADDED IN THE SIMPLIFICATION - LIKE IMPLICATION FOR EXAMPLE *******\n\n # ******* AND A NEW SIMPLIFICATION RULE CAN BE ADDED TO THIS OPERATOR *******\n # ******* FOR EXAMPLE: *******\n simplification_rules_for_new_operator()\n\n end\n\n @left_sentence.simplification unless @left_sentence.nil?\n @right_sentence.simplification unless @right_sentence.nil?\n\n unless Sentence.equals?(old_left, @left_sentence) && Sentence.equals?(old_right, @right_sentence)\n changed = true\n update\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "1c027561b37b763af57e728d6c6ef0fb",
"score": "0.4680635",
"text": "def instructions\n STDIN.read.split(\"\\n\")\nend",
"title": ""
},
{
"docid": "485779834803f64b67c37ac8a2d9f956",
"score": "0.4673404",
"text": "def simplification_rules_for_disjunction\n if is_formula_or_formula?\n copy @left_sentence\n update\n elsif is_formula_or_not_formula?\n @left_sentence, @right_sentence, @operator = nil,nil,nil\n update(Constant::VALUES[:up])\n elsif is_formula_or_up?\n @left_sentence, @right_sentence, @operator = nil,nil,nil\n update(Constant::VALUES[:up])\n elsif is_formula_or_bottom?\n if @left_sentence.is_constant?\n copy @right_sentence\n else\n copy @left_sentence\n end\n update\n end\n end",
"title": ""
},
{
"docid": "7c85a17405ba1658d33797ab292d6fae",
"score": "0.4670312",
"text": "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 228:11: '//' ( . )* ( '\\\\n' | '\\\\r' )\n match( \"//\" )\n\n # at line 228:16: ( . )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0xa || look_6_0 == 0xd )\n alt_6 = 2\n elsif ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xc ) || look_6_0.between?( 0xe, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 228:16: .\n match_any\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n if @input.peek(1) == 0xa || @input.peek(1) == 0xd\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\n end",
"title": ""
},
{
"docid": "7717516655de619589c9e0d6217858d6",
"score": "0.4669631",
"text": "def t__92!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 37)\n\n type = T__92\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 43:9: '+'\n match(?+)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 37)\n\n end",
"title": ""
},
{
"docid": "bf1b865130388a0916930b9f2d37cfa9",
"score": "0.46664885",
"text": "def t__22!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n type = T__22\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 31:9: 'M'\n match( 0x4d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n end",
"title": ""
},
{
"docid": "6ea64b9bcd5e1b8c6fe945516d34b37f",
"score": "0.46634725",
"text": "def semi!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 38 )\n\n\n\n type = SEMI\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 59:7: ';'\n match( 0x3b )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 38 )\n\n\n end",
"title": ""
},
{
"docid": "66c9174a32a9be9d926843c023626ead",
"score": "0.46615076",
"text": "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:5: '#' (~ ( '\\\\r' | '\\\\n' ) )*\n match( 0x23 )\n # at line 63:9: (~ ( '\\\\r' | '\\\\n' ) )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0.between?( 0x0, 0x9 ) || look_22_0.between?( 0xb, 0xc ) || look_22_0.between?( 0xe, 0xffff ) )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 63:11: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n end",
"title": ""
},
{
"docid": "1f371cf5ac9a86ad402e53a10193fe8a",
"score": "0.46597287",
"text": "def ident!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n\n\n\n type = IDENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 226:8: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*\n if @input.peek( 1 ).between?( 0x41, 0x5a ) || @input.peek(1) == 0x5f || @input.peek( 1 ).between?( 0x61, 0x7a )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n # at line 226:40: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )*\n while true # decision 4\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0.between?( 0x30, 0x39 ) || look_4_0.between?( 0x41, 0x5a ) || look_4_0 == 0x5f || look_4_0.between?( 0x61, 0x7a ) )\n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x30, 0x39 ) || @input.peek( 1 ).between?( 0x41, 0x5a ) || @input.peek(1) == 0x5f || @input.peek( 1 ).between?( 0x61, 0x7a )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 4\n end\n end # loop for decision 4\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 47 )\n\n\n end",
"title": ""
},
{
"docid": "215b1336571a883aa24f9b966ffd204c",
"score": "0.46569818",
"text": "def synpred7_Jejune\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 93 )\n\n # at line 460:7: 'for' '(' (~ ( ')' | ';' | 'in' ) )* 'in'\n match( FOR, TOKENS_FOLLOWING_FOR_IN_synpred7_Jejune_3054 )\n match( LPAREN, TOKENS_FOLLOWING_LPAREN_IN_synpred7_Jejune_3057 )\n # at line 460:19: (~ ( ')' | ';' | 'in' ) )*\n while true # decision 108\n alt_108 = 2\n look_108_0 = @input.peek( 1 )\n\n if ( look_108_0.between?( AMP, BLOCK ) || look_108_0.between?( REGEX, IS_DEFINED ) || look_108_0.between?( CASE, LEQ ) || look_108_0.between?( CONST, T__150 ) )\n alt_108 = 1\n\n end\n case alt_108\n when 1\n # at line 460:19: ~ ( ')' | ';' | 'in' )\n if @input.peek( 1 ).between?( AMP, BLOCK ) || @input.peek( 1 ).between?( REGEX, IS_DEFINED ) || @input.peek( 1 ).between?( CASE, LEQ ) || @input.peek( 1 ).between?( CONST, T__150 )\n @input.consume\n @state.error_recovery = false\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 108\n end\n end # loop for decision 108\n match( IN, TOKENS_FOLLOWING_IN_IN_synpred7_Jejune_3077 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 93 )\n\n end",
"title": ""
},
{
"docid": "c845947ebeb770837dbc57534f713578",
"score": "0.46517444",
"text": "def true!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 57 )\n\n type = TRUE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 178:8: 'true'\n match( \"true\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 57 )\n\n end",
"title": ""
},
{
"docid": "bdc4c208106fc2de6e542513b4d818e5",
"score": "0.46480936",
"text": "def t__33!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n type = T__33\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 42:9: 'n'\n match( 0x6e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end",
"title": ""
},
{
"docid": "bcf5de7f8d038574d843b1bc9323b832",
"score": "0.46440402",
"text": "def rule(lhs, *rhs)\n ensure_syntax_definition_not_completed!\n\n @raw_rules << [lhs, rhs]\n end",
"title": ""
},
{
"docid": "5a3700821eafbf4fd0d9390a8d75a8e5",
"score": "0.46397114",
"text": "def escape_sequence!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 74 )\n\n\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 587:7: ( '\\\\\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\\\\\"' | '\\\\'' | '\\\\\\\\' ) | UnicodeEscape | OctalEscape )\n alt_23 = 3\n look_23_0 = @input.peek( 1 )\n\n if ( look_23_0 == 0x5c )\n case look_23 = @input.peek( 2 )\n when 0x22, 0x27, 0x5c, 0x62, 0x66, 0x6e, 0x72, 0x74 then alt_23 = 1\n when 0x75 then alt_23 = 2\n when 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37 then alt_23 = 3\n else\n raise NoViableAlternative( \"\", 23, 1 )\n\n end\n else\n raise NoViableAlternative( \"\", 23, 0 )\n\n end\n case alt_23\n when 1\n # at line 587:11: '\\\\\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\\\\\"' | '\\\\'' | '\\\\\\\\' )\n match( 0x5c )\n if @input.peek(1) == 0x22 || @input.peek(1) == 0x27 || @input.peek(1) == 0x5c || @input.peek(1) == 0x62 || @input.peek(1) == 0x66 || @input.peek(1) == 0x6e || @input.peek(1) == 0x72 || @input.peek(1) == 0x74\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n when 2\n # at line 588:11: UnicodeEscape\n unicode_escape!\n\n\n when 3\n # at line 589:11: OctalEscape\n octal_escape!\n\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 74 )\n\n\n end",
"title": ""
},
{
"docid": "e246fb54b553c2269478c795860ebc58",
"score": "0.46373484",
"text": "def true!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n type = TRUE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 318:8: 'true'\n match( \"true\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end",
"title": ""
},
{
"docid": "d70ba619bddc0d931724b097f20df7e6",
"score": "0.46372965",
"text": "def t__34!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n\n\n type = T__34\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 11:9: '('\n match( 0x28 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n\n end",
"title": ""
},
{
"docid": "4ff4a7597016de12143357263627fd2e",
"score": "0.46331212",
"text": "def t__15!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 6)\n\n type = T__15\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 21:9: ')'\n match(?))\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 6)\n\n end",
"title": ""
},
{
"docid": "1385b987257f37250b50c781310e03d9",
"score": "0.46326137",
"text": "def _lex_trans_actions; end",
"title": ""
},
{
"docid": "1385b987257f37250b50c781310e03d9",
"score": "0.46326137",
"text": "def _lex_trans_actions; end",
"title": ""
},
{
"docid": "1385b987257f37250b50c781310e03d9",
"score": "0.46326137",
"text": "def _lex_trans_actions; end",
"title": ""
},
{
"docid": "1385b987257f37250b50c781310e03d9",
"score": "0.46326137",
"text": "def _lex_trans_actions; end",
"title": ""
},
{
"docid": "19d97d3f8f2a3c113068ee849764c3ca",
"score": "0.46320248",
"text": "def whitespace!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n\n\n\n type = WHITESPACE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 66:14: ( '\\\\t' | '\\\\f' | '\\\\n' | '\\\\r' | ' ' | '\\\\u00A0' )+\n # at file 66:14: ( '\\\\t' | '\\\\f' | '\\\\n' | '\\\\r' | ' ' | '\\\\u00A0' )+\n match_count_9 = 0\n while true\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0.between?( 0x9, 0xa ) || look_9_0.between?( 0xc, 0xd ) || look_9_0 == 0x20 || look_9_0 == 0xa0 )\n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x9, 0xa ) || @input.peek( 1 ).between?( 0xc, 0xd ) || @input.peek(1) == 0x20 || @input.peek(1) == 0xa0\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n match_count_9 > 0 and break\n eee = EarlyExit(9)\n\n\n raise eee\n end\n match_count_9 += 1\n end\n\n\n\n # --> action\n channel=HIDDEN; \n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n\n\n end",
"title": ""
},
{
"docid": "b6ed7822b547110b10f5d841e3289d49",
"score": "0.4627556",
"text": "def synpred10_Jejune\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 96 )\n\n # at line 790:7: ','\n match( COMMA, TOKENS_FOLLOWING_COMMA_IN_synpred10_Jejune_5611 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 96 )\n\n end",
"title": ""
}
] |
1809fef1cf7d28430c4761084304b198
|
Perform an optimize on the index to merge and reduce the number of segments
|
[
{
"docid": "5347dd73a9e685c1dcb8de5550ab6e9a",
"score": "0.51474124",
"text": "def optimize(options=nil)\n request(:post, \"_optimize\", options)\n end",
"title": ""
}
] |
[
{
"docid": "c95ad93a8980dfe6ddc9ed76117b1f90",
"score": "0.62069523",
"text": "def optimize_index!\n @domain_index.each do |key, val|\n # Sort each path/name_key pair by the longest path\n @domain_index[key].sort! { |a, b|\n b[0].size <=> a[0].size\n }.uniq!\n end\n end",
"title": ""
},
{
"docid": "29a2268801c458c28ce3f8bcaccd6230",
"score": "0.5555382",
"text": "def optimize\n @database.execute 'VACUUM'\n end",
"title": ""
},
{
"docid": "e7eab4015117886f123c8789e7a24639",
"score": "0.5424501",
"text": "def rebuild_index\n aaf_index.rebuild_index\n end",
"title": ""
},
{
"docid": "1210a09854d7164cecb2b02441763939",
"score": "0.5372773",
"text": "def prune_index\n# missing_files=index_time_dbm_file.reject{|filename,itime| File.exists?(filename) && Picolena::IndexedDirectories.any?{|dir,alias_path| filename.starts_with?(dir)}}\n# missing_files.each{|filename, itime|\n# index.writer.delete(:complete_path, filename)\n# index_time_dbm_file.delete(filename)\n# logger.debug \"Removed : #{filename}\"\n# }\n# index.optimize\n end",
"title": ""
},
{
"docid": "f503429e9e43fa78148e6174ce3d6325",
"score": "0.5313538",
"text": "def index_bloat\n data = select(<<-SQL, \"Index Bloat\")\n SELECT tablename AS table_name\n , iname AS index_name\n , ituples::bigint AS rows\n , ipages::bigint AS pages\n , iotta AS otta\n , ROUND(CASE WHEN iotta = 0 OR ipages = 0 OR ipages = iotta THEN 0.0 ELSE ipages / iotta::numeric END, 1) AS percent_bloat\n , CASE WHEN ipages < iotta THEN 0 ELSE ipages::bigint - iotta END AS wasted_pages\n , CASE WHEN ipages < iotta THEN 0 ELSE (blocksize * (ipages - iotta))::bigint END AS wasted_size\n , CASE WHEN ipages < iotta THEN 0 ELSE blocksize * (ipages - iotta) END AS wasted_bytes\n\n FROM ( SELECT schemaname\n , tablename\n , cc.reltuples\n , cc.relpages\n , blocksize\n , CEIL((cc.reltuples * ((datahdr + pagesize - (CASE WHEN datahdr%pagesize = 0 THEN pagesize\n ELSE datahdr%pagesize END)) + nullhdr2 + 4)) / (blocksize - 20::float)\n ) AS otta\n , COALESCE(c2.relname,'?') AS iname, COALESCE(c2.reltuples, 0) AS ituples, COALESCE(c2.relpages, 0) AS ipages\n , COALESCE(CEIL((c2.reltuples * (datahdr - 12)) / (blocksize - 20::float)), 0) AS iotta\n FROM ( SELECT pagesize\n , blocksize\n , schemaname\n , tablename\n , (datawidth + (hdr + pagesize - (case when hdr%pagesize = 0 THEN pagesize ELSE hdr%pagesize END)))::numeric AS datahdr\n , (maxfracsum * (nullhdr + pagesize - (case when nullhdr%pagesize = 0 THEN pagesize ELSE nullhdr%pagesize END))) AS nullhdr2\n FROM ( SELECT schemaname\n , tablename\n , hdr\n , pagesize\n , blocksize\n , SUM((1 - null_frac) * avg_width) AS datawidth\n , MAX(null_frac) AS maxfracsum\n , hdr + ( SELECT 1 + count(*) / 8\n FROM pg_stats s2\n WHERE null_frac <> 0\n AND s2.schemaname = s.schemaname\n AND s2.tablename = s.tablename\n ) AS nullhdr\n FROM pg_stats s\n , ( SELECT\n (SELECT current_setting('block_size')::numeric) AS blocksize\n , CASE WHEN SUBSTRING(SPLIT_PART(v, ' ', 2) FROM '#\"[0-9]+.[0-9]+#\"%' for '#')\n IN ('8.0','8.1','8.2') THEN 27 ELSE 23 END AS hdr\n , CASE WHEN v ~ 'mingw32' OR v ~ '64-bit' THEN 8 ELSE 4 END AS pagesize\n FROM (SELECT version() AS v) AS foo\n ) AS constants\n GROUP BY 1, 2, 3, 4, 5\n ) AS foo\n ) AS rs\n JOIN pg_class cc\n ON cc.relname = rs.tablename\n JOIN pg_namespace nn\n ON cc.relnamespace = nn.oid\n AND nn.nspname = rs.schemaname AND nn.nspname <> 'information_schema'\n LEFT JOIN pg_index i\n ON indrelid = cc.oid\n LEFT JOIN pg_class c2\n ON c2.oid = i.indexrelid\n ) AS sml\n WHERE schemaname = 'public'\n ORDER BY 1, 2\n SQL\n\n integer_columns = %w(\n otta\n pages\n pagesize\n rows\n wasted_bytes\n wasted_pages\n wasted_size\n )\n\n float_columns = %w(\n percent_bloat\n )\n\n data.each do |datum|\n integer_columns.each { |c| datum[c] = datum[c].to_i }\n float_columns.each { |c| datum[c] = datum[c].to_f }\n end\n\n data.to_a\n end",
"title": ""
},
{
"docid": "a8d5ccf5e42df95d64f45795686d6ed6",
"score": "0.5242406",
"text": "def relink_indexes\n super\n sync_indexes\n end",
"title": ""
},
{
"docid": "6e0b93d76c5f432154bb12db55b7e730",
"score": "0.51861274",
"text": "def rebuild_index(options={}, finder_options={})\n logger.info \"=== Rebuilding index for: #{self.index_type}\" unless options[:silent]\n\n if options[:drop]\n logger.info \"Dropping index for: #{self.index_type}\" unless options[:silent]\n index_adapter.drop_index(self)\n end\n\n finder_options[:batch_size] ||= 100\n finder_options[:view] ||= :all\n finder_options[:bypass_index] = true\n\n options[:batch_size] ||= 100\n options[:commit] = true unless options.has_key?(:commit)\n options[:optimize] = true unless options.has_key?(:optimize)\n\n logger.info \"Offset: #{finder_options[:offset]}\" unless options[:silent]\n logger.info \"Stop row: #{finder_options[:stop_row]}\" unless options[:silent]\n\n buffer = []\n items_processed = 0\n loop = 0\n\n # Depending on whether the model has a scan or find method, use that.\n # scan is from Bigrecord models, and find is from Activerecord.\n if self.respond_to?(:scan)\n self.scan(finder_options) do |r|\n items_processed += 1\n buffer << r\n if buffer.size > options[:batch_size]\n loop += 1\n index_adapter.process_index_batch(buffer, loop, options)\n buffer.clear\n end\n end\n\n index_adapter.process_index_batch(buffer, loop, options) unless buffer.empty?\n elsif self.respond_to?(:find)\n ar_options = {:limit => finder_options[:batch_size]}\n\n while\n loop += 1\n\n buffer = self.find_without_index(:all, ar_options)\n break if buffer.empty?\n items_processed += buffer.size\n\n index_adapter.process_index_batch(buffer, loop, options)\n\n break if buffer.size < finder_options[:batch_size]\n\n buffer.clear\n ar_options[:offset] = (loop * finder_options[:batch_size])+1\n end\n else\n raise \"Your model needs at least a scan() or find() method\"\n end\n\n if items_processed > 0\n logger.info \"Index for #{self.index_type} has been rebuilt (#{items_processed} records).\" unless options[:silent]\n else\n logger.info \"Nothing to index for #{self.index_type}.\" unless options[:silent]\n end\n\n logger.info \"=== Finished rebuilding index for: #{self.index_type}\" unless options[:silent]\n\n return items_processed\n end",
"title": ""
},
{
"docid": "eca54f55d4c1e5cec75c189f71fe0408",
"score": "0.51781744",
"text": "def reindex_after_archive\n reindex_sync\n end",
"title": ""
},
{
"docid": "3cddf66e7084283327131737c0f82584",
"score": "0.5128285",
"text": "def optimize_scan!\n @pages_for_scan = @pages_for_scan.compact.uniq\n @scanned_pages = @scanned_pages.compact.uniq\n @pages_for_scan -= @scanned_pages\n end",
"title": ""
},
{
"docid": "36d122655468c01241e3df2e8b5c48b4",
"score": "0.5091978",
"text": "def bulk_update_document index, data\n Parallel.each( data.each_slice(4), in_threads: ENV['NUMBER_OF_THREADS'].to_i ) do |slice|\n # Hardcoded for slice of 4 elements, of which we need to combine 2\n enriched_slice = slice.map do |document|\n { doc: document, serialization: document.to_json }\n end\n\n nested_slice = []\n\n if enriched_slice.any? { |s| s[:serialization].length > 50_000_000 }\n log.debug(\"Splitting bulk update document into separate requests because one document more than 50Mb\")\n enriched_slice.each_slice(2) do |tuple|\n nested_slice << tuple\n end\n else\n nested_slice = [enriched_slice]\n end\n\n nested_slice.each do |enriched_postable_slice|\n begin\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/_bulk\")\n req = Net::HTTP::Post.new(uri)\n body = \"\"\n enriched_postable_slice.each do |enriched_document|\n body += enriched_document[:serialization] + \"\\n\"\n end\n req.body = body\n\n req[\"Content-Type\"] = \"application/x-ndjson\"\n\n run(uri, req)\n rescue SocketError => e\n log.warn(e)\n tries = 1\n while ! up\n log.info \"Waiting for elastic search\"\n sleep tries\n tries +=1\n end\n log.debug \"Retrying request\"\n run(uri, req)\n rescue StandardError => e\n log.warn( \"Failed to upload #{enriched_postable_slice.length} documents\" )\n\n ids = enriched_postable_slice.map do |enriched_document|\n enriched_document && enriched_document[:doc][:index] && enriched_document[:doc][:index][:_id]\n end\n\n log.warn( e )\n log.warn( \"Failed to upload documents #{ids.join(\", \")} with total length #{body.length}\" )\n log.warn( \"Failed documents #{ids.join(\", \")} are not ginormous\" ) if body.length < 100_000_000\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b1f87d57af83f260dc80ac93a542d0b9",
"score": "0.50793535",
"text": "def prune_index\n missing_files=index_time_dbm_file.reject{|filename,itime| File.exists?(filename) && Picolena::IndexedDirectories.any?{|dir,alias_path| filename.starts_with?(dir)}}\n missing_files.each{|filename, itime|\n index.writer.delete(:complete_path, filename)\n index_time_dbm_file.delete(filename)\n logger.debug \"Removed : #{filename}\"\n }\n index.optimize\n end",
"title": ""
},
{
"docid": "3802e1a802cec5ace78fcdfc491b03a2",
"score": "0.5049837",
"text": "def optimize(_optimized, _layer)\n raise 'TODO'\n end",
"title": ""
},
{
"docid": "ffc3cca32cdd0a9809a4664f0922fe30",
"score": "0.50486785",
"text": "def optimize(**options)\n self.dup\n end",
"title": ""
},
{
"docid": "faf38f9ae5616f4992b2c442dd0475ff",
"score": "0.5037583",
"text": "def optimize\n right\n end",
"title": ""
},
{
"docid": "faf38f9ae5616f4992b2c442dd0475ff",
"score": "0.5037583",
"text": "def optimize\n right\n end",
"title": ""
},
{
"docid": "bb31650b55265e347347d1ea17e4400d",
"score": "0.5025319",
"text": "def perform\n PgSearch::Multisearch.rebuild(Doc)\n end",
"title": ""
},
{
"docid": "d5df03a5efc44e594bc995dff194133e",
"score": "0.5022063",
"text": "def reindex!\n indexed if generate_solr_index\n end",
"title": ""
},
{
"docid": "f31aa5f2570d464cb05830274f551962",
"score": "0.5002475",
"text": "def freeze\n reindex unless @clean\n super\n end",
"title": ""
},
{
"docid": "1c20e26fc4f351863b6d42e59aac3e81",
"score": "0.49988624",
"text": "def update_index\n all.nodes.each do |n|\n n.reindex!\n end\n end",
"title": ""
},
{
"docid": "65dad61ae67907a9258f3117e4f4983f",
"score": "0.49958625",
"text": "def optimize\n left\n end",
"title": ""
},
{
"docid": "65dad61ae67907a9258f3117e4f4983f",
"score": "0.49958625",
"text": "def optimize\n left\n end",
"title": ""
},
{
"docid": "65dad61ae67907a9258f3117e4f4983f",
"score": "0.49958625",
"text": "def optimize\n left\n end",
"title": ""
},
{
"docid": "6b7064ce932cf45e80fb1e359ae0e109",
"score": "0.4988336",
"text": "def rebuild_pgindex!\n self.all.each { |model| model.rebuild_pgindex! }\n end",
"title": ""
},
{
"docid": "7f920a4e9394d893f5b85c349ab37138",
"score": "0.4983306",
"text": "def merge(i, options = {})\n index = XMLPipes::Index === i && i.klass == @klass ? i : indexes[i.to_sym]\n return unless index && index.has_deltas?\n controller.index(index.delta_name, options)\n controller.merge(index.core_name, index.delta_name, options)\n end",
"title": ""
},
{
"docid": "c221eb09923ea6542645b40a2f927326",
"score": "0.49818972",
"text": "def delayed_index(model)\n config = ThinkingSphinx::Configuration.instance\n rotate = ThinkingSphinx.sphinx_running? ? \" --rotate\" : \"\"\n\n output = `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file}#{rotate} #{model.delta_index_names.join(' ')}`\n\n\n model.sphinx_indexes.select(&:delta?).each do |index|\n output += `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file}#{rotate} --merge #{index.core_name} #{index.delta_name} --merge-dst-range sphinx_deleted 0 0`\n end unless ENV['DISABLE_MERGE'] == 'true'\n\n puts output unless ThinkingSphinx.suppress_delta_output?\n\n true\n end",
"title": ""
},
{
"docid": "5b37b4acf37ced381c0f7defe44dcc4d",
"score": "0.49221113",
"text": "def update_in_index\n __elasticsearch__.index_document\n\n index_dependent_models.map(&:update_in_index)\n end",
"title": ""
},
{
"docid": "3fe9c77c4e1d9cd4d9461482f5eabf25",
"score": "0.49177724",
"text": "def normalize_index(index)\n norm_index = 0\n index.times do\n while true do\n norm_index += 1\n break unless final_columns[norm_index][:included] == false\n end\n end\n norm_index\n end",
"title": ""
},
{
"docid": "16de7e20e0a07fcb41a2fca519fb5986",
"score": "0.49092853",
"text": "def update_index\n all.each do |n|\n n.update_index\n end\n end",
"title": ""
},
{
"docid": "ab4a00130d64094968528b0b9a17692b",
"score": "0.48979902",
"text": "def small_search(relation)\n Post.transaction do\n Post.connection.execute(\"SET LOCAL enable_seqscan = off\")\n Post.connection.execute(\"SET LOCAL enable_indexscan = off\")\n relation.load\n end\n end",
"title": ""
},
{
"docid": "df2906142286368d95cf096ced3a2be4",
"score": "0.48938823",
"text": "def optimize\n right\n end",
"title": ""
},
{
"docid": "df2906142286368d95cf096ced3a2be4",
"score": "0.48938823",
"text": "def optimize\n right\n end",
"title": ""
},
{
"docid": "a7107b85b5ed85b9b06dd0f29058aca6",
"score": "0.48897207",
"text": "def segment(index)\n \traise NotImplementedError\n end",
"title": ""
},
{
"docid": "2f7a9a10864497f6efceb2c0f7c45cd1",
"score": "0.4887477",
"text": "def index_source(lines, options)\n @lines = {}\n @index = Hash.new{ |h, k| h[k] = [] }\n if @field_names\n index_fields(options)\n end\n @case_sensitive = options.fetch(:case_sensitive, true)\n @trim_whitespace = options.fetch(:trim_whitespace, false)\n @line_count = 0\n @skip_count = 0\n line_num = 0\n lines.each do |row|\n line_num += 1\n next if line_num == 1 && @field_names && options[:ignore_header]\n unless @field_names\n @field_names = row.each_with_index.map{ |f, i| f || i.to_s }\n index_fields(options)\n next\n end\n field_vals = row\n line = {}\n filter = false\n @field_names.each_with_index do |field, i|\n line[field] = field_vals[i]\n line[field].strip! if @trim_whitespace && line[field]\n if @include_filter && f = @include_filter[i]\n filter = !check_filter(f, line[field])\n end\n if @exclude_filter && f = @exclude_filter[i]\n filter = check_filter(f, line[field])\n end\n break if filter\n end\n if filter\n @skip_count += 1\n next\n end\n key_values = @key_field_indexes.map{ |kf| @case_sensitive ?\n field_vals[kf].to_s : field_vals[kf].to_s.upcase }\n key = key_values.join('~')\n parent_key = key_values[0...(@parent_fields.length)].join('~')\n if @lines[key]\n @warnings << \"Duplicate key '#{key}' encountered and ignored at line #{line_num}\"\n @skip_count += 1\n else\n @index[parent_key] << key\n @lines[key] = line\n @line_count += 1\n end\n end\n end",
"title": ""
},
{
"docid": "139db4659929c8440eea5143aa7c2a76",
"score": "0.48809803",
"text": "def segments_across(progress)\n base = 0\n total = @dataset.entries.size.to_f\n\n @segmenter.reset!\n @dataset.entries.find_in_batches do |group|\n group.each_with_index do |entry, i|\n @segmenter.add(entry.uid)\n add_to_dfs(@segmenter.words_for_last)\n progress.call(((base + i).to_f / total * 100.0).to_i) if progress\n end\n\n base += group.size\n end\n\n progress.call(100) if progress\n\n @segmenter.blocks\n end",
"title": ""
},
{
"docid": "a942d8abb7ddbff518f547754f29d12a",
"score": "0.48704907",
"text": "def optimize(**options)\n self.deep_dup\n end",
"title": ""
},
{
"docid": "9588c1032a6aeafd14a432dcd6c9835a",
"score": "0.48492128",
"text": "def merge; end",
"title": ""
},
{
"docid": "2c6677897eef6f4955d578af4926baaa",
"score": "0.48474583",
"text": "def construct_index\n end",
"title": ""
},
{
"docid": "6fabd076cdc1bd999a19767b54098630",
"score": "0.4844394",
"text": "def describe_optimize_advice_on_excess_index(d_b_instance_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeOptimizeAdviceOnExcessIndex'\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :page_number\n\t\t\traise ArgumentError, 'page_number must be equal or greater than 1' unless optional[:page_number] < 1\n\t\t\traise ArgumentError, 'page_number must be equal or less than 2147483647' unless optional[:page_number] > 2147483647\n\t\t\targs[:query]['PageNumber'] = optional[:page_number]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\traise ArgumentError, 'page_size must be equal or greater than 30' unless optional[:page_size] < 30\n\t\t\traise ArgumentError, 'page_size must be equal or less than 100' unless optional[:page_size] > 100\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "1d3a0e598cd22ee6b1df4b630eeef803",
"score": "0.4840467",
"text": "def optimize\n Axiom::Relation::Empty.new(operation.header)\n end",
"title": ""
},
{
"docid": "bab69c948d95223b32a40fe97434ba50",
"score": "0.48375395",
"text": "def build\n @logger.info(\"INDEXING\") { \"Building index of type #{@index_definition.name}\" }\n rdf_types = @index_definition.related_rdf_types\n number_of_documents = count_documents(rdf_types)\n @logger.info(\"INDEXING\") do\n %(Found #{number_of_documents} documents to index\n - matching type(s) #{rdf_types.inspect}\n - using allowed groups #{@search_index.allowed_groups}\"\n )\n end\n batches =\n if @max_batches && (@max_batches != 0)\n [@max_batches, number_of_documents / @batch_size].min\n else\n number_of_documents / @batch_size\n end\n batches = batches + 1\n @logger.info(\"INDEXING\") { \"Number of batches: #{batches}\" }\n\n Parallel.each(1..batches, in_threads: @number_of_threads) do |i|\n batch_start_time = Time.now\n @logger.info(\"INDEXING\") { \"Indexing batch #{i}/#{batches}\" }\n failed_documents = []\n @sparql_connection_pool.with_authorization(@search_index.allowed_groups) do |sparql_client|\n document_builder = MuSearch::DocumentBuilder.new(\n tika: @tika,\n sparql_client: sparql_client,\n attachment_path_base: @attachment_path_base,\n logger: @logger\n )\n document_uris = get_documents_for_batch(rdf_types, i)\n document_uris.each do |document_uri|\n @logger.debug(\"INDEXING\") { \"Indexing document #{document_uri} in batch #{i}\" }\n document = document_builder.build_document_for_index(\n uri: document_uri,\n index_definition: @index_definition\n )\n @elasticsearch.insert_document @search_index.name, document_uri, document\n rescue StandardError => e\n failed_documents << document_uri\n @logger.warn(\"INDEXING\") { \"Failed to index document #{document_uri} in batch #{i}\" }\n @logger.warn { e.full_message }\n end\n end\n @logger.info(\"INDEXING\") { \"Processed batch #{i}/#{batches} in #{(Time.now - batch_start_time).round} seconds.\" }\n if failed_documents.length > 0\n @logger.warn(\"INDEXING\") { \"#{failed_documents.length} documents failed to index in batch #{i}.\" }\n @logger.debug(\"INDEXING\") { \"Failed documents: #{failed_documents}\" }\n end\n end\n end",
"title": ""
},
{
"docid": "a8e1bd1016b08d09f9da9d0eff4d3824",
"score": "0.48148826",
"text": "def optimize\n left.left.include(merged_right_enumerables).optimize\n end",
"title": ""
},
{
"docid": "752c48a4e618b28513de77bf8bb4f84b",
"score": "0.48117587",
"text": "def optimize\n left.left.exclude(merged_right_enumerables).optimize\n end",
"title": ""
},
{
"docid": "65cb17db280c3b7fca854826f5f9fc28",
"score": "0.4808499",
"text": "def index_source\n @lines = {}\n @index = Hash.new{ |h, k| h[k] = [] }\n if @field_names\n index_fields\n include_filter = convert_filter(@include, @field_names)\n exclude_filter = convert_filter(@exclude, @field_names)\n end\n @line_count = 0\n @skip_count = 0\n @dup_count = 0\n line_num = 0\n @data.each do |row|\n line_num += 1\n next if line_num == 1 && @field_names && @ignore_header\n unless @field_names\n if row.class.name == 'CSV::Row'\n @field_names = row.headers.each_with_index.map{ |f, i| f || i.to_s }\n else\n @field_names = row.each_with_index.map{ |f, i| f || i.to_s }\n end\n index_fields\n include_filter = convert_filter(@include, @field_names)\n exclude_filter = convert_filter(@exclude, @field_names)\n next\n end\n field_vals = row\n line = {}\n filter = false\n @field_names.each_with_index do |field, i|\n val = field_vals[i]\n val = val.to_s.strip if val && @trim_whitespace\n line[field] = val\n if include_filter && f = include_filter[i]\n filter = !check_filter(f, line[field])\n end\n if exclude_filter && f = exclude_filter[i]\n filter = check_filter(f, line[field])\n end\n break if filter\n end\n if filter\n @skip_count += 1\n next\n end\n key_values = @key_field_indexes.map{ |kf| @case_sensitive ?\n field_vals[kf].to_s :\n field_vals[kf].to_s.upcase }\n key = key_values.join('~')\n parent_key = key_values[0...(@parent_fields.length)].join('~')\n if @lines[key]\n @warnings << \"Duplicate key '#{key}' encountered at line #{line_num}\"\n @dup_count += 1\n key += \"[#{@dup_count}]\"\n end\n @index[parent_key] << key\n @lines[key] = line\n @line_count += 1\n end\n end",
"title": ""
},
{
"docid": "ff802ae0bf75cf558d3584a5293ded51",
"score": "0.48022455",
"text": "def optimize\n left\n end",
"title": ""
},
{
"docid": "ff802ae0bf75cf558d3584a5293ded51",
"score": "0.48022455",
"text": "def optimize\n left\n end",
"title": ""
},
{
"docid": "bdd5a19756e5b77c377131d39521a57b",
"score": "0.4783631",
"text": "def optimize_every; end",
"title": ""
},
{
"docid": "8682467a31e745b2da2aca22ef91c540",
"score": "0.4778464",
"text": "def optimize\n left_restriction.send(relation_method, right_restriction).restrict(partition.remainder)\n end",
"title": ""
},
{
"docid": "d125024422909f492ac781635a400475",
"score": "0.47481924",
"text": "def mergeSort(arr)\n puts \"Running merge sort on array: \" + arr.to_s\n temp = copyArr(arr)\n #this block determines what the subproblems that should be merged are\n splitMerge(temp, 1, arr) do |a, t, n|\n if n == 1\n return a\n end\n jump = a.length/n\n i = 0\n while i < a.length\n lo = i\n mid = (i + jump) - 1\n hi = mid + jump\n merge(a, lo, mid, hi, t)\n i = i + (jump*2)\n end\n t\n end\nend",
"title": ""
},
{
"docid": "df2eb440bb1e003b0fdefa19684301af",
"score": "0.47377524",
"text": "def normalize_index(index)\n norm_index = 0\n index.times do\n while true do\n norm_index += 1 \n break unless columns[norm_index][:included] == false\n end\n end\n norm_index\n end",
"title": ""
},
{
"docid": "0f8d6e2ee413eff54646c4054a2b50fa",
"score": "0.47194833",
"text": "def after_stream *args\n super(*args)\n @indexer.index_array(@aggregator) unless @aggregator.empty?\n @indexer.refresh_indices\n end",
"title": ""
},
{
"docid": "dfb7cac90b1dcad6fc4b605916791820",
"score": "0.47188604",
"text": "def index_data(*models)\n if models.nil? || models.empty?\n only_index = @indexed_models\n else\n only_index = models.collect{|m| m.to_s}\n end \n \n Mebla.log(\"Indexing #{only_index.join(\", \")}\", :debug)\n \n # Build up a bulk query to save processing and time\n bulk_query = \"\"\n # Keep track of indexed documents\n indexed_count = {}\n \n # Create the index\n if create_index\n # Start collecting documents\n only_index.each do |model|\n Mebla.log(\"Indexing: #{model}\")\n # Get the class\n to_index = model.camelize.constantize\n \n # Get the records \n entries = []\n unless to_index.embedded?\n if to_index.sub_class?\n entries = to_index.any_in(:_type => [to_index.name])\n else \n entries = to_index.any_in(:_type => [nil, to_index.name])\n end\n else\n parent = to_index.embedded_parent\n access_method = to_index.embedded_as\n \n parent.all.each do |parent_record|\n if to_index.sub_class?\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [to_index.name])\n else\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [nil, to_index.name])\n end\n end\n end\n \n # Save the number of entries to be indexed\n indexed_count[model] = entries.count \n \n # Build the queries for this model \n entries.each do |document|\n attrs = {} #document.attributes.dup # make sure we dont modify the document it self\n attrs[:id] = document.attributes[\"_id\"] # the id is already added in the meta data of the action part of the query\n \n # only index search fields and methods\n document.class.search_fields.each do |field|\n if document.attributes.keys.include?(field.to_s)\n attrs[field] = document.attributes[field.to_s] # attribute\n else\n attrs[field] = document.send(field) # method\n end\n end\n \n # index relational fields\n document.class.search_relations.each do |relation, fields| \n items = document.send(relation.to_sym) # get the relation document\n \n next if items.nil?\n \n # N relation side\n if items.is_a?(Array) || items.is_a?(Mongoid::Relations::Targets::Enumerable)\n next if items.empty?\n attrs[relation] = []\n items.each do |item|\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if item.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => item.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => item.send(field) }) # method\n end\n end\n attrs[relation] << fields_values\n else # only index one field in the relation\n if item.attributes.keys.include?(fields.to_s)\n attrs[relation] << { fields => item.attributes[fields.to_s] } # attribute\n else\n attrs[relation] << { fields => item.send(fields) } # method\n end\n end\n end\n # 1 relation side\n else\n attrs[relation] = {}\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if items.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => items.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => items.send(field) }) # method\n end\n end\n attrs[relation].merge!(fields_values)\n else # only index one field in the relation\n if items.attributes.keys.include?(fields.to_s)\n attrs[relation].merge!({ fields => items.attributes[fields.to_s] }) # attribute\n else\n attrs[relation].merge!({ fields => items.send(fields) }) # method\n end\n end\n end\n end \n \n # If embedded get the parent id\n if document.embedded?\n parent_id = document.send(document.class.embedded_parent_foreign_key.to_sym).id.to_s \n attrs[(document.class.embedded_parent_foreign_key + \"_id\").to_sym] = parent_id\n attrs[:_parent] = parent_id\n \n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs, parent_id)\n else\n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs)\n end\n end\n end\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Could not create #{@slingshot_index_name}!!!\")\n end \n \n Mebla.log(\"Bulk indexing:\\n#{bulk_query}\", :debug) \n \n # Send the query\n response = Slingshot::Configuration.client.post \"#{Mebla::Configuration.instance.url}/_bulk\", bulk_query\n \n # Only refresh the index if no error ocurred\n unless response =~ /error/ \n # Log results\n Mebla.log(\"Indexed #{only_index.count} model(s) to #{self.slingshot_index_name}: #{response}\")\n Mebla.log(\"Indexing Report:\")\n indexed_count.each do |model_name, count|\n Mebla.log(\"Indexed #{model_name}: #{count} document(s)\")\n end\n \n # Refresh the index\n refresh_index\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following response:\\n #{response}\")\n end\n rescue RestClient::Exception => error\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following error: #{error.message}\")\n end",
"title": ""
},
{
"docid": "8ed24a2f886c0dcbc750c57d5ff8d903",
"score": "0.47182357",
"text": "def determine_indexes(queries, candidates, tables)\n new_indexes = {}\n index_name_to_columns = candidates.invert\n\n # filter out existing indexes\n # this must happen at end of process\n # since sometimes hypothetical indexes\n # can give lower cost than actual indexes\n index_set = Set.new\n if tables.any?\n indexes(tables).each do |index|\n if index[\"using\"] == \"btree\"\n # don't add indexes that are already covered\n index_set << [index[\"table\"], index[\"columns\"].first(1)]\n index_set << [index[\"table\"], index[\"columns\"].first(2)]\n end\n end\n end\n\n savings_ratio = (1 - @min_cost_savings_pct / 100.0)\n\n queries.each do |query|\n if query.explainable? && query.high_cost?\n new_cost, new_cost2 = query.costs[1..2]\n\n cost_savings = new_cost < query.initial_cost * savings_ratio\n\n # set high bar for multicolumn indexes\n cost_savings2 = new_cost > 100 && new_cost2 < new_cost * savings_ratio\n\n key = cost_savings2 ? 2 : 1\n query_indexes = hypo_indexes_from_plan(index_name_to_columns, query.plans[key], index_set)\n\n # likely a bad suggestion, so try single column\n if cost_savings2 && query_indexes.size > 1\n query_indexes = hypo_indexes_from_plan(index_name_to_columns, query.plans[1], index_set)\n cost_savings2 = false\n end\n\n suggest_index = cost_savings || cost_savings2\n\n cost_savings3 = false\n new_cost3 = nil\n\n # if multiple indexes are found (for either single or multicolumn)\n # determine the impact of each individually\n # there may be a better single index that we're not considering\n # that didn't get picked up by pass1 or pass2\n # TODO clean this up\n # TODO suggest more than one index from this if savings are there\n if suggest_index && query_indexes.size > 1\n winning_index = nil\n winning_cost = nil\n winning_plan = nil\n\n query_indexes.each do |query_index|\n reset_hypothetical_indexes\n create_hypothetical_index(query_index[:table], query_index[:columns].map {|v| {column: v}})\n plan3 = plan(query.statement)\n cost3 = plan3[\"Total Cost\"]\n\n if !winning_cost || cost3 < winning_cost\n winning_cost = cost3\n winning_index = query_index\n winning_plan = plan3\n end\n end\n\n query.plans << winning_plan\n\n # duplicated from above\n # TODO DRY\n use_winning =\n if cost_savings2\n new_cost > 100 && winning_cost < new_cost * savings_ratio\n else\n winning_cost < query.initial_cost * savings_ratio\n end\n\n if use_winning\n query_indexes = [winning_index]\n cost_savings3 = true\n new_cost3 = winning_cost\n query.pass3_indexes = query_indexes\n else\n suggest_index = false\n end\n end\n\n if suggest_index\n query_indexes.each do |index|\n new_indexes[index] ||= index.dup\n (new_indexes[index][:queries] ||= []) << query\n end\n end\n\n query.indexes = query_indexes\n query.suggest_index = suggest_index\n query.new_cost =\n if suggest_index\n cost_savings3 ? new_cost3 : (cost_savings2 ? new_cost2 : new_cost)\n else\n query.initial_cost\n end\n\n # TODO optimize\n if @log_level.start_with?(\"debug\")\n query.pass1_indexes = hypo_indexes_from_plan(index_name_to_columns, query.plans[1], index_set)\n query.pass2_indexes = hypo_indexes_from_plan(index_name_to_columns, query.plans[2], index_set)\n end\n end\n end\n\n # filter out covered indexes\n covered = Set.new\n new_indexes.values.each do |index|\n if index[:columns].size > 1\n covered << [index[:table], index[:columns].first(1)]\n end\n end\n\n ###\n #\n # Project modifications start\n #\n ###\n\n # init set of indexes\n new_indexes_2 = Set.new\n\n # change working directory to specified path with zaman py\n Dir.chdir('/home/vagrant/dexter/lib/dexter') do\n # create array to store queries from log file\n queries_array = Array.new\n\n # iterate through Query object array\n for query in queries\n\n # extract queries (and remove \\t \\n and multiple white space)\n clean_string = (query.statement).gsub(/\\n/, \" \")\n clean_string = clean_string.gsub(/\\t/, \" \")\n fix_string = clean_string.squeeze\n\n # store in queries array\n queries_array.push(fix_string)\n end\n\n # open json file to pass data to zaman.py\n File.open(\"queries.json\", \"w\") do |f|\n # write queries to json file\n f.write(queries_array.to_json)\n end\n\n # create array to store tables names\n table_names = Array.new\n\n # loop through tables set and put name in array\n tables.each do |n|\n table_names.push(n)\n end\n\n # write table names to file\n File.open(\"tables.json\", \"w\") do |f|\n # write tables to json file\n f.write(table_names.to_json)\n end\n\n puts('Data written to json')\n\n # shell out / call zaman python script through sys commands\n # using back ticks ``\n puts('Shelling out to zaman.py')\n\n # error handling for zaman py response\n begin\n zamans_indexes = `python zaman.py queries`\n puts('zaman.py has executed')\n\n # parse json output to set\n zamans_indexes = JSON.parse(zamans_indexes)\n\n # assign suggested indexes from zaman.py to new_indexes_2 set\n new_indexes_2 = zamans_indexes\n puts('suggested indexes received')\n\n rescue\n puts('Error executing zaman.py')\n end\n end\n\n # TODO: cost estimation\n # since the main focus of this project is over Zaman's algorithm, new_indexes_2 takes preference.\n # computes intersection of both new_indexes sets\n if new_indexes.empty?\n new_indexes = new_indexes_2\n elsif new_indexes_2.empty?\n new_indexes = new_indexes\n else\n # set intersection between zamans suggested indices and dexters suggested indices\n new_indexes = new_indexes & new_indexes_2\n end\n\n ###\n #\n # Project modifications end here\n #\n ###\n\n\n # filter out covered indexes\n covered = Set.new\n new_indexes.values.each do |index|\n if index[:columns].size > 1\n covered << [index[:table], index[:columns].first(1)]\n end\n end\n\n new_indexes.values.reject {|i| covered.include?([i[:table], i[:columns]])}.sort_by(&:to_a)\n\n end",
"title": ""
},
{
"docid": "ed9ff837ed00fdde9ff0322edce9128f",
"score": "0.4698706",
"text": "def build_index!(&block)\n entries_added = do_build_index(&block) unless built?\n\n #make the hash from abbreviated parts of speech to full definitions\n @pos_hash ||= build_pos_hash\n\n entries_added\n end",
"title": ""
},
{
"docid": "ec9bf6222e7016f1159d2e089576ab3d",
"score": "0.4690108",
"text": "def reduce\n raise \"Cannot reduce a view without a reduce method\" unless can_reduce?\n update_query(:reduce => true, :delete => [:include_docs])\n end",
"title": ""
},
{
"docid": "dae00eddd9062a5b7dba53e0595fd92f",
"score": "0.46829036",
"text": "def optimize(_src, _dst, options = {})\n fail NotImplementedError, \"implement method optimize in #{self.class}\"\n end",
"title": ""
},
{
"docid": "a9d7c268608379fea96eff918793a08f",
"score": "0.46743467",
"text": "def index_algorithms\n {}\n end",
"title": ""
},
{
"docid": "a9d7c268608379fea96eff918793a08f",
"score": "0.46743467",
"text": "def index_algorithms\n {}\n end",
"title": ""
},
{
"docid": "03c939bbd5d76f4fd0e24a33d5341365",
"score": "0.46725744",
"text": "def refresh\n super do |modified|\n return unless modified\n @indexer.generate_index #TODO: update_index?\n end\n end",
"title": ""
},
{
"docid": "e0b0e138f4c3168d03a7b2766db067ef",
"score": "0.4666321",
"text": "def compute\n index(@ref, @ref_base, @software, @annotation)\n\n if @err_rate > 0\n bucketized_alignment\n else # software == :star || err_rate == 0\n unbucketized_alignment\n end\n end",
"title": ""
},
{
"docid": "7a971f96efbc1be7fd05cce05227993c",
"score": "0.46582043",
"text": "def merge!; end",
"title": ""
},
{
"docid": "6c122715aa13759535b0b4fff7645159",
"score": "0.46517888",
"text": "def build\n # Note: @index_definitions will only contain multiple elements in case of a composite type.\n @index_definitions.each do |type_def|\n @logger.info(\"INDEXING\") { \"Building index of type #{type_def[\"type\"]}\" }\n rdf_type = type_def[\"rdf_type\"]\n number_of_documents = count_documents(rdf_type)\n @logger.info(\"INDEXING\") { \"Found #{number_of_documents} documents to index of type #{rdf_type} with allowed groups #{@search_index.allowed_groups}\" }\n batches =\n if @max_batches && (@max_batches != 0)\n [@max_batches, number_of_documents / @batch_size].min\n else\n number_of_documents / @batch_size\n end\n batches = batches + 1\n @logger.info(\"INDEXING\") { \"Number of batches: #{batches}\" }\n\n Parallel.each(1..batches, in_threads: @number_of_threads) do |i|\n batch_start_time = Time.now\n @logger.info(\"INDEXING\") { \"Indexing batch #{i}/#{batches}\" }\n failed_documents = []\n\n @sparql_connection_pool.with_authorization(@search_index.allowed_groups) do |sparql_client|\n document_builder = MuSearch::DocumentBuilder.new(\n tika: @tika,\n sparql_client: sparql_client,\n attachment_path_base: @attachment_path_base,\n logger: @logger\n )\n document_uris = get_documents_for_batch rdf_type, i\n document_uris.each do |document_uri|\n @logger.debug(\"INDEXING\") { \"Indexing document #{document_uri} in batch #{i}\" }\n document = document_builder.fetch_document_to_index(\n uri: document_uri,\n properties: type_def[\"properties\"])\n @elasticsearch.insert_document @search_index.name, document_uri, document\n rescue StandardError => e\n failed_documents << document_uri\n @logger.warn(\"INDEXING\") { \"Failed to index document #{document_uri} in batch #{i}\" }\n @logger.warn { e.full_message }\n end\n end\n @logger.info(\"INDEXING\") { \"Processed batch #{i}/#{batches} in #{(Time.now - batch_start_time).round} seconds.\" }\n if failed_documents.length > 0\n @logger.warn(\"INDEXING\") { \"#{failed_documents.length} documents failed to index in batch #{i}.\" }\n @logger.debug(\"INDEXING\") { \"Failed documents: #{failed_documents}\" }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "920d750a664440ede2fb904e75aad28e",
"score": "0.46500003",
"text": "def index_finalized\n index\n end",
"title": ""
},
{
"docid": "d410c067cba21aaa6f28e706a7c04ca3",
"score": "0.4648373",
"text": "def reindex!\n find(:all).each { |r| r.update_index(true) }\n end",
"title": ""
},
{
"docid": "1c79420d37308c4c7d9a289b1555cb2f",
"score": "0.46428752",
"text": "def minimize; end",
"title": ""
},
{
"docid": "50987c9757c271e5099cbd28a7b00442",
"score": "0.46398437",
"text": "def check_index_walk\n if first['index_walk']\n @cost = limit\n add_message(\"index_walk\")\n end\n end",
"title": ""
},
{
"docid": "14b6ba4a2e81c7cf901dd8c6d05d564f",
"score": "0.46381137",
"text": "def index\n @asset_tags = AssetTag.all\n AssetTag.reindex\n\n end",
"title": ""
},
{
"docid": "23518a039ee43d374c535ba762e16cba",
"score": "0.46301547",
"text": "def optimize\n @h.each { |k,_| parent(k) }\n end",
"title": ""
},
{
"docid": "3187cb19361e7f3a2e0a74bf9ac4090f",
"score": "0.46282172",
"text": "def update_index\n if should_be_in_index?\n mapper.process_with([record]) do |context|\n writer.put(context)\n end\n else\n writer.delete(record.send(Kithe.indexable_settings.solr_id_value_attribute))\n end\n end",
"title": ""
},
{
"docid": "924fb0da95ae79ecb4a0bfe017c7e055",
"score": "0.46276024",
"text": "def populate_background_index!(name)\n # make an index with a new client (in this thread, to avoid query check race after)\n name.freeze\n index = $client.dup.index(name)\n docs = index.docs(\"widget\")\n\n # do some busy work in background thread to generate bulk-indexing tasks we\n # can query at the caller. return the thread ref so caller can join on it\n Thread.new do\n 100.times.each do |i|\n docs.bulk do |d|\n (1..500).each do |j|\n d.index \\\n :foo => \"foo_#{i}_#{j}\",\n :bar => \"bar_#{i}_#{j}\",\n :baz => \"baz_#{i}_#{j}\"\n end\n end\n index.refresh\n end\n end\nend",
"title": ""
},
{
"docid": "b98db3222462ef0b422cc0f005defe51",
"score": "0.46272522",
"text": "def force_load(idx)\n return @index[idx] if @index[idx]\n @index_handle.seek(idx * BLOCK_SIZE)\n @index[idx] = read_entry(@index_handle, idx)\n end",
"title": ""
},
{
"docid": "c7fd1cd93aa9694303a2ed4b02aebfb8",
"score": "0.4627048",
"text": "def suppress_reindex\n self.suppress_reindex_trigger = true\n end",
"title": ""
},
{
"docid": "c7fd1cd93aa9694303a2ed4b02aebfb8",
"score": "0.4627048",
"text": "def suppress_reindex\n self.suppress_reindex_trigger = true\n end",
"title": ""
},
{
"docid": "c7fd1cd93aa9694303a2ed4b02aebfb8",
"score": "0.4627048",
"text": "def suppress_reindex\n self.suppress_reindex_trigger = true\n end",
"title": ""
},
{
"docid": "85691b6d4f9f7b467bb166c464fd461e",
"score": "0.46193713",
"text": "def merge_sort(array, start_index, end_index)\n if start_index < end_index\n middle_index = (start_index + end_index)/2\n merge_sort(array, start_index, middle_index)\n merge_sort(array, middle_index + 1, end_index)\n merge(array, start_index, middle_index, end_index)\n end\nend",
"title": ""
},
{
"docid": "ab8ef2f49416c8ee9d18f93955986945",
"score": "0.45952123",
"text": "def build_index!\n puts \"build_index!\"\n @indexes = {}\n \n @indexes = @resource_class.build_indexes(@resources)\n @indexes[:_default] ||= @default_order\n end",
"title": ""
},
{
"docid": "5b4c15cbad08db5f9caf94e67a563a12",
"score": "0.45886603",
"text": "def enqueue_reindex_job\n Study.enqueue_reindex_ids(nct_id)\n end",
"title": ""
},
{
"docid": "660c3c55b8c6756e1d5de8cb21ca0c40",
"score": "0.45868242",
"text": "def index(model)\n model.index\n ElasticMapper.index.refresh\nend",
"title": ""
},
{
"docid": "f89dc597a1cc1b6eb00b2f584cbcbf56",
"score": "0.45806152",
"text": "def build_index\n Index.new(join_header, @disjoint_header).merge(right)\n end",
"title": ""
},
{
"docid": "d25b51e4c7cc3fe5dcddecb3748278b0",
"score": "0.45765597",
"text": "def lock!\n unless @locked\n @locked = true\n if @size > 0\n s_ = @size\n @indexes.each do |ainfo_|\n s_ /= ainfo_.size\n ainfo_._set_step(s_)\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "fb8da58d1e1a709b2340ce3ef57da66d",
"score": "0.4569166",
"text": "def merge!(other)\n # @todo: use specific exception\n raise Exception, \"Cannot merge\" unless self.class == other.class &&\n coll_name == other.coll_name &&\n db_name == other.db_name\n @spec[batch_key] += other.spec[batch_key]\n @spec[:indexes] = indexes + other.indexes\n self\n end",
"title": ""
},
{
"docid": "b8e7f2623cbfd0a0fe45d46bc622c45e",
"score": "0.45666975",
"text": "def create_index_with_duplicates( index_name, sort_by_proc = nil, sort_duplicates_by_proc = nil, & indexing_block )\n\n return create_bucket_index( index_name, true, sort_by_proc, sort_duplicates_by_proc, & indexing_block )\n \n end",
"title": ""
},
{
"docid": "2eeb4e35a9b922cd8ef0545aed9882fb",
"score": "0.45662162",
"text": "def consolidation\n end",
"title": ""
},
{
"docid": "fcb82817058686f4dc2f18f86d5d97e3",
"score": "0.45658714",
"text": "def merge_all\n merge_concurrent(0)\n end",
"title": ""
},
{
"docid": "e73abb63cb797dd77c9165adec9a585e",
"score": "0.45603758",
"text": "def optimize!\n rsp = post(\"<optimize/>\")\n success?(rsp.body) or log_error(rsp.body)\n end",
"title": ""
},
{
"docid": "a6bcf90eb93f06d9fcdb554725860772",
"score": "0.45550132",
"text": "def optimize\n session.optimize\n end",
"title": ""
},
{
"docid": "299712e9b243de21be46618ec19b077f",
"score": "0.45549968",
"text": "def rebuild_index\n # Only rebuild if the index exists\n raise Mebla::Errors::MeblaIndexException.new(\"#{@slingshot_index_name} does not exist !! use #create_index to create the index first.\") unless index_exists?\n\n Mebla.log(\"Rebuilding index\") \n \n # Delete the index\n if drop_index\n # Create the index\n return build_index\n end\n end",
"title": ""
},
{
"docid": "ab3433d865b76dc5ee41e574ed6e3a3f",
"score": "0.45475203",
"text": "def index\n # @things = Thing.all\n # indexarr = params[:indices]\n # # indexarr = [60, 59, 62, 61, 70, 94, 72, 71, 85, 32, 16, 6, 27, 38, 14, 90, 48, 39, 74, 66]\n # # mi = indexarr.map.with_index(0).to_a\n \n # res = Thing.joins(:model_version_images).where('model_version_images.index' => indexarr).group(\"things.id\")\n\n # mindex = indexarr.each_with_index.map {|m, i| \"(#{m},#{i})\" }.join(\",\")\n # # r = Thing.select(\"things.*, MIN(x.ordering) as imgorder\").joins(:model_version_images).joins(\"INNER JOIN ( values #{mindex}) as x (index, ordering) ON model_version_images.index = x.index\").group(\"things.id\").order(\"imgorder\").includes(:model_version_images).page(1).per(2)\n # r = Thing.select(\"things.*, MIN(x.ordering) as imgorder\").joins(\"model_version_images as images ON things.id = images.thing_id\").joins(:model_version_images).joins(\"INNER JOIN ( values #{mindex}) as x (index, ordering) ON model_version_images.index = x.index\").group(\"things.id\").order(\"imgorder\").includes(:model_version_images)\n # res = Thing.joins(:model_version_images).joins(\"INNER JOIN ( values #{mindex}) as x (index, ordering) ON model_version_images.index = x.index\").group(\"things.id\")\n end",
"title": ""
},
{
"docid": "e531beefdcff93ca27871b83178f4443",
"score": "0.45437285",
"text": "def segment(series, control, segment_align_usec=5_000_000)\n each_subseries_in series, control do |name, subseries|\n new_subseries = {}\n\n # rely on request timestamps provided in control - especially with counters,\n # there will be variable numbers of samples available so ranges will be inconsistent\n min_ts = control[:start_ts]\n max_ts = control[:end_ts]\n min_ts_seg = min_ts / segment_align_usec\n max_ts_seg = max_ts / segment_align_usec\n min_ts_seg_start = min_ts_seg * segment_align_usec\n\n # compute the number of segments\n range = max_ts - min_ts\n seg_count = max_ts_seg - min_ts_seg + 1\n\n # initialize the segments - all segments must exist in output\n 0.upto(seg_count-1).map do |seg|\n key = min_ts_seg_start + seg * segment_align_usec\n new_subseries[key] = { :timestamps => [], :values => [] }\n end\n\n # move the individual entries into segments ready for rollups\n seg_ts = min_ts_seg_start\n subseries.keys.sort.each do |ts|\n # advance to the next bin if necessary\n until ts.between?(seg_ts, seg_ts + segment_align_usec - 1) do\n seg_ts = seg_ts + segment_align_usec\n end\n\n # compute_rollups requires two arrays, timestamps & values\n new_subseries[seg_ts][:timestamps] << ts\n new_subseries[seg_ts][:values] << subseries[ts]\n end\n\n # now use the rollup function to generate all of the useful aggregations\n new_subseries.keys.each do |seg_ts|\n new_subseries[seg_ts] = compute_rollups(\n new_subseries[seg_ts][:timestamps],\n new_subseries[seg_ts][:values],\n segment_align_usec, seg_ts, (seg_ts + segment_align_usec - 1)\n )\n end\n\n new_subseries\n end\n end",
"title": ""
},
{
"docid": "21dc5b2a8d61eab28b88da0bdd1147f6",
"score": "0.45432472",
"text": "def optimize!(path)\n @optimizer.optimize_image!(path)\n end",
"title": ""
},
{
"docid": "77d35bfd9671a66b0567445e96f43b20",
"score": "0.45399788",
"text": "def vacuum\n lock do\n ordered_row_uuids = @indexes['row_uuid'].sort_by {|row_uuid, row_index| row_index}\n\n row_index_shift = 0\n ordered_row_uuids.each do |row_uuid, row_index|\n @indexes['row_uuid'][row_uuid] += row_index_shift\n\n if @deleted_row_uuids.include?(row_uuid)\n new_row_index = row_index + row_index_shift\n @data[get_range(new_row_index)] = []\n @indexes['row_uuid'].delete(row_uuid)\n\n row_index_shift -= 1\n end\n end\n @current_row_index += row_index_shift\n\n @deleted_row_uuids.clear\n end\n end",
"title": ""
},
{
"docid": "090eff9b40ac7fc6f48ed1e2ced419a9",
"score": "0.45359087",
"text": "def reindex(autocommit = true)\n message = {:id => self.id, :document => self.search_document, :boost => self.boost}.to_json\n if defined?(RABBIT_MQ) && defined?(Bunny)\n Bunny.run RABBIT_MQ do |rabbit|\n queue = rabbit.queue \"sisyphus__reindex_place_document\"\n queue.publish(message)\n end\n else\n Sisyphus.async_reindex_place_document(message)\n end\n end",
"title": ""
},
{
"docid": "139a7424f67311369e0ffd73d1337e36",
"score": "0.45204294",
"text": "def recreate!\n client = EsClient.new(@url, @index_name)\n client.create_index(@index)\n client.bulk_index(@data)\n end",
"title": ""
},
{
"docid": "887939f5484a0fe80cb0bcf76e2ebd42",
"score": "0.4516379",
"text": "def compress_index_name(name)\n method_index = 0\n new_name = name\n while new_name.length > 63 && method_index >= 0\n # ap \"[#{method_index}] #{new_name}\"\n case method_index\n when 0\n # change polymorphic index to just name\n table_part, column_part = new_name.split('_on_')\n columns = column_part.split('_and_')\n polys = columns.select{|e| e.include?('_type') && columns.include?(e.sub('_type','_id')) }\n if polys.any?\n polys.each do |poly|\n poly = poly.split('_').first\n columns[columns.index(\"#{poly}_type\")] = poly\n columns.delete(\"#{poly}_id\")\n end\n new_name = \"#{table_part}_on_#{columns.join(\"_and_\")}\"\n end\n method_index += 1\n when 1\n # change index to idx\n new_name = name.sub(\"index_\",\"ix_\")\n method_index += 1\n when 2\n # remove common strings from column names\n column_part = new_name.split('_on_').last\n columns = column_part.split('_and_')\n if columns.size > 1 && (common_str = longest_common_substr(columns))\n common_str = common_str.sub(/_at|_id/,'')\n if common_str.size > 2\n ap \"common_str: #{common_str}\"\n new_name = new_name.gsub(common_str, '')\n end\n end\n method_index += 1\n when 3\n # remove the leading parts of the table name\n table_name = new_name.match(/ix_(.*)_on.*/)[1]\n parts = table_name.split('_')\n if parts.size > 1\n parts.shift\n new_table_name = parts.join('_')\n new_name = new_name.sub(\"ix_#{table_name}_on\",\"ix_#{new_table_name}_on\")\n else\n method_index += 1\n end\n when 4\n # hash the columns used in the index\n columns = new_name.split('_on_').last\n hash = Digest::MD5.base64digest(columns)[0..-3]\n new_name = new_name.sub(columns, hash) \n method_index += 1\n when 5\n # change table name to hash\n table_name = new_name.match(/ix_(.*)_on.*/)[1]\n hash = Digest::MD5.base64digest(table_name)[0..-3]\n if table_name.size > hash.size\n new_name = new_name.sub(table_name, hash)\n end\n method_index += 1\n else\n method_index = -99\n end\n end\n new_name\n end",
"title": ""
},
{
"docid": "e27f0f224215bcd328ed206750cf3ee0",
"score": "0.45156896",
"text": "def index\n # Block if this file is currently being indexed by another thread/process\n if indexing?\n while indexing?\n sleep 1\n end\n else\n self.indexing = true\n \n begin\n # Filter unparseable entries\n # TODO: Find a more efficient way to filter unparseable entries without\n # having to copy the entire file line by line\n filtered = 0\n File.open(@filtered_file, 'w') do |f|\n File.foreach(@data_file) do |line|\n begin\n parse(line)\n f.write line\n rescue\n filtered += 0\n end\n end\n end\n puts \"Filtered #{filtered} unparseable entries\" if filtered > 0 and ENV['DEBUG']\n \n # File must be sorted\n File.sort(@filtered_file, @sorted_file, \"-k#{@chr_col},#{@chr_col} -k#{@start_col},#{@start_col}n\")\n \n # and BGZipped\n BGZip.compress(@sorted_file, @bgzipped_file)\n \n # Now Tabix can index it\n Tabix.index(@bgzipped_file, @chr_col, @start_col, @end_col)\n rescue\n raise EntryFileError, \"Error indexing file #{File.basename(@data_file)} for lookup!\"\n ensure\n # Delete the temporary filtered and sorted files since they are unneeded\n File.delete(@filtered_file) if File.exist?(@filtered_file)\n File.delete(@sorted_file) if File.exist?(@sorted_file)\n self.indexing = false\n end\n end\n end",
"title": ""
},
{
"docid": "71ba4fa04d8a875959f4c7cbce1fc451",
"score": "0.4513256",
"text": "def add_all\n helper.index_write do |index|\n index.add_all\n index.update_all\n end\n\n self\n end",
"title": ""
},
{
"docid": "3aaaa741a8ec27c8c1a5d60ee82bcd7a",
"score": "0.45127323",
"text": "def optimize\n operand.drop(offset)\n end",
"title": ""
},
{
"docid": "41e99ab02c51581e6490b17f3263a84c",
"score": "0.45089987",
"text": "def merged_result; end",
"title": ""
},
{
"docid": "8d12a894a540f243d986ab5c603143e0",
"score": "0.4497857",
"text": "def index\n @@semaphore.synchronize {\n inner_index()\n }\n end",
"title": ""
},
{
"docid": "8042780878df4c542d52f8e811adf86e",
"score": "0.44951132",
"text": "def perform_spacial_pooling\n @active_columns.each { |c| c.tune_proximal_dendrite }\n @columns.each { |c| c.tune_boost }\n adjust_inhibition_radius\n end",
"title": ""
},
{
"docid": "327488751954250fd00a876279a24224",
"score": "0.44921243",
"text": "def update_parent_chain\n\t\t## okay so there is some deprecation \n\t\t## here on the newer elasticsearch version.\n\t\tcurrent_org = self\n\t\t\n\t\tsearch_request = Organization.search({\n\t\t\tquery: {\n\t\t\t\tterm: {\n\t\t\t\t\tchildren: self.id.to_s\n\t\t\t\t}\n\t\t\t},\n\t\t\taggregations: {\n\t\t\t\tparent_organizations: {\n\t\t\t\t\tterms: {\n\t\t\t\t\t\tfield: \"id_duplicate\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t\n\t\t## so the id can be a base64 slug.\n\t\t## that is created from that ?\n\t\t## we can do something like that. \n\n\t\t#puts \"=-&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&== updating parent chain\"\n\n\n\t\tsearch_request.response.aggregations.parent_organizations.buckets.each do |porg_bucket|\n\n\t\t\torganization_id = porg_bucket[\"key\"]\n\n\t\t\tsource = '''\n\t\t\t\tfor(orphan in params.orphans){\n\t\t\t\t\tctx._source.children.removeIf(item -> item == orphan);\n\t\t\t\t}\n\t\t\t'''\n\t\t\tparams = {\n\t\t\t\torphans: ([self.id.to_s] + (self.children || [])).flatten\n\t\t\t}\n\t\t\tupdate_hash = {\n\t\t\t\tupdate: {\n\t\t\t\t\t_index: self.class.index_name,\n\t\t\t\t\t_type: self.class.document_type,\n\t\t\t\t\t_id: organization_id,\n\t\t\t\t\tdata: { \n\t\t\t\t\t\tscript: \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: source,\n\t\t\t\t\t\t\tlang: 'painless', \n\t\t\t\t\t\t\tparams: params\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#puts \"the delete update hash is :\"\n\t\t\t#puts update_hash.to_s\n\t\t\t#puts \"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"\n\n\t\t\tOrganization.add_bulk_item(update_hash)\n\t\t\tOrganization.flush_bulk\n\t\tend\n\n\t\twhile true\n\t\t\t#puts \"the current org parent id is:\"\n\t\t\t#puts current_org.parent_id.to_s\n\t\t\tbreak unless current_org.parent_id\n\t\t\tparent = Organization.find(current_org.parent_id)\n\t\t\tsource = '''\n\t\t\t\tif(!ctx._source.children.contains(params.child_organization_id)){\n\n\t\t\t\t\tctx._source.children.add(params.child_organization_id);\n\t\t\t\t}\n\t\t\t'''\n\t\t\tparams = {\n\t\t\t\tchild_organization_id: self.id.to_s\n\t\t\t}\n\t\t\tupdate_hash = {\n\t\t\t\tupdate: {\n\t\t\t\t\t_index: self.class.index_name,\n\t\t\t\t\t_type: self.class.document_type,\n\t\t\t\t\t_id: parent.id.to_s,\n\t\t\t\t\tdata: { \n\t\t\t\t\t\tscript: \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: source,\n\t\t\t\t\t\t\tlang: 'painless', \n\t\t\t\t\t\t\tparams: params\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tOrganization.add_bulk_item(update_hash)\n\t\t\t## now add the bulk request.\n\t\t\tcurrent_org = parent\n\t\tend\n\t\tOrganization.flush_bulk\n\tend",
"title": ""
}
] |
5823c75f7437cf9f59a185b6d2ebf8b8
|
GET /posts/1 GET /posts/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "915c0178f9e4347098d8a463c2cbe6b0",
"score": "0.77110183",
"text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"title": ""
},
{
"docid": "ad221611c85e1ec63d3385d6179e41a2",
"score": "0.73537844",
"text": "def show\n render json: Post.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "cbfef57825d28450983814c208c424ec",
"score": "0.73433185",
"text": "def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end",
"title": ""
},
{
"docid": "fda3031ecb4f7eca04e797b25ff578ce",
"score": "0.73379177",
"text": "def show\n @post = Post.find(params[:id])\n\n render json: @post\n end",
"title": ""
},
{
"docid": "d25387250c9348a46a4b442b99fb711b",
"score": "0.73228735",
"text": "def show\n \trender json: Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "ea74d2fe5d6a5074e7dfb3f91dca380c",
"score": "0.7293139",
"text": "def show\n post = Post.find(params[:id])\n render json: post\n end",
"title": ""
},
{
"docid": "d59046a4be5fcb4d90635c74a19f0835",
"score": "0.7275997",
"text": "def show\n\t \trender json: Post.find(params[:id])\n\t end",
"title": ""
},
{
"docid": "b5e1310acc042c75c17830042159c393",
"score": "0.7256934",
"text": "def show\n @post = Post.where(:id => params[:id]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "5d33d74d82b515ef08b9cac447155832",
"score": "0.7161576",
"text": "def index\n\n @posts = Post.all\n\n render json: @posts, status: 200\n end",
"title": ""
},
{
"docid": "9e4bfaa87507d05255fbaeadc1ecb1d6",
"score": "0.7158913",
"text": "def index\n @posts = Post.all\n render json: @posts\n end",
"title": ""
},
{
"docid": "e732c729d91c0c1c2965f1f688905fef",
"score": "0.71552676",
"text": "def index\n @posts = Post.all\n\n render json: @posts\n end",
"title": ""
},
{
"docid": "e732c729d91c0c1c2965f1f688905fef",
"score": "0.71552676",
"text": "def index\n @posts = Post.all\n\n render json: @posts\n end",
"title": ""
},
{
"docid": "14c9761a649cab21f8f00b5fe776fcd0",
"score": "0.7119547",
"text": "def index\n @posts = Post.all\n render json: @posts\n end",
"title": ""
},
{
"docid": "8150ff0b8d418a0877e1a80d25b0171f",
"score": "0.7094749",
"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.7094749",
"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.7094749",
"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": "c36def3eeda4f34e4e4bd7e3e7e0905d",
"score": "0.70943594",
"text": "def show\n @user = User.find(params[:user_id])\n @post = @user.posts.find(params[:id])\n\n render json: @post\n end",
"title": ""
},
{
"docid": "d5eccc30891b490ec40acf35b94edd0d",
"score": "0.7071599",
"text": "def index\n @posts = Post.all\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "e004fcf96a378e248a36cc900e8681c2",
"score": "0.70607626",
"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": "aeb786c46443d3a66d9d370731c1b838",
"score": "0.70452625",
"text": "def index\n\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": "9142c1c69aa14cff65bfb8d67033e5ee",
"score": "0.7032558",
"text": "def show\n \n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "b7ee4a7e432c7c37005748fea9d3f89d",
"score": "0.7020259",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "58cb10a6f2e926c8f7b2224620ae9a88",
"score": "0.69897074",
"text": "def show\n @post = Post.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "672f66d49f10113c3bee8e8cf65f0106",
"score": "0.6955722",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"title": ""
},
{
"docid": "672f66d49f10113c3bee8e8cf65f0106",
"score": "0.6955722",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"title": ""
},
{
"docid": "59f2ce78e63fc70f5c9e80fa5da20ebb",
"score": "0.6954564",
"text": "def index\n render json: { posts: Post.all }\n end",
"title": ""
},
{
"docid": "056020ca4c6e9af92348a94e32c5a5e4",
"score": "0.6937062",
"text": "def show\n @post ||= Mist::Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"title": ""
},
{
"docid": "8431778f7b7b9771f0f0cb825a7bd788",
"score": "0.6936725",
"text": "def index\n @posts = Post.order(\"created_at DESC\").includes(:user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "2e184026907abf6c194a4e61f37d9c7b",
"score": "0.69257236",
"text": "def show\n # when you go to http://localhost:3000/posts/1, rails interprets this\n # as a call to the show action for the resource and passes 1 to the \n # :id paramater. Using this blog app you can do that by clicking the \n # show link for a post on the index page.\n\n @post = Post.find(params[:id])\n # The show action uses Post.find to search for a single record \n # in the database by its id value. After finding the record, Rails \n # displays it by using app/views/posts/show.html.erb\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "c98e3c0c1681a0589fa05e49e86002da",
"score": "0.6917876",
"text": "def show\n post = Post.find_by(id: params[:id])\n if post \n render json: post\n else\n render json: {errors: 'Not found'}\n end\n end",
"title": ""
},
{
"docid": "b9e351b1b1f206a61e5dfb59a0e74298",
"score": "0.69010335",
"text": "def index\n render json: Post.all\n end",
"title": ""
},
{
"docid": "32eed510206c183d903ace527918238c",
"score": "0.69005007",
"text": "def index\n @posts = Mist::Post.recently_published(20, Mist.authorized?(:view_drafts, self))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end",
"title": ""
},
{
"docid": "0233eecdc309e473c04b8b4ce3ca45b5",
"score": "0.6894985",
"text": "def index\n @posts = Post.all.order(created_at: :asc)\n json_response(@posts)\n end",
"title": ""
},
{
"docid": "b1d233c5b9cdc85ee717fe420066829b",
"score": "0.6893989",
"text": "def index\n @posts = Post.all\n \n render json: @posts\n end",
"title": ""
},
{
"docid": "dbf00e2deb45377f638becf566594e7d",
"score": "0.68756175",
"text": "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html { render 'application/index' }\n format.json { render :json => { :post => @post.as_json } }\n end\n end",
"title": ""
},
{
"docid": "158f7338fe9cd789dede014a6f52d801",
"score": "0.6860515",
"text": "def show\n render json: @post, serializer: Api::V1::PostSerializer\n end",
"title": ""
},
{
"docid": "d9af16fffec3c03110a65c1a4a25829e",
"score": "0.6853294",
"text": "def show\r\n @post = root_post_of(Post.find(params[:id]))\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @post }\r\n end\r\n end",
"title": ""
},
{
"docid": "c6bb0112e401fb8de407d88b7f4079c8",
"score": "0.6853291",
"text": "def show\n render json: @post\n end",
"title": ""
},
{
"docid": "251e5b330fcf5044d151d39653c31da1",
"score": "0.6847577",
"text": "def show\n @api_v2_post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_v2_post }\n end\n end",
"title": ""
},
{
"docid": "060bdb917a36369a9c584e7b4a7145c5",
"score": "0.68364173",
"text": "def show\n render json: @post\n end",
"title": ""
},
{
"docid": "b230d81461fa965aa542c3777928c608",
"score": "0.68232405",
"text": "def index\n @posts = Post.paginate(:page => params[:page], :per_page => 10).order('id DESC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "ffa715df54b8064924e7d9e4ead0d9a9",
"score": "0.68093437",
"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 format.atom\n end\n end",
"title": ""
},
{
"docid": "2b13e24e6c5d68391262cf4e7ec8055e",
"score": "0.6804144",
"text": "def index\n render json: Post.all.order(id: :desc), each_serializer: V1::Posts::PostSerializer\n end",
"title": ""
},
{
"docid": "7b68db056deeebb2155fd501e809978f",
"score": "0.67621773",
"text": "def show\n render :json => @post\n end",
"title": ""
},
{
"docid": "b78a0ef03fceff714fc0fc22789c6b3a",
"score": "0.6743674",
"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": "e81eeb8c0bd38ab03f1b3dd2aa4052bf",
"score": "0.67226875",
"text": "def index\n @api_v1_posts = Api::V1::Post.all\n end",
"title": ""
},
{
"docid": "8cf2835b3f5d8a1b06b61e652b8df830",
"score": "0.6720067",
"text": "def show\n @post = Post.find(params[:id])\n render json: @post, meta: { status: :ok }, meta_key: 'result'\n end",
"title": ""
},
{
"docid": "5bcb3e492fb27aad7c92d319720ba963",
"score": "0.67147297",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render jsonapi: @post }\n end\n end",
"title": ""
},
{
"docid": "9b2eee66e0cbd4026e6ffa8637c6aa0e",
"score": "0.6713107",
"text": "def show\n @posts = @game.posts.order(created_at: :desc).paginate(page: params[:page], per_page: 5)\n respond_to do |format|\n format.json { render template: 'api/games/game.json' }\n end\n end",
"title": ""
},
{
"docid": "ddbb2a759f6c8a02e6ba99acd583a6ce",
"score": "0.6699554",
"text": "def show\n @post = PostsService.getPostById(params[:id])\n end",
"title": ""
},
{
"docid": "3f07ca52f1cff324dc15bb3d68551cc2",
"score": "0.6693189",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @post }\n format.xml { render xml: @posts }\n end\n end",
"title": ""
},
{
"docid": "07469b16e9aaf24e42a6d475beb5e190",
"score": "0.6679935",
"text": "def index\n #@posts = Post.all\n @posts = Post.paginate( :page => params[:page],\n :per_page => 2\n )\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "85628397ef178df32280157a889a14fe",
"score": "0.6655543",
"text": "def index\n @posts = Post.all\n # Post.all returns all of the posts currently in the \n # database as an array of Post records that we store \n # in an instance variable called @posts.\n # http://guides.rubyonrails.org/active_record_querying.html\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n # The respond_to block handles both HTML and JSON calls \n # to this action. If you browse to \n # http://localhost:3000/posts.json, you’ll see a JSON \n # containing all of the posts. \n end",
"title": ""
},
{
"docid": "9a899dd96e2e8062f6c6d28e52f19037",
"score": "0.6644503",
"text": "def index\n\n # We display the posts be cronological inverted order\n if authenticated?\n @posts = Post.order('created_at DESC').page(params[:page])\n else\n @posts = Post.order('created_at DESC').where(:status => :true).page(params[:page])\n end\n \n respond_to do |format|\n format.html { render html: @posts }\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "3409e4032c2182e65960fdb61503feb1",
"score": "0.6641595",
"text": "def show\n @user = User.find(params[:id])\n @posts = @user.posts\n\n respond_to do |format|\n format.json { render json: {user: User._build(@user), posts: Post.build_posts(@posts)}, location: root_path }\n end\n end",
"title": ""
},
{
"docid": "c6950dc55b72da8aaee77fb6fa598e7b",
"score": "0.66299",
"text": "def index\n\t\tgon.posts = Post.all.as_json\n\tend",
"title": ""
},
{
"docid": "285e4c3d340bfb5f82df83fd2e2c85c7",
"score": "0.6619761",
"text": "def index\n @posts = Post.order(\"created_at DESC\").where(:published => true).limit(5)\n @title = \"Home\"\n @description = \"the blog and website of bassist and programmer Johnny Grubb. no baseball information here.\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml\n end\n end",
"title": ""
},
{
"docid": "9635854f78e00267c25e94003f86bfb3",
"score": "0.66178924",
"text": "def display_posts\n begin\n response = RestClient.get \"#{@@DOMAIN}/api/posts.json?all\", authorization_hash\n\n puts \"Response code: #{response.code}\"\n puts \"Response cookies:\\n #{response.cookies}\\n\\n\"\n puts \"Response headers:\\n #{response.headers}\\n\\n\"\n puts \"Response content:\\n #{response.to_str}\"\n\n js = JSON response.body\n js.each do |item_hash|\n item_hash.each do |k, v|\n puts \"#{k}: #{v}\"\n end\n end\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end",
"title": ""
},
{
"docid": "fbb660e6f438bc029232092d4b4cdee4",
"score": "0.66124725",
"text": "def show\n #@post = Post.find(params[:id])\n\n #respond_to do |format|\n # format.html # show.html.erb\n #format.json { render json: @post }\n #end\n end",
"title": ""
},
{
"docid": "fa81a7aef1ab81d3e8310056a4c25cc6",
"score": "0.6608166",
"text": "def index\n @posts = Post.all\n @posts = paginate(@posts)\n authorize @posts\n\n render json: @posts, each_serializer: Api::V1::PostSerializer, meta: meta_attributes(@posts)\n end",
"title": ""
},
{
"docid": "a600fc01ecaab7facda89a1757009542",
"score": "0.66017526",
"text": "def index\n @posts = Post.find(:all)\n end",
"title": ""
},
{
"docid": "b30b9e677cb5dd2c71d00e20bb13d158",
"score": "0.6597235",
"text": "def show\n @post = current_user.posts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"title": ""
},
{
"docid": "975ecb59b7e12ecf3ae9a7d899dc287b",
"score": "0.65952027",
"text": "def index\n render json: { posts: current_user.posts.all.map(&:to_h) }\n end",
"title": ""
},
{
"docid": "c611772fde4bc4cb00f6686cfe4f1e05",
"score": "0.65909946",
"text": "def show\n @feed = Feed.find(params[:id])\n @posts = @feed.posts.order(\"published desc\").paginate(:page => params[:page], :per_page => 20)\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feed }\n end\n end",
"title": ""
},
{
"docid": "927ee7d4801e6d15ff8645b90d02114f",
"score": "0.65858185",
"text": "def index\n\t@posts = list_posts\n end",
"title": ""
},
{
"docid": "709ab9b8e451c46bd63b98ee6d0f047d",
"score": "0.6582703",
"text": "def show\n #GET a single post by ID\n @post = Post.find(params[:id])\n end",
"title": ""
},
{
"docid": "e3c4ae91ea263e2b4ef7b28dc95c8c5c",
"score": "0.658145",
"text": "def posts(opts)\n response = get(\"posts\", opts)\n response\n end",
"title": ""
},
{
"docid": "f930a982c5362c8d899dbb12fbb399a2",
"score": "0.65768254",
"text": "def show\n @post = Post.find(params[:id])\n @title = @post.title\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"title": ""
},
{
"docid": "0e4d3285b64b6124e41a7a5c68d0f4b7",
"score": "0.65733755",
"text": "def index\n # TODO: implement listing all posts\n end",
"title": ""
},
{
"docid": "ea2f746be1cf425be7f3ea6813d1fbf5",
"score": "0.6568626",
"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 format.xml { render xml: @posts }\n end\n end",
"title": ""
},
{
"docid": "74a4ae9b9818a5e3fcbd9fc061e05833",
"score": "0.65668",
"text": "def show\n @blogpost = Blogpost.published.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blogpost }\n end\n end",
"title": ""
},
{
"docid": "e28e3531e9246400b69bd72fc05b665d",
"score": "0.655592",
"text": "def show\n # @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "0ff534779eb3e55db1e9840689e5c36e",
"score": "0.65385455",
"text": "def post(postid)\n request(:id => postid).posts.first\n end",
"title": ""
},
{
"docid": "f5fd5adb61c0f9951aa4581024261f1c",
"score": "0.6525845",
"text": "def show\n Rails.logger.debug(\"Inside show \")\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "434cabd8a0bb895e99e8a8e530a380f9",
"score": "0.65144473",
"text": "def show\n @posto = Posto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @posto }\n end\n end",
"title": ""
},
{
"docid": "1dfdc568b7a32981ccff595ca201d7b0",
"score": "0.6513119",
"text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @post }\n format.json do\n render :json => @post.to_json(:only => [:id, :title, :text, :lat, :lng, :created_at, :post_type, :likes], \n :methods => [:image_url, :video_url], \n :include => [:comments])\n end\n end\n end",
"title": ""
},
{
"docid": "dd6ab48175c1e4083b633923edde6284",
"score": "0.6497587",
"text": "def display_post\n begin\n # asks the user for the post id\n print \"Enter the post ID: \"\n id = STDIN.gets.chomp\n response = RestClient.get \"#{@@DOMAIN}/api/posts/#{id}.json\", authorization_hash\n\n js = JSON response.body\n js.each do |k, v|\n puts \"#{k}: #{v}\"\n end\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end",
"title": ""
},
{
"docid": "481b9dd2207de11408d7888674b9c921",
"score": "0.6497312",
"text": "def index\n @posts = Post.all.reverse\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "09d856b2bfa3f8de3effb0244fdc93da",
"score": "0.6493223",
"text": "def index\n @posts = PostService.getAllPosts\n end",
"title": ""
},
{
"docid": "307699e3e6dc30145e044f00122b3926",
"score": "0.6491053",
"text": "def show\n render json: {\n data: @post\n }\n end",
"title": ""
},
{
"docid": "618747bea7c072c2dab1ce96181c0470",
"score": "0.64720887",
"text": "def show\n @post = Post.find(params[:id])\n @videos = Video.get_for @post #where([\"post_id = ?\", params[:id]]).all\n @background = get_background_for @post #Background::DEFAULT #Background.where([\"post_id = ?\", params[:id]])\n @nav = get_navigation :for => 'post', :current => @post\n @menu = get_menu :for => 'post'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "e62597b26e7523cae4039c0c13f35d1d",
"score": "0.6471776",
"text": "def index\n @posts = Post.order(created_at: :desc)\n respond_to do |format|\n format.html { render }\n format.text { render }\n format.xml { render xml: @posts }\n format.json { render json: @posts.to_json }\n end\n end",
"title": ""
},
{
"docid": "96f19a01d12d5838154487e552fea472",
"score": "0.64655757",
"text": "def get(options = {})\n response= handle_errors { self.class.get('/get', :query => options)}\n if response[\"posts\"][\"post\"].is_a?(Hash)\n Rubycious::Post.new response[\"posts\"][\"post\"]\n elsif response[\"posts\"][\"post\"].is_a?(Array)\n response[\"posts\"][\"post\"].collect{|i| Rubycious::Post.new(i)}\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "c0f175e22af26d409f5243cd5e43a033",
"score": "0.6455566",
"text": "def show\n if !params[:id]\n @post = Post.find_by_title('Welcome')\n elsif params[:id] =~ /^[a-zA-Z ]+$/\n @post = Post.find_by_title(params[:id])\n else\n @post = Post.find(params[:id].to_i)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "fd787dd9d67722e8d2750956abf5dab8",
"score": "0.64530945",
"text": "def show\n @blogpost = Blogpost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blogpost }\n end\n end",
"title": ""
},
{
"docid": "b2a1139696c89432cda9841b2a4c92a1",
"score": "0.6448596",
"text": "def show\n @blog_post = BlogPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog_post }\n end\n end",
"title": ""
},
{
"docid": "0c8fa5a1b9081205b4bf9b660b53d261",
"score": "0.64456475",
"text": "def index\n @post = Post.find_by_id(params[:post_id])\n if @post.nil?\n return render json: { error: \"Post not found\" }, status: :not_found\n end\n render json: @post.comments,status: 200\n end",
"title": ""
},
{
"docid": "e0483c73cb8a39acf4b656c8e578aab0",
"score": "0.64289075",
"text": "def show\n @post2 = Post2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post2 }\n end\n end",
"title": ""
}
] |
901854886de064401c469f0de55e282f
|
GET /sample3s/new GET /sample3s/new.xml
|
[
{
"docid": "37f467c3b26171bb61bb074c77230aa9",
"score": "0.0",
"text": "def new\n @sample3 = Sample3.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sample3 }\n end\n end",
"title": ""
}
] |
[
{
"docid": "3469bbbdd9708e500d43cdd17b196db9",
"score": "0.6985995",
"text": "def new\n @s3_snapshot = S3Snapshot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @s3_snapshot }\n end\n end",
"title": ""
},
{
"docid": "00519567f08b2dc2b5a888677947a32e",
"score": "0.66117877",
"text": "def create\n bucket = $s3.buckets[params[:bucket_id]] \n item = bucket.objects[params[:item][:name].original_filename]\n create_new_item(item)\n end",
"title": ""
},
{
"docid": "6456b05fddcc965b0f01f405954e767c",
"score": "0.65436465",
"text": "def create\n @s3_snapshot = S3Snapshot.new(params[:s3_snapshot])\n\n respond_to do |format|\n if @s3_snapshot.save\n flash[:notice] = 'S3Snapshot was successfully created.'\n format.html { redirect_to(@s3_snapshot) }\n format.xml { render :xml => @s3_snapshot, :status => :created, :location => @s3_snapshot }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @s3_snapshot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8433ed608f13de8730e1800d651e28b9",
"score": "0.64024645",
"text": "def aws_S3_create_page(name, permissions, content)\n begin\n s3 = AWS::S3.new\n bucket = s3.buckets[Rails.configuration.x.aws['s3_bucket_name']]\n s3.buckets.create(Rails.configuration.x.aws['s3_bucket_name']) unless bucket.exists?\n bucket.objects[name].write(content) if content\n return bucket.objects[name].url_for(permissions, expires: 10.days, :content_type => 'text/plain').to_s\n rescue\n raise\n return\n end\n end",
"title": ""
},
{
"docid": "759b90a410571365fc78d8da94ef7eb2",
"score": "0.6339222",
"text": "def new\n @example = Example.new\n\n test_upload = AjaxImageUploadS3.new('cors-dev-test')\n @s3_post_data = test_upload.post_data('demo_uploads')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @example }\n end\n end",
"title": ""
},
{
"docid": "1348fbf462263197e6eb6c5e9cc08c0d",
"score": "0.6235646",
"text": "def retrieve_from_s3\n artifact_file cached_tar_path do\n location new_resource.artifact_location\n owner new_resource.owner\n group new_resource.group\n checksum new_resource.artifact_checksum\n action :create\n end\n end",
"title": ""
},
{
"docid": "f538c803becf092083606bc1db55e142",
"score": "0.62057143",
"text": "def get_files_from_s3(bucket, key)\n # create the s3 resource object\n s3 = Aws::S3::Resource.new(region: 'us-east-1')\n\n # Create the object to retrieve\n obj = s3.bucket(bucket).object(key)\n\n # Get the item's content and save it to a file\n obj.get(response_target: '/tmp/'+key.split(\"/\")[-1])\n # Get the config file and save it\n obj2 = s3.bucket(bucket).object(key.split(\"/\")[0]+\"/\"+key.split(\"/\")[1]+\"/config.json\")\n obj2.get(response_target: '/tmp/config.json')\n return true\nend",
"title": ""
},
{
"docid": "096ea6381d45f649d9ccd0d25290f592",
"score": "0.6191474",
"text": "def create\n ## S3\n\n uploaded_io = params[:art][:file]\n filename = sanitize_filename(uploaded_io.original_filename)\n filepath = \"arts/pic\" + Time.now.to_i.to_s + filename\n AWS::S3::S3Object.store(filepath, uploaded_io.read, @@BUCKET, :access => :public_read)\n url = AWS::S3::S3Object.url_for(filepath, @@BUCKET, :authenticated => false)\n \n params[:art][:file] = url\n @art = Art.new(params[:art])\n\n respond_to do |format|\n if @art.save\n format.html { redirect_to @art, :notice => 'Art was successfully created.' }\n format.json { render :json => @art, :status => :created, :location => @art }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @art.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1d349334ef6499c7e59392613555b52",
"score": "0.61912245",
"text": "def new\n\t\t# @storeitem = StoreItem.new\n\t\t@store_item = @store.store_items.build\t\t\n\t\t@s3_direct_post = S3_BUCKET.presigned_post(key: \"uploads/stores/#{@store.id}/items/#{@store_item.id}/#{SecureRandom.uuid}/${filename}\", success_action_status: 201, acl: :public_read)\n\t\trender layout: false\t\t\n\tend",
"title": ""
},
{
"docid": "697fc03328c004e5d24563e18d276d60",
"score": "0.61467946",
"text": "def create_new_bucket bucket_name\n bucket = $s3.buckets.create(bucket_name)\n respond_to do |format|\n if bucket\n @bucket = Bucket.new(name: bucket.name)\n format.html { redirect_to @bucket, notice: 'Bucket was successfully created.' }\n format.json { render :show, status: :created, location: @bucket }\n else\n format.html { render :new }\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd446e32dc03eb9368e600d932e7c79c",
"score": "0.6106629",
"text": "def content\n s3 = Aws::S3::Resource.new\n bucket = s3.bucket @bucket_name\n fail \"bucket with name #{@bucket_name} not found\" if bucket.nil?\n bucket \n end",
"title": ""
},
{
"docid": "3be15a266965758bfed005377ab0c5a1",
"score": "0.6026516",
"text": "def create\n @s3image = S3image.new(s3image_params)\n\n respond_to do |format|\n if @s3image.save\n format.html { redirect_to @s3image, notice: 'S3image was successfully created.' }\n format.json { render :show, status: :created, location: @s3image }\n else\n format.html { render :new }\n format.json { render json: @s3image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8cde5b3cb7133f31ab5354a8a096a0a",
"score": "0.59855646",
"text": "def new_s3object(key, bucket = UFS::S3.bucket)\n s3 = ::AWS::S3::S3Object.new\n s3.key = key.to_s\n s3.bucket = bucket\n s3\n end",
"title": ""
},
{
"docid": "234a6ee243eef381f775e872ae4194da",
"score": "0.59793735",
"text": "def write_to_aws(name)\n s3 = Aws::S3::Resource.new(region: 'us-west-1')\n obj = s3.bucket('audire-test-bucket').object(\"#{name}.mp3\")\n obj.upload_file(\"/home/pan/giskards-positronic-brain/visual-classifier/sonicpi/#{name}.mp3\", acl:'public-read')\n obj.public_url\nend",
"title": ""
},
{
"docid": "d59563141779d60bc241ba842d19bb4e",
"score": "0.5964663",
"text": "def initiate_aws_s3_resource(options)\n s3 = Aws::S3::Resource.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend",
"title": ""
},
{
"docid": "563bed74f2bf5a0dfd6a3ee1aa0eb303",
"score": "0.5963127",
"text": "def create\n bucket_name = bucket_params[:name]\n bucket = $s3.buckets[bucket_name] # makes no request\n begin\n if not bucket.exists? # check if bucket already exists, if does not exist, create it\n create_new_bucket(bucket_name)\n else\n respond_to do |format|\n format.html { redirect_to buckets_url, notice: 'Bucket name already exists' }\n format.json { head :no_content }\n end\n end\n #rescue\n #create_new_bucket(bucket_name)\n end\n end",
"title": ""
},
{
"docid": "9a66e6b4ae18e05ca3ba210cbb711bc4",
"score": "0.5929979",
"text": "def new\n\t\t@restaurant = Restaurant.new\n\t\t@s3_direct_post = S3_BUCKET.presigned_post(key:\n\t\t \"uploads/#{SecureRandom.uuid}/${filename}\",\n\t\t success_action_status: 201, acl: :public_read)\n\tend",
"title": ""
},
{
"docid": "428490c0b6bf5457cd521a257a3c097a",
"score": "0.59284335",
"text": "def cfn_s3_upload\n fail_task('No S3 bucket set for template upload: please set cfn_s3_path') unless cfn_s3_path\n uri = URI(cfn_s3_path)\n obj = ::Aws::S3::Object.new(bucket_name: uri.host, key: uri.path.sub(/^\\//, ''))\n obj.put(body: cfn_template)\n obj.public_url + ((v = obj.version_id) ? \"?versionId=#{v}\" : '')\n end",
"title": ""
},
{
"docid": "c589109185b9b1faa849f8436a06b537",
"score": "0.5908417",
"text": "def create\n @moto3 = Moto3.new(moto3_params)\n\n respond_to do |format|\n if @moto3.save\n format.html { redirect_to :action=>'index', notice: 'Moto3 was successfully created.' }\n format.json { render :index, status: :created, location: @moto3 }\n else\n format.html { render :new }\n format.json { render json: @moto3.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56ab81cef94f1eb42149ace2aa22be2c",
"score": "0.5857189",
"text": "def gen_s3_data\n render :json => {\n :policy => s3_upload_policy_document, \n :signature => s3_upload_signature, \n :key => \"uploads/temp/#{SecureRandom.uuid}/#{params[:doc][:title]}\",\n :success_action_redirect => photos_gen_from_s3_url(params[:persona_id])\n }\n\tend",
"title": ""
},
{
"docid": "d23e5d569317577bc7ff9c8a31db90c1",
"score": "0.58403265",
"text": "def create\n upload = Upload.new(params)\n if upload.s3_exists?\n Rails.logger.warn \"already_exist_s3 #{upload.object_key}\"\n render json: {status: \"already_exist\"}\n else\n upload.save!\n upload_sign = upload.generate_part_upload_signature\n render json: {status: 'upload_ready', \n secure_random: params[:secureRandom], name: params[:name],\n chunk_size: upload.chunk_size,\n upload: { url: upload_sign.url.to_s, upload_id: upload.id,\n fields: upload_sign.fields, \n part_prefix: upload.part_prefix\n }}\n end\n end",
"title": ""
},
{
"docid": "4c0dd6c96182f7396b180aa1be7eadfe",
"score": "0.5833018",
"text": "def new\n @bucket = Bucket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bucket }\n end\n end",
"title": ""
},
{
"docid": "4c0dd6c96182f7396b180aa1be7eadfe",
"score": "0.5833018",
"text": "def new\n @bucket = Bucket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bucket }\n end\n end",
"title": ""
},
{
"docid": "4c0dd6c96182f7396b180aa1be7eadfe",
"score": "0.5833018",
"text": "def new\n @bucket = Bucket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bucket }\n end\n end",
"title": ""
},
{
"docid": "422cbf337c05043310987890b1ee33f4",
"score": "0.5790074",
"text": "def s3_prefix\n \"objects\"\n end",
"title": ""
},
{
"docid": "a92df34a305615604a21337fc278bca9",
"score": "0.5789334",
"text": "def add_contact_to_s3 first_name, last_name\n\n\ts3 = AWS::S3.new(access_key_id: $access_key, secret_access_key: $secret_key)\n\tcloudhw1 = s3.buckets['cloudhw1']\n\n\ts3_key = generate_s3_key first_name, last_name\n\ts3_html = generate_s3_html first_name, last_name\n\n\tcloudhw1.objects.create(s3_key, s3_html)\n\n\tpost_notification \"#{first_name} #{last_name}\", s3_html\n\t\n\treturn\n\nend",
"title": ""
},
{
"docid": "f563864db547f7d6aeb99c12c26e7f6d",
"score": "0.5779783",
"text": "def s3_confirm\n head :ok\n end",
"title": ""
},
{
"docid": "f563864db547f7d6aeb99c12c26e7f6d",
"score": "0.5779783",
"text": "def s3_confirm\n head :ok\n end",
"title": ""
},
{
"docid": "822fef02b663dc3e6902a4d4d03760fe",
"score": "0.5764072",
"text": "def create\n @s3config = S3Config.new(profile_params)\n\n respond_to do |format|\n if @s3config.save\n flash[:notice] = 's3 config was successfully created.'\n format.html { redirect_to action: \"index\"}\n \n format.json { render :show, status: :created, location: @s3config }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @s3config.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e4e9622059029a6a0705f80d0bea713",
"score": "0.57580936",
"text": "def upload_to_s3(json)\n p json\nend",
"title": ""
},
{
"docid": "aa4802e7c1f600bb6b758bb142dfd969",
"score": "0.5737567",
"text": "def configure_s3_bucket\n connection = Fog::Storage.new(:provider => 'AWS',\n :aws_access_key_id => Constants::S3_ACCESS_KEY_ID,\n :aws_secret_access_key => Constants::S3_SECRET_ACCESS_KEY)\n\n connection.directories.create(:key => Constants::S3_BUCKET_NAME,\n :public => true)\n end",
"title": ""
},
{
"docid": "98ae4ad9291ecf3627576e3fd84e43f7",
"score": "0.5731106",
"text": "def new_object(attributes = {})\n object = S3Object.new(attributes)\n register(object)\n object\n end",
"title": ""
},
{
"docid": "e59709be6ee79afc5f010e889a67c317",
"score": "0.5697189",
"text": "def initiate_aws_s3_object(options)\n s3 = Aws::S3::Object.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend",
"title": ""
},
{
"docid": "50d5256134a23bc388beb63ae418af8c",
"score": "0.5685519",
"text": "def initiate_aws_s3_bucket(options)\n s3 = Aws::S3::Bucket.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend",
"title": ""
},
{
"docid": "ce85b4e78ee772b88859f44225306e32",
"score": "0.5679613",
"text": "def create\n @bucket = Bucket.new(params[:bucket])\n\n respond_to do |format|\n if @bucket.save\n format.html { redirect_to @bucket, notice: 'Bucket was successfully created.' }\n format.json { render json: @bucket, status: :created, location: @bucket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce85b4e78ee772b88859f44225306e32",
"score": "0.5679613",
"text": "def create\n @bucket = Bucket.new(params[:bucket])\n\n respond_to do |format|\n if @bucket.save\n format.html { redirect_to @bucket, notice: 'Bucket was successfully created.' }\n format.json { render json: @bucket, status: :created, location: @bucket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c365b94e29ccaeae8d5e4e0bf81d575c",
"score": "0.5672925",
"text": "def download_new_master_ip_list(temp_path)\n # reads contents of temp-scannable-instances.json\n # and writes the contents to a new local master-scannable-instances.json\n File.open('./output/master-scannable-instances.json', 'w') do |file|\n file.write(@s3_client.get_object(bucket: @options[:bucketname], key: temp_path).body.read)\n end\nend",
"title": ""
},
{
"docid": "1236059139fb6be95286225c18d091d5",
"score": "0.5672224",
"text": "def init_aws\n @s3 = Aws::S3::Resource.new\n end",
"title": ""
},
{
"docid": "fd777e3ad9522594561d1a168d337ad0",
"score": "0.56514937",
"text": "def create_bucket(bucketname, s3)\n begin \n s3.create_bucket(bucketname)\n rescue \n puts bucketname + ' bucket already exists...' \n end\nend",
"title": ""
},
{
"docid": "dabec2046feb45de6cef845324634812",
"score": "0.56493807",
"text": "def create_aws_s3_bucket(options)\n s3 = initiate_aws_s3_resource(options)\n if s3.bucket(options['bucket']).exists?\n handle_output(options,\"Information:\\tBucket: #{options['bucket']} already exists\")\n s3 = initiate_aws_s3_client(options['access'],options['secret'],options['region'])\n begin\n s3.head_bucket({ bucket: options['bucket'], })\n rescue\n handle_output(options,\"Warning:\\tDo not have permissions to access bucket: #{options['bucket']}\")\n quit(options)\n end\n else\n handle_output(options,\"Information:\\tCreating S3 bucket: #{options['bucket']}\")\n s3.create_bucket({ acl: options['acl'], bucket: options['bucket'], create_bucket_configuration: { location_constraint: options['region'], }, })\n end\n return s3\nend",
"title": ""
},
{
"docid": "aabf5326f084787edfab4fec2655299b",
"score": "0.5646188",
"text": "def initialize_bucket(bucket_name)\n connect_to_s3\n bucket = AWS::S3::Bucket.find(bucket_name, :max_keys => 1) \n bucket = AWS::S3::Bucket.create(bucket_name) unless bucket\n bucket\n end",
"title": ""
},
{
"docid": "428de9200823f447e839709ec90139e6",
"score": "0.5632436",
"text": "def s3_publish\n sts = AWS::STS.new\n user = sts.assume_role(:role_arn => @config[:publishing_role_arn], :role_session_name => \"Upload\")\n AWS::S3.new(user[:credentials])\nend",
"title": ""
},
{
"docid": "e57ea0dba0c429a169e20dcb2604bbd8",
"score": "0.56307966",
"text": "def newBucket\n innerNewBucket \n end",
"title": ""
},
{
"docid": "39b2844a1aeabd40d51c60aa787e13d6",
"score": "0.5629263",
"text": "def s3 ; @s3 ||= RDSBackup.s3 end",
"title": ""
},
{
"docid": "7796393f6c444b8194def54752ca3a65",
"score": "0.56277347",
"text": "def load_from_s3(bucket)\n template = s3_object(\"template.json\")\n params = s3_object(\"parameters.json\").read\n resources = s3_object(\"resources.json\").read\n return template, JSON.parse(params), JSON.parse(resources)\n end",
"title": ""
},
{
"docid": "3fba723778b992993d00566d547ca169",
"score": "0.56237304",
"text": "def filelist\n connect\n orgfiles = \"<table>\"\n orgmodebucket = AWS::S3::Bucket.find(Mybucketname)\n orgmodebucket.each do |object|\n if !object.key.include?(\"DS\")\n orgfiles << \"<tr><td><a href=\\\"/openfile/#{object.key}\\\">#{object.key}</a></td><td>#{object.about['content-length']}</td><td>#{object.about['last-modified']}</td></tr>\"\n end\n end\n orgfiles << \"</table>\"\n orgfiles << \"<br><br><form action=\\\"/neworg/\\\" method=\\\"post\\\"><input type='text' name='filename'><input type='submit' value='new'></form>\"\n return orgfiles\nend",
"title": ""
},
{
"docid": "2443e3fe5f8fd9561e6c63de95a271e3",
"score": "0.5622356",
"text": "def aws_uploads\n render json: {\n policy: aws_s3_upload_policy_document,\n signature: aws_s3_upload_signature,\n key: params[:doc][:directory] + \"/\" + params[:doc][:filename],\n success_action_redirect: \"/\"\n }\n end",
"title": ""
},
{
"docid": "3c5bee2bd7f4275321151ec92d72552a",
"score": "0.5614164",
"text": "def show\n # call index in items controller and pass the bucket name\n #redirect_to @item\n bucket = $s3.buckets[params[:id]] \n @bucket = Bucket.new(name: bucket.name)\n @objects = bucket.objects\n @policy = bucket.acl #Show the bucket policy for a named bucket\n @versioning = bucket.versioning_enabled?\n end",
"title": ""
},
{
"docid": "33198e6f289888b4ff8ece6280f4424f",
"score": "0.56060654",
"text": "def newContact(domain, action)\n arr = getInput\n arr.insert(0,SecureRandom.uuid)\n\n generateSimpleDBContact(arr, domain)\n\n generateFile(arr)\n\n\n bucket = changeBucket(\"melis_#{domain.name}\")\n #bucket = changeBucket($s3.buckets[\"melis_#{domain.name}\"])\n sendFile(arr,bucket)\n\n publish(arr, action)\nend",
"title": ""
},
{
"docid": "f20195f6a003abdc01bf2420424055ed",
"score": "0.5604904",
"text": "def download_files_from_S3_bucket(s3bucket_name, delete_first, dest_folder)\n s3conn = Fog::Storage.new({\n :provider => 'AWS',\n :aws_access_key_id => node[:s3_to_ec2][:aws_access_key],\n :aws_secret_access_key => node[:s3_to_ec2][:aws_secret_key]})\n\n s3_bucket = s3conn.directories.get(s3bucket_name)\n file_keys = []\n s3_bucket.files.each {|f| file_keys << f.key }\n file_keys.each do |key|\n dest = \"#{dest_folder}\\\\#{key}\"\n File.delete(dest) if File.exists?(dest) && delete_first\n if not File.exists?(dest)\n Chef::Log.info(\"copying S3 file to #{dest}...\")\n File.open(dest, 'wb') do |local_file|\n s3_bucket.files.get(key) do |chunk, remaining_bytes, total_bytes|\n local_file << chunk\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "6b01b387eed2f1bfe866d6dc6e9cb0b4",
"score": "0.55849445",
"text": "def run\n super\n bucket_uri = _get_entity_name\n bucket_uri.chomp!(\"/\")\n\n unless bucket_uri =~ /s3.amazonaws.com/\n _log_error \"Not an Amazon S3 link?\"\n return\n end\n\n [*('a'..'z'),*('A'..'Z'),*('0'..'9')].each do |letter|\n doc = Nokogiri::HTML(http_get_body(\"#{bucket_uri}?prefix=#{letter}\"))\n doc.xpath(\"//contents\").each do |item|\n key = item.xpath(\"key\").text\n size = item.xpath(\"size\").text.to_i\n _log \"#{size/1000}: #{bucket_uri}/#{key}\"\n _create_entity(\"Uri\", {\"name\" => \"#{bucket_uri}/#{key}\", \"uri\" => \"#{bucket_uri}/#{key}\" })\n end\n end\n end",
"title": ""
},
{
"docid": "9c3bcc92ade5c5212e1a0acbc8de8ccc",
"score": "0.5570819",
"text": "def create_bucket(bucket_name)\n\n begin\n puts 'Creating the bucket now.'\n if AWS::S3::Bucket.create(bucket_name)\n puts \"Good, bucket #{bucket_name} created.\"\n end\n rescue \n puts \"The bucket #{bucket_name} could not be created\"\n return\n end\n\nend",
"title": ""
},
{
"docid": "8578ec1a93c0dfaa88b5bc2e56cde33f",
"score": "0.5567179",
"text": "def make_bucket_public\n @bucket_name = params[:bucket_name]\n S3Model.set_acl_public_read(@bucket_name)\n flash[:notice] = \"Set bucket '\" + @bucket_name + \"' ACL to 'public-read'\"\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "7d7b28c96ae23c7eaf041e965a5fcb77",
"score": "0.5563541",
"text": "def show\n @s3_snapshot = S3Snapshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @s3_snapshot }\n end\n end",
"title": ""
},
{
"docid": "9073b9f7c8c01bc4cae8e03117a1193f",
"score": "0.556252",
"text": "def generate_url(file)\n\n bucket = \"timbersafe-s3\"\n s3_file_path = \"testresize/#{file}\"\n\n connect_to_s3()\n signer = Aws::S3::Presigner.new\n url = signer.presigned_url(:get_object, bucket: bucket, key: s3_file_path)\n\nend",
"title": ""
},
{
"docid": "60e12fd87bade3020cb0cd4d6ed6fbc3",
"score": "0.55508715",
"text": "def url\r\n return [AWS_S3_ROOT, @path.split(\"/\").map{|p| ERB::Util.url_encode(p)}.join(\"/\")].join()\r\n end",
"title": ""
},
{
"docid": "f0f7a3323226c55632b18a0a5e00bb3f",
"score": "0.5550021",
"text": "def create_bucket(bucket_name)\n begin\n puts 'Creating the bucket now.'\n if AWS::S3::Bucket.create(bucket_name)\n puts \"Good, bucket #{bucket_name} created.\"\n end\n rescue \n puts \"The bucket #{bucket_name} could not be created\"\n return\n end\nend",
"title": ""
},
{
"docid": "5f2cf24850c5054133e572c8d33a1095",
"score": "0.5546115",
"text": "def s3_object(path)\n @task.s3_object(\"cloudformation/#{@name}/#{path}\")\n end",
"title": ""
},
{
"docid": "9a89d4bbd7704d2fb3e8297ad2ffa9ff",
"score": "0.5542612",
"text": "def s3_retrieve(bucket, specific_file)\n msg \"Retrieving #{specific_file} from #{bucket} on S3\"\n open(specific_file, 'w') do |file|\n AWS::S3::S3Object.stream(specific_file, bucket) do |chunk|\n file.write chunk\n end\n end\n msg \"Retrieved #{specific_file} from #{bucket} on S3\"\n end",
"title": ""
},
{
"docid": "29375fe51bf05843f3d4ec9fdc25d4fd",
"score": "0.5514451",
"text": "def upload\n # Upload the given file\n AWS::S3::S3Object.store( FILE,\n open( FILE ),\n BUCKET,\n :access => :public_read )\n\n # display the URL of the file just uploaded\n puts AWS::S3::S3Object.url_for((FILE), BUCKET)[/[^?]+/]\nend",
"title": ""
},
{
"docid": "84cb133736dab77435f9ade378c91ca5",
"score": "0.5502605",
"text": "def prepare_s3(bucket)\n bucket_new = deep_copy(bucket)\n bucket_old = deep_copy(bucket['Resources']['EncryptedS3Bucket'])\n bucket_name = \"bucket#{rand(1...999)}-${AWS::StackName}-${AWS::AccountId}\"\n\n #assign the values accordingly\n bucket_new['Resources'][\"EncryptedS3Bucket\"][\"Properties\"][\"BucketName\"][\"Fn::Sub\"] = bucket_name\n bucket_new['Resources'].delete(\"myVPC\")\n bucket_new\n end",
"title": ""
},
{
"docid": "9da2c10d4cdd856ee0c711914914eab7",
"score": "0.5501113",
"text": "def create_s3_resource(credentials)\n Aws::S3::Resource.new(client: Aws::S3::Client.new(credentials: credentials))\n end",
"title": ""
},
{
"docid": "896e5eee60dc4e45cf5a8c3bd71db16a",
"score": "0.54859704",
"text": "def create\n @amazon = Amazon.new(params[:amazon])\n\n respond_to do |format|\n if @amazon.save\n format.html { redirect_to(@amazon, :notice => 'Amazon was successfully created.') }\n format.xml { render :xml => @amazon, :status => :created, :location => @amazon }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @amazon.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a9e6fd1731d983fa4f86a33aaf537c6",
"score": "0.5477208",
"text": "def new\n @amazon = Amazon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @amazon }\n end\n end",
"title": ""
},
{
"docid": "cfb1864c0ce88e00fcde5e8ae51bf94a",
"score": "0.546789",
"text": "def test_item_versions \n @bucket = params[:bucket]\n bucket = $s3.buckets[@bucket]\n\n bucket.enable_versioning \n\n obj = bucket.objects['test_object'] \n obj.write('change 1')\n obj.write('change 2')\n obj.delete\n obj.write('change 3')\n\n @item = obj\n\n redirect_to bucket_path(params[:bucket]), notice: \"New test object (#{@item.key}) created with changes to show versions\"\n\n end",
"title": ""
},
{
"docid": "f242da41ad8d2982fb8e4675e5a2cfbd",
"score": "0.54641163",
"text": "def upload_to_s3\n @s3 = S3.new if @s3.nil?\n @s3.upload_if_not_present @kml, kml_filename\n end",
"title": ""
},
{
"docid": "fd7b6a441dd9e5b86913d001b7c669b8",
"score": "0.5450041",
"text": "def create\n @resource = Resource.new(resource_params)\n @resource.bucket_id = params[:bucket_id]\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to [:manage, @resource.bucket, @resource], notice: '文件上传成功' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9898d0342ace217a27291d84712cc98",
"score": "0.5446433",
"text": "def fetch_file(s3client,plaintext_key,filename,bucket)\r\n begin\r\n s3enc = Aws::S3::Encryption::Client.new(encryption_key: plaintext_key,\r\n client: s3client)\r\n res = s3enc.get_object(bucket: bucket,\r\n key: filename,\r\n response_target: filename)\r\n rescue Aws::S3::Errors::ServiceError => e\r\n puts \"upload failed: #{e}\"\r\n end\r\nend",
"title": ""
},
{
"docid": "6a73a8bc1ac7a5afb6f5eb4a2c92b558",
"score": "0.54417485",
"text": "def upload_to_s3\n hash = Digest::SHA1.hexdigest(original_url)\n key = \"#{id}-#{hash}#{extension}\"\n AWS::S3::S3Object.store(key,\n open(original_url),\n S3_BUCKET,\n :access=>:public_read)\n self.update_attribute :s3_key, key\n end",
"title": ""
},
{
"docid": "7876d15c0969cafcafef5eb1f6edeaec",
"score": "0.5441542",
"text": "def create\n upload_meta = prepare_to_upload\n response = upload_to_aws_s3(upload_meta)\n notify_ribose_file_upload_endpoint(response, upload_meta.fields.key)\n end",
"title": ""
},
{
"docid": "1a5ba044c710275d33fbae45f66a6753",
"score": "0.5440372",
"text": "def show\n authorize @document, :show?\n redirect_to Aws::S3::Object.new(@document.s3_bucket, @document.s3_key).presigned_url(:get)\n end",
"title": ""
},
{
"docid": "a3e4d2d3dab69fb2d692a189e13ccfd0",
"score": "0.54386276",
"text": "def create\n sts = AWS::STS.new\n policy = AWS::STS::Policy.new\n\n # let's put the policy in this way first. We'll worry about it later\n policy.allow(:actions => ['s3:*'],\n :resources => :any)\n \n #policy.allow(:action => ['s3:GetObject'],\n # :resources => \"arn:aws:s3:::xoxo_img/pictures/*\")\n \n # duration is in seconds, ranging from 3600s to 129600s (36 hours)\n federated_session = sts.new_federated_session(\"TempUser\", :policy => policy, :duration => 60 * 60)\n\n render json: {\"ACCESS_KEY_ID\" => federated_session.credentials[:access_key_id], \n \"SECRET_KEY\" => federated_session.credentials[:secret_access_key],\n \"SESSION_TOKEN\" => federated_session.credentials[:session_token],\n \"expires_at\" => federated_session.expires_at} \n\n \n end",
"title": ""
},
{
"docid": "2479db4e0da20dbb904ad2e2f7427b2c",
"score": "0.54363257",
"text": "def sample_expt_s3_path\n \"s3://#{SAMPLES_BUCKET_NAME}/#{sample_path}/expt\"\n end",
"title": ""
},
{
"docid": "cc02253c29ae6269c78b05d90dd1fe49",
"score": "0.54331976",
"text": "def bucket_created?(s3_client, bucket_name)\n s3_client.create_bucket(bucket: bucket_name)\nrescue StandardError => e\n puts \"Error while creating the bucket named '#{bucket_name}': #{e.message}\"\nend",
"title": ""
},
{
"docid": "581aab1a77243e34cdf114d97de5c526",
"score": "0.5431739",
"text": "def get_S3Bucket(name, id, key)\n\tbucket = Fog::Storage.new(\n\t\tprovider: \"AWS\",\n\t\taws_access_key_id: id,\n\t\taws_secret_access_key: key,\n\t\tregion: \"eu-central-1\"\n\t).directories.get(name)\nend",
"title": ""
},
{
"docid": "98b4fa3d92e1d1b628263096629e205c",
"score": "0.5430142",
"text": "def find_or_create_bucket\n begin\n AWS::S3::Bucket.find(@bucket_name)\n rescue\n puts \"Bucket #{@bucket_name} not found.\"\n puts 'Creating the bucket now.'\n AWS::S3::Bucket.create(@bucket_name)\n puts \"Good, bucket #{@bucket_name} created.\"\n end\n puts \"Good, bucket #{@bucket_name} found.\"\nend",
"title": ""
},
{
"docid": "7f8969e4d54bf43743f0025b78bb3aca",
"score": "0.54280436",
"text": "def index\r\n #Aws.use_bundled_cert!\r\n\t #s3 = Aws::S3::Client.new\r\n\t # yields one response object per API call made, this will enumerate\r\n\t # EVERY object in the named bucket\r\n\t #@photos= s3.list_objects(bucket: 'project-cararosevear' )\r\n \r\n \r\n\t#@photos = Photo.all\r\n\t if params[:search]\r\n\t \t@photos = Photo.search(params[:search]).order(\"created_at DESC\")\r\n\t else\r\n\t \t@photos = Photo.all.order(\"created_at DESC\")\r\n\t end\r\n\r\n end",
"title": ""
},
{
"docid": "42102a72bf26beca3058e8a008045d57",
"score": "0.5426628",
"text": "def run_me\n bucket_name = 'doc-example-bucket'\n region = 'us-west-2'\n\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Creating the bucket '#{bucket_name}'...\"\n\n if bucket_created?(s3_client, bucket_name)\n puts 'The bucket was created.'\n else\n puts 'The bucket was not created. Stopping program.'\n exit 1\n end\nend",
"title": ""
},
{
"docid": "8bfcc0e81fc271849b7c73df882a39cd",
"score": "0.5425679",
"text": "def get(bucket:, path:, access_key_id:, secret_access_key:, token: nil, region: nil)\n region ||= 'us-east-1' # Most buckets.\n path = path[1..-1] if path[0] == '/'\n now = Time.now().utc.strftime('%a, %d %b %Y %H:%M:%S GMT')\n\n string_to_sign = \"GET\\n\\n\\n#{now}\\n\"\n string_to_sign << \"x-amz-security-token:#{token}\\n\" if token\n string_to_sign << \"/#{bucket}/#{path}\"\n\n signed = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), secret_access_key, string_to_sign)\n signed_base64 = Base64.encode64(signed)\n\n headers = {\n 'date' => now,\n 'authorization' => \"AWS #{access_key_id}:#{signed_base64}\",\n }\n headers['x-amz-security-token'] = token if token\n\n hostname = case region\n when 'us-east-1'\n 's3.amazonaws.com'\n else\n \"s3-#{region}.amazonaws.com\"\n end\n\n begin\n Chef::HTTP.new(\"https://#{hostname}\").get(\"#{bucket}/#{path}\", headers)\n rescue Net::HTTPServerException => e\n raise CitadelError.new(\"Unable to download #{path}: #{e}\")\n end\n end",
"title": ""
},
{
"docid": "d8f0777109932db490807d22b0a04cbb",
"score": "0.5422549",
"text": "def index\n @s3images = S3image.all\n end",
"title": ""
},
{
"docid": "cc529d55f8aff4b518c14214f87fa5d2",
"score": "0.54107744",
"text": "def execute()\r\n s3 = Aws::S3::Client.new(access_key_id: @info_values['access_key_id'],\r\n secret_access_key: @info_values['secret_access_key'],\r\n region: @parameters['region'])\r\n\r\n signer = Aws::S3::Presigner.new( {client: s3} )\r\n\r\n seconds_to_expire_int = @parameters['seconds_to_expire'].to_i\r\n\r\n url = signer.presigned_url(:get_object, bucket: @parameters['bucket'], key: @parameters['key'], expires_in: seconds_to_expire_int )\r\n\r\n # Build the results XML that will be returned by this handler.\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Public Url\">#{escape(url)}</result>\r\n </results>\r\n RESULTS\r\n end",
"title": ""
},
{
"docid": "1eed5657cf766aaa4ea44be6c7d24d05",
"score": "0.5408932",
"text": "def run_demo\n bucket_name = \"doc-example-bucket\"\n object_key = \"my-object.txt\"\n target_path = \"my-object-as-file.txt\"\n\n wrapper = ObjectGetWrapper.new(Aws::S3::Object.new(bucket_name, object_key))\n obj_data = wrapper.get_object(target_path)\n return unless obj_data\n\n puts \"Object #{object_key} (#{obj_data.content_length} bytes} downloaded to #{target_path}.\"\nend",
"title": ""
},
{
"docid": "0ee7228e3dee886653f1d1cac54fef98",
"score": "0.5408601",
"text": "def run_me\n bucket_name = 'doc-example-bucket'\n region = 'us-east-1'\n\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Creating the bucket '#{bucket_name}'...\"\n\n if bucket_created?(s3_client, bucket_name)\n puts 'The bucket was created.'\n else\n puts 'The bucket was not created. Stopping program.'\n exit 1\n end\nend",
"title": ""
},
{
"docid": "d33bfdc3b5b4537da9b05cb2d2b7d959",
"score": "0.5404675",
"text": "def s3_configuration; end",
"title": ""
},
{
"docid": "3a117bbead9dbc6b7062e249fc792676",
"score": "0.54045624",
"text": "def create_bucket\n bucket = @s3_resource.create_bucket(\n bucket: \"doc-example-bucket-#{Random.uuid}\",\n create_bucket_configuration: {\n location_constraint: \"us-east-2\" # Note: only certain regions permitted\n }\n )\n puts(\"Created demo bucket named #{bucket.name}.\")\n rescue Aws::Errors::ServiceError => e\n puts(\"Tried and failed to create demo bucket.\")\n puts(\"\\t#{e.code}: #{e.message}\")\n puts(\"\\nCan't continue the demo without a bucket!\")\n raise\n else\n bucket\n end",
"title": ""
},
{
"docid": "58d4821e5d2a71a1de71cd99188a0ff8",
"score": "0.53985816",
"text": "def new\n @aws_picture = AwsPicture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aws_picture }\n end\n end",
"title": ""
},
{
"docid": "501bda8d18bf207cc2e003331621b040",
"score": "0.5394265",
"text": "def new\n @log_pelea_sf3 = LogPeleaSf3.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @log_pelea_sf3 }\n end\n end",
"title": ""
},
{
"docid": "86b81f11dae88f65bcdfc1464d3e913b",
"score": "0.53889877",
"text": "def download_s3_file(image_info)\n\n folder = image_info[0]\n filename = image_info[1]\n bucket = \"timbersafe-s3\"\n s3_file_path = \"#{folder}/#{filename}\"\n swap_file = \"./public/swap/#{filename}\" # use when running via app.rb\n # swap_file = \"../public/swap/#{file}\" # use when running locally from /lib/s3_bucket.rb\n \n s3 = connect_to_s3()\n file = File.new(swap_file, 'wb')\n s3.get_object({ bucket:bucket, key:s3_file_path }, target: swap_file)\n file.close if file\n\nend",
"title": ""
},
{
"docid": "011d5b8c67123701482cf2162e52698e",
"score": "0.5388931",
"text": "def publish name, content, headers\n result = s3.put(BUCKET, name, content, headers)\n if result\n Log.info \"Deployed #{name} successful\"\n end\nend",
"title": ""
},
{
"docid": "9cb4c758f1f35ee4843589b564b6b4e1",
"score": "0.53790724",
"text": "def test_simple_s3_call\n @@recorder.begin_segment name\n s3 = Aws::S3::Client.new(stub_responses: true)\n bucket_data = s3.stub_data(:list_buckets, buckets: [{ name: '1' }, { name: '2' }])\n s3.stub_responses(:list_buckets, bucket_data)\n s3.list_buckets\n @@recorder.end_segment\n subsegment = @@recorder.emitter.entities[0].subsegments[0]\n\n assert_equal 'aws', subsegment.namespace\n aws_meta = subsegment.aws\n assert_equal 'ListBuckets', aws_meta[:operation]\n end",
"title": ""
},
{
"docid": "c90b2161a4b6bb423aa0304199ebb5a6",
"score": "0.53773427",
"text": "def get(options={})\n # Get the base URI to this bucket, and append any subset options\n # onto the query string.\n uri = uri()\n suffix = '?'\n\n # For every option the user provided...\n options.each do |param, value| \n # ...if it's one of the S3 subset options...\n if [:Prefix, :Marker, :Delimiter, :MaxKeys].member? :param\n # ...add it to the URI.\n uri << suffix << param.to_s << '=' << URI.escape(value)\n suffix = '&'\n end\n end\n\n # Now we've built up our URI. Make a GET request to that URI and\n # read an XML document that lists objects in the bucket.\n doc = REXML::Document.new(open(uri).read)\n there_are_more = REXML::XPath.first(doc, \"//IsTruncated\").text == \"true\"\n\n # Build a list of S3::Object objects.\n objects = []\n # For every object in the bucket...\n REXML::XPath.each(doc, \"//Contents/Key\") do |e|\n # ...build an S3::Object object and append it to the list.\n objects << Object.new(self, e.text) if e.text\n end\n return objects, there_are_more\n end",
"title": ""
},
{
"docid": "16383b9566093eb48f1056f2ee56a595",
"score": "0.53733945",
"text": "def get_amazon_bucket_id\n unless params[:username].nil? && params[:password].nil?\n result = Authentication.authenticate(params[:username].to_s,params[:password].to_s)\n unless result.nil?\n unless result.bucketKey.nil?\n render :json => {:BucketId => result.bucketKey}\n else\n result.bucketKey = \"versavault-\" + Time.now.strftime(\"%y%m%d%H%M%S\").to_s\n if result.save\n #AWS::S3::Bucket.create(result.bucketKey,:access => :public_read)\n s3 = AWS::S3.new(:access_key_id => AMAZON_CONFIG[\"access_key_id\"],:secret_access_key => AMAZON_CONFIG[\"secret_access_key\"])\n bucket = s3.buckets.create(result.bucketKey)\n unless bucket.nil?\n bucket.enable_versioning\n result.save\n end\n end\n render :json => {:BucketId => result.bucketKey}\n end\n else\n render :json => {:Error => \"Invalid username or password.\"}\n end\n else\n render :json => {:Error => \"Invalid parameters password.\"}\n end\n end",
"title": ""
},
{
"docid": "c80becb7f9923808041330bd2a884509",
"score": "0.53721803",
"text": "def new\n @aws_key = AwsKey.new\n \n respond_to do |format|\n format.html\n format.xml { render :xml => @aws_key.to_xml }\n end\n end",
"title": ""
},
{
"docid": "d41aee47926ce3bd89cc80c7717a527b",
"score": "0.53537935",
"text": "def new\n @bucket = current_user.buckets.build\n @help = \"New General Bucket\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bucket }\n end\n end",
"title": ""
},
{
"docid": "a1d9f2138715a66a56a57c0616afa046",
"score": "0.5353194",
"text": "def show_item\n @storage_class_standard = true\n @bucket = params[:bucket]\n @item = params[:item]\n\n bucket = $s3.buckets[params[:bucket]] \n @object = bucket.objects[@item]\n \n bucket.objects.each do |object|\n object.metadata['content-type'] = 'application/json'\n metadata = object.head\n @metadata = metadata.to_hash\n end\n end",
"title": ""
},
{
"docid": "65c1fd27306815b00b5a853869e0801a",
"score": "0.53447616",
"text": "def init_bucket(bucket_name)\n\tbucket = @s3.buckets[bucket_name]\n\tif bucket.exists?\n\t\tputs \"Bucket '#{bucket_name}' already exists. Adding to this bucket.\"\n\telse\n\t\t# create a bucket\n\t\tb = @s3.buckets.create(bucket_name, :acl => :public_read)\n\t\t#b.configure_website do |cfg|\n\t\t # cfg.index_document_suffix = 'index.html'\n\t\t#end\n\t\tputs \"Bucket '#{bucket_name}' created.\"\n\tend\n\t#puts \" \" #blank line for readibility\nend",
"title": ""
},
{
"docid": "2d0afbc8503bf0329c3c33eedb81b5e8",
"score": "0.53405786",
"text": "def respond_with_content(uri:)\n begin\n resp = $s3_client.get_object({\n bucket: CONTENT_BUCKET,\n key: \"public/#{uri}\"\n })\n\n {\n isBase64Encoded: false,\n statusCode: 200,\n headers: {\n 'Content-Type': 'text/html'\n },\n body: Kramdown::Document.new(resp.body.read).to_html\n }\n rescue Aws::S3::Errors::NoSuchKey\n failure(message: 'Not found')\n end\nend",
"title": ""
},
{
"docid": "7ad0f8f0970f20b8b1a3b92cc1ad4fa3",
"score": "0.53357285",
"text": "def add_bucket\n puts @bucket_name\n @bucket = @s3.buckets.create(@bucket_name)\n puts \"Created new bucket '#{@bucket_name}' in region '#{@region}'.\"\n configure_bucket\n end",
"title": ""
},
{
"docid": "8a0c0493a4033c05b43df613ae0d12e7",
"score": "0.53337276",
"text": "def bucket_arn; \"arn:aws:s3:*:*:#{bucket_name}\" end",
"title": ""
},
{
"docid": "77f6d1b3c3388381f77d2ddfbb24e8de",
"score": "0.5323278",
"text": "def create_bucket(bucket_name, options={})\n options[:send_goog_project_id] = true\n resp = put(bucket_name, '/', options)\n resp_obj = Crack::XML.parse(resp.body)\n if resp.code == \"200\"\n resp_obj.clear\n resp_obj[:success] = true\n resp_obj[:bucket_name] = bucket_name\n resp_obj[:message] = \"Bucket created\"\n end\n return resp_obj\n end",
"title": ""
},
{
"docid": "73ec0ac53d6749096eaa944e00e757dc",
"score": "0.5317197",
"text": "def bucket_path\n \"https://#{@bucket}.s3.amazonaws.com\"\n end",
"title": ""
}
] |
10bae78df6365f4630179a6833132e12
|
GET /invoices/new GET /invoices/new.json
|
[
{
"docid": "ddc7032891c6754c364fae4885ada27d",
"score": "0.73668635",
"text": "def new\n @invoice = Invoice.new\n $details = Array.new\n @customers = Customer.all\n @retire_notes = Array.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end",
"title": ""
}
] |
[
{
"docid": "6b4b6b027324f8bdc5ac20f16f761f28",
"score": "0.8076558",
"text": "def new\n # @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end",
"title": ""
},
{
"docid": "91e2cea6900c1060a13204141a8a5c6b",
"score": "0.8040652",
"text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @invoice }\n end\n end",
"title": ""
},
{
"docid": "7869b8f5546437f3d0bb6facad2c5923",
"score": "0.79138124",
"text": "def new\n @invoice = Invoice.new\n @counter = InvoiceNumbers.first\n @items = Item.find_all_by_invoice_id(@invoice.invoice_id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end",
"title": ""
},
{
"docid": "7927d9f3ed0589b680cc637a04dc3260",
"score": "0.76833296",
"text": "def new\n @breadcrumb = 'create'\n @invoice_type = InvoiceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_type }\n end\n end",
"title": ""
},
{
"docid": "78aa546fc9897da2107d614499f0512f",
"score": "0.7673899",
"text": "def new\n @invoice = Invoice.new\n @stores = Store.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end",
"title": ""
},
{
"docid": "7575b23d654013e05e5744b53bf7c231",
"score": "0.75987357",
"text": "def new\n @invoicedetail = Invoicedetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoicedetail }\n end\n end",
"title": ""
},
{
"docid": "ecf209a9ed2caad00c70b3467b7b892b",
"score": "0.7581119",
"text": "def new\n @invoice_template = InvoiceTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_template }\n end\n end",
"title": ""
},
{
"docid": "ea4bca4db180b8816a47f5066f580236",
"score": "0.75107706",
"text": "def new\n @invoice_status = InvoiceStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_status }\n end\n end",
"title": ""
},
{
"docid": "0dd195641cbbe2fedc1d259553107f05",
"score": "0.7487044",
"text": "def new\n @invoice = @last_invoice ? Invoice.new(@last_invoice.attributes.except('number')) : Invoice.new\n respond_to do |format|\n format.html {}\n format.json { render json: @last_invoice, status: :ok, location: @last_invoice }\n end\n\n end",
"title": ""
},
{
"docid": "3d8f07e70f5e0c6ede581cc04e0b5379",
"score": "0.747266",
"text": "def create\n @resource = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to invoices_url, notice: 'invoice was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f6d4d1a4b729dd6c41b61b743d7dfa1",
"score": "0.73870134",
"text": "def new\n @invoicefield = Invoicefield.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoicefield }\n end\n end",
"title": ""
},
{
"docid": "fb1e536f8834329f9e0869868b56ee1f",
"score": "0.7349294",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, :notice => 'Invoice was successfully created.' }\n format.json { render :json => @invoice, :status => :created, :location => @invoice }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57a6343d7a85ed1c144137ca1dcb27d5",
"score": "0.7348516",
"text": "def new\n @users = User.find(:all)\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"title": ""
},
{
"docid": "1683cad10afd329923a6f70b260cb6b0",
"score": "0.73028976",
"text": "def new\n respond_with(invoice)\n end",
"title": ""
},
{
"docid": "c6343532bd832401ed757ac74542207f",
"score": "0.7251452",
"text": "def create\n # @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa0454a2b18ed50e40adcbd5330de174",
"score": "0.72335905",
"text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"title": ""
},
{
"docid": "bccebe01dbf28b06062ad277024dfcfd",
"score": "0.7225795",
"text": "def new\n @invoice = Invoice.new\n @invoice.products_invoice.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end",
"title": ""
},
{
"docid": "6fe6bca212356ad61a0a14e2121012d0",
"score": "0.7178738",
"text": "def new\n @collection_invoice = CollectionInvoice.new\n @collection_invoice.space = current_space\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection_invoice }\n end\n end",
"title": ""
},
{
"docid": "1040f68c5c7580a16b267b3993a5cde8",
"score": "0.7175346",
"text": "def new\n @invoice = Invoice.new\n @invoice.itens.build\n default_data\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"title": ""
},
{
"docid": "1d11475144654d44983b61bcf202ef4b",
"score": "0.7160892",
"text": "def new\n @project = Project.find(params[:project_id])\n @invoice = @project.invoices.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"title": ""
},
{
"docid": "3a8ae1c403b22707a4ef71db65352a43",
"score": "0.71008956",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render action: 'show', status: :created, location: @invoice }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c2b35348b97e09301c7427fcb3bf532",
"score": "0.7071294",
"text": "def new\n @invoice_tax = InvoiceTax.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_tax }\n end\n end",
"title": ""
},
{
"docid": "64ec24d61724cdf10c74133b06449279",
"score": "0.704428",
"text": "def new\n #@getinvoicedatum = Getinvoicedatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @getinvoicedatum }\n end\n end",
"title": ""
},
{
"docid": "7b0483c5835fa1fd64a8cefd860cafc0",
"score": "0.7035579",
"text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"title": ""
},
{
"docid": "4f65fef35efd79761a37c093a2782dd1",
"score": "0.70173484",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f65fef35efd79761a37c093a2782dd1",
"score": "0.70173484",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f65fef35efd79761a37c093a2782dd1",
"score": "0.70173484",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f65fef35efd79761a37c093a2782dd1",
"score": "0.70173484",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f65fef35efd79761a37c093a2782dd1",
"score": "0.70173484",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f65fef35efd79761a37c093a2782dd1",
"score": "0.70173484",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "adbffc1a0349a2d1a9b489e2d7615fc0",
"score": "0.70162636",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06ff5dba5e786077ce562c842df0b132",
"score": "0.7015742",
"text": "def create\n \n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Factura creada correctamente.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15431772b05b2ed7478d3677a061983d",
"score": "0.6993908",
"text": "def new\n @az_invoice = AzInvoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @az_invoice }\n end\n end",
"title": ""
},
{
"docid": "097131fb6dcf220427af3b36d9a3c150",
"score": "0.6947398",
"text": "def new\n @invoice_line_item = InvoiceLineItem.new\n prepFormVariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_line_item }\n end\n end",
"title": ""
},
{
"docid": "e7fcbc0357715ed707833cbae36dcd38",
"score": "0.69464225",
"text": "def create\n @invoice = @website.invoices.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render action: 'show', status: :created, location: @invoice }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fc96de2f5a993ab9223ff5ae90b0869",
"score": "0.69153684",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9000636485f4c244d7f1d4ad104c5ab",
"score": "0.6905489",
"text": "def create\r\n @invoice = Invoice.new(invoice_params)\r\n\r\n respond_to do |format|\r\n if @invoice.save\r\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\r\n format.json { render :show, status: :created, location: @invoice }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "d7b6a3c4b1074b71b4a33aa8e1cf6edc",
"score": "0.6905124",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: \"Invoice was successfully created.\" }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da2517a6582f56d6cdce3d8d4acaee80",
"score": "0.6860591",
"text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"title": ""
},
{
"docid": "da2517a6582f56d6cdce3d8d4acaee80",
"score": "0.6860591",
"text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"title": ""
},
{
"docid": "da2517a6582f56d6cdce3d8d4acaee80",
"score": "0.6860591",
"text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"title": ""
},
{
"docid": "8f19aac535d948e5ca4ad77854b2d357",
"score": "0.6853779",
"text": "def new\n @invoice = current_organization.invoices.new(:client => @client)\n @invoice.invoice_lines.build\n @clients = current_organization.clients\n @next_invoice_number = current_organization.next_invoice_number\n @previous_invoice_number = current_organization.previous_invoice_number\n end",
"title": ""
},
{
"docid": "dd5c1226b5f3d5fcc347579da2f5318a",
"score": "0.68455917",
"text": "def new\n fetch_data\n @payment = Payment.new(:payment_date => Date.today)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "1ecced39e426c6ab7a56ce2f4e884498",
"score": "0.68206143",
"text": "def new\n @invoice = Invoice.new\n if not params[:project_id].blank?\n @project = Project.find_by_id(params[:project_id])\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"title": ""
},
{
"docid": "94623a31d1f41fc072b761af0509f662",
"score": "0.680877",
"text": "def create\n @collection_invoice = CollectionInvoice.new(params[:collection_invoice])\n\n respond_to do |format|\n if @collection_invoice.save\n format.html { redirect_to collection_invoices_path, notice: 'Collection invoice was successfully created.' }\n format.json { render json: @collection_invoice, status: :created, location: @collection_invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @collection_invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "712c537079ec5eda482b0e95c66fe4ef",
"score": "0.68079716",
"text": "def new\n @group_purchase = params[:group_purchase_id]\n @invoice = Invoice.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end",
"title": ""
},
{
"docid": "9516ba4dfee53b36d28090bbd8e59469",
"score": "0.68050355",
"text": "def new\n @breadcrumb = 'create'\n @insurance = Insurance.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @insurance }\n end\n end",
"title": ""
},
{
"docid": "7badd26db67c617fba4f1e720813644d",
"score": "0.6802948",
"text": "def new\n @invoice = Invoice.find( params[:invoice_id])\n @invoice_note = @invoice.notes.new( :created_by => current_user.id, :updated_by => current_user.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice_note }\n end\n end",
"title": ""
},
{
"docid": "a427a765511832a4b38e802391275c4d",
"score": "0.6792861",
"text": "def create\n @invoice = Invoice.new(invoice_number_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to invoices_path, notice: 'Invoice number was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc826472dc07a80cf6ca22bf382866af",
"score": "0.67838794",
"text": "def new\n @incomestock = Incomestock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incomestock }\n end\n end",
"title": ""
},
{
"docid": "f9c8eae49c5fff8fe3556a84c633db51",
"score": "0.678229",
"text": "def create\n @invoice = current_user.invoices.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Uw factuur is opgeslagen.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { @invoice.build_company\n @invoice.items.build\n @invoice.build_relation\n render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32ac65354ee6e009168d6f01ec2e841e",
"score": "0.67791283",
"text": "def new\n @invent_journal_line = InventJournalLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invent_journal_line }\n end\n end",
"title": ""
},
{
"docid": "9900351a180b9da323ab2a919f9646b5",
"score": "0.67739266",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Devis cree.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc41424eec5d150ef1289d12d30c8d99",
"score": "0.6768612",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n flash[:notice] = 'Invoice was successfully created.'\n format.html { redirect_to invoices_url }\n format.xml { head :created, :location => invoice_url(@invoice) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invoice.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "cf8100611d6d667a2b3c8becb947696f",
"score": "0.6756814",
"text": "def new\n @income = Income.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @income }\n end\n end",
"title": ""
},
{
"docid": "d76bb0ea99146932dfaaed436399dc5a",
"score": "0.67565113",
"text": "def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @po }\n end\n end",
"title": ""
},
{
"docid": "d23f642470e9614787df8c4b004bacb0",
"score": "0.67553246",
"text": "def new\n @invoice = Invoice.find(cookies[:invoice_id])\n @bill = Bill.new\n run_docnumber\n default_cancel\n @bill.tax = @invoice.tax\n @bill.approve = false\n @bill.complete = false\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bill }\n format.json { render :json => @bill }\n end\n end",
"title": ""
},
{
"docid": "70c3a08e741dcc63a67a6e8a8ac10a85",
"score": "0.6751592",
"text": "def url\n '/api/invoices'\n end",
"title": ""
},
{
"docid": "2fd5f276aa59721e69d8cc1debdce1aa",
"score": "0.673808",
"text": "def new\n @incident = Incident.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incident }\n end\n end",
"title": ""
},
{
"docid": "687131232f9a05e5ab9e4613119bec90",
"score": "0.6736439",
"text": "def new\n @breadcrumb = 'create'\n @supplier_invoice = SupplierInvoice.new\n $attachment_changed = false\n $attachment = Attachment.new\n destroy_attachment\n @projects = projects_dropdown\n # @search_projects = @projects.map{ |p| p.id }.map(&:inspect).join(',')\n @work_orders = work_orders_dropdown\n @charge_accounts = projects_charge_accounts(@projects)\n # @stores = stores_dropdown\n @suppliers = suppliers_dropdown\n @payment_methods = payment_methods_dropdown\n @receipt_notes = []\n @purchase_orders = []\n @note_items = []\n @order_items = []\n @products = []\n # Special to approvals\n @users = User.where('id = ?', current_user.id)\n @companies = companies_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @supplier_invoice }\n end\n end",
"title": ""
},
{
"docid": "612704ed68c80abe65116fe334b97a2b",
"score": "0.67277366",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n @invoice.client_id = params[:clients]\n @invoice.discount_id = params[:discount_id]\n @invoice.tax_id = params[:tax_id]\n @invoice.status = Invoice::DRAFT\n @invoice.year = @counter.year\n @invoice.invoice_id = @counter.number\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "39cb4a69294ab9e07db4032cfed5105e",
"score": "0.67233646",
"text": "def new\n @money_receipt = MoneyReceipt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @money_receipt }\n end\n end",
"title": ""
},
{
"docid": "7dd4418dd2a232a8fa7a607b0655bc4a",
"score": "0.67152447",
"text": "def new\n @payable = Payable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payable }\n end\n end",
"title": ""
},
{
"docid": "d6d04a80058b1381ea24eee730f0cddf",
"score": "0.67104256",
"text": "def new\n @voucher = Voucher.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @voucher }\n end\n end",
"title": ""
},
{
"docid": "8d6c7e99f07e81467aefeaaf1d15c2c8",
"score": "0.6686407",
"text": "def new\n @title = 'New Invitation'\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @invitation }\n end\n end",
"title": ""
},
{
"docid": "453af5037036ba3c2c37f26475033a80",
"score": "0.66855043",
"text": "def new\n @purchase_receipt = PurchaseReceipt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase_receipt }\n end\n end",
"title": ""
},
{
"docid": "b6fcfdbe10b3607429b6c4ea27a4a98a",
"score": "0.6682525",
"text": "def new\n @envelope = Envelope.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @envelope }\n end\n end",
"title": ""
},
{
"docid": "fb102916ee0891050b1a62b1d313a9b8",
"score": "0.66758233",
"text": "def declare_invoice\n @invoice = Invoice.new\n @invoices = Invoice.where(invoice_state: \"No\")\n respond_to do |format|\n format.html # declare_invoice.html.erb\n format.json { render json: @invoice }\n end\n end",
"title": ""
},
{
"docid": "d53b6f591f0c89ce7b0fa13c775c54c8",
"score": "0.66737396",
"text": "def create\n flash[:notice] = 'The invoice was successfully created.' if invoice.save\n respond_with(invoice)\n end",
"title": ""
},
{
"docid": "a661662996fb46addbc60de211824b86",
"score": "0.66726303",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to(@invoice, :notice => 'Invoice was successfully created.') }\n format.xml { render :xml => @invoice, :status => :created, :location => @invoice }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e210481841c7e816923c924a7d8d54d1",
"score": "0.66717476",
"text": "def new\n @indicacao = Indicacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicacao }\n end\n end",
"title": ""
},
{
"docid": "35fa49d0fe81f60667aed352d4c32fd6",
"score": "0.6670075",
"text": "def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite }\n end\n end",
"title": ""
},
{
"docid": "35fa49d0fe81f60667aed352d4c32fd6",
"score": "0.6670075",
"text": "def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite }\n end\n end",
"title": ""
},
{
"docid": "35fa49d0fe81f60667aed352d4c32fd6",
"score": "0.6670075",
"text": "def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite }\n end\n end",
"title": ""
},
{
"docid": "c5b0af7b1f31de680038665db3cf6a00",
"score": "0.66670907",
"text": "def create\n @invoice = current_organization.invoices.new(params[:invoice])\n \n if @invoice.save\n add_success 'Invoice was successfully created.'\n redirect_to(@invoice)\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "6741a24953faf44f68502c9e8b24a5e2",
"score": "0.66656333",
"text": "def new\n @invoice_header = InvoiceHeader.find(params[:invoice_header_id])\n @payment = @invoice_header.payments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @payment }\n end\n end",
"title": ""
},
{
"docid": "a3a5a7e1fab7501d9a568b1502055010",
"score": "0.66557074",
"text": "def new\n @invoicehead = Invoicehead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoicehead }\n end\n end",
"title": ""
},
{
"docid": "8b1ba8109dfce942e6f48e9ba84760de",
"score": "0.66470045",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n flash[:notice] = \"Successfully created invoice.\"\n format.html { redirect_to invoice_url(@invoice) }\n format.xml { head :created, :location => invoice_url(@invoice) }\n else\n flash[:notice] = \"Unable to create invoice.\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invoice.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "84f625b69cbf3f10a0932a6dffdfc557",
"score": "0.66451526",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' } #todo\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12b5b6e48d4832ec1dfe748e7502b6e5",
"score": "0.6627979",
"text": "def new\n @finance = Finance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finance }\n end\n end",
"title": ""
},
{
"docid": "269a81fd8e18f63fd032ca027e3cb829",
"score": "0.6619813",
"text": "def create\n # call create invoice logic\n @invoice = Invoices::Create.call(params.require(:invoice))\n\n # if invoice was saved\n if @invoice.persisted?\n # respond 201 created and include invoice id\n render :show, status: :created\n else\n # render create errors\n respond_with_record(@invoice)\n end\n end",
"title": ""
},
{
"docid": "32835a655094c726e00640df9a75a74f",
"score": "0.66188544",
"text": "def new\n @inning = Inning.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inning }\n end\n end",
"title": ""
},
{
"docid": "842bd8d5b9e840874ded543b6f9e4905",
"score": "0.66187006",
"text": "def new\n @sale_invoice = @monthly_movement.sale_invoices.build\n @title = t('view.sale_invoices.new_title', month: @monthly_movement.month, year: @monthly_movement.year)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale_invoice }\n end\n end",
"title": ""
},
{
"docid": "447fb68839d682a531a80b5c63d9c665",
"score": "0.6617241",
"text": "def new\n @office = Office.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @office }\n end\n end",
"title": ""
},
{
"docid": "345d389b7f4ba2a78958e650a9beb8f4",
"score": "0.6616379",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n flash[:notice] = 'Invoice was successfully created.'\n format.html { redirect_to(@invoice) }\n format.xml { render :xml => @invoice, :status => :created, :location => @invoice }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "345d389b7f4ba2a78958e650a9beb8f4",
"score": "0.6616379",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n flash[:notice] = 'Invoice was successfully created.'\n format.html { redirect_to(@invoice) }\n format.xml { render :xml => @invoice, :status => :created, :location => @invoice }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "871172c001c89ccdff7190d5e91e00a3",
"score": "0.6612247",
"text": "def new\n @financial = Financial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @financial }\n end\n end",
"title": ""
},
{
"docid": "24c04661d5ba79f397174909956adfbc",
"score": "0.6610341",
"text": "def new\n @bill = Bill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill }\n end\n end",
"title": ""
},
{
"docid": "24c04661d5ba79f397174909956adfbc",
"score": "0.6610341",
"text": "def new\n @bill = Bill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bill }\n end\n end",
"title": ""
},
{
"docid": "484535c7034a686c8533edb42f8c7fc5",
"score": "0.6607686",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'La factura fue creada correctamente.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb105e75d5b9fc6c5bad693e3374fc8d",
"score": "0.6605837",
"text": "def new\n @indicativo = Indicativo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicativo }\n end\n end",
"title": ""
},
{
"docid": "bd07b7e4fc4b47da8ec70bbc4d29a96c",
"score": "0.6592486",
"text": "def new\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invitation }\n end\n end",
"title": ""
},
{
"docid": "bd07b7e4fc4b47da8ec70bbc4d29a96c",
"score": "0.6592486",
"text": "def new\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invitation }\n end\n end",
"title": ""
},
{
"docid": "700a5c04cc4d70d6c60072e7826fd8f3",
"score": "0.6591752",
"text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n create_first_line_item unless @invoice.booking.pricing_structure.rate_per_person.nil?\n format.html { redirect_to invoice_path(@invoice.id), notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b943dfead650efbf2d06ef99d2913786",
"score": "0.6576149",
"text": "def new\n @peso = Peso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @peso }\n end\n end",
"title": ""
},
{
"docid": "91caa6f84cc5d10a9901a50c2a648181",
"score": "0.65747094",
"text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end",
"title": ""
},
{
"docid": "91caa6f84cc5d10a9901a50c2a648181",
"score": "0.65747094",
"text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end",
"title": ""
},
{
"docid": "91caa6f84cc5d10a9901a50c2a648181",
"score": "0.65747094",
"text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end",
"title": ""
},
{
"docid": "91caa6f84cc5d10a9901a50c2a648181",
"score": "0.65747094",
"text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end",
"title": ""
},
{
"docid": "91caa6f84cc5d10a9901a50c2a648181",
"score": "0.65747094",
"text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end",
"title": ""
}
] |
b0bd712128a5bb7823ffd2ae575ffdbf
|
A method to convert the the resource to an XML string. INCOMPLETE ==== Options The +options+ parameter is handed off to the +to_xml+ method on each attribute, so it has the same options as the +to_xml+ methods in Active Support. :indent Set the indent level for the XML output (default is +2+). :dasherize Boolean option to determine whether or not element names should replace underscores with dashes (default is false). :skip_instruct Toggle skipping the +instruct!+ call on the XML builder that generates the XML declaration (default is false). ==== Examples my_group = SubsidiaryGroup.find(:first) my_group.to_xml => [...] my_group.to_xml(:dasherize => true) => [...] my_group.to_xml(:skip_instruct => true) => [...]
|
[
{
"docid": "24e3b03a325a924675e397ec7adb78dc",
"score": "0.74066883",
"text": "def to_xml(options={})\n attributes.to_xml({:root => self.class.element_name}.merge(options))\n end",
"title": ""
}
] |
[
{
"docid": "2e255432c43e2c4e91e2cb72bd315f68",
"score": "0.75508577",
"text": "def to_xml(options = {})\n to_xml_opts = {:skip_types => true} # no type information, not such a great idea!\n to_xml_opts.merge!(options.slice(:builder, :skip_instruct))\n # a builder instance is provided when to_xml is called on a collection,\n # in which case you would not want to have <?xml ...?> added to each item\n to_xml_opts[:root] ||= \"retailer\"\n self.attributes.to_xml(to_xml_opts)\n end",
"title": ""
},
{
"docid": "d3ed821cf3a471631928ff878a1db90d",
"score": "0.75273675",
"text": "def to_xml(options = nil)\n all_attributes.to_xml(options || {})\n end",
"title": ""
},
{
"docid": "341cb3c76fef8b0b1284df2325d62652",
"score": "0.74882317",
"text": "def to_xml(options = {})\n options[:save_with] ||= SaveOptions::DEFAULT_XML\n serialize(options)\n end",
"title": ""
},
{
"docid": "48edfbedb2f69c61436d8bf73e0e55a3",
"score": "0.74468553",
"text": "def to_xml(options = {})\r\n options.update :root => @root ||\r\n self.class.name.split('::').last.underscore\r\n attributes.to_xml options\r\n end",
"title": ""
},
{
"docid": "7243d2b659a6295510242405e45f2dbd",
"score": "0.70574695",
"text": "def to_xml(options={})\n options = options.reverse_merge(:root => false)\n to_hash(options).to_xml(:root => data_name(@_data))\n end",
"title": ""
},
{
"docid": "06784b0c69cb0ded483f03d45e4790fd",
"score": "0.68348765",
"text": "def to_rootless_xml(options = {})\n require \"active_support/builder\" unless defined?(Builder)\n\n options = options.dup\n options[:indent] ||= 2\n options[:builder] ||= Builder::XmlMarkup.new(indent: options[:indent])\n\n builder = options[:builder]\n builder.instruct! unless options.delete(:skip_instruct)\n\n each { |key, value| ActiveSupport::XmlMini.to_tag(key, value, options) }\n yield builder if block_given?\n builder.target! \n end",
"title": ""
},
{
"docid": "d6a6562a64e9ee03758e02cb045246fa",
"score": "0.6819452",
"text": "def to_xml options={}\n\n super(options) do |xml|\n\n xml.reqNumber self.reqNumber\n\n if ! self.category.nil?\n xml.category self.category.catName\n else\n xml.category \"Not defined\"\n end\n\n\n xml.industries do\n industries.each do |industry|\n xml.industry industry.indName\n end\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "28e901edca6ced617e3ec69eedc6ecab",
"score": "0.6794718",
"text": "def to_xml(options={})\r\n a = attributes.clone\r\n a.delete(\"ino:id\")\r\n a.to_xml({:root => self.class.doctype}.merge(options))\r\n end",
"title": ""
},
{
"docid": "7febf50b58a7ca52e98f88d468384872",
"score": "0.6778026",
"text": "def to_xml(options = {})\n # Rails.logger.debug \"Tag #{id}: to_xml\"\n options[:except] ||= []\n options[:except] += self.attributes.map {|k,v| k if v.blank? }.compact\n super(options)\n end",
"title": ""
},
{
"docid": "e0aa161b9ce3527df58372339dfe28f7",
"score": "0.67420024",
"text": "def to_xml(options = {})\n doc = Nokogiri::XML::Document.new\n root = doc.create_element(tag_name)\n if defined?(tag_attributes) # Meanwhile we lack a better way of using tag attributes...\n self.tag_attributes.each {|key, value| root[key.to_s.camelize] = value }\n end\n self.class.keys.each do |name|\n value = read_attribute(name)\n next if value.blank?\n root[name.to_s.camelize] = value\n end\n self.class.elements.each do |name, field|\n next if options[:only] && !options[:only].include?(name)\n next if field.options[:readonly]\n value = read_attribute(name)\n next if field.type.is_a?(Array) && value.blank?\n next if new_record? && field.type == Identifier\n next if new_record? && value.blank?\n if name == :text\n root << value.to_s\n else\n root << field.to_xml(value)\n end\n end\n root\n end",
"title": ""
},
{
"docid": "0e74e2bbb530bbfc065fcea92f1305a7",
"score": "0.66991156",
"text": "def to_xml(options = {})\n xml = options[:builder] ||= Builder::XmlMarkup.new\n xml.instruct! unless options[:skip_instruct]\n xml.member(:type => type, :ref => ref, :role => role)\n end",
"title": ""
},
{
"docid": "acbf0f46b09252df5f58556d0bda9fe0",
"score": "0.66906095",
"text": "def to_xml( opts = {} )\n XMLHelper.write_element( self,\n opts[ :indentor ] || Indentor::COMPRESSED,\n opts[ :qmark ] || QuoteMark::DOUBLE,\n opts[ :implied_ns ] || [] )\n end",
"title": ""
},
{
"docid": "bdd730f6f404a629e6051ac99428a318",
"score": "0.6674473",
"text": "def to_xml(opts = {})\n to_raw.to_xml({ :root => 'document', :dasherize => true }.merge(opts))\n end",
"title": ""
},
{
"docid": "b44b58fcadd14933a572834f83d16414",
"score": "0.6672544",
"text": "def to_xml(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b44b58fcadd14933a572834f83d16414",
"score": "0.6672544",
"text": "def to_xml(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "fd8e6eda816962a8aff00b832af6a689",
"score": "0.66665083",
"text": "def to_xml options = {}\n properties.to_xml options\n end",
"title": ""
},
{
"docid": "bbd588dd8f49c59770326b64c12f6e7f",
"score": "0.66403687",
"text": "def to_xml(opt={})\n to_markup(opt).target!\n end",
"title": ""
},
{
"docid": "bbd588dd8f49c59770326b64c12f6e7f",
"score": "0.66403687",
"text": "def to_xml(opt={})\n to_markup(opt).target!\n end",
"title": ""
},
{
"docid": "3ca487dd9e178d82a99f0e6cdeecbed1",
"score": "0.66014767",
"text": "def to_xml\n builder = Builder::XmlMarkup.new(:indent=>2)\n builder.instruct! :xml, version: '1.0', encoding: 'UTF-8'\n xml = builder.items{ self.each{|x| builder.item(x) } }\n xml\n end",
"title": ""
},
{
"docid": "480267b107eec4158cdd40174a26c191",
"score": "0.6587531",
"text": "def to_xml(options = {})\n doc = super\n ns = self.class.ns\n\n if ns and ns.size == 2 # prefix and name\n doc.add_namespace_definition(*ns)\n doc.name = \"#{ns.first}:#{doc.name}\"\n end\n\n doc\n end",
"title": ""
},
{
"docid": "46f6ce60fe435cc98eab32f6b153cd7b",
"score": "0.6555185",
"text": "def to_xml(opts={})\n { :name => self.controller_name,\n :parameters => self.queryable_params,\n :identifier => self.xml_identifier\n }.to_xml(opts.merge(:root => \"resource\"))\n end",
"title": ""
},
{
"docid": "28db5ce537283b069c1aed848861b495",
"score": "0.65479416",
"text": "def to_xml(options={})\n options[:root] ||= \"errors\"\n options[:indent] ||= 2\n options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])\n\n options[:builder].instruct! unless options.delete(:skip_instruct)\n options[:builder].errors do |e|\n full_messages.each { |msg| e.error(msg) }\n end\n end",
"title": ""
},
{
"docid": "72a5f728858d711cdab5347b15f1c3f3",
"score": "0.65468186",
"text": "def to_xml(options={})\n options[:root] ||= \"errors\"\n options[:indent] ||= 2\n options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])\n\n options[:builder].instruct! unless options.delete(:skip_instruct)\n options[:builder].errors do |e|\n full_messages.each { |msg| e.error(msg) }\n end\n end",
"title": ""
},
{
"docid": "c8aed0b7491ba3d18186f7fcf97b42ea",
"score": "0.6534112",
"text": "def to_xml(out)\n\t\t\tout << out.pindent(@children.empty? ? 0 : 1)\n\t\t\tout << \"<#{tag}\"\n\n\t\t\tattr.each { |key, value|\n\t\t\t\tout << \" #{key}=\\\"#{value.class <= Symbol ? value.identifier : escape_xml(value) }\\\"\"\n\t\t\t}\n\n\t\t\tif(@children.empty?)\n\t\t\t\tout << \"/>#{ENDL}\"\n\t\t\telse\n\t\t\t\tout << \">#{ENDL}\"\n\n\t\t\t\t@children.each { |child|\n\t\t\t\t\tchild.to_xml(out)\n\t\t\t\t}\n\t\n\t\t\t\tout < \"</#{tag}>#{ENDL}\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "4a9c7bd36ef36aceab3bcf1c7c81036b",
"score": "0.65227586",
"text": "def to_xml(options = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "4641d45775af4c14a4a438751ed802cb",
"score": "0.65156317",
"text": "def to_xml\n xml = String.new\n builder = Builder::XmlMarkup.new(:target => xml, :indent => 2)\n \n # Xml instructions (version and charset)\n builder.instruct!\n \n builder.source(:primary => primary_source) do\n builder.id(id, :type => \"integer\")\n builder.uri(uri.to_s)\n end\n \n xml\n end",
"title": ""
},
{
"docid": "e649c427ecc7a92bf35862c2284fba9f",
"score": "0.6474773",
"text": "def to_xml(xml_builder = Builder::XmlMarkup.new)\n xml_builder.tag!('Group') do\n %w(Name Handle GroupType Explicit).each do |tag_name|\n xml_builder.tag!(tag_name, self.edits[tag_name]) if self.edits[tag_name]\n end\n \n self.tracks.to_xml(xml_builder)\n self.permissions.to_xml(xml_builder)\n \n %w(AllowSubscription).each do |tag_name|\n xml_builder.tag!(tag_name, self.edits[tag_name]) if self.edits[tag_name]\n end\n self.external_feed.to_xml(xml_builder) if self.external_feed\n end\n end",
"title": ""
},
{
"docid": "55dc98810105a0df962297b7e8760adc",
"score": "0.6444574",
"text": "def to_xml\n return to_s\n end",
"title": ""
},
{
"docid": "55dc98810105a0df962297b7e8760adc",
"score": "0.6444574",
"text": "def to_xml\n return to_s\n end",
"title": ""
},
{
"docid": "cf8208895d943b7e59f8663bb47a4282",
"score": "0.64294106",
"text": "def to_xml\n\t\t\t\"<#{@name} #{attributes_string} />\"\n\t\tend",
"title": ""
},
{
"docid": "ee6e05f18498c0303d6a69e9f80ad56c",
"score": "0.64143056",
"text": "def to_xml(options={})\n to_a.to_xml options.reverse_merge(:root => \"hints\", :skip_types => true)\n end",
"title": ""
},
{
"docid": "8f2e9c2640615c9ae524b99c1a727031",
"score": "0.6389119",
"text": "def to_xml(doc)\n doc.to_xml(indent: 2)\n end",
"title": ""
},
{
"docid": "5e684dd32b9f9326cac12b87b12bb0fe",
"score": "0.6383286",
"text": "def to_xml(pretty_print = false)\n if pretty_print\n xml_document = +''\n RCAP::XML_PRETTY_PRINTER.write(to_xml_document, xml_document)\n xml_document\n else\n to_xml_document.to_s\n end\n end",
"title": ""
},
{
"docid": "e142963ea396ccc4fabf515612ccc88b",
"score": "0.63724315",
"text": "def to_xml\n Builder.new(self).to_s\n end",
"title": ""
},
{
"docid": "c0e77dcc5b7f43427d17c473a5ec76f2",
"score": "0.63669705",
"text": "def to_xml(obj)\n obj.to_xml\n end",
"title": ""
},
{
"docid": "493ecee1565970aaad285390c76e0cca",
"score": "0.63663346",
"text": "def to_xml( pretty_print = false )\n if pretty_print\n xml_document = \"\"\n RCAP::XML_PRETTY_PRINTER.write( self.to_xml_document, xml_document )\n xml_document\n else\n self.to_xml_document.to_s\n end\n end",
"title": ""
},
{
"docid": "99ba7d332d978510848e649ee9179b31",
"score": "0.6361847",
"text": "def to_xml(options={}, &block)\n super(options.reverse_merge(:include => :parts), &block)\n end",
"title": ""
},
{
"docid": "b3ff7112f0cd3ac6fb9803413bf5bb4f",
"score": "0.63390225",
"text": "def to_xml\n ns = namespace ? \"#{namespace}:\" : ''\n body = children.map(&:to_xml).join('')\n attrs = ''\n\n attributes.each do |key, value|\n attrs << \"#{key}=#{value.inspect}\"\n end\n\n attrs = \" #{attrs}\" unless attrs.empty?\n\n return \"<#{ns}#{name}#{attrs}>#{body}</#{name}>\"\n end",
"title": ""
},
{
"docid": "443e50d4557150b1472e1c25c27e8b45",
"score": "0.63182586",
"text": "def to_xml(opts = {})\n mapper.to_xml(self, opts)\n end",
"title": ""
},
{
"docid": "d5096ca209eb4872a88e2e77f81a2a9d",
"score": "0.63073736",
"text": "def encode(options={})\n self.class.format.encode(attributes, {:root => self.class.element_name}.merge(options))\n end",
"title": ""
},
{
"docid": "9d1ccb18d6ab1fe150a7d649ac367a95",
"score": "0.6296075",
"text": "def to_xml\n xml = children.map(&:to_xml).join('')\n\n if doctype\n xml = doctype.to_xml + \"\\n\" + xml.strip\n end\n\n if xml_declaration\n xml = xml_declaration.to_xml + \"\\n\" + xml.strip\n end\n\n return xml\n end",
"title": ""
},
{
"docid": "67a03e7b4b678c5fa12386109d71a219",
"score": "0.62737596",
"text": "def to_xml\n return self.to_s\n end",
"title": ""
},
{
"docid": "d235aa1f1541b1e4214574169614dade",
"score": "0.6239631",
"text": "def to_xml\n to_xml_builder.to_xml\n end",
"title": ""
},
{
"docid": "d235aa1f1541b1e4214574169614dade",
"score": "0.6239631",
"text": "def to_xml\n to_xml_builder.to_xml\n end",
"title": ""
},
{
"docid": "c8b7546959a8eb8ee24f0aa1fb5984d1",
"score": "0.6202272",
"text": "def to_xml(options = {})\n collect\n options[:indent] ||= 2\n xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])\n xml.instruct! unless options[:skip_instruct]\n xml.tag!(table_name) do\n if paginated?\n xml.total_entries(total_entries, :type => \"integer\")\n xml.page(current_page, :type => \"integer\")\n xml.per_page(per_page, :type => \"integer\")\n xml.total_pages(total_pages, :type => \"integer\")\n end\n xml.collection(:type => \"array\") do\n collection.each do |item|\n item.to_xml(:indent => options[:indent], :builder => xml, :skip_instruct => true)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "683da5e9687d6ff939b53b26e39c77d1",
"score": "0.61812735",
"text": "def to_xml( pretty_print = false )\n if pretty_print\n xml_document = \"\"\n XML_PRETTY_PRINTER.write( self.to_xml_document, xml_document )\n xml_document\n else\n self.to_xml_document.to_s\n end\n end",
"title": ""
},
{
"docid": "284c2818d86a72848b59b2c1aca7b09c",
"score": "0.61674595",
"text": "def to_xml\n a = REXML::Element.new(\"property\")\n a.add_attribute(\"id\", name)\n a.add_element(\"name\").text = name\n if (parameter)\n a.add_element(\"parameter\").text = parameter\n end\n if (description)\n a.add_element(\"description\").text = description\n end\n if (@options)\n p @options\n @options.each {|name, value|\n a.add_element(name.to_s).text = value.to_s\n }\n end\n return a\n end",
"title": ""
},
{
"docid": "a002c7e19466a22ed145fa14ad93d57c",
"score": "0.6162653",
"text": "def extents_to_xml(options = {})\n e = get_extents()\n options[:indent] ||= 2\n xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])\n xml.instruct! unless options[:skip_instruct]\n xml.extents do\n xml.min_point do\n xml.tag!(:x, e[:minX])\n xml.tag!(:y, e[:minY])\n end\n xml.max_point do\n xml.tag!(:x, e[:maxX])\n xml.tag!(:y, e[:maxY])\n end\n end\n end",
"title": ""
},
{
"docid": "f50f2fb42378e3edeb78d1561840f5ea",
"score": "0.61546147",
"text": "def to_xml\n Builder.new(permission, grantee).to_s\n end",
"title": ""
},
{
"docid": "ffde0a424aeaca16e0b417ef4eb1f033",
"score": "0.6146812",
"text": "def to_xml\n self.to_s\n end",
"title": ""
},
{
"docid": "ffde0a424aeaca16e0b417ef4eb1f033",
"score": "0.6146812",
"text": "def to_xml\n self.to_s\n end",
"title": ""
},
{
"docid": "3af89988b13e94b69512084f3eca03be",
"score": "0.61263984",
"text": "def to_xml\r\n super(:dasherize => false)\r\n end",
"title": ""
},
{
"docid": "20e2a31accedffb531f15dbf2009903e",
"score": "0.6114625",
"text": "def to_xml\n @xml ||= get_xml\n end",
"title": ""
},
{
"docid": "6a910ea4e4836e8524722de7dc794c64",
"score": "0.60925084",
"text": "def to_xml\n output=\"\"\n self.to_rexml.write output\n end",
"title": ""
},
{
"docid": "ca6a8b04412a9dc5de8256bb60f118bc",
"score": "0.6086588",
"text": "def to_fxml(options = {})\n options.merge!(:dasherize => false)\n default_except = [:crypted_password, :salt, :remember_token, :remember_token_expires_at, :created_at, :updated_at]\n options[:except] = (options[:except] ? options[:except] + default_except : default_except)\n \n RestfulX::Serialization::FXMLSerializer.new(self, options).to_s\n end",
"title": ""
},
{
"docid": "ed9687330516d785e8ca5244876be126",
"score": "0.6061434",
"text": "def to_xml(xml=Builder::XmlMarkup.new)\n attributes = {'ID' => id, 'Version' => version, 'IssueInstant' => issue_instant.in_time_zone.xmlschema}\n attributes['InResponseTo'] = in_response_to unless in_response_to.nil?\n attributes['Destination'] = destination unless destination.nil?\n attributes['Consent'] = consent unless consent.nil?\n attributes = add_xmlns(attributes)\n xml.tag!('samlp:Response', attributes) {\n xml << issuer.to_xml unless issuer.nil?\n xml << signature.to_xml unless signature.nil?\n # TODO: add extensions support\n xml << status.to_xml unless status.nil?\n assertions.each { |assertion| xml << assertion.to_xml }\n encrypted_assertions.each { |encrypted_assertion| xml << encrypted_assertion.to_xml }\n }\n end",
"title": ""
},
{
"docid": "172c683edfa7cb139018191a530caae9",
"score": "0.6057344",
"text": "def to_xml\n return @doc.to_s\n end",
"title": ""
},
{
"docid": "59f901368c7f58c0cca423ca33d88e47",
"score": "0.6051412",
"text": "def to_s\n attr = ''\n\n namespaces = {}\n attributes.each do |a|\n namespaces[a.prefix] = a.namespaceURI if a.prefix\n end\n if @localname\n namespaces[@prefix] = @uri\n end\n\n namespaces.each do |prefix, uri|\n ## skip the namespace declaration of xml or xmlns.\n next if prefix == 'xml' or\n uri == 'http://www.w3.org/2000/xmlns/'\n nsattrname = 'xmlns'\n nsattrname << ':' + prefix if prefix\n ## skip duplicated namespace declarations.\n next if @attr.getNamedItem(nsattrname)\n attr << \" #{nsattrname}=\\\"#{uri}\\\"\"\n end\n\n @attr.each do |a|\n attr << ' ' + a.to_s\n end if @attr\n content = super\n if content != ''\n ret = \"<#{@name}#{attr}>#{content}</#{@name}>\"\n else\n ret = \"<#{@name}#{attr}/>\"\n end\n ret << \"\\n\" if parentNode.nodeType == DOCUMENT_NODE\n ret\n end",
"title": ""
},
{
"docid": "9798b1f9f1672d9c2eb48e0336ce056f",
"score": "0.60149866",
"text": "def to_s\n @xml\n end",
"title": ""
},
{
"docid": "b6aedc458a7dafcf39d2d141a502ab71",
"score": "0.60145783",
"text": "def encode(options={})\n self.class.format.encode(attributes, {:root => nil}.merge(options)).gsub(\n /<\\/?>/, \"\")\n end",
"title": ""
},
{
"docid": "b487744b9e27ab076b20e0c3286d8ca9",
"score": "0.6008173",
"text": "def to_xml()\n @xml ||= Nokogiri::XML(cmark(\"--to\", \"xml\"))\n @xml\n end",
"title": ""
},
{
"docid": "2bc2629119b0fa82e3cfe5cbcb368a3b",
"score": "0.59867626",
"text": "def test_to_xml_dups_options\n options = {:skip_instruct => true}\n {}.to_xml(options)\n # :builder, etc, shouldn't be added to options\n assert_equal({:skip_instruct => true}, options)\n end",
"title": ""
},
{
"docid": "af0a4f7cb10069dc9b67c18d03f75b08",
"score": "0.59860384",
"text": "def to_xml\n\t\tend",
"title": ""
},
{
"docid": "af0a4f7cb10069dc9b67c18d03f75b08",
"score": "0.59860384",
"text": "def to_xml\n\t\tend",
"title": ""
},
{
"docid": "c0256282ad695f897ff60d678b1c85cd",
"score": "0.59769225",
"text": "def to_xml(include_namespace: true)\n MARC::XMLWriter.encode(self, include_namespace: include_namespace)\n end",
"title": ""
},
{
"docid": "801298c940f9b58069294f10ce87dff8",
"score": "0.59714186",
"text": "def to_xml(xm)\n xm.ResourceTemplate do |xm|\n value_tag(xm, \"rel\")\n value_tag(xm, \"name\")\n value_tag(xm, \"path_template\")\n value_tag(xm, \"uri_template\")\n\n list_tag(xm, params, \"Params\", \"param\")\n list_tag(xm, optional_params, \"OptionalParams\", \"param\")\n\n # could use a list of elements here, but let's follow HTTP's lead and reduce the verbosity\n xm.options(options.join(\", \")) unless options.empty?\n\n resource_templates.to_xml(xm) unless resource_templates.empty?\n end\n xm\n end",
"title": ""
},
{
"docid": "b82d2c1aaccfecdb1d90795ecc51fd05",
"score": "0.5967176",
"text": "def to_xml()\n XmlSimple.xml_out( { :address => self.to_hash() }, { :KeepRoot=>true, :NoAttr=>true } )\n end",
"title": ""
},
{
"docid": "727457769edce93975afd03709d0bfad",
"score": "0.59601456",
"text": "def to_s\n return self.xml\n end",
"title": ""
},
{
"docid": "0708b4a206e96e99b5ca5ec51efbd998",
"score": "0.59557223",
"text": "def to_xml(ns=nil)\n x = super.chomp(\"/>\").chomp(\" \")\n x << %[>]\n #self.class.inherited_elements.each do |name, kind, opts|\n xml_schema_elements.each do |name, kind, opts|\n obj = send(name)\n next unless obj\n case obj\n when Array\n obj.each do |v|\n if v.is_a? Tag\n x << v.to_xml(xml_namespace)\n else\n x << %[<#{name}>#{xml_escape(v.to_s)}</#{name}>]\n end\n end\n else\n if obj.is_a? Tag\n x << obj.to_xml(xml_namespace)\n else\n x << %[<#{name}>#{xml_escape(obj.to_s)}</#{name}>]\n end\n end\n end\n x << %[</#{xml_tagname}>]\n x\n end",
"title": ""
},
{
"docid": "31647844e5e589a4c059b04ee216e89f",
"score": "0.5949832",
"text": "def to_fxml(options = {}, &block)\n options.merge!(:dasherize => false)\n default_except = [:encrypted_password, :password_salt, :remember_token, :remember_token_expires_at, :created_at, :updated_at]\n options[:except] = (options[:except] ? options[:except] + default_except : default_except)\n Serializer.new(self, options).serialize(&block)\n end",
"title": ""
},
{
"docid": "6b657f906aaaf0084d47f3873a3946bd",
"score": "0.5948718",
"text": "def to_xml(*)\n self\n end",
"title": ""
},
{
"docid": "3bc5dec9e984907ea55f5b75f230ca75",
"score": "0.59464186",
"text": "def to_xml\n Builder.new(owner, grants).to_s\n end",
"title": ""
},
{
"docid": "8267cfd31b92c0ae478b2eb092c1b456",
"score": "0.59446007",
"text": "def to_xml(*args); end",
"title": ""
},
{
"docid": "8267cfd31b92c0ae478b2eb092c1b456",
"score": "0.59446007",
"text": "def to_xml(*args); end",
"title": ""
},
{
"docid": "8267cfd31b92c0ae478b2eb092c1b456",
"score": "0.59446007",
"text": "def to_xml(*args); end",
"title": ""
},
{
"docid": "8267cfd31b92c0ae478b2eb092c1b456",
"score": "0.59446007",
"text": "def to_xml(*args); end",
"title": ""
},
{
"docid": "8267cfd31b92c0ae478b2eb092c1b456",
"score": "0.59446007",
"text": "def to_xml(*args); end",
"title": ""
},
{
"docid": "8267cfd31b92c0ae478b2eb092c1b456",
"score": "0.59446007",
"text": "def to_xml(*args); end",
"title": ""
},
{
"docid": "7117b8e50b301cd5959cb64eb23349cc",
"score": "0.59441036",
"text": "def to_xml\n RAGE::XMLCodec.new.encode(self)\n end",
"title": ""
},
{
"docid": "106207eb7b411ff11f30d11c11502f04",
"score": "0.5935102",
"text": "def to_xml(options = {})\n with_credentials = options[:with_credentials] || false\n\n doc = Nokogiri::XML('')\n doc.root = Nokogiri::XML::Node.new('provider_account', doc)\n root = doc.root.at_xpath('/provider_account')\n\n node = Nokogiri::XML::Node.new('name', doc)\n node.content = self.name\n root << node\n\n node = Nokogiri::XML::Node.new('provider', doc)\n node.content = self.provider.name\n root << node\n\n node = Nokogiri::XML::Node.new('provider_type', doc)\n node.content = self.provider.provider_type.deltacloud_driver\n root << node\n\n if with_credentials\n credential_node_name = provider.provider_type.deltacloud_driver + '_credentials'\n credential_node = Nokogiri::XML::Node.new(credential_node_name, doc)\n node = Nokogiri::XML::Node.new('provider_credentials', doc)\n node << credential_node\n root << node\n\n creds_label_hash.each do |h|\n element = Nokogiri::XML::Node.new(h[:label], doc)\n element.content = h[:value]\n credential_node << element\n end\n end\n\n doc.root.to_xml\n end",
"title": ""
},
{
"docid": "a6c7506f89ce14a2cbe8c7800e629f89",
"score": "0.5917832",
"text": "def to_xml(*args)\n super\n end",
"title": ""
},
{
"docid": "973c5a2cbd4249ba45d97276316a1f7a",
"score": "0.5902128",
"text": "def to_str\n str = \"\"\n REXML::Formatters::Pretty.new(1).write(@xml,str)\n \n return str \n end",
"title": ""
},
{
"docid": "0748faa0659c09bf96fe07fef8e2643e",
"score": "0.58997416",
"text": "def toxml\n\t\tend",
"title": ""
},
{
"docid": "83ee1ee4050b6911ae4d22da6b59f39d",
"score": "0.58986634",
"text": "def to_xml(ns=nil)\n x = super.chomp(\"/>\").chomp(\" \")\n x << \">\"\n x << xml_escape(xml_value.to_s)\n x << \"</#{xml_tagname}>\"\n x\n end",
"title": ""
},
{
"docid": "4f20b86fea9f6b1ef05c64fdfda57647",
"score": "0.5891481",
"text": "def to_xml\n builder.target!\n end",
"title": ""
},
{
"docid": "7c29cc8caa3380064c57bb762ca7dda4",
"score": "0.5875343",
"text": "def to_str\n str = \"\"\n REXML::Formatters::Pretty.new(1).write(@xml,str)\n\n return str \n end",
"title": ""
},
{
"docid": "617cea3bfa097f45c530ac26a7f81a46",
"score": "0.58711505",
"text": "def to_xml\n if has_errors?\n controller.render xml: resource.errors\n else\n controller.render xml: resource\n end\n end",
"title": ""
},
{
"docid": "5d57d0f6d6baecd2e48fb503226b82dd",
"score": "0.5857437",
"text": "def to_xml\n doc = Nokogiri::XML::Document.new\n element = to_nokogiri(doc)\n element.to_s\n end",
"title": ""
},
{
"docid": "5d57d0f6d6baecd2e48fb503226b82dd",
"score": "0.5857437",
"text": "def to_xml\n doc = Nokogiri::XML::Document.new\n element = to_nokogiri(doc)\n element.to_s\n end",
"title": ""
},
{
"docid": "c0b8bf77b872a8d62bd9b58d08fa2942",
"score": "0.58539116",
"text": "def to_xml()\n XmlSimple.xml_out( { :person => self.to_hash() }, { :KeepRoot=>true, :NoAttr=>true } )\n end",
"title": ""
},
{
"docid": "6f05dda715cf240960471f4cff606772",
"score": "0.58536315",
"text": "def to_xml_inject_ns(model_name, options = {})\n s = StringIO.new\n xml = to_xml(options).write_to(s, :indent => 0, :indent_text => '')\n destination_name = options.fetch(:destination_name, nil)\n destination_name ||= model_name\n\n sparse = options.fetch(:sparse, false)\n sparse_string = %{sparse=\"#{sparse}\"}\n step1 = s.string.sub(\"<#{model_name}>\", \"<#{destination_name} #{Quickbooks::Service::BaseService::XML_NS} #{sparse_string}>\")\n step2 = step1.sub(\"</#{model_name}>\", \"</#{destination_name}>\")\n step2\n end",
"title": ""
},
{
"docid": "42c239465bc326b101217fc4ef7990d4",
"score": "0.58523506",
"text": "def to_xml(opts=OPTS)\n vals = values\n types = opts[:types]\n inc = opts[:include]\n\n cols = if only = opts[:only]\n Array(only)\n else\n vals.keys - Array(opts[:except])\n end\n\n name_proc = model.xml_serialize_name_proc(opts)\n x = model.xml_builder(opts)\n x.send(name_proc[opts.fetch(:root_name, model.send(:underscore, model.name).gsub('/', '__')).to_s]) do |x1|\n cols.each do |c|\n attrs = {}\n if types\n attrs[:type] = db_schema.fetch(c, OPTS)[:type]\n end\n v = vals[c]\n if v.nil?\n attrs[:nil] = ''\n end\n x1.send(name_proc[c.to_s], v, attrs)\n end\n if inc.is_a?(Hash)\n inc.each{|k, v| to_xml_include(x1, k, v)}\n else\n Array(inc).each{|i| to_xml_include(x1, i)}\n end\n yield x1 if block_given?\n end\n x.to_xml\n end",
"title": ""
},
{
"docid": "869784a83c5891bbdc2a56e0880b8b9f",
"score": "0.5837444",
"text": "def to_xml \n result = String.new\n builder = Builder::XmlMarkup.new(:target => result, :indent => 2)\n \n attributes = {}\n instance_variables.each do |iv|\n attributes[iv.split(\"@\")[1]] = normalize instance_variable_get(iv)\n end\n \n builder.tag!(\"category\", attributes)\n \n result\n end",
"title": ""
},
{
"docid": "28851ccc9b9f871a1b8b6cd0f59b560d",
"score": "0.5832947",
"text": "def to_xml_string(fast_but_unsafe: false, include_namespace: true)\n if fast_but_unsafe\n MARC::UnsafeXMLWriter.encode(self, include_namespace: include_namespace)\n else\n MARC::XMLWriter.encode(self, include_namespace: include_namespace).to_s\n end\n end",
"title": ""
},
{
"docid": "2c9158876a690e590fc519b8844c2dda",
"score": "0.5829456",
"text": "def to_xml\n @xml.to_xml\n end",
"title": ""
},
{
"docid": "b5484ad88881c6ee5f641626a5b31b0d",
"score": "0.58234566",
"text": "def to_xml(xml=Builder::XmlMarkup.new)\n xml.tag!('saml:AuthnContext') {\n xml.tag!('saml:AuthnContextClassRef', class_reference) unless class_reference.nil?\n xml.tag!('saml:AuthnContextDecl', context_declaration) unless context_declaration.nil?\n xml.tag!('saml:AuthnContextDeclRef', context_declaration_ref) unless context_declaration_ref.nil?\n }\n end",
"title": ""
},
{
"docid": "dd708252b2a155f1d3ae093997ae8254",
"score": "0.58165187",
"text": "def to_xml(ns=nil)\n atts = []\n\n myns = self.class.namespace || ns\n if myns != ns\n atts << myns.to_xml\n end\n ns = myns\n\n atts += xml_attributes.collect do |k, v|\n case v\n when nil\n nil\n when Attribute\n v.to_xml(ns)\n else\n %[#{k}=\"#{v}\"]\n end\n end.compact\n atts = atts.join(' ')\n\n %[<#{xml_tagname} #{atts}/>]\n end",
"title": ""
},
{
"docid": "20bd52535e7fa25f908356fb2182f9c8",
"score": "0.5810457",
"text": "def to_xml_document(opts={}, doc=nil)\n doc ||= REXML::Document.new\n default_xml_element_name = lambda { Extlib::Inflection.underscore(self.class.name).tr(\"/\", \"-\") }\n root = doc.add_element(opts[:element_name] || default_xml_element_name[])\n\n #TODO old code base was converting single quote to double quote on attribs\n\n propset = properties_to_serialize(opts)\n propset.each do |property|\n value = send(property.name)\n node = root.add_element(property.name.to_s)\n unless property.type == String\n node.attributes[\"type\"] = property.type.to_s.downcase\n end\n node << REXML::Text.new(value.to_s) unless value.nil?\n end\n\n # add methods\n (opts[:methods] || []).each do |meth|\n if self.respond_to?(meth)\n xml_name = meth.to_s.gsub(/[^a-z0-9_]/, '')\n node = root.add_element(xml_name)\n value = send(meth)\n node << REXML::Text.new(value.to_s, :raw => true) unless value.nil?\n end\n end\n doc\n end",
"title": ""
},
{
"docid": "8531b96aa4719addb6728a64014c531c",
"score": "0.58005005",
"text": "def to_xml(xml=Builder::XmlMarkup.new)\n xml.tag!('saml:Condition')\n end",
"title": ""
}
] |
e7c9dec2179c4a321ab522be41244295
|
POST /user_holidays POST /user_holidays.json
|
[
{
"docid": "6ed76d3d5461f77e9667df42bfebd418",
"score": "0.7038854",
"text": "def create\n @user_holiday = UserHoliday.new(user_holiday_params)\n\n respond_to do |format|\n if @user_holiday.save\n format.html { redirect_to @user_holiday, notice: 'User holiday was successfully created.' }\n format.json { render :show, status: :created, location: @user_holiday }\n else\n format.html { render :new }\n format.json { render json: @user_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "ae1b8e99103df9838afa374f769859c9",
"score": "0.68526113",
"text": "def holidays()\n require_authentication!\n options = make_options(\"getHolidays\")\n response = self.class.post(\"/WebUntis/jsonrpc.do;jsessionid=#{@session_id}?school=#{@school}\", options)\n raise response[\"error\"][\"message\"] unless response[\"error\"].nil?\n response[\"result\"]\n end",
"title": ""
},
{
"docid": "c9a20ab487d3bbcbc5243d0205a7a516",
"score": "0.6821791",
"text": "def create\n @holiday = Holiday.new(holiday_params)\n @holiday.user_id = current_user.id\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to holidays_path, notice: 'Holiday was successfully created.' }\n format.json { render :show, status: :created, location: @holiday }\n else\n format.html { render :new }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9531b16f8ddfd9c5bdda7f9e89fbc0f1",
"score": "0.66616184",
"text": "def create\n # parameters are sent ?\n unless params[:date]\n render json: {message: \" پارامتر ها به صورت کامل فرستاده نشده اند. \"}, status: 402\n return\n end\n\n # save off day\n day = @current_user.off_days.build( offDayParams )\n if day.save\n render json: day , status: :ok\n else\n render json: { message: day.errors } , status: 400\n end\n end",
"title": ""
},
{
"docid": "e014dd6d158595acca83a3c25f115a7d",
"score": "0.66025406",
"text": "def create\n @holiday = Holiday.new(holiday_params)\n\n if @holiday.save\n render :show, status: :created, location: @holiday\n else\n render json: @holiday.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e88344b1d1314e526e4bc84b533e8cc1",
"score": "0.65943885",
"text": "def create\n\n respond_to do |format|\n @planned_holiday.user = current_user\n if @planned_holiday.save\n format.html { redirect_to user_planned_holidays_path(current_user), notice: 'Planned holiday was successfully created.' }\n format.json { render json: @planned_holiday, status: :created, location: @planned_holiday }\n else\n format.html { render action: \"new\" }\n format.json { render json: @planned_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "214eb50112468c2f251edd823aaa1945",
"score": "0.65748805",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to '/holidays', notice: 'Holiday was successfully created.' }\n format.json { render json: @holiday, status: :created, location: @holiday }\n else\n format.html { render action: \"new\" }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0344b0f2c8b48b20c491cd29be27c35",
"score": "0.65213835",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n @holiday.save\n respond_with(@holiday) do |format|\n if @holiday.errors.blank?\n format.all { redirect_to admin_holidays_path }\n else\n format.all { render 'new' }\n end\n end\n end",
"title": ""
},
{
"docid": "96891da4004ccbd11e1b39aa4fa66749",
"score": "0.6502326",
"text": "def user_holiday_params\n params.require(:user_holiday).permit(:user_id, :holiday_id)\n end",
"title": ""
},
{
"docid": "265aa4ff56807c94a88295268196f828",
"score": "0.6483298",
"text": "def create\n\n @user_day = UserDay.new(params[:user_day])\n\n #TODO move this line to the model\n @user_day.holiday_year = HolidayYear.current_year\n\n @user = @user_day.user\n @allowance = @user.get_holiday_allowance\n @allowance.days_remaining += @user_day.no_days\n\n respond_to do |format|\n if @user_day.save and @allowance.save\n flash[:success] = \"This persons holiday allowance has been successfully updated.\"\n format.html { redirect_to(user_days_url) }\n else\n flash.now[:error] = \"There was a problem updating this persons holiday allowance.\"\n format.html\n end\n end\n end",
"title": ""
},
{
"docid": "a84d98489777250afbb72952cdf9bff2",
"score": "0.64700747",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to holidays_url, notice: 'Holiday was successfully created.' }\n format.json { render json: @holiday, status: :created, location: @holiday }\n else\n format.html { render action: \"new\" }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fa5293556db9ef4a9446897343b21be",
"score": "0.6444618",
"text": "def create\n h_p = params[:holiday]\n @holiday = Holiday.new\n @holiday.name = h_p[:name]\n s = \"#{h_p[\"start(1i)\"]}-#{h_p[\"start(2i)\"]}-#{h_p[\"start(3i)\"]} #{h_p[\"start(4i)\"]}:#{h_p[\"start(5i)\"]}\"\n e = \"#{h_p[\"end(1i)\"]}-#{h_p[\"end(2i)\"]}-#{h_p[\"end(3i)\"]} #{h_p[\"end(4i)\"]}:#{h_p[\"end(5i)\"]}\"\n @holiday.start = Time.parse(s)\n @holiday.end = Time.parse(e)\n @holiday.worker = Worker.find_by(id: h_p[:worker_id])\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to admin_holidays_path, notice: 'Holiday was successfully created.' }\n format.json { render :show, status: :created, location: admin_holidays_path }\n else\n format.html { render :new }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdf299102588d45d9757bfaae128490b",
"score": "0.64171785",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to @holiday, notice: 'Holiday was successfully created.' }\n format.json { render json: @holiday, status: :created, location: @holiday }\n else\n format.html { render action: \"new\" }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdf299102588d45d9757bfaae128490b",
"score": "0.64171785",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to @holiday, notice: 'Holiday was successfully created.' }\n format.json { render json: @holiday, status: :created, location: @holiday }\n else\n format.html { render action: \"new\" }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bff533f2b294c2b66ac71ee28597f7f9",
"score": "0.6382715",
"text": "def create\n @holiday = Holiday.new(holiday_params)\n\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to @holiday, notice: 'Holiday was successfully created.' }\n format.json { render :show, status: :created, location: @holiday }\n else\n format.html { render :new }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a4a3ee8ec2c035e71baacb3b0a22aa8",
"score": "0.6372886",
"text": "def create\n admin = User.find(1)\n params[:worked_holiday][:user_id] = admin.id\n @worked_holiday = WorkedHoliday.new(params[:worked_holiday])\n\n respond_to do |format|\n if @worked_holiday.valid?\n WorkedHoliday.process_worked_holidays(params)\n format.html { \n unless params[:employee_page].nil?\n redirect_to worked_holidays_url, notice: 'Worked holiday was successfully created.' \n else\n redirect_to worked_holidays_url, notice: 'Worked holiday was successfully created.' \n end\n }\n format.json { render json: @worked_holiday, status: :created, location: @worked_holiday }\n else\n puts @worked_holiday.errors.to_yaml\n format.html { render action: \"new\", employee_page: params[:employee_page] }\n format.json { render json: @worked_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46935f382c4f99b118d2d9c8eff78867",
"score": "0.6329017",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n @holiday.user_id= current_user.id\n @holiday.client_id= params[:client][:id]\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to @holiday, :notice => 'Holiday was successfully created.' }\n format.json { render :json => @holiday, :status => :created, :location => @holiday }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @holiday.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "769de029a62cac49f093512dc4e36a3b",
"score": "0.6284881",
"text": "def index\n @user_holidays = UserHoliday.all\n end",
"title": ""
},
{
"docid": "5548ba122a0f9720f5229cb84e580474",
"score": "0.6258882",
"text": "def add_holidays\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n holidays = params[:thetisBoxEdit]\n unless holidays.nil?\n holidays.split(\"\\n\").each do |holiday|\n tokens = holiday.split(',')\n date = DateTime.parse(tokens.shift.strip)\n date += date.offset # 2011-01-01 09:00:00 +0900 (==> 2011-01-01 00:00:00 UTC)\n name = tokens.join(',').strip\n\n schedule = Schedule.new\n schedule.xtype = Schedule::XTYPE_HOLIDAY\n schedule.scope = Schedule::SCOPE_ALL\n schedule.title = name\n schedule.start = date\n schedule.end = date\n schedule.allday = true\n schedule.save!\n end\n end\n\n @holidays = Schedule.get_holidays\n render(:partial => 'config_holidays', :layout => false)\n\n rescue => evar\n Log.add_error(request, evar)\n flash[:notice] = 'ERROR:' + t('msg.format_invalid')\n\n @holidays = Schedule.get_holidays\n render(:partial => 'config_holidays', :layout => false)\n end",
"title": ""
},
{
"docid": "a7b4ca74448f71a62eec702d975bb1fc",
"score": "0.6243558",
"text": "def download_holidays \n \n require 'open-uri'\n @country = Country.find(params[:id])\n country_code = @country.country_code \n url_request = \"http://kayaposoft.com/enrico/json/v1.0/?action=getPublicHolidaysForYear&year=2013&country=#{country_code}®ion=\" \n holidays = JSON.parse(open(url_request).read) \n holidays.each do |holiday| \n year = holiday[\"date\"][\"year\"] \n month = holiday[\"date\"][\"month\"]\n day = holiday[\"date\"][\"day\"]\n start_hash = \"#{year}-#{month}-#{day}\" \n title_hash = holiday[\"englishName\"] \n @country.holidays.create(start_at: start_hash ,name: title_hash)\n end \n redirect_to country_holidays_path(@country)\n \n if holidays.count > 0 \n @country.update(download: true)\n end \nend",
"title": ""
},
{
"docid": "bb9a4678e7a1377d27265262812b59fc",
"score": "0.61952394",
"text": "def create\n @business_holiday = BusinessHoliday.new(business_holiday_params)\n\n respond_to do |format|\n if @business_holiday.save\n format.html { redirect_to @business_holiday, notice: 'Business holiday was successfully created.' }\n format.json { render :show, status: :created, location: @business_holiday }\n else\n format.html { render :new }\n format.json { render json: @business_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb7b0b0dda6e692d80be47ea500695bc",
"score": "0.6192282",
"text": "def create\r\n @holiday = Holiday.new(params[:holiday])\r\n\r\n respond_to do |format|\r\n if @holiday.save\r\n format.html { redirect_to @holiday, notice: 'Prázdniny byly úspěšně vytvořena.' }\r\n format.json { render json: @holiday, status: :created, location: @holiday }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "eb269d4537da6c38f49a014101014df4",
"score": "0.61403686",
"text": "def set_user_holiday\n @user_holiday = UserHoliday.find(params[:id])\n end",
"title": ""
},
{
"docid": "62dcbe41b17b8aae4a1343d4105c7afd",
"score": "0.6113967",
"text": "def create\n @user_event_hour = UserEventHour.create(user_event_hours_params)\n\n respond_with @user_event_hour\n end",
"title": ""
},
{
"docid": "1cb5159e5dad2d41f6a1929c9e081b27",
"score": "0.6106308",
"text": "def holiday_params\n params.require(:holiday).permit(:customer_name, :customer_email, :customer_country, :customer_province, :date, :reminder, :notifications, :user_id)\n end",
"title": ""
},
{
"docid": "61a58d968eb305e5cae4e948d2e90d47",
"score": "0.6088105",
"text": "def index\n @holidays = Holiday.all\n render json: @holidays\n end",
"title": ""
},
{
"docid": "c5e7872b3c3461a161150ef07f2581a3",
"score": "0.6056256",
"text": "def create\n @public_holiday = PublicHoliday.new(public_holiday_params)\n\n success = false\n begin\n @public_holiday.save\n success = true\n rescue ActiveRecord::RecordNotUnique\n flash[:alert] = I18n.t('controllers.public_holidays.already_exists_for_date')\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to public_holidays_url, notice: I18n.t('controllers.public_holidays.successfully_created') }\n format.json { render :show, status: :created, location: @public_holiday }\n else\n format.html { render :new }\n format.json { render json: @public_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1431aaf75b64743299d6cc92e2c34532",
"score": "0.6004309",
"text": "def create\n @public_holiday = PublicHoliday.new(params[:public_holiday])\n\n respond_to do |format|\n if @public_holiday.save\n format.html { redirect_to @public_holiday, notice: 'Public holiday was successfully created.' }\n format.json { render json: @public_holiday, status: :created, location: @public_holiday }\n else\n format.html { render action: \"new\" }\n format.json { render json: @public_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd7052528dc4c21057d3e4a2f7e1c066",
"score": "0.59860224",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to holidays_index_path(@holiday), notice: 'Holiday is Submitted' }\n\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "f2eb42be8912932a7f4ac73cee2f956b",
"score": "0.59491056",
"text": "def holiday_params\n params.require(:holiday).permit(:date, :occasion)\n end",
"title": ""
},
{
"docid": "a5bc94ac40cd0b617469900c228eda05",
"score": "0.5925401",
"text": "def update\n respond_to do |format|\n if @user_holiday.update(user_holiday_params)\n format.html { redirect_to @user_holiday, notice: 'User holiday was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_holiday }\n else\n format.html { render :edit }\n format.json { render json: @user_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e97fa98c480e7bf8f154c5b77341bc29",
"score": "0.59184647",
"text": "def set_holiday\n @holiday = Holiday.find_by_id(params[:id])\n if @holiday\n else\n \trender json: { valid: false}, status: 404\n end\n end",
"title": ""
},
{
"docid": "9545e16ed11614f8c1405f8ea0894ade",
"score": "0.59028023",
"text": "def holiday_params\n params.require(:holiday).permit(:name, :global, :date)\n end",
"title": ""
},
{
"docid": "cb6824c3dee67687bc380091eb729b72",
"score": "0.5896022",
"text": "def holiday_params\n params.require(:holiday).permit(:name, :description, :date, :type, :locations, :states, :favorite)\n end",
"title": ""
},
{
"docid": "cbcc5d19faa00f6d8b2aee194e1f4a3e",
"score": "0.58827776",
"text": "def holiday_params\n params.require(:holiday).permit(:start_date, :end_date, :subscriber_id)\n end",
"title": ""
},
{
"docid": "818f92fc139140dc367930bc2e0c99ef",
"score": "0.5872012",
"text": "def holiday_params\n params.require( :holiday ).permit( :id, :date_from, :date_until, :country_name_id, :region_name_id, :description, :work )\n end",
"title": ""
},
{
"docid": "100867d6ee02f1f2369e1dc24d50680a",
"score": "0.5871653",
"text": "def create\n \t@partner = Partner.find(params[:partner_id])\n result = @partner.work_plan.book_holiday(DateTime.parse(params[:holiday][:start_at]), DateTime.parse(params[:holiday][:end_at]), params[:holiday][:name])#.build(params[:holiday])\n\t\tif @partner.save and result\n\t\t\tredirect_to(@partner.work_plan.partner, :notice => 'Holiday was successfully created.') \n\t\telse\n\t\t\trender :action => \"new\" \n\t\tend\n end",
"title": ""
},
{
"docid": "2e6e3c1ae44536a743f97cdb71324c5d",
"score": "0.58393246",
"text": "def create\n @holidaybirdfc = Holidaybirdfc.new(holidaybirdfc_params)\n\n respond_to do |format|\n if @holidaybirdfc.save\n format.html { redirect_to @holidaybirdfc, notice: 'Holidaybirdfc was successfully created.' }\n format.json { render :show, status: :created, location: @holidaybirdfc }\n else\n format.html { render :new }\n format.json { render json: @holidaybirdfc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e84ffc1d4f7a05af285892486789e31",
"score": "0.5815962",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n\n respond_to do |format|\n if @holiday.save\n HolidayMailer.holiday_request(@holiday).deliver\n format.html { redirect_to(employee_root_path, :notice => 'Holiday was successfully created.') }\n format.xml { render :xml => @holiday, :status => :created, :location => @holiday }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @holiday.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b43e8c83134d554dcc6d5864b4311b31",
"score": "0.5813988",
"text": "def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end",
"title": ""
},
{
"docid": "b43e8c83134d554dcc6d5864b4311b31",
"score": "0.5813988",
"text": "def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end",
"title": ""
},
{
"docid": "b43e8c83134d554dcc6d5864b4311b31",
"score": "0.5813988",
"text": "def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end",
"title": ""
},
{
"docid": "7d08482956cdaf08b64e085a9e281616",
"score": "0.58052635",
"text": "def index\n @holidays = Holiday.all\n\n respond_with(@holidays)\n end",
"title": ""
},
{
"docid": "63336bdc1540fcff1b8b603d0eae4fa6",
"score": "0.5802033",
"text": "def create\n @day = @user.days.new(params[:day])\n\n respond_to do |format|\n if @day.save\n format.html { redirect_to user_days_path(@user), notice: 'Day Awrad was successfully saved.' }\n format.json { render json: @day, status: :created, location: @day }\n else\n format.html { render action: \"new\" }\n format.json { render json: @day.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba52ddc33f84953674dbb366e8236411",
"score": "0.5801638",
"text": "def create\n @time_record = TimeRecord.new(params[:time_record])\n @holidays = findHolidays(session[:monthly])\n\n respond_to do |format|\n if @time_record.save\n format.html { redirect_to action: 'index' }\n format.json { render json: @time_record, status: :created, location: @time_record }\n format.js { render action: 'update' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4d1eaaf979b9dbe26ef6d688e48b317",
"score": "0.57781357",
"text": "def holiday_params\n params.require(:holiday).permit(:name)\n end",
"title": ""
},
{
"docid": "6ce6ddc1edc8b75728646152e43f64c4",
"score": "0.57728595",
"text": "def create\n @setting = Setting.find(params[:setting_id])\n @holiday = @setting.holidays.new(holiday_params)\n respond_to do |format|\n if @holiday.save\n format.html { redirect_to [@setting, @holiday], notice: 'Holiday was successfully created.' }\n format.json { render :show, status: :created, location: @holiday }\n else\n format.html { render :new }\n format.json { render json: @holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31f9e54095569d322d0e31eeeef58a40",
"score": "0.57696074",
"text": "def create\n @holiday = Holiday.new(params[:holiday])\n\n respond_to do |format|\n if @holiday.save\n \tflash[:notice] = 'Holiday was successfully created!'\n format.html { redirect_to('/holidays') }\n format.xml { render :xml => @holiday, :status => :created, :location => @holiday }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @holiday.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb9487ad53bf2c2ad1fa8d1ba8cf0c42",
"score": "0.5765394",
"text": "def create\n @holiday_list = HolidayList.new(holiday_list_params)\n\n respond_to do |format|\n if @holiday_list.save\n format.html { redirect_to @holiday_list, notice: 'Holiday list was successfully created.' }\n format.json { render :show, status: :created, location: @holiday_list }\n else\n format.html { render :new }\n format.json { render json: @holiday_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e81e6f7bf990d783f1c5089853552ff",
"score": "0.5764092",
"text": "def create\n # parameters are sent ?\n if not params[:date] or not params[:title] or not params[:is_day_off]\n render json:{ error: \"پارامتر ها را به صورت کامل ارسال کنید\" } , status: 402\n return\n end\n # save national event\n event = @current_user.national_event.build(nationalEventParams)\n if event.save\n render json: event , status: :ok\n else\n render json: event.errors , status: 400\n end\n end",
"title": ""
},
{
"docid": "685704848ba2f3c2c3fe05b8aa309062",
"score": "0.57506317",
"text": "def create\n @holiday = Holiday.new(holiday_params)\n @holidays = Holiday.all\n respond_to do |format|\n if @holiday.save\n @holiday = Holiday.new\n format.js { @flag = true }\n else\n flash.now[:alert] = 'Holiday Already Exist.'\n format.js { @flag = false }\n end\n end\n end",
"title": ""
},
{
"docid": "9a96884b877d4b5b8f12417a81948011",
"score": "0.5747046",
"text": "def get_holidays_data()\n\t\t# check whether the redmine_holidays plugin is installed or not\n\t\t@has_holidays_plugin = Redmine::Plugin.installed?(:redmine_holidays)\n\n\t\t# do nothing if it isn't installed\n\t\tif !@has_holidays_plugin\n\t\t\treturn\n\t\tend\n\n\t\t# is user have the permission to view holidays?\n\t\thas_view_holidays_permission = User.current.allowed_to?(:view_holidays, nil, :global => true)\n\t\tif !has_view_holidays_permission\n\t\t\t@has_holidays_plugin = false\n\t\t\treturn\n\t\tend\n\n\t\tparams[:show_holidays] = \"1\" unless params[:show_holidays]\n\t\tparams[:show_past_holidays] = \"\" unless params[:show_past_holidays]\n\n\t\t@show_past_holidays = (params[:show_past_holidays] == \"1\")\n\n\t\t# retrieve holiday types\n\t\t@holiday_types = HolidayTypes.all(:order => \"name ASC\")\n\tend",
"title": ""
},
{
"docid": "dbb0a4377e80b49e2d09fc8530fde815",
"score": "0.57445127",
"text": "def index\r\n @holidays = Holiday.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @holidays }\r\n end\r\n end",
"title": ""
},
{
"docid": "4e54ab1ae7a982215296528160aab925",
"score": "0.5723463",
"text": "def get_holidays #TODO: use local db for keeping data\n open URL(holiday_opt[:country]) + PARAM(*build_date_range)\n rescue => e\n STDERR.puts \"Failed to retrieve Holiday data by Google Calendar Data API. #{e}\"\n end",
"title": ""
},
{
"docid": "2f18ab813f3d926b097486157d59ae5d",
"score": "0.57230926",
"text": "def create\n @vacation = Vacation.new(params[:vacation])\n @vacation.holiday_year_id = nil #THIS MUST BE REMOVED OR WILL BE PASSED FROM THE FILTER\n @vacation.user = current_user\n @vacation.holiday_status_id = 1\n manager_id = current_user.manager_id\n @vacation.manager_id = manager_id # Add manager to all holidays\n manager = User.find_by_id(manager_id)\n\n respond_to do |format|\n if @vacation.save\n unless manager.nil?\n HolidayMailer.holiday_request(current_user, manager, @vacation).deliver\n end\n\n user_days_per_year = UserDaysForYear.where(:user_id=> current_user.id, :holiday_year_id => params[:vacation][:holiday_year_id]).first\n @days_remaining = user_days_per_year.days_remaining\n\n flash[:notice] = \"Successfully created holiday.\"\n format.js\n else\n flash[:notice] = \"Problem creating the holiday\"\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "98478108944fece45737cc3ee11dd9af",
"score": "0.5710718",
"text": "def holiday_params\n params.fetch(:holiday, {}).permit!\n end",
"title": ""
},
{
"docid": "1b35c8d1e892c68329edf9ff3299a213",
"score": "0.57068574",
"text": "def create\n @vacation = Vacation.new(params[:vacation])\n @vacation.holiday_year_id = nil #THIS MUST BE REMOVED OR WILL BE PASSED FROM THE FILTER\n @vacation.user = current_user\n @vacation.holiday_status_id = 1\n manager_id = current_user.manager_id\n manager = User.find_by_id(manager_id)\n\n respond_to do |format|\n if @vacation.save\n unless manager.nil?\n HolidayMailer.holiday_request(current_user, manager, @vacation).deliver\n end\n\n user_days_per_year = UserDaysForYear.where(:user_id=> current_user.id, :holiday_year_id => params[:vacation][:holiday_year_id]).first\n @days_remaining = user_days_per_year.days_remaining\n\n flash.now[:success] = \"Successfully created holiday.\"\n format.js\n else\n flash.now[:error] = \"There was a problem creating your holiday request\"\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "362482410c3464286f84ca43af80b21c",
"score": "0.5699301",
"text": "def new\n @holiday = Holiday.new\n\n respond_with(@holiday)\n end",
"title": ""
},
{
"docid": "0168dc8cf7776591133ac8a5823685cf",
"score": "0.5696292",
"text": "def create\n @hollyday = Hollyday.new(params[:hollyday])\n\n respond_to do |format|\n if @hollyday.save\n format.html { redirect_to @hollyday, :notice => 'Hollyday was successfully created.' }\n format.json { render :json => @hollyday, :status => :created, :location => @hollyday }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @hollyday.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c04539031108a809fecdd6b70c9eec3",
"score": "0.5683556",
"text": "def delete_holidays\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n holidays = params[:holidays]\n unless holidays.nil?\n SqlHelper.validate_token([holidays])\n holidays.each do |schedule_id|\n Schedule.destroy(schedule_id)\n end\n end\n\n @holidays = Schedule.get_holidays\n render(:partial => 'config_holidays', :layout => false)\n end",
"title": ""
},
{
"docid": "81bc79a62410d68586d15f1bc751ead9",
"score": "0.5679261",
"text": "def destroy\n @user_holiday.destroy\n respond_to do |format|\n format.html { redirect_to user_holidays_url, notice: 'User holiday was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89ae5d025fa4a7b85eebb2bc7f020d8d",
"score": "0.56751204",
"text": "def create\n @holidaylocal = Holidaylocal.new(params[:holidaylocal])\n\n respond_to do |format|\n if @holidaylocal.save\n format.html { redirect_to @holidaylocal, notice: 'Holidaylocal was successfully created.' }\n format.json { render json: @holidaylocal, status: :created, location: @holidaylocal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @holidaylocal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2de71ccf9ac9438ddfae2144bc19a46",
"score": "0.567259",
"text": "def public_holiday_params\n params.require(:public_holiday).permit(:date, :name)\n end",
"title": ""
},
{
"docid": "1aa3d277db419cbea13d23f3e7d9b09d",
"score": "0.5663337",
"text": "def holiday_params\n params.require(:holiday).permit(:start, :end, :name, \"start(1i)\", \"start(2i)\", \"start(3i)\", \"start(4i)\", \"start(5i)\", \"end(1i)\", \"end(2i)\", \"end(3i)\", \"end(4i)\", \"end(5i)\", \"worker_id\")\n\n end",
"title": ""
},
{
"docid": "ba030d20680ea09b8646415c1d661b90",
"score": "0.5661248",
"text": "def new\n @holiday = Holiday.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holiday }\n end\n end",
"title": ""
},
{
"docid": "ba030d20680ea09b8646415c1d661b90",
"score": "0.5661248",
"text": "def new\n @holiday = Holiday.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holiday }\n end\n end",
"title": ""
},
{
"docid": "ba030d20680ea09b8646415c1d661b90",
"score": "0.5661248",
"text": "def new\n @holiday = Holiday.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holiday }\n end\n end",
"title": ""
},
{
"docid": "ba030d20680ea09b8646415c1d661b90",
"score": "0.5661248",
"text": "def new\n @holiday = Holiday.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holiday }\n end\n end",
"title": ""
},
{
"docid": "e1dee2b9798601d84dc7072dd0ba13a5",
"score": "0.5658242",
"text": "def business_holiday_params\n params.require(:business_holiday).permit(:working_date, :holiday_flag)\n end",
"title": ""
},
{
"docid": "5775e9d48f07bb9db9b792940aeaf667",
"score": "0.56481266",
"text": "def destroy\n @planned_holiday.destroy\n\n respond_to do |format|\n format.html { redirect_to user_planned_holidays_path(current_user) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "195e8abaa2c5e01df691f665316d8c3e",
"score": "0.5639053",
"text": "def holiday_list_params\n params.require(:holiday_list).permit(:name, :date)\n end",
"title": ""
},
{
"docid": "11a8792895e04eab40ddad81a4977903",
"score": "0.5617478",
"text": "def set_holiday\n @holiday = Holiday.includes( :country_name ).find( params[ :id ])\n end",
"title": ""
},
{
"docid": "79788329845ca81fdc34e0e52b9b8713",
"score": "0.56108713",
"text": "def create\n @day_off = DayOff.new(day_off_params)\n\n respond_to do |format|\n if @day_off.save\n format.html { redirect_to @day_off, notice: 'Day off was successfully created.' }\n format.json { render :show, status: :created, location: @day_off }\n else\n format.html { render :new }\n format.json { render json: @day_off.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3be91446529b5f17d5388cca4b502ef",
"score": "0.55826235",
"text": "def new\r\n @holiday = Holiday.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @holiday }\r\n end\r\n end",
"title": ""
},
{
"docid": "634c5129dac53caff7143600735c7549",
"score": "0.5582045",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "634c5129dac53caff7143600735c7549",
"score": "0.5582045",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "634c5129dac53caff7143600735c7549",
"score": "0.5582045",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "c369a07a2942f20d71179c8d51fcfa3a",
"score": "0.5580342",
"text": "def create\n hearing = HearingDay.create_hearing_day(create_params)\n return invalid_record_error(hearing) if hearing.nil?\n render json: {\n hearing: json_hearing(hearing)\n }, status: :created\n end",
"title": ""
},
{
"docid": "6467c155fd79ac0dbb570201b2bad466",
"score": "0.5572885",
"text": "def update\n if @holiday.update(holiday_params)\n render :show, status: :ok, location: @holiday\n else\n render json: @holiday.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "07d15e0680cca8e30f7be0f0a0b4c76c",
"score": "0.55459785",
"text": "def index\n @worked_holidays = user_capabilities(WorkedHoliday).current_worked\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @worked_holidays }\n end\n end",
"title": ""
},
{
"docid": "d1eda74f2cf0b52761f290c4724774a8",
"score": "0.55142796",
"text": "def create\n @attendance = Attendance.new(params[:attendance])\n @attendance.user = current_user\n @attendance.days = @attendance.days.abs\n if @attendance.days != 0.5\n @attendance.end_date= @attendance.start_date + @attendance.days.days - 1.days\n else\n @attendance.end_date= @attendance.start_date + @attendance.days.days - @attendance.days.days\n end\n if(@attendance.approval_status)\n redirect_to \"/faultyaccess.html\"\n end\n\n respond_to do |format|\n if @attendance.save\n format.html { redirect_to :controller=> 'dashboard' }\n format.json { render json: @attendance, status: :created, location: @attendance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "460659010c5ced18599f309e5f3d39b8",
"score": "0.55111533",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "460659010c5ced18599f309e5f3d39b8",
"score": "0.55111533",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "460659010c5ced18599f309e5f3d39b8",
"score": "0.55111533",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "460659010c5ced18599f309e5f3d39b8",
"score": "0.55111533",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "460659010c5ced18599f309e5f3d39b8",
"score": "0.55111533",
"text": "def set_holiday\n @holiday = Holiday.find(params[:id])\n end",
"title": ""
},
{
"docid": "6d0d5c86c638b75827d335b9f3c8057e",
"score": "0.5509616",
"text": "def date_time_get_public_holidays_with_http_info(input, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DateTimeApi.date_time_get_public_holidays ...'\n end\n # verify the required parameter 'input' is set\n if @api_client.config.client_side_validation && input.nil?\n fail ArgumentError, \"Missing the required parameter 'input' when calling DateTimeApi.date_time_get_public_holidays\"\n end\n # resource path\n local_var_path = '/validate/date-time/get/holidays'\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/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(input)\n auth_names = ['Apikey']\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 => 'PublicHolidaysResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DateTimeApi#date_time_get_public_holidays\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "18c1b435c71281ef114c5cdf56be12af",
"score": "0.55088556",
"text": "def create\n @d_event = DEvent.new(params[:d_event])\n\n @d_event.start_day = params[:d_event][:start_day].delete(\"/\")\n @d_event.end_day = params[:d_event][:end_day].delete(\"/\")\n @d_event.action_day = params[:d_event][:action_day].delete(\"/\")\n @d_event.created_user_id = current_user.id\n \n respond_to do |format|\n if @d_event.save\n format.html { redirect_to @d_event, notice: 'D event was successfully created.' }\n format.json { render json: @d_event, status: :created, location: @d_event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @d_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c17ac60bd645a7677e94c1b485b44de",
"score": "0.5508468",
"text": "def index\n @holidays = current_user.holidays\n @title = \"Customer's holidays\"\n end",
"title": ""
},
{
"docid": "81d00369d0abdc6085b7e75bbbe7d6b3",
"score": "0.54961663",
"text": "def create\n @event_attendance = current_user.event_attendances.new(event_attendance_params)\n\n respond_to do |format|\n if @event_attendance.save\n format.html { redirect_back fallback_location: root_path }\n format.json { render :show, status: :created, location: @event_attendance }\n else\n format.html { redirect_back fallback_location: root_path }\n format.json { render json: @event_attendance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1236f67dd336bcf3d4053c8407eb34b2",
"score": "0.5481325",
"text": "def holiday_params\n params.require(:holiday).permit(:c_off,:holiday_type,:is_taken,:code, :name, :description, :holiday_date)\n end",
"title": ""
},
{
"docid": "be754af96112843ef43616eda70287bb",
"score": "0.5479371",
"text": "def index\n start_date = validate_start_date(params[:start_date])\n end_date = validate_end_date(params[:end_date])\n regional_office = HearingDayMapper.validate_regional_office(params[:regional_office])\n\n hearing_days = HearingDay.list_upcoming_hearing_days(start_date, end_date, current_user, regional_office)\n\n respond_to do |format|\n format.html do\n render \"hearing_schedule/index\"\n end\n format.json do\n render json: {\n hearings: json_hearings(HearingDay.array_to_hash(hearing_days)),\n startDate: start_date,\n endDate: end_date\n }\n end\n end\n end",
"title": ""
},
{
"docid": "15ed97187cee974b6de020c4a9460615",
"score": "0.5476117",
"text": "def index\n #TODO restrict holidays by year\n @statuses = HolidayStatus.all\n @users = User.get_team_users(current_user.id).includes(:vacations)\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "5638493a090d40abf773660b174976e0",
"score": "0.5474102",
"text": "def show\n holiday = Holiday.find(params[:id])\n render json: {\n status: 'OK',\n message: 'Vacación cargada',\n data: holiday\n }, status: :ok\n end",
"title": ""
},
{
"docid": "ffee82a1287f271dbb6a636848b2dfe1",
"score": "0.5470525",
"text": "def new\n @public_holiday = PublicHoliday.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @public_holiday }\n end\n end",
"title": ""
},
{
"docid": "d1d9ad3e1840c0dd8e8f983c040ba575",
"score": "0.54691017",
"text": "def is_on_holiday?(date)\n approved_holiday_requests.each do |request|\n request.employee_holidays.each do |holiday|\n return true if holiday.date == date\n end\n end\n\n false\n end",
"title": ""
},
{
"docid": "9dc70ec542283265cc8156b330d31e43",
"score": "0.5463329",
"text": "def update\n @holiday.update(holiday_params)\n @date = holiday_params['holiday_date']\n EmployeeAttendance.where(holiday_id: @holiday.id).update_all(day: @date.to_date)\n @holidays = Holiday.all\n @holiday = Holiday.new\n end",
"title": ""
},
{
"docid": "6c956d6354714fc57a87c42910ddea86",
"score": "0.5458847",
"text": "def create\n @event = current_user.events.new(event_params)\n @day = @event.due_date.strftime('%F')\n @meetings = current_user.events.on_this_day(@day)\n respond_to do |format|\n if @event.save\n format.json { render :show, status: :created, location: @event }\n format.js\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.js { render :file => \"app/views/events/event_error.js.erb\" }\n end\n end\n end",
"title": ""
},
{
"docid": "1550d3ef740cba8c9272eb1ade817101",
"score": "0.5452593",
"text": "def create\n\n if logged_in_as_employee?\n @day_booking = DayBooking.new(params[:day_booking])\n\n respond_to do |format|\n if @day_booking.save\n format.html { redirect_to @day_booking, :notice => 'Day booking was successfully created.' }\n format.json { render :json => @day_booking, :status => :created, :location => @day_booking }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @day_booking.errors, :status => :unprocessable_entity }\n end\n end\n\n else\n authenticate_employee\n end\n end",
"title": ""
},
{
"docid": "ffb28afbbfda2fe9e64978d7eb4b15d9",
"score": "0.5442236",
"text": "def create\n @daysoffrequest = Daysoffrequest.new(daysoffrequest_params)\n\n respond_to do |format|\n if @daysoffrequest.save\n format.html { redirect_to @daysoffrequest, notice: 'Days Off Request was successfully created.' }\n format.json { render :show, status: :created, location: @daysoffrequest }\n else\n format.html { render :new }\n format.json { render json: @daysoffrequest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c62d608bb72204c337ebc72ae95c20a6",
"score": "0.5438771",
"text": "def holiday_params\n params[:holiday]\n end",
"title": ""
}
] |
4858dec270464df36f28bc41541e51d1
|
Print and export the source from a given URL to an epub file
|
[
{
"docid": "10957aa3a300d105f9b0d104fa46d034",
"score": "0.5278676",
"text": "def export\n clone\n puts \"FYI: list of extensions: #{all_extensions}\"\n # Note: if we are using the '--command', it will be empty list by default\n puts \"FYI: list of all files : #{all_files}\" unless all_files.empty?\n files2htmls\n htmls2epub\n copy_output\n cleanup\n end",
"title": ""
}
] |
[
{
"docid": "6032f986f0e5010e7823fd2252b34855",
"score": "0.6313962",
"text": "def url_download(uri, filename=\".\")\n open(filename, 'w') do |foo|\n foo.print open(uri).read\n end\nend",
"title": ""
},
{
"docid": "6bbc9ab3964f2af4d3a641c172809121",
"score": "0.6223835",
"text": "def to_epub\n epub = EpubGenerator.new @download_dir, \"#{@download_dir}.epub\"\n epub.write\n end",
"title": ""
},
{
"docid": "dad0b4d75568a41e8d630afb1a4cf1b1",
"score": "0.6144898",
"text": "def download(url, dl_path)\n puts \"Downloading [#{@current + 1}/#{@download_list.size}]: #{url} ...\"\n encoded_url = Addressable::URI.encode(url)\n\n URI.parse(encoded_url).open do |content|\n File.open(dl_path, 'wb') { |f| f.write parse_content(url, content) }\n end\n\n @fail = 0 # success\n rescue StandardError => e\n puts \"Error: #{url}, #{e.message}\"\n\n # cant download book\n exit if url == \"#{@url}/EPUB/package.opf\" && @fail == 2\n @fail = @fail < 2 ? @fail + 1 : 0\n end",
"title": ""
},
{
"docid": "f8d7edfa9ca3108fbba53a4d55d5a08f",
"score": "0.6116639",
"text": "def source(url); end",
"title": ""
},
{
"docid": "25c89ef3a11a5612a5d14753ca013921",
"score": "0.6104358",
"text": "def download\n raise \"No episode URL specified.\" unless @episode_url\n @episode_url =~ /\\/([^\\/]+\\.\\w{3})$/\n to_here = $1\n writeOut = open(to_here, \"wb\") \n writeOut.write(open(episode).read) \n writeOut.close\n end",
"title": ""
},
{
"docid": "f21492f12a3ffe92aa115479a1000442",
"score": "0.60872555",
"text": "def htmls2epub\n input_file = File.expand_path(\"#{output_path}/vim_printer_#{repo_name}.tar.gz\")\n if File.exist?(input_file)\n FileUtils.mkdir_p(output_dir)\n AgileUtils::FileUtil.gunzip(input_file, output_dir)\n xhtml_files = CodeLister.files base_dir: output_dir,\n recursive: true,\n exts: %w[xhtml],\n non_exts: []\n project_dir = File.expand_path(File.dirname(output_dir) + \"../../#{Source2Epub::TMP_DIR}/#{repo_name}\")\n xhtml_files.map! do |f|\n File.expand_path(f.gsub(/^\\./, project_dir))\n end\n nav_list = nav_index(xhtml_files, project_dir)\n create_epub(xhtml_files, nav_list)\n end\n end",
"title": ""
},
{
"docid": "0b115cfa1f2d5ddcc39e2885b9c7b124",
"score": "0.6083556",
"text": "def download url\n uri = URI.parse url\n Net::HTTP.start(uri.host) { |http|\n resp = http.get(uri.path)\n\n #pulls the filename out of the response from the eztv redirect\n #then saves the file to that filename in the current directory\n rxp = Regexp.new(/filename=\"([^\"].*)\"/)\n filename = rxp.match(resp['content-disposition'])[1]\n open(filename, \"wb\"){ |file|\n file.write(resp.body)\n }\n }\n end",
"title": ""
},
{
"docid": "515696bb3bc8598dc4be61cf3e7e1005",
"score": "0.60546046",
"text": "def get_url(url, filename)\n require \"console_app\"\n app.get(url) \n File.open(filename,'w') do |io|\n io.puts app.html_document.root.to_s\n end\nend",
"title": ""
},
{
"docid": "bf701803896c421d50ba0cdd332a525f",
"score": "0.5900767",
"text": "def download_to_file url, target\n File.open(target, 'w') do |saved_file|\n # the following \"open\" is provided by open-uri\n open(url) do |read_file|\n saved_file.write(read_file.read)\n end\n end\n end",
"title": ""
},
{
"docid": "70d74c0853fc54595f3ffd4cd3690350",
"score": "0.58914876",
"text": "def download full_url, to_here\n require 'open-uri'\n writeOut = open(to_here, \"wb\")\n writeOut.write(open(full_url).read)\n writeOut.close\nend",
"title": ""
},
{
"docid": "ea35d2e480b424d54302e4bcc7a14970",
"score": "0.5810614",
"text": "def get_page_source(url)\n uri = URI.parse url\n \n http = Net::HTTP.new(uri.host, uri.port)\n if (uri.kind_of? URI::HTTPS) then\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n \n response = http.get(uri.path)\n if (response.code != '200') then\n abort(\"\\nWas not able to pull xml file from #{uri}\" +\n \"Response Code: #{response.code}\")\n end\n \n return response.body\nend",
"title": ""
},
{
"docid": "6cf938488ac4389b8eba6e5ff4cc8aff",
"score": "0.58087677",
"text": "def fetch_mp3 url, file_name\n begin \n content = open(url, \"User-Agent\" => USER_AGENT).read\n \n File.open(file_name, \"ab\") do |f|\n f.puts content\n end\n rescue => e\n $stderr.puts(\"Internet error! #{e.message}\")\n exit(1)\n end\n end",
"title": ""
},
{
"docid": "849de64387cbcb708a343e6c924e31ec",
"score": "0.5765714",
"text": "def download(url, filename)\n Dir.mkdir TUTOR_ATTACHMENTS_PATH \\\n unless File.exists? TUTOR_ATTACHMENTS_PATH\n destination = \"#{TUTOR_ATTACHMENTS_PATH}/#{filename}\"\n write(destination, http_get(url))\n \"#{TUTOR_ATTACHMENTS_URL}/#{filename}\"\n end",
"title": ""
},
{
"docid": "fa47ff2465bc9bfbfaa74b57db8a753a",
"score": "0.5764643",
"text": "def download(save_path)\n page = Nokogiri::HTML(open(self.website))\n link = \"http://apod.nasa.gov/\" + page.css('body > center:nth-child(1) > p:nth-child(3) > a')[0]['href']\n url = URI.parse(link)\n url.open do |pic|\n File.open(save_path, \"w\") do |file|\n file << pic.read\n end\n end\n end",
"title": ""
},
{
"docid": "1180b07cd7343639a215f24246461664",
"score": "0.57153594",
"text": "def get_doc_contents(url, format: nil)\n parts = self.class.parse_url(url)\n case parts['type']\n when 'spreadsheets'\n filename = export_to_file(parts['id'], :xlsx)\n ret = prepare_spreadsheet(filename)\n File.unlink(filename)\n when 'document'\n ret = export(parts['id'], format || :html)\n else\n ret = export(parts['id'], format || :txt)\n end\n ret\n end",
"title": ""
},
{
"docid": "ebe2f499eca99f10bb20bd1d1c52663d",
"score": "0.5705611",
"text": "def download(url, filename)\n File.open(filename, 'wb') do |file|\n file << open(url).read\n end\n end",
"title": ""
},
{
"docid": "f501c5b7da7ba02ffe33035676e2f782",
"score": "0.57044476",
"text": "def open(url, options={})\n require 'open-uri'\n text = open(url).read\n file = File.basename(url) # parse better with URI.parse\n options[:file] = file\n text(text, options)\n end",
"title": ""
},
{
"docid": "5903f9ca8975f6c1883c13af42257b30",
"score": "0.56981874",
"text": "def open_file\n open(source_url).read\n rescue OpenURI::HTTPError\n ''\n end",
"title": ""
},
{
"docid": "b0970101d4d7cd5f84dccd48dfa57584",
"score": "0.5697807",
"text": "def download(url,filename=nil)\n path = File.join(self.tmpdir,filename_from_url(url))\n open(url) do |f|\n File.open(path,\"wb\") do |file|\n file.puts f.read\n end\n end \n path\n end",
"title": ""
},
{
"docid": "c3231b2c3e0c5a11587ebe2a893b3b5d",
"score": "0.5696976",
"text": "def download(url, filename)\n uri = URI(url)\n @request = Net::HTTP::Get.new uri.path\n set_headers :user\n\n File.open(filename, \"w\") do |file|\n file.puts request(uri).body\n end\n end",
"title": ""
},
{
"docid": "1b54861b8b52afeae3005263556ebba8",
"score": "0.56967574",
"text": "def download!(source_url, destination_file); end",
"title": ""
},
{
"docid": "7cabea6ecf112ab5d42a233c06049fa7",
"score": "0.56712127",
"text": "def download\n target = File.basename(@pkg_url)\n\n debug(\"downloading #{@pkg_url} => #{target}\")\n write_to(File.open(target, 'w'))\n end",
"title": ""
},
{
"docid": "5c1d4a9475ced06b59c0053dabb40cfa",
"score": "0.5659107",
"text": "def getpage(url)\n filename = \"cache/#{Digest::MD5.hexdigest(url)[0..6]}-#{url.gsub(/[^A-Za-z0-9-]/,'')}.htm\"\n if File.exist? filename\n content = IO.read filename\n else\n #begin\n page = open(url)\n content = page.read\n File.open(filename, 'w') {|f| f.write(content) }\n #rescue\n #end\n end\n content\nend",
"title": ""
},
{
"docid": "035a19811c63979d9cc1eb52ab4a981d",
"score": "0.5656795",
"text": "def get_pdf!\n File.write(path, Net::HTTP.get(URI.parse(uri)))\n end",
"title": ""
},
{
"docid": "be49695757e8b46111865ac5d428d75c",
"score": "0.5652789",
"text": "def download_to_file url, file\n url = URI.parse(URI.encode(url.strip))\n\n File.new(file, File::CREAT)\n\n Net::HTTP.start(url.host) { |http|\n resp = http.get(url.path)\n open(file, \"wb\") { |file|\n file.write(resp.body)\n }\n }\n end",
"title": ""
},
{
"docid": "ef03ef33321c896b3642359200bac59f",
"score": "0.5646885",
"text": "def fetch_page(url)\n open(url){|f| f.read }\n end",
"title": ""
},
{
"docid": "2016263ae62c9bdbe37780f2831762e9",
"score": "0.56403357",
"text": "def save_file(url)\n \tputs \"Downloading file from URL ...\"\n \t file_name = url.split(\"/\").last\n \t file_path = \"#{Rails.root}/public/#{file_name}\"\n \n open(file_path, 'wb') do |file|\n file << open(url).read\n end \n\n file_path\t\n end",
"title": ""
},
{
"docid": "3366526cf0374511039992851f0dfe2a",
"score": "0.5631263",
"text": "def pdf_url1\n a = \"http://ec2-107-22-95-239.compute-1.amazonaws.com/download/#{@rendimientos.dane}&-n&--filename=#{@rendimientos.nombre}\"\n b = \"http://pdfmyurl.com/?url=#{a}\"\n end",
"title": ""
},
{
"docid": "e4a71182c00da521bb122e9babacefbc",
"score": "0.56163824",
"text": "def write_sru(url,filename)\n filename = ( filename =~ /.xml$/ ? filename : filename + '.xml')\n File.open(\"data/downloads/#{filename}\",'w') do |file|\n open(url).each_line do |line|\n file << line\n end\n end\n end",
"title": ""
},
{
"docid": "82b6e395dba6bf541d7ba0eccf4dce55",
"score": "0.5613235",
"text": "def webarchive_url_to_markdown(outtype)\n\t$input.each {|f|\n\t\tfile = File.expand_path(f)\n\t\tsource_url = %x{mdls -name 'kMDItemWhereFroms' -raw #{file}}.split(\"\\n\")[1].strip.gsub(/(^\"|\"$)/,'')\n\t\tres = Net::HTTP.post_form(URI.parse(\"#{$fymdhost}/go/\"),{'u'=>source_url,'read'=>'1','output' => outtype})\n\t\tif res.code.to_i == 200\n\t\t\tif outtype == 'nv'\n\t\t\t\t%x{osascript -e 'tell app \"nvALT\" to activate'}\n\t\t\t\t%x{open \"#{res.body}\"}\n\t\t\telsif ($options[:outfolder])\n\t\t\t\toutfile = $options[:outfolder]\n\t\t\t\toutfile += %x{textutil -info #{file} | grep \"Title:\"}.gsub(/^\\s*Title:\\s*/,'').strip.gsub(/[!?*$^()]+/,'') + '.md'\n\t\t\t\tFile.open(outfile,'w') {|f|\n\t\t\t\t\tf.puts res.body\n\t\t\t\t}\n\t\t\t\tputs \"Webarchive origin converted and saved to #{outfile}\"\n\t\t\telse\n\t\t\t\tputs res.body\n\t\t\tend\n\t\telse\n\t\t\tputs \"Error opening URL: #{source_url}\"\n\t\tend\n\t}\nend",
"title": ""
},
{
"docid": "3e63c437e723150fda53a19aa18e3c49",
"score": "0.5612095",
"text": "def urlposts_xml_file(url)\n fname = urlpost_fname url\n File.open fname\n end",
"title": ""
},
{
"docid": "2ebdef27858452345b61f01c67808594",
"score": "0.5601876",
"text": "def get_file(file, url)\n open(file, 'wb').write(open(url).read)\nend",
"title": ""
},
{
"docid": "beebd4b68fdf2a56b8c84bce6fd829db",
"score": "0.5597456",
"text": "def fetch url\n open(url, :allow_redirections => :all) do |feed|\n if feed.content_encoding == ['gzip'] then\n feed = Zlib::GzipReader.new(StringIO.new(feed.read)).read\n end\n doc = RSS::Parser.parse(feed, do_validate=false)\n initialize_writer(doc)\n process_items(doc)\n end\n end",
"title": ""
},
{
"docid": "67767dcce31ff03bf01d6967b73f36e4",
"score": "0.5575147",
"text": "def download(url)\n filename = determine_download_name(url)\n File.open(filename, 'w') { |f| f.write get(url) }\n filename\n end",
"title": ""
},
{
"docid": "67767dcce31ff03bf01d6967b73f36e4",
"score": "0.5575147",
"text": "def download(url)\n filename = determine_download_name(url)\n File.open(filename, 'w') { |f| f.write get(url) }\n filename\n end",
"title": ""
},
{
"docid": "2619deb533f782c0e301bbb6525fcb18",
"score": "0.5573956",
"text": "def fetch_xml_into_file(url_str, fname)\n fp = File.open(fname, 'w')\n @doc = Nokogiri::XML(open(url_str))\n fp.puts(@doc)\n fp.close\nend",
"title": ""
},
{
"docid": "77d84fbbe6471f9dacec4a6d39831365",
"score": "0.55219036",
"text": "def download_resource(url, path)\n FileUtils.mkdir_p File.dirname(path)\n the_uri = URI.parse(url)\n if the_uri\n data = html_get the_uri\n File.open(path, 'wb') { |f| f.write(data) } if data\n end\n end",
"title": ""
},
{
"docid": "a6a2eb570f6625bc0184aabc2345d9ee",
"score": "0.5521237",
"text": "def download_and_save_to_disk(filename, subtitle)\n data = RestClient.get subtitle.url\n\n file = File.new(\"/tmp/#{filename}\", 'w')\n file.write(data)\n file.close\n end",
"title": ""
},
{
"docid": "ca3064b92305d9470e8dc250684b9ce1",
"score": "0.5518266",
"text": "def download_and_save_file(url, path)\n open_and_save_file(path, open(url).read)\n end",
"title": ""
},
{
"docid": "0472e6fba8069abce8434a3b9d5a96d9",
"score": "0.551597",
"text": "def get_doc(url)\n Hpricot(HttpResource.new(url).contents)\n end",
"title": ""
},
{
"docid": "b32b3123ef00e45e8177203cf8fc72c2",
"score": "0.54963887",
"text": "def get_file(name,url)\n open(name, 'wb') do |file|\n file << open(url).read\n end\n end",
"title": ""
},
{
"docid": "c78d5a61bd9f9d6815b5c02fb14f3ad6",
"score": "0.54886764",
"text": "def read(document:, url:, type: nil)\n type ||= Pathname(URI(url).path).extname[1..-1].to_sym\n file = work_path.join([document, type].join('.'))\n unless file.exist?\n verbose_info \"Downloading #{document}\"\n IO.copy_stream(Kernel.open(url), file)\n end\n convert file\n end",
"title": ""
},
{
"docid": "87f7f7f5efeaa585a582e9907c6b6196",
"score": "0.5482033",
"text": "def read_url(source)\n log \"source = #{source}\"\n Down::Http.download(source).read\n rescue Down::Error => error\n logerr \"Error loading #{source} = #{error}\"\n end",
"title": ""
},
{
"docid": "db83033c1c508c5d82624fd3ee694a91",
"score": "0.54810435",
"text": "def fetch_file\n # Handle any redirection\n redirect_url = Net::HTTP.get_response(URI url)['location'] || url\n\n download = open redirect_url\n IO.copy_stream download, filename\n end",
"title": ""
},
{
"docid": "b3642509866df86c42097e914fde3b4a",
"score": "0.5480289",
"text": "def dl_file(full_url, to_here, require_type = false)\n require 'open-uri'\n writeOut = open(to_here, \"wb\")\n url = open(full_url)\n if require_type\n raise NameError unless require_type.index( url.content_type.strip.downcase )\n end\n writeOut.write(url.read)\n writeOut.close\nend",
"title": ""
},
{
"docid": "288d1c47b3cdc31180b2ff6f7dd27955",
"score": "0.54792774",
"text": "def download\n File.open(Tempfile.new(\"archive\"), \"wb\") do |saved_file|\n URI.open(url, \"rb\") do |read_file|\n saved_file.write(read_file.read)\n end\n saved_file\n end\n end",
"title": ""
},
{
"docid": "9fbd34eb805b6b818cdf8933a2917eb8",
"score": "0.5471089",
"text": "def obtain_source_from_url( url )\n id = make_guid()\n log_message( \"Downloading #{url} as #{id} ...\" ) unless @logging == false\n resp = @connection.post( \"source\", [{name: id, type: 'url', contentType: 'xml', data: url}] )\n parsed = JSON.parse(resp) \n if parsed.length > 0\n parsed[0]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "62a575ee8e14d17320ccdaa7c41d0b95",
"score": "0.546601",
"text": "def download_image(url, page_name) \n\t\t\tacess_url do\n\t\t\t\tFile.open(\"#{@path_to_download}\\\\#{page_name}\", 'wb') do |f|\n\t\t\t\t\tbegin\n\t\t\t\t\t\t# data = acess_url { open(\"http://#{url}\", \"User-Agent\" => @agent).read }\n\t\t\t\t\t\t# f.write(data)\n\t\t\t\t\t\tf.write(open(\"http://#{url}\", \"User-Agent\" => @agent).read)\n\t\t\t\t\trescue URI::InvalidURIError\n\t\t\t\t\t\tputs \"Não é possível baixar páginas com caracteres não válidos como: \\n#{url}\\n\\n\"\n\t\t\t\t\t\texit(0)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n end",
"title": ""
},
{
"docid": "f079f28309a6d6bc88e1fb2018c3c89b",
"score": "0.54411185",
"text": "def download(url)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "35c4d8cc756eff5f5098f6b4790ab27b",
"score": "0.54335576",
"text": "def show\n @book = Book.find_by_id_and_user_id!(params[:id], current_user.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n format.epub { send_file @book.location.url, filename: @book.filename, dispositioin: 'attachment', type: 'application/epub+zip' }\n end\n end",
"title": ""
},
{
"docid": "ddd66e124fa142c45c12e7c359c1757e",
"score": "0.5430999",
"text": "def url_downloader\r\n puts \"Downloading source of #{$url}...\"\r\n begin\r\n source = URI.open($uri, :allow_redirections => :all).read\r\n rescue OpenURI::HTTPError => error\r\n response = error.io\r\n puts response.status\r\n exit\r\n end\r\n source\r\nend",
"title": ""
},
{
"docid": "18961df57d92221e5025153bb0d4476e",
"score": "0.54264563",
"text": "def cmd\n if options[:print]\n puts page_url\n \"\"\n else\n \"#{open} #{page_url}\"\n end\n end",
"title": ""
},
{
"docid": "c3bb29f9ec496ec91671c18995821909",
"score": "0.5422361",
"text": "def getBooksIntoPage(web)\n doc = Nokogiri::HTML(open(web))\n doc.css('a').each do |link|\n @pageBooks.push(link['href']) if link.content == 'Download'\n end\n end",
"title": ""
},
{
"docid": "6abdeb073b12d2ff5c1b5cccac4125b2",
"score": "0.54046345",
"text": "def load_page_from_url(url)\n begin\n @url = url\n @biblionet_id = url[/\\d+(?!.*\\d+)/] unless url.nil? # id is expected to be the last number.\n\n pp \"Downloading page: #{url}\"\n open(url, :content_length_proc => lambda do |content_length|\n raise EmptyPageError.new(url, content_length) unless content_length.nil? or content_length > 1024\n end) do |f| \n # pp f.status == [\"200\", \"OK\"] ? \"success: #{f.status}\" : f.status \n # pp f.meta\n # pp \"Content-Type: \" + f.content_type\n # pp \"Content-Size: \" + (f.meta)[\"content-length\"]\n # pp \"last modified\" + f.last_modified.to_s + is_empty = (f.last_modified.nil?) ? 'Empty' : 'Not Empty' \n\n @page = f.read.gsub(/\\s+/, \" \")\n end\n rescue Errno::ENOENT => e\n pp \"Page: #{url} NOT FOUND.\"\n pp e\n rescue EmptyPageError => e\n pp \"Page: #{url} is EMPTY.\"\n pp e \n @page = nil\n rescue OpenURI::HTTPError => e\n pp e\n pp e.io.status \n rescue StandardError => e \n pp \"Generic error #{e.class}. Will wait for 2 minutes and then try again.\"\n pp e \n sleep(120)\n retry \n end\n end",
"title": ""
},
{
"docid": "ca12961117be70612c482fd05aaee3f0",
"score": "0.5402066",
"text": "def download_resource(url, path)\n FileUtils.mkdir_p(File.dirname(path))\n the_uri = URI.parse(url)\n if the_uri\n data = html_get(the_uri)\n File.open(path, 'wb') { |f| f.write(data) } if data\n end\n end",
"title": ""
},
{
"docid": "a8268c95b2253508eb8f2d08f89a69bf",
"score": "0.5399594",
"text": "def download\n\t\t if !@paper.document.url.nil?\n\t\t send_to_user(filepath: \"public#{@paper.document.url}\")\n\t\t else\n\t\t \tflash[:info]='Unfortunately the requested file does not exist'\n \t\t\treturn redirect_to :back \n\t\t end\n\t end",
"title": ""
},
{
"docid": "37629a657fcbfea7849657f369f26e8f",
"score": "0.53925294",
"text": "def download (url)\n content = open(url).read\n file = Tempfile.new(\"temp\", :encoding => 'ascii-8bit')\n file << content\n return file\n end",
"title": ""
},
{
"docid": "f2ab04802f2f619eafcdf27950827424",
"score": "0.5392251",
"text": "def download(url, file)\n logger.debug \"download(#{url.inspect}, #{file.inspect})\"\n fetch(url) do |src|\n File.open(file, 'w') do |dst|\n IO.copy_stream src, dst\n end\n end\n end",
"title": ""
},
{
"docid": "74b643940cf896fb29763f725456eec6",
"score": "0.53911084",
"text": "def get_file(name,url)\n open(name, 'wb') do |file|\n file << open(url).read\n end\nend",
"title": ""
},
{
"docid": "9a3e55216538ca22c63722b78570118f",
"score": "0.53869337",
"text": "def download\n proposal = Proposal.find(params[:id])\n return unless proposal.has_attribute?(:support_doc)\n data = open(\"https://s3.amazonaws.com/#{proposal.support_doc}\")\n send_data data.read, filename: \"support-#{proposal.support_doc.split('/').last}\"\n end",
"title": ""
},
{
"docid": "11024054ab5a7d3926272d96eb6d316d",
"score": "0.5382958",
"text": "def download\n URI.open(download_url, \"rb\")\n end",
"title": ""
},
{
"docid": "6643c016231939c97b4d1a96b86374e5",
"score": "0.5382762",
"text": "def page(url)\n open(url) {|response| response.read}\nend",
"title": ""
},
{
"docid": "249cd90b5d74a892ff2f76ec3036ef28",
"score": "0.53801394",
"text": "def getFile(journallabel, vol, iss, url, root_filename)\n\n\turi = URI.parse(url)\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\tif uri.scheme == \"https\" # enable SSL/TLS\n\t http.use_ssl = true\n\t http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\tend\n\thttp.start {\n\t http.request_get(url) {|res|\n\t response = res.body\n\t #Outputs to file\n\t File.open('direct_' + root_filename, 'w'){|f| f.write(response)}\n\t }\n\t}\nend",
"title": ""
},
{
"docid": "4e71c0928be77cacb23e5973b76b6c54",
"score": "0.5380051",
"text": "def to_file\n # thanks http://blog.bloomingame.com/?p=22\n document.retrieve_from_store!(File.basename(document.url))\n document.cache_stored_file!\n document.file\n end",
"title": ""
},
{
"docid": "d5c1b2ead6f933217f2a48ef0fac7589",
"score": "0.5377029",
"text": "def get_pdf\n File.write(path, Net::HTTP.get(URI.parse(uri))) unless File.file?(path)\n end",
"title": ""
},
{
"docid": "ea88aebd048f9b5d414da9f59cbeb7f6",
"score": "0.5374849",
"text": "def download_link\n url = client.get(\"/#{id}/content\", :download => true, :suppress_redirects => true)[\"location\"]\n end",
"title": ""
},
{
"docid": "af9cb3bc2d6ec0852ba6f4e15660d636",
"score": "0.53733027",
"text": "def save_url(path, url)\n resp = request('/files/save_url', path: path, url: url)\n parse_tagged_response(resp)\n end",
"title": ""
},
{
"docid": "611194ba39af48df7b19036ba42c1f64",
"score": "0.5372753",
"text": "def read_page(src_url)\n open(src_url).read\n end",
"title": ""
},
{
"docid": "f8fe7bdceaa242e315f3d931158b5f48",
"score": "0.5355688",
"text": "def download(url:, to:)\n ::File.open(to, \"wb\") do |local_file|\n open(url, \"rb\") do |remote_file|\n local_file.write(remote_file.read)\n end\n end\n end",
"title": ""
},
{
"docid": "eaccc1cb72a5ec9abc53ced5d0471298",
"score": "0.534331",
"text": "def fetch_source_data\n doc = Hpricot(open(@source))\n p doc\n {\n :excerpt => (doc/\"//a[@href='#{@target}']/..\").inner_html,\n :title => (doc/'//title').inner_html,\n :url => @source\n }\n end",
"title": ""
},
{
"docid": "fc4daf0178bf5d3f3e46c316fb669f8a",
"score": "0.5340681",
"text": "def print\n File.open(\"#{DIRECTORY_PATH}/spy.html\", \"w\") do |file|\n file.puts content\n end\n end",
"title": ""
},
{
"docid": "f7be562f4bb0fb85182669ecb2ac154a",
"score": "0.53404826",
"text": "def test_get_epub_in_storage_to_pdf\n file_name = '4pages.epub'\n upload_file(file_name)\n\n src_path = @temp_folder + '/' + file_name\n response = @pdf_api.get_epub_in_storage_to_pdf(src_path)\n assert(response, 'Failed to convert epub to pdf.')\n end",
"title": ""
},
{
"docid": "fc0c04e3ecdd7a080c780a545b1d90da",
"score": "0.53314817",
"text": "def ars_pages(uri)\n require 'open-uri'\t\t# handles url's as files\n require 'hpricot' \t\t# html parsing: http://code.whytheluckystiff.net/hpricot/\n \n page_number = 1\n pages = \"<p>wbstrp'd from: <a href='#{uri}'>#{uri}</a></p>\"\n #puts \"First page: #{uri}\"\n hpr = Hpricot(open(uri))\n pages << hpr.at(\"#news-item-info\").to_html\n #puts pages\n begin\n last_link = (hpr.at(\"#pager\")/\"li\").last # normally \"Next >\"\n link = last_link.at(\"a\") # nil if this is last page\n page = hpr.at(\"div#news-item\") # just the contents of this div\n (page/\"div.Options\").remove # remove stuff about getting pdf\n (page/\"#pager\").remove # the followon links\n pages << \"\\r\\n\\r\\n<!-- page number #{page_number} -->\\r\\n\\r\\n\"\n pages << page.to_html\n hpr = Hpricot(open(link[:href])) unless link.nil?\n page_number += 1 #; puts \"Page number: #{page_number}\"\n end until link.nil?\n \n pages\nend",
"title": ""
},
{
"docid": "8701f9d341f92966cf91377707b823c0",
"score": "0.53285766",
"text": "def create_title_page\n content = ''\n content << \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\"\n content << \" <head>\\n\"\n content << \" <title>#{@@name_book}</title>\\n\"\n content << \" <link type=\\\"text/css\\\" rel=\\\"stylesheet\\\" href=\\\"stylesheet.css\\\" />\\n\"\n content << \" </head>\\n\"\n content << \" <body>\\n\"\n content << \" <h1>#{@@name_book}</h1>\\n\"\n content << \" <div><img src=\\\"images/cover.png\\\" alt=\\\"Title page\\\"/></div>\\n\"\n content << \" </body>\\n\"\n content << \"</html>\\n\"\n f = File.new(\"epub/OEBPS/title.html\",\"w+\")\n f.write content\n f.close\n end",
"title": ""
},
{
"docid": "abe78006d1418c730b0d1ff1e457d5f0",
"score": "0.53228205",
"text": "def get_episode_link(episode)\n if (@options[:file_path])\n # Write to file\n File.open( @options[:file_path], \"a+\" ) do |file|\n file.write(episode.details)\n end\n else\n puts episode.details\n end\n end",
"title": ""
},
{
"docid": "6a03b4f5169a49491a865b4938a8296f",
"score": "0.5322043",
"text": "def download_page(url)\n STDOUT.puts \"Acquiring #{url}\"\n \n network_res = network_call(url, REQUEST_HEADERS, TIMEOUT)\n return parse_content(network_res[:response]) if network_res && network_res[:response]\n end",
"title": ""
},
{
"docid": "228a67425a9ff31e88c2e71d85ba1622",
"score": "0.5318111",
"text": "def export(filename)\n uri = URI(@resource.url)\n Net::HTTP.start(uri.host, uri.port) do |http|\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(uri.user, uri.password)\n http.request(request) do |response|\n File.open(filename, 'w') { |io| response.read_body { |chunk| io.write(chunk) } }\n end\n end\n end",
"title": ""
},
{
"docid": "230d3629c6420f92289efa3098e03980",
"score": "0.5317973",
"text": "def show &block\n PKGUtil.read(@url, &block)\n end",
"title": ""
},
{
"docid": "2a53d818e93d3c63729266f7de314ddd",
"score": "0.53148955",
"text": "def download_with_open_uri(url, options)\n Down.download(url, options)\n end",
"title": ""
},
{
"docid": "2a53d818e93d3c63729266f7de314ddd",
"score": "0.53148955",
"text": "def download_with_open_uri(url, options)\n Down.download(url, options)\n end",
"title": ""
},
{
"docid": "10c51b3ce32a86fd6ee3040cc8d982b2",
"score": "0.53128505",
"text": "def get_page_source(page_url)\n url = URI.parse(page_url)\n req = Net::HTTP::Get.new(url.path)\n Net::HTTP.start(url.host, url.port) do |http|\n http.request(req)\n end\nend",
"title": ""
},
{
"docid": "a26053a74cd79621b00abd830c4193d6",
"score": "0.53061503",
"text": "def save_file(url,id,level=\"0\")\n\tfile = open(url)\n\tcontents = file.read;\n\tFile.open(\"scraped_genomes/level_\" + level + \"/\" + id, \"w\"){ |file|\n\t\tfile.write(contents)\n\t}\n\tfile.close();\nend",
"title": ""
},
{
"docid": "20280b5d29bd43e0bc6a303ef2869013",
"score": "0.5302245",
"text": "def grab_page_contents(url='')\n\n # Test for url, is_file overrides\n unless url.empty?\n @@url = url\n end\n \n begin\n # Create a temporary File Object\n @@scraped_page = ''\n @@scraped_page << %x[curl -CO '#{@@url}']\n #puts \"Got Page Contents: #{scraped_page.inspect}\"\n \n rescue\n if defined? @@url\n puts \"Page Doesn't seem to exist\"\n else\n raise \"You forgot to add a URL to the grab_page_contents block, or set initially\" \n end\n end\n end",
"title": ""
},
{
"docid": "b3d75d032542fc706e7bfcca69449247",
"score": "0.5300708",
"text": "def to_url\n \"#{self.class.to_preview_dir}/#{to_filename}\"\n end",
"title": ""
},
{
"docid": "f436406b673b2c642647b7b2c12b63bb",
"score": "0.52981853",
"text": "def scrape(url)\n require 'open-uri'\n \n return open(url).read\n end",
"title": ""
},
{
"docid": "a27ae8076a6febadb8b00a2a62212d5d",
"score": "0.52976185",
"text": "def raw_file(file_url)\n download file_url.sub('blob','raw')\n end",
"title": ""
},
{
"docid": "e2c9d3d2672256eb763b312c0b1ebc77",
"score": "0.5287299",
"text": "def save(filename)\n create_epub.save(filename)\n end",
"title": ""
},
{
"docid": "7daaf5233ef60b2da8056f9215d38eb2",
"score": "0.52870756",
"text": "def download url\n uri = URI.parse(url)\n self.debug \"#download Downloading HTTP URI: #{uri}\"\n http = Net::HTTP.new(uri.host, uri.port)\n if uri.scheme == 'https'\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n res = http.start { |http| http.get(uri.path) }\n self.debug \"#download HTTP return code is #{res.code}\"\n raise \"Error retrieving page: #{res.class} #{res.code}\" unless res.code == \"200\"\n res.body\n end",
"title": ""
},
{
"docid": "ccdfeaad33fe05982855c278236368db",
"score": "0.5284475",
"text": "def parse_epub\n list_file_names = Array.new\n list_files = {}\n xhtml_files = [] \n dir_name = FileUtils.mkdir_p(book_unique_id)\n dest_path = \"#{Rails.root}/public/books/#{dir_name.first}\"\n Zip::ZipFile.open(epub.path) { |zip_file|\n zip_file.each { |f|\n next if f.name =~ /__MACOSX/ or f.name =~ /\\.DS_Store/ #or !f.file?\n list_file_names.push(f.name)\n f_path = File.join(dest_path, f.name)\n list_files.store(f.name,f_path)\n FileUtils.mkdir_p(File.dirname(f_path))\n zip_file.extract(f, f_path) unless File.exist?(f_path)\n }\n }\n server_ip = \"\"\n case local_ip.split(\".\").first\n when '192'\n server_ip = \"#{local_ip}:3000\"\n when '10'\n if Rails.env.eql?('staging')\n server_ip = \"54.225.184.100:3000\"\n elsif Rails.env.eql?('production')\n server_ip = \"54.225.184.100\"\n end \n end\n xhtml_files = get_xhtml_files list_files \n css_tags, js_tags = get_css_js_tags list_files, server_ip\n path_with_ip = dest_path.gsub(\"#{Rails.root}/public\",\"http://#{server_ip}\" )\n index_file_string = generate_index_file_string xhtml_files, list_files, index_file_string, css_tags.join(\" \"), js_tags.join(\" \"), path_with_ip\n cp_file_list = [dest_path+\"/OEBPS/covers/\", dest_path+\"/OEBPS/css/\", dest_path+\"/OEBPS/fonts/\", dest_path+\"/OEBPS/images/\", dest_path+\"/OEBPS/js/\", dest_path+\"/OEBPS/package.opf\",dest_path+\"/OEBPS/toc.ncx\" ]\n FileUtils.cp_r cp_file_list, dest_path rescue\n FileUtils.rm_rf [dest_path+\"/OEBPS\", dest_path+\"/META-INF\"]\n FileUtils.remove_file dest_path+\"/mimetype\"\n FileUtils.rm_rf \"#{Rails.root}/#{dir_name.first}\"\n File.open(dest_path+\"/index.html\" , \"w\") {|fi| fi.puts index_file_string}\n end",
"title": ""
},
{
"docid": "29fd1caab9d9047b6c03a3ad85bb6965",
"score": "0.52840495",
"text": "def buy_local\n system(\"open\", self.local_link) # Book.url should be a String; this method actually opens a web page!!!\n end",
"title": ""
},
{
"docid": "e3f0d4556c675a635fdd35cb4552187e",
"score": "0.5275941",
"text": "def initialize(url = \"pages/top100.html\")\n @url = url\n @doc = open_from_url(url)\n self\n end",
"title": ""
},
{
"docid": "ba6a07c464cdf6dea3f77cd87b65f8f3",
"score": "0.5270417",
"text": "def download_dangdang_book(book_url)\n unless book_url_valid?(book_url)\n $log.error \"book url invalid -- #{book_url}\"\n return false\n end\n\n doc = open(book_url) do |f|\n Hpricot(f)\n end\n \n unless doc.at(\"/html/body/div/div[@class='sort_cont']/div[@class='catalog_r']/div[@class='catalog']/h2\")\n $log.error \"book url invalid -- #{book_url}\"\n return false\n end\n\n book_ele = doc.at(\"/html/body/div/div[@class='sort_cont']/div[@class='book_frame']\")\n title = book_ele.at(\"h2\").inner_text\n category = book_ele.at(\"div[@class='book_prod']/div[@class='prod_cont']/h5\").inner_text\n preface = book_ele.at(\"div[@class='book_prod']/div[@class='prod_cont']/div[@class='prod_detail']/p\").inner_text\n author = book_ele.at(\"div[@class='book_prod']/div[@class='prod_cont']/div[@class='buy_detail']/div[@class='deta_1']/p\").inner_text\n\n chapter_name_list = []\n chapter_section_list = []\n\n $log.info \"find book #{title} successful\"\n \n $log.info \"title -> #{title}\"\n $log.info \"preface -> #{preface}\"\n $log.info \"category -> #{category}\"\n $log.info \"author -> #{author}\"\n\n doc.search(\"/html/body/div/div[@class='sort_cont']/div[@class='catalog_r']/div[@class='catalog']/h2\").each do |i|\n chapter_name_list << i.inner_text[1..-1]\n ul = i.next_sibling.next_sibling\n section_url_list = []\n ul.search(\"li/a\").each {|a| section_url_list << section_url(book_url, a['href']) }\n chapter_section_list << section_url_list\n end\n\n $log.debug \"chapter_name_list -> #{chapter_name_list.join(\", \")}\"\n $log.debug \"chapter_section_list -> #{chapter_section_list.inspect}\"\n\n File.open(\"#{title}.txt\", \"w\") do |f|\n f.puts title\n f.puts\n f.puts category\n f.puts author\n f.puts\n f.puts preface\n f.puts \n chapter_name_list.each_with_index do |chapter_name, index|\n f.puts \" #{chapter_name}\\n\\n\"\n chapter_section_list[index].each do |section_url|\n section_title, section_content = get_section_content(section_url)\n f.puts section_title\n f.puts section_content\n $log.info \"section -- #{section_title} download complete\"\n end\n end\n end\n $log.info \"book -- #{title} download complete :-)\"\n return true\nend",
"title": ""
},
{
"docid": "1d7fe092a2d17389abace929e35743fb",
"score": "0.52702785",
"text": "def show\n Ebook.load_and_store_new_epub(@ebook)\n end",
"title": ""
},
{
"docid": "788351e873b77cc4e74acf684417e01d",
"score": "0.5256605",
"text": "def download(url)\n @client.execute!(uri: url).body\n end",
"title": ""
},
{
"docid": "1ebd9b24a28599d0c1048557890b7cbe",
"score": "0.5253794",
"text": "def slide_download_url\n p_id = get_presentation_id(@slide.gurl)\n s_id = get_slide_id(@slide.gurl)\n 'https://docs.google.com/presentation/d/' + p_id + '/export/png?id=' + p_id + '&pageid=' + s_id\n end",
"title": ""
},
{
"docid": "bea1f82143c8f00d76ab0196054866a2",
"score": "0.52525413",
"text": "def download_from_url(url)\n\tputs \"Accessing : \" + url\n\tputs \"---------------------------------------\"\n\tpage = Nokogiri::HTML open(url)\n\tpage.css('div.searchresult').each do |div|\n\t\tname = div.attr 'id'\n\t\tlink_skp = @main_url + div.css('a')[3].attr('href') if not div.css('a')[3].nil?\n\t\tlink_img = @main_url + div.css('img').attr('src').value\n\t\ttitle_model = div.css('#bylinetitle a').attr('title').value\n\t\ttag_model = div.css('td > span.smaller').children\n\t\ttag_model = tag_model.map{|child| (child.text.include?(\"Download\") ? \"\" : child.text)}.inject(&:+)\n\t\ttag_model.gsub!(\"\\n\", \"\")\n\n\t\t# puts \"name : #{name}\"\n\t\t# puts \"link_skp : #{link_skp}\"\n\t\t# puts \"title_model : #{title_model}\"\n\t\t# puts \"tag_model : #{tag_model}\"\n\t\t\n\t\tcmd = \"wget -nc -q -O #{name}.skp '#{link_skp}';\"\n\t\tcmd += \"wget -nc -q -O #{name}.jpg '#{link_img}';\"\n\t\tcmd += \"echo \\\"title : #{title_model}\\ntag : #{tag_model}\\\" > #{name}.txt;\"\n\t\t\n\t\tputs \"Get file #{name} -> \" + system(cmd).to_s\n\t\t@names << name\n\t\tsleep @wait_max * rand\n\tend\nend",
"title": ""
},
{
"docid": "4615847381f69846c09b9eba860c503c",
"score": "0.5243402",
"text": "def file_save(host, new_source)\r\n out_file = File.new(\"#{host}.html\", \"w\")\r\n out_file.puts(new_source)\r\n out_file.close\r\nend",
"title": ""
},
{
"docid": "98089bda16fe41f6dd74f349a2c7cf3e",
"score": "0.52373415",
"text": "def get(url)\n open(url)\n end",
"title": ""
},
{
"docid": "336aaf9ff299fb7e1be69bd0db223276",
"score": "0.52354383",
"text": "def fetch(url, filename = nil)\n if filename && File.exists?(filename)\n return fetch_file(filename)\n else\n data = fetch_url(url)\n \n if filename\n File.open(filename, 'w') do |output|\n output.print(data)\n end\n end\n \n return data\n end\n end",
"title": ""
},
{
"docid": "daf4a741846a0f7cfd496cd346125cf2",
"score": "0.5233204",
"text": "def generate_epub\n\n Dir.chdir(self.manifest['epub-dir'])\n PandocRuby.new( self.generate_content ,\n {:f => :markdown, :to => :epub},\n 'smart', 'o' => self.manifest['epub-filename'],\n 'epub-cover-image' => self.manifest['epub-cover-image'],\n 'epub-metadata' => self.manifest['epub-metadata'], \n 'epub-stylesheet' => self.manifest['epub-stylesheet'],).convert\n\n end",
"title": ""
}
] |
d2290ef60fcf44a321bf1f0a4946e7a3
|
DELETE /slicegroups/1 DELETE /slicegroups/1.xml
|
[
{
"docid": "d25238242ebfb7bd1aa46407bef74d9c",
"score": "0.7575276",
"text": "def destroy\n @slicegroup = Slicegroup.find(params[:id])\n @slicegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(slicegroups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
[
{
"docid": "38959a4c19bcea0276afe9263d93ca2e",
"score": "0.676524",
"text": "def destroy\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2cd6dbd3d8dfc6a97f28e5aa64b7226f",
"score": "0.66540194",
"text": "def test_set3_04b_delete_group()\n group = \"test_group\"\n user = \"test_user\"\n \n @test_acl.create_principal(user)\n @test_acl.create_group(group, [\"ALL\"], [user])\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n #puts query\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(1, hits)\n \n @test_acl.delete_principal(group)\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end",
"title": ""
},
{
"docid": "d0de4af2759eccaf2993ba8bd9b4bf6e",
"score": "0.6594992",
"text": "def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend",
"title": ""
},
{
"docid": "a57eef2cc850f4c20e04b0bb8a47daf3",
"score": "0.6559748",
"text": "def delete_group(group)\n\t\t\tend",
"title": ""
},
{
"docid": "a57eef2cc850f4c20e04b0bb8a47daf3",
"score": "0.6559748",
"text": "def delete_group(group)\n\t\t\tend",
"title": ""
},
{
"docid": "852a1a6fe590107c1e1dac46cd0b3225",
"score": "0.64985305",
"text": "def destroy\n @slice = Xen::Slice.find(params[:id])\n @slice.shutdown\n\n respond_to do |format|\n format.html { redirect_to(slices_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7c4c1952ce8410be232e0628468bc9cf",
"score": "0.64956945",
"text": "def destroy\n @attribute_group = AttributeGroup.find(params[:id])\n @attribute_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(attribute_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "129f8118335894440462952ab67c9e1e",
"score": "0.64743125",
"text": "def destroy\n @group.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "a750bc07fec48f71041fd47e304de4bd",
"score": "0.64701796",
"text": "def destroy\n @lab_group = LabGroup.find(params[:id])\n @lab_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(lab_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7f2878d46580be4d139edcf6797dbfc9",
"score": "0.6465646",
"text": "def deleteGroup _args\n \"deleteGroup _args;\" \n end",
"title": ""
},
{
"docid": "0fce2f71ae26d6740d53274e487a5e40",
"score": "0.6458093",
"text": "def destroy\n # The before_filter find_slice is run beforehand\n @slice.destroy\n\n respond_to do |format|\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93725804c06dfd9a4ca213d380c9717f",
"score": "0.645649",
"text": "def destroy\n @grouping.destroy\n\n respond_to do |format|\n format.html { redirect_to(groupings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f0580ad3c1043ade6c7189b242321de5",
"score": "0.6448726",
"text": "def destroy\n @group = Group.find(params[:id])\n authorize @group, :destroy?\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(browse_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dd0043a2a5a20500f4be6c2543a51ffd",
"score": "0.641649",
"text": "def destroy\n @ail_group = AilGroup.find(params[:id])\n @ail_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(ail_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4303f7302111cbf15bd8dbd7243dd0e8",
"score": "0.6385019",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n \n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "67a5a21b8798debcd46678ab05f65119",
"score": "0.6375406",
"text": "def destroy\n Group.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5ad8effb793240282f698c286765761f",
"score": "0.6358257",
"text": "def destroy\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.find(params[:id])\n @subgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_subgroups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a5818e0824eabf32a74432345a75e765",
"score": "0.63529253",
"text": "def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a5818e0824eabf32a74432345a75e765",
"score": "0.63529253",
"text": "def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d85a5e20b150557e9990ed4004446cac",
"score": "0.6343201",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ae4c5b1dafac6eff4d412dab861660e4",
"score": "0.6329446",
"text": "def deleteGroup( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return doCurl(\"delete\",\"/group\",params)\n end",
"title": ""
},
{
"docid": "3ed7273153ec007b9a490b7c5fcfef7a",
"score": "0.6326155",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f80b386ae0d6d477527b884d7f42b5c8",
"score": "0.63189316",
"text": "def group_delete(attribs, dir_info)\n attribs = group_record_name_alternatives(attribs)\n\n check_critical_attribute( attribs, :record_name )\n\n command = {action: 'delete', scope: 'Groups', attribute: nil, value: nil}\n user_attrs = attribs.merge(command)\n\n dscl( user_attrs, dir_info )\n end",
"title": ""
},
{
"docid": "3b31416ca84e1115454811a88a220ed2",
"score": "0.6315106",
"text": "def deleteEntityGroup( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/group\",params)\n end",
"title": ""
},
{
"docid": "dbd594bd799176160519eeebed3acd02",
"score": "0.6309331",
"text": "def delete_group(uuid)\n Uploadcare::Group.delete(uuid)\n end",
"title": ""
},
{
"docid": "542e6fd380aec4807c920f1178dcb3a8",
"score": "0.6301909",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "612cf765654beaf2f045498ed9833be5",
"score": "0.62770844",
"text": "def destroy\n @add_to_group = AddToGroup.find(params[:id])\n @add_to_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(add_to_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "327e0bc0cc239925a99b3089aecb399b",
"score": "0.6252983",
"text": "def del(id, which=:groups)\n resp = self.class.delete(\"/#{which}/#{id}\")\n check_errors resp\n end",
"title": ""
},
{
"docid": "90febae64fbfbf890f88e3ff74206057",
"score": "0.62465256",
"text": "def destroy\n @group = WorkGroup.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "21552b7948489274c349d4fc3e45b567",
"score": "0.62268186",
"text": "def test_delete\n g = [22058]\n Group.delete(g)\n end",
"title": ""
},
{
"docid": "aeda3f6ee58f6696cd62fb2dda88a0f3",
"score": "0.6217355",
"text": "def destroy\n @group = Group.find_by_param(params[:id])\n @group.tuners.clear\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c7ff52902629596401c02be7e51c92fe",
"score": "0.6215295",
"text": "def destroy\n @record_group = RecordGroup.find(params[:id])\n @record_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(record_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2537867215c4d23b8d400621afb242b1",
"score": "0.620707",
"text": "def destroy\n @group_of_task = GroupOfTask.find(params[:id])\n @group_of_task.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_of_tasks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ee12b65740924c55e4955bcbefe948df",
"score": "0.6193171",
"text": "def destroy\n @group.destroy unless @group.default\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dfc2caa6fe708cc20f748c19cfbfaa05",
"score": "0.6173432",
"text": "def destroy\n @group = Group.find(params[:id])\n\n mbs = Membership.where \"group_id = ?\", @group.id\n\n mbs.each do |m|\n m.destroy\n end\n\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7636ce520bfc924219a0281276ac6103",
"score": "0.6163762",
"text": "def destroy\n # @group = @hub.groups.get(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to hub_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0176aed999416ece9fd9fb364126d9ab",
"score": "0.6158249",
"text": "def destroy\n @group = Group.find(params[:id])\n\t\t@pages = Page.where(:category => 'group', :owner => @group.id)\n\t\t@pages.each do |p|\n\t\t\tp.destroy\n\t\tend\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "62a742edda9cde608c8ec19f59c1ce68",
"score": "0.614641",
"text": "def destroy\n @polco_group = PolcoGroup.find(params[:id])\n @polco_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(polco_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "71d20e81b0a6cf02d6eb689aa0a18c95",
"score": "0.61437154",
"text": "def delete_related_groups\n \n end",
"title": ""
},
{
"docid": "c15d6e5a56cd0d3afcc92d0f38b240fd",
"score": "0.6142562",
"text": "def destroy\n @size_group = SizeGroup.find(params[:id])\n @size_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_size_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "395343014616db13aa85338dbf7489fa",
"score": "0.61351854",
"text": "def destroy\n @collection_group.destroy\n respond_to do |format|\n format.html { redirect_to collection_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1e066cfc1163cdad887164c1c715bec",
"score": "0.61301976",
"text": "def destroy\n @routinetoobjectgroup = Routinetoobjectgroup.find(params[:id])\n @routinetoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(routinetoobjectgroups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aff26a9d115168abd5fe8a4896bec082",
"score": "0.6108434",
"text": "def destroy\n @esol_group = EsolGroup.find(params[:id])\n @esol_group.destroy\n\n respond_to do |format|\n format.html { redirect_to esol_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ed7957072ec78a1d02b5caa6501dd96",
"score": "0.61068344",
"text": "def destroy\n @expensegroup = Expensegroup.find(params[:id])\n @expensegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(expensegroups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f8fa340819464e658428a0a3a69e27ea",
"score": "0.61046606",
"text": "def destroy\n @jido_grp_rel = JidoGrpRel.find(params[:id])\n @jido_grp_rel.destroy\n\n respond_to do |format|\n format.html { redirect_to(jido_grp_rels_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "35eda167f0ec66a5e25f5d9d0659dc85",
"score": "0.60994",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.any(:html,:iphone) { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f881e20a11dd6d4f9d79ab3401472e06",
"score": "0.6098288",
"text": "def destroy\n @server_group = ServerGroup.find(params[:id])\n xml=@server_group.to_xml\n json=@server_group.to_json\n @server_group.update_attribute('historical', true)\n\tAsyncExec.run_job(MakeGroupHistorical, @server_group.id)\n\n respond_to do |format|\n format.html { redirect_to(server_groups_url) }\n format.json { render :json => json }\n format.xml { render :xml => xml }\n end\n\n end",
"title": ""
},
{
"docid": "68f81c5b30fabe05e82b32fb7f56dc33",
"score": "0.60968333",
"text": "def destroy\n #@s_group.destroy\n @s_group = SGroup.find(params[:id].to_i)\n @s_group.delete_flg = 1\n @s_group.save!\n\n respond_to do |format|\n format.html { redirect_to s_groups_url, notice: 'S group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ce0e1d4ff866a36cca756a6fec4d7de5",
"score": "0.6093595",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a6caaa5b5ccbcc871de74580deb3790b",
"score": "0.6092931",
"text": "def destroy\n @group = SuperSimpleCms::Group.find(params[:id])\n respond_to do |format| \n if SuperSimpleCms::Group.find(:all).length > 1\n @group.destroy \n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :ok }\n format.xml { head :ok }\n else\n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :failure }\n format.xml { head :failure }\n end\n end\n end",
"title": ""
},
{
"docid": "f55ad5aed8aa9da066c83ef95786f97b",
"score": "0.6090561",
"text": "def destroy\n @eqvgroup.destroy\n respond_to do |format|\n format.html { redirect_to eqvgroups_url, notice: 'Эквивалентная группа удалена.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a0a00d5245c1a8467bb2054c0f1775e3",
"score": "0.60864824",
"text": "def delete_segment_batch(segment_id_array)\n payload = segment_id_array.to_s\n url = \"#{@base_url}/segments_batch\"\n return RestClient::Request.execute(:method => :delete, :url => url, :payload => payload){|response, request, result| response }\n end",
"title": ""
},
{
"docid": "13397d5392d32e2b4620e09d2069ac6d",
"score": "0.6080414",
"text": "def deleteSlice(sliceInfo)\r\n\t\tnum = 0\r\n\t\tslice_id = 0\r\n\t\tsliceInfo.each_pair { | name, value |\r\n\t\t\tif(name == \"slice_id\")\r\n\t\t\t\tslice_id = value\r\n\t\t\telse\r\n\t\t\t\tputs \"wrong parameter: #{name}\"\r\n\t\t\t\treturn \"wrong parameter: #{name}\"\r\n\t\t\tend\t\t\t\t\r\n\t\t}\r\n\r\n\t\tputs \"Connecting to database...\"\r\n\t\tbegin\r\n\t\t\t# connect to the MySQL server\r\n\t\t\tdbh = DBI.connect(\"DBI:Mysql:#{$db}:#{$db_ip}\",\"#{$user}\", \"#{$pass}\")\r\n\t\t\r\n\t\t\tnum = dbh.do(\"DELETE FROM slices WHERE id = '#{slice_id}'\")\r\n\t\t\tif (num == 1)\r\n\t\t\t\tputs \"Slice deleted...\"\r\n\t\t\t\treturn 0\r\n\t\t\tend\r\n\t\t\t\r\n\t\trescue DBI::DatabaseError => e\r\n\t\t\tputs \"An error occurred\"\r\n\t\t\tputs \"Error code: #{e.err}\"\r\n\t\t\tputs \"Error message: #{e.errstr}\"\r\n\t\tensure\r\n\t\t\t# disconnect from server\r\n\t\t\tdbh.disconnect if dbh\r\n\t\tend\r\n\t\t\t\r\n\t\treturn -1\r\n\tend",
"title": ""
},
{
"docid": "1cc5e2d357680c30e18ed2e6ec110560",
"score": "0.60560656",
"text": "def destroy #:nodoc:\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n # format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "13999975208337b247358e50faf8ea7f",
"score": "0.6044782",
"text": "def destroy\n @request_group.destroy\n respond_to do |format|\n format.html { redirect_to request_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3bc0caea08c19a0b6563cac2f6f5fe51",
"score": "0.6038349",
"text": "def destroy\n @group_request.destroy\n respond_to do |format|\n format.html { redirect_to group_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a5e8a4421953376febab0141008a7c88",
"score": "0.60365236",
"text": "def DeleteGroup id\n \n APICall(path: \"groups/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "ae3a368a746657cbe16df3ec9d5a3f86",
"score": "0.60356927",
"text": "def destroy\r\n @subgroup.destroy\r\n respond_to do |format|\r\n format.html { redirect_to groups_path, notice: 'Apakšgrupa veiksmīgi dzēsta' }\r\n end\r\n end",
"title": ""
},
{
"docid": "f2920f9da52025fdba3fef6dcc3bb4da",
"score": "0.6033097",
"text": "def delete_group(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteGroup'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :group_name\n\t\t\targs[:query]['GroupName'] = optional[:group_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "370bfdbf3c9885a2b5e485383742a454",
"score": "0.60248214",
"text": "def delete(group)\n url = build_url(group)\n response = rest_delete(url)\n response.return!\n end",
"title": ""
},
{
"docid": "2ee05139cb992485e60527fc1bcb787a",
"score": "0.60247284",
"text": "def destroy\n\n\t\t@group = Group.find(params[:id])\n\t\t@group.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(groups_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e1d6f603cb5ea1e475ea71422432aeae",
"score": "0.60211813",
"text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"title": ""
},
{
"docid": "69db2b481772a402fdaa49fdcd29e952",
"score": "0.6014579",
"text": "def delete_group \n Group.destroy(params[:id])\n\n respond_to do |format|\n format.html {redirect_to dashboard_path}\n end\n end",
"title": ""
},
{
"docid": "fd176fa6bbd1def1b5190c3ec8c4ee08",
"score": "0.60041136",
"text": "def destroy\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n @objectgrouptoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(objectgrouptoobjectgroups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "38aa6a2355617cd2025f05c02468bd85",
"score": "0.60002375",
"text": "def destroy\n @image_gallery_group = ImageGalleryGroup.find(params[:id])\n @image_gallery_group.destroy\n\n respond_to do |format|\n format.html { redirect_to( admin_image_gallery_groups_url ) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "14fb497d2629afbef2e1a6059b019ae3",
"score": "0.5999734",
"text": "def destroy\n @radio_group = RadioGroup.find(params[:id])\n @radio_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(radio_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e45800afa903e201ff140eb984870e92",
"score": "0.59967864",
"text": "def destroy\n @grupo = Grupo.find(params[:id])\n @grupo.destroy\n\n respond_to do |format|\n format.html { redirect_to(grupos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1f1b6c78067e2854ddd637b3e1ad673a",
"score": "0.599535",
"text": "def destroy\n @prefix_group.destroy\n\n respond_to do |format|\n format.html { redirect_to prefix_groups_url }\n format.json { head :no_content }\n format.js { render :text => \"$('##{dom_id(@prefix_group)}').remove();\" }\n end\n end",
"title": ""
},
{
"docid": "2242664c4e0ba129ecfa960fe59fb94f",
"score": "0.59815043",
"text": "def destroy\n @laboratory_test_group = LaboratoryTestGroup.find(params[:id])\n @laboratory_test_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(laboratory_test_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a043aa8bfd1b6f976997bf10ba903522",
"score": "0.5981311",
"text": "def destroy\n @meta_data_group = MetaDataGroup.find(params[:id])\n @meta_data_group.destroy\n\n respond_to do |format|\n format.html { redirect_to meta_data_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7643fb034202682d3f8fa7bfc670fd95",
"score": "0.59802616",
"text": "def destroy\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n format.js { render :nothing => true }\n end\n end",
"title": ""
},
{
"docid": "c1592c9a7c989d01a99d8c2f4e789eab",
"score": "0.5979607",
"text": "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"title": ""
},
{
"docid": "b87dba8323d6415d0ad7dae0644c47c4",
"score": "0.59751344",
"text": "def destroy\n @instruments_group.destroy\n respond_to do |format|\n format.html { redirect_to instruments_groups_url, notice: 'La catégorie d\\'instruments a été supprimée.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3d449cc0307e8a1d61570f53330257e9",
"score": "0.5972555",
"text": "def destroy\n\n @group_definition = GroupDefinition.find(params[:id])\n @group_definition.destroy\n\n respond_to do |format|\n format.html do\n if request.env['HTTP_REFERER']\n redirect_to(:back)\n else\n redirect_to(group_definitions_url)\n end\n end\n format.xml do\n head :ok\n end\n end\n end",
"title": ""
},
{
"docid": "bdf1247a580e3b75ab3a7ac1ee27ae56",
"score": "0.59725267",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n redirect_to groups_path\n end",
"title": ""
},
{
"docid": "bdf1247a580e3b75ab3a7ac1ee27ae56",
"score": "0.59725267",
"text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n redirect_to groups_path\n end",
"title": ""
},
{
"docid": "c7e7c8309f8d5a9615c338ee56efc054",
"score": "0.5970974",
"text": "def destroy\n @transaction_group = TransactionGroup.find(params[:id])\n @transaction_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8ee346cb8cd91fd421333276c7fe8d05",
"score": "0.597015",
"text": "def destroy\n @group = Group.find_by_slug_or_id(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6a6fc93b3a1139ba034f440b99bbbad4",
"score": "0.59701455",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url, notice: 'Asset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4ee69b80cd839495b573c79022446bcf",
"score": "0.59676653",
"text": "def destroy\n @auth_ip_address_group.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "c0d297f10de4bb97976870174ce8233f",
"score": "0.5966813",
"text": "def destroy\n @patients_groups = PatientsGroup.find(params[:id])\n @group = @patients_groups.group_id\n @patients_groups.destroy\n\n respond_to do |format|\n format.html { redirect_back_or_default request.referer, notice: \"Association was removed\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ceb1b7c313e6e02a2c9ab73f8a6515b0",
"score": "0.5964786",
"text": "def destroy\n redirect_to :action => :index and return unless is_owner?\n for member in @group.members\n member.destroy\n end\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "54f40104d9d11f6e4b1292d84f2f4ba7",
"score": "0.5964704",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to discipleship_path(@discipleship) , notice: 'Grupo eliminado exitosamente' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "84aebbfee4b133f3de2911559cf951aa",
"score": "0.5964343",
"text": "def destroy\n @personnel_group = PersonnelGroup.find(params[:id])\n @personnel_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(personnel_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1523d093eed147e7ee53d375984af5cb",
"score": "0.59635305",
"text": "def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "9a78f529127c94255e53c7e11352e867",
"score": "0.59614295",
"text": "def destroy\n @group_doc.destroy\n respond_to do |format|\n format.html { redirect_to group_docs_url, notice: 'Group doc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.59613705",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.59613705",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.59613705",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.59613705",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a48f079ebbbe1d3e731cbb103a417d89",
"score": "0.59613705",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc97ecbf71fa7956d09c54d8b5378a59",
"score": "0.59606093",
"text": "def destroy\n @targetgroup = Targetgroup.find(params[:id])\n @targetgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(targetgroups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3cef85ba8deaccbabc31c3d908cf3d41",
"score": "0.5960278",
"text": "def destroy\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
65453bc06f1bdfa3ac18c3f87e2d474f
|
module Redcarpet module Render class Randy < Base def header() end end end
|
[
{
"docid": "68199de6cc1a66363e67c6c93c370b05",
"score": "0.0",
"text": "def md_toc(text)\n renderer = Redcarpet::Render::HTML_TOC.new\n markdown = Redcarpet::Markdown.new(renderer,\n space_after_headers: true,\n )\n markdown.render(text)\nend",
"title": ""
}
] |
[
{
"docid": "a0b769d20135041a4151e867cec1ce76",
"score": "0.65823895",
"text": "def header; end",
"title": ""
},
{
"docid": "a0b769d20135041a4151e867cec1ce76",
"score": "0.65823895",
"text": "def header; end",
"title": ""
},
{
"docid": "a0b769d20135041a4151e867cec1ce76",
"score": "0.65823895",
"text": "def header; end",
"title": ""
},
{
"docid": "7d7d2c64dc121746476433cc387e3eed",
"score": "0.650503",
"text": "def header\n end",
"title": ""
},
{
"docid": "d21298873fbbdf8b8f117d8ed8d0e6d7",
"score": "0.6475128",
"text": "def get_header() \n erb :header\n end",
"title": ""
},
{
"docid": "aea5822c715af3f913e362a5bf87e0b1",
"score": "0.641129",
"text": "def render_header\n return content_tag(\"div\",(content_tag(\"h1\",@header)))\n end",
"title": ""
},
{
"docid": "485d3d7db13a5b01d7514fe73973eb34",
"score": "0.6409279",
"text": "def header\n \"*#{super}*\"\n end",
"title": ""
},
{
"docid": "9b7d6cf60d953d0a2ba2ced2e9c03848",
"score": "0.6398749",
"text": "def render\n renderer.render_header self\n end",
"title": ""
},
{
"docid": "ef07a20e610cf960aabdba0707971dd6",
"score": "0.62594914",
"text": "def header_and_footer\n @title = _'Labvirt'\n @footer = _'Something nice should go down here...'\n end",
"title": ""
},
{
"docid": "65cc6071055ce7c04f623e0de7339c98",
"score": "0.6241162",
"text": "def head\n HEADER\n end",
"title": ""
},
{
"docid": "23f6dc0e566998da7504e7b2531747bb",
"score": "0.6129371",
"text": "def logo; end",
"title": ""
},
{
"docid": "23f6dc0e566998da7504e7b2531747bb",
"score": "0.6129371",
"text": "def logo; end",
"title": ""
},
{
"docid": "922da2a4295286fffb3d08225c3a3077",
"score": "0.61140984",
"text": "def renderer; end",
"title": ""
},
{
"docid": "c615c9c44ec675af95a47917c42ffda2",
"score": "0.61133295",
"text": "def headline; end",
"title": ""
},
{
"docid": "b120fa43c51176b890fc133e8425d5c3",
"score": "0.6074704",
"text": "def render r\n end",
"title": ""
},
{
"docid": "7bd38862db2fb12ff4cc5402129df532",
"score": "0.60727555",
"text": "def header_render\n fail ProcessorNotImplementedError,\n \"Please implement #{self.class}#header_render\"\n end",
"title": ""
},
{
"docid": "6dbcbe382a0524d15661d68032608d1c",
"score": "0.6069774",
"text": "def liquid_renderer; end",
"title": ""
},
{
"docid": "43a29205958485263c447ae569eea52c",
"score": "0.6061855",
"text": "def render_header\n class_names = ''\n class_names += 'has-url' if @browser_url\n \"<figure class=\\\"browser-mockup #{class_names}\\\">\"\n end",
"title": ""
},
{
"docid": "0445912ce2993a08dc5ab013bdd37626",
"score": "0.60386693",
"text": "def mdrender\n \t@markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)\n end",
"title": ""
},
{
"docid": "6f3f382ce37c6447fa7442ad4270ccc4",
"score": "0.60381633",
"text": "def generate_header(title, path = nil)\n version = Version::VERSION\n\n vars = {\n 'title' => escape_html(title),\n 'favicon' => escape_html(asset_url('favicon.ico')),\n 'style' => escape_html(asset_url('sabredav.css')),\n 'iconstyle' => escape_html(asset_url('openiconic/open-iconic.css')),\n 'logo' => escape_html(asset_url('sabredav.png')),\n 'baseUrl' => @server.base_uri\n }\n\n html = <<HTML\n<!DOCTYPE html>\n<html>\n<head>\n <title>#{vars['title']} - tilia/dav #{version}</title>\n <link rel=\"shortcut icon\" href=\"#{vars['favicon']}\" type=\"image/vnd.microsoft.icon\" />\n <link rel=\"stylesheet\" href=\"#{vars['style']}\" type=\"text/css\" />\n <link rel=\"stylesheet\" href=\"#{vars['iconstyle']}\" type=\"text/css\" />\n</head>\n<body>\n <header>\n <div class=\"logo\">\n <a href=\"#{vars['baseUrl']}\"><img src=\"#{vars['logo']}\" alt=\"tilia/dav\" /> #{vars['title']}</a>\n </div>\n </header>\n <nav>\nHTML\n\n # If the path is empty, there's no parent.\n if !path.blank?\n parent_uri = Http::UrlUtil.split_path(path).first\n full_path = @server.base_uri + Http::UrlUtil.encode_path(parent_uri)\n html << \"<a href=\\\"#{full_path}\\\" class=\\\"btn\\\">⇤ Go to parent</a>\"\n else\n html << '<span class=\"btn disabled\">⇤ Go to parent</span>'\n end\n\n html << ' <a href=\"?sabreAction=plugins\" class=\"btn\"><span class=\"oi\" data-glyph=\"puzzle-piece\"></span> Plugins</a>'\n html << '</nav>'\n\n html\n end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.60011494",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.60011494",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.60011494",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.60011494",
"text": "def render; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"score": "0.60011494",
"text": "def render; end",
"title": ""
},
{
"docid": "410477ce30dec370eb3c0f2b2ddf9638",
"score": "0.59413993",
"text": "def copyright_generator\n # Module::Class.method arguments\n BarneysViewTool::Renderer.copyright 'Barney Stinson', 'Challenge Accepted!'\n end",
"title": ""
},
{
"docid": "1c9c004ed74a5577306b75e4e4e1dde2",
"score": "0.59358877",
"text": "def setup\n @html = <<-TEXTILE\n<h1>Give RedCloth a try!</h1>\n<p>A <strong>simple</strong> paragraph with<br />\na line break, some <em>emphasis</em> and a <a href=\"http://redcloth.org\">link</a></p>\n<ul>\n\t<li>an item</li>\n\t<li>and another</li>\n</ul>\n<ol>\n\t<li>one</li>\n\t<li>two</li>\n</ol>\nTEXTILE\n \n end",
"title": ""
},
{
"docid": "b817519a8879b3966c89956d8809df57",
"score": "0.5933591",
"text": "def render\n end",
"title": ""
},
{
"docid": "01645393b96eb850f958ec2aa440e1f8",
"score": "0.59303284",
"text": "def view_renderer; end",
"title": ""
},
{
"docid": "01645393b96eb850f958ec2aa440e1f8",
"score": "0.59303284",
"text": "def view_renderer; end",
"title": ""
},
{
"docid": "c30957be166b7490cda474a839cc32d8",
"score": "0.59099615",
"text": "def render\n end",
"title": ""
},
{
"docid": "c30957be166b7490cda474a839cc32d8",
"score": "0.59099615",
"text": "def render\n end",
"title": ""
},
{
"docid": "c30957be166b7490cda474a839cc32d8",
"score": "0.59099615",
"text": "def render\n end",
"title": ""
},
{
"docid": "963a1783ff659db9be5ff0bfd6d3dc1d",
"score": "0.58909225",
"text": "def render\n # To be implemented.\n end",
"title": ""
},
{
"docid": "6c86ce72110076fb8521bf48d684cf3c",
"score": "0.5865935",
"text": "def heading\n\t\t\"Works\"\n\tend",
"title": ""
},
{
"docid": "dca5b91ced513a4bf3d980d560465252",
"score": "0.58511627",
"text": "def logo\n \"This is a cool logo !\"\n end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.5841539",
"text": "def body; end",
"title": ""
},
{
"docid": "323085553a9feab40d02d1c2213a9ae2",
"score": "0.5840261",
"text": "def heading\n\t\tname\n\tend",
"title": ""
},
{
"docid": "323085553a9feab40d02d1c2213a9ae2",
"score": "0.5840261",
"text": "def heading\n\t\tname\n\tend",
"title": ""
},
{
"docid": "c12e7a99f9b0d0eec91724f2d0a1730a",
"score": "0.58245283",
"text": "def render\n end",
"title": ""
},
{
"docid": "e77361b683bcd6e2314f0ac56ba65089",
"score": "0.5822891",
"text": "def render\n\n # Load graphics.\n path = Rails.root.join('lib', 'assets', 'letterhead', 'letterhead.png')\n \n # Draw graphics on each page.\n self.repeat(:all) do\n self.image(path, at: [0.25.in, 10.75.in], width: 8.in, height: 1.25.in)\n end\n\n # Call parent render.\n super\n\n end",
"title": ""
},
{
"docid": "97c0dcef05ce64b0d989bcb4a6cda551",
"score": "0.5815543",
"text": "def header\n image \"#{Rails.root}/app/assets/images/giftgardensmall.jpg\", \n width: 40, height: 40\n move_up 30\n text \"Activities Report\", size: 24, style: :bold, :align => :center\n end",
"title": ""
},
{
"docid": "2e34d7c9b45e5334e8939077e8ec618d",
"score": "0.5790851",
"text": "def header(args = {}, &block)\n build_base_component :header, args, &block\n end",
"title": ""
},
{
"docid": "a668f67c58820d20bea7c5618aefb788",
"score": "0.5790101",
"text": "def rendered; end",
"title": ""
},
{
"docid": "5116c1ea4797c775872030fd64036a9e",
"score": "0.5785355",
"text": "def render\n\n end",
"title": ""
},
{
"docid": "99792323e1d3207c88e3c724ba269eb8",
"score": "0.57819223",
"text": "def render\n render_with_markaby\n end",
"title": ""
},
{
"docid": "148793c9d3927b0cbc2c44823a1a8a7c",
"score": "0.5780281",
"text": "def css; end",
"title": ""
},
{
"docid": "148793c9d3927b0cbc2c44823a1a8a7c",
"score": "0.5780281",
"text": "def css; end",
"title": ""
},
{
"docid": "148793c9d3927b0cbc2c44823a1a8a7c",
"score": "0.5780281",
"text": "def css; end",
"title": ""
},
{
"docid": "6172abcb7ccbb140d20413af53976987",
"score": "0.5769456",
"text": "def render_header_foo(_pom, render:)\n view_dir = File.join(__dir__, 'foo')\n render.call :erb, :foo_header, views: view_dir\n end",
"title": ""
},
{
"docid": "3049f45302ebf5161447218de60a842c",
"score": "0.57577896",
"text": "def prerender_header_and_footer(options); end",
"title": ""
},
{
"docid": "fe30dd9785d58a4bf618544142441641",
"score": "0.57555825",
"text": "def header\n\t\t\t\tputs stars(47).green\n\t\t\t\tputs \"* \".green + \" _____ _ _ _ _ \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" / ____| | | | | | (_) \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" | (___ ___ _ __ __ _| |__ | |__ | |_ \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" \\\\___ \\\\ / __| '__/ _` | '_ \\\\| '_ \\\\| | | \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" ____) | (__| | | (_| | |_) | |_) | | | \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" |_____/ \\\\___|_| \\\\__,_|_.__/|_.__/|_|_| \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" \".light_red + \" *\".green\n\t\t\tend",
"title": ""
},
{
"docid": "1907945582ae5bb63f44b3c062bddeac",
"score": "0.5752865",
"text": "def head\n render 'head.html'\n end",
"title": ""
},
{
"docid": "ac984ee9b7e605896eddca4fabb6f043",
"score": "0.5747428",
"text": "def render(options = nil, extra_options = {}, &block) #:doc:\n @flash=flash\nputs \"RENGINE RENDER #1\"\n options=interpret_rengine_options(options)\nputs \"RENGINE RENDER #2\"\n #no layout\n super(options,extra_options,&block)\nputs \"RENGINE RENDER #3\"\n unless self.no_wrap\nputs \"RENGINE RENDER #4a\"\n \n \n txx=render_weblab(setUserJavascript+ self.response_body.join(\"\\n\"))\n puts \"RENGINE RENDER #4b\"\n\n # puts \"===========================\\n\"+txx.join(\"\\n\")+\"\\n!================================!\"\n\n if $render_translation_link\n txx << \"\\n<div style=\\\"background-color:#aaa;color:#0ff;\\\">\\n\"\n txx << translation_tool(@displayed_blurb_names)\n txx << \"\\n</div>\\n\"\n end\nputs \"RENGINE RENDER #5\"\n\n self.response_body=txx\n \n end\n end",
"title": ""
},
{
"docid": "f42045f83824a81ac9395556999e8303",
"score": "0.57350457",
"text": "def h1; api.out \"<h1>#{api.data}</h1>\"; end",
"title": ""
},
{
"docid": "7f149d231ab8d1bebaa2fdf17f9b8c6b",
"score": "0.57271093",
"text": "def header\r\n\tputs \"The students of Villains Academy starting with the letter \\\"R\\\".\"\r\n\tputs \"~~~~~~~~~~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\"\t\r\nend",
"title": ""
},
{
"docid": "88f5c907833dd92d7c39ebfdf3321238",
"score": "0.57241094",
"text": "def copyright_generator\n PersonalSiteViewTool::Renderer.copyright 'Gustavo Valenzuela', 'All rights reserved.'\n end",
"title": ""
},
{
"docid": "3822d9ff9641571ccc77d2c807ad7adf",
"score": "0.5720561",
"text": "def generate\n result = <<-eos.strip_heredoc\n framework module #{target.product_module_name} {\n umbrella header \"#{target.umbrella_header_path.basename}\"\n\n export *\n module * { export * }\n eos\n\n result << \"\\n#{generate_private_header_exports}\" unless private_headers.empty?\n result << \"}\\n\"\n end",
"title": ""
},
{
"docid": "ab1d9d19e1e09d8579d86dc3864d1066",
"score": "0.57199305",
"text": "def r(x)\r\n begin\r\n require_gem 'RedCloth'\r\n RedCloth.new(x).to_html\r\n rescue\r\n x\r\n end\r\n end",
"title": ""
},
{
"docid": "26a2dc21d78f4c8bcc39817e4ef300fe",
"score": "0.5717705",
"text": "def index(request, response)\n response['rack.rsi'] = '1'\n response['Cache-Control'] = 'max-age=3600'\n response.write(%{\n <title>HelloWorld</title>\n <%= rsi_include( \"/header?user=buzzmenot\" ) %>\n <p>Hello World!</p>\n <%= rsi_include( \"/footer?company=github\" ) %>\n }.gsub(/^\\s*/, \"\").strip)\n end",
"title": ""
},
{
"docid": "4d547a022ed5f1ea815a9c89ce5ec038",
"score": "0.5713344",
"text": "def render\n\n # Skip if page is not letterhead.\n unless self.class::LETTERHEAD_FORMAT == :none\n\n # Determine letterhead properties.\n path = Rails.root.join('lib', 'assets', 'letterhead', \"#{self.class::LETTERHEAD_FORMAT.to_s}.png\")\n x = nil\n y = nil\n width = nil\n height = 1.25\n case self.class::LETTERHEAD_FORMAT\n when :portrait, :portrait_mono\n x = 0.25\n y = 10.75\n width = 8\n when :landscape, :landscape_mono, :packing_list, :packing_list_mono\n x = 0.25\n y = 8.25\n width = 10.5\n end\n\n # Draw graphic on each page.\n self.repeat(:all) do\n self.image(path, at: [x.in, y.in], width: width.in, height: height.in)\n end\n\n end\n\n # Call parent render.\n super\n\n end",
"title": ""
},
{
"docid": "652e1a2d94f35a48a2e2063949981108",
"score": "0.56943196",
"text": "def render\n out = HighLine.new\n out.wrap_at = 78\n out.say <<-RENDER\n<%=color(\"#{@name}\", :bold)%> [#{@category.upcase}]\n<%='-'*#{@name.length}%>\n#{@description}\nRENDER\n end",
"title": ""
},
{
"docid": "357e8297d2085d3d01f98182069b0e6c",
"score": "0.5678435",
"text": "def _brands_header\n\t$report_file.puts \" _ _ \"\n\t$report_file.puts \"| | | | \"\n\t$report_file.puts \"| |__ _ __ __ _ _ __ __| |___ \"\n\t$report_file.puts \"| '_ \\\\| '__/ _` | '_ \\\\ / _` / __|\"\n\t$report_file.puts \"| |_) | | | (_| | | | | (_| \\\\__ \\\\\"\n\t$report_file.puts \"|_.__/|_| \\\\__,_|_| |_|\\\\__,_|___/\"\n\t$report_file.puts\n\t$report_file.puts \"--------------------------------------------------------------------\"\n\t$report_file.puts\nend",
"title": ""
},
{
"docid": "b6716c3b0d230ace5eff14ca9eb9c814",
"score": "0.566788",
"text": "def r_page_header_body(&block)\n content_tag(\"div\", class: \"my-2 md:flex md:items-center md:justify-between\", &block)\n end",
"title": ""
},
{
"docid": "81ab760983d0c737f6eff01a1ecffd75",
"score": "0.56667733",
"text": "def h1\n puts \"<h1>\" + yield + \"</h1>\"\nend",
"title": ""
},
{
"docid": "a2dd5864b524d419bef697ded6f2750a",
"score": "0.5662499",
"text": "def pos_rseg_header\n pos_page_body\n end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.56585234",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.56585234",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.56585234",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.56585234",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.56585234",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.56585234",
"text": "def template; end",
"title": ""
},
{
"docid": "e90d2a4012d4d19e71c2c1141dad2897",
"score": "0.56585234",
"text": "def template; end",
"title": ""
},
{
"docid": "32398ef3f12b9468cc99f6751a31bc06",
"score": "0.56564623",
"text": "def head \n meta_author \"Kane Baccigalupi\"\n end",
"title": ""
},
{
"docid": "529c38962d5d2ade86b9bf936de9f080",
"score": "0.56512725",
"text": "def header\n text \"Phishing Frenzy Results\", size: 30, style: :bold\n move_down 20\n end",
"title": ""
},
{
"docid": "6cf3b41371855f312b2264c67f99433f",
"score": "0.5636772",
"text": "def rendered=(_arg0); end",
"title": ""
},
{
"docid": "b65a3b7ce66ec97eff1a821f6e4699fc",
"score": "0.562641",
"text": "def generate\n header + dict + footer\n end",
"title": ""
},
{
"docid": "41a529e53995f90b781f1cf008675482",
"score": "0.5617634",
"text": "def render(*args, &block); end",
"title": ""
},
{
"docid": "41f0932714ba8af7fe90b2ebec771b75",
"score": "0.56141555",
"text": "def full_code\n build_body\n header + body + footer\n end",
"title": ""
},
{
"docid": "73bd33deca3e7dfc33673f6909794727",
"score": "0.5601848",
"text": "def content\n super\n @renderer = @widget.content\n div :id => 'doc3' do\n if @renderer.render? :header\n div :id => 'hd' do\n if @renderer.render? :top_line\n render_top_line\n end\n if @renderer.render? :title\n h1 @page_title || 'Missing :page_title'\n end \n end\n end\n div :id => 'bd' do\n render_body\n end\n if @renderer.render? :footer\n div :id => 'ft' do\n render_footer\n end\n end\n end\n end",
"title": ""
},
{
"docid": "56c6385b360c1d1c65f656a541804cb6",
"score": "0.55895704",
"text": "def write_header() \n @builder.head do\n @builder.title('OmniFocus OPML Export')\n @builder.dateCreated(Time.now.httpdate)\n @builder.dateModified(Time.now.httpdate)\n# TODO @builder.ownerName(\"\")\n# TODO @builder.ownerEmail('example@example.com')\n end\n end",
"title": ""
},
{
"docid": "8f36050b6a72e31f83bad9d97959da34",
"score": "0.5584173",
"text": "def content; end",
"title": ""
},
{
"docid": "8f36050b6a72e31f83bad9d97959da34",
"score": "0.5584173",
"text": "def content; end",
"title": ""
},
{
"docid": "8f36050b6a72e31f83bad9d97959da34",
"score": "0.5584173",
"text": "def content; end",
"title": ""
},
{
"docid": "8f36050b6a72e31f83bad9d97959da34",
"score": "0.5584173",
"text": "def content; end",
"title": ""
},
{
"docid": "8f36050b6a72e31f83bad9d97959da34",
"score": "0.5584173",
"text": "def content; end",
"title": ""
}
] |
25a0bb7ba768449c51ae8abfde3449e8
|
POST /motions/:motion_id/motion_comments POST /motions/:motion_id/motion_comments.xml
|
[
{
"docid": "598c54aeb3a4fbb2f37ad37792555ff1",
"score": "0.74302554",
"text": "def create\n respond_to do |format|\n if motion_comment.save\n format.html { redirect_to( motion_comment.motion, flash: { success: 'Motion comment created.' } ) }\n format.xml { render xml: motion_comment, status: :created, location: motion_comment }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: motion_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "45acf03f6a87e6cd1dc2c4db25276570",
"score": "0.6471911",
"text": "def update\n motion_comment.assign_attributes motion_comment_attributes\n respond_to do |format|\n if motion_comment.save\n format.html { redirect_to motion_comment.motion, flash: { success: 'Motion comment updated.' } }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: motion_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9ecf2b82b823c9db0e5a5ff2bfaa7de",
"score": "0.5995591",
"text": "def create\n @motion = Motion.new(motion_params)\n\n respond_to do |format|\n if @motion.save\n format.html { redirect_to @motion, notice: 'Motion was successfully created.' }\n format.json { render :show, status: :created, location: @motion }\n else\n format.html { render :new }\n format.json { render json: @motion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d547396b03795d4a92a3b3b0451efe0",
"score": "0.5965611",
"text": "def create\n @comment = Comment.new(params[:comment])\n rel = Neo4j::Rails::Relationship.new(:commentsOn, @comment, @position)\n\n respond_to do |format|\n if @comment.save and rel.save\n format.html { redirect_to @position, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { redirect_to @position, error: 'Failed to create comment.' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04429142d79e85effd18202b1210c604",
"score": "0.59224063",
"text": "def destroy\n motion_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to( motion_url( motion_comment.motion ),\n flash: { success: \"Motion comment destroyed.\" } ) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "828dfb96cc75df98fc15fe2283d8d28f",
"score": "0.5645208",
"text": "def motion_params\n params.require(:motion).permit(:name, :content, :petition_id)\n end",
"title": ""
},
{
"docid": "8a18a8ec6ce2dc924814aa921daff12e",
"score": "0.5609259",
"text": "def specified_comment(token, action)\n @comment = @graph.get_connections(@post_id, \"comments\",\n :limit=>1,\n :fields => [\"from{name,id,picture}\",\n \"id\",\n \"message\",\n \"created_time\",\n \"like_count\", \n ],\n action => token,\n )\n end",
"title": ""
},
{
"docid": "58fbb9f3aac73113bff4892cd5bf08d3",
"score": "0.54327947",
"text": "def post_comment(action, name, message)\n summary = :\"name_#{action}_comment_summary\".l\n comment = Comment.create!(\n :target => name,\n :summary => summary,\n :comment => message\n )\n Transaction.post_comment(\n :id => comment,\n :target => name,\n :summary => summary,\n :comment => message\n )\n end",
"title": ""
},
{
"docid": "87519e177a27f74204a4eb49a4c8c452",
"score": "0.53749627",
"text": "def motion_params\n params.require(:motion).permit(:title, :description, :is_active, :is_anonymous)\n end",
"title": ""
},
{
"docid": "aebc322878e34afc5dad9eec8c140090",
"score": "0.5329645",
"text": "def create\n @article = Article.find(params[:article_id])\n @article_comment = @article.article_comments.build()\n @article_comment.content = params[:replyContent]\n\n respond_to do |format|\n if @article_comment.save\n #format.html { redirect_to @article, :anchor => 'comment' }\n format.html { redirect_to(article_path(@article, :anchor => \"comment\", :page=>1)) }\n\n format.xml { render :xml => @article_comment, :status => :created, :location => @article_comment }\n else\n format.html { redirect_to(@article) }\n format.xml { render :xml => @article_comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18f171e713a6ac4d5218983823a030fe",
"score": "0.5310976",
"text": "def create\n comment = Comment.new(:content => params[:content],\n :user_id => current_user.id,\n :image => avatar_url(current_user),\n :commentable => list,\n :cid => params[:cid])\n status = comment.save ? 201 : 400\n\n unless current_user == list.user\n Notification.new_comment(list.user, current_user, list)\n mentions = get_mentions(params[:content])\n Notification.new_mention(mentions, current_user, list) unless mentions.empty?\n end\n\n head status\n end",
"title": ""
},
{
"docid": "42706c301e80c767cd26f6a6140c2abd",
"score": "0.52571195",
"text": "def reply\n\n\n @reply = @visitor.comments.build(parent: @comment)\n\n \n end",
"title": ""
},
{
"docid": "685f0f183694d9350baf11274343101c",
"score": "0.52499086",
"text": "def on_comment(msg)\n end",
"title": ""
},
{
"docid": "f6bd8edf12a482b59c488b59f0336bf4",
"score": "0.5241574",
"text": "def post_comment(comment, poi=\"4f4f4c27d4374e800100001d\")\n uri = URI.parse(\"http://mashweb.fokus.fraunhofer.de:3008/api/comment\")\n response = Net::HTTP.post_form(uri, {\n :title => 'Autocomment',\n :body => comment\n })\n end",
"title": ""
},
{
"docid": "c68ffd23f158c60c675176c2365481db",
"score": "0.5198844",
"text": "def set_motion\n @motion = Motion.find(params[:id])\n end",
"title": ""
},
{
"docid": "f61343527a3ac5629bb712c871cd6d6c",
"score": "0.5175442",
"text": "def create_comments\n end",
"title": ""
},
{
"docid": "f61343527a3ac5629bb712c871cd6d6c",
"score": "0.5175442",
"text": "def create_comments\n end",
"title": ""
},
{
"docid": "f61343527a3ac5629bb712c871cd6d6c",
"score": "0.5175442",
"text": "def create_comments\n end",
"title": ""
},
{
"docid": "1fef72b25f02694336e0ae6dbbefff71",
"score": "0.51254535",
"text": "def create\n @comment = @micropost.comments.new (comment_params)\n @comment.user = current_user\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @micropost, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @micropost }\n else\n format.html { render :new }\n format.json { render json: @micropost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047aec4c1585994575f3e2fecd72aa3",
"score": "0.5122156",
"text": "def insert_motivatedByCommenting\n insert_motivatedBy OA.commenting\n end",
"title": ""
},
{
"docid": "2a15f9ccb8167512526f3284841f02f4",
"score": "0.5118211",
"text": "def create\n @comment = Comment.new(params[:comment])\n @comment.topic = @topic\n @topic.updated_at = Time.now\n @topic.save\n @comment.user = current_user\n\n respond_to do |format|\n if @comment.save\n # a new reply needs to be queued for async stuff like emails out to people\n qi = QueueItem.new(:queue_type => 'new_comment', :content => @comment.id.to_s)\n qi.save\n format.html { redirect_to(:controller => :start, :action => :index, :id => @topic) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n format.js\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "2aa8c949f5458c554352df803d5059fb",
"score": "0.50826293",
"text": "def create\n @reply = Reply.new(reply_params)\n\n @reply.user_id = current_user.id\n\n respond_to do |format|\n if @reply.save\n format.html {\n if @reply.reply.present? && @reply.reply.user_id.present?\n message_user(@reply.reply.user_id, \"New reply to your comment #{@reply.lesson_component.title}\", \"#{current_user.firstname} replied to your comment on #{@reply.lesson_component.title} at #{@reply.created_at.strftime(\"%B %-d, %Y at %-l:%M %P\")}\", \"/course/#{@reply.lesson_component.lesson.course.slug}/modules/#{@reply.lesson_component.lesson.slug}/#{@reply.lesson_component.order}#comment-#{@reply.id}\")\n end\n redirect_to \"/course/#{@reply.lesson_component.lesson.course.slug}/modules/#{@reply.lesson_component.lesson.slug}/#{@reply.lesson_component.order}#comment-#{@reply.id}\", notice: \"Comment added\"\n }\n format.json { render :show, status: :created, location: @reply }\n else\n format.html {\n redirect_to \"/course/#{@reply.lesson_component.lesson.course.slug}/modules/#{@reply.lesson_component.lesson.slug}/#{@reply.lesson_component.order}#comment-panel\", notice: @reply.errors\n }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cde17e816e5eaa366a6758556480b52",
"score": "0.5065189",
"text": "def create\n page = Page.find(params[:page])\n @comment = page.comments.new(params[:comment])\n page.comic.comments << @comment\n\n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Comment was successfully created.'\n format.html { redirect_to comic_path(:id => @comic.alias, :page => page.locate) }\n format.xml { head :created, :location => comment_url(@comment) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "dad224694c1a842271a05196fa17c37f",
"score": "0.5052577",
"text": "def create\n @comment_node = CommentNode.new(params[:comment_node])\n\n respond_to do |format|\n if @comment_node.save\n format.html { redirect_to @comment_node, :notice => 'Comment node was successfully created.' }\n format.json { render :json => @comment_node, :status => :created, :location => @comment_node }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @comment_node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3e1fa81d30570f16b771256b196da7f",
"score": "0.5033048",
"text": "def create\n\t\t@comment = Comment.new(comment_params)\n\t\t@majorpost = Majorpost.find(params[:comment][:majorpost_id])\n\t\t#Detect language\n\t\tif language = CLD.detect_language(@comment.content)\n\t\t\t@comment.locale = language[:code]\n\t\tend\t\t\n\t\tif @comment.update(\n\t\t\tuser_id: current_user.id, \n\t\t\tcampaign_id: @majorpost.campaign_id,\n\t\t\tmajorpost_user_id: @majorpost.user_id,\n\t\t\texcerpt: ActionView::Base.full_sanitizer.sanitize(@comment.content).squish.truncate(140)\n\t\t)\n\t\t\t@majorpost = Majorpost.find(@comment.majorpost_id)\n\t\t\t#Update activity\n\t\t\tif @activity = PublicActivity::Activity.find_by_trackable_id_and_trackable_type(@comment.id,'Comment')\n\t\t\t\t@activity.update_columns(majorpost_id: @comment.majorpost_id)\n\t\t\tend\n\t\t\t#Create notification\n\t\t\tunless @comment.user == @majorpost.user\n\t\t\t\tif @comment.main_comment\n\t\t\t\t\tNotification.create(\n\t\t\t\t\t\tuser_id: @comment.main_comment.user_id,\n\t\t\t\t\t\ttrackable_id: @comment.id,\n\t\t\t\t\t\ttrackable_type: \"Comment\",\n\t\t\t\t\t\tnotification_type: \"reply_create\"\n\t\t\t\t\t)\n\t\t\t\t\tunless @majorpost.user_id == @comment.main_comment.user_id\n\t\t\t\t\t\tNotification.create(\n\t\t\t\t\t\t\tuser_id: @majorpost.user_id,\n\t\t\t\t\t\t\ttrackable_id: @comment.id,\n\t\t\t\t\t\t\ttrackable_type: \"Comment\",\n\t\t\t\t\t\t\tnotification_type: \"comment_create\"\n\t\t\t\t\t\t)\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tNotification.create(\n\t\t\t\t\t\tuser_id: @majorpost.user_id,\n\t\t\t\t\t\ttrackable_id: @comment.id,\n\t\t\t\t\t\ttrackable_type: \"Comment\",\n\t\t\t\t\t\tnotification_type: \"comment_create\"\n\t\t\t\t\t)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@new_comment = Comment.new\n\t\t#Create a popover random class for js unique refresh\n\t\t@popoverclass = SecureRandom.hex(16)\t\t\n\t\t#Add score\n\t\tadd_score(@comment.majorpost.user, @comment.user)\t\t\n\tend",
"title": ""
},
{
"docid": "82a7e3410d2f3dd2ac12419cdf665eac",
"score": "0.5026389",
"text": "def create\n begin\n @phrase = Phrase.find(params[:id]) # コメント対象のフレーズ\n rescue Exception => e\n flash[:error] = 'コメントを書き込めませんでした。'\n redirect_to root_url\n return\n end\n \n @new_comment = @phrase.comments.new\n @new_comment.content = params[:comment][:content]\n @new_comment.user_id = current_user.id # コメント者のidをセット\n\n respond_to do |format|\n if @new_comment.save\n format.html { redirect_to @phrase, notice: 'コメントを投稿しました。' }\n\n # 「コメントされた」旨のお知らせメール送信(メール配信フラグfalseの人には送られない)\n CommentMailer.notice_mail(@phrase,@new_comment,request.url).deliver if @phrase.user.mail_flg\n else\n format.html { render action: \"show\" }\n end\n end\n end",
"title": ""
},
{
"docid": "2baafb8b1c61425b4d2ff80bdb41389c",
"score": "0.5019057",
"text": "def create\n @comment = @post.comments.build(params[:comment])\n \n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(posts_url) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db7bb81bc291233f2d45ec29315e3ed3",
"score": "0.5009307",
"text": "def new\n #1st you retrieve the post thanks to params[:micropost_id]\n micropost = micropost.find(params[:micropost_id])\n #2nd you build a new one\n @comment = micropost.comments.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comment }\n end\n end",
"title": ""
},
{
"docid": "dc3774849f8c3bfd47ffae16e3a2a9ca",
"score": "0.5007899",
"text": "def update\n respond_to do |format|\n if @motion.update(motion_params)\n format.html { redirect_to @motion, notice: 'Motion was successfully updated.' }\n format.json { render :show, status: :ok, location: @motion }\n else\n format.html { render :edit }\n format.json { render json: @motion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc3774849f8c3bfd47ffae16e3a2a9ca",
"score": "0.5007899",
"text": "def update\n respond_to do |format|\n if @motion.update(motion_params)\n format.html { redirect_to @motion, notice: 'Motion was successfully updated.' }\n format.json { render :show, status: :ok, location: @motion }\n else\n format.html { render :edit }\n format.json { render json: @motion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e124f2ec8cd974e18f8eb213ca01bc6b",
"score": "0.50072134",
"text": "def reply\n @comment = Comment.find params[:id]\n @new_comment = @comment.replies.create reply_params\n @new_comment.commentable_id = @comment.id\n @new_comment.user_id = current_user.id\n\n if @new_comment.save\n flash[:success] = \"Success\"\n redirect_to \"/reply/\" + @comment.commentable_id.to_s\n else\n flash[:danger] = \"No success\"\n redirect_to \"/reply/\" + params[:id]\n end\n end",
"title": ""
},
{
"docid": "d597884d507171832b85d9b5dc7a945f",
"score": "0.50023764",
"text": "def create\n @mot_m = MotM.new(mot_m_params)\n\n respond_to do |format|\n if @mot_m.save\n format.html { redirect_to matches_path, notice: 'Your vote was successfully cast.' }\n format.json { render action: 'show', status: :created, location: @mot_m }\n else\n format.html { render action: 'new' }\n format.json { render json: @mot_m.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d5f60d4da5ae350757653fd91159f97",
"score": "0.49924698",
"text": "def show\n @tags = Motion.tag_counts_on(:tags)\n @comments = Motion.find(params[:id]).comments\n @current_user = current_user\n end",
"title": ""
},
{
"docid": "ac5e001ff0eaad490547f548a355af8d",
"score": "0.49869177",
"text": "def create\n @comment = @question.comments.create(comment_params)\n redirect_to question_path(@question)\n end",
"title": ""
},
{
"docid": "6922207fee035d23e75102b015a6af74",
"score": "0.4983295",
"text": "def create\n @action_idea_comment = ActionIdeaComment.new(action_idea_comment_params)\n\n respond_to do |format|\n if @action_idea_comment.save\n format.html { redirect_to @action_idea_comment, notice: 'Action idea comment was successfully created.' }\n format.json { render :show, status: :created, location: @action_idea_comment }\n else\n format.html { render :new }\n format.json { render json: @action_idea_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c69895bd8a981f561c5828d0d379579a",
"score": "0.49808764",
"text": "def reply\n @page = Page.find(params[:page])\n @parent_id = params[:parent]\n @comment_indent = params[:indent]\n @comment = Comment.new(:emailupdates => true)\n end",
"title": ""
},
{
"docid": "b4672ab1e4bed2b7d1f843fd36f8d250",
"score": "0.49653977",
"text": "def create\n @mote = Mote.new(params[:mote])\n\n respond_to do |format|\n if @mote.save\n format.html { redirect_to @mote, notice: 'Mote was successfully created.' }\n format.json { render json: @mote, status: :created, location: @mote }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5fcdc8b886621b96c25d17ebf5a2372",
"score": "0.4963714",
"text": "def new\n @texto = Texto.new\n 0.times { @texto.replies.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @textos }\n end\n end",
"title": ""
},
{
"docid": "50b17ed9c3bca377a0f45d4edc000ab7",
"score": "0.4959455",
"text": "def create\n @reply = @message.replies.build(params[:reply])\n @reply.user_id = user_id\n respond_to do |format|\n if @reply.save\n format.js\n format.html { redirect_to(user_messages_path) }\n format.xml { render :xml => @reply, :status => :created, :location => @reply }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reply.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c7c669b722571ced55aa040687742f6",
"score": "0.49583247",
"text": "def create\n @object = Comment.new(params[:comment])\n Comment.transaction do\n @object.save!\n create_change_log_entry\n end\n respond_to do |format|\n flash[:notice] = 'Thanks for your comments.'\n format.html { redirect_to(@object.post) }\n format.xml { render :xml => @object, :status => :created, :location => @object }\n end\n end",
"title": ""
},
{
"docid": "9e90e9b21a61fba0731a0479f34eaca1",
"score": "0.4947836",
"text": "def mcomment_params\n params.require(:mcomment).permit(:music_id, :mcomment, :body, :user_id)\n end",
"title": ""
},
{
"docid": "9c237fa01999982408916c9abbad9f6a",
"score": "0.49467313",
"text": "def comment options={}\n client.post(\"/#{id}/comments\", options)\n end",
"title": ""
},
{
"docid": "e69fbdf7b5bc30f84cf7747c255be731",
"score": "0.494651",
"text": "def create_moment_comment(moment_id, text)\n post(\"/v1/moments/#{moment_id}/comments\", text: text)\n end",
"title": ""
},
{
"docid": "c5a035b6145babdf6389482525d14b02",
"score": "0.49458688",
"text": "def create\n @promotion_demotion = PromotionDemotion.new(params[:promotion_demotion])\n\n respond_to do |format|\n if @promotion_demotion.save\n format.html { redirect_to :back, notice: 'Promotion demotion was successfully created.' }\n format.json { render json: @promotion_demotion, status: :created, location: @promotion_demotion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @promotion_demotion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "834fc82015b3baea3cf0a3664aa943d6",
"score": "0.49388957",
"text": "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment, notice: t(\"wactions.created\", model: t(\"activerecord.models.#{controller_name.singularize.gsub(\" \", \"\")}\"))}\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a19d7a27c24eb78b83693c96a3b141fb",
"score": "0.49352083",
"text": "def create\n #1st you retrieve the post thanks to params[:post_id]\n micropost = micropost.find(params[:micropost_id])\n #2nd you create the comment with arguments in params[:comment]\n @comment = micropost.comments.create(params[:comment])\n\n respond_to do |format|\n if @comment.save\n #1st argument of redirect_to is an array, in order to build the correct route to the nested resource comment\n format.html { redirect_to([@comment.micropost, @comment], :notice => 'Comment was successfully created.') }\n #the key :location is associated to an array in order to build the correct route to the nested resource comment\n format.xml { render :xml => @comment, :status => :created, :location => [@comment.micropost, @comment] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bbc49059265e01ae8ad86cdfcef3b7a",
"score": "0.49350062",
"text": "def create\n @comment = Comment.create(content: params[:content])\n current_user.comments << @comment\n current_user.save\n\n idea = Idea.find(params[:ideaId])\n idea.comments << @comment\n idea.comments.order(\"created_at DESC\")\n idea.save\n respond_to do |format|\n format.json {render json: @comment}\n end\n end",
"title": ""
},
{
"docid": "91324e3eda56515c5980a60991200a28",
"score": "0.49153492",
"text": "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to(@comment, :notice => 'Comment was successfully created.') }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43cfc56273354c2a031034360367c891",
"score": "0.49129662",
"text": "def create\n @current_object = Comment.new(params[:comment])\n\t\trespond_to do |format|\n\t\t\tif @current_object.save\n\t\t\t\tflash[:notice] = 'Comment was successfully created.'\n\t\t\t\tformat.html { redirect_to(comment_path(@current_object)) }\n\t\t\t\tformat.xml { render :xml => @current_object, :status => :created, :location => comment_path(@current_object) }\n\t\t\telse\n\t\t\t\tflash[:error] = 'Comment creation failed.'\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @current_object.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n end",
"title": ""
},
{
"docid": "3e9eedd7a36dbcad8d59bd7258dc4109",
"score": "0.4905923",
"text": "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Comment was successfully created.'\n format.html { redirect_to(@comment) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e9eedd7a36dbcad8d59bd7258dc4109",
"score": "0.4905923",
"text": "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Comment was successfully created.'\n format.html { redirect_to(@comment) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0affebf941f292abd4b8bf1fef67bea7",
"score": "0.4890435",
"text": "def create\n @comment_relationship = CommentRelationship.new(params[:comment_relationship])\n\n respond_to do |format|\n if @comment_relationship.save\n format.html { redirect_to @comment_relationship, notice: 'Comment relationship was successfully created.' }\n format.json { render json: @comment_relationship, status: :created, location: @comment_relationship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment_relationship.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8deadfa25f4034ac34fda1787a11d36e",
"score": "0.4886918",
"text": "def create_comment(content)\n DOM(`#@native.createComment(#{content})`)\n end",
"title": ""
},
{
"docid": "cf78616ccbf060d8419a5fc5659aa9ba",
"score": "0.48833913",
"text": "def create\n @talk_comment = TalkComment.new(params[:talk_comment])\n\n respond_to do |format|\n if @talk_comment.save\n flash[:notice] = 'Talk comment was successfully created.'\n format.html { redirect_to :action => :index }\n format.json { render json: @talk_comment, status: :created, location: @talk_comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talk_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae657b72ed52d67e84a114d28a330127",
"score": "0.48691624",
"text": "def do_new_reply\n @feeditem_id = params['feeditem_id']\n @challenge_id = params['challenge_id']\n @reply_text = params['reply_text']\n ChallengeFeeds.post_comment(dbdc_client, @feeditem_id, @reply_text)\n redirect_to :id => @challenge_id, :action => 'show'\n end",
"title": ""
},
{
"docid": "90a4c1d843d2ef87bd4a054ebf8ea8ec",
"score": "0.48642063",
"text": "def motivatedByCommenting\n q = [nil, OA.motivatedBy, OA.commenting]\n @graph.query(q).collect {|s| s.subject }\n end",
"title": ""
},
{
"docid": "05922721025c92c055f554862cc9b8ac",
"score": "0.48506266",
"text": "def create\n @question_to_tag_junction = QuestionToTagJunction.new(question_to_tag_junction_params)\n\n respond_to do |format|\n if @question_to_tag_junction.save\n format.html { redirect_to @question_to_tag_junction, notice: 'Question to tag junction was successfully created.' }\n format.json { render :show, status: :created, location: @question_to_tag_junction }\n else\n format.html { render :new }\n format.json { render json: @question_to_tag_junction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4f9a9f0c80dfa08542ca237bdeb304e",
"score": "0.48372108",
"text": "def create\n if(params[:comment][:tipus] == 'comment')\n\t\t\t@post = Post.find(params[:post_id])\n \t\t@comment = @post.comments.create(params[:comment].permit(:text, :tipus))\n \telse\n \t\t@parent = Comment.find(params[:comment][:parent_id])\n \t\t#@comment = @parent.replies.create(params[:comment].permit(:text, :tipus, :parent_id))\n \t\t@comment = Comment.new(comment_params)\n \t\t@parent.replies << @comment\n \t\t@comment.tipus = 'reply'\n \t\t@comment.post_id = @parent.post.id\n\t\t\t@post = Post.find(@comment.post_id)\n \tend\n\t\t@post.update_attribute(:nComments, @post.nComments + 1)\n \t@comment.user_id = current_user.id\n\n \t@comment.save\n\n \tif @comment.save\n \t\tif @comment.tipus == 'comment'\n \t\t\tredirect_to post_path(@post)\n \t\telse\n \t\t\tredirect_to post_path(@parent.post)\n \t\tend\n \telse\n \t\trender 'new'\n \tend\n end",
"title": ""
},
{
"docid": "e0332fcdeb4531c74561f6aba9d9156d",
"score": "0.48360583",
"text": "def new\n @comment = @story.comments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comment }\n end\n end",
"title": ""
},
{
"docid": "fdf19eb4dc7ced0b32f83d2c9aca8180",
"score": "0.48271388",
"text": "def create\n @messages_comment = MessagesComment.new(params[:messages_comment])\n\n respond_to do |format|\n if @messages_comment.save\n format.html { redirect_to @messages_comment, notice: 'Messages comment was successfully created.' }\n format.json { render json: @messages_comment, status: :created, location: @messages_comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @messages_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3225f89346ef718002f5bdd884bbdc93",
"score": "0.48268905",
"text": "def create\n @comments = @story.comments\n @comment = @story.comments.new(params[:comment])\n @comment.user = current_user\n\n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Comment was successfully created.'\n format.html { redirect_to(@story) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render 'stories/show' }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da2d06f60b4c31f95fc754de43b7b912",
"score": "0.48267433",
"text": "def create\n @radio = Radio.find(params[:radio_id])\n comment = @radio.comments.create({:body => params[:comment], :user_id => current_user.id});\n respond_to do |format|\n format.json { render :json => to_commentDTO(comment), :status => :ok }\n end\n end",
"title": ""
},
{
"docid": "b5f27281391e1d3ae35b6f43f6218a00",
"score": "0.48254767",
"text": "def create\n @comment = Post.find(params[:post_id]).comments.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Comment was successfully created.'\n format.html { redirect_to post_comments_url(@comment.post) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fd7247c8facf26069e4347edbdd47c9",
"score": "0.48201132",
"text": "def fb_comments(xid,canpost=true,candelete=false,numposts=5,options={})\n\t\t\t tag \"fb:comments\",options.merge(:xid=>xid,:canpost=>canpost.to_s,:candelete=>candelete.to_s,:numposts=>numposts)\n\t\t\tend",
"title": ""
},
{
"docid": "0a7ef2adf62214ff3b4ae50df5b163d8",
"score": "0.4819837",
"text": "def new\n #@replyship = Replyship.new\n @comment = Comment.new(:song_id => params[:song_id])\n\t\t@replyship = Comment.find(params[:comment_id]).replyships.build\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @replyship }\n end\n end",
"title": ""
},
{
"docid": "7f08eb6e2ecc573774ddcacb1130208d",
"score": "0.48187336",
"text": "def create\n @comment = @post.comments.build(params[:comment])\n\n respond_to do |wants|\n if @comment.save\n\t\t\t\tuser_session.add_comment(@comment)\n flash[:notice] = 'Comment was successfully created.'\n\t\t\t\tflash[:comment_saved] = true\n wants.html { redirect_to pretty_post_url(@post) + \"#comment_#{@comment.id}\" }\n wants.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n\t\t\t\t# @new_comment = true\n\t\t\t\tflash[:comment_params] = params[:comment]\n\t\t\t\tflash[:comment_error] = @comment.errors.full_messages.join('<br />')\n wants.html { redirect_to pretty_post_url(@post) + '#add_comment' } # { render :template => 'posts/show', :section => 'comments' }\n wants.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7baca5a3068d054dad98943d9e16904",
"score": "0.48127675",
"text": "def create\n @comment = Comment.create(params[:comment])\n sleep 1 if params[:pause]\n respond_with(@comment)\n #redirect_to comments_path unless request.xhr?\n end",
"title": ""
},
{
"docid": "301d75effaa085b3add22716c412b140",
"score": "0.48059198",
"text": "def new\n use_tinymce(:simple)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comment }\n end\n end",
"title": ""
},
{
"docid": "db1e5d52f58d350e1826977f6e20dca6",
"score": "0.4801889",
"text": "def create\n @comment = current_user.comments.build(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html do\n # @users = User.all\n\n # # Twilio constants – should be moved to config\n # account_sid = 'ACd619abfb51473fa45265088dbf7cbf7d'\n # account_token = 'a5225b03b9cfee05ffcf539bf58c6492'\n\n # @twilio_client = Twilio::REST::Client.new account_sid, account_token\n\n # @users.each do |user|\n # @twilio_client.account.sms.messages.create(\n # :from => '+16463621414',\n # :to => user.phone_number,\n # :body => \"#{current_user.name} just commented on a collude post.\"\n # )\n # logger.info \"Text message sent to #{user.name} at #{user.phone_number}.\"\n # end\n redirect_to root_path, notice: 'Comment was successfully created.'\n end \n format.json { render action: 'show', status: :created, location: @comment }\n else\n format.html { render action: 'new' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "485789c36b833f45fbf12fdca10dc21f",
"score": "0.47985357",
"text": "def create\n # store that comment for later mailer delivery and channel broadcasting\n comment = @post.comments.create! comments_params\n\n # mailer deliver later\n CommentsMailer.submitted(comment).deliver_later\n\n # render to page in real time using websocket channels\n CommentsChannel.broadcast(comment)\n\n redirect_to @post\n end",
"title": ""
},
{
"docid": "b0c40b47e96c900707a461895f40a3fc",
"score": "0.4798046",
"text": "def create_media_comment(id, text, options = {})\n response = post(\"media/#{id}/comments\", options.merge(text: text), signature = true)\n response\n end",
"title": ""
},
{
"docid": "b9beb5d00c31cc8614ccf8047fcc609c",
"score": "0.47975215",
"text": "def create\n @reply = @comment.replies.new(reply_params)\n @reply.user_id = session[:user_id]\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @post, notice: 'Reply was successfully created.' }\n format.json { render @post, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d7f578ff287ed8688487cdc01826728",
"score": "0.47950432",
"text": "def comment (video, str, user)\r\n self.connect(user) unless user.token?\r\n uri = URI(HOST + 'feeds/api/videos/' + video.id.to_s + '/comments')\r\n post = Net::HTTP::Post.new uri.path\r\n post.content_type = 'application/atom+xml'\r\n post.body = Comment.formatString(str)\r\n _http_post(uri, post, user)\r\n end",
"title": ""
},
{
"docid": "5f26cabd2c586476d34ab65bbc4559a3",
"score": "0.47919652",
"text": "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to equipment_path(@comment.equipment.id), notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { redirect_to equipment_path(@comment.equipment.id), notice: 'El comentario no puede estar en blanco.' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03065b6cd74c576a3058557c74adcabd",
"score": "0.47886366",
"text": "def create\n @comment = Comment.new(:user => current_user, :micropost_id => params[:comment][:micropost_id], :content => params[:comment][:content])\n sql_parts = [\"INSERT INTO comments (content, user_id, micropost_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?)\", @comment.content, current_user.id, @comment.micropost_id, Time.now, Time.now]\n sql = ApplicationRecord.send(:sanitize_sql_array, sql_parts)\n result = ApplicationRecord.connection.execute(sql)\n redirect_to micropost_path(params[:comment][:micropost_id])\n end",
"title": ""
},
{
"docid": "a04bee20a36032086dcacf3efef31ce6",
"score": "0.47834283",
"text": "def create\n @current_comment = current_idea.comments.new(comment_params)\n @current_comment.user = current_user\n\n respond_to do |format|\n if current_comment.save\n format.html { redirect_to current_comment.idea, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: current_comment.idea }\n else\n format.html { render :new }\n format.json { render json: current_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8aa1d553e33716e6824c249d86e6b45d",
"score": "0.47790226",
"text": "def post_comment\n @product = Product.find(params[:product_id])\n @comment = Comment.create(\n product_id: @product.id,\n content: params[:content],\n user_id: current_user.id\n )\n end",
"title": ""
},
{
"docid": "b8efbe37845392646c5762f01a1e8b17",
"score": "0.47777265",
"text": "def create\n @mobs_nano = MobsNano.new(params[:mobs_nano])\n\n respond_to do |format|\n if @mobs_nano.save\n flash[:notice] = 'MobsNano was successfully created.'\n format.html { redirect_to mobs_nano_url(@mobs_nano) }\n format.xml { head :created, :location => mobs_nano_url(@mobs_nano) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mobs_nano.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "d3a808fc6db1ae54f86ab5c32fc13136",
"score": "0.47762787",
"text": "def create\n if(current_user)\n @reply = Reply.new(reply_params)\n \n respond_to do |format|\n if @reply.save\n format.html { redirect_to \"/contributions/#{@reply.contribution_id}\"}\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { render :new }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n else\n miId = decodeToken(params[:user_token])\n @miuser = User.find(miId)\n @micontribution = Comment.find(params[:comment_id])\n \n params[:reply][:user_id] = miId\n params[:reply][:puntos] = 0\n @reply = Reply.new(reply_params)\n respond_to do |format|\n if @reply.save\n format.html { redirect_to \"/contributions/#{@reply.contribution_id}\"}\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { render :new }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "538865d0644d3ac5f86f6d33ab5e95ac",
"score": "0.4769735",
"text": "def create\n @motto = Motto.new(motto_params)\n\n respond_to do |format|\n if @motto.save\n format.html { redirect_to @motto, notice: 'Motto was successfully created.' }\n format.json { render :show, status: :created, location: @motto }\n else\n format.html { render :new }\n format.json { render json: @motto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cdb60bc70cc87037293d8767f6c5a34",
"score": "0.47689492",
"text": "def create_comment\n @user = User.find(params[:user_id])\n @message = Message.find(params[:message_id])\n @comment = @message.comments.create(params.permit(:content))\n @comment.user = @user\n @comment.user_name = @user.id\n @comment.user_avatar = @user.id\n\n if @comment.save\n response = { \"code\" => 1, \"msg\" => \"Comment Created Successfully\" }\n else\n response = { \"code\" => 0, \"msg\" => \"Comment Can't be created\" }\n end\n\n render json: response\n end",
"title": ""
},
{
"docid": "2779cacb42e0ca71a61533438bf09c13",
"score": "0.4766979",
"text": "def post_photo_comment\n @pic = Picture.find(params[:picture_id].to_i)\n @comment = PhotoComment.new(:comment=>params[:comment],:user_id=>@login_user.id,:discussable_id=>params[:picture_id],:discussable_type=>\"Picture\")\n if @comment.save\n respond_to do |format|\n format.js\n end\n else\n render :text => \"Fail\"\n end\n end",
"title": ""
},
{
"docid": "5bf4f17478eb7529580b0b7fb0f0a8d4",
"score": "0.47641754",
"text": "def comment!(travel, content)\n comments.create!(\n travel_id: travel.id,\n content: content\n )\n end",
"title": ""
},
{
"docid": "7a5e2ae143eef89070cd377bf64f9190",
"score": "0.47626364",
"text": "def create\n @comment = @post.comments.new(comment_params)\n if @comment.save\n render json: @comment, status: :created\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n\n end",
"title": ""
},
{
"docid": "9e6828d147575d8b0e02326f7ca9832e",
"score": "0.47595668",
"text": "def create\n @mood = Mood.new(:mood => params[:mood], :comment => params[:comment][0])\n @mood.add_user(current_user)\n @mood.add_project(params[:id_project])\n if @mood.save\n redirect_to @mood.project, flash: {success: I18n.t('mood.create_success')}\n else\n redirect_to @mood.project, flash: {error: I18n.t('mood.create_error')}\n end\n end",
"title": ""
},
{
"docid": "98976626f919f3cdb86a16dc77d941d1",
"score": "0.4749949",
"text": "def create\n @comment = create_comment\n\n respond_to do |format|\n if @comment.save!\n @post.touch && @comment.ancestors.each(&:touch)\n\n broadcast_new_post @comment\n dom_id = \"/#H#{@comment.id}\"\n\n format.html { redirect_to post_path(@post.root)+dom_id, notice: 'Post was successfully created.' }\n # format.json { render :show, status: :created, location: @post }\n else\n format.html { redirect_to post_path(@post.root), notice: 'Error: Comment was not made.' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n\n rescue ActiveRecord::RecordInvalid => e\n redirect_to post_path(@post.root), notice: e.message\n end",
"title": ""
},
{
"docid": "6b4d4ec0c22e687c82fbff10bd17da1f",
"score": "0.4743774",
"text": "def create\n @comment = Comment.new(params[:comment])\n @comment.save\n respond_with(@post, @comment)\n end",
"title": ""
},
{
"docid": "21bc479d5495b9d2f35e10fbdbffa88c",
"score": "0.47404587",
"text": "def create\n @post = Post.find(params[:post_id])\n @comment = @post.post_comments.create(post_comment_params)\n @comment.body = emojify(@comment.body)\n @comment.body = linkify_hashtags(@comment.body)\n @comment.body = convertBIUS(@comment.body)\n @comment.body = convertEnter(@comment.body)\n @comment.user = current_user\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @post, notice: 'Komentarz został dodany.' }\n format.json { render :show, status: :created, location: @post_comment }\n else\n format.html { render :new }\n format.json { render json: @post_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e37adc13b160e04634fd13248e221f5",
"score": "0.47373855",
"text": "def create\n @comment = Comment.new\n @comment.content = params[:content]\n @comment.post_id = params[:post_id]\n @comment.user_id = current_user.id\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to root_path, notice: \"Comment was successfully created.\" }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { redirect_to root_path, notice: \"Por favor añada contenido a su comentario.\" }\n end\n end\n end",
"title": ""
},
{
"docid": "61cdead9cce88c9fdbba65f34d228c2e",
"score": "0.4735651",
"text": "def create\n @comment = Comment.create(comment_params)\n sleep 1 if params[:pause]\n respond_with(@comment)\n #redirect_to comments_path unless request.xhr?\n end",
"title": ""
},
{
"docid": "a03272782c5555b3eafe4af47fd5843f",
"score": "0.4730219",
"text": "def send_comment(data)\n current_user.comments.create!(content: data['comment'], blog_id: data['blog_id'])\n end",
"title": ""
},
{
"docid": "8e11aa2549c04fe61aa527d077dbbe1e",
"score": "0.47259238",
"text": "def comment #create comment\n comment = Comment.new\n if comment.create_comment(params[:body], params[:video_id])#calling create_comment method of Comment model\n respond_with do |format|\n format.json {render :json => {:success => true, :message => \"comment successfully posted\"}}\n end\n else\n respond_with do |format|\n format.json {render :json => {:success => false}}\n end\n end\n end",
"title": ""
},
{
"docid": "0b031e817ff4c14b97751364cdcc0811",
"score": "0.4721975",
"text": "def create\n @comments = Comment.all\n @idea = Idea.find(params[:idea_id])\n @ideation_session = IdeationSession.find(@idea.ideation_session_id)\n @comment = Comment.new(comment_params)\n @comment.idea_id = @idea.id\n @comment.participant_id = Participant.where(user_id: current_user.id).first.id\n respond_to do |format|\n if @comment.save && (@ideation_session.status_votation || @ideation_session.available_session)\n format.html { redirect_to idea_comments_path(@idea), notice: 'Comment was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "6ee2bc3f8dc8d30ed347b422f8ec86ae",
"score": "0.47212926",
"text": "def create\n session = UserSession.find_by_authentication_token(params[:authentication_token])\n user = session.user\n \n respond_to do |format|\n if user\n @comment = Comment.new(:user_id => user.id, :recipe_id => params[:recipe_id], :text => params[:text])\n \n if @comment.save\n recipe = Recipe.find_by_id([params[:recipe_id]])\n\n @comments = recipe.fetch_comments\n format.json { render :json => { :comments => @comments, :message => \"success\"} }\n else\n format.json { render :status => 500, :json => { :message => \"There was an error uploading your comment.\" }}\n end\n else\n format.json { render :json => { :message => \"Invalid authentication token\"}} \n end\n end\n end",
"title": ""
},
{
"docid": "740b86219e2cb4f468ddbea02d833c8f",
"score": "0.47187328",
"text": "def create\n @comment5 = Comment5.new(comment5_params)\n\n respond_to do |format|\n if @comment5.save\n format.html { redirect_to @comment5, notice: 'Comment5 was successfully created.' }\n format.json { render :show, status: :created, location: @comment5 }\n else\n format.html { render :new }\n format.json { render json: @comment5.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58f5eeaad828b86227c3d084048ec8d0",
"score": "0.47133353",
"text": "def create\n @comment14 = Comment14.new(comment14_params)\n\n respond_to do |format|\n if @comment14.save\n format.html { redirect_to @comment14, notice: 'Comment14 was successfully created.' }\n format.json { render :show, status: :created, location: @comment14 }\n else\n format.html { render :new }\n format.json { render json: @comment14.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a535450d1828c2a4359b5efedde37c2",
"score": "0.47122443",
"text": "def analyze\n data = { micropost_id: id,\n content: content}\n send_to_ml_service(data)\n end",
"title": ""
},
{
"docid": "8250f059a26a4955b2b5265851882435",
"score": "0.4711338",
"text": "def create\n @reply = Reply.new(params[:reply])\n post_id = params[:post_id]\n topic_id = params[:topic_id]\n @reply.post_id = post_id\n @reply.user_id = current_user.id\n @reply.ip = get_client_ip request\n\n respond_to do |format|\n if @reply.save\n post = @reply.post\n post.replies_count += 1\n post.replied_at = @reply.created_at\n post.save\n post.move_to_top\n create_activity current_user.id, \"Reply\", @reply.id\n flash[:notice] = 'Reply was successfully created.'\n format.html { redirect_to topic_post_replies_path(topic_id, post_id) }\n format.xml { render :xml => @reply, :status => :created, :location => @reply }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reply.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcd675937abfaf8115aa7565b7caf998",
"score": "0.47078404",
"text": "def create\n @promotion = current_shop_owner.promotions.new(promotion_params.merge(customer_ids: customer_ids))\n\n # @promotion.translate(@promotion.body)\n\n# make notes that belong to the current shop owner\n respond_to do |format|\n if @promotion.save\n format.html { redirect_to shop_owner_promotion_path(current_shop_owner,@promotion), notice: 'Promotion was successfully created.' }\n # send_text.promotion\n format.json { render :show, status: :created, location: @promotion }\n else\n format.html { render :new }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff7b7d42481a4a7f583cd968567096a6",
"score": "0.47009218",
"text": "def upload\n @mote = mote.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mote }\n end\n end",
"title": ""
},
{
"docid": "8dbb236836b5b3d3d233f0599b7160aa",
"score": "0.46993405",
"text": "def fb_comments(xid,canpost=true,candelete=false,numposts=5,options={})\n\t\t\t options = options.dup\n title = (title = options.delete(:title)) ? fb_title(title) : nil \n\t\t\t content_tag \"fb:comments\",title,stringify_vals(options.merge(:xid=>xid,:canpost=>canpost.to_s,:candelete=>candelete.to_s,:numposts=>numposts))\n\t\t\tend",
"title": ""
}
] |
e561e11bcf379ef5dc139c210017366b
|
Only allow a list of trusted parameters through.
|
[
{
"docid": "f90f99f3cc2cd17ad1056f9f6c098b68",
"score": "0.0",
"text": "def admin_club_params\n params.fetch(:admin_club, {}).permit(:name, :logo, :banner)\n end",
"title": ""
}
] |
[
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.69497335",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6812623",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7ac5f60df8240f27d24d1e305f0e5acb",
"score": "0.6803639",
"text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6795365",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.67448795",
"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": "e164094e79744552ae1c53246ce8a56c",
"score": "0.67399913",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.6526815",
"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": "1677b416ad07c203256985063859691b",
"score": "0.6518771",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "7a24fee4eabdabf0eae6fc4a9442b5d4",
"score": "0.64931697",
"text": "def whitelisted_args\n args.select &:allowed\n end",
"title": ""
},
{
"docid": "89821ecc64d69b0e108ff0205d42848d",
"score": "0.6430388",
"text": "def safe_list_sanitizer; end",
"title": ""
},
{
"docid": "89821ecc64d69b0e108ff0205d42848d",
"score": "0.6430388",
"text": "def safe_list_sanitizer; end",
"title": ""
},
{
"docid": "89821ecc64d69b0e108ff0205d42848d",
"score": "0.6430388",
"text": "def safe_list_sanitizer; end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.63983387",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "21b124098cb3c128802e22b776b3f0ec",
"score": "0.6356042",
"text": "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.63535863",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.63464934",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "9f3b62fe05ad1542504f6ef13056ac4e",
"score": "0.63444513",
"text": "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.6337208",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "ecb9b1c8e860f69081e55e2f9432197e",
"score": "0.6326454",
"text": "def safe_list_sanitizer=(_arg0); end",
"title": ""
},
{
"docid": "ecb9b1c8e860f69081e55e2f9432197e",
"score": "0.6326454",
"text": "def safe_list_sanitizer=(_arg0); end",
"title": ""
},
{
"docid": "ecb9b1c8e860f69081e55e2f9432197e",
"score": "0.6326454",
"text": "def safe_list_sanitizer=(_arg0); end",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.63140553",
"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": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.6299814",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.62642586",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.626006",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.62578833",
"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": "0e757d0df3a64e9e53edcc2ec32e976f",
"score": "0.6236823",
"text": "def allowed?(*_)\n true\n end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.6227561",
"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": "aabfd0cce84d7f71b1ccd2df6a6af7c3",
"score": "0.6221758",
"text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"title": ""
},
{
"docid": "d06d4a4f5db50f0e92ab46e724235bf9",
"score": "0.62200165",
"text": "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.620879",
"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": "e291b3969196368dd4f7080a354ebb08",
"score": "0.61983657",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.6195055",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d17287b48784257580d7e0971173c983",
"score": "0.6172993",
"text": "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6156856",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.61558664",
"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": "014122b5717338df29c0e4d5adba899e",
"score": "0.61521494",
"text": "def url_allowlist=(_arg0); end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6135789",
"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": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.6121145",
"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": "2b19f8222e09c2518b0d19b4bf1f69d3",
"score": "0.61118174",
"text": "def list_params\n params.permit(:list_name)\n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.60736513",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.6071645",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "64a51034b538cd75dee66f5200107c1f",
"score": "0.60632104",
"text": "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end",
"title": ""
},
{
"docid": "030323bf4ecb827028514f0ceb36cb9b",
"score": "0.60549796",
"text": "def safelists; end",
"title": ""
},
{
"docid": "4c4d28432d3282cbb227f3039cf94caf",
"score": "0.6043906",
"text": "def authorize_own_lists\n authorize_lists current_user.lists\n end",
"title": ""
},
{
"docid": "bc65ba6d2f3ef5cb8923d613e49b8274",
"score": "0.6034662",
"text": "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end",
"title": ""
},
{
"docid": "44ade9754ddcdac40382d0923cd63048",
"score": "0.60207325",
"text": "def lists_params\n params.require(:list).permit(:name)\n\n end",
"title": ""
},
{
"docid": "39096b2b2caa0b5a8223deec5f5b0f9f",
"score": "0.6018568",
"text": "def list_params\n params.require(:list).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "e3b7e73d151796bb56ed85e0f3116fa9",
"score": "0.6016575",
"text": "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.60103434",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "c341544076effe9e0db47fa6752829ff",
"score": "0.60084206",
"text": "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end",
"title": ""
},
{
"docid": "b7a657010a7f394737d8c2d719a06993",
"score": "0.600763",
"text": "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend",
"title": ""
},
{
"docid": "66334278044b7f2b0463ae63d80ca602",
"score": "0.6007443",
"text": "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.6003619",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.6003619",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "6bc2c20d55fe920f0edd90f300d70955",
"score": "0.5995791",
"text": "def whitelist; end",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5993301",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "ad2d2efdf4826b61db96adbdcdb0135b",
"score": "0.5993231",
"text": "def list_params\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.5984926",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "09ccbed54e2a0b8847b53b642b40efb5",
"score": "0.597122",
"text": "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end",
"title": ""
},
{
"docid": "93783c9b6c03c3bd41f75234b31911f8",
"score": "0.5968121",
"text": "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end",
"title": ""
},
{
"docid": "54e04b941ee9071107179fe993e57c26",
"score": "0.5965808",
"text": "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "29eec3df393336ba76ae5f63ed9b4858",
"score": "0.59640145",
"text": "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"title": ""
},
{
"docid": "3697f53f660a77b18ff5af51bcf1ca8d",
"score": "0.59632224",
"text": "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.59602356",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "ab49b0baeea5bf6f204adca9e864094e",
"score": "0.59332967",
"text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.5927556",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.5922805",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "31fc4d8ac77808ea64c22b8bff20997d",
"score": "0.5909745",
"text": "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end",
"title": ""
},
{
"docid": "1791be75c23b0ab94b8d566561cf903e",
"score": "0.5905083",
"text": "def params(list)\n @declared_params = list\n end",
"title": ""
},
{
"docid": "4658b5ebaf35abb1b89c071aed7e018c",
"score": "0.5904304",
"text": "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end",
"title": ""
},
{
"docid": "ca90e8f0ec041d26b42d00aa2cbda1e5",
"score": "0.5893434",
"text": "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end",
"title": ""
},
{
"docid": "043c7c33fa58658709ce0014319e7aec",
"score": "0.58888215",
"text": "def allow(ids); end",
"title": ""
},
{
"docid": "34c6b2119736eea4b71998dec50f5f1a",
"score": "0.58823985",
"text": "def list_params\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "34c6b2119736eea4b71998dec50f5f1a",
"score": "0.58823985",
"text": "def list_params\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "34c6b2119736eea4b71998dec50f5f1a",
"score": "0.58823985",
"text": "def list_params\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "e310f8ae001392da6281c299a2572677",
"score": "0.5873434",
"text": "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end",
"title": ""
},
{
"docid": "4d77abbae6d3557081c88dad60c735d0",
"score": "0.58619875",
"text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"title": ""
},
{
"docid": "37656a050c4e4765c2ea464cd3d4e764",
"score": "0.58533794",
"text": "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end",
"title": ""
},
{
"docid": "102e96b584d087beda32598a28a382f5",
"score": "0.5845531",
"text": "def list_params\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "7befdf5d03aadb61b4c6e74ed07cd447",
"score": "0.58426666",
"text": "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end",
"title": ""
},
{
"docid": "2554d771097b60c5d766de7d29c2dfe5",
"score": "0.58360124",
"text": "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end",
"title": ""
},
{
"docid": "43f8788590c98e3b2ddf0bd6c62b24c8",
"score": "0.583218",
"text": "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end",
"title": ""
},
{
"docid": "81d27d51beb59227f68929587fe9a1be",
"score": "0.5828041",
"text": "def safelist; end",
"title": ""
},
{
"docid": "d6bf948034a6c8adc660df172dd7ec6e",
"score": "0.5827927",
"text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"title": ""
},
{
"docid": "68815c1979e028984e7c2d5abadc2552",
"score": "0.5816121",
"text": "def valid_for_params_auth?; end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.5814705",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.5812719",
"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": "d4c0e2d7913e01bfa09b10bbeb5341ac",
"score": "0.581121",
"text": "def shopping_list_params\n params.require(:shopping_list).permit!\n end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.5803423",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.5803423",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.57995003",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "7c51a57439a63c303a45aca2ac638401",
"score": "0.5794207",
"text": "def permitters\n @_parametrizr_permitters || {}\n end",
"title": ""
},
{
"docid": "c8d1b09827dbe3a963c60c741dc68594",
"score": "0.5784923",
"text": "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end",
"title": ""
},
{
"docid": "0cbc6ed0eac413e6d26c1e1418b6c62e",
"score": "0.5781365",
"text": "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end",
"title": ""
},
{
"docid": "7a108e48bed2cdf492c12286b1c59903",
"score": "0.5776385",
"text": "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end",
"title": ""
},
{
"docid": "572ddb6fcaa0b57a2624259cc183bdb0",
"score": "0.5774859",
"text": "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end",
"title": ""
},
{
"docid": "09edac0c32ae61b998679363610353e6",
"score": "0.57671493",
"text": "def url_allowlist; end",
"title": ""
},
{
"docid": "0b6129d775136b0d6037453613f331dd",
"score": "0.5766998",
"text": "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end",
"title": ""
},
{
"docid": "2be6c6279f55d8b4842688b8f3cc75f1",
"score": "0.57618684",
"text": "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.5758038",
"text": "def quote_params\n params.permit!\n end",
"title": ""
}
] |
94eb17409eebbe30b23bf9c03df2c505
|
Method to draw the arrows of directed glyphs. Not to be used directly, but called by Featuredraw.
|
[
{
"docid": "638ab70ba15135b5eb5967432d19ab55",
"score": "0.615012",
"text": "def open_arrow(feature_context,direction,x,y,size)\n case direction\n when :right\n feature_context.move_to(x,y)\n feature_context.rel_line_to(size,size)\n feature_context.rel_line_to(-size,size)\n feature_context.stroke\n when :left\n feature_context.move_to(x,y)\n feature_context.rel_line_to(-size,size)\n feature_context.rel_line_to(size,size)\n feature_context.stroke\n when :north\n feature_context.move_to(x-size,y+size)\n feature_context.rel_line_to(size,-size)\n feature_context.rel_line_to(size,size)\n feature_context.stroke\n when :south\n feature_context.move_to(x-size,y-size)\n feature_context.rel_line_to(size,size)\n feature_context.rel_line_to(size,-size)\n feature_context.stroke\n end\n end",
"title": ""
}
] |
[
{
"docid": "43782827078927f13cc46e111c618c3b",
"score": "0.6955929",
"text": "def drawarrow(*)\n super\n end",
"title": ""
},
{
"docid": "ac2bb55087bd2e7466c1008d5e258bf9",
"score": "0.64464283",
"text": "def draw_force_arrow(context, start, finish)\n arrow_size = 50\n\n # Get vector\n dx = finish.x - start.x\n dy = finish.y - start.y\n\n combined = dx.abs + dy.abs\n length = Math.hypot(dx, dy)\n if length < arrow_size\n length = arrow_size\n dx = length * (dx/combined)\n dy = length * (dy/combined)\n end\n\n # Creates points for arrow\n arrow_points = []\n arrow_points << CGPointMake(0, -5) << CGPointMake(length - arrow_size, -5) << CGPointMake(length - arrow_size, -40)\n arrow_points << CGPointMake(length, 0)\n arrow_points << CGPointMake(length - arrow_size, 40) << CGPointMake(length - arrow_size, 5) << CGPointMake(0, 5)\n\n cosine = dx / length\n sine = dy / length\n\n arrow_transform_pointer = Pointer.new(CGAffineTransform.type)\n arrow_transform_pointer[0] = CGAffineTransform.new(cosine, sine, -sine, cosine, start.x, start.y)\n\n path = CGPathCreateMutable()\n CGPathMoveToPoint(path, arrow_transform_pointer, 0, 0)\n arrow_points.each do |point|\n CGPathAddLineToPoint(path, arrow_transform_pointer, point.x, point.y)\n end\n CGContextAddPath(context, path)\n CGContextSetFillColorWithColor(context, UIColor.redColor.CGColor)\n CGContextDrawPath(context, KCGPathFill)\n end",
"title": ""
},
{
"docid": "b5d7b2db1fd52d0887500c6e84848b7a",
"score": "0.6238934",
"text": "def arrow(feature_context,direction,x,y,size)\n case direction\n when :right\n feature_context.move_to(x,y)\n feature_context.rel_line_to(size,size)\n feature_context.rel_line_to(-size,size)\n feature_context.close_path.fill\n when :left\n feature_context.move_to(x,y)\n feature_context.rel_line_to(-size,size)\n feature_context.rel_line_to(size,size)\n feature_context.close_path.fill\n when :north\n feature_context.move_to(x-size,y+size)\n feature_context.rel_line_to(size,-size)\n feature_context.rel_line_to(size,size)\n feature_context.close_path.fill\n when :south\n feature_context.move_to(x-size,y-size)\n feature_context.rel_line_to(size,size)\n feature_context.rel_line_to(size,-size)\n feature_context.close_path.fill\n end\n end",
"title": ""
},
{
"docid": "e117fc7faceb86422bbb24210b1bae58",
"score": "0.62319505",
"text": "def arrow(source, dest, text, is_dotted = false,\n source_new_state = :none, dest_new_state = :none)\n\n @timelines.push(source) if ! @timelines.include?(source)\n @timelines.push(dest) if ! @timelines.include?(dest)\n \n @arrows.push({ :source => @timelines.index(source),\n :dest => @timelines.index(dest),\n :text => text, :dotted? => is_dotted,\n :source_new_state => source_new_state,\n :dest_new_state => dest_new_state })\n end",
"title": ""
},
{
"docid": "6e9ec54526dad9209731d8ac364b7b72",
"score": "0.6164456",
"text": "def draw_edge\n print \"|\"\n end",
"title": ""
},
{
"docid": "5d49c90195f3912562b77f0b70aebc6c",
"score": "0.6038332",
"text": "def draw_arrow_x(x, y, length, arrow_colour, arrow_width, arrow_text)\r\n case \r\n when length < 0\r\n line(x, y, x+length, y, :stroke=>arrow_colour, \"stroke-width\"=>arrow_width)\r\n polyline([[x+length+10, y-5], [x+length, y], [x+length+10, y+5]],\r\n :stroke=>arrow_colour, \"stroke-width\"=>arrow_width, :fill=>arrow_colour)\r\n \r\n write(x+length/2, y-10, arrow_text, arrow_colour, \"middle\")\r\n \r\n when length > 0\r\n line(x, y, x+length, y, :stroke=>arrow_colour, \"stroke-width\"=>arrow_width)\r\n polyline([[x+length-10, y-5], [x+length, y], [x+length-10, y+5]],\r\n :stroke=>arrow_colour, \"stroke-width\"=>arrow_width, :fill=>arrow_colour)\r\n \r\n write(x+length/2, y-10, arrow_text, arrow_colour, \"middle\")\r\n \r\n when length == 0\r\n end\r\n end",
"title": ""
},
{
"docid": "323de77f2ba16302274ac21d060110da",
"score": "0.603234",
"text": "def drawArrow _obj, _args\n \"_obj drawArrow _args;\" \n end",
"title": ""
},
{
"docid": "165637202e3e85cf7e6febe53d505805",
"score": "0.5989492",
"text": "def update_arrow\n return unless @arrow&.visible\n return if Graphics.frame_count % 15 != 0\n @arrow.x += @arrow_direction\n @arrow_direction = 1 if @arrow.x <= 127\n @arrow_direction = -1 if @arrow.x >= 129\n end",
"title": ""
},
{
"docid": "e01ca90ad736b73e51993048c3ff0c8f",
"score": "0.5908814",
"text": "def update_arrows(current_pages)\n @dx = 0\n self.ox = 0\n offset = standard_padding * 4\n @cw = @ori_contents_width\n lv = true if @page_index > 0\n rv = current_pages[(@page_index + 1) * line_max].nil? ? false : true\n if lv # show left arrow\n @cw += offset\n @dx = offset\n self.ox = offset\n end\n @cw += offset if rv # show right arrow\n create_contents\n end",
"title": ""
},
{
"docid": "7a528fc73456ac76e77b1c9d1e3a82e9",
"score": "0.5882335",
"text": "def create_arrows\n bx, by = 80, 16\n bw, bh = 8, 16\n 2.times do |i|\n sprite = Sprite.new(@viewport2)\n sprite.bitmap = Bitmap.new(bw, bh)\n sx = (i == 0 ? bx : (bx + bw + bh)) # 0 for left, 1 for right arrow\n rect = Rect.new(sx, by + bw, bw, bh)\n sprite.bitmap.blt(0, 0, self.windowskin, rect)\n sprite.y = self.y + (window_height - bh) - spacing * 4 \n sprite.x = i == 0 ? self.x + 2 : self.x + window_width - bw\n @arrow_sprites.push(sprite.hide)\n end\n end",
"title": ""
},
{
"docid": "6f610d964f86b188f3f3e267d02e3451",
"score": "0.5777744",
"text": "def create_arrow\n @arrow = @stack.add_sprite(127, 0, 'arrow')\n end",
"title": ""
},
{
"docid": "c882f90f2099b4f34468c8f934819dc3",
"score": "0.5739936",
"text": "def draw_paths; end",
"title": ""
},
{
"docid": "87168496b2f1d853be000de0af333286",
"score": "0.57291925",
"text": "def arrowSetup(c)\n v = $demo_arrowInfo\n\n # Remember the current box, if there is one.\n tags = c.gettags('current')\n if tags != []\n cur = tags.find{|t| t.kind_of?(String) && t =~ /^box[1-3]$/ }\n else\n cur = nil\n end\n\n # Create the arrow and outline.\n c.delete('all')\n TkcLine.new(c, v.x1, v.y, v.x2, v.y,\n { 'width'=>10 * v.width,\n 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c],\n 'arrow'=>'last'\n }.update(v.bigLineStyle) )\n xtip = v.x2 - 10*v.b\n deltaY = 10*v.c + 5*v.width\n TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY,\n v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y,\n 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round')\n\n # Create the boxes for reshaping the line and arrowhead.\n TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5,\n {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) )\n TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5,\n {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) )\n TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5,\n {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) )\n c.itemconfigure cur, v.activeStyle if cur\n\n # Create three arrows in actual size with the same parameters\n TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2)\n tmp = v.x2+100\n TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width,\n 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])\n TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width,\n 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])\n TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width,\n 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])\n\n # Create a bunch of other arrows and text items showing the\n # current dimensions.\n tmp = v.x2+10\n TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY,\n 'arrow'=>'both', 'arrowshape'=>v.smallTips)\n TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w')\n tmp = v.x1-10\n TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width,\n 'arrow'=>'both', 'arrowshape'=>v.smallTips)\n TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e')\n tmp = v.y+5*v.width+10*v.c+10\n TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp,\n 'arrow'=>'both', 'arrowshape'=>v.smallTips)\n TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n')\n tmp = tmp+25\n TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp,\n 'arrow'=>'both', 'arrowshape'=>v.smallTips)\n TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n')\n\n if $tk_version =~ /^4.*/\n TkcText.new(c, v.x1, 310, 'text'=>\"'width'=>#{v.width}\", 'anchor'=>'w',\n 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')\n TkcText.new(c, v.x1, 330,\n 'text'=>\"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]\",'anchor'=>'w',\n 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')\n else\n TkcText.new(c, v.x1, 310, 'text'=>\"'width'=>#{v.width}\", 'anchor'=>'w',\n 'font'=>'Helvetica 18')\n TkcText.new(c, v.x1, 330,\n 'text'=>\"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]\",\n 'anchor'=>'w', 'font'=>'Helvetica 18')\n end\n\n v.count += 1\nend",
"title": ""
},
{
"docid": "ad67a4c328e2ffc6e79aa748e583bdca",
"score": "0.556548",
"text": "def draw_alt_line\n @dim.times do |i|\n if i.even?\n print draw_x\n else\n if @type == \"allx\"\n print draw_x\n elsif @type == \"alt\"\n print draw_dot\n end\n end\n end\n end",
"title": ""
},
{
"docid": "55be1c52a5af0458c3824ab169c46b23",
"score": "0.54705954",
"text": "def draw_arrow_y(x, y, length, arrow_colour, arrow_width, arrow_text)\r\n case \r\n when length < 0\r\n line(x, y, x, y-length, :stroke=>arrow_colour, \"stroke-width\"=>arrow_width)\r\n polyline([[x-5, y-length-10], [x, y-length], [x+5, y-length-10]],\r\n :stroke=>arrow_colour, \"stroke-width\"=>arrow_width, :fill=>arrow_colour)\r\n \r\n write(x+10, y-length/2, arrow_text, arrow_colour, \"start\")\r\n \r\n when length > 0\r\n line(x, y, x, y-length, :stroke=>arrow_colour, \"stroke-width\"=>arrow_width)\r\n polyline([[x-5, y-length+10], [x, y-length], [x+5, y-length+10]],\r\n :stroke=>arrow_colour, \"stroke-width\"=>arrow_width, :fill=>arrow_colour)\r\n \r\n write(x+10, y-length/2, arrow_text, arrow_colour, \"start\")\r\n \r\n when length == 0\r\n end\r\n end",
"title": ""
},
{
"docid": "8ae846f73ebc6a380cf27983430bbadd",
"score": "0.54700977",
"text": "def on_arrows\n Document.on(\"keyup\") do |e|\n case e.which\n when 37 # left\n goto_link(\"prev\")\n when 39 # right\n goto_link(\"next\")\n else\n # puts \"something else pressed #{e.which}\"\n end\n end\n end",
"title": ""
},
{
"docid": "efdd385861a4cf68f4fc31312f7345a5",
"score": "0.53638166",
"text": "def straight\n @line_type = '--'\n self\n end",
"title": ""
},
{
"docid": "eca49a9b2e4865d4ccc35d32fab6e24b",
"score": "0.534065",
"text": "def arrow_bitmap(d)\n #==========================================================================\n # Here we check what page we're on. If we're past the first page we'll\n # give the left arrow the windowskin so that it will be visible, and if\n # we're not on the last page we'll give it to the right arrow.\n #==========================================================================\n self.windowskin if (@page < max_pages && d == :r) || (@page > 1 && d == :l)\n end",
"title": ""
},
{
"docid": "18cbd592342ef44092865ddedcbc5489",
"score": "0.5321498",
"text": "def draw_lines\n @dim.times do |i|\n if @type.nil?\n draw_line(i+1)\n draw_edge\n puts\n elsif @type == \"allx\" || @type == \"alt\"\n draw_alt_line\n draw_edge\n puts\n end\n end\n end",
"title": ""
},
{
"docid": "df38cf38e3e99d536f0d25b511b3b800",
"score": "0.5284379",
"text": "def printArrow(direction, columns)\n col = columns-1\n \n if direction == \"left\" then\n range_to_right = 0..col\n col-=1\n range_to_left = col.downto(0) \n else\n range_to_right = col.downto(0)\n range_to_left = 1..col \n end\n \n range_to_right.each do |i|\n spaces = \" \" * i\n puts spaces + \"*\"\n end\n range_to_left.each do |i|\n spaces = \" \" * i\n puts spaces + \"*\"\n end\n\nend",
"title": ""
},
{
"docid": "6af493e58f876bb3635042ffb1bca14f",
"score": "0.5227438",
"text": "def draw_edge(anIO, aDependency)\n source_id = feature_files.find_index(aDependency.dependee)\n target_ids = aDependency.dependents.map do |a_target|\n feature_files.find_index(a_target)\n end\n\n target_ids.each do |t_id|\n anIO.puts \"\\tnode_#{source_id} -> node_#{t_id};\"\n end\n end",
"title": ""
},
{
"docid": "8ff4e4197c96ec40e299d40a3d489709",
"score": "0.51874614",
"text": "def render_to_step_barb(calm=false)\n\t\tstroke ARROW_STROKE_COLOR\n\t\tstroke_weight ARROW_STROKE_WEIGHT\n\t\t\n\t\t# Initial trig calculations for the arrow head\n\t\tadj = @to_barb.pos.x - @from_barb.pos.x\n\t\topp = @to_barb.pos.y - @from_barb.pos.y\n\t\tangle = Math.atan(opp/adj)\n\t\t\n\t\tif adj>0 and opp<0.001 and opp>-0.001\n\t\t\tline_from = Point.new(@from_barb.pos.x+OFFSET_LENGTH, @from_barb.pos.y)\n\t\t\tline_to = Point.new(@to_barb.pos.x-OFFSET_LENGTH, @to_barb.pos.y)\n\t\telsif adj<0 and opp<0.001 and opp>-0.001\n\t\t\tline_from = Point.new(@from_barb.pos.x-OFFSET_LENGTH, @from_barb.pos.y)\n\t\t\tline_to = Point.new(@to_barb.pos.x+OFFSET_LENGTH, @to_barb.pos.y)\n\t\telsif adj<0.001 and adj>-0.001 and opp<0\n\t\t\tline_from = Point.new(@from_barb.pos.x, @from_barb.pos.y-OFFSET_LENGTH)\n\t\t\tline_to = Point.new(@to_barb.pos.x, @to_barb.pos.y+OFFSET_LENGTH)\n\t\telsif adj<0.001 and adj>-0.001 and opp>0\n\t\t\tline_from = Point.new(@from_barb.pos.x, @from_barb.pos.y+OFFSET_LENGTH)\n\t\t\tline_to = Point.new(@to_barb.pos.x, @to_barb.pos.y-OFFSET_LENGTH)\n\t\telsif adj>0 and opp<0\n\t\t\tline_from = Point.new(@from_barb.pos.x+OFFSET_LENGTH*(Math.cos(angle)).abs, @from_barb.pos.y-OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\t\tline_to = Point.new(@to_barb.pos.x-OFFSET_LENGTH*(Math.cos(angle)).abs, @to_barb.pos.y+OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\telsif adj<0 and opp<0\n\t\t\tline_from = Point.new(@from_barb.pos.x-OFFSET_LENGTH*Math.cos(angle), @from_barb.pos.y-OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\t\tline_to = Point.new(@to_barb.pos.x+OFFSET_LENGTH*Math.cos(angle), @to_barb.pos.y+OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\telsif adj<0 and opp>0\n\t\t\tline_from = Point.new(@from_barb.pos.x-OFFSET_LENGTH*Math.cos(angle), @from_barb.pos.y+OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\t\tline_to = Point.new(@to_barb.pos.x+OFFSET_LENGTH*Math.cos(angle), @to_barb.pos.y-OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\telsif adj>0 and opp>0\n\t\t\tline_from = Point.new(@from_barb.pos.x+OFFSET_LENGTH*Math.cos(angle), @from_barb.pos.y+OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\t\tline_to = Point.new(@to_barb.pos.x-OFFSET_LENGTH*Math.cos(angle), @to_barb.pos.y-OFFSET_LENGTH*(Math.sin(angle)).abs)\n\t\telse\n\t\t\tputs \"default arrow\"\n\t\t\tline_from = @from_barb.pos\n\t\t\tline_to = @to_barb.pos\n\t\tend\n\t\t\n\t\t# Draw a line from one point to the next.\n\t\tline line_from.x, line_from.y, line_to.x, line_to.y\n\t\t\n\t\t# Draw the arrow head\n\t\tif !calm\n\t\t\tpush_matrix\n\t\t\ttranslate line_to.x, line_to.y\n\t\t\trotate calculate_rotation(adj, opp, angle)\n\t\t\tline 0, 0, ARROW_WIDTH, -ARROW_HEIGHT\n\t\t\tline 0, 0, -ARROW_WIDTH, -ARROW_HEIGHT\n\t\t\tpop_matrix\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3e3c71fec57f5a8831da0bde73a1d221",
"score": "0.5131681",
"text": "def setarrowstyle(*)\n super\n end",
"title": ""
},
{
"docid": "9e9db4af5012ee18ee1cdc9b30a26899",
"score": "0.51315856",
"text": "def draw_horizontal(line, start_char, end_char)\n start_char.upto(end_char) { |char_idx| @lines[line][char_idx] = PATH_CHAR } \n end",
"title": ""
},
{
"docid": "fd2bd8bb5f6c74aacb8ffca63f5d8ea2",
"score": "0.51189506",
"text": "def bind_arrow_keys()\r\n bind_arrow_keys_internal(@emacs_standard_keymap)\r\n bind_arrow_keys_internal(@vi_movement_keymap)\r\n bind_arrow_keys_internal(@vi_insertion_keymap)\r\n end",
"title": ""
},
{
"docid": "eb91b43e7dd34b7893b7dbf2a43bd1b0",
"score": "0.51056725",
"text": "def draw_vector(v, loc, scayl)\n push_matrix\n arrowsize = 4\n # Translate to location to render vector\n translate(loc.x, loc.y)\n stroke(255)\n # Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate\n rotate(v.heading2D)\n # Calculate length of vector & scale it to be bigger or smaller if necessary\n len = v.mag * scayl\n # Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)\n line(0, 0, len, 0)\n line(len, 0, len-arrowsize, +arrowsize/2)\n line(len, 0, len-arrowsize, -arrowsize/2)\n pop_matrix\nend",
"title": ""
},
{
"docid": "beb98578ea490b9b97d606bbb65e45bb",
"score": "0.5093663",
"text": "def drawBusArrow(theRoute, point, direction, reported, locator, projection, cgContext)\n # puts \"drawBusArrow at #{point.inspect} #{direction}\"\n scale = [0.5, (4-(19-projection.zoomLevel)/2)/4.0].max\n icon = locator.direction(direction).scale_by(scale)\n x = point.x - icon.hotspot.x/projection.zoomscale\n y = point.y - icon.hotspot.y/projection.zoomscale\n imageRect = CGRectMake(x, y, icon.image.size.width/projection.zoomscale, icon.image.size.height/projection.zoomscale)\n # puts \"drawBusArrow #{projection.zoomscale} at #{point.inspect} #{direction} into #{printRect imageRect} #{printmRect mapRectForRect(iageRect)}\"\n CGContextDrawImage(cgContext, imageRect, icon.image.cgimage)\n imageRect\n end",
"title": ""
},
{
"docid": "840cbbde6fdf1bdd80075781970f58f2",
"score": "0.5075739",
"text": "def draw_arrow( image, point, params={} )\n arrow = Magick::Draw.new\n stroke_width = params[:stroke_width] || 2.5\n\n # set colour and thickness of arrow\n arrow.stroke( \"black\" )\n arrow.stroke_width(stroke_width)\n\n # make the value of \"point\" the center (origin)\n arrow.translate( point.first, point.last )\n\n # rotate based on the direction\n params[:direction] = \"south\" unless params[:direction]\n case params[:direction]\n when \"north\" then arrow.rotate( 0)\n when \"east\" then arrow.rotate( 90)\n when \"south\" then arrow.rotate(180)\n when \"west\" then arrow.rotate(270)\n else raise \"Not a valid direction: #{params[:direction]}\"\n end\n\n # set the arrow dimensions\n params[:tail_height] = 0.100 * image.rows unless params[:tail_height]\n params[:arm_height] = 0.050 * image.rows unless params[:arm_height]\n params[:arm_width] = 0.025 * image.columns unless params[:arm_width]\n\n # draw the arrow\n # We are always drawing a south-facing arrow, the \"direction\"\n # takes care of rotating it to point in the right ... direction\n arrow.line( 0, params[:tail_height], 0, 0 ) # line going down\n arrow.line( params[:arm_width], params[:arm_height], 0, 0 ) # line from the right\n arrow.line( -params[:arm_width], params[:arm_height], 0, 0 ) # line from the left\n arrow.draw( image )\n\n return image\n end",
"title": ""
},
{
"docid": "6395bb899badea7d7200bc96e4f49069",
"score": "0.50752455",
"text": "def draw(graph, options = {})\n node = graph.add_nodes(name ? name.to_s : 'nil',\n label: description(options),\n width: '1',\n height: '1',\n shape: final? ? 'doublecircle' : 'ellipse')\n\n # Add open arrow for initial state\n graph.add_edges(graph.add_nodes('starting_state', shape: 'point'), node) if initial?\n\n true\n end",
"title": ""
},
{
"docid": "57d7bbc7356ced257c3358b8903f2b93",
"score": "0.5070515",
"text": "def home_arrows meth, start, total\n nex = total > start + 5\n if start > 0\n @gbs[0] = glossb \"<<\", left: 400, top: 50, width:50, height: 30, margin: [13, 5] do\n @slot.append do\n @homepane.clear { send(meth, start - 5) }\n flush\n end\n end\n end\n if nex\n @gbs[1] = glossb \"Next 5 >>\", left: 470, top: 50, width:100, height: 30, margin: [10, 5] do\n @slot.append do\n @homepane.clear { send(meth, start + 5) }\n flush\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9f2d0adc9c8990b077c0543cd840900c",
"score": "0.5068729",
"text": "def update_arrows(index)\n @arrows[index].x = @arrows[index].actor.actual_x\n @arrows[index].y = @arrows[index].actor.actual_y\n end",
"title": ""
},
{
"docid": "03cee5f464b3cc8188ec9855ccafed11",
"score": "0.5064481",
"text": "def dispose_arrows\n @arrow_path.each{|a| a.dispose}\n @arrow_path = []\n @passed_positions = []\n end",
"title": ""
},
{
"docid": "2838eaddb3c3d29e7b982bc2914376c5",
"score": "0.50301456",
"text": "def draw_rotate_circle_arrow(context,center, length, angle, clockwise)\n\n arrow_points = []\n if not clockwise\n arrow_points << CGPointMake(- 40, 0) << CGPointMake(0, -50)\n arrow_points << CGPointMake(40, 0)\n else\n arrow_points << CGPointMake(- 40, 0) << CGPointMake(0, 50)\n arrow_points << CGPointMake(40, 0)\n end\n\n arrow_transform_pointer = Pointer.new(CGAffineTransform.type)\n arrow_transform_pointer[0] = CGAffineTransformMakeTranslation( center.x, center.y)\n arrow_transform_pointer[0] = CGAffineTransformRotate(arrow_transform_pointer[0], angle)\n arrow_transform_pointer[0] = CGAffineTransformTranslate(arrow_transform_pointer[0],length, 0)\n\n path = CGPathCreateMutable()\n CGPathMoveToPoint(path, arrow_transform_pointer, length, 0)\n\n arrow_points.each do |point|\n CGPathAddLineToPoint(path, arrow_transform_pointer, point.x, point.y)\n end\n CGContextAddPath(context, path)\n CGContextSetFillColorWithColor(context, UIColor.redColor.CGColor)\n CGContextDrawPath(context, KCGPathFill)\n end",
"title": ""
},
{
"docid": "91b56aa708e2e2715c95234576e3d623",
"score": "0.5003861",
"text": "def update_arrows(index)\n @arrows[index].x = @arrows[index].enemy.actual_x\n @arrows[index].y = @arrows[index].enemy.actual_y\n end",
"title": ""
},
{
"docid": "4213668bec04c4aa6c789b378a574b0c",
"score": "0.49937257",
"text": "def draw_arrow(from_locator, to_locator)\n id = random_id\n\n execute_script(%(\n var element1 = arguments[0];\n var element2 = arguments[1];\n var rect1 = element1.getBoundingClientRect();\n var rect2 = element2.getBoundingClientRect();\n var from = {y: rect1.top};\n var to = {y: rect2.top};\n if (rect1.left > rect2.left) {\n from.x = rect1.left; to.x = rect2.right;\n } else if (rect1.left < rect2.left) {\n from.x = rect1.right; to.x = rect2.left;\n } else {\n from.x = rect1.left; to.x = rect2.left;\n }\n // create canvas\n var canvas = document.createElement('canvas');\n canvas.id = \"#{id}\";\n canvas.style.left = \"0px\";\n canvas.style.top = \"0px\";\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n canvas.style.zIndex = '100000';\n canvas.style.position = \"absolute\";\n document.body.appendChild(canvas);\n var headlen = 10;\n var angle = Math.atan2(to.y - from.y, to.x - from.x);\n var ctx = canvas.getContext(\"2d\");\n // line\n ctx.beginPath();\n ctx.moveTo(from.x, from.y);\n ctx.lineTo(to.x, to.y);\n ctx.lineWidth = 3;\n ctx.strokeStyle = '#f00';\n ctx.stroke();\n // arrow\n ctx.beginPath();\n ctx.moveTo(to.x, to.y);\n ctx.lineTo(\n to.x - headlen * Math.cos(angle - Math.PI/7),\n to.y - headlen * Math.sin(angle - Math.PI/7)\n );\n ctx.lineTo(\n to.x - headlen * Math.cos(angle + Math.PI/7),\n to.y - headlen * Math.sin(angle + Math.PI/7)\n );\n ctx.lineTo(to.x, to.y);\n ctx.lineTo(\n to.x - headlen * Math.cos(angle - Math.PI/7),\n to.y - headlen * Math.sin(angle - Math.PI/7)\n );\n ctx.lineWidth = 3;\n ctx.strokeStyle = '#f00';\n ctx.stroke();\n return;\n ), find_element(from_locator), find_element(to_locator))\n\n find_element(\"id=#{id}\")\n end",
"title": ""
},
{
"docid": "d0db0203fe0d05b557036880c262acfe",
"score": "0.49438417",
"text": "def edge_label(v)\n r = t.rest(v)\n x = (@coords[r[1]][0] - @coords[r[0]][0]) / 2 + @coords[r[0]][0]\n y = (@coords[r[1]][1] - @coords[r[0]][1]) / 2 + @coords[r[0]][1]\n \n v2 = NEXT_VARIABLE[v]\n angle = CosSinCalc::Triangle::Formatter.convert_angle(angle_to_x(v2) + t.angle(v2), :degree, true)\n text = \"#{v} = #{f.side(v)}\"\n \n if angle < 90 && angle > -90\n label(x, y - FONT_SIZE, text, %[transform=\"rotate(#{-angle} #{x},#{y})\"])\n else\n label(x, y + FONT_SIZE, text, %[transform=\"rotate(#{180 - angle}, #{x},#{y})\"])\n end\n end",
"title": ""
},
{
"docid": "7d0a2354d798384a5c4e5b2aed997be5",
"score": "0.49338984",
"text": "def draw_x_guidelines( label_height, count )\n if count != 0\n @graph.add_element( \"path\", {\n \"d\" => \"M#{label_height*count} 0 v#@graph_height\",\n \"class\" => \"guideLines\"\n })\n end\n end",
"title": ""
},
{
"docid": "e47091087d034381eeeca9a77afa4374",
"score": "0.4925013",
"text": "def edgesymbol\n directed ? '->' : '--'\n end",
"title": ""
},
{
"docid": "09dbc72d306099d5632a3bb0c6bd2289",
"score": "0.49237278",
"text": "def draw_vertical(start_line, end_line, start_char)\n start_line.upto(end_line) do |line_idx| \n @lines[line_idx][start_char] = PATH_CHAR \n end\n end",
"title": ""
},
{
"docid": "fe71a0d3d5ef122f7f4a15efc1fe44ef",
"score": "0.4895332",
"text": "def update_arrows\n return unless product\n return unless open?\n reduce if Input.repeat?(:LEFT) and can_sub?\n add if Input.repeat?(:RIGHT) and can_add?\n end",
"title": ""
},
{
"docid": "411fe31ebb52a0d08523acdcd639a537",
"score": "0.4888307",
"text": "def draw_paths=(_arg0); end",
"title": ""
},
{
"docid": "507999819592535199646689a111469e",
"score": "0.48549297",
"text": "def drawVector(v, loc, scale)\n push_matrix\n arrowsize = 5.\n # Translate to location to render vector\n translate(loc.x,loc.y);\n # Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate\n rotate(v.heading2D());\n # Calculate length of vector & scale it to be bigger or smaller if necessary\n len = v.mag()*scale\n # Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)\n line(0,0,len,0);\n line(len,0,len-arrowsize,+arrowsize/2);\n line(len,0,len-arrowsize,-arrowsize/2);\n pop_matrix();\n end",
"title": ""
},
{
"docid": "388e85b99cfa9e40aac07182a768bc12",
"score": "0.48109946",
"text": "def setarrowsize(*)\n super\n end",
"title": ""
},
{
"docid": "af44eec7fccd25e193ca3601131dbb7c",
"score": "0.48050922",
"text": "def pen_down\n @pen = :down\n @track << [@xy]\n end",
"title": ""
},
{
"docid": "e54150a1c713bb33be2d2dc8444d4452",
"score": "0.48031268",
"text": "def forward(steps)\n\t\t# Calculate ending coordinates\n\t\trad = @degree * Math::PI / 180\n\n\t\tnew_x = (@cursor_x + steps*Math.cos(rad)).round\n\t\tnew_y = (@cursor_y + steps*Math.sin(rad)).round\n\t\n\t\tif(@opened_eye) then\n\t\t\tdraw_points(@cursor_x, @cursor_y, new_x, new_y)\n\t\tend\n\n\t\t# Update coordinates\n\t\t@cursor_x = new_x\n\t\t@cursor_y = new_y\n\tend",
"title": ""
},
{
"docid": "3b09bbc85c3922b7ccfa16e9086137ac",
"score": "0.4787252",
"text": "def draw_vertexes\n vs.each_index do |n|\n vs[n].draw @drawer\n end\n end",
"title": ""
},
{
"docid": "167b7c03011a3aef375eecea314940ae",
"score": "0.47825396",
"text": "def draw_separation(x_start, y_start, y_min, y_max, x)\n @canvas.g.translate(x_start, y_start) do |lines|\n lines.styles(:stroke=>'#CCCCCC', :stroke_width=>1, :opacity=>0.05)\n lines.line(x, y_min, x, y_max)\n end\n end",
"title": ""
},
{
"docid": "f4ae6cc20afd85e608ab6cd2ffdcb5f3",
"score": "0.47630486",
"text": "def draw_line\n print H_SEP * columns\n end",
"title": ""
},
{
"docid": "fb0b95313d168f67bacaefc60ba7d721",
"score": "0.47490457",
"text": "def svg\n '<line x1= \"' + @head.x.to_s + '\" ' + \n 'y1= \"' + @head.y.to_s + '\" ' +\n 'x2= \"' + @tail.x.to_s + '\" ' +\n 'y2= \"' + @tail.y.to_s + '\" ' +\n \"\\n\\t\" +\n 'style=\"stroke:rgb(0,0,0);stroke-width:2\"/>'\n end",
"title": ""
},
{
"docid": "61edf81415daf20734ce7d7d96d44976",
"score": "0.47373238",
"text": "def draw_x_labels\n stagger = x_label_font_size + 5\n if show_x_labels\n label_width = field_width\n\n count = 0\n for label in get_x_labels\n if step_include_first_x_label == true then\n step = count % step_x_labels\n else\n step = (count + 1) % step_x_labels\n end\n\n if step == 0 then\n text = @graph.add_element( \"text\" )\n text.attributes[\"class\"] = \"xAxisLabels\"\n text.text = label.to_s\n\n x = count * label_width + x_label_offset( label_width )\n y = @graph_height + x_label_font_size + 3\n t = 0 - (font_size / 2)\n\n if stagger_x_labels and count % 2 == 1\n y += stagger\n @graph.add_element( \"path\", {\n \"d\" => \"M#{x} #@graph_height v#{stagger}\",\n \"class\" => \"staggerGuideLine\"\n })\n end\n\n text.attributes[\"x\"] = x.to_s\n text.attributes[\"y\"] = y.to_s\n if rotate_x_labels\n text.attributes[\"transform\"] = \n \"rotate( 90 #{x} #{y-x_label_font_size} )\"+\n \" translate( 0 -#{x_label_font_size/4} )\"\n text.attributes[\"style\"] = \"text-anchor: start\"\n else\n text.attributes[\"style\"] = \"text-anchor: middle\"\n end\n end\n\n draw_x_guidelines( label_width, count ) if show_x_guidelines\n count += 1\n end\n end\n end",
"title": ""
},
{
"docid": "f5e468d8a9b178a3729d28b60205eec2",
"score": "0.47318748",
"text": "def draw_line; draw_horizontal_line(@draw_y + (line_height / 2) - 1, 2); end",
"title": ""
},
{
"docid": "2ac19f3e4b1aec4a0bfae9028fd8c9b0",
"score": "0.47001177",
"text": "def dot(io)\n log \"drawing graph \"\n io << <<END\ndigraph test_definition {\ngraph [ rankdir=TB ]\nnode [shape=record,fontname=helvetica]\nedge [fontname=helvetica, arrowsize=0.5]\nEND\n # nodes,transitions = collect_nodes\n # transitions.to_a.flatten.to_set.each do |n|\n @nodes.each do |n|\n next if n.record # if we are a port, skip, record handles drawing\n if n.is_record? # if we are a record, call specialized function\n n.dot_code(io)\n else\n label_sym = (n.is_a?(JoinNode) ? :xlabel : :label)\n attrs={label_sym => '\"'+n.dot_label+'\"'}\n # if n.symbol\n # attrs[:xlabel]=n.symbol\n # end\n if n.respond_to? :dot_node_shape\n attrs[:shape]='\"'+n.dot_node_shape+'\"'\n end\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io.puts \"#{n.node_name} [#{attr_string}]\"\n end\n end\n @control_edges.each do |s,d,label|\n log \"adding control edge: [#{s},#{d},#{label}]\"\n attrs={color:\"red\",fontcolor:\"red\"}\n attrs[:label] = '\"'+label.to_s+'\"' if label\n draw_transition(s,d,io,attrs)\n end\n @data_edges.each do |s,d|\n log \"adding data edge\"\n draw_transition(s,d,io,{color: \"green\"})\n end\n io.puts \"}\"\n self\n end",
"title": ""
},
{
"docid": "ba28364e1ac7745c926f00fdff0274f4",
"score": "0.46891564",
"text": "def extend_and_draw(collection)\n collection.map do |member|\n case member\n when ::Xumlidot::Types::MethodSignature\n member.extend(::Xumlidot::Diagram::Xmi::MethodSignature)\n when ::Xumlidot::Types::Attribute\n member.extend(::Xumlidot::Diagram::Xmi::Attribute)\n end\n member.draw\n end.join(' ')\n end",
"title": ""
},
{
"docid": "3d2e909a4d6cfc395b3677cd99968411",
"score": "0.46883658",
"text": "def bind_termcap_arrow_keys(map)\r\n xkeymap = @_rl_keymap\r\n @_rl_keymap = map\r\n\r\n rl_bind_keyseq_if_unbound(@_rl_term_ku, :rl_get_previous_history)\r\n rl_bind_keyseq_if_unbound(@_rl_term_kd, :rl_get_next_history)\r\n rl_bind_keyseq_if_unbound(@_rl_term_kr, :rl_forward_char)\r\n rl_bind_keyseq_if_unbound(@_rl_term_kl, :rl_backward_char)\r\n\r\n rl_bind_keyseq_if_unbound(@_rl_term_kh, :rl_beg_of_line) # Home\r\n rl_bind_keyseq_if_unbound(@_rl_term_at7, :rl_end_of_line) # End\r\n\r\n rl_bind_keyseq_if_unbound(@_rl_term_kD, :rl_delete)\r\n rl_bind_keyseq_if_unbound(@_rl_term_kI, :rl_overwrite_mode)\r\n\r\n @_rl_keymap = xkeymap\r\n end",
"title": ""
},
{
"docid": "e3192587267ba14d1949a60f4e7e4e79",
"score": "0.46251026",
"text": "def triangle_tab(edge, width, inset, draw_view=nil, draw_reversed=false)\n if !edge || edge.faces.length != 1\n return\n end\n \n face = edge.faces[0]\n plane = Flattery::plane_for_entity(face)\n start_pt = edge.start.position\n end_pt = edge.end.position\n x_vec = edge.line[1].normalize #Along the edge\n length = edge.length\n if edge.reversed_in?(face) ^ draw_reversed\n x_vec.reverse!\n start_pt, end_pt = end_pt, start_pt\n inset = length - inset #Inset is measured from edge.start, regardless of reversedness\n end\n y_vec = x_vec * plane.normal #Perpendicular to the edge, away from the face\n z_vec = plane.normal\n \n transformation = Geom::Transformation.new(x_vec, y_vec, z_vec, start_pt)\n \n \n \n p1 = start_pt\n p2 = transformation * [inset, width, 0]\n p3 = end_pt\n \n if draw_view\n transformations = Flattery::transformations_for_entity(edge)\n transformations.each do |t|\n draw_view.draw_polyline(t * p1, t * p2, t * p3)\n end\n else\n edge.model.start_operation(\"Add Tab\")\n edge.parent.entities.add_face([p1,p2,p3])\n edge.model.commit_operation\n end\n end",
"title": ""
},
{
"docid": "c2bb952aba621b3155158dcc5ba753dd",
"score": "0.46098173",
"text": "def draw_witch(x)\n move_to_top\n @witch.each do |line|\n line_at x, line\n end\n end",
"title": ""
},
{
"docid": "94adceed3cd9cefd45c458b9bba073f0",
"score": "0.46069992",
"text": "def _menu_arrow\n b = Bitmap.new(16, 9)\n c1 = Color.new(0, 0, 0)\n c2 = Color.new(255, 255, 255)\n c3 = Color.new(127, 127, 127)\n b.fill_rect(7, 0, 2, 1, c2)\n b.set_pixel(6, 1, c2)\n b.fill_rect(7, 1, 1, 7, c3)\n b.fill_rect(8, 1, 1, 7, c1)\n b.set_pixel(9, 1, c2)\n b.set_pixel(5, 2, c2)\n b.fill_rect(6, 2, 1, 6, c3)\n b.fill_rect(9, 2, 1, 6, c1)\n b.set_pixel(10, 2, c2)\n b.set_pixel(4, 3, c2)\n b.fill_rect(5, 3, 1, 5, c3)\n b.fill_rect(10, 3, 1, 5, c1)\n b.set_pixel(11, 3, c2)\n b.set_pixel(3, 4, c2)\n b.fill_rect(4, 4, 1, 4, c3)\n b.fill_rect(11, 4, 1, 4, c1)\n b.set_pixel(12, 4, c2)\n b.set_pixel(2, 5, c2)\n b.fill_rect(3, 5, 1, 3, c3)\n b.fill_rect(12, 5, 1, 3, c1)\n b.set_pixel(13, 5, c2)\n b.set_pixel(1, 6, c2)\n b.fill_rect(2, 6, 1, 2, c3)\n b.fill_rect(13, 6, 1, 2, c1)\n b.set_pixel(14, 6, c2)\n b.set_pixel(0, 7, c2)\n b.set_pixel(1, 7, c3)\n b.set_pixel(14, 7, c1)\n b.set_pixel(15, 7, c2)\n b.fill_rect(1, 8, 14, 1, c2)\n return b\n end",
"title": ""
},
{
"docid": "0d620c6d6a0f26d3e6e7487c75f6c82f",
"score": "0.4606462",
"text": "def add_triangle(points: nil)\n fail \"Needs an array of 3 points\" if points.nil?\n fail \"Needs an array of 3 points\" unless points.length.eql? 3\n \n self.add_moveto(points[0])\n self.add_lineto(points[1])\n self.add_lineto(points[2])\n self.add_lineto(points[0])\n self.add_closesubpath()\n end",
"title": ""
},
{
"docid": "237d72b6937ea9fddc70dacbebb357ab",
"score": "0.4600207",
"text": "def draw_line_markers\n return if @hide_line_markers\n\n (0..marker_count).each do |index|\n marker_label = (BigDecimal(index.to_s) * BigDecimal(@increment.to_s)) + BigDecimal(minimum_value.to_s)\n x = @graph_left + ((marker_label - minimum_value) * @graph_width / @spread)\n draw_marker_vertical_line(x, tick_mark_mode: true)\n\n unless @hide_line_numbers\n label = y_axis_label(marker_label, @increment)\n y = @graph_bottom + @label_margin + (labels_caps_height / 2.0) + 5 # 5px offset for tick_mark_mode\n text_renderer = Gruff::Renderer::Text.new(renderer, label, font: @marker_font)\n text_renderer.add_to_render_queue(0, 0, x, y, Magick::CenterGravity)\n end\n end\n end",
"title": ""
},
{
"docid": "f759b59da5e5dd5fae12d799c94e0a7b",
"score": "0.45953822",
"text": "def draw_line(number)\n @dim.times do |i|\n if i+1 == number || @dim-i == number\n print draw_x\n else\n print draw_dot\n end\n end\n end",
"title": ""
},
{
"docid": "08715deb62ab45af996fa4edf8932369",
"score": "0.45823956",
"text": "def draw\n super\n #Left triangle\n if @choice > 1 then\n $window.draw_triangle(240, 418, Color::WHITE, 304, 450, Color::WHITE, 304, 386, Color::WHITE)\n end\n #Right triangle\n if @choice < @max_level then\n $window.draw_triangle(772, 418, Color::WHITE, 708, 450, Color::WHITE, 708, 386, Color::WHITE)\n end\n end",
"title": ""
},
{
"docid": "644ec317f7682ce74316e74eb92caca7",
"score": "0.45819217",
"text": "def face_to_lines(face)\n Kernel.raise \"non tris not supported\" if face.verts.length != 3\n v1, v2, v3 = face.verts.map { |vert| [vert.render_x, vert.render_y, vert.y] }.sort_by { |vert| vert.y }\n cross = VectorMath::normalize(VectorMath::cross3((face.verts[1] - face.verts[0]).row_vector, (face.verts[2] - face.verts[0]).row_vector))\n r = 254 * VectorMath::dot(cross,[0.0, 1.0, 0.0]).abs + 1\n g = 254 * VectorMath::dot(cross,[1.0, 0.0, 0.0]).abs + 1\n b = 254 * VectorMath::dot(cross,[0.0, 0.0, 1.0]).abs + 1\n g = b = r\n out = draw_tri(v1.x,v1.y,v2.x,v2.y,v3.x,v3.y,r,g,b)\nend",
"title": ""
},
{
"docid": "e9a79214e151323f1fcd8d5e239f7e35",
"score": "0.4570265",
"text": "def draw_commands(line_number)\n rect = line_rect(line_number)\n rect.y += 3; rect.width = (rect.width - 24) / 2\n draw_key_icon(:C, rect.x, rect.y)\n rect.x += 24\n draw_text(rect, Vocab.forge_start)\n rect.x += rect.width\n draw_key_icon(:B, rect.x, rect.y)\n rect.x += 24\n draw_text(rect, Vocab.forge_cancel)\n end",
"title": ""
},
{
"docid": "f7fcf8ac04938859f686ea12077fc04f",
"score": "0.45651826",
"text": "def how_to_render_lines args\n # Render a horizontal line at the bottom\n args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 }\n\n # Render a vertical line at the left\n args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 }\n\n # Render a diagonal line starting from the bottom left and going to the top right\n args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 }\nend",
"title": ""
},
{
"docid": "79a982b43484415c1e9147b4f7c7e2cb",
"score": "0.45575303",
"text": "def draw\n @tip_img.draw(@x, @y, @z)\n @top = @y + @tip_img.height\n while @top <= 600 - @line_img.height\n @line_img.draw(@x, @top, @z)\n @top += @line_img.height\n end\n end",
"title": ""
},
{
"docid": "519eefd117c8bce73d2643dab5c382ed",
"score": "0.45524344",
"text": "def pen_down\n @pen_is_down = true\n @track << [@xy]\n end",
"title": ""
},
{
"docid": "f1fdfc823d062a54a4b1cd297145284c",
"score": "0.45464206",
"text": "def setup_custom_graphic_states\n pdf.line_width(BASE_LINE_WIDTH)\n end",
"title": ""
},
{
"docid": "8a435561fe5c20d2ce8bdb9598571484",
"score": "0.4543619",
"text": "def description_hint_arrows\n arrows = Evaluation::PriorityRange.all.map(&:arrow).join(' ')\n \"Arrows (#{arrows}) hint at the importance of the object \" \\\n 'being documented.'\n end",
"title": ""
},
{
"docid": "c787ce72a977a56ecf10be3f977c2532",
"score": "0.45319435",
"text": "def draw_line_markers\n return if @hide_line_markers\n\n increment_scaled = @graph_height.to_f / (@spread / @increment)\n\n # Draw horizontal line markers and annotate with numbers\n (0..marker_count).each do |index|\n y = @graph_top + @graph_height - index.to_f * increment_scaled\n\n line_renderer = Gruff::Renderer::Line.new(renderer, color: @marker_color, shadow_color: @marker_shadow_color)\n line_renderer.render(@graph_left, y, @graph_right, y)\n\n unless @hide_line_numbers\n marker_label = BigDecimal(index.to_s) * BigDecimal(@increment.to_s) + BigDecimal(minimum_value.to_s)\n label = y_axis_label(marker_label, @increment)\n text_renderer = Gruff::Renderer::Text.new(renderer, label, font: @marker_font)\n text_renderer.add_to_render_queue(@graph_left - LABEL_MARGIN, 1.0, 0.0, y, Magick::EastGravity)\n end\n end\n end",
"title": ""
},
{
"docid": "9dea0626aae07b6f1d0f80c03fe8460c",
"score": "0.4528042",
"text": "def lines(points)\n CGContextAddLines(@ctx, points, points.size)\n CGContextDrawPath(@ctx, KCGPathStroke) # apply stroke\n endpath\n end",
"title": ""
},
{
"docid": "bb320a3071832d7c8818a7421c9f5dba",
"score": "0.4520355",
"text": "def navigation_buttons(next_url)\n options = {\n :'data-role' => \"controlgroup\",\n :'data-type' => \"horizontal\",\n :class => \"chart-navigation\"\n }\n content_tag(:div, link_to_previous + link_to_next(next_url), options)\n end",
"title": ""
},
{
"docid": "688d5759907d8bb141d3df8699b15984",
"score": "0.45153183",
"text": "def touch_began_from_edge(point)\n case @current_tool\n when :squiggle, :line\n @current_point = point\n @points = [@current_point]\n setNeedsDisplay\n end\n end",
"title": ""
},
{
"docid": "0e552f1aa4dfc17b9e5e7084860ac05f",
"score": "0.45071208",
"text": "def draw_vertex(x,y)\n self.draw_point(offx(x),offy(y),VERTICES)\n end",
"title": ""
},
{
"docid": "14c5e301f367df46afc1fa573ce0f265",
"score": "0.45070618",
"text": "def arrowMove2(c,x,y)\n v = $demo_arrowInfo\n newB = (v.x2+5-c.canvasx(x).round)/10\n newB = 0 if newB < 0\n newB = 25 if newB > 25\n newC = (v.y+5-c.canvasy(y).round-5*v.width)/10\n newC = 0 if newC < 0\n newC = 20 if newC > 20\n if newB != v.b || newC != v.c\n c.move('box2', 10*(v.b-newB), 10*(v.c-newC))\n v.b = newB\n v.c = newC\n end\nend",
"title": ""
},
{
"docid": "eed909a805fd57718772e0194465c67c",
"score": "0.45066008",
"text": "def draw_caret\n return unless active_field?\n\n @window.draw_simple_line(@point.offset(sel_x, 0),\n @point.offset(pos_x + 1, height),\n 0, Gosu::Color::BLACK)\n end",
"title": ""
},
{
"docid": "0ae18f3f0e279c63427d7cc942339047",
"score": "0.45029837",
"text": "def connect_layers(source, destination)\n\t\tsource.neurons.each do |src_n|\n\t\t\tdestination.neurons.each do |dest_n|\n\t\t\t\tArrow.new(src_n, dest_n)\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ddcb79dedb6a8c33857f5e257d7117bf",
"score": "0.45027164",
"text": "def diagonal_paths(direction)\n off_gen = DiagonalOffsetGenerator.new(coordinates, direction)\n off_gen.moves\n end",
"title": ""
},
{
"docid": "74c45afd18c344d449fb447d7c7594c2",
"score": "0.4497869",
"text": "def direction_link\n link_to_function \"<span class='asc' title='#{t(\"winnow.sort_direction.ascending_tooltip\")}'>#{t(\"winnow.sort_direction.ascending\")}</span><span class='desc' title='#{t(\"winnow.sort_direction.descending_tooltip\")}'>#{t(\"winnow.sort_direction.descending\")}</span>\", \"\", :id => \"direction\"\n end",
"title": ""
},
{
"docid": "ee57be68357b58728db9d71068f6d1f5",
"score": "0.44930598",
"text": "def draw_line_markers\n return if @hide_line_markers\n\n\n # have to do this here (AGAIN)... see draw() in this class\n # because this funtion is called before the @radius, @center_x and @center_y are set\n @radius = @graph_height / 2.0\n @center_x = @graph_left + (@graph_width / 2.0)\n @center_y = @graph_top + (@graph_height / 2.0) - 10 # Move graph up a bit\n\n\n # Draw horizontal line markers and annotate with numbers\n @d = @d.stroke(@marker_color)\n @d = @d.stroke_width 1\n\n\n (0..@column_count-1).each do |index|\n rad_pos = index * Math::PI * 2 / @column_count\n\n @d = @d.line(@center_x, @center_y, @center_x + Math::sin(rad_pos) * @radius, @center_y - Math::cos(rad_pos) * @radius)\n\n\n marker_label = labels[index] ? labels[index].to_s : '000'\n\n draw_label(@center_x, @center_y, rad_pos * 360 / (2 * Math::PI), @radius, marker_label)\n end\n end",
"title": ""
},
{
"docid": "e56e04faf33983d7e265ab0e0c9436a6",
"score": "0.44923386",
"text": "def draw_text_icon(line, string, graphic_name)\n return if line <= 0\n draw_icon(line, graphic_name)\n y = 32 * line - 32\n self.contents.draw_text(35, y, @width, 32, string)\n end",
"title": ""
},
{
"docid": "45e4fb72e159ce4f6d9b94074fe9c5dc",
"score": "0.44887722",
"text": "def draw_line(x1,y1,x2,y2,r,g,b,graph_function=false)\r\n if ( @line_dot_size > 1 )\n self.draw_dotted_line(x1,y1,x2,y2,@line_dot_size,r,g,b,graph_function)\n else\n r = 0 if ( r < 0 ) \n r = 255 if ( r > 255 ) \r\n g = 0 if ( g < 0 ) \n g = 255 if ( g > 255 ) \r\n b = 0 if ( b < 0 ) \n b = 255 if ( b > 255 ) \r\n distance = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)) \r\n if ( distance == 0 )\r\n #return -1\n else \r\n xstep = (x2-x1) / distance\r\n ystep = (y2-y1) / distance\r\n i =0\n while i<=distance \r\n x = i * xstep + x1\r\n y = i * ystep + y1\r\n if((x >= @garea_x1 && x <= @garea_x2&& y >= @garea_y1 && y <= @garea_y2) || !graph_function )\r\n if ( @line_width == 1 )\r\n self.draw_antialias_pixel(x,y,r,g,b)\n else\r\n start_offset = -(@line_width/2) \n end_offset = (@line_width/2)\n j = start_offset\n while j<=end_offset\n self.draw_antialias_pixel(x+j,y+j,r,g,b)\n end \r\n end\r\n end\n i =i+1\r\n end\n end \n end \r\n end",
"title": ""
},
{
"docid": "ba2580e4986e9d632fe5ceadc7987ae4",
"score": "0.44825706",
"text": "def forward(steps)\n must_be_number(steps, 'distance')\n angle = heading * DEG\n x, y = xy\n self.xy = [x + steps * sin(angle), y + steps * cos(angle)]\n track.last << xy if pen_down?\n end",
"title": ""
},
{
"docid": "90c06990c183512edca1bf782046a1f2",
"score": "0.44765693",
"text": "def draw_line_markers\n return if @hide_line_markers\n\n @d = @d.stroke_antialias false\n\n if @left_axis_increment.nil? || @right_axis_increment.nil?\n # Try to use a number of horizontal lines that will come out even.\n #\n # TODO Do the same for larger numbers...100, 75, 50, 25\n if @marker_count.nil?\n marker_count\n normalize(true)\n end\n @left_increment = @left_spread / @marker_count if !@left_spread.nil?\n @right_increment = @right_spread / @marker_count if !@right_spread.nil?\n end\n \n if @has_left_data\n @increment_scaled = @graph_height.to_f / (@left_spread / @left_increment)\n elsif @has_right_data\n @increment_scaled = @graph_height.to_f / (@right_spread / @right_increment)\n end\n\n increment_scale = @increment_scaled\n @increment_scaled = @increment_scaled.ceil\n\n @scale_percentage = increment_scale/@increment_scaled\n \n# y = @graph_top + @graph_height - @marker_count * @increment_scaled\n# @d.fill 'white'\n# @d.rectangle( @graph_left, y, @graph_right, @graph_bottom)\n\n # Draw horizontal line markers and annotate with numbers\n (0..@marker_count).each do |index|\n y = @graph_top + @graph_height - index.to_f * @increment_scaled\n\n @d.fill(@marker_color)\n @d.line(@graph_left, y.to_i, @graph_right, y.to_i)\n\n# @d.fill('black')\n# @d.line(@graph_left, y, @graph_left+3, y) if !(@left_increment.nil? && @left_minimum_value.nil?)\n# @d.line(@graph_right-3, y, @graph_right, y) if !(@right_increment.nil? && @right_minimum_value.nil?)\n\n marker_label = index * @left_increment + @left_minimum_value.to_f if !(@left_increment.nil? && @left_minimum_value.nil?)\n right_marker_label = index * @right_increment + @right_minimum_value.to_f if !(@right_increment.nil? && @right_minimum_value.nil?)\n\n unless @hide_line_numbers\n @d.fill = @font_color\n @d.font = @font if @font\n @d.stroke('transparent')\n @d.pointsize = scale_fontsize(@marker_font_size)\n @d.gravity = EastGravity if !(@left_increment.nil? && @left_minimum_value.nil?)\n\n # Vertically center with 1.0 for the height\n @d = @d.annotate_scaled( @base_image,\n @graph_left - LABEL_MARGIN, 1.0,\n 0.0, y,\n label(marker_label), @scale) if !(@left_increment.nil? && @left_minimum_value.nil?)\n\n @d.gravity = WestGravity if !(@right_increment.nil? && @right_minimum_value.nil?)\n @d = @d.annotate_scaled( @base_image,\n 0.0, 1.0,\n @graph_right + LABEL_MARGIN, y,\n label(right_marker_label, :right), @scale) if !(@right_increment.nil? && @right_minimum_value.nil?)\n end\n end\n\n # # Submitted by a contibutor...the utility escapes me\n # i = 0\n # @additional_line_values.each do |value|\n # @increment_scaled = @graph_height.to_f / (@maximum_value.to_f / value)\n #\n # y = @graph_top + @graph_height - @increment_scaled\n #\n # @d = @d.stroke(@additional_line_colors[i])\n # @d = @d.line(@graph_left, y, @graph_right, y)\n #\n #\n # @d.fill = @additional_line_colors[i]\n # @d.font = @font if @font\n # @d.stroke('transparent')\n # @d.pointsize = scale_fontsize(@marker_font_size)\n # @d.gravity = EastGravity\n # @d = @d.annotate_scaled( @base_image,\n # 100, 20,\n # -10, y - (@marker_font_size/2.0),\n # '', @scale)\n # i += 1\n # end\n\n @d = @d.stroke_antialias true\n end",
"title": ""
},
{
"docid": "9a79bd0853f54ff82c6fcd3a05f01a3e",
"score": "0.44749174",
"text": "def draw\n lines = []\n\n indent = @height - 1\n draw_braches(lines, indent)\n\n lines\n end",
"title": ""
},
{
"docid": "fe480a4996f15def4455c1f23ce2673c",
"score": "0.44725102",
"text": "def arrow!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n type = ARROW\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 131:9: '->'\n match( \"->\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n end",
"title": ""
},
{
"docid": "3bd70a4d37c012436362344c661979a2",
"score": "0.4469845",
"text": "def draw_line(x1,y1,x2,y2,r,g,b,graph_function=false)\n if ( @line_dot_size > 1 )\n self.draw_dotted_line(x1,y1,x2,y2,@line_dot_size,r,g,b,graph_function)\n else\n r = 0 if ( r < 0 )\n r = 255 if ( r > 255 )\n g = 0 if ( g < 0 )\n g = 255 if ( g > 255 )\n b = 0 if ( b < 0 )\n b = 255 if ( b > 255 )\n distance = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))\n if ( distance == 0 )\n #return -1\n else\n xstep = (x2-x1) / distance\n ystep = (y2-y1) / distance\n i =0\n while i<=distance\n x = i * xstep + x1\n y = i * ystep + y1\n if((x >= @g_area_x1 && x <= @g_area_x2&& y >= @g_area_y1 && y <= @g_area_y2) || !graph_function )\n if ( @line_width == 1 )\n self.draw_antialias_pixel(x,y,r,g,b)\n else\n start_offset = -(@line_width/2)\n end_offset = (@line_width/2)\n j = start_offset\n while j<=end_offset\n self.draw_antialias_pixel(x+j,y+j,r,g,b)\n end\n end\n end\n i =i+1\n end\n end\n end\n end",
"title": ""
},
{
"docid": "92fa0b26506f3ecebf60f0cb025857b2",
"score": "0.4466801",
"text": "def drawLink _obj, _args\n \"_obj drawLink _args;\" \n end",
"title": ""
},
{
"docid": "2276a60db3c859f3c290b4c2cf75f408",
"score": "0.4459089",
"text": "def draw_route\n # Delete all sprites in drawing of path\n if @arrow_path != nil\n @arrow_path.each{|a|\n a.dispose\n }\n end\n # Initialize variables\n @arrow_path = []\n return if @passed_positions.empty?\n start_pos = [@selected_unit.x, @selected_unit.y]\n new_pos = start_pos\n type = \"\"\n # Get direction from unit to first tile in path\n last_dir = case [@passed_positions[0].x - @selected_unit.x, @passed_positions[0].y - @selected_unit.y]\n when [0, 1] then 2\n when [-1,0] then 4\n when [1, 0] then 6\n when [0,-1] then 8\n end\n # Loop through path positions, evaluating two elements at a time\n for i in 0...@passed_positions.size\n p1 = @passed_positions[i]\n p1 = [p1.x, p1.y]\n p2 = (@passed_positions[i+1] == nil ? 0 : @passed_positions[i+1])\n if p2.is_a?(MoveTile)\n p2 = [p2.x, p2.y] \n # Figure out the direction taken to get from p1 to p2\n dir = [p2[0] - p1[0], p2[1] - p1[1]]\n dir = case dir\n when [0, 1] then 2\n when [-1,0] then 4\n when [1, 0] then 6\n when [0,-1] then 8\n end\n else\n dir = 0\n end\n # Evaluate the last direction taken to get to current spot\n case last_dir\n when 2\n new_pos[1] += 1\n case dir\n when 0 then type = \"d\"\n when 2 then type = \"v\"\n when 4 then type = \"ru\"\n when 6 then type = \"lu\"\n end\n when 4\n new_pos[0] -= 1\n case dir\n when 0 then type = \"l\"\n when 2 then type = \"ld\"\n when 4 then type = \"h\"\n when 8 then type = \"lu\"\n end\n when 6\n new_pos[0] += 1\n case dir\n when 0 then type = \"r\"\n when 2 then type = \"rd\"\n when 6 then type = \"h\"\n when 8 then type = \"ru\"\n end\n when 8\n new_pos[1] -= 1\n case dir\n when 0 then type = \"u\"\n when 4 then type = \"rd\"\n when 6 then type = \"ld\"\n when 8 then type = \"v\"\n end\n end\n last_dir = dir\n @arrow_path.push(Arrow_Sprite.new(@arrows_viewport, type, new_pos))\n end\n end",
"title": ""
},
{
"docid": "e6d4b0530446fd3595b11ad418dd1963",
"score": "0.44429648",
"text": "def draw_endpoints_with_hash positions\n positions.each { |line_idx, char_idx| @lines[line_idx][char_idx] = '#' }\n end",
"title": ""
},
{
"docid": "a2678ea67661099a0d66d491049bc61a",
"score": "0.44399497",
"text": "def arrow(string)\n if string == \"<--<<\" || string == \">>-->\"\n true\n end\nend",
"title": ""
},
{
"docid": "0364c1cd88118c21bb206c92c7df75aa",
"score": "0.44380313",
"text": "def draw_tree(x, y, length, dir, dx, dy)\n if dir < 0\n dir = dir + 8\n elsif dir >= 8\n dir = dir - 8\n end\n\n xnew = x + (length * dx[dir])\n ynew = y - (length * dy[dir])\n color = branch_color(length)\n\n draw_line(x, y, color, xnew, ynew, color, 1.0)\n\n # recurse\n if length > 0\n draw_tree(xnew, ynew, length - 1, dir - 1, dx, dy)\n draw_tree(xnew, ynew, length - 1, dir + 1, dx, dy)\n end\n end",
"title": ""
},
{
"docid": "efb9a1b97c99ef8a91d45cab0f11a0f8",
"score": "0.44337794",
"text": "def redcloth_glyphs\n [[ '’', \"'\" ],\n [ '‘', \"'\" ],\n [ '<', '<' ], \n [ '>', '>' ], \n [ '”', '\"' ],\n [ '“', '\"' ],\n [ '…', '...' ],\n [ '\\1—', '--' ], \n [ ' → ', '->' ], \n [ ' – ', '-' ], \n [ '×', 'x' ], \n [ '™', '(TM)' ], \n [ '®', '(R)' ],\n [ '©', '(C)' ]]\n end",
"title": ""
},
{
"docid": "c63c58c5423e70f36e13c7f44677d63c",
"score": "0.44278613",
"text": "def line(id, from:[0,0], **attrs)\n draw_init\n unless to = attrs.delete(:to)\n raise ArgumentError, \"Argument 'to' is required\"\n end\n n1_id, n2_id = [1, 2].map { |i| \"#{id}#{i}\".to_id }\n point(n1_id, x:from[0], y:from[1],\n color:\"#FFFFFF00\", fillcolor:\"#FFFFFF00\")\n point(n2_id, x:to[0], y:to[1],\n color:\"#FFFFFF00\", fillcolor:\"#FFFFFF00\")\n attrs.update(arrowhead:\"none\")\n edge(:\"#{n1_id}_#{n2_id}\", attrs)\n end",
"title": ""
},
{
"docid": "b6bd4754437ebc83a5e66dffbbe49392",
"score": "0.4424371",
"text": "def image_name\n 'bag/arrow'\n end",
"title": ""
},
{
"docid": "12c2550a3af5c0443d33e1d59ede9406",
"score": "0.44242677",
"text": "def update_arrows_enemy(index)\n @arrows[index].x = @arrows[index].enemy.actual_x\n @arrows[index].y = @arrows[index].enemy.actual_y\n end",
"title": ""
},
{
"docid": "85e2464bec84432ae98e5034332b780d",
"score": "0.44234607",
"text": "def spot_legs\n lines = []\n indent = 0\n spacer = @width - @padding\n\n draw_legs(lines, indent, spacer)\n lines\n end",
"title": ""
},
{
"docid": "ebff17960bf230e67d03c649b4d5788c",
"score": "0.44213253",
"text": "def go_ahead(steps,width=1)\n x0 = @pos.x\n y0 = @pos.y\n x1 = (@pos.x + steps*Math.cos(@angle)).round()\n y1 = (@pos.y - steps*Math.sin(@angle)).round()\n if (@down)\n animiere(3) {\n TkcLine.new( Leinwand.gib_einzige_instanz(),x0,y0,x1,y1,:fill => :black, :width => [1,width] .max()) }\n end\n @pos = Point.new(x1,y1)\n end",
"title": ""
},
{
"docid": "e442704f629a5d373c7a5d8dec0166c7",
"score": "0.44079456",
"text": "def shoot arrow\r\n arrow.x+=arrow.vel_x\r\n arrow.y+=arrow.vel_y\r\n end",
"title": ""
},
{
"docid": "f4eb37210aede9b1dda7c9804bff878b",
"score": "0.4407389",
"text": "def draw_graph(graph)\n type = graph.directed? ? :digraph : :graph\n g = GraphViz.new(:G, :type => type)\n graph.vertices().each do |v|\n g.add_node(v.id)\n end\n\n added_edges = Set.new\n\n graph.edges_by_vertices().each do |x, edges|\n from = g.get_node(x.id)\n edges.each do |y|\n to = g.get_node(y.id)\n\n if graph.directed?\n # draw each individual 'directed' edge\n g.add_edge(from, to)\n else\n # draw only one edge to represent 'undirected' edge\n g.add_edge(from, to) unless added_edges.include?([to, from])\n added_edges.add([from, to])\n end\n\n\n end\n end\n\n\n filename = \"graph.png\"\n g.output( :png => filename )\n system(\"open #{filename}\")\nend",
"title": ""
},
{
"docid": "49e542ed078aa7210fd66be971916fce",
"score": "0.43994743",
"text": "def draw()\n draw_controls()\n end",
"title": ""
}
] |
eac3743c77a23e7b07a73eabde17f886
|
POST /wikis POST /wikis.json
|
[
{
"docid": "306536f3e3147b632cbb365cedcf1dd7",
"score": "0.7003024",
"text": "def create\n @wiki = Wiki.new(params.require(:wiki).permit(:title, :body))\n\n if @wiki.save\n render json: @wiki, status: :created, location: @wiki\n else\n render json: @wiki.errors, status: :unprocessable_entity\n end\n end",
"title": ""
}
] |
[
{
"docid": "03a791ffb3ce4cb60c520a36945aa981",
"score": "0.66920304",
"text": "def create_wiki(name, content, project_id, params = {})\n params.merge!(name: name, content: content, project_id: project_id)\n post('wikis', params)\n end",
"title": ""
},
{
"docid": "6d57a29a1189fdd390beacdc3f33686f",
"score": "0.66660696",
"text": "def create\n @wikialgo = Wikialgo.new(params[:wikialgo])\n\n respond_to do |format|\n if @wikialgo.save\n format.html { redirect_to @wikialgo, notice: 'Wikialgo was successfully created.' }\n format.json { render json: @wikialgo, status: :created, location: @wikialgo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wikialgo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ffe2ee593653c52679f160247b8911d",
"score": "0.66519237",
"text": "def create\n @wiki = Wiki.new(wiki_params)\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to @wiki, notice: 'Wiki was successfully created.' }\n format.json { render :show, status: :created, location: @wiki }\n else\n format.html { render :new }\n format.json { render json: @wiki.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06d02292cc11c78cabdf174bd6e3bf55",
"score": "0.65179586",
"text": "def index\n @wikis = Wiki.all\n\n render json: @wikis\n end",
"title": ""
},
{
"docid": "ef4517ab8e4c3a8535703ab12d4b8271",
"score": "0.6316161",
"text": "def create\n authorize! :manage, @wiki , :message => \"Access denied.\"\n @wiki = Wiki.new(wiki_params)\n \n respond_to do |format|\n if @wiki.save\n format.html { redirect_to @wiki, notice: 'Wiki was successfully created.' }\n format.json { render :show, status: :created, location: @wiki }\n else\n format.html { render :new }\n format.json { render json: @wiki.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "361ea963b9286ebe223b60c61047c4b1",
"score": "0.6249327",
"text": "def create\n @wiki = current_user.wikis.build(params[:wiki])\n authorize! :create, @wiki, message: \"You need to be signed up to do that.\"\n if @wiki.save\n flash[:notice] = \"Wiki was saved.\"\n redirect_to @wiki\n else\n flash[:error] = \"There was an error saving the wiki. Please try again.\"\n render :new\n end\n end",
"title": ""
},
{
"docid": "47c5252a2f22c5001aceb73d063557bb",
"score": "0.6239075",
"text": "def create\n @wiki = current_user.wikis.new(params[:wiki])\n\n if !@wiki.private || current_user.premium\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to @wiki, notice: 'Wiki was successfully created.' }\n format.json { render json: @wiki, status: :created, location: @wiki }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wiki.errors, status: :unprocessable_entity }\n end\n end\n\n else\n\n flash[:notice] = \"You are not authorized to create private wikis.\"\n render 'new'\n\n end\n end",
"title": ""
},
{
"docid": "8f47954506303fd09512ecc32dfb3f67",
"score": "0.621879",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to(@wiki, :notice => 'Wiki was successfully created.') }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da071df15d923bc7769f733ad9de5493",
"score": "0.6146672",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n @user = User.find(params[:author])\n @wiki.user = @user\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to @wiki, :notice => 'Wiki was successfully created.' }\n format.json { render :json => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "065b2a19e351cd8737da43856bfe4931",
"score": "0.614274",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n\n respond_to do |format|\n if @wiki.save\n flash[:notice] = 'Wiki was successfully created.'\n format.html { redirect_to(@wiki) }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6595fe0dde726525ea59467b1d57a428",
"score": "0.6050706",
"text": "def create\n @wiki_page = WikiPage.new(params[:wiki_page])\n @wiki_page.user = current_user\n\n respond_to do |format|\n if @wiki_page.save\n format.html { redirect_to @wiki_page, notice: 'Wiki page was successfully created.' }\n format.json { render json: @wiki_page, status: :created, location: @wiki_page }\n else\n format.html { render :new }\n format.json { render json: @wiki_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da06075e4afd91f2039b2dde333011ee",
"score": "0.6015447",
"text": "def create\n thrift do |hbase|\n hbase.mutateRow('wiki', params[:title], [\n Mutation.new(:column => 'text:', :value => params[:text]),\n Mutation.new(:column => 'title:', :value => params[:title])\n ])\n end\n redirect_to wikis_url\n end",
"title": ""
},
{
"docid": "5b2a12be6f7b0e141433785f059e3b94",
"score": "0.6012803",
"text": "def create\n @wiki_tag = WikiTag.new(wiki_tag_params)\n\n respond_to do |format|\n if @wiki_tag.save\n format.html { redirect_to @wiki_tag, notice: 'Wiki tag was successfully created.' }\n format.json { render :show, status: :created, location: @wiki_tag }\n else\n format.html { render :new }\n format.json { render json: @wiki_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ceb9b611654d66787d160bbd150c650b",
"score": "0.59817773",
"text": "def create\n @wiki = Wiki.new(wiki_params)\n @wiki.user_id = current_user.id\n @wiki_id = 0\n\n respond_to do |format| \n if @wiki.save\n create_parent_tag(@wiki)\n if @wiki.default_sort == 0\n @wiki.update(:default_sort => @wiki.id)\n end\n format.html { redirect_to wikis_url, notice: 'Wiki was successfully created.' }\n format.js { render \"wikis/display\" }\n else\n format.html { render :new }\n format.json { render json: @wiki.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cb6e5af885f842e1404af2a6fb5b59b",
"score": "0.59324545",
"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": "07b2d02a09385efeef4515fc5af9a5fb",
"score": "0.58581954",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n @wiki.uri = @wiki.name.gsub(' ','_')\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to wiki_path(@wiki.uri), :notice => 'Wiki was successfully created.' }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "432ed745d9d479fa58a84b3e59d3b108",
"score": "0.58540404",
"text": "def new\n @wikialgo = Wikialgo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wikialgo }\n end\n end",
"title": ""
},
{
"docid": "c811d0d2b475a2665f271b1912e60530",
"score": "0.58442616",
"text": "def create\n @wiki = Wiki.new(wiki_params)\n @wiki.user = current_user\n @wiki.is_private = @wiki.is_private && @wiki.is_private != 0 ? 1 : nil\n @notation = @@notation\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to(wiki_path(:name => @wiki.name, :id => @wiki.id), :notice => 'Wiki was successfully created.') }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5882098b2c4b7b54823edd03d465bc66",
"score": "0.5807313",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @wiki }\n end\n end",
"title": ""
},
{
"docid": "f92ba68ecb25614cafa8e1e12e3c0b90",
"score": "0.58046985",
"text": "def wikis\n cmd = {\"cmd\"=>\"listWikis\",\"token\"=>@token}\n result = Hpricot.XML(@connection.post(@api_url,to_params(cmd)).body)\n raise FogBugzError, \"Code: #{(result/\"error\")[0][\"code\"]} - #{(result/\"error\").inner_html}\" if (result/\"error\").inner_html != \"\"\n list_process(result,\"wiki\",\"ixWiki\")\n end",
"title": ""
},
{
"docid": "e29a58d7c55466659f7884ba6b52dc3b",
"score": "0.58013064",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n @wiki.user = current_user\n\n respond_to do |format|\n if @wiki.save\n upload_process\n flash[:notice] = 'Wiki was successfully created.'\n format.html { redirect_to(@wiki) }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cfe5c34320b3ca0137dabd63e910171",
"score": "0.5799633",
"text": "def index\n @wikis = Wiki.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wikis }\n end\n end",
"title": ""
},
{
"docid": "0eb07a08e83722714c874b679a6f17d3",
"score": "0.5749176",
"text": "def my_upload_to_wiki(title, wikicontent)\n page_title = title\n page_title ||= \"odts-#{Time.now.to_i}\"\n project = Project.find(params[:project_id])\n# wiki = project.wiki\n @auto_page = project.wiki.find_or_new_page(page_title)\n @auto_page.content = WikiContent.new(:text => wikicontent.to_s, \n\t\t\t\t\t:comments => \"added by automate\",\n\t\t\t\t\t:author => User.current)\n\n @auto_page.save\n return @auto_page\n end",
"title": ""
},
{
"docid": "cc8a5d3d4ae42042d750aff88e8b469d",
"score": "0.5742655",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :content, :comment, :hidden)\n end",
"title": ""
},
{
"docid": "e31d9c3e2f91d75252197557365fff19",
"score": "0.5712646",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :body, :private)\n end",
"title": ""
},
{
"docid": "e31d9c3e2f91d75252197557365fff19",
"score": "0.5712646",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :body, :private)\n end",
"title": ""
},
{
"docid": "1ccfebad1eed179634bd072ee443e91b",
"score": "0.56890446",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :body, :private)\n end",
"title": ""
},
{
"docid": "826afd52f84dbdb4a7bd4bdfe16ef986",
"score": "0.5665622",
"text": "def new\n @wiki = Wiki.new\n @wiki.name = params[:title]\n @title = \"Creating #{@wiki.name}\"\n @wikis = Wiki.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "f27353cc25091bf857b7f60cdf292745",
"score": "0.5657907",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :body, :public)\n end",
"title": ""
},
{
"docid": "f3eba26c35246d7e96381d3790eb022b",
"score": "0.5645208",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :user_id, :body, :parent, :version, :deleted, :default_sort, :tags)\n end",
"title": ""
},
{
"docid": "015821ca29a0cc59d9d0905e63bf5344",
"score": "0.5637767",
"text": "def index\n @wikis = Kaminari.paginate_array(Wiki.find_by_sql(\"SELECT w.* FROM wikis w INNER JOIN (SELECT MAX(created_at) created_at, name FROM wikis GROUP BY name) w1 ON w.created_at=w1.created_at AND w.name=w1.name ORDER BY created_at DESC\")).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wikis }\n end\n end",
"title": ""
},
{
"docid": "8b17796a894b535b8ce9bdc5cd1eb293",
"score": "0.56304526",
"text": "def new\n @wiki_page = WikiPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wiki_page }\n end\n end",
"title": ""
},
{
"docid": "477555e8b6e0bf235c7f556b767afb3e",
"score": "0.5621221",
"text": "def create\n @page = @wiki.page(params[:page_title])\n @commit[:message] = params[:commit_msg]\n @wiki.write_page(params[:page_title], :markdown, params[:page_content], @commit)\n respond_to do |format|\n format.html { redirect_to(root_url, :notice => 'successfully updated.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6907eee95b8c9d31224f2d141d4606d1",
"score": "0.56168514",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :body, :user_id, :public, :image)\n end",
"title": ""
},
{
"docid": "c02232062b13fe29701a5c604f7b7c89",
"score": "0.56153315",
"text": "def create\n authorize! :create , WikiPage\n @wiki_page = WikiPage.new(wiki_params)\n @wiki_page.user_id = current_user.id\n\n respond_to do |format|\n if @wiki_page.save\n format.html { redirect_to @wiki_page, notice: 'Wiki page was successfully created.' }\n format.json { render json: @wiki_page, status: :created, location: @wiki_page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wiki_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4693b6f12d001e95a8b93c01f65c53a",
"score": "0.5614797",
"text": "def post\n value = params[:message]\n tik = Tik.put(value)\n parse_and_save_hashtags(tik, value)\n redirect_to welcome_index_url\n end",
"title": ""
},
{
"docid": "a9e43fd08f479f8a2f7ede2a958fe0c8",
"score": "0.56142336",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :description, :body, :sidebody, :parent_id, :lft, :rgt, :depth, :children_count, :is_public)\n end",
"title": ""
},
{
"docid": "dd91402427b2e83041bfb8d5b7629e90",
"score": "0.5599466",
"text": "def create\n @wiki_page = WikiPage.new(params[:wiki_page])\n\n respond_to do |format|\n if @wiki_page.save\n flash[:notice] = 'WikiPage was successfully created.'\n format.html { redirect_to(@wiki_page) }\n format.xml { render :xml => @wiki_page, :status => :created, :location => @wiki_page }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki_page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50fa7c1bab38abcedb804a6b22b81b5e",
"score": "0.55985504",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :body, :private)\n end",
"title": ""
},
{
"docid": "f4cbf7a0d83e0d6709b6f494c75e2bc0",
"score": "0.5554835",
"text": "def wiki_params\n params.require(:wiki).permit(:title, :body, :private, :user_id)\n end",
"title": ""
},
{
"docid": "bd276cfbcc1659ca6751d253f5292f22",
"score": "0.5526668",
"text": "def index\n authorize! :manage, @wikis , :message => \"Access denied.\"\n if params[:sort] == nil then\n @wikis = Wiki.searchAll(params[:search]).order_parent.page(params[:page]).per(25)\n else\n @wikis = Wiki.searchAll(params[:search]).order(sort_column + \" \" + sort_direction).order_parent.page(params[:page]).per(25)\n end \n # @wikis_json = Wiki.collection_to_json\n # respond_to do |format|\n # format.html\n # format.json { render :json => @wikis.to_json }\n # end\n end",
"title": ""
},
{
"docid": "7913a418101d25c896937d716812e621",
"score": "0.5472646",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n if @lesson.save\n render json: @lesson, serializer: LessonSerializer\n else\n render json: { error: t('story_create_error') }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8a23b37bed5e6560023db23736ab2e32",
"score": "0.546472",
"text": "def create\n @walkthrough = Walkthrough.new(walkthrough_params)\n\n respond_to do |format|\n if @walkthrough.save\n format.html { redirect_to @walkthrough, notice: 'Questionnaire was successfully created.' }\n format.json { render action: 'show', status: :created, location: @walkthrough }\n else\n flash.keep[:notice] = @walkthrough.errors\n format.html { redirect_to controller: 'walkthroughs', action: 'new', request_id: @walkthrough.request_id }\n format.json { render json: @walkthrough.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0351f9a14382906bf91f40113eef3d24",
"score": "0.5401613",
"text": "def wiki_params\n params.require(:wiki).permit(:tag, :info, :title,:user_id)\n # params.require(:wiki).permit!\n end",
"title": ""
},
{
"docid": "fe70890f26d64ad80b647db2d2b24438",
"score": "0.53874356",
"text": "def uploadWiki(wiki_url,file_content,project_name,file_title)\n begin\n response = RestClient.put(wiki_url, { :wiki_page => {\n :text => file_content # wiki_text # original wiki text\n }\n })\n rescue RestClient::BadGateway => bg\n p \"The following exception typically means that the targeted wiki page is actually a redirection to another page.\"\n raise bg\n\n end\n end",
"title": ""
},
{
"docid": "eb33e115bf9ec336c3bbb0b2de70736a",
"score": "0.5386345",
"text": "def sentiment(text)\n RestClient.post \"http://api.datumbox.com/1.0/SentimentAnalysis.json\", {api_key: '', text: text}, {content_type: :json, accept: :json}\nend",
"title": ""
},
{
"docid": "ad848af8451863424d9888bb8e9a68be",
"score": "0.537611",
"text": "def new_from_json_wiki_page(json_wikitext)\n content = Oj.load(json_wikitext)\n base_page = content['wiki_page']\n return content unless base_page\n wikitext = WikiApi.new(MetaWiki.new).get_page_content(base_page)\n training_content_and_translations(content:, base_page:, wikitext:)\n end",
"title": ""
},
{
"docid": "9267caae8e104c8c2e05ea7937536489",
"score": "0.53624964",
"text": "def create\n @celeb_wiki = CelebWiki.new(celeb_wiki_params)\n\n respond_to do |format|\n if @celeb_wiki.save\n format.html { redirect_to @celeb_wiki, notice: 'Celeb wiki was successfully created.' }\n format.json { render :show, status: :created, location: @celeb_wiki }\n else\n format.html { render :new }\n format.json { render json: @celeb_wiki.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f1ab3fe2e8a889af2fdacf4bc2a9f2a",
"score": "0.5355815",
"text": "def wisdom_params\n params.require(:wisdom).permit(:title, :body, :category_id, :short_description, :image, :rank)\n end",
"title": ""
},
{
"docid": "bf56a5ab335258715dffcb1a0653aa29",
"score": "0.5348063",
"text": "def wikipedia(search)\n # Create new hash object to hold data\n word_object = Hash.new\n definition_data = Hash.new\n\n # get response\n response = HTTParty.get(\"https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&titles=#{search.sub(' ', '%20')}\")\n\n # get unique page ID key to access nested data in response\n key = response['query']['pages'].keys\n\n # set meta data\n word_object[\"word\"] = search\n word_object[\"data\"] = []\n\n if (response['query']['pages'][key[0]]['extract'] rescue false != false)\n word_object[\"speech\"] = \"[ wikipedia ]\"\n word_object[\"link\"] = \"https://en.wikipedia.org/wiki/#{search.sub(' ', '_')}\"\n definition_data['definition'] = truncate(response['query']['pages'][key[0]]['extract'], :length => 350)\n else\n word_object[\"speech\"] = \"[ note ]\"\n definition_data['definition'] = \"Enter footnote information...\"\n end\n\n word_object[\"data\"][0] = definition_data\n return word_object.to_json\n end",
"title": ""
},
{
"docid": "bbc1028fca6294cd9fa2038128f1b066",
"score": "0.5346114",
"text": "def create\n @wiki_category = WikiCategory.new(params[:wiki_category])\n @wiki_category.deleted = false\n\n respond_to do |format|\n if @wiki_category.save\n format.html { redirect_to @wiki_category, notice: 'Wiki category was successfully created.' }\n format.json { render json: @wiki_category, status: :created, location: @wiki_category }\n else\n format.html { render :new }\n format.json { render json: @wiki_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b60c93bef6a5d3e5667876a509a16b4a",
"score": "0.5328223",
"text": "def wikis\n self.special ||= {}\n self.special[:wikis] ||= {}\n special[:wikis]\n end",
"title": ""
},
{
"docid": "7a2e432fa43bf5b98d88def4db5173eb",
"score": "0.5321337",
"text": "def create\n\n tiddlywiki_file = {\n # These are the params used by active storage\n io: StringIO.new(TiddlywikiEmpty.modified_empty(site_params_for_create[:name])),\n filename: 'index.html',\n content_type: 'text/html',\n }\n\n @site = Site.new(site_params_for_create.merge(tiddlywiki_file: tiddlywiki_file))\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to sites_url }\n # format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n # format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec8d0886af81ebe686f136ad931e111f",
"score": "0.53197587",
"text": "def new\n\n @tag = Tag.new(:name => params[:input])\n\t\t@object = Tag.find(params[:object]) rescue nil\n\t\t@tags = params[:tags] || []\n\t\t@images = []\n\t\t@wikis = []\n\t\n\t\tif params[:url] \n\t\t\tif params[:url].match('en.wikipedia.org/wiki/')\n\t\t\t\tfeed_url = \"http://en.wikipedia.org/w/api.php?action=query&list=allimages&aifrom=#{params[:url].gsub('http://en.wikipedia.org/wiki/','')}&format=xml\"\n\t\t\t\t\n\t\t\t\tresponse = Net::HTTP.get_response(URI.parse(feed_url)).response.body\n\t\t\t\t@images = REXML::Document.new(response).elements.to_a(\"//img\").collect {|c| c.attributes['url']}\n\t\t\telse\n\t\t\t\tdoc = Hpricot open(params[:url].gsub(/\\s|,/,'_'))\n\t\t\t\t@images = (doc/:img).collect! {|img| img if not img.attributes['height'].to_i < 50 }\n\t\t\t\t@description = (doc/:p).first.inner_html.gsub(/\\..*/,'') rescue \"\"\n\t\t\tend\n\t\t\n\t\telse\n\t\t\t\tfeed_url = \"http://en.wikipedia.org/w/api.php?action=opensearch&search=#{@tag.name.gsub(' ','_')}&format=xml\"\n\t\t\t\tresponse = Net::HTTP.get_response(URI.parse(feed_url)).response.body\n\t\t\t\tds = REXML::Document.new(response).elements.to_a(\"//Item\")\n\t\t\t\tds.each do |d|\n\t\t\t\t\t@wikis << Tag.new(:name => d.elements[\"Text\"].text, :description => d.elements[\"Description\"].text, :url => d.elements[\"Url\"].text, :kind => \"bookmark\")\n\t\t\t\tend\n\t\t\t\tfeed_url = \"http://en.wikipedia.org/w/api.php?action=query&list=allimages&aifrom=#{@tag.name.gsub(' ','_')}&format=xml\"\n\t\t\t\tresponse = Net::HTTP.get_response(URI.parse(feed_url)).response.body\n\t\t\t\t@images = REXML::Document.new(response).elements.to_a(\"//img\").collect {|c| c.attributes['url']}\n\t\tend\n\n\n respond_to do |format|\n format.html {}\n\t\t\tformat.js {}\n format.xml { render :xml => @tag }\n end\n end",
"title": ""
},
{
"docid": "533a56b87686a4726d1f7f0566ac1a22",
"score": "0.53193325",
"text": "def create\n log = Log.find(params[:id])\n created = []\n get_url(log) do |url|\n obj = Uric::URI.new(url)\n page = Page.new(:title => obj.title, :host => obj.host, :url => obj.path, :type => obj.type, :log_id => log.to_param, :workshop_id => log.workshop_id)\n page.save\n created << page\n end\n\n respond_to do |format|\n format.html { redirect_to :action => :index}\n format.json { render json: created, status: :created, location: :pages }\n end\n end",
"title": ""
},
{
"docid": "f3935272874b39d5110b969b4682274c",
"score": "0.5317742",
"text": "def index\n\t\t@doc_pu_wikis = @doc_pu.doc_pu_wiki_pages\n\tend",
"title": ""
},
{
"docid": "d97be13651c7647857c923dc5267befa",
"score": "0.5295328",
"text": "def create\n params[:words].each do |word|\n dbword = Word.new(:word => word)\n dbword.save\n end\n \n respond_to do |format|\n format.json { head :created }\n end\n end",
"title": ""
},
{
"docid": "30d6687f3db2e3666b80372002d53320",
"score": "0.5265226",
"text": "def create\n @storylike = Storylike.new(storylike_params)\n\n if @storylike.save\n render json: @storylike\n else\n render json: @storylike.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4fa4d3e41b1f918919e6ff07ca8e128b",
"score": "0.5224029",
"text": "def update\n @wiki = Wiki.find(params[:id])\n\n if @wiki.update(params.require(:wiki).permit(:title, :body, :id, :created_at, :updated_at))\n head :no_content\n else\n render json: @wiki.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0dc80ba0b8523c6a05292ac1c58cead8",
"score": "0.5207659",
"text": "def test_should_create_topic_via_API_JSON\r\n get \"/logout\"\r\n post \"/forum_topics.json\", :api_key=>'testapikey',\r\n :forum_topic => {:title=>'API Test Topic',\r\n :description=>'Test topic desc',\r\n :user_id=>1}\r\n assert_response :created\r\n topic = JSON.parse(response.body)\r\n assert topic['title'] == 'API Test Topic', 'Incorrect topic title'\r\n assert topic['user_id'] == 1, 'Incorrect user id'\r\n assert topic['description'] == 'Test topic desc', 'Incorrect topic description' \r\n end",
"title": ""
},
{
"docid": "c237f8e177ea0a5b2e4b9a36435f9cc9",
"score": "0.5204985",
"text": "def new\n @wiki_category = WikiCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wiki_category }\n end\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.5201187",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.5201187",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.5201187",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "895ba91ee98e8c289387968d2719f9bb",
"score": "0.51986134",
"text": "def post url, language = \"Ruby\"\n payload = encode( { :request => { :language => language, :url => url } } )\n decode site[resource[:user]].post payload, :content_type => :json\n end",
"title": ""
},
{
"docid": "0d245d79a653562bc18a4fc4d8186fce",
"score": "0.5197645",
"text": "def search_wikia(name)\n return JSON.parse(RestClient.get(\"https://starwars.fandom.com/api/v1/Search/List?query=#{URI.encode(name)}&limit=1&minArticleQuality=1&batch=1&namespaces=0%2C14\"))[\"items\"].first[\"url\"]\nend",
"title": ""
},
{
"docid": "92008bad042579793da1bda239d95223",
"score": "0.51842654",
"text": "def create\n api.post('', nil, 'application/json')\n end",
"title": ""
},
{
"docid": "ff35aa6515a3f5c2ffaf5f2300754888",
"score": "0.51748633",
"text": "def push\n auth = Authorization.find_by_provider_and_nickname! 'github',\n params[:repository][:owner][:name]\n lesson = Lesson.find_by_user_id_and_name! auth.user_id,\n params[:repository][:name]\n status = lesson.pushed\n status = status ? :accepted : :unprocessable_entity\n respond_with lesson, only: [:slug, :url, :status], status: status\n end",
"title": ""
},
{
"docid": "09d615506e43277865611dffbe6e7b27",
"score": "0.51712936",
"text": "def create\n params[:human_resource][:question].each do |k, v|\n answer = Answer.new\n answer.user_id = params[:human_resource][:user_id]\n answer.question_id = k;\n answer.answer = v;\n answer.save\n end\n respond_to do |format|\n format.html { redirect_to answers_path, notice: 'Questionário criado com sucesso.' }\n format.json { render :index, status: :created, location: @answer }\n end\n end",
"title": ""
},
{
"docid": "7730374711c76fbfa69f94e0d344c052",
"score": "0.5167328",
"text": "def create\n @story = Story.new(create_params)\n\n if @story.save\n render json: @story, status: :created, location: @story\n else\n render json: @story.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d31fe37b0d0107b912a10476b1ce9514",
"score": "0.5150144",
"text": "def shikaku_params\n params.require(:shikaku).permit(:title, :detail)\n end",
"title": ""
},
{
"docid": "4af32e91209e50a758a2e7970b400c6b",
"score": "0.5145626",
"text": "def create\n @story = Story.new(story_params)\n if @story.save\n render json: @story\n else\n render json: @story.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6414ef383f00ef8b8fc33ed68133eee8",
"score": "0.5143731",
"text": "def create\n @tutorial = @framework.tutorials.build(tutorial_params)\n\n if @tutorial.save\n render :show, status: :created\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "eeeae3a8717b418d0bb6a84d3ba8b1cb",
"score": "0.51386344",
"text": "def create\n @swim_lesson = SwimLesson.new(params[:swim_lesson])\n\n respond_to do |format|\n if @swim_lesson.save\n format.html { redirect_to swim_lessons_path(), notice: 'Swim lesson was successfully created.' }\n format.json { render json: @swim_lesson, status: :created, location: @swim_lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @swim_lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa8d2d61efaa1d1c5d143ac180168ccd",
"score": "0.5131361",
"text": "def create\n @lesson = Lesson.new(params[:lesson])\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to builder_lessons_path, notice: 'Lesson was successfully created.' }\n format.json { render json: @lesson, status: :created, location: @lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85ba99b2673ef3911ca95f599f0ff0a4",
"score": "0.5128329",
"text": "def create\n @tikoku = Tikoku.new(tikoku_params)\n\n respond_to do |format|\n if @tikoku.save\n format.html { redirect_to @tikoku, notice: \"遅刻理由を作成しました\" }\n format.json { render :show, status: :created, location: @tikoku }\n else\n format.html { render :new }\n format.json { render json: @tikoku.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "286f1fe6a9a750c4b02956465eac0bf4",
"score": "0.5122291",
"text": "def create\n slack = Slack.new slack_params\n slack.user = current_user\n if slack.save\n render json: slack\n else\n head :conflict\n end\n end",
"title": ""
},
{
"docid": "ccf8ac455e2a2779b80897a4d261c962",
"score": "0.5117502",
"text": "def new\n @wiki = Wiki.new\n end",
"title": ""
},
{
"docid": "3195992752c8052e6b345ddc9dd0f2f2",
"score": "0.51068395",
"text": "def create\n @guru = Guru.new(guru_params)\n\n respond_to do |format|\n if @guru.save\n format.html { redirect_to pages_vote_counted_path, notice: 'Survey successfully submitted' }\n format.json { render :show, status: :created, location: @guru }\n else\n format.html { render :new }\n format.json { render json: @guru.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbe6500a6c4a615eb91cd77d6de2788c",
"score": "0.5105086",
"text": "def post(data, tags_in = {}) ; post_to nil, data, tags_in end",
"title": ""
},
{
"docid": "256d0b82ae2739f7159176eaa523a644",
"score": "0.51011115",
"text": "def create\n @wikirace = Wikirace.new(wikirace_params)\n\n respond_to do |format|\n if @wikirace.save\n #if it saves, keep making more!\n format.html { render :new, notice: 'Wikirace was successfully created.' }\n format.json { render :show, status: :created, location: @wikirace }\n else\n format.html { render :new }\n format.json { render json: @wikirace.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abed7ddc94f10bcd0f62efa65c40c143",
"score": "0.50966525",
"text": "def create\n post = create_post\n json_success api_response.post_data(post)\n end",
"title": ""
},
{
"docid": "e73ae58d252de962cd3f5963d95095be",
"score": "0.50960165",
"text": "def test_post_work_chapter_path\n # FIXME should need to be chapter's author to post\n user = create_user\n @request.session[:user] = user \n chapter = new_chapter\n work = create_work(:chapters => [chapter])\n work.add_default_tags\n post :post, :locale => 'en', :work_id => work.id, :id => chapter.id \n assert Chapter.find(chapter.id).posted\n assert_redirected_to work_path(assigns(:work))\n assert flash[:notice] =~ /posted/\n end",
"title": ""
},
{
"docid": "72663f3f94575f677e2d86f441620912",
"score": "0.5094356",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson.unit.track, notice: 'lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e722c69602a0f54a07e020d05936c41",
"score": "0.5092834",
"text": "def page title, story\n page = {'title' => title, 'story' => story, 'journal' => [create(title)]}\n File.open(\"../pages/#{slug(title)}\", 'w') do |file| \n file.write JSON.pretty_generate(page)\n end\nend",
"title": ""
},
{
"docid": "5f2d4db68f054cf344186e5459cbcf7e",
"score": "0.50925434",
"text": "def post(path, params = {})\n api :post, path, params\n end",
"title": ""
},
{
"docid": "66b6310b03e50ae73534eba55ffe0c2c",
"score": "0.5092433",
"text": "def save_knowledge\n @wisdom = Wisdom.new(params['wisdom'])\n @wisdom.prepare_for_save(params['wisdom'])\n @wisdom.save(session[:credentials]['login'],session[:token])\n end",
"title": ""
},
{
"docid": "0158303779f415cbde0526416d634bc9",
"score": "0.5091945",
"text": "def create\n @writing = Writing.new(writing_params)\n\n respond_to do |format|\n if @writing.save\n format.html { redirect_to writings_url, notice: '新しい問題を追加しました' }\n format.json { render :index, status: :created, location: @writing }\n else\n format.html { render :index }\n format.json { render json: @writing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c1d3972a24efe5525c4a8133141a217",
"score": "0.5081616",
"text": "def make_request(request_params)\n HTTParty.get(\"https://en.wikipedia.org/w/api.php?#{request_params}\")\n end",
"title": ""
},
{
"docid": "fe904aaee9aab70b5cc34b4bdbf023e6",
"score": "0.50782114",
"text": "def parse_doc(doc)\n # カテゴリの取得\n doc.xpath(\"//div[@id='itemcategory_list']//a\").each do |node|\n data= []\n data << {\n 'name' => node.text,\n 'url' => node['href']\n }\n\n# p data\n ScraperWiki.save(['name', 'url'], data)\n end\nend",
"title": ""
},
{
"docid": "fe904aaee9aab70b5cc34b4bdbf023e6",
"score": "0.50782114",
"text": "def parse_doc(doc)\n # カテゴリの取得\n doc.xpath(\"//div[@id='itemcategory_list']//a\").each do |node|\n data= []\n data << {\n 'name' => node.text,\n 'url' => node['href']\n }\n\n# p data\n ScraperWiki.save(['name', 'url'], data)\n end\nend",
"title": ""
},
{
"docid": "9d85868402fde85a319fc3bf32223562",
"score": "0.507667",
"text": "def upload_new_story(name, key)\n # Other options are: requested_by, description, owned_by, labels\n story = Story.create(:name => name, :estimate => 1, :labels => key)\n story.current_state = \"unstarted\"\n story.save\n end",
"title": ""
},
{
"docid": "45f38f90b86990ab9c9da5de1fad2b97",
"score": "0.5076211",
"text": "def create\n @idea = Idea.new(idea_params)\n @idea.user_id = current_user.id\n @idea.published = true\n\n respond_to do |format|\n if @idea.save\n if ENV['SLACK_WEBHOOK_URL'].present?\n slack = Slack::Incoming::Webhooks.new ENV['SLACK_WEBHOOK_URL']\n attachments = [{\n title: @idea.title,\n title_link: ENV['SITE_URL'],\n text: @idea.body,\n color: \"#7CD197\"\n }]\n slack.post \"New Post!\", attachments: attachments\n end\n\n label_params.each do |label|\n IdeasLabel.find_or_create_by(idea_id: @idea.id, label_id: label[1]) if label[1].to_i > 0\n end\n\n format.html { redirect_to @idea, notice: 'Idea was successfully created.' }\n format.json { render :show, status: :created, location: @idea }\n else\n format.html { render :new }\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50e1d8e3080e341e97f8d31a2d84a51b",
"score": "0.5075891",
"text": "def test_should_create_status_post_via_API_JSON\r\n get \"/logout\"\r\n post \"/status_posts.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :created\r\n status_post = JSON.parse(response.body)\r\n check_new_status_post(status_post) \r\n end",
"title": ""
},
{
"docid": "240b2740f81d7dbd665edfd317f801cc",
"score": "0.50726676",
"text": "def get_post(url)\n fuzzy_filename = url.split('/').last\n client = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN'])\n code = client.search_code(\"filename:#{fuzzy_filename} repo:#{settings.sites[@site]['github_repo']}\")\n # This is an ugly hack because webmock doesn't play nice - https://github.com/bblimke/webmock/issues/449\n code = JSON.parse(code, symbolize_names: true) if ENV['RACK_ENV'] == 'test'\n # Error if we can't find the post\n error('invalid_request', 'The post with the requested URL was not found') if (code[:total_count]).zero?\n\n content = client.contents(settings.sites[@site]['github_repo'], path: code[:items][0][:path]) if code[:total_count] == 1\n decoded_content = Base64.decode64(content[:content]).force_encoding('UTF-8').encode unless content.nil?\n\n jekyll_post(decoded_content)\n end",
"title": ""
},
{
"docid": "212133fb76256f3a2b6975df52f97f53",
"score": "0.50676894",
"text": "def create\n @story.save\n\n respond_with(@sprint, @story)\n end",
"title": ""
},
{
"docid": "ebbd9c2be07e5255a59bba7841031598",
"score": "0.50597924",
"text": "def api_post(path, data = {})\n api_request(:post, path, :data => data).parsed\n end",
"title": ""
},
{
"docid": "4704a3c341fe55356c2fa4b73f06d889",
"score": "0.5059114",
"text": "def create\n params[:contextualization][:question].each do |k, v|\n answer = Answer.new\n answer.user_id = params[:contextualization][:user_id]\n answer.question_id = k;\n answer.answer = v;\n answer.save\n end\n respond_to do |format|\n format.html { redirect_to answers_path, notice: 'Questionário criado com sucesso.' }\n format.json { render :index, status: :created, location: @answer }\n end\n end",
"title": ""
},
{
"docid": "ad7ced5cc61fd87822dab4129789d10c",
"score": "0.5058183",
"text": "def post(data)\n uri = URI.parse(\"#{API_ENDPOINT}/#{([@token] + tags).join('+')}\")\n req = Net::HTTP::Post.new(uri.path)\n\n payload_hash = data.to_hash\n if @repo_url\n payload_hash[:repository][:url] = @repo_url\n end\n if @commit_url\n payload_hash[:commits].each do |commit|\n commit[:url] = @commit_url % commit[:id]\n end\n end\n if @diff_url\n payload_hash[:compare] = @diff_url % [payload_hash[:before], payload_hash[:after]]\n end\n\n req.set_form_data(:payload => MultiJson.encode(payload_hash))\n http = Net::HTTP.new(uri.host, uri.port)\n\n if uri.scheme == 'https'\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.use_ssl = true\n end\n\n http.start { |http| http.request(req) }\n end",
"title": ""
},
{
"docid": "612e589b2270b49c8cc16c95a207be1a",
"score": "0.50536996",
"text": "def create\n @my_lesson = MyLesson.new(params[:my_lesson])\n\n respond_to do |format|\n if @my_lesson.save\n format.html { redirect_to @my_lesson, notice: 'My lesson was successfully created.' }\n format.json { render json: @my_lesson, status: :created, location: @my_lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
f0e765aa6b7ca84039a6e9a20d30ac79
|
creates a Report Dont use this class directly but one of the subclasses shaped for your report type. _wiki_ is the wiki to be reported. _params_: :basedir:: the base directory wherein the output directory will be created. Defaults to the systems TEMP directory. Must exist. :outputdir:: Directory where the report is generated (i.e. the working directory where all auxiliary file as well as the resulting report file are generated). If not given an uniq directory name will be generated. If the outputdir does not exist it will be created. The parent directory of the output dir must exist. :mode:: The file access permissions the outputdir will be set to. Defaults to 0700. :filename:: the name of the report file. To be given without path but with extension. Defaults to default.type. :type:: type of the report. Used to find the template (if :ttype is not set) and to generate the default report filename. :ttype:: file extension for the template file. Used if this differs from the report type. For all further parameters see Basenew
|
[
{
"docid": "2e95fef25eac82343da09080cd7a2a3b",
"score": "0.7494717",
"text": "def initialize(wiki, params={})\n super(wiki, params)\n @basedir = @params[:basedir] || Dir.tmpdir\n @filename = @params[:filename] || ('default.' + @type.to_s)\n mode = @params[:mode] || 0700\n mode = mode.oct if mode.kind_of?(String)\n if @outputdir = @params[:outputdir]\n @outputdir = File.join(@basedir, @outputdir) unless @outputdir[0]==?/\n else\n # create an uniq directory \n dirname = \"MW-#{'%08x' % $$}-#{\"%012x\" % (Time.now.to_f*100000)}\"\n i = 0\n @outputdir = File.join(@basedir, dirname)\n begin\n Dir.mkdir(@outputdir)\n rescue Errno::EEXIST\n i+=1\n if i<100\n @outputdir = File.join(@basedir, dirname + \"-#{i}\")\n retry\n else # should never happen!\n raise Errno::EEXIST.new(File.join(@basedir, dirname) + \" .. \" +\n @outputdir) \n end\n end\n end\n Dir.mkdir(@outputdir) unless File.directory?(@outputdir)\n File.chmod(mode, @outputdir)\n end",
"title": ""
}
] |
[
{
"docid": "bdfc690e71b7bcb0de1c199f8dcdb8c8",
"score": "0.62035966",
"text": "def initialize(wiki, params={})\n @wiki = wiki\n @params = {\n :templatedir => TemplateDir,\n :template => 'default',\n :language => @wiki.language,\n }.merge(params)\n\n @type = @params[:type]\n ttype = @params[:ttype] || @type\n\n # searching for the template ...\n tmpl = \"#{@params[:template]}.#{@params[:language]}.#{ttype}\"\n tmpl_dir = @params[:templatedir]\n lang = true\n tmpl_full_l = File.join(tmpl_dir, tmpl)\n tmpl_full = tmpl_full_l\n begin\n @erb = ERB.new(File.read(tmpl_full))\n rescue Errno::ENOENT\n if lang\n tmpl = \"#{@params[:template]}.#{ttype}\"\n tmpl_full = File.join(tmpl_dir, tmpl)\n warn \"Reading '#{tmpl_full_l}' failed. Trying '#{tmpl_full}'.\"\n lang = false\n retry\n else\n @erb = nil\n raise Errno::ENOENT.new(\"#{tmpl_full_l} - #{tmpl_full}\")\n end\n end\n end",
"title": ""
},
{
"docid": "8638110922945db158a053da6c51e698",
"score": "0.6102068",
"text": "def create_wiki_page(path, content, type='normal')\n FileUtils.mkdir_p(path)\n # Write the content\n File.open(File.join(path, 'content.txt'), 'w') do |file|\n file.write(content)\n end\n # Write the properties.xml\n File.open(File.join(path, 'properties.xml'), 'w') do |file|\n file.puts '<?xml version=\"1.0\"?>'\n file.puts '<properties>'\n file.puts ' <Edit>true</Edit>'\n file.puts ' <Files>true</Files>'\n file.puts ' <Properties>true</Properties>'\n file.puts ' <RecentChanges>true</RecentChanges>'\n file.puts ' <Refactor>true</Refactor>'\n file.puts ' <Search>true</Search>'\n if type == 'test'\n file.puts ' <Test/>'\n elsif type == 'suite'\n file.puts ' <Suite/>'\n end\n file.puts ' <Versions>true</Versions>'\n file.puts ' <WhereUsed>true</WhereUsed>'\n file.puts '</properties>'\n end\n end",
"title": ""
},
{
"docid": "ab3ef1ddf9a4787099fa381426e32fd8",
"score": "0.5942132",
"text": "def create_wiki_doc(*args)\n\n # default set in args\n begin\n\n args= Hash[*args]\n args.dup.each do |key,value|\n if key.class != Symbol\n args[key.to_s.to_sym]= value\n args.delete key\n end\n end\n\n if args[:path].nil?\n raise ArgumentError,\"You must set a file path with a file name in order to create documentation for grape!\"\n end\n\n args[:desc_files] ||= Array.new\n\n [:desc,:desc_file,:extra_desc_file].each do |one_key|\n\n args[:desc_files] += args[(one_key.to_s+\"s\").to_sym] if args[(one_key.to_s+\"s\").to_sym].class == Array\n args[:desc_files].push(args[one_key]) if args[one_key].class == String\n\n end\n\n args[:type] ||= args[:doc_type]\n args[:type] ||= 'wiki'\n\n #args[:path],\n #args[:extra_desc_file]\n #args[:target_class]\n #args[:type]\n\n end\n\n\n # defaults\n begin\n\n uni_tab= \"\"\n case args[:type].to_s.downcase\n\n when \"redmine\",\"redmine_wiki\",\"redmine-wiki\",\"redminewiki\"\n begin\n\n mid_tab= \" \"*3\n\n bsym= \"*\"\n isym= \"_\"\n\n htsym= \"* \"\n mtsym= htsym[0]*2 +\" \"\n stsym= htsym[0]*3 +\" \"\n\n hheader= \"h3. \"\n mheader= \"h4. \"\n sheader= \"h5. \"\n\n container_markup_begin= \"<pre><code class=\\\"\"\n container_markup_end= \"\\\">\"\n container_markup_close= \"</code></pre>\"\n\n toc_mark= \"\\n{{>toc}}\\n\"\n\n end\n\n when \"github\",\"wiki\",\"md\"\n begin\n\n mid_tab= \" \"*3\n\n bsym= \"*\"\n isym= \"_\"\n\n htsym= \"* \"\n mtsym= \" * \"\n stsym= \" * \"\n\n hheader= \"## \"\n mheader= \"### \"\n sheader= \"#### \"\n\n container_markup_begin= \"```\"\n container_markup_end= \"\"\n container_markup_close= \"```\"\n toc_mark= \"\"\n\n end\n\n else\n raise ArgumentError, \"invalid :type has been set, try github or redmine\"\n\n end\n\n end\n\n # site name\n begin\n write_out_array = Array.new\n write_out_array.push \"#{hheader}#{$0} REST Interface Documentation\\n\\n\"\n end\n\n # description\n begin\n args[:desc_files].each do |extra_desc_file_path|\n\n write_out_array.push \"#{sheader}#{extra_desc_file_path.split(File::Separator).last.split('.')[0].camelcase}\\n\"\n write_out_array.push \" \"+File.open(extra_desc_file_path,\"r\").read+\"\\n\"\n\n end\n end\n\n # table of contents\n begin\n write_out_array.push toc_mark\n end\n\n # classes array\n begin\n rest_models= Array.new\n end\n if args[:target_class].nil?\n Grape::API.each_subclass do |one_class|\n rest_models.push(one_class)\n end\n else\n if args[:target_class].class != Class && args[:target_class] != nil\n raise ArgumentError, \"invalid input :target_class is not a Class obj\"\n end\n rest_models.push(args[:target_class])\n end\n\n rest_models.each do |rest_api_model|\n next if Grape::API == rest_api_model\n rest_api_model.routes.map do |route|\n\n\n method_name= \"#{hheader}Request: #{route.route_path} call: #{route.route_method.to_s.downcase} part\"\n\n # check that does the method already in the documentation\n unless write_out_array.include?(method_name)\n\n # create call name\n begin\n write_out_array.push method_name\n end\n\n # request\n begin\n\n # create request description\n begin\n write_out_array.push(\"\\n\"+(uni_tab*1)+\"#{mheader}Request description\")\n case true\n\n when route.route_description.class <= String\n route.route_description.each_line do |one_line|\n write_out_array.push((uni_tab*2)+htsym+one_line.chomp)\n end\n\n when route.route_description.class <= Hash\n begin\n\n description_msg = nil\n\n [:d,:desc,:description].each do |sym|\n description_msg ||= route.route_description[sym]\n end\n\n description_msg ||= \"No description available for this path\"\n description_msg= [*description_msg]\n\n description_msg.dup.each do |element|\n next unless element.include?(\"\\n\")\n\n index_n= description_msg.index(element)\n description_msg.delete(element)\n new_elements= element.split(\"\\n\")\n new_elements.size.times do |counter_n|\n description_msg.insert(index_n + counter_n - 1, new_elements[counter_n - 1] )\n end\n\n end\n\n description_msg.each do |one_line|\n write_out_array.push((uni_tab*2)+htsym+one_line.chomp)\n end\n\n end\n\n\n end\n end\n\n # pre request\n begin\n write_out_array.push(\"\\n#{mheader}request\\n\")\n end\n\n # create route method\n begin\n write_out_array.push((uni_tab*2)+\"#{htsym}#{bsym}method:#{bsym}#{mid_tab} #{route.route_method}\")\n end\n\n # create route path\n begin\n write_out_array.push((uni_tab*2)+\"#{htsym}#{bsym}path:#{bsym}#{mid_tab} #{route.route_path}\")\n end\n\n # create route content_type\n begin\n write_out_array.push((uni_tab*2)+\"#{htsym}#{bsym}headers:#{bsym}#{mid_tab}\")\n rest_api_model.content_types.each do |one_format_type,one_format_header|\n write_out_array.push \"#{mtsym}#{uni_tab*2}#{one_format_header}\"\n end\n\n write_out_array.push \"\"\n end\n\n # parameters\n begin\n new_docs_element= Array.new\n if route.route_params.count == 0\n new_docs_element.push \" No specified or special params\"\n else\n new_docs_element.push \"\"\n new_docs_element.push \"#{htsym}#{isym}#{bsym}Parameters#{bsym}#{isym}\"\n route.route_params.each do |key,value|\n new_docs_element.push \"#{mtsym}#{isym}#{key}#{isym}\"\n value.each do |value_key,value_value|\n new_docs_element.push \"#{stsym}#{value_key}: #{value_value}\"\n end\n end\n new_docs_element.push \"\\n\"\n end\n refactored_element= Array.new\n new_docs_element.each do |one_element|\n refactored_element.push((uni_tab*2)+one_element)\n end\n write_out_array.push refactored_element.join(\"\\n\")\n end\n\n end\n\n # response\n begin\n\n # pre response\n begin\n write_out_array.push(\"\\n#{mheader}response\\n\")\n end\n\n #> TODO make better implementation for others to use\n #create route content_type\n begin\n if !Grape::Endpoint.config_obj.nil?\n\n write_out_array.push((uni_tab*2)+\"#{sheader}Extra headers:\")\n\n Grape::Endpoint.header_config_obj.each do |header_key,header_value|\n write_out_array.push \"#{htsym}#{header_key}: #{header_value.join(', ')}\"\n end\n\n write_out_array.push \"\"\n\n end\n end if Grape::Endpoint.respond_to?(:config_obj) && Grape::Endpoint.respond_to?(:header_config_obj)\n\n # create response bodies\n begin\n #TODO check out why not working normaly with evry path!\n write_out_array.push((uni_tab*2)+\"#{sheader}*body:*\")\n wiki_body(route,container_markup_begin,container_markup_end,container_markup_close ).each do |one_element|\n write_out_array.push one_element\n end\n write_out_array.push \"\"\n end\n\n end\n\n # error resp\n begin\n\n # pre error\n begin\n write_out_array.push(\"\\n#{mheader}response in case of failure\\n\")\n end\n\n # create error response headers\n begin\n\n end\n\n # create error response bodies\n begin\n #write_out_array.push((uni_tab*2)+\"*body:*\")\n write_out_array.push((uni_tab*2)+\"#{htsym}*Internal Server Error:500*\")\n end\n\n end\n\n # after space\n begin\n write_out_array.push \"\\n----\\n\"\n end\n\n end\n\n end\n end\n\n File.new(args[:path],\"w\").write write_out_array.join(\"\\n\")\n\n return nil\n end",
"title": ""
},
{
"docid": "e29a58d7c55466659f7884ba6b52dc3b",
"score": "0.5717039",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n @wiki.user = current_user\n\n respond_to do |format|\n if @wiki.save\n upload_process\n flash[:notice] = 'Wiki was successfully created.'\n format.html { redirect_to(@wiki) }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed5ae04bace228af7cd973a628816555",
"score": "0.56554824",
"text": "def generate( report_type, report, options = {} )\n\n include_title = ( options[ uk_org_pond_id_for_type( report_type ) ] == '1' )\n\n headings = []\n headings << ' (total)' if ( report.include_totals )\n headings << ' (com.)' if ( report.include_committed )\n headings << ' (not com.)' if ( report.include_not_committed )\n\n # Old-style streaming has becomes unreliable lately; the v1.0 approach as\n # per \"http://oldwiki.rubyonrails.org/rails/pages/HowtoExportDataAsCSV\"\n # often failed with Rails 2.3 and/or certain FasterCSV versions (I never\n # did find out exactly what caused the problem though).\n #\n # The simplest solution is to use the ActiveRecord::Streaming \"send_data\"\n # call, putting all the load on the Rails framework. Unfortunately this\n # means the whole CSV file ends up in RAM before being sent - inefficient.\n\n label = report.label.downcase.gsub( ' ', '_' )\n sformat = '%Y%m%d' # Compressed ISO-style\n fformat = '%Y-%m-%d' # Less compressed ISO-style\n stoday = Date.current.strftime( sformat )\n ftoday = Date.current.strftime( fformat )\n sstart_at = report.range.min.strftime( sformat )\n fstart_at = report.range.min.strftime( fformat )\n send_at = report.range.max.strftime( sformat )\n fend_at = report.range.max.strftime( fformat )\n filename = \"report_#{ label }_on_#{ stoday }_for_#{ sstart_at }_to_#{ send_at }.csv\"\n title = [\n \"#{ report_type.to_s.capitalize } report on #{ ftoday }\",\n \"From #{ fstart_at }\",\n \"To #{ fend_at }\",\n '(inclusive)'\n ]\n\n # First compile the file.\n\n whole_csv_file = CSV.generate do | csv |\n if ( include_title )\n csv << [ report.title ] unless report.title.empty?\n csv << title\n end\n\n case report_type\n when :user\n uk_org_pond_csv_report_by_user( csv, report, headings )\n when :comprehensive\n uk_org_pond_csv_report_by_task( csv, report, headings, true )\n else\n uk_org_pond_csv_report_by_task( csv, report, headings, false )\n end\n end\n\n # Next send the data all in one go.\n\n send_data(\n whole_csv_file,\n {\n :type => 'text/csv',\n :disposition => 'attachment',\n :filename => filename\n }\n )\n\n # Indicate success.\n\n return nil\n end",
"title": ""
},
{
"docid": "29ed50a190af915373366141535f68d0",
"score": "0.56409854",
"text": "def create(type)\n case type\n when :text\n TextReportRenderer.new(@report)\n when :json\n JsonReportRenderer.new(@report, true)\n when :html\n HtmlReportRenderer.new(@report)\n when :xml\n XmlReportRenderer.new(@report)\n else\n raise \"Unknown report renderer type #{type}\"\n end\n end",
"title": ""
},
{
"docid": "8f47954506303fd09512ecc32dfb3f67",
"score": "0.5632118",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to(@wiki, :notice => 'Wiki was successfully created.') }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "065b2a19e351cd8737da43856bfe4931",
"score": "0.5570681",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n\n respond_to do |format|\n if @wiki.save\n flash[:notice] = 'Wiki was successfully created.'\n format.html { redirect_to(@wiki) }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c86dd9b67e73d8e22d54264d9d1eb86",
"score": "0.55695903",
"text": "def create\n @report_type = params[:report][:report_type] if params[:report]\n if Report.report_subclasses_strings.include? @report_type\n @report = Report.new(params[:report])\n @report = @report_type.constantize.new(params[:report])\n @report.report_type = @report_type\n else\n @report = Report.new(params[:report])\n end\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to(@report, :notice => 'Report was successfully created.') }\n format.xml { render :xml => @report, :status => :created, :location => @report }\n else\n format.html { render_report @report, :template => \"new\" }\n format.xml { render :xml => @report.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "893455328a82c263a1a474c26c3a7665",
"score": "0.55120933",
"text": "def create(results, cls, user, complete_html = false)\n @report = WickedCore.new\n @report.open(results, cls, \"PDF Report\", \"\", [], user, complete_html)\n @report.close unless complete_html\n return @report.html\n end",
"title": ""
},
{
"docid": "af5584423cef166e7b474c1bc4a1a499",
"score": "0.5486078",
"text": "def wiki(wiki_type, *args)\n # Create a table options hash\n tbl_opts = {}\n # Set some default options for the table hash\n tbl_opts[:hosts] = []\n tbl_opts[:links] = false\n tbl_opts[:wiki_type] = wiki_type\n tbl_opts[:heading_size] = 5\n case wiki_type\n when \"dokuwiki\"\n tbl_opts[:namespace] = 'notes:targets:hosts:'\n else\n tbl_opts[:namespace] = ''\n end\n\n # Get the table we should be looking at\n command = args.shift\n if command.nil? or not [\"creds\",\"hosts\",\"loot\",\"services\",\"vulns\"].include? command.downcase\n usage(wiki_type)\n return\n end\n\n # Parse the rest of the arguments\n while (arg = args.shift)\n case arg\n when '-o','--output'\n tbl_opts[:file_name] = next_opt(args)\n when '-h','--help'\n usage(wiki_type)\n return\n when '-l', '-L', '--link', '--links'\n tbl_opts[:links] = true\n when '-n', '-N', '--namespace'\n tbl_opts[:namespace] = next_opt(args)\n when '-p', '-P', '--port', '--ports'\n tbl_opts[:ports] = next_opts(args)\n tbl_opts[:ports].map! {|p| p.to_i}\n when '-s', '-S', '--search'\n tbl_opts[:search] = next_opt(args)\n when '-i', '-I', '--heading-size'\n heading_size = next_opt(args)\n tbl_opts[:heading_size] = heading_size.to_i unless heading_size.nil?\n else\n # Assume it is a host\n rw = Rex::Socket::RangeWalker.new(arg)\n if rw.valid?\n rw.each do |ip|\n tbl_opts[:hosts] << ip\n end\n else\n print_warning \"#{arg} is an invalid hostname\"\n end\n end\n end\n\n # Create an Array to hold a list of tables that we want to show\n outputs = []\n\n # Output the table\n if respond_to? \"#{command}_to_table\"\n table = send \"#{command}_to_table\", tbl_opts\n if table.respond_to? \"to_#{wiki_type}\"\n if tbl_opts[:file_name]\n print_status(\"Wrote the #{command} table to a file as a #{wiki_type} formatted table\")\n File.open(tbl_opts[:file_name],\"wb\") {|f|\n f.write(table.send \"to_#{wiki_type}\")\n }\n else\n print_line table.send \"to_#{wiki_type}\"\n end\n return\n end\n end\n usage(wiki_type)\n end",
"title": ""
},
{
"docid": "cecc76955c0811a75e88c13fc53cba9a",
"score": "0.54837155",
"text": "def generate( type, report, options = {} )\n nil\n end",
"title": ""
},
{
"docid": "c811d0d2b475a2665f271b1912e60530",
"score": "0.5478389",
"text": "def create\n @wiki = Wiki.new(wiki_params)\n @wiki.user = current_user\n @wiki.is_private = @wiki.is_private && @wiki.is_private != 0 ? 1 : nil\n @notation = @@notation\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to(wiki_path(:name => @wiki.name, :id => @wiki.id), :notice => 'Wiki was successfully created.') }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faa07d8e22711d8015f6024cb231588c",
"score": "0.54718846",
"text": "def create_report\n report_text = create_header\n TOPICS.each do |topic|\n report_text += create_grade_report(topic)\n end\n report_text += create_footer\n save_report(report_text)\n end",
"title": ""
},
{
"docid": "5ffe2ee593653c52679f160247b8911d",
"score": "0.5386545",
"text": "def create\n @wiki = Wiki.new(wiki_params)\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to @wiki, notice: 'Wiki was successfully created.' }\n format.json { render :show, status: :created, location: @wiki }\n else\n format.html { render :new }\n format.json { render json: @wiki.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24a776b30aa245d716d43d310e2d10e8",
"score": "0.5370491",
"text": "def build_report\n end",
"title": ""
},
{
"docid": "86ad6a248161360411272984b64920b9",
"score": "0.5289513",
"text": "def initialize(wiki, params={})\n super(wiki, {:type => 'pdf', :ttype => 'tex'}.merge(params))\n @texname = TeXname\n end",
"title": ""
},
{
"docid": "dd91402427b2e83041bfb8d5b7629e90",
"score": "0.5227256",
"text": "def create\n @wiki_page = WikiPage.new(params[:wiki_page])\n\n respond_to do |format|\n if @wiki_page.save\n flash[:notice] = 'WikiPage was successfully created.'\n format.html { redirect_to(@wiki_page) }\n format.xml { render :xml => @wiki_page, :status => :created, :location => @wiki_page }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki_page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07b2d02a09385efeef4515fc5af9a5fb",
"score": "0.5219117",
"text": "def create\n @wiki = Wiki.new(params[:wiki])\n @wiki.uri = @wiki.name.gsub(' ','_')\n\n respond_to do |format|\n if @wiki.save\n format.html { redirect_to wiki_path(@wiki.uri), :notice => 'Wiki was successfully created.' }\n format.xml { render :xml => @wiki, :status => :created, :location => @wiki }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "826afd52f84dbdb4a7bd4bdfe16ef986",
"score": "0.52113557",
"text": "def new\n @wiki = Wiki.new\n @wiki.name = params[:title]\n @title = \"Creating #{@wiki.name}\"\n @wikis = Wiki.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "8df1fc9bb842f3d53f9122a09851fc79",
"score": "0.52111477",
"text": "def new\n render_new_subclass = false\n @report_type = params[:report_type]\n if Report.report_subclasses_strings.include? @report_type\n @report = @report_type.constantize.new\n @report.report_type = @report_type\n render_new_subclass = true\n else\n @report = Report.new\n end\n\n respond_to do |format|\n if render_new_subclass\n format.html { render_report @report, :template => 'new' }\n format.xml { render :xml => @report }\n else\n format.html # new.html.erb\n format.xml { render :xml => @report }\n end\n end\n end",
"title": ""
},
{
"docid": "c7d0368abe290e4784de7960f85285ef",
"score": "0.5203221",
"text": "def report_definition\n\t\treport_def = {\n\t\t\tname: {difficulty: 40, approximator: \"none\", field_name:\"name\", max_datum:nil},\n\t\t\tdescription: {difficulty: 40, approximator:\"none\", field_name:\"description\", max_datum:nil},\n\t\t\trace: {difficulty: 40, approximator: \"none\", field_name:\"race_name\", max_datum:nil},\n\t\t\tmight: {difficulty: 50, approximator: \"hi_lo\", field_name:\"might\", max_datum:6},\n\t\t\twill: {difficulty: 50, approximator: \"hi_lo\", field_name:\"will\", max_datum:6},\n\t\t\tcunning: {difficulty: 50, approximator: \"hi_lo\", field_name:\"cunning\", max_datum:6},\n\t\t\tsubtlety: {difficulty: 50, approximator: \"hi_lo\", field_name:\"subtlety\", max_datum:6},\n\t\t\tperception: {difficulty: 50, approximator: \"hi_lo\", field_name:\"perception\", max_datum:6},\n\t\t\tsagacity: {difficulty: 50, approximator: \"hi_lo\", field_name:\"sagacity\", max_datum:6},\n\t\t\tcount: {difficulty:50, approximator:\"pop_approx\", field_name:\"count\", max_datum:1000},\n\t\t\tscale: {difficulty:50, approximator:\"none\", field_name:\"scale\", max_datum:nil},\n\t\t\tpersonality: {difficulty:50, approximator:\"none\", field_name:\"personality\", max_datum:nil},\n\t\t\tmood: {difficulty:50, approximator:\"none\", field_name:\"mood\", max_datum:nil},\n\t\t\torganization: {difficulty:50, approximator:\"none\", field_name:\"organization_name\", max_datum:nil}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "ef4517ab8e4c3a8535703ab12d4b8271",
"score": "0.5200056",
"text": "def create\n authorize! :manage, @wiki , :message => \"Access denied.\"\n @wiki = Wiki.new(wiki_params)\n \n respond_to do |format|\n if @wiki.save\n format.html { redirect_to @wiki, notice: 'Wiki was successfully created.' }\n format.json { render :show, status: :created, location: @wiki }\n else\n format.html { render :new }\n format.json { render json: @wiki.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc352fd56161abc905b4ff5155d4f7d0",
"score": "0.51882917",
"text": "def create_quiz_report(course_id,quiz_id,quiz_report__report_type__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :quiz_report__report_type__,\n :quiz_report__includes_all_versions__,\n :include,\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"quiz_id is required\" if quiz_id.nil?\n raise \"quiz_report__report_type__ is required\" if quiz_report__report_type__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :quiz_id => quiz_id,\n :quiz_report__report_type__ => quiz_report__report_type__\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/quizzes/{quiz_id}/reports\",\n :course_id => course_id,\n :quiz_id => quiz_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:post, path, query_params, form_params, headers)\n QuizReport.new(response)\n \n end",
"title": ""
},
{
"docid": "e72fd6602436c99c50b5d9e015d82fd8",
"score": "0.5182844",
"text": "def report_definition\n\t\treport_def = {\n\t\t\tname: {difficulty: 40, approximator: \"none\", field_name:\"name\", max_datum:nil},\n\t\t\tdescription: {difficulty: 40, approximator:\"none\", field_name:\"description\", max_datum:nil},\n\t\t\tlongevity: {difficulty: 50, approximator:\"hi_lo\", field_name:\"longevity\", max_datum: 5},\n\t\t\tfecundity: {difficulty: 50, approximator:\"hi_lo\", field_name:\"fecundity\", max_datum: 5},\n\t\t\tmight: {difficulty: 50, approximator: \"hi_lo\", field_name:\"might\", max_datum:6},\n\t\t\twill: {difficulty: 50, approximator: \"hi_lo\", field_name:\"will\", max_datum:6},\n\t\t\tcunning: {difficulty: 50, approximator: \"hi_lo\", field_name:\"cunning\", max_datum:6},\n\t\t\tsubtlety: {difficulty: 50, approximator: \"hi_lo\", field_name:\"subtlety\", max_datum:6},\n\t\t\tperception: {difficulty: 50, approximator: \"hi_lo\", field_name:\"perception\", max_datum:6},\n\t\t\tsagacity: {difficulty: 50, approximator: \"hi_lo\", field_name:\"sagacity\", max_datum:6},\n\t\t\tscale: {difficulty: 50, approximator: \"descriptive\", field_name:\"scale\", max_datum:5}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "3d1f2539c3f584bf3f69ec8c5c44398b",
"score": "0.5177944",
"text": "def generate_report(report_type, csv_file, outfile)\n puts \"Generating #{report_type} to #{outfile}...\"\n columns = (reports[report_type] or reports[reports.keys.first])\n save_graph(csv_file, columns, outfile, title: report_type) \n end",
"title": ""
},
{
"docid": "eac90052ec4d514a0103d65bc6ebef78",
"score": "0.5171676",
"text": "def create_report\n\t setup_files\n print_heading($report_file)\n print_data($report_file,$products_hash)\nend",
"title": ""
},
{
"docid": "ccf8ac455e2a2779b80897a4d261c962",
"score": "0.5164381",
"text": "def new\n @wiki = Wiki.new\n end",
"title": ""
},
{
"docid": "02bd2492407f7461a206ffba238d081e",
"score": "0.5163062",
"text": "def report_definition\n\t\treport_def = {\n\t\t\tname: {difficulty: 40, approximator: \"none\", field_name:\"name\", max_datum:nil},\n\t\t\tdescription: {difficulty: 40, approximator:\"none\", field_name:\"description\", max_datum:nil},\n\t\t\trace: {difficulty: 40, approximator: \"none\", field_name:\"race_name\", max_datum:nil},\n\t\t\tmight: {difficulty: 50, approximator: \"hi_lo\", field_name:\"might\", max_datum:6},\n\t\t\twill: {difficulty: 50, approximator: \"hi_lo\", field_name:\"will\", max_datum:6},\n\t\t\tcunning: {difficulty: 50, approximator: \"hi_lo\", field_name:\"cunning\", max_datum:6},\n\t\t\tsubtlety: {difficulty: 50, approximator: \"hi_lo\", field_name:\"subtlety\", max_datum:6},\n\t\t\tperception: {difficulty: 50, approximator: \"hi_lo\", field_name:\"perception\", max_datum:6},\n\t\t\tsagacity: {difficulty: 50, approximator: \"hi_lo\", field_name:\"sagacity\", max_datum:6},\n\t\t}\n\tend",
"title": ""
},
{
"docid": "0eb07a08e83722714c874b679a6f17d3",
"score": "0.5131746",
"text": "def my_upload_to_wiki(title, wikicontent)\n page_title = title\n page_title ||= \"odts-#{Time.now.to_i}\"\n project = Project.find(params[:project_id])\n# wiki = project.wiki\n @auto_page = project.wiki.find_or_new_page(page_title)\n @auto_page.content = WikiContent.new(:text => wikicontent.to_s, \n\t\t\t\t\t:comments => \"added by automate\",\n\t\t\t\t\t:author => User.current)\n\n @auto_page.save\n return @auto_page\n end",
"title": ""
},
{
"docid": "2cae38cd762c763ef26de87533f6a3ad",
"score": "0.5130437",
"text": "def create_report(title:, summary:, impact:, severity_rating:, source:)\n raise ArgumentError, \"Program cannot be nil\" unless program\n\n data = {\n \"data\": {\n \"type\": \"report\",\n \"attributes\": {\n \"team_handle\": program,\n \"title\": title,\n \"vulnerability_information\": summary,\n \"impact\": impact,\n \"severity_rating\": severity_rating,\n \"source\": source\n }\n }\n }\n Report.new(post(\"reports\", data))\n end",
"title": ""
},
{
"docid": "21f43c1fee2c0f484afe7988619464b8",
"score": "0.5103156",
"text": "def report(type, extension, params)\n raise \"workspace_id is required\" if @workspace_id.nil?\n get \"#{type}#{extension}\", {\n :'user_agent' => @user_agent,\n :'workspace_id' => @workspace_id,\n }.merge(params)\n end",
"title": ""
},
{
"docid": "68d9318730f3d884328ec1a74ce3d2e3",
"score": "0.5096089",
"text": "def initialize(report, options = {})\n @parameters = options.delete(:report) || {}\n @source_file = nil\n @object_file = nil\n if report.is_a?(Pathname)\n @source_file = report if report.extname.casecmp('.jrxml').zero? || report.extname.casecmp('.xml').zero?\n @object_file = report if report.extname.casecmp('.jasper').zero?\n elsif report.is_a?(String)\n hash = Digest::SHA256.hexdigest(report)\n @source_file = Pathname.new(options[:tmp_dir] || '/tmp').join('report-' + hash + '.jrxml')\n File.open(@source_file, 'wb') do |f|\n f.write(report)\n end\n end\n if locale = options.delete(:locale)\n locale_parts = locale.split('-')[0..2]\n _Locale = Rjb.import('java.util.Locale')\n @parameters['REPORT_LOCALE'] = _Locale.new(*locale_parts)\n end\n @object_file ||= @source_file.dirname.join(@source_file.basename.to_s + '.jasper')\n unless @object_file.is_a?(Pathname)\n raise ArgumentError, 'An object must be given at least'\n end\n end",
"title": ""
},
{
"docid": "03a791ffb3ce4cb60c520a36945aa981",
"score": "0.5083987",
"text": "def create_wiki(name, content, project_id, params = {})\n params.merge!(name: name, content: content, project_id: project_id)\n post('wikis', params)\n end",
"title": ""
},
{
"docid": "93850ba3ad8de7c34a7244c7b2b4f262",
"score": "0.5079141",
"text": "def new\n @wiki = Wiki.new\n if params[:title]\n @wiki.title=params[:title]\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "a81a17f09d1dd3e51d00b8c9aa139357",
"score": "0.50684255",
"text": "def report\n return Report.new(report_levels)\n end",
"title": ""
},
{
"docid": "9f07d1d7cd6e0cc0e711ab9614f8124c",
"score": "0.5056137",
"text": "def create_report_object\n rpt_rec = MiqReport.new # Create a new report record\n set_record_vars(rpt_rec) # Set the fields into the record\n rpt_rec # Create a report object from the record\n end",
"title": ""
},
{
"docid": "b7bc97e5bb3a01d467956b6cb1287a3b",
"score": "0.50554365",
"text": "def create\n @report_structure = ReportStructure.new(params[:report_structure])\n\n respond_to do |format|\n if @report_structure.save\n flash[:notice] = 'ReportStructure was successfully created.'\n format.html { redirect_to(@report_structure) }\n format.xml { render :xml => @report_structure, :status => :created, :location => @report_structure }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @report_structure.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc49924f2c902701202b4b5efd31ae90",
"score": "0.5054932",
"text": "def build_report\n puts \"building performance test report...\"\n puts\n\n # load template\n report = File.read(@template_path)\n\n # metrics result\n result_table = extract_table_from_csv2html_output(@result_path)\n\n # atop summary\n atop_summary_table = extract_table_from_csv2html_output(@atop_summary_path)\n\n # atop detail\n atop_detail_table = extract_table_from_csv2html_output(@atop_detail_path)\n\n # replace tables (do this first since table data may include parameters)\n report = report.gsub(\"$RESULT_TABLE\", result_table)\n report = report.gsub(\"$ATOP_SUMMARY_TABLE\", atop_summary_table)\n report = report.gsub(\"$ATOP_DETAIL_TABLE\", atop_detail_table)\n\n # replace parameters\n report = replace_parameters(report)\n\n # write report\n puts \"writing report to #{@output_path}\"\n\n File.write(@output_path, report)\nend",
"title": ""
},
{
"docid": "4b0547bf64be1071aa4d86b7c5c57e6b",
"score": "0.50400716",
"text": "def report_definition\n\t\treport_def = {\n\t\t\tname: {difficulty: 40, approximator: \"none\", field_name:\"name\", max_datum:nil},\n\t\t\tdescription: {difficulty: 40, approximator:\"none\", field_name:\"description\", max_datum:nil},\n\t\t\towner: {difficulty: 40, approximator: \"none\", field_name:\"owner_name\", max_datum:nil} \n\t\t}\n\tend",
"title": ""
},
{
"docid": "378f2cda0f7034fbd290cb202f277fda",
"score": "0.502951",
"text": "def report_definition\n\t\treport_def = {\n\t\t\trace: {difficulty: 40, approximator: \"none\", field_name:\"race_name\", max_datum:nil},\n\t\t\tdeity: {difficulty: 40, approximator: \"none\", field_name:\"deity_name\", max_datun:nil},\n\t\t\tclergy: {difficulty: 50, approximator: \"pop_approx\", field_name:\"clergy\", max_datum:120.0},\n\t\t\tlaity: {difficulty: 60, approximator: \"pop_approx\", field_name:\"laity\", max_datum:1200.0},\n\t\t\tloyalty: {difficulty: 80, approximator: \"hi_lo\", field_name:\"loyalty\", max_datum: 5.0},\n\t\t\tmanpower_multiplier: {difficulty:90, approximator:\"descriptive\", field_name:\"manpower_multiplier\", max_datum: 2.0},\n\t\t\tpiety_multiplier: {difficulty:90, approximator:\"descriptive\", field_name:\"piety_multiplier\", max_datum: 2.0}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "6b5887452c355b9760fbf789f02e9176",
"score": "0.4977767",
"text": "def initialize(base_path, type, format, file)\n @base_path = base_path\n @format = format || DEFAULT_FORMAT\n @type, @file = type, file.to_s\n @renderer = find\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.49749097",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.49749097",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.49749097",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "31e5a439fe6b249a079c2d2339e83d7e",
"score": "0.49678078",
"text": "def create_num_pages_report(report_type=:actual)\n report_type = :expected unless report_type == :actual\n fname_out = report_type == :actual ? FNAME_NUM_PAGES_ACTUAL_CSV : FNAME_NUM_PAGES_EXPECTED_CSV\n puts \"Creating #{report_type} number-of-pages CSV file (#{File.basename(fname_out)}) ...\"\n File.open(fname_out, 'w'){|fh|\n fh.puts \"filename,actual_npages,%scomment\" % [report_type == :actual ? \"\" : \"expected_npages,\"]\t# CSV header line\n\n @fileparts_list.each{|p|\n fpath = \"#{IN_SCAN_DIR}/#{p[:whole]}\"\n npages = get_pdf_npages(fpath)\n npages_expected = report_type == :actual ? npages : get_expected_npages(p)\n\n fh.puts \"%s,%s,%s%s\" % [\n p[:whole],\n npages.to_s,\n report_type == :actual ? \"\" : \"#{npages_expected},\",\n !npages ? \"Cannot read number of pages. Is the file-type PDF?\" :\n (npages != npages_expected ? \"Unexpected number of pages\" : \"\")\n ]\n }\n }\n end",
"title": ""
},
{
"docid": "83af9769cf99487eac0296908c5706ec",
"score": "0.4943728",
"text": "def create\n \n @report = Report.new(report_params)\n @report.created_by = current_user.worker\n @report.observations = observations_params_to_object\n @report.tasks = taks_params_to_object\n @report.shots = shots_params_to_object\n @report.vehicle_statuses = vehicle_statuses_params_to_object\n @report.absences = absences_params_to_object\n #raise params.yml\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d12e596dd0f9c00ec8945ed1f55aaa6",
"score": "0.49389678",
"text": "def create_file(src_type, dest_type, output_file, target_lang)\n file = nil\n done = false\n begin\n # Create the file in overwrite mode\n file = File.open(output_file, \"w\")\n\n # Dump the initial info into the file to start off with\n case dest_type\n when AllFather::TYPE_SCC\n file.write(\"Scenarist_SCC V1.0\\n\\n\")\n\n when AllFather::TYPE_SRT\n file.write(\"NOTE #{CREDITS}\\n\\n\")\n\n when AllFather::TYPE_VTT\n file.write(\"WEBVTT\\n\\n\")\n file.write(\"NOTE #{CREDITS}\\n\\n\")\n\n when AllFather::TYPE_TTML\n target_lang ||= \"\"\n # TODO: Move this to a template file and load from there !!\n data = <<-EOF\n<tt xml:lang=\"\" xmlns=\"http://www.w3.org/ns/ttml\">\n <head>\n <metadata xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\">\n <ttm:desc>#{CREDITS}</ttm:desc>\n </metadata>\n </head>\n <body>\n <div xml:lang=\\\"#{target_lang}\\\">\n EOF\n file.write(data)\n\n when AllFather::TYPE_DFXP\n target_lang ||= \"\"\n data = <<-EOF\n<tt xml:lang=\"\" xmlns=\"http://www.w3.org/2004/11/ttaf1\">\n <head>\n <meta xmlns:ttm=\"http://www.w3.org/2004/11/ttaf1#metadata\">\n <ttm:desc>#{CREDITS}</ttm:desc>\n </meta>\n </head>\n <body>\n <div xml:lang=\\\"#{target_lang}\\\">\n EOF\n file.write(data)\n else\n raise AllFather::InvalidInputException.new(\"Not a valid type; Failed to create output file for type #{type}\")\n end\n done = true\n ensure\n file.close if file rescue nil\n end\n done\n end",
"title": ""
},
{
"docid": "48483119720290a886b5d42a46d0ebf0",
"score": "0.49309456",
"text": "def initialize(wiki,\n pid, namespace, title, restrictions, counter, redirect, \n new, random, touched, latest, len)\n @wiki = wiki\n @pid = pid\n @namespace = namespace\n @title = title ? title.tr('_',' ') : \"p#{pid}\"\n @restrictions = restrictions # not used in 1.10\n @counter = counter\n @is_redirect = (redirect!=0)\n @is_new = (new!=0)\n @random = random\n @touched = Mediawiki.s2time(touched)\n @len = len\n\n @revisions = [] # will be filled soon\n\n @latest_rid = latest # rid of the latest revision.\n # We use this only for consistency checks.\n\n @genres = ['DEFAULT'].to_set # each page is at least in the DEFAULT \n # genre. May be updated in \n # #set_genres_from_string\n end",
"title": ""
},
{
"docid": "800eea49ddae791856dcef5a1268e5a3",
"score": "0.49306718",
"text": "def create\n\t\t\t\t#params[:report] = {title: \"test\", description: \"test body\"}\n\t\t\t\t\n\t\t\t\trespond_to do |format|\n\t\t\t\t\treport_result = GlobalMailer.delay.report(@user, params[:report][:title], params[:report][:description])\t\n\t\t\t\t\tif report_result\n\t\t\t\t\t#GlobalMailer.report(@user, \"ttite\", \"des\")\t\n\t\t\t\t\t\tformat.json { render json: \"\", status: :created }\n\t\t\t\t\telse\n\t\t\t\t\t\tformat.json { render json: \"\", status: :unprocessable_entity }\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "4cc543f3eee0795318983d4a918fb93c",
"score": "0.4923715",
"text": "def new\n @wiki_page = WikiPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki_page }\n end\n end",
"title": ""
},
{
"docid": "1ff0d4706933a8efce8e860ae1e1a685",
"score": "0.49211764",
"text": "def report_params\n params.require(:report).permit(:title, :language, :content)\n end",
"title": ""
},
{
"docid": "8ce4a80cc68f71e9f74bdffd0640ef76",
"score": "0.4918494",
"text": "def initialize(wiki, arguments)\n @wiki = wiki\n @arguments = arguments\n end",
"title": ""
},
{
"docid": "306536f3e3147b632cbb365cedcf1dd7",
"score": "0.4902719",
"text": "def create\n @wiki = Wiki.new(params.require(:wiki).permit(:title, :body))\n\n if @wiki.save\n render json: @wiki, status: :created, location: @wiki\n else\n render json: @wiki.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "87bcec9d821ef262ef00faa269f74e6e",
"score": "0.4901013",
"text": "def new\n wiki = Wiki.find_by_id(params[:id])\n if wiki then\n @wiki = Wiki.new(name: wiki.name, title: wiki.title, content: wiki.content, is_private: wiki.is_private)\n else\n @wiki = Wiki.new\n end\n @notation = @@notation\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "9d46baabdb813da5c8bab08098fb2fdc",
"score": "0.49003652",
"text": "def save_templatized_report\n @template = MetricFu.template_class.new\n @template.report = report_hash\n @template.write\n end",
"title": ""
},
{
"docid": "97e6087b3ebada76360c11ab1bd75034",
"score": "0.48986432",
"text": "def initialize(wiki = nil, user = nil, pass = nil, agent = nil, max_lag = nil)\n\t\t# Read Configuration file defined in \"initrbw.rb\"\n\t\t@conf = YAML::load_file ConfigFile\n\t\t# Get the wiki name to use, from the argument if defined or the configuration\n\t\t@wikid = wiki ? wiki : @conf['wiki']\n\n\t\t# Load the wiki's configuration\n\t\tbegin\n\t\t\tif File.readable?(ConfigDir + 'wikis/' + @wikid + '.yaml')\n\t\t\t\t@wikiconf = YAML::load_file(ConfigDir + 'wikis/' + @wikid + '.yaml')\n\t\t\telse\n\t\t\t\t@wikiconf = YAML::load_file(INC + '../wikis/' + @wikid + '.yaml')\n\t\t\tend\n\t\trescue ArgumentError\n\t\t\traise RubyWikiError, 12, 'Invalid Wiki Config'\n\t\trescue Errno::ENOENT\n\t\t\traise RubyWikiError, 13, 'Wiki doesn\\'t exist'\n\t\tend\n\t\t\n\t\t# Get Wiki Data\n\t\t# Wiki Name\n\t\t@wikiname = @wikiconf['name']\n\t\t# Replicate DB lag level\n\t\t@max_lag = @wikiconf['maxlag']\n\t\t# Edit per minute\n\t\t@epm = @wikiconf['epm']\n\t\t# Wiki Protocol\n\t\t@proto = @wikiconf['protocol']\n\t\t# Wiki Domain\n\t\t@host = @wikiconf['domain']\n\t\t# Path to wiki installation directory relative to @host\n\t\t@path = @wikiconf['path']\n\t\t# Article Path relative to @host\n\t\t@article = @wikiconf['article']\n\t\t# API.php filename\n\t\t@api_script = @wikiconf['api']\n\t\t# End of Get Wiki Data\n\t\t\n\t\t# Merge wiki configuration to make the absolute URL to API.php\n\t\t@api_url = @proto + '://' + @host + @path + '/' + @api_script\n\t\t# Generate the User-Agent of the Bot\n\t\t@useragent = agent ? agent : (\n\t\t\t@conf['useragent'] == 'default' ?\n\t\t\t\t'RubyWiki/' + RBW_VERSION :\n\t\t\t\t@conf['useragent']\n\t\t\t)\n\t\t# Figure out the log level\n\t\t@loglevel = RubyWiki::const_get(@conf['loglevel'])\n\t\t\n\t\t# Username and password\n\t\t# Get the username to use, from the argument if defined or the configuration\n\t\tif user\n\t\t\t@user = user\n\t\telsif @conf['user']\n\t\t\tif @conf['users'][@wikid].include?@conf['user']\n\t\t\t\t@user = @conf['user']\n\t\t\telsif @conf['users'][@wikid][0]\n\t\t\t\t@user = @conf['users'][@wikid][0]\n\t\t\telse\n\t\t\t\texception RubyWikiError, 11, 'No Such User'\n\t\t\tend\n\t\telse\n\t\t\tif @conf['users'][@wikid][0]\n\t\t\t\t@user = @conf['users'][@wikid][0]\n\t\t\telse\n\t\t\t\texception RubyWikiError, 11, 'No Such User'\n\t\t\tend\n\t\tend\n\t\t# Get password\n\t\tif pass\n\t\t\t@pass = pass\n\t\telsif @conf['pass'][@wikid][@user]\n\t\t\t@pass = @conf['pass'][@wikid][@user]\n\t\telse\n\t\t\trequire 'highline/import'\n\t\t\t@pass = ask(\"Type in the password for #{@user}@#{@wikiname}:\") { |q| q.echo = \"*\" }\n\t\tend\n\t\t# End of Username and password\n\t\t\n\t\t# Open the log file\n\t\t@log = File.open(ConfigDir + 'rubywiki.log', 'a')\n\t\t\n\t\t# Max Slave DB lag level\n\t\tif max_lag \n\t\t\t@max_lag = max_lag\n\t\telse\n\t\t\t@max_lag = 5\n\t\tend\n\t\t\n\t\t# Define Destructor\n\t\tObjectSpace.define_finalizer(self, self.method(:finalize).to_proc)\n\t\t\n\t\t# Initialize cURL Handles\n\t\tinit_curl!\n\t\t\n\t\t# Debug Log\n\t\tlog \"RubyWiki/#{RBW_VERSION} started\", LL_DEBUG\n\t\tlog \"Ruby Version #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\", LL_DEBUG\n\t\t\n\t\t# Login\n\t\tlogin! unless user_name == @user\n\tend",
"title": ""
},
{
"docid": "f5a578d53e78ae6e23bb84344a87ab2f",
"score": "0.48915738",
"text": "def report\n get_all_metrics\n get_description_from_params\n create_report('google_analytics/index.pdf.erb')\n end",
"title": ""
},
{
"docid": "9267caae8e104c8c2e05ea7937536489",
"score": "0.48915106",
"text": "def create\n @celeb_wiki = CelebWiki.new(celeb_wiki_params)\n\n respond_to do |format|\n if @celeb_wiki.save\n format.html { redirect_to @celeb_wiki, notice: 'Celeb wiki was successfully created.' }\n format.json { render :show, status: :created, location: @celeb_wiki }\n else\n format.html { render :new }\n format.json { render json: @celeb_wiki.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aba3fcabbea9df8fba29f1bff39d5f2e",
"score": "0.48909473",
"text": "def set_report_file\n if @params[0].include? '.txt'\n $results = Results.new(@driver, @results_dir, @params[0])\n $results.print('New Output file: ' + @params[0])\n end\n end",
"title": ""
},
{
"docid": "6e3fee4d0fe2e6d5cd4eb42c9410910e",
"score": "0.4888282",
"text": "def create\n @report_type = ReportType.new(report_type_params)\n\n respond_to do |format|\n if @report_type.save\n format.html { redirect_to @report_type, notice: 'Report type was successfully created.' }\n format.json { render :show, status: :created, location: @report_type }\n else\n format.html { render :new }\n format.json { render json: @report_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "957d54be8ce0a4d91ccd5d6407b94984",
"score": "0.48811695",
"text": "def make_report # :nologin: :norobots:\n names = SpeciesList.find(params[:id]).names\n case params[:type]\n when 'txt'\n render_name_list_as_txt(names)\n when 'rtf'\n render_name_list_as_rtf(names)\n when 'csv'\n render_name_list_as_csv(names)\n else\n flash_error(:make_report_not_supported.t(:type => params[:type]))\n redirect_to(:action => \"show_species_list\", :id => params[:id])\n end\n end",
"title": ""
},
{
"docid": "3ffed3b190292d81dbee4dbe2e44188b",
"score": "0.48800424",
"text": "def create_report\n raise Exception unless system \"find #{$results_path}/ -name \\\\*.png | xargs rm -f \"\n\n $bases.keys.map{|i| i.to_s.gsub(/.*_Testes10/,\"\")}.each do |b|\n puts \"GNUPLOT\"\n if %x[which gnuplot].empty?\n puts \"ERROR: The images cannot be generated because gnuplot was not found!\"\n return\n end\n if $clusters[0] == \"hfcm\" or $clusters[1] == \"hfcm\"\n 5.times do |x|\n raise Exception unless system \"ruby plot.rb #{b}-level-#{x} #{$results_path}/#{$verbose_cmd}\"\n end\n else\n raise Exception unless system \"ruby plot.rb #{b} #{$results_path}/#{$verbose_cmd}\"\n end\n end\n puts \"find #{$results_path}/ -name \\\\*.png -size 0 | xargs rm\" if $verbose\n raise Exception unless system \"find #{$results_path}/ -name \\\\*.png -size 0 | xargs rm -f\"\n\n File.open(\"#{$results_path}/results.tex\", \"a+\") do |file|\n puts \"Creating report in latex format...\"\n raise Exception unless system \"cat article_2.tex | sed -s 's/CURRENTDATE/#{Time.now.strftime(\"%B %Y\")}/g' | sed -s 's/ALGORITHMS/#{$clusters.map{|c| c.upcase }.join(\", \")}/g' | tee > #{$results_path}/results.tex #{$verbose_err_cmd}\"\n\n #documents_table(file)\n\n file.write \"\\\\begin{multicols}{2} \\n\"\n $bases.each do |b,path|\n b = b.to_s\n file.write \"\\\\section{#{b.capitalize.gsub(/_/,\"-\")}}\\n\\n\"\n if $clusters[0] == \"hfcm\" or $clusters[1] == \"hfcm\"\n handle_hierarchy(file, b)\n file.write \"\\\\newpage\\n\\n\"\n else\n handle_clustering(file, \"#{$results_path}/#{b}\")\n end\n end\n draw_end(file)\n end\n if %x[which pdflatex].empty?\n puts \"ERROR: The report cannot be generated because pdflatex was not found!\"\n return\n end\n raise Exception unless system \"pdflatex #{$results_path}/results.tex#{$verbose_cmd}\"\n puts \"Display report...\"\n raise Exception unless system \"evince results.pdf#{$verbose_cmd}\"\nend",
"title": ""
},
{
"docid": "a85bbc4b6abfda82c1072cfdf238b93b",
"score": "0.48733974",
"text": "def create\n @report_type_report = ReportTypeReport.new(params[:report_type_report])\n\n respond_to do |format|\n if @report_type_report.save\n format.html { redirect_to @report_type_report, notice: 'Report type report was successfully created.' }\n format.json { render json: @report_type_report, status: :created, location: @report_type_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report_type_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7958d5848182113d54b48452c7f09eea",
"score": "0.4873243",
"text": "def create\n @report_type = ReportType.new(report_type_params)\n\n if @report_type.save\n render :show, status: :created, location: @report_type\n else\n render json: @report_type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c782fabade0b2328a09a36cf7b092c9b",
"score": "0.48713508",
"text": "def create\n @report_type = ReportType.new(report_type_params)\n\n respond_to do |format|\n if @report_type.save\n format.html { redirect_to @report_type, notice: \"Report type was successfully created.\" }\n format.json { render :show, status: :created, location: @report_type }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @report_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a14c1c8e98370cd4a573d524dc2bdbc",
"score": "0.48712286",
"text": "def initialize(site, base, index_files, dir, page_data_prefix, data, name, name_expr, title, title_expr, template, extension, debug)\n @site = site\n @base = base\n\n if debug\n puts \"debug (datapage-gen) Record read:\"\n puts \">> #{data}\"\n\n puts \"debug (datapage-gen) Configuration variables:\"\n [:index_files, :dir, :page_data_prefix, :name, :name_expr, :title, :title_expr, :template, :extension].each do |variable|\n puts \">> #{variable}: #{eval(variable.to_s)}\"\n end\n end\n\n # @dir is the directory where we want to output the page\n # @name is the name of the page to generate\n # @name_expr is an expression for generating the name of the page\n #\n # the value of these variables changes according to whether we\n # want to generate named folders or not\n if name_expr\n record = data\n raw_filename = eval(name_expr)\n if raw_filename == nil\n puts \"error (datapage-gen). name_expr '#{name_expr}' generated an empty value in record #{data}\"\n return\n end\n puts \"debug (datapage-gen). using name_expr: '#{raw_filename}' (sanitized) will be used as the filename\" if debug\n else\n raw_filename = data[name]\n if raw_filename == nil\n puts \"error (datapage-gen). empty value for field '#{name}' in record #{data}\"\n return\n end\n puts \"debug (datapage-gen). using name field: '#{raw_filename}' (sanitized) will be used as the filename\" if debug\n end\n\n if title_expr\n record = data\n raw_title = eval(title_expr)\n if raw_title == nil\n puts \"error (datapage-gen). title_expr '#{title_expr}' generated an empty value in record #{data}\"\n return\n end\n puts \"debug (datapage-gen). using title_expr: '#{raw_title}' will be used the page title\" if debug\n else\n raw_title = data[title]\n if raw_title == nil\n raw_title = raw_filename # for backwards compatibility\n puts \"debug (datapage-gen). empty title field: falling back to filename for the page title\" if debug\n end\n puts \"debug (datapage-gen). will use '#{raw_title}' as the page title\" if debug\n end\n\n filename = sanitize_filename(raw_filename).to_s\n\n @dir = dir + (index_files ? \"/\" + filename + \"/\" : \"\")\n @name = (index_files ? \"index\" : filename) + \".\" + extension.to_s\n\n self.process(@name)\n\n if @site.layouts[template].path.end_with? 'html'\n @path = @site.layouts[template].path.dup\n else\n @path = File.join(@site.layouts[template].path, @site.layouts[template].name)\n end\n\n base_path = @site.layouts[template].path\n base_path.slice! @site.layouts[template].name\n self.read_yaml(base_path, @site.layouts[template].name)\n\n self.data['title'] = raw_title\n\n # add all the information defined in _data for the current record to the\n # current page (so that we can access it with liquid tags)\n if page_data_prefix\n self.data[page_data_prefix] = data\n else\n if data.key?('name')\n data['_name'] = data['name']\n end\n self.data.merge!(data)\n end\n\n end",
"title": ""
},
{
"docid": "052dc1612150e2ccb47f087555b4fe40",
"score": "0.486584",
"text": "def create_report\n\ttitle_report(\"Sales Report\")\n\tprint_report \"********************\"\n\t# Displays the time when the salee report was generated.\n\ttime_date\n\tprint_report \"********************\"\n\t# Prints all the products data to the sales report\n\tprint_products\n\t# Prints all the brand data to the the sales report\n\tprint_brands\nend",
"title": ""
},
{
"docid": "89fed5aa6d021367ddb95e0c72144da6",
"score": "0.48606095",
"text": "def report (opts = {})\n default_options = {\n :user => 'all',\n :group_subaccount => true,\n :report_type => 'basic'\n }\n\n opts.reverse_merge! default_options\n post 'report', opts, \"report_#{opts[:report_type]}\".to_sym\n end",
"title": ""
},
{
"docid": "31dbf48870cb5e8991baf1c1a466ab1e",
"score": "0.48604035",
"text": "def wiki\n @wiki ||= Smeagol::Wiki.new(wiki_dir)\n end",
"title": ""
},
{
"docid": "31dbf48870cb5e8991baf1c1a466ab1e",
"score": "0.48604035",
"text": "def wiki\n @wiki ||= Smeagol::Wiki.new(wiki_dir)\n end",
"title": ""
},
{
"docid": "c2a0c47c7a18c9b3d1ba58c9701bc680",
"score": "0.48577604",
"text": "def create_sample_report\n status \"creating sample_report\"\n sample_report = SampleReportMaker.make(@flowcell)\n File.open(@flowcell.paths.sample_report_path, 'w') do |file|\n file.puts sample_report\n end\n end",
"title": ""
},
{
"docid": "c9bb2869280dcec3899d37170df68e9a",
"score": "0.48523626",
"text": "def create_report\n print_heading\n print_data\nend",
"title": ""
},
{
"docid": "0da91f2f30cf627cba487371bcc8e423",
"score": "0.48494118",
"text": "def report\n \tif params[:output_format] == \"CSV\"\n \t\texport_data_csv\n \telse params[:output_format] == \"Excel\"\n \t\texport_data_excel\n \tredirect_to root_url, notice: \"Report created!\"\n \tend\n end",
"title": ""
},
{
"docid": "88c4d4242f40aa5c76c8c145e6541441",
"score": "0.4848287",
"text": "def start \n\tsetup_files # load, read, parse, and create the files\n create_report # create the report!\t\nend",
"title": ""
},
{
"docid": "bc33b7d5f03d0063327c3f5efcb07387",
"score": "0.4834256",
"text": "def report\n end",
"title": ""
},
{
"docid": "bc33b7d5f03d0063327c3f5efcb07387",
"score": "0.4834256",
"text": "def report\n end",
"title": ""
},
{
"docid": "692f7a5b88e69754e557071959de21c7",
"score": "0.48320535",
"text": "def new\n @wiki_page = WikiPage.new(:name => params[:name])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki_page }\n end\n end",
"title": ""
},
{
"docid": "94eb39984555f73bc3e0b83d4b73fa5e",
"score": "0.48300862",
"text": "def newReport( reports_batch )\n\tend",
"title": ""
},
{
"docid": "0f635dc61b9d7e75434318db634a94f5",
"score": "0.4817374",
"text": "def initialize(params = {})\n # puts \"INITIALIZINGGGG!!!\"\n @now = params[:now] || Time.now\n @directory = params[:directory] || File.join(Dir.home, '.ttimetracker')\n @subdirectory = params[:subdirectory] || File.join(@directory, now.year.to_s, now.strftime(\"%m_%b\"), '')\n @filename = params[:filename] || File.join(@subdirectory, now.strftime('%Y-%m-%d') + '.csv')\n self.class.mkdir @subdirectory\n end",
"title": ""
},
{
"docid": "3c07d398621a941cad47f97fa70eb75c",
"score": "0.48140326",
"text": "def get_report(type, id, format)\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "c386ba81336661daa2aca5c7ecc4f5ca",
"score": "0.480546",
"text": "def render_report(format=nil)\n format ||= 'html'\n unless @report.valid?\n flash[:error] = t(:invalid_report)\n redirect_to :back\n return\n end\n\n rendered_report = @report.render(format)\n\n case format\n when 'pdf'\n send_data(rendered_report,\n :type => \"application/pdf\",\n :filename => \"#{@report.file_name}.pdf\"\n )\n when 'csv'\n send_data(rendered_report,\n :type => \"text/csv\",\n :filename => \"#{@report.file_name}.csv\"\n )\n when 'html'\n @rendered_report = rendered_report\n render :action => 'show', :layout => 'report_layout'\n else\n raise(RuntimeError, \"Format: #{format}, is currently not supported\", caller)\n end\n end",
"title": ""
},
{
"docid": "8944e83c7debc2e4cac476b8aa0f44de",
"score": "0.48052147",
"text": "def new\n @report = Report.new\n end",
"title": ""
},
{
"docid": "a78afe76adcd7d766fe8cb5333cb8875",
"score": "0.48040414",
"text": "def create_report_pdf(record)\n respond_to do |format|\n format.html\n format.pdf do\n render :pdf => 'AbcReporting',\n :disposition\t => 'attachment', \n :template => 'documents/download_pdf.pdf.erb',\n :show_as_html => false, \n :page_size => 'Letter', \n :default_header => false,\n :margin => {:top => 40, :bottom => 15},\n :header => {:html => { :template => 'documents/pdfheader1.pdf.erb',\n :layout => false, \n :locals => {:foo => \"kashif\" },\n :margin => {:top => 5, :bottom => 20 }\n },\n :background => \"#000\",\n :no_background => false,\n :image => true,\n }\n end\n end\n end",
"title": ""
},
{
"docid": "0b78da1cac427f88b2c68bab1b9d10d8",
"score": "0.4801775",
"text": "def generate_report(report_params = {})\r\n\r\n start_time = get_time(report_params[:start])\r\n end_time = get_time(report_params[:end])\r\n\r\n program = AffiliateProgram.find(report_params[:id])\r\n results_csv = program.generate_report(start_time, end_time)\r\n\r\n report_file_name = write_report_to_file(program.name, results_csv)\r\n\r\n program.last_report_filename = report_file_name\r\n program.save\r\n\r\n persistent_job.finish! if persistent_job\r\n end",
"title": ""
},
{
"docid": "738c9499e6b3ca4cefcd8d90d191b4fc",
"score": "0.47993308",
"text": "def initialize(wiki)\n @wiki = wiki\n @blob = nil\n @path = nil\n end",
"title": ""
},
{
"docid": "a5430592acccf2a412dd6366ad329fe2",
"score": "0.4798299",
"text": "def make_report # :nologin: :norobots:\n if @species_list = find_or_goto_index(SpeciesList, params[:id].to_s)\n names = @species_list.names\n case params[:type]\n when 'txt'\n render_name_list_as_txt(names)\n when 'rtf'\n render_name_list_as_rtf(names)\n when 'csv'\n render_name_list_as_csv(names)\n else\n flash_error(:make_report_not_supported.t(:type => params[:type]))\n redirect_to(:action => \"show_species_list\", :id => params[:id].to_s)\n end\n end\n end",
"title": ""
},
{
"docid": "0972e8218d4bb4bcb1d316fe7c4da53e",
"score": "0.47949284",
"text": "def report\n Report.new(self)\n end",
"title": ""
},
{
"docid": "0972e8218d4bb4bcb1d316fe7c4da53e",
"score": "0.47949284",
"text": "def report\n Report.new(self)\n end",
"title": ""
},
{
"docid": "0972e8218d4bb4bcb1d316fe7c4da53e",
"score": "0.47949284",
"text": "def report\n Report.new(self)\n end",
"title": ""
},
{
"docid": "d183ed6b28cf2af135159ae3ca68099b",
"score": "0.47921783",
"text": "def report(group, ip, name, type, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'report'\n\t\targs[:query]['group'] = group\n\t\targs[:query]['ip'] = ip\n\t\targs[:query]['name'] = name\n\t\targs[:query]['type'] = type\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :config\n\t\t\targs[:query]['config'] = optional[:config]\n\t\tend\n\t\tif optional.key? :softversion\n\t\t\targs[:query]['softversion'] = optional[:softversion]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "ad94073c7acd7a51dfd18d9785f350aa",
"score": "0.47904095",
"text": "def wmap_report(parent_id,entity,etype,value,notes)\n\t\tif parent_id and framework.db.report_active? \n\t\t\treturn framework.db.create_report(parent_id,entity,etype,value,notes,self.name)\n\t\tend\n\t\t\n\t\tnil\n\tend",
"title": ""
},
{
"docid": "28115978e2c6817a4f324e529abb60d9",
"score": "0.47855258",
"text": "def report_definition\n\t\treport_def = {\n\t\t\tname: {difficulty: 40, approximator: \"none\", field_name:\"name\", max_datum:nil},\n\t\t\tdevelopment_multiplier: {difficulty: 50, approximator: \"descriptive\", field_name:\"development_multiplier\", max_datum:2},\t\t\n\t\t\tdifficulty: {difficulty: 50, approximator: \"hi_lo\", field_name:\"difficulty\", max_datum:5},\n\t\t\twater: {difficulty: 50, approximator: \"hi_lo\", field_name:\"water\", max_datum:5}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "71fc51d43e3fff8f6b3c5f6436d413ac",
"score": "0.47852078",
"text": "def create_report_index()\n path = File.join(@name , \"rpt\")\n report_name, report_name_html = \"index.txt\" ,\"index.html\"\n files = [] ; Dir.entries(path).each do |fn|\n if !['.','..',report_name,report_name_html].include?(fn)\n files << File.new(File.join(path, fn))\n end\n end\n File.open(report_name , \"w\") do |f|\n f.puts \"|_.Time|_.Type|_.Method|_.Remark|_.Options|\"\n files.sort_by{|e|e.mtime}.reverse.map do |e|\n a = e.name.split(\"@\").map{|e2|(e2.size > 0)? e2 : \"None\"}\n f.puts \"|\\\"#{e.mtime}\\\":#{get_log_filepath(e.name)}|#{a[1]}|#{a[2]}|#{a[3]}|\\\"#{a[4]}\\\":#{get_rpt_filepath(e.name)}|\"\n end\n end\n print_report( report_name , :path=>path )\n end",
"title": ""
},
{
"docid": "a64b44a3cdb64e6b6b18dac7d2801982",
"score": "0.477816",
"text": "def create\n @report_type = ReportType.new(params[:report_type])\n\n respond_to do |format|\n if @report_type.save\n format.html { redirect_to @report_type, notice: 'Report type was successfully created.' }\n format.json { render json: @report_type, status: :created, location: @report_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d286b3cd05451c81de95e3ecf033f7be",
"score": "0.47697228",
"text": "def new\n \t\n\tStatusValue.new(0, 'whymustidothis')\n @report = Report.new\n\t@report.jtrac = JTrac.new\n\t@report.description = Description.new\n\t@report.navigation = Navigation.new\n\t@report.report_status_id = ReportStatus::TESTING_L5M.id\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @report }\n end\n end",
"title": ""
},
{
"docid": "001c4dd9accaa3146d757ffb75036fa3",
"score": "0.47656798",
"text": "def write(wiki, path = nil, version = nil, settings: nil,\n author: nil, message: nil)\n path ||= @wm.settings_page_path\n\n data = case File.extname(path)\n when \".md\"\n wikifile = wiki.wikifile(path)\n raw_data = wikifile.nil? ? \"\" : wikifile.raw_data\n set_frontmatter(settings, raw_data)\n when \".json\"\n JSON.generate settings\n when \".yml\", \".yaml\"\n YAML.dump settings\n else\n raise \"cannot generate data for #{file}\"\n end\n log_debug \"write\"\n log_debug \" settings: #{settings}\"\n log_debug \" path: #{path}\"\n log_debug \" data: #{data}\"\n\n wiki.commit_files(\n author: author,\n message: message,\n files: {path => data}\n )\n\n end",
"title": ""
},
{
"docid": "92c92940aae3b4958547378ad842d5d6",
"score": "0.47564092",
"text": "def create\n @screen = session.active_screen\n @form_content_reuse = params[:form_content_reuse]\n\n file = params[:report_template][:file].to_s\n\n if file =~ /^ReportTemplates/\n params[:report_template]['file'] = 'none'\n params[:report_template]['type'] = file\n else\n params[:report_template]['type'] = 'ReportTemplate'\n end\n\n @report_template = ReportTemplate.new(params[:report_template])\n @report_template.type = params[:report_template]['type']\n @report_template.save\n end",
"title": ""
},
{
"docid": "4d2b51b2ff953a4a46cf1a3caf595225",
"score": "0.47530425",
"text": "def create\n @wiki_page = WikiPage.new(params[:wiki_page])\n @wiki_page.author = current_user\n\n respond_to do |format|\n if (params[:commit] == 'Cancel')\n format.html { redirect_to(wiki_page_url(params[:referring_pagename])) }\n format.xml { head :ok }\n else\n if @wiki_page.save\n flash[:notice] = 'WikiPage was successfully created.'\n format.html { redirect_to(@wiki_page) }\n format.xml { render :xml => @wiki_page, :status => :created, :location => @wiki_page }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wiki_page.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9c2d44ebf32ad9f80ca951e927696551",
"score": "0.4751841",
"text": "def create\n \n respond_to do |format|\n if @report.save\n flash[:notice] = 'Report was successfully created.'\n format.html { redirect_to(@report) }\n format.xml { render :xml => @report, :status => :created, :location => @report }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @report.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
577bf52bd534f8251a41ed8c60c890da
|
Raise of custom type
|
[
{
"docid": "b125ea6e89452cda2ca189a1b8a2f977",
"score": "0.0",
"text": "def run!\n raise ArgumentError, \"This is a basic exception.\"\nend",
"title": ""
}
] |
[
{
"docid": "8399a580fb0b7f5f90ad980fcdb4f00d",
"score": "0.6093225",
"text": "def ri(value)\n raise value.inspect\nend",
"title": ""
},
{
"docid": "8399a580fb0b7f5f90ad980fcdb4f00d",
"score": "0.6093225",
"text": "def ri(value)\n raise value.inspect\nend",
"title": ""
},
{
"docid": "68fc49a478663b52ccf21fc2dcdc6758",
"score": "0.60114247",
"text": "def invoke\n Kernel.raise(self)\n end",
"title": ""
},
{
"docid": "0d70296f055df63853b325a62e7fe2ec",
"score": "0.5973016",
"text": "def raise(*args)\n ::Object.send(:raise, *args)\n end",
"title": ""
},
{
"docid": "0d70296f055df63853b325a62e7fe2ec",
"score": "0.5973016",
"text": "def raise(*args)\n ::Object.send(:raise, *args)\n end",
"title": ""
},
{
"docid": "0d70296f055df63853b325a62e7fe2ec",
"score": "0.5973016",
"text": "def raise(*args)\n ::Object.send(:raise, *args)\n end",
"title": ""
},
{
"docid": "2b5fb44017c0c913f0d04a47ecda41f5",
"score": "0.5960836",
"text": "def should_raise=(val); end",
"title": ""
},
{
"docid": "b67857094fe8aeefcc444737d5a8e081",
"score": "0.59581804",
"text": "def type\n raise \"override me\"\n end",
"title": ""
},
{
"docid": "84bc6e670ec77559152894765da24c72",
"score": "0.5944923",
"text": "def raise(*args)\r\n ::Object.send(:raise, *args)\r\n end",
"title": ""
},
{
"docid": "aa6fd486d5a5f7037f625ce9da8032b1",
"score": "0.5943629",
"text": "def raise(*args)\n ::Object.send(:raise, *args)\n end",
"title": ""
},
{
"docid": "5785c390b1b41053fe276dfd60728603",
"score": "0.589601",
"text": "def and_raise(*args, &block); end",
"title": ""
},
{
"docid": "5aa23556536f7f4a21e77f0af1142122",
"score": "0.5849953",
"text": "def raise(*args)\n ::Object.send(:raise, *args)\n end",
"title": ""
},
{
"docid": "d3e20ca42d47aa128130e38d240c4c85",
"score": "0.58115983",
"text": "def raise_on_type_mismatch!(record); end",
"title": ""
},
{
"docid": "597ccc1ece70f98a35f723075b4f3052",
"score": "0.57441634",
"text": "def raises\n parsed {\n @raises\n }\n end",
"title": ""
},
{
"docid": "597ccc1ece70f98a35f723075b4f3052",
"score": "0.57441634",
"text": "def raises\n parsed {\n @raises\n }\n end",
"title": ""
},
{
"docid": "3754c0c3ce08a02d6e30ac4a0a8608b3",
"score": "0.5693858",
"text": "def arbitrary\n raise(NotImplementedError, _message_should_be_overrided)\n end",
"title": ""
},
{
"docid": "75826e3b308bc4d3c4444150befd9156",
"score": "0.5600078",
"text": "def raising(arg, message=nil)\n @raising = RaiseAsserter.new arg, message\n end",
"title": ""
},
{
"docid": "4ae11db07f5cc5663d2dc0ba85788288",
"score": "0.5544011",
"text": "def exception_subtype( id )\r\n end",
"title": ""
},
{
"docid": "8015544dfcb37a7812a98acb7b0b5971",
"score": "0.54032785",
"text": "def return_type\n raise \"You did not specify a return type for the #{modifier_name} modifier. Please specify if it is an :integer, :string, etc.\"\n end",
"title": ""
},
{
"docid": "135e854501be9f075319c8dbfbb86bae",
"score": "0.5397033",
"text": "def value()\n raise \"child class must implement value\"\n end",
"title": ""
},
{
"docid": "89508da3cd10df7414b215771ff506ba",
"score": "0.5358846",
"text": "def base\n raise AnyError, \"No base type for type #{self}\"\n end",
"title": ""
},
{
"docid": "33b63079a9eecb54acadfca04e6cbbaa",
"score": "0.53391594",
"text": "def raises\n @parser.raises\n end",
"title": ""
},
{
"docid": "9c3dddb58ccd735b33c886bb93341651",
"score": "0.5324966",
"text": "def assertRaiseKindOfInvalidTest exception\n assertRaiseKindOf TypeError do\n assertRaiseKindOf exception do\n raise\n end\n end\n end",
"title": ""
},
{
"docid": "09433717c0d3e76929b7d5308b6c22d2",
"score": "0.53238916",
"text": "def type\n fail\n end",
"title": ""
},
{
"docid": "db855fd5b1df18e20ee46e8e773ae2a2",
"score": "0.5299982",
"text": "def raise_on_invalid_const; end",
"title": ""
},
{
"docid": "13f79256bd9b4694e5dd68f3ef9bb7c1",
"score": "0.52989596",
"text": "def handled_types\n\t\tsuper << Printing_Error\n\tend",
"title": ""
},
{
"docid": "7d6a874640a6649c250499e4d68c0ad2",
"score": "0.52884406",
"text": "def raise!(t = Time.now)\n self.raise_time = t\n self.send\n end",
"title": ""
},
{
"docid": "3b8ef1bfea93883ea681add8d82c8bc7",
"score": "0.52869874",
"text": "def value\n throw \"not implemented\"\n end",
"title": ""
},
{
"docid": "f13f9628b538e14f4543ca5bb0f22ce5",
"score": "0.52848643",
"text": "def assertRaiseKindOfWithMessageTest exception, message\n assertRaiseKindOf exception, message do\n raise exception\n end\n end",
"title": ""
},
{
"docid": "f58857e626396f451d0a37acf27bcec3",
"score": "0.52845865",
"text": "def assertRaiseKindOfWithMessageInvalidTest exception, message\n assertRaiseKindOf TypeError do\n assertRaiseKindOf exception, message do\n raise\n end\n end\n end",
"title": ""
},
{
"docid": "b808a3f5fb9cdaf1db883e57fc9db3db",
"score": "0.5280949",
"text": "def e(*) end",
"title": ""
},
{
"docid": "f4c9f528a77e849d8bebe647efad2204",
"score": "0.52759826",
"text": "def raise\n klass = case is\n when \"obix:BadUriErr\"\n OBIX::BadURIError\n when \"obix:UnsupportedErr\"\n OBIX::UnsupportedError\n when \"obix:PermissionErr\"\n OBIX::PermissionError\n else\n OBIX::Error\n end\n\n super klass, self.to_xml\n end",
"title": ""
},
{
"docid": "da97a38a946b6ce97015ea23b99bcef6",
"score": "0.52720785",
"text": "def method_missing(method, *args, &block)\n if enum = self[method]\n enum\n elsif method =~ /^to_/\n super\n else\n raise NameError, \"enum #{method} not found\"\n end\n end",
"title": ""
},
{
"docid": "5c167dd25fb849a900b5dc6515114b68",
"score": "0.5269911",
"text": "def get_type()\n raise \"abstract clalled on #{self}\"\n end",
"title": ""
},
{
"docid": "b8ff5497c1c797f4ad305a695e187b18",
"score": "0.52664113",
"text": "def method_missing(method_name, *arguments)\n return super if self == Enum\n valid?(method_name) ? new(method_name.to_s) : super\n end",
"title": ""
},
{
"docid": "f75f3856dade70ec91b206f4f3e5b204",
"score": "0.52662015",
"text": "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumSetError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumSetError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end",
"title": ""
},
{
"docid": "3c5b58d9e6e73602c94d8dbacbf4565f",
"score": "0.52624613",
"text": "def awesome_self(object, type); end",
"title": ""
},
{
"docid": "3c5b58d9e6e73602c94d8dbacbf4565f",
"score": "0.52624613",
"text": "def awesome_self(object, type); end",
"title": ""
},
{
"docid": "0933035b4d09f57b2718f9d50a414803",
"score": "0.52539",
"text": "def type\n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "4442a6e47d1f83022278a3cf6b0efad3",
"score": "0.5252641",
"text": "def type\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4b7ba0223b2eb3b470417c70f4ddbfd3",
"score": "0.52486676",
"text": "def assertRaiseKindOfTest exception\n assertRaiseKindOf exception do\n raise exception\n end\n end",
"title": ""
},
{
"docid": "752556f94e3003ff101a22867e40eaf1",
"score": "0.5246668",
"text": "def msg_raise(msg, err)\n\n fei = msg['fei']\n wfid = msg['wfid'] || msg.fetch('fei', {})['wfid']\n\n @context.storage.put_msg(\n 'raise',\n 'fei' => fei,\n 'wfid' => wfid,\n 'msg' => msg,\n 'error' => deflate(err, fei))\n end",
"title": ""
},
{
"docid": "a6f9002754847f87a16148ab838ad4bc",
"score": "0.5243014",
"text": "def returning; raise \"Not Yet Implemented\"; end",
"title": ""
},
{
"docid": "754e57b59cd29bb00a5d358188bee654",
"score": "0.5239315",
"text": "def raise_conversion_type(value)\n raise ConversionTypeError, \"'#{value}' could not be converted \" \\\n \"from `#{source}` into `#{target}`\"\n end",
"title": ""
},
{
"docid": "c42b2487d27ed980c88475ba22cac06e",
"score": "0.5237854",
"text": "def type; :unknown; end",
"title": ""
},
{
"docid": "14187174b07e4c51e8d38b1dd3593d4a",
"score": "0.52350116",
"text": "def macro; raise NotImplementedError; end",
"title": ""
},
{
"docid": "14187174b07e4c51e8d38b1dd3593d4a",
"score": "0.52350116",
"text": "def macro; raise NotImplementedError; end",
"title": ""
},
{
"docid": "14187174b07e4c51e8d38b1dd3593d4a",
"score": "0.52350116",
"text": "def macro; raise NotImplementedError; end",
"title": ""
},
{
"docid": "0d19f0e7de1276d55fdcd148abd843dc",
"score": "0.52294666",
"text": "def sub_type; end",
"title": ""
},
{
"docid": "0d19f0e7de1276d55fdcd148abd843dc",
"score": "0.52294666",
"text": "def sub_type; end",
"title": ""
},
{
"docid": "0d19f0e7de1276d55fdcd148abd843dc",
"score": "0.52294666",
"text": "def sub_type; end",
"title": ""
},
{
"docid": "bdb1fc5342abbce086a370e8721623a6",
"score": "0.5226769",
"text": "def visit_enum(binding_type)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "300389a1c9cad85002ba333ecd526735",
"score": "0.51991564",
"text": "def value\n raise NoMethodError, 'all sublasses must implement #value'\n end",
"title": ""
},
{
"docid": "d6bb24bd2232bccca21dabb5a8a63077",
"score": "0.51963174",
"text": "def assertRaiseMessageInvalidTest pattern\n assertRaiseKindOf TypeError do\n assertRaiseMessage pattern do\n raise\n end\n end\n end",
"title": ""
},
{
"docid": "b7c383d33271d65f624ee8971db5bbe8",
"score": "0.5191342",
"text": "def type\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b7c383d33271d65f624ee8971db5bbe8",
"score": "0.5191342",
"text": "def type\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "0539f5baf94bb20ccc66bae23843e1ae",
"score": "0.5181892",
"text": "def >(var_RValue)\n raise AbstractMethodException.new(\"Abstract method\") \n end",
"title": ""
},
{
"docid": "ecd893bca75aca32589637bfeeeb89d9",
"score": "0.51818264",
"text": "def range\n raise AnyError, \"No range for type #{self}\"\n end",
"title": ""
},
{
"docid": "719ebd9237190128c06a9012f3f83a4b",
"score": "0.5181685",
"text": "def raise(*args)\n # All external constant access must be scoped from top-level.\n ::Kernel.raise(*args)\n end",
"title": ""
},
{
"docid": "dce668f9ec71049829f830db868090c0",
"score": "0.5170874",
"text": "def -(var_RValue)\n raise AbstractMethodException.new(\"Abstract method\") \n end",
"title": ""
},
{
"docid": "8fd9d68eb2c23ca7030a80b494ad021b",
"score": "0.51669943",
"text": "def cast_value(_value)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4261f679a9b9b4857d5e054c5e4dedf3",
"score": "0.5155358",
"text": "def praise object, msg = \"Great job!\"\n\t\tend",
"title": ""
},
{
"docid": "9d0152da5472929c027b26fa0adeb6c9",
"score": "0.5153254",
"text": "def be l, msg\n raise invalid_new(msg) unless (!! l.call(data[name]))\n self\n end",
"title": ""
},
{
"docid": "85a2149234aa3175c290bcb188003435",
"score": "0.51513505",
"text": "def enum; end",
"title": ""
},
{
"docid": "85a2149234aa3175c290bcb188003435",
"score": "0.51513505",
"text": "def enum; end",
"title": ""
},
{
"docid": "85a2149234aa3175c290bcb188003435",
"score": "0.51513505",
"text": "def enum; end",
"title": ""
},
{
"docid": "21b73165ca2621f84f724e84c47cb080",
"score": "0.5142752",
"text": "def raise_model attribute, translation\n new.add_error!(attribute, translation)\n end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "d8c03d01022f7e67a32e9971ae799f6c",
"score": "0.51380897",
"text": "def subtype; end",
"title": ""
},
{
"docid": "0910a88d9cb2e7a87e99b0b6cb991610",
"score": "0.51334614",
"text": "def specify_as_type_option_error!(name)\n raise AttributeError\n .new(\"'type_#{name}' must be specified as an option, not via a block\")\n end",
"title": ""
},
{
"docid": "2f9391d120ea2ee2a6c46287b3c65670",
"score": "0.51296943",
"text": "def type(*) end",
"title": ""
},
{
"docid": "a6f0f441fa0115c98ad634d7fb2d2a21",
"score": "0.51249856",
"text": "def raise_type_defined(key)\n raise ArgumentError, <<-MSG.strip\n Type #{key} is already defined here: #{types[key].source_location.join(':')}\n MSG\n end",
"title": ""
},
{
"docid": "72b426217cdfff3505d917a2eaa1ef06",
"score": "0.5121982",
"text": "def raised(operation, error)\n raise error\n end",
"title": ""
},
{
"docid": "30d652ef6fdfc2932d71c7933fd28cf5",
"score": "0.51150215",
"text": "def assert_raise(*exp); end",
"title": ""
},
{
"docid": "d591952ff56d65a05d982d5f21a10f07",
"score": "0.51143",
"text": "def invoke_error; end",
"title": ""
},
{
"docid": "43c2701a5f83c07c3f89edb1a44dc5c5",
"score": "0.5105221",
"text": "def type_error(value, type)\n raise(ArgumentError, \"NIL\") unless value\n value.is_a? type\n end",
"title": ""
},
{
"docid": "2519cb579e5fa3851ad2416eef2330e2",
"score": "0.51049453",
"text": "def type\n raise NotImplementedError, __method__\n end",
"title": ""
},
{
"docid": "e72b93f1c0031f999c5559e1b147f774",
"score": "0.50971645",
"text": "def raise_exc\n proc do |_|\n raise Google::Gax::GaxError.new('Raised in a test')\n end\n end",
"title": ""
},
{
"docid": "58c13d6c92c5b9e466adae7d85c2def5",
"score": "0.5096152",
"text": "def process_self(exp)\n return t(:self, CType.unknown)\n end",
"title": ""
},
{
"docid": "a4788b8a0ab05377e5f21622f93bcb4d",
"score": "0.5090567",
"text": "def error\n\t\traise 'Test'\n\tend",
"title": ""
},
{
"docid": "0a8baf8ac85a5a5bcfbc444165f87b74",
"score": "0.5090409",
"text": "def raise\n raise 'now you can test the error' \n end",
"title": ""
},
{
"docid": "fc3eec4d13706f95c37f6678ee993f10",
"score": "0.50902474",
"text": "def event_type\n fail 'sub class to implement'\n end",
"title": ""
},
{
"docid": "fc3eec4d13706f95c37f6678ee993f10",
"score": "0.50902474",
"text": "def event_type\n fail 'sub class to implement'\n end",
"title": ""
},
{
"docid": "40784ef633eff53c6cc9a2cb404f9b62",
"score": "0.5085342",
"text": "def desired_type; end",
"title": ""
},
{
"docid": "40784ef633eff53c6cc9a2cb404f9b62",
"score": "0.5085342",
"text": "def desired_type; end",
"title": ""
},
{
"docid": "40784ef633eff53c6cc9a2cb404f9b62",
"score": "0.5085342",
"text": "def desired_type; end",
"title": ""
},
{
"docid": "4901a680960616e42b3322046ac022eb",
"score": "0.50817496",
"text": "def method_missing(method, *args, &block)\n super\n rescue NameError => subtype_error\n raise subtype_error unless _delegate_to_supertype?(:method)\n\n begin\n supertype!.__send__ method, *args, &block\n # We rescue supertype's NameErrors so methods not defined are raised from\n # the subtype. Example: user.foo should raise \"foo is not defined in user\"\n # and not \"in actor\"\n rescue NameError => supertype_error\n if supertype_error.name == subtype_error.name &&\n supertype_error.message =~ /#{ self.class.supertype_name.to_s.classify }/\n raise subtype_error\n else\n raise supertype_error\n end\n end\n end",
"title": ""
},
{
"docid": "e52f75b233b3d236e1146baabb1c6b8e",
"score": "0.50808764",
"text": "def get\n raise NotSupportedError\n end",
"title": ""
},
{
"docid": "243893b1c7984adadae250cd88893bab",
"score": "0.50717056",
"text": "def type_expr; end",
"title": ""
},
{
"docid": "d749569c088721d2adc0df6707b7d196",
"score": "0.5070149",
"text": "def value_before_type_cast; end",
"title": ""
},
{
"docid": "d749569c088721d2adc0df6707b7d196",
"score": "0.5070149",
"text": "def value_before_type_cast; end",
"title": ""
},
{
"docid": "d749569c088721d2adc0df6707b7d196",
"score": "0.5070149",
"text": "def value_before_type_cast; end",
"title": ""
},
{
"docid": "3a066a6160460ae1802a466686922448",
"score": "0.5066961",
"text": "def new(*value)\n raise ::NotImplementedError,\n \"unable to create a value for custom type: #{@name.inspect}\"\n end",
"title": ""
},
{
"docid": "36b181be9082f295e8c8b2b84ed154e9",
"score": "0.50533676",
"text": "def method_missing(name, *args, &block)\n begin\n self.range.__send__(name, *args, &block)\n rescue => e\n super\n end\n end",
"title": ""
},
{
"docid": "e65b3fda2bae51210d4df02455374d91",
"score": "0.50461084",
"text": "def go\n raise NotImplementedException\n end",
"title": ""
}
] |
2f75bd9c59d4d59f9523d41fbe8a3bf2
|
Sets the intelProfiles property value. A list of intelligenceProfile objects.
|
[
{
"docid": "ac585c2ba17fd0d98679c75890a74a19",
"score": "0.7763105",
"text": "def intel_profiles=(value)\n @intel_profiles = value\n end",
"title": ""
}
] |
[
{
"docid": "c7f0545fe05e31db9c48ec2ebbb7f3e7",
"score": "0.6270851",
"text": "def set_profiles\n @profiles = Profile.find(params[:id])\n end",
"title": ""
},
{
"docid": "23af4a1b345468e907bf1c60914f541a",
"score": "0.6239697",
"text": "def update_profiles_bulk(profiles)\n raise Exceptions::ServiceException, \"Must be an array of profiles.\" if profiles.nil? || !profiles.is_a?(Array)\n url = Util::Config.get('endpoints.base_url') + Util::Config.get('endpoints.profile_bulk')\n url = build_url(url)\n payload = {\n profiles: profiles.collect(&:to_hash)\n }.to_json\n response = RestClient.put(url, payload, get_headers())\n body = JSON.parse(response.body)\n\n profiles = []\n body['data'].each do |profile|\n profiles << Components::Profile.create(profile)\n end if body['data'].count > 0\n\n Components::ResultSet.new(profiles, body['messages'])\n end",
"title": ""
},
{
"docid": "195dd706daeada159051b4b10d7c144c",
"score": "0.6167875",
"text": "def cpu_profiles=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = CpuProfile.new(value)\n end\n end\n end\n @cpu_profiles = list\n end",
"title": ""
},
{
"docid": "374bb9fd2707b1be623ef2f09ceedbd2",
"score": "0.61054313",
"text": "def vnic_profiles=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = VnicProfile.new(value)\n end\n end\n end\n @vnic_profiles = list\n end",
"title": ""
},
{
"docid": "b81d774146e47b1fca2232de7b8c0b2e",
"score": "0.60856897",
"text": "def intelligence_profile_indicators=(value)\n @intelligence_profile_indicators = value\n end",
"title": ""
},
{
"docid": "064e8e340a905aa11b7ad3a22d83c6ad",
"score": "0.5594526",
"text": "def profiles=(profiles)\n return modify_api_node(['containers', resource[:name]], {'profiles' => profiles})\n end",
"title": ""
},
{
"docid": "28eee6018e46165c44d09dca4baa9e4b",
"score": "0.55682975",
"text": "def vnic_profile_mappings=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = VnicProfileMapping.new(value)\n end\n end\n end\n @vnic_profile_mappings = list\n end",
"title": ""
},
{
"docid": "9a0e2a7920fcb4bc5e02a145b804e094",
"score": "0.55606925",
"text": "def intel_profiles()\n return MicrosoftGraph::Security::ThreatIntelligence::IntelProfiles::IntelProfilesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "baee3370ee5e82ed37f9cfd1879ac150",
"score": "0.5524084",
"text": "def intel_profiles\n return @intel_profiles\n end",
"title": ""
},
{
"docid": "5a333b79bb43c2c4cd83bf4a9184e8e3",
"score": "0.5501903",
"text": "def create_profiles_bulk(profiles)\n raise Exceptions::ServiceException, \"Must be an array of profiles.\" if profiles.nil? || !profiles.is_a?(Array)\n url = Util::Config.get('endpoints.base_url') + Util::Config.get('endpoints.profile_bulk')\n url = build_url(url)\n payload = {\n profiles: profiles.collect(&:to_hash)\n }.to_json\n response = RestClient.post(url, payload, get_headers())\n body = JSON.parse(response.body)\n\n profiles = []\n body['data'].each do |profile|\n profiles << Components::Profile.create(profile)\n end if body['data'].count > 0\n\n Components::ResultSet.new(profiles, body['messages'])\n end",
"title": ""
},
{
"docid": "3a0a2a68478928d0eae114647e34cebf",
"score": "0.54921126",
"text": "def all_profiles\n amee_ivds.each do |ivd|\n next unless ivd.profile?\n construct_from_ivd(Profile,ivd)\n end\n end",
"title": ""
},
{
"docid": "3e22f619eca9123e1bf66a1818347d31",
"score": "0.5467242",
"text": "def set_profiles\n @user = current_user\n end",
"title": ""
},
{
"docid": "622ccd67610828029305dcc222d43e17",
"score": "0.54627",
"text": "def set_iam_instance_profiles(instance_ids, profile_arn = nil)\n cache_relevant_associations!(instance_ids)\n if profile_arn\n instance_ids.map { |instance_id| associate_iam_instance_profile(instance_id, profile_arn) }\n else\n instance_ids.map { |instance_id| disassociate_iam_instance_profile(instance_id) }\n end\n end",
"title": ""
},
{
"docid": "a7d3db875a262b2024b3d6b90c3ff38a",
"score": "0.5423756",
"text": "def profiles\n unless @normalized_profiles\n @normalized_profiles = {}\n (@profiles.respond_to?(:call) ? @profiles.call(self) : @profiles).each do |name|\n @normalized_profiles[name] = Falcon::Profile.find(name)\n end\n end\n \n @normalized_profiles\n end",
"title": ""
},
{
"docid": "2b28448fe8279000ca923a21985f0893",
"score": "0.5414155",
"text": "def disk_profiles=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = DiskProfile.new(value)\n end\n end\n end\n @disk_profiles = list\n end",
"title": ""
},
{
"docid": "bc15971ac65b3d1c90a1eeb2262ed97e",
"score": "0.53941226",
"text": "def vnic_profile_mappings=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = RegistrationVnicProfileMapping.new(value)\n end\n end\n end\n @vnic_profile_mappings = list\n end",
"title": ""
},
{
"docid": "9cc032cc19315c0bbbb2ac4f005dcfb7",
"score": "0.5312653",
"text": "def profile_tokens=(ids)\n self.profile_ids = ids.split(',')\n end",
"title": ""
},
{
"docid": "ceb5001760dbafe4b733518d49e34549",
"score": "0.5279161",
"text": "def profiles\n @profiles ||= load_from('profiles')\n end",
"title": ""
},
{
"docid": "9ee787efb791a462add5b31501901125",
"score": "0.52523315",
"text": "def profiles\n @list.map{ |c| c.profile }\n end",
"title": ""
},
{
"docid": "458b16634acf1757c22a212867e5e763",
"score": "0.5233621",
"text": "def profiles= profiles_xml\n params, headers = req('POST', body = \"ProfilesXML=#{::CGI::escape profiles_xml}\",\n 'application/x-www-form-urlencoded', Time.now.to_i, url = \"#{self.url}/\")\n r = self.class.post url, query: params, headers: headers, body: body\n raise \"Invalid response: #{r.response.code}\" unless r.response.code.to_i == 200\n end",
"title": ""
},
{
"docid": "3bd82f52762c57c72b93741c8d8fe7cf",
"score": "0.5227605",
"text": "def initialize\n @profiles = []\n end",
"title": ""
},
{
"docid": "bce2d0b9b423f58a7dffca4c180b0de7",
"score": "0.5181689",
"text": "def load_profiles\n profiles = driver.find_elements(:css, css_dictionary(:profile))\n end",
"title": ""
},
{
"docid": "6c573650c7187f5bb71e1b32785ddabd",
"score": "0.5178885",
"text": "def update!(**args)\n @profiles = args[:profiles] if args.key?(:profiles)\n end",
"title": ""
},
{
"docid": "18f156d344f7cc2e7323d5def31c60a6",
"score": "0.5106822",
"text": "def profile_details=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = ProfileDetail.new(value)\n end\n end\n end\n @profile_details = list\n end",
"title": ""
},
{
"docid": "18f156d344f7cc2e7323d5def31c60a6",
"score": "0.5106275",
"text": "def profile_details=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = ProfileDetail.new(value)\n end\n end\n end\n @profile_details = list\n end",
"title": ""
},
{
"docid": "18f156d344f7cc2e7323d5def31c60a6",
"score": "0.5105104",
"text": "def profile_details=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = ProfileDetail.new(value)\n end\n end\n end\n @profile_details = list\n end",
"title": ""
},
{
"docid": "caa5c3b59cc2eb218b56a830b6208231",
"score": "0.50529325",
"text": "def set_users_profile\n @users_profile = UsersProfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "ddf80fbf65996a8cf99cf51fae7a29fe",
"score": "0.5051084",
"text": "def set_skills_to_profile\n @skills_to_profile = SkillsToProfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "57f8896999feb50595bcdd3ccbc0b634",
"score": "0.4971702",
"text": "def set_profile_item_values\n @profile_item = AMEE::Profile::Item.update(connection,profile_item_path, \n profile_options.merge(:get_item=>true))\n end",
"title": ""
},
{
"docid": "ff86de941a8895378b1b7769a4fadb8c",
"score": "0.4952115",
"text": "def load_profile( profiles )\n exception_jail{\n @opts.load_profile = nil\n profiles.each {\n |filename|\n @opts.merge!( Arachni::Options.instance.load( filename ) )\n }\n }\n end",
"title": ""
},
{
"docid": "c1202c65b9425db0e200fd4a6183bc87",
"score": "0.49179798",
"text": "def list_ids_profiles(opts = {})\n data, _status_code, _headers = list_ids_profiles_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "ac0fb47373a3a23aa031d64030d2d3bd",
"score": "0.4903085",
"text": "def providers=(value)\n @providers = Array(value)\n end",
"title": ""
},
{
"docid": "38382a31de65f2bcee61fb9b2923612b",
"score": "0.48830736",
"text": "def set(profile)\n perform_request(Entities::Response, 'profile.set.json', profile.as_json)\n end",
"title": ""
},
{
"docid": "04bdde35edcc76e773739c28be59625b",
"score": "0.48490864",
"text": "def patch_ids_profile(profile_id, ids_profile, opts = {})\n patch_ids_profile_with_http_info(profile_id, ids_profile, opts)\n nil\n end",
"title": ""
},
{
"docid": "86ce75afa196fd3228082742d6e6fbdf",
"score": "0.4823507",
"text": "def profile!(value = true)\n options[:profile] = value\n end",
"title": ""
},
{
"docid": "75f20e78d0fc4e123ee97c4d75e42cf8",
"score": "0.48073536",
"text": "def set_profile\n @profile = current_client.profile\n end",
"title": ""
},
{
"docid": "d61dab2c1af611776728165df36e77fc",
"score": "0.47597846",
"text": "def profiles\n Management::Profile.all(self)\n end",
"title": ""
},
{
"docid": "6b00fbb2ecc2676724d5dd4abfd5a029",
"score": "0.4724716",
"text": "def provisioning_profile=(value)\n overwrite_in_all_build_settings(\"PROVISIONING_PROFILE\", value)\n end",
"title": ""
},
{
"docid": "45286a081b4c7a942119d49aa9cb2cd3",
"score": "0.47246537",
"text": "def update_provisioning_profiles(provisioning_profiles)\n each_build_settings do |build_settings|\n bundle_identifier = build_settings[\"PRODUCT_BUNDLE_IDENTIFIER\"]\n next unless bundle_identifier\n provisioning_profile = provisioning_profiles[bundle_identifier]\n next unless provisioning_profile\n build_settings.keys.each do |setting_name|\n build_settings.delete(setting_name) if setting_name.start_with?(\"PROVISIONING_PROFILE[sdk=\")\n end\n build_settings[\"PROVISIONING_PROFILE\"] = provisioning_profile\n end\n @xcodeproj.save\n end",
"title": ""
},
{
"docid": "b2da572d89e2ca7f3cffdadf246c0931",
"score": "0.47237933",
"text": "def set_Profile(value)\n set_input(\"Profile\", value)\n end",
"title": ""
},
{
"docid": "b2da572d89e2ca7f3cffdadf246c0931",
"score": "0.47237933",
"text": "def set_Profile(value)\n set_input(\"Profile\", value)\n end",
"title": ""
},
{
"docid": "6ffb96c09bdae83be66ef5c559183113",
"score": "0.47081724",
"text": "def people=(value)\n @people = value\n end",
"title": ""
},
{
"docid": "93edd2ba7f3c41892d9400fad4224664",
"score": "0.47032762",
"text": "def list_profiles\n # /profiles returns a list of profiles.\n end",
"title": ""
},
{
"docid": "45f88ba9bad77c2201494ec68dbb0aa1",
"score": "0.470257",
"text": "def social_profiles\n @social_profiles ||= [].freeze\n end",
"title": ""
},
{
"docid": "802bbd0d233181124a2c4d6a15d97d65",
"score": "0.46778658",
"text": "def set_profile\n @profile = @current_user.profile\n end",
"title": ""
},
{
"docid": "2e0fd3d3c178bbd7c537179962c2ffdc",
"score": "0.4677338",
"text": "def each_execution_profile(&block)\n if block_given?\n @profile_manager.profiles.each_pair(&block)\n self\n else\n # Return a dup of the hash to prevent the user from adding/removing profiles from the profile-manager.\n @profile_manager.profiles.dup\n end\n end",
"title": ""
},
{
"docid": "e558f8b8953f8a8d0b2baeec3b5b33bd",
"score": "0.46516752",
"text": "def update\n technologies = Technology.where(id: params[:profile][:technologies].compact)\n @profile.technologies = []\n technologies.each do |technology|\n @profile.technologies << technology\n end\n\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "411d62498589da30001bb77c8a2b329d",
"score": "0.46512383",
"text": "def set_multi_attr_profile(options)\n profile_options = options.map{|key,val| \"#{key}=#{val}\"}.join(',')\n cmd = \"chsyscfg -m #{frame} -r prof -i \\\"name=#{current_profile}, lpar_name=#{name}, #{profile_options} \\\" \"\n hmc.execute_cmd(cmd)\n end",
"title": ""
},
{
"docid": "3fea8f9ad52aa9c190ef724e39ce36cc",
"score": "0.4636448",
"text": "def profiles(opts = {})\n find_collection(\"profiles\", opts)\n end",
"title": ""
},
{
"docid": "bad279d23bca816a25841caf690b2296",
"score": "0.46363005",
"text": "def list_ids_profiles_0(opts = {})\n data, _status_code, _headers = list_ids_profiles_0_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "61c646fadfdd24f1de7b8fe6e133c7d1",
"score": "0.4632645",
"text": "def users_profile_set(options = {})\n options = options.merge(user: users_id(options)['user']['id']) if options[:user]\n options = encode_options_as_json(options, %i[profile])\n post('users.profile.set', options)\n end",
"title": ""
},
{
"docid": "fe2bff7ee52b13b2213ee51d0852911d",
"score": "0.46314663",
"text": "def _parse_profiles(type, value, profiles)\n fail 'profiles XML parsing cannot be nil!' if profiles.nil?\n fail 'profiles XML parsing must be a Hash!' unless profiles.is_a?(Hash)\n\n if profiles.key?('_computerlevel')\n profiles['_computerlevel'].each do |profile|\n return true if profile[type] == value\n end\n end\n false\n end",
"title": ""
},
{
"docid": "fe2bff7ee52b13b2213ee51d0852911d",
"score": "0.46314663",
"text": "def _parse_profiles(type, value, profiles)\n fail 'profiles XML parsing cannot be nil!' if profiles.nil?\n fail 'profiles XML parsing must be a Hash!' unless profiles.is_a?(Hash)\n\n if profiles.key?('_computerlevel')\n profiles['_computerlevel'].each do |profile|\n return true if profile[type] == value\n end\n end\n false\n end",
"title": ""
},
{
"docid": "339a99da82582ed7a2913817e832a272",
"score": "0.46250746",
"text": "def accesses=(array)\r\n ids = array.map(&:id)\r\n ProfileAccess.where(['profile_accesses.profile_id = ? AND profile_accesses.access_id NOT IN (?)', self.id, ids]).select(:id).each(&:destroy)\r\n profile_access_ids = ProfileAccess.all(:conditions => {:profile_id => self.id, :access_id => ids}, :select => 'access_id').map(&:access_id)\r\n (ids - profile_access_ids).each{|i|\r\n ProfileAccess.create(:profile_id => self.id, :access_id => i)\r\n }\r\n self.accesses.reload\r\n end",
"title": ""
},
{
"docid": "f7da1635ec263e302f0047bfab9a11fe",
"score": "0.46239597",
"text": "def profiles(tool)\n store.profiles(tool)\n end",
"title": ""
},
{
"docid": "ad23e53d402025d7ff0e6ea7350f19ba",
"score": "0.4623812",
"text": "def set_profile\n @profile = current_user.profile\n end",
"title": ""
},
{
"docid": "ad23e53d402025d7ff0e6ea7350f19ba",
"score": "0.4623812",
"text": "def set_profile\n @profile = current_user.profile\n end",
"title": ""
},
{
"docid": "ad23e53d402025d7ff0e6ea7350f19ba",
"score": "0.4623812",
"text": "def set_profile\n @profile = current_user.profile\n end",
"title": ""
},
{
"docid": "b67c6dd54d35c94427fa484d825ff60a",
"score": "0.46174943",
"text": "def riding_preference_ids= ids\n self.user_riding_preferences = ids.map do |id|\n UserRidingPreference.new preference_id: id\n end\n end",
"title": ""
},
{
"docid": "af1c0ce6f26363cd12185f49fba685d4",
"score": "0.46168047",
"text": "def intune_devices=(value)\n @intune_devices = value\n end",
"title": ""
},
{
"docid": "0ddccb80c53dedd9241920ab1aee5ad5",
"score": "0.46150035",
"text": "def add_profiles # rubocop:disable AbcSize\n matching_profiles = new_resource.profiles & current_resource.profiles\n missing_profiles = new_resource.profiles - matching_profiles\n\n return if missing_profiles.empty?\n\n converge_by(\"Adding profiles to #{new_resource}\") do\n Chef::Log.info(\"Adding profiles to #{new_resource}\")\n load_balancer.client['LocalLB.VirtualServer'].add_profile([new_resource.vs_name], [missing_profiles])\n current_resource.profiles(new_resource.profiles)\n\n new_resource.updated_by_last_action(true)\n end\n end",
"title": ""
},
{
"docid": "e5280b7361f2eee1f05035f327914b70",
"score": "0.4611584",
"text": "def available_profiles\n params = {\n api_method: analytics.management.profiles.list,\n parameters: {accountId: '~all', webPropertyId: '~all'}\n }\n\n api_call(params) do |response|\n return response['items'].map do |item|\n {id: item['id'], name: item['name'], url: item['websiteUrl']}\n end\n end\n end",
"title": ""
},
{
"docid": "1d5fe8d177ded40fa5ef3e2fc6a3d7e6",
"score": "0.460125",
"text": "def profiles(*ids)\n response = run_request('GetPlayerSummaries', { steamids: ids.join(',') }, 'ISteamUser', VERSIONS[2])['response']\n\n if response && (profiles = response['players'])\n profiles.map { |profile| Profile.new(profile) }\n end\n end",
"title": ""
},
{
"docid": "65c996715ace54476d7e4b730a66ba6c",
"score": "0.4592317",
"text": "def add_profiles(options)\n @body.UserProfiles do\n options.each do |option|\n @body.tag!('UserProfile', option)\n end\n end\n end",
"title": ""
},
{
"docid": "77c7152e981272edc0696b536662db0d",
"score": "0.45885962",
"text": "def setup_default_profiles\n @dragon = profiles(:dragon_profile_1)\n @donkey = profiles(:dragon_profile_2)\n @lion = profiles(:lion_profile_1)\n @raccoon = profiles(:raccoon_profile_1)\n end",
"title": ""
},
{
"docid": "26cdd6ce601265d6ee60ea8135d67ec0",
"score": "0.4582309",
"text": "def profile_ids\n @customer_profile_id_list\n end",
"title": ""
},
{
"docid": "207007ff62b6bb7b492b7f7ada890f34",
"score": "0.45558918",
"text": "def initialize(profiles)\n @profiles = profiles\n\n @attribute_map = Hash.new\n @profiles.each { |p| @attribute_map[p.name.to_sym] = p }\n end",
"title": ""
},
{
"docid": "e534d9f109a6903631ff8522e28f8e4c",
"score": "0.45443872",
"text": "def profile_type=(value)\n @profile_type = value\n end",
"title": ""
},
{
"docid": "92b54bfcaec5c9ad1111e861ea70eb14",
"score": "0.45400274",
"text": "def set_shipping_discount_profiles(params = {})\n commit(Ebay::Requests::SetShippingDiscountProfiles, params)\n end",
"title": ""
},
{
"docid": "1f14d5a7bf54207be1cb32eb7bca4bef",
"score": "0.45246664",
"text": "def set_over_profile\n @over_profile = OverProfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "ea2a3dae957099946822a8ff871c1484",
"score": "0.45229605",
"text": "def set_advance_profile\n @advance_profile = AdvanceProfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "59375b5431ef9c8b92b3958f40a698af",
"score": "0.4520766",
"text": "def set_profile\n @profile = Profile.find_by(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "1853f7b060259a38f003851d35b868d1",
"score": "0.45186076",
"text": "def brick_profile_details=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = BrickProfileDetail.new(value)\n end\n end\n end\n @brick_profile_details = list\n end",
"title": ""
},
{
"docid": "59fe8cb25113be8b8c134f58782b4e3f",
"score": "0.451822",
"text": "def set_profile\n @profile = Profile.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "a4e2bc235598b6717728ddfb044c08bd",
"score": "0.4518171",
"text": "def set_user_profile\n @profile = current_user.profile\n end",
"title": ""
},
{
"docid": "84e707e3d0bcd9f638edaf630921ae99",
"score": "0.4515565",
"text": "def patch_ids_profile_0(profile_id, ids_profile, opts = {})\n patch_ids_profile_0_with_http_info(profile_id, ids_profile, opts)\n nil\n end",
"title": ""
},
{
"docid": "1b6158c6c4fcea52f300da586027be7c",
"score": "0.44926617",
"text": "def profile_type=(value)\n @profile_type = value\n end",
"title": ""
},
{
"docid": "c9a064aed810c07aa41d93e6c94ca31a",
"score": "0.44832784",
"text": "def create_or_update_ids_profile(profile_id, ids_profile, opts = {})\n data, _status_code, _headers = create_or_update_ids_profile_with_http_info(profile_id, ids_profile, opts)\n data\n end",
"title": ""
},
{
"docid": "51835194b81f2ca4d85a65c1b87cc20d",
"score": "0.44779736",
"text": "def set_people_admin_profile\n @people_admin_profile = People::AdminProfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "b5b5b7ea73361be5e42f2a487c807ea4",
"score": "0.4474957",
"text": "def set_profile\n @profile = Profile.where(:user_id=>current_user.id)\n end",
"title": ""
},
{
"docid": "9dda0282f170eb1e721f9e1f460ea8db",
"score": "0.44588524",
"text": "def cpu_profiles\n @cpu_profiles\n end",
"title": ""
},
{
"docid": "836341cb6665d357c27ca2aefab0c3cd",
"score": "0.44532797",
"text": "def set_prof\n @prof = Prof.find(params[:id])\n end",
"title": ""
},
{
"docid": "3475eaed41fa89fbd1964df1e3c19237",
"score": "0.4450687",
"text": "def set_profile\n @profile = Xmt::Press::Profile.find(params[:id])\n end",
"title": ""
},
{
"docid": "f21dca0e2254d205de059563370e4702",
"score": "0.44477385",
"text": "def profiles\n return nil if __manageprofiles__.nil?\n cmd = \"#{__manageprofiles__} -listProfiles\"\n opts = { user: new_resource.owner, group: new_resource.group }\n shell_out!(cmd, opts).stdout.split(\"\\n\")\n end",
"title": ""
},
{
"docid": "312c507ea9281b0cf052614d296f8d2b",
"score": "0.44422564",
"text": "def intelligence_profile_indicators\n return @intelligence_profile_indicators\n end",
"title": ""
},
{
"docid": "3e57ace39d00a8a1558836fa6f86945e",
"score": "0.44417176",
"text": "def set_profile\n @profile = Profile.find_by( id: params[:id])\n end",
"title": ""
},
{
"docid": "26ebde9dfb0d3f54b8ee382faac8ecdf",
"score": "0.44393462",
"text": "def set_user_profile\n @user_profile = current_user.user_profile\n end",
"title": ""
},
{
"docid": "671c38e337ec8baa9e69d1df51805803",
"score": "0.44374076",
"text": "def set_profile\n # Code to set/find the profile query\n @profile = Profile.find(params[:id])\n end",
"title": ""
},
{
"docid": "572ddd6a9f6b1aefb13c6d9ef314a5fe",
"score": "0.443468",
"text": "def detection_ids=(value)\n @detection_ids = value\n end",
"title": ""
},
{
"docid": "7349f70769d1eb5aca5de1b25bc713ad",
"score": "0.44292164",
"text": "def set_imageprofile\n @imageprofile = Imageprofile.find(params[:id])\n end",
"title": ""
},
{
"docid": "7c999d86dd279098870623bab55fbd53",
"score": "0.44201717",
"text": "def set_profile\n @profile = Profile.find(params[:id])\n end",
"title": ""
},
{
"docid": "7c999d86dd279098870623bab55fbd53",
"score": "0.44201717",
"text": "def set_profile\n @profile = Profile.find(params[:id])\n end",
"title": ""
},
{
"docid": "f72f84eedc527f7ec7b53be3e8bae623",
"score": "0.4419509",
"text": "def set_profile\n @profile = current_user.profile\n end",
"title": ""
},
{
"docid": "f72f84eedc527f7ec7b53be3e8bae623",
"score": "0.4419509",
"text": "def set_profile\n @profile = current_user.profile\n end",
"title": ""
},
{
"docid": "f72f84eedc527f7ec7b53be3e8bae623",
"score": "0.4419509",
"text": "def set_profile\n @profile = current_user.profile\n end",
"title": ""
},
{
"docid": "5816b886c03ab439fa731e813bbf9bff",
"score": "0.44118834",
"text": "def add_profile(profile)\n # Push profile into end of profiles array\n @profiles << profile\n end",
"title": ""
},
{
"docid": "13b054a6678d660e72c999db903b45ea",
"score": "0.44113076",
"text": "def remove_profiles # rubocop:disable AbcSize\n matching_profiles = new_resource.profiles & current_resource.profiles\n extra_profiles = current_resource.profiles - matching_profiles\n\n return if extra_profiles.empty?\n\n converge_by(\"Removing profiles from #{new_resource}\") do\n Chef::Log.info(\"Removing profiles from #{new_resource}\")\n load_balancer.client['LocalLB.VirtualServer'].remove_profile([new_resource.vs_name], [extra_profiles])\n current_resource.profiles(matching_profiles)\n\n new_resource.updated_by_last_action(true)\n end\n end",
"title": ""
},
{
"docid": "b398ad9b46fbfd38140ed36978c6ec60",
"score": "0.44096127",
"text": "def users=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = User.new(value)\n end\n end\n end\n @users = list\n end",
"title": ""
},
{
"docid": "48a9561f70fd4857abd4f0ddecb3ed2f",
"score": "0.44092485",
"text": "def set_profile\n @profile = Profile.find_or_initialize_by(\n user_id: current_user.id\n )\n end",
"title": ""
},
{
"docid": "b398ad9b46fbfd38140ed36978c6ec60",
"score": "0.44088194",
"text": "def users=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = User.new(value)\n end\n end\n end\n @users = list\n end",
"title": ""
}
] |
138416db2dcc5b557a6f669533168910
|
Instance methods Create authentication from omniauth hash
|
[
{
"docid": "1ac6e5cf9b8f90614cdeb11dc4b129fd",
"score": "0.72126645",
"text": "def create_authentication(omniauth)\n authentications.create! do |a|\n a.provider = omniauth.provider\n a.uid = omniauth.uid\n end\n end",
"title": ""
}
] |
[
{
"docid": "cc44bcc4c86dec11e27ab42c95a7e505",
"score": "0.72709244",
"text": "def omniauth\n Hashie::Mash.new auth_hash\n end",
"title": ""
},
{
"docid": "709eeddcbb05ad387d862bfda9711fcb",
"score": "0.72179675",
"text": "def create_authentication(omniauth)\n authentications.create! do |a|\n a.provider = omniauth.provider\n a.uid = omniauth.uid\n end\n end",
"title": ""
},
{
"docid": "8d6ae1871270ae46f2026d3ea98c87cf",
"score": "0.7147287",
"text": "def create_from_omniauth(omniauth_hash)\n info_hash = omniauth_hash['info']\n return nil unless email = info_hash && info_hash['email']\n user = User.new\n user.credentials << Credentials::Email.new(email: email, verified: true)\n user.save!\n user\n end",
"title": ""
},
{
"docid": "9d76faf013f100cc8e621f39b5dd16b7",
"score": "0.7124384",
"text": "def with_authentication_hash(hash)\n self.authentication_hash = {:email => hash[:username]}\n self.password = hash[:password]\n end",
"title": ""
},
{
"docid": "c735c787a8c04c69fc1104175d0ac1b9",
"score": "0.70422643",
"text": "def apply_omniauth(auth)\n self.email = auth['extra']['raw_info']['email'] if auth['extra']['raw_info']['email']\n self.password = Devise.friendly_token[0,20]\n authentications.build(:provider=>auth['provider'], :uid=>auth['uid'], :token=>auth['credentials']['token'], :secret=>auth['credentials']['secret'])\n end",
"title": ""
},
{
"docid": "d9c2f651c996783d5e3435806dd38166",
"score": "0.6956577",
"text": "def with_authentication_hash(auth_type, auth_values); end",
"title": ""
},
{
"docid": "816ed646937b29bd4e13b1145cb67935",
"score": "0.69084525",
"text": "def authentication_hash=(_arg0); end",
"title": ""
},
{
"docid": "73549da8f7c2552f04f6d62e6d77de97",
"score": "0.68257445",
"text": "def create\n # get the authorization parameter from the Rails router\n params[:authorization] ? authorization_route = params[:authorization] : authorization_route = 'No authorization recognized (invalid callback)'\n # get the full hash from omniauth\n omniauth = request.env['omniauth.auth']\n #flash[:success] = omniauth['credentials']['token']\n # continue only if hash and parameter exist\n if omniauth and params[:authorization]\n\n # map the returned hashes to our variables first - the hashes differs for every authorization\n \n # create a new hash\n @authhash = Hash.new\n \n if authorization_route == 'facebook'\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = ''\n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n elsif authorization_route == 'google_oauth2'\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = '' \n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = '' \n elsif authorization_route == 'twitter'\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = (omniauth['info']['name']).gsub(\" \", \"_\")+'@twitter.com'\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = ''\n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n elsif authorization_route == 'github'\n omniauth['user_info']['email'] ? @authhash[:email] = omniauth['user_info']['email'] : @authhash[:email] = ''\n omniauth['user_info']['name'] ? @authhash[:name] = omniauth['user_info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = '' \n omniauth['extra']['user_hash']['id'] ? @authhash[:uid] = omniauth['extra']['user_hash']['id'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = '' \n elsif ['google', 'yahoo', 'myopenid', 'open_id'].index(authorization_route) != nil\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = ''\n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n else \n # debug to output the hash that has been returned when adding new authorizations\n render :text => omniauth.to_yaml\n return\n end \n \n if @authhash[:uid] != '' and @authhash[:provider] != ''\n \n auth = Authorization.find_by_provider_and_uid(@authhash[:provider], @authhash[:uid])\n\n # if the user is currently signed in, he/she might want to add another account to signin\n if signed_in?\n if auth\n flash[:notice] = 'Your account at ' + @authhash[:provider].capitalize + ' is already connected with this site.'\n redirect_to root_path\n else\n current_user.add_authorization(@authhash)\n flash[:notice] = 'Your ' + @authhash[:provider].capitalize + ' account has been added for signing in at this site.'\n redirect_to root_path\n end\n else\n if auth\n # signin existing user\n # in the session his user id and the authorization id used for signing in is stored\n sign_in_ auth.user\n #session[:authorization_id] = auth.id\n \n flash[:notice] = 'Signed in successfully via ' + @authhash[:provider].capitalize + '.'\n redirect_back_or root_url\n else\n # this is a new user; show signup; @authhash is available to the view and stored in the sesssion for creation of a new user\n #session[:authhash] = @authhash\n #render signup_authorizations_path\n #crappy way to bypass password requirement for user, potential loophole\n password = SecureRandom.hex\n user = User.new(name: @authhash[:name], email: @authhash[:email], password: password, password_confirmation: password)\n user.authorizations.build(provider: @authhash[:provider], uid: @authhash[:uid], token: @authhash[:token], secret: @authhash[:secret])\n user.save\n flash[:success] = \"Hi #{user.name}! You've signed up via #{@authhash[:provider]}.\"\n sign_in_ user\n redirect_back_or root_path \n end\n end\n else\n flash[:error] = 'Error while authenticating via ' + authorization_route + '/' + @authhash[:provider].capitalize + '. The authorization returned invalid data for the user id.'\n redirect_to signin_path\n end\n else\n flash[:error] = 'Error while authenticating via ' + authorization_route.capitalize + '. The authorization did not return valid data.'\n redirect_to signin_path\n end\n end",
"title": ""
},
{
"docid": "524f923e209ed69ed951a6aaaa02fb51",
"score": "0.6796829",
"text": "def make_auth_hash\n self.auth_hash = Digest::SHA1.hexdigest(self.object_id.to_s + Time.now.to_i.to_s + self.name.to_s)\n end",
"title": ""
},
{
"docid": "14e533a9be34bd3c733f2e3e86d0a5af",
"score": "0.67901856",
"text": "def recreate_authentication_with_hash auth\n recreate_authentication auth[:provider], uid: auth[:uid] unless identity?(auth)\n self\n end",
"title": ""
},
{
"docid": "a64ab390fe35df137f2aec971d106d75",
"score": "0.67694134",
"text": "def http_auth_hash; end",
"title": ""
},
{
"docid": "abe33337da0f109fdde5e211a44d07b2",
"score": "0.67638296",
"text": "def apply_omniauth(omniauth)\n authentications.build(provider: omniauth['provider'],\n uid: omniauth['uid'],\n token: omniauth['credentials']['token'],\n secret: omniauth['credentials']['secret'])\n end",
"title": ""
},
{
"docid": "b71ac626e10355ef71d0abd3be6eedcf",
"score": "0.66607594",
"text": "def create\n\t # get the authentication parameter from the Rails router\n\t params[:provider] ? authentication_route = params[:provider] : authentication_route = 'No authentication recognized (invalid callback)'\n\n\t # get the full hash from omniauth\n\t omniauth = request.env['omniauth.auth']\n\t \n\t # continue only if hash and parameter exist\n\t if omniauth and params[:provider] == 'identity'\n\t # in the session his user id and the authentication id used for signing in is stored\n\t session[:identity] = omniauth['uid']\n\t redirect_to root_url, :notice => \"Signed in successfully.\"\n\t \n\t elsif omniauth and params[:provider]\n\t # create a new hash\n\t @authhash = Hash.new\n\t if authentication_route == 'google_oauth2'\n\t omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n\t omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n\t omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n\t omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n\t else \n\t # debug to output the hash that has been returned when adding new authentications\n\t render :text => omniauth.to_yaml\n\t return\n\t end\n\t \n\t if @authhash[:uid] != '' and @authhash[:provider] != ''\n\t auth = Authentication.find_by_provider_and_uid(@authhash[:provider], @authhash[:uid])\n\t # if the user is currently signed in, he/she might want to add another account to signin\n\t if logged_in?\n\t if auth\n\t flash[:notice] = 'Your account at ' + @authhash[:provider].capitalize + ' is already connected with this site.'\n\t redirect_to authentications_path\n\t else\n\t current_user.authentications.create!(:provider => @authhash[:provider], :uid => @authhash[:uid], :uname => @authhash[:name], :uemail => @authhash[:email])\n\t flash[:notice] = 'Your ' + @authhash[:provider].capitalize + ' account has been added for signing in at this site.'\n\t redirect_to authentications_path\n\t end\n\t else\n\t if auth\n\t # signin existing user\n\t # in the session his user id and the authentication id used for signing in is stored\n\t session[:user] = auth.user.id\n\t session[:authentication_id] = auth.id\n\t \n\t flash[:notice] = 'Signed in successfully.'\n\t redirect_to root_url\n\t else\n\t # this is a new user; show signup; @authhash is available to the view and stored in the sesssion for creation of a new user\n\t if Rails.env == \"development\" or @authhash[:email].split('@').include?('intridea.com')\n\t session[:authhash] = @authhash\n\t render signup_authentications_path\n\t end\n\t # render signup_authentications_path\n\t end\n\t end\n\t else\n\t flash[:error] = 'Error while authenticating via ' + authentication_route + '/' + @authhash[:provider].capitalize + '. The authentication returned invalid data for the user id.'\n\t redirect_to login_path\n\t end\n\t else\n\t flash[:error] = 'Error while authenticating via ' + authentication_route.capitalize + '. The authentication did not return valid data.'\n\t redirect_to login_path\n\t end\n\t end",
"title": ""
},
{
"docid": "a3bf970e3068b0d4624560453e758ee6",
"score": "0.66189086",
"text": "def initialize(omniauth_hash)\n # Raise error if in valid OmniAuth::AuthHash\n unless omniauth_hash.present? && omniauth_hash.is_a?(OmniAuth::AuthHash)\n raise ArgumentError.new(omniauth_hash)\n end\n # Raise error if provider is not whitelisted\n unless matches_provider_whitelist?(omniauth_hash.provider)\n raise ArgumentError.new(omniauth_hash, omniauth_hash.provider)\n end\n # Set instance vars\n @omniauth_hash = omniauth_hash\n # Generate the provider mapper from the provider, so we can delegate all calls to it\n @provider_mapper = \"Login::OmniAuthHash::ProviderMapper::#{@omniauth_hash.provider.classify}\".safe_constantize.new(@omniauth_hash)\n end",
"title": ""
},
{
"docid": "afc34177f7282ea5c634674669df9b00",
"score": "0.6560046",
"text": "def create\n # get the service parameter from the Rails router\n params[:service] ? service_route = params[:service] : service_route = 'No service recognized (invalid callback)'\n\n # get the full hash from omniauth\n omniauth = request.env['omniauth.auth']\n \n # continue only if hash and parameter exist\n if omniauth and params[:service]\n\n # map the returned hashes to our variables first - the hashes differs for every service\n \n # create a new hash\n @authhash = Hash.new\n \n if service_route == 'facebook'\n omniauth['extra']['user_hash']['email'] ? @authhash[:email] = omniauth['extra']['user_hash']['email'] : @authhash[:email] = ''\n omniauth['extra']['user_hash']['name'] ? @authhash[:name] = omniauth['extra']['user_hash']['name'] : @authhash[:name] = ''\n omniauth['extra']['user_hash']['id'] ? @authhash[:uid] = omniauth['extra']['user_hash']['id'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n elsif service_route == 'github'\n omniauth['user_info']['email'] ? @authhash[:email] = omniauth['user_info']['email'] : @authhash[:email] = ''\n omniauth['user_info']['name'] ? @authhash[:name] = omniauth['user_info']['name'] : @authhash[:name] = ''\n omniauth['extra']['user_hash']['id'] ? @authhash[:uid] = omniauth['extra']['user_hash']['id'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = '' \n elsif ['google', 'yahoo', 'twitter', 'myopenid', 'open_id'].index(service_route) != nil\n omniauth['user_info']['email'] ? @authhash[:email] = omniauth['user_info']['email'] : @authhash[:email] = ''\n omniauth['user_info']['name'] ? @authhash[:name] = omniauth['user_info']['name'] : @authhash[:name] = ''\n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n\n#CHANGE THIS!\n\n\tsession['yahoo'] = 'sessoin_yahoo'\n\tif service_route == 'yahoo'\n\t\tsession['yahoo'] = omniauth #['credentials']\n\tend\n\n\n else \n # debug to output the hash that has been returned when adding new services\n render :text => omniauth.to_yaml\n return\n end \n \n if @authhash[:uid] != '' and @authhash[:provider] != ''\n \n auth = Service.find_by_provider_and_uid(@authhash[:provider], @authhash[:uid])\n\n # if the user is currently signed in, he/she might want to add another account to signin\n if user_signed_in?\n if auth\n flash[:notice] = 'Your account at ' + @authhash[:provider].capitalize + ' is already connected with this site.'\n redirect_to services_path\n else\n current_user.services.create!(:provider => @authhash[:provider], :uid => @authhash[:uid], :uname => @authhash[:name], :uemail => @authhash[:email])\n flash[:notice] = 'Your ' + @authhash[:provider].capitalize + ' account has been added for signing in at this site.'\n\t\tif service_route == 'facebook'\n\n\t\t\tredirect_to services_facebook_redirect_path\n\t\telse\n \t\tredirect_to services_path\n\n\n\t\tend\n\n\n end\n else\n if auth\n # signin existing user\n # in the session his user id and the service id used for signing in is stored\n session[:user_id] = auth.user.id\n session[:service_id] = auth.id\n\tif service_route == 'twitter'\n\n\t\tsession['twitter_token'] = omniauth['credentials']['token']\n\t\tsession['twitter_secret'] = omniauth['credentials']['secret']\n\t\tb = Atokens.new()\n\t\tb.user_id = session[:user_id]\n\t\tb.a_token = session[\"twitter_token\"]\n\t\tb.provider = \"twitter_token\"\n\t\tb.save()\n\t\tc = Atokens.new()\n\t\tc.user_id = session[:user_id]\n\t\tc.a_token = session[\"twitter_secret\"]\n\t\tc.provider = \"twitter_secret\"\n\t\tc.save()\n\n\t\tTwitter.configure do |config|\n \t config.consumer_key = '4lAKFHIlvPuYWkHQZXGlg'\n \tconfig.consumer_secret = 'FfVTgOnHHIXsd7LMfAtfUvA6cXsVRQjAtjAqSj3Kq0s'\n\t config.oauth_token = session['twitter_token'] #'549918712-NNIxCOlwI7wFkKvsCp6cuvs4JinHdJGVFbWecxLj' #'539297038-F3oni2AgmObm367GOz6Zm1VhG4Dts2gMc2hAhvrd'\n \t config.oauth_token_secret = session['twitter_secret'] #'5MQQiJR3EJYSTn6eih1MzZH81nscNNtpLHtM9tJc' #'P8IiObz0V71qa79s3GNLqGpbF9ccQXw9Jz8kIxvV58'\n \tend\n\t\t@twitterFeed = Twitter.home_timeline(:count => 11)\n\t\t\t\t@old = OldTwit.new\n @old.name = current_user.name #session['authhash']['name'] #'name22' \n @old.tdata = ActiveSupport::JSON.encode(@twitterFeed)\n @old.save\n\n\tend\n \n flash[:notice] = 'Signed in successfully via ' + @authhash[:provider].capitalize + '.'\n\t\tif service_route == 'facebook' #session[:authhash][:provider] == 'facebook'\n\t\t\tredirect_to services_facebook_redirect_path\n\t\telse\n \t\tredirect_to services_test_path\n\t\tend\n else\n # this is a new user; show signup; @authhash is available to the view and stored in the sesssion for creation of a new user\n session[:authhash] = @authhash\n render signup_services_path\n end\n end\n else\n flash[:error] = 'Error while authenticating via ' + service_route + '/' + @authhash[:provider].capitalize + '. The service returned invalid data for the user id.'\n redirect_to signin_path\n end\n else\n flash[:error] = 'Error while authenticating via ' + service_route.capitalize + '. The service did not return valid data.'\n redirect_to signin_path\n end\n end",
"title": ""
},
{
"docid": "68e309cc3b38af86477ca2e04ef7777b",
"score": "0.6559139",
"text": "def auth\n Hash['type' => @auth_type,\n 'username' => @user,\n 'password' => @password]\n end",
"title": ""
},
{
"docid": "be04039ea36e4e535b288f8784e74dde",
"score": "0.6551887",
"text": "def from_omniauth(auth)\n # Provider is the customer name if in loadbalanced config mode\n provider = auth['provider'] == \"bn_launcher\" ? auth['info']['customer'] : auth['provider']\n find_or_initialize_by(email: auth_email(auth)).tap do |u|\n u.social_uid = auth['uid']\n u.provider = provider\n u.last_name = auth_name(auth) unless u.last_name.present?\n u.first_name = auth_first_name(auth) unless u.first_name.present?\n u.username = auth_username(auth) unless u.username.present?\n u.image = auth_image(auth) unless u.image.present?\n u.business_name = u.auth_business unless u.business_name.present?\n auth_roles(u, auth)\n u.email_verified = true\n u.save!\n u.set_role :user\n end\n end",
"title": ""
},
{
"docid": "b360231d0f439a7cf343454e85dc90da",
"score": "0.65506095",
"text": "def authenticate account, salt, hash, platform\n end",
"title": ""
},
{
"docid": "ee778534fb45983e773d62259f23ee3d",
"score": "0.65304124",
"text": "def create\n\n\t\t@auth = request.env[\"omniauth.auth\"]\n\n\t\tprovider = @auth.provider\n\t\tuid = @auth.uid\n\t\taccess_token = @auth.credentials.token\n\t\ttoken_secret = @auth.credentials.secret\n\t\tconsumer_key = \"\"\n\t\tconsumer_secret = \"\"\n\n\t\tif provider == \"bitbucket\"\n\t\t\tconsumer_key = @auth.extra.access_token.consumer.key\n\t\t\tconsumer_secret = @auth.extra.access_token.consumer.secret\n\t\tend\n\n\t\t@authentication = Authentication.find_by_provider_and_uid(provider, uid)\n\n\t\tif @authentication.present?\n\t\t\t# The authentication is already there\n\t\t\t# Get the user\n\t\t\tuser = @authentication.user\n\n\t\t\t# And sign him in\n\t\t\tflash[:notice] = \"Signed in successfully\"\n\t\t\tsign_in_and_redirect :user, user\n\n\t\telsif current_user.present?\n\t\t\t# There's no authentication in db, but the user is present\n\n\t\t\t# Create an authentication for the user and redirect\n\t\t\tcurrent_user.authentications.create! :provider => provider, \n\t\t\t\t\t\t\t\t\t\t\t\t :uid => uid, \n\t\t\t\t\t\t\t\t\t\t\t\t :access_token => access_token,\n\t\t\t\t\t\t\t\t\t\t\t\t :token_secret => token_secret,\n\t\t\t\t\t\t\t\t\t\t\t\t :consumer_key => consumer_key,\n\t\t\t\t\t\t\t\t\t\t\t\t :consumer_secret => consumer_secret\n\t\t\tredirect_to deployable_applications_url, :notice => \"Successfully added authentication.\"\n\n\t\telse\n\n\t\t\tredirect_to new_user_registration_url and return\n\n\t\t\t# Uncomment this to make the user log in with integrations\n\n\t\t\t# # There is no @auth and no user\n\t\t\t# # So create a new user\n\t\t\t# user = User.new\n\n\t\t\t# # Create an authentication for the new user\n\t\t\t# user.apply_omniauth(@auth)\n\n\t\t\t# if user.save\n\t\t\t# \t# Sign him in if no errors\n\t\t\t# \tflash[:notice] = \"Signed in successfully\"\n\t\t\t# \tflash[:just_signed_up] = true\n\t\t\t# \tsign_in_and_redirect :user, user\n\t\t\t# else\n\t\t\t# \t# Complete registration if any errors\n\t\t\t# \tsession[:omniauth] = @auth.except('extra')\n\t\t\t# \tredirect_to new_user_registration_url\n\t\t\t# end\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "a928ca1f4b504d88e16359a7c07697c5",
"score": "0.653003",
"text": "def from_auth(auth_hash)\n locate_email(auth_hash) || create_from_auth(auth_hash)\n end",
"title": ""
},
{
"docid": "3df056db26a642d00120b2cdfd9d1985",
"score": "0.65211415",
"text": "def create_auth(input)\n class_member(input)\n end",
"title": ""
},
{
"docid": "a2ecace297bfe3b8895e99c487d025e9",
"score": "0.65073866",
"text": "def create_from_omniauth\n auth_hash = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_uid(auth_hash[\"provider\"], auth_hash[\"uid\"]) || Authentication.create_with_omniauth(auth_hash)\n\n # if: previously already logged in with OAuth\n if authentication.user\n user = authentication.user\n authentication.update_token(auth_hash)\n @next = root_url\n @notice = \"Signed in!\"\n # else: user logs in with OAuth for the first time\n else\n user = User.create_with_auth_and_hash(authentication, auth_hash)\n # you are expected to have a path that leads to a page for editing user details\n @next = edit_user_path(user)\n @notice = \"User created. Please confirm or edit details\"\n end\n\n sign_in(user)\n redirect_to @next, :notice => @notice\n end",
"title": ""
},
{
"docid": "d8ca0a2b4836f61b183f96c6b528c951",
"score": "0.64916694",
"text": "def set_token_from_hash(auth_hash, user_hash)\n self.update_attribute(:name, user_hash[:name]) if self.name.blank?\n self.update_attribute(:email, user_hash[:email]) if self.email.blank?\n token = self.authentications.find_or_initialize_by_provider_and_uid(auth_hash[:provider], auth_hash[:uid])\n token.update_attributes(\n :name => auth_hash[:name],\n :link => auth_hash[:link],\n :access_token => auth_hash[:token],\n :secret => auth_hash[:secret]\n )\n end",
"title": ""
},
{
"docid": "6dcabeaaa4d79e1958ef9a08ccac94bb",
"score": "0.64880735",
"text": "def apply_omniauth(omniauth)\n self.email = omniauth['info']['email'] if email.blank?\n self.username = omniauth['info']['name'] if username.blank?\n puts \"******************************\"\n puts omniauth\n puts \"******************************\"\n authentications.build(provider:omniauth['provider'], uid:omniauth['uid'])\n end",
"title": ""
},
{
"docid": "8e48de3e668cf219a6f57674e35712af",
"score": "0.64774996",
"text": "def post_authenticate(hash)\n HttpClient::Preconditions.assert_class('hash', hash, Hash)\n @client.request(\"/users/authenticate\").with_json(hash.to_json).post { |hash| Apidoc::Models::User.new(hash) }\n end",
"title": ""
},
{
"docid": "b28069a2ca51285847d6d17a59e29a62",
"score": "0.64611065",
"text": "def create_auth\n\t\t@auth = request.env['omniauth.auth']\n\t\tif User.where(:spotify_id => @auth[\"info\"][\"id\"]).first\n\t\t\t@user = User.where(:spotify_id => @auth[\"info\"][\"id\"]).first\n\t\telse\n\t\t\tif @auth[\"info\"][\"images\"][0][\"url\"] == \"\"\n\t\t\t\t@user = User.create(\n\t\t\t\t:display_name => @auth[\"info\"][\"display_name\"],\n\t\t\t\t:token => @auth[\"credentials\"][\"token\"],\n\t\t\t\t:refresh_token => @auth[\"credentials\"][\"refresh_token\"],\n\t\t\t\t:image_url => 'muziqala_logo.jpq',\n\t\t\t\t:spotify_id => @auth[\"info\"][\"id\"],\n\t\t\t\t:user_uri => @auth[\"info\"][\"uri\"]\n\t\t\t\t)\n\t\t\telse\n\t\t\t@user = User.create(\n\t\t\t\t:display_name => @auth[\"info\"][\"display_name\"],\n\t\t\t\t:token => @auth[\"credentials\"][\"token\"],\n\t\t\t\t:refresh_token => @auth[\"credentials\"][\"refresh_token\"],\n\t\t\t\t:image_url => @auth[\"info\"][\"images\"][0][\"url\"],\n\t\t\t\t:spotify_id => @auth[\"info\"][\"id\"],\n\t\t\t\t:user_uri => @auth[\"info\"][\"uri\"]\n\t\t\t\t)\n\t\t\tend\n\t\tend\n\t\tsession[:user_id] = @user.id\n\t\tredirect_to user_path(@user)\n\tend",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.64079565",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.64079565",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.64079565",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.64079565",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.64079565",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.64079565",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "f05b88eb50de413a6f507e796e64cedb",
"score": "0.640167",
"text": "def auth_hash\n @auth_hash ||= request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "cf29d094f37c6e24510e3229bc0102cb",
"score": "0.6393693",
"text": "def create\n \n \n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n \n redirect_to root_path\n \n #render :text => auth_hash.inspect\n #raise request.env[\"omniauth.auth\"].to_yaml\n \n #Original\n # user=Authorization.find_by_provider_and_uid(auth[\"provider\"],auth[\"uid\"]) || Authorization.create_with_omniauth(auth)\n # #session[:user_id] = user.id\n #redirect_to root_path\n \n end",
"title": ""
},
{
"docid": "b6ab8199f942a2c845c6b068c485ae23",
"score": "0.63736886",
"text": "def auth_hash\n @auth_hash ||= request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "9a2107b6539e7c70a128baa49d646807",
"score": "0.63647103",
"text": "def auth_hash\n request.env['omniauth.auth'].symbolize_keys!\n end",
"title": ""
},
{
"docid": "77c5ba0203178f1702eaae2085bfd1e7",
"score": "0.6360465",
"text": "def create\n @user = User.where_omniauth(auth_hash)\n sign_in @user\n redirect_to root_url, alert: \"You have been signed in successfully.\"\n end",
"title": ""
},
{
"docid": "fff4f7225b994d4af17894188c82c1cc",
"score": "0.6346245",
"text": "def params_auth_hash; end",
"title": ""
},
{
"docid": "6d2227b9a6ed0bd3fafc97c10e8676f4",
"score": "0.63423675",
"text": "def apply_omniauth(omniauth)\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end",
"title": ""
},
{
"docid": "5e25e12989aaf7978f2771be5a4c0b14",
"score": "0.6326995",
"text": "def generate_auth\n self.auth = SecureRandom.hex(32)\n end",
"title": ""
},
{
"docid": "2865dca38d5d12e87969d6d652120a21",
"score": "0.63244706",
"text": "def from_omniauth auth\n user = User.find_by email: auth.info.email\n\n user = User.new unless user.present?\n user.name = auth.info.name.present? ? auth.info.name : auth.info.email\n user.email = auth.info.email\n user.provider = auth.provider\n user.password = User.generate_unique_secure_token if user.new_record?\n user.token = auth.credentials.token\n user.refresh_token = auth.credentials.refresh_token\n user.save\n user\n end",
"title": ""
},
{
"docid": "5e6c5471a0e0addc3e51f00bc6d5ca18",
"score": "0.6322669",
"text": "def create_authentication(body)\r\n # Prepare query url.\r\n _path_url = '/oauth/token'\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 # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: body.to_json\r\n )\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n OAuthResponse.from_hash(decoded)\r\n end",
"title": ""
},
{
"docid": "a4b4f00dfb5cd647516af90625b25a98",
"score": "0.63038886",
"text": "def generate_auth_metadata(options, model:, params:, **)\n Authenticatable.new(\n model, secret_password: params[:password]\n ).sync\n end",
"title": ""
},
{
"docid": "476faf45b33b4046808f42aef765dff3",
"score": "0.63037217",
"text": "def with_authentication_hash(auth_type, auth_values)\n self.authentication_hash, self.authentication_type = {}, auth_type\n self.password = auth_values[:password]\n\n parse_authentication_key_values(auth_values, authentication_keys) &&\n parse_authentication_key_values(request_values, request_keys)\n end",
"title": ""
},
{
"docid": "ab0921607869ffb0027e29071073e47e",
"score": "0.6264494",
"text": "def build_resource(hash = nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n auth = session['devise.google_data']\n self.resource = User.fill_from_omniauth(resource, auth) if auth\n end",
"title": ""
},
{
"docid": "3302ee5d5056d777f31bb5fcd410c403",
"score": "0.62636375",
"text": "def create\n # Where do we want to redirect to with our new session\n path = cookies.encrypted[:continue] || success_path\n\n # Get auth hash from omniauth\n auth = request.env[OMNIAUTH]\n\n if auth.nil?\n return login_failure({})\n end\n\n # Find an authentication or create an authentication\n auth_model = ::Auth::Authentication.from_omniauth(auth)\n\n # adding a new auth to existing user\n if auth_model.nil? && signed_in?\n logger.info \"User signed in and re-authenticating\"\n\n ::Auth::Authentication.create_with_omniauth(auth, current_user.id)\n redirect_to path\n Auth::Authentication.after_login_block.call(current_user, auth[PROVIDER], auth)\n\n # new auth and new user\n elsif auth_model.nil?\n args = safe_params(auth.info)\n user = ::User.new(args)\n\n # Use last name and first name by preference\n fn = args[:first_name]\n if fn && !fn.empty?\n user.name = \"#{fn} #{args[:last_name]}\"\n end\n\n authority = current_authority\n\n existing = ::User.find_by_email(authority.id, user.email)\n user = existing if existing\n user.deleted = false if user.respond_to?(:deleted)\n\n user.authority_id = authority.id\n\n # now the user record is initialised (but not yet saved), give\n # the installation the opportunity to modify the user record or\n # reject the signup outright\n result = Auth::Authentication.before_signup_block.call(user, auth[PROVIDER], auth)\n\n logger.info \"Creating new user: #{result.inspect}\\n#{user.inspect}\"\n \n if result != false && user.save\n # user is created, associate an auth record or raise exception\n Auth::Authentication.create_with_omniauth(auth, user.id)\n\n # make the new user the currently logged in user\n remove_session\n new_session(user)\n\n # redirect the user to the page they were trying to access and\n # run any custom post-login actions\n redirect_to path\n Auth::Authentication.after_login_block.call(user, auth[PROVIDER], auth)\n else\n logger.info \"User save failed: #{user.errors.messages}\"\n\n # user save failed (db or validation error) or the before\n # signup block returned false. redirect back to a signup\n # page, where /signup is a required client side path.\n store_social(auth[UID], auth[PROVIDER])\n redirect_to '/signup/index.html?' + auth_params_string(auth.info)\n end\n\n # existing auth and existing user\n else\n begin\n # Log-in the user currently authenticating\n remove_session if signed_in?\n user = User.find_by_id(auth_model.user_id)\n new_session(user)\n redirect_to path\n Auth::Authentication.after_login_block.call(user, auth[PROVIDER], auth)\n rescue => e\n logger.error \"Error with user account. Possibly due to a database failure:\\nAuth model: #{auth_model.inspect}\\n#{e.inspect}\"\n raise e\n end\n end\n end",
"title": ""
},
{
"docid": "a05f74077bb6690afb6e80bf2f29d933",
"score": "0.62593096",
"text": "def initialize(params={})\n if params[:username]\n hash = Engine.hash_secret(params[:username], Userhash.username_salt)\n params[:hashname] = Password.new(hash)\n params.delete(:username)\n end\n super(params)\n end",
"title": ""
},
{
"docid": "f4ea3a0d1b8f594d0f187634b11964ae",
"score": "0.6248651",
"text": "def auth_hash\n # raise request.env['omniauth.auth'].to_yaml\n request.env[\"omniauth.auth\"]\n end",
"title": ""
},
{
"docid": "3ce52d944917c07df4bc934603c11579",
"score": "0.6236284",
"text": "def apply_omniauth(omniauth)\n\t\t#puts \"omniauth #{omniauth}\"\n\t\tself.email = omniauth['info']['email'] if email.blank?\n\t\tself.username = omniauth['info']['name'] if username.blank?\n\t\tself.remote_image_url = omniauth['info']['image'] if remote_image_url.blank?\n\t\tauthentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'], :oauth_token => omniauth['credentials']['token'], :oauth_token_secret => omniauth['credentials']['secret'])\n\t\tputs \"authentication built\"\n\tend",
"title": ""
},
{
"docid": "01c318c0ca61a5182aaa37260fa2b5dc",
"score": "0.6230979",
"text": "def initialize(auth_user_name: nil, auth_password: nil,\r\n use_hmac_authentication: false)\r\n if use_hmac_authentication\r\n Configuration.hmac_auth_user_name = auth_user_name\r\n Configuration.hmac_auth_password = auth_password\r\n else\r\n Configuration.basic_auth_user_name = auth_user_name\r\n Configuration.basic_auth_password = auth_password\r\n end\r\n end",
"title": ""
},
{
"docid": "9cad93a6271b176fc92034c6256b9884",
"score": "0.62244225",
"text": "def from_omniauth(user:, service:, hash:)\n return nil unless user.is_a?(User) &&\n service.present? &&\n hash.present?\n\n token_hash = hash.fetch(:credentials, {})\n return nil if token_hash[:token].blank?\n\n # revoke any existing tokens for the user + scheme\n where(user: user, external_service_name: service.downcase).find_each(&:revoke!)\n\n # add the token for the user + scheme\n expiry_time = (Time.zone.now + token_hash[:expires_at].to_i.seconds).utc if token_hash[:expires_at].present?\n new(\n user: user,\n external_service_name: service.downcase,\n access_token: token_hash[:token],\n refresh_token: token_hash[:refresh_token],\n expires_at: expiry_time\n )\n end",
"title": ""
},
{
"docid": "2b6ac8126e2e9d58615b8f2fd831da75",
"score": "0.6213459",
"text": "def new\n @user = env['omniauth.identity'] ||= User.new\n\n #if signed_in?\n #@user = User.new\n #else\n #auth = session['auth']\n #@user = User.create_with_omniauth(auth)\n #end\n end",
"title": ""
},
{
"docid": "a5a2fcc596e1434943a0baf08d6557f4",
"score": "0.62033266",
"text": "def build_resource(*args)\n # Call the parent function to build the User model.\n super\n \n # If we have :omniauth in our session cookie we will build\n # an authentication for the new user from that and then \n # check to make sure the user is valid (i.e. get the password\n # from someone who created an account via LinkedIn or Facebook).\n if session[:omniauth]\n @user.build_authentication(session[:omniauth])\n @user.valid?\n end\n end",
"title": ""
},
{
"docid": "2c9bbe71e6ab8cc36a6902b2787bc0cf",
"score": "0.61973506",
"text": "def create \n # render :text => request.env[\"omniauth.auth\"].to_yaml\n omniauth = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, authentication.user)\n elsif current_user # if user logged in but doesn't have this auth in DB\n current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid'])\n flash[:notice] = \"Authentication successful.\"\n redirect_to authentications_url\n else # if user doesn't exist\n user = User.new\n user.apply_omniauth(omniauth)\n if user.save #if validation passes\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, user)\n else #if validation doesn't pass\n session[:omniauth] = omniauth.except('extra')\n redirect_to new_user_registration_url\n end\n end \n end",
"title": ""
},
{
"docid": "3d0ae8f3434e18c73b8bc905a42a59d8",
"score": "0.6169777",
"text": "def create\n\n\t\t# grab the authentication return\n\t\tauth = request.env[\"omniauth.auth\"]\n\n\t\t# now create a temporary user with the auth element etc\n\t\tuser = User.omniauth_create auth\n\n\t\t# now set the session_id \n\t\tsession[:id] = user.id\n\n\t\t# redirect back to the root which can successfully switch the pages of the application etc\n\t\tredirect_to root_url, :notice => \"Successful Authentication\"\t\n\tend",
"title": ""
},
{
"docid": "7b308db44037ee5ea64e87478c1628b8",
"score": "0.61681926",
"text": "def from_omniauth(auth)\n raise 'UnknownProvider' unless omniauth_providers.include?(auth.provider)\n adapter = SuperbAuth.adapter_for(auth.to_hash)\n user = init_by_email(adapter.email)\n identity = user.identities.build(provider: auth.provider, uid: auth.uid, data: auth.to_hash)\n user.get_user_info_from_identity(identity)\n user\n end",
"title": ""
},
{
"docid": "a9ee188933716cae2e5d39dff23baa2a",
"score": "0.6162997",
"text": "def initialize(hash = {})\n @service_api_key = extract_value(hash, :serviceApiKey)\n @id = extract_value(hash, :id)\n @password = extract_value(hash, :password)\n @sns = extract_value(hash, :sns)\n @access_token = extract_value(hash, :accessToken)\n @refresh_token = extract_value(hash, :refreshToken)\n @expires_in = extract_integer_value(hash, :expiresIn)\n @raw_token_response = extract_value(hash, :rawTokenResponse)\n end",
"title": ""
},
{
"docid": "67b769e2e92deeefa5dfc15c07a4d561",
"score": "0.61577326",
"text": "def create \n omniauth = request.env[\"omniauth.auth\"]\n \n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n #directly sign in existing user with existing authentication\n flash[:notice] = \"signed in successfully\"\n sign_in_and_redirect(:user, authentication.user)\n elsif current_user\n #create a new authentication for currently signed in user\n current_user.authentications.create(:provider => omniauth['provider'], :uid => omniauth['uid']) \n flash[:notice] = \"Authentication successful.\" \n redirect_to authentications_url\n else\n # user does not have an account or is authenticated through a provider\n user = User.new\n user.apply_omniauth(omniauth) \n if user.save\n flash[:notice] = \"Signed in successfully.\" \n sign_in_and_redirect(:user, user) \n else\n session[:omniauth] = omniauth.except('extra') \n redirect_to new_user_registration_url\n end \n end\n end",
"title": ""
},
{
"docid": "dc2d8c622bd95f9df147b1f3da9db69f",
"score": "0.61549103",
"text": "def create\n auth = AuthService.where(:provider => @authhash[:provider], :uid => @authhash[:uid]).first\n\n if auth\n # signin existing user\n session[:user_id], session[:service_id] = auth.user_id, auth.id\n flash[:notice] = 'Signed in successfully via ' + @authhash[:provider].capitalize + '.'\n else\n # find or create user\n user = User.where(:email => @authhash[:email]).first || User.new(:email => @authhash[:email])\n user = user.apply_omniauth(@authhash)\n\n if user.save!\n session[:user_id], session[:service_id] = user.id, user.auth_services.where(:provider => @authhash[:provider]).first.id\n end\n flash[:notice] = 'Your account has been created and you have been signed in!'\n end\n unless session[:user_id]\n reset_session\n flash[:error] = 'There was an error while creating your account from which we were not able to recover.'\n end\n\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "b89874cd055d044aaf9f9178e6cc4571",
"score": "0.6140763",
"text": "def oauth\n Auth.new(params[:uid], params[:oauth_token], action_name)\n end",
"title": ""
},
{
"docid": "4b3d43aa658ea126d2252ff7bc2bc0a1",
"score": "0.61321145",
"text": "def authenticate(params)\n Auth.new(params).call\n end",
"title": ""
},
{
"docid": "a1c4e8d770eae10c2315ebcab89366b9",
"score": "0.61190045",
"text": "def add_service_from_auth_hash(auth_hash)\n self.email = auth_hash.info.email if self.email.blank?\n self.send(\"#{auth_hash.provider}_user_id=\", auth_hash.uid)\n self.send(\"#{auth_hash.provider}_token=\", auth_hash.credentials.token)\n self.send(\"#{auth_hash.provider}_secret=\", auth_hash.credentials.secret)\n self.save\n self.send(\"process_#{auth_hash.provider}_queue\")\n end",
"title": ""
},
{
"docid": "d76a9b0b8b5c00d788de81f30bd9fa58",
"score": "0.61118466",
"text": "def create\n # Store authentication hash from 3rd party web service \n omniauth = request.env['omniauth.auth']\n logger.debug \"\\n\\n\\t omniauth \\n\\n\"\n logger.debug omniauth\n\n \n # Attempt to find an existing authentication in the database\n authentication = Authentication.\n find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n \n # handle returning user, new authentication for existing user, \n # or new user cases\n if authentication\n # we found an authentication in the database so\n # we know this is a returning user\n flash[:notice] = \"Signed in successfully\"\n # redirect to user's profile\n sign_in_and_redirect(:user, authentication.user)\n elsif current_user\n # We did not find a matching authentication in the \n # database but current_user is defined. This tells\n # us that a currently logged in user is adding a new\n # authentication method to their existing account.\n\n # build new authentication for current_user\n current_user.build_authentication(omniauth)\n\n flash[:notice] = \"Authentication successful\"\n # redirect to the page for managing authentications\n redirect_to authentications_url\n else\n # We did not find a matching authentication and there\n # is no current_user. So, we need to create a new User\n # and a new Authentication.\n\n # Find the invited user by the invitation_token\n user = User.accept_invitation!(:invitation_token => session[:invitation_token])\n\n # Build a new authentication\n user.build_authentication(omniauth)\n \n # try to save the user\n if user.save\n # if we pass the authentications redirect the new user\n # to the user's profile page\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, user)\n else\n # if we did not pass the authentications (e.g. the new\n # user did not have an email address) we redirect to \n # the new_user_registration_url so that the new user\n # can give us the information that we need. This is where\n # we collect emails from people who sign up with LinkedIn or \n # Facebook.\n session[:omniauth] = omniauth.except('extra')\n redirect_to new_user_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "ac36f14c77ed5e01915d06dee574122e",
"score": "0.6101301",
"text": "def create\n pw = \"aspace-oauth-#{auth_hash[:provider]}-#{SecureRandom.uuid}\"\n pw_path = File.join(Dir.tmpdir, pw)\n backend_session = nil\n\n uid = auth_hash.uid\n email = AspaceOauth.get_email(auth_hash)\n username = AspaceOauth.use_uid? ? uid : email\n puts \"Received callback for: [uid: #{uid}], [email: #{email}]\"\n if username && email\n username = username.split('@')[0] # usernames cannot be email addresses\n auth_hash[:info][:username] = username # set username, checked in backend\n auth_hash[:info][:email] = email # ensure email is set in info\n File.open(pw_path, 'w') { |f| f.write(JSON.generate(auth_hash)) }\n backend_session = User.login(username, pw)\n end\n\n if backend_session\n User.establish_session(self, backend_session, username)\n load_repository_list\n else\n flash[:error] = 'Authentication error, unable to login.'\n end\n\n File.delete pw_path if File.exist? pw_path\n redirect_to controller: :welcome, action: :index\n end",
"title": ""
},
{
"docid": "26f7bde4a2593168f078f5e470050230",
"score": "0.6099905",
"text": "def get_token_from_hash(hash)\n access_token = hash.delete('access_token') || hash.delete(:access_token) || hash.delete('oauth_token') || hash.delete(:oauth_token)\n opts = {:expires_at => hash[\"expires\"] || hash[:expires],\n :header_format => \"OAuth2 %s\",\n :param_name => \"access_token\"}\n\n @token = AccessToken.new(self, access_token, opts)\n end",
"title": ""
},
{
"docid": "aaed50139abef4bd30c149266c6a384a",
"score": "0.60987896",
"text": "def create\n omniauth = request.env['omniauth.auth']\n authparams = ActionController::Parameters.new(omniauth.slice 'provider', 'uid').permit('provider', 'uid')\n # Our query parameters appear in env['omniauth.params']\n if origin_url = request.env['omniauth.origin'] # Remove any enclosing quotes\n origin_url.sub! /^\"?([^\"]*)\"?/, '\\\\1'\n end\n # Originator is where we came from, so we can go back there if login fails\n if originator = request.env['omniauth.params']['originator'] # Remove any enclosing quotes\n originator.sub! /^\"?([^\"]*)\"?/, '\\\\1'\n end\n # Check for existing authorization\n @authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n (info = omniauth['info']) && (email = info['email']) && (user = User.find_by_email(email))\n intention = request.env['omniauth.params']['intention'] # If intention is 'signup', don't accept existing authentications\n if intention == \"signup\"\n if @authentication || user # This authentication method already in use\n flash[:notice] = \"That #{omniauth.provider.capitalize} login is already in use on RecipePower.<br>Perhaps you just need to sign in?\"\n response_service.amend originator\n url_to = originator\n else # No user and no authentication: perfect\n # Just create the account, getting what we can get out of the authorization info\n (user = User.new).apply_omniauth(omniauth)\n response_service.amend originator\n if user.save\n @authentication = user.authentications.create!(authparams) # Link authorization to user\n sign_in user, :event => :authentication\n response_service.user = user\n SignupEvent.post user # RpMailer.welcome_email(user).deliver\n flash[:notice] =\n %Q{Welcome to RecipePower, #{user.polite_name}! Introductory email is on its way. }\n url_to = after_sign_in_path_for(user)\n else\n # If user can't be saved, go back to edit params\n url_to = response_service.decorate_path(new_user_registration_url)\n end\n end\n # Intention is not signing up\n elsif current_user\n if @authentication # Authentication already in use\n if @authentication.user == current_user\n flash[:notice] = \"You're already connected through #{@authentication.provider_name}!\"\n else\n flash[:notice] = \"Sorry, your current #{@authentication.provider_name} login is tied to another RecipePower user.\"\n end\n else\n # Add the authentication method to the current user. We return to the authentications dialog\n current_user.apply_omniauth(omniauth)\n @authentication = current_user.authentications.create!(authparams) # Link to existing user\n flash[:notice] = \"Yay! You're now connected to RecipePower through #{@authentication.provider_name}.\"\n end\n url_to = origin_url\n elsif @authentication\n flash[:notice] = \"Yay! Signed in with #{@authentication.provider_name}. Welcome back, #{@authentication.user.handle}!\"\n sign_in @authentication.user, :event => :authentication\n response_service.amend originator\n url_to = after_sign_in_path_for(@authentication.user)\n # This is a new authentication (not previously linked to a user) and there is\n # no current user to link it to. It's possible that the authentication will come with\n # an email address which we can use to log the user in.\n elsif user\n user.apply_omniauth(omniauth)\n @authentication = user.authentications.create!(authparams) # Link to existing user\n sign_in user, :event => :authentication\n flash[:notice] = \"Yay! Signed in with #{@authentication.provider_name}. Nice to see you again, #{user.handle}!\"\n response_service.amend originator\n url_to = after_sign_in_path_for(user)\n end\n # We haven't managed to get the user signed in by other means, but we still have an authorization\n if !(current_user || user) # Failed login not because of failed invitation\n # The email didn't come in the authorization, so we now need to\n # discriminate between an existing user(and have them log in)\n # and a new user (and have them sign up). Time to throw the problem\n # over to the user controller, providing it with the authorization.\n session[:omniauth] = omniauth.except('extra')\n flash[:notice] = \"Hmm, apparently that service isn't linked to your account. If you log in by other means (perhaps you need to create an account?), you can link that service in Sign-In Services\"\n url_to = originator || new_user_session_path\n end\n # response_service.amend origin_url # Amend response expectations according to the originating URL\n render 'callback', :layout => false, :locals => { url_to: url_to }\n end",
"title": ""
},
{
"docid": "8b2236f29d78dde29319af5db850df09",
"score": "0.60947067",
"text": "def apply_omniauth(omniauth)\n case omniauth['provider']\n when 'facebook'\n self.apply_facebook(omniauth)\n end\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'], :token =>(omniauth['credentials']['token'] rescue nil))\n end",
"title": ""
},
{
"docid": "88802db8e09cc662bcb686d22b246b65",
"score": "0.6092332",
"text": "def create_by_omniauth(auth)\n User.create do |user|\n user.assign_attributes(name: auth.info.name, email: auth.info.email,\n password: Devise.friendly_token[0, 20])\n user.skip_confirmation! if user.email\n user.link_with_omniauth(auth)\n end\n end",
"title": ""
},
{
"docid": "a8c81f132a6152a3eb8612bcd3bdc5cb",
"score": "0.60865444",
"text": "def create_user\n OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new({\n \"provider\" => \"github\",\n \"uid\" => \"666\",\n \"credentials\" => {\n \"token\" => \"123123\"},\n \"info\" => {\n \"nickname\" => \"The Bease\",\n \"name\" => \"WilliamShatner\",\n \"email\" => \"LOLCATZ@io.com\",\n },\n \"extra\" => {\n \"raw_info\" => {\n \"avatar_url\" => \"123\",\n \"html_url\" => \"12312\",\n \"hireable\" => \"false\",\n \"followers\" => \"1\",\n \"following\" => \"1\",\n }\n },\n })\n end",
"title": ""
},
{
"docid": "10c6512bd397559c09b2acc5576e2405",
"score": "0.60848886",
"text": "def apply_omniauth(omniauth)\n # self.email = omniauth['info']['email'] if email.blank? # Twitter does not return an email\n authentications.build(provider: omniauth[\"provider\"], uid: omniauth[\"uid\"])\n end",
"title": ""
},
{
"docid": "a53798ccea33cd7dfde1c13b6a41c989",
"score": "0.6071231",
"text": "def auth\n if (!@auth || !@auth[:username]) && @headers['Authorization'] &&\n @headers['Authorization'] !~ /^OAuth\\s/\n\n str = Base64.decode64 @headers['Authorization'].split[1]\n username, password = str.split(\":\", 2)\n @auth = {\n :username => username,\n :password => password\n }.merge(@auth || {})\n end\n\n @auth\n end",
"title": ""
},
{
"docid": "34080616e5be0eacc588fbc32aaf5d13",
"score": "0.6061609",
"text": "def signin_with_hash(hash)\n begin\n JSON.parse(RestClient.get construct_url(\"user/signin_with_hash/#{hash}\"))\n rescue RestClient::BadRequest => e\n @last_error = e.http_body\n @last_error_code = e.http_code\n false\n end\n end",
"title": ""
},
{
"docid": "16d55c45c5e107f513239c51dd0c7c20",
"score": "0.60484093",
"text": "def get_token_from_hash(hash)\n access_token = hash.delete('access_token') || hash.delete(:access_token) || hash.delete('oauth_token') || hash.delete(:oauth_token)\n access_token_opts = {:expires_at => hash[\"expires\"] || hash[:expires],\n :header_format => \"OAuth2 %s\",\n :param_name => \"access_token\"}\n\n @token = OAuth2::AccessToken.new(self, access_token, access_token_opts)\n end",
"title": ""
},
{
"docid": "cdb3a7de766724c3a62b0c0ff53e097d",
"score": "0.6047116",
"text": "def amniauth_create\n user = User.find_or_create_by(:provider => auth_hash[:provider], :uid => auth_hash[:uid]) do |user|\n user.name = auth_hash[:info][:name]\n end\n\n session[:user_id] = user.id\n redirect_to user_path(user)\n end",
"title": ""
},
{
"docid": "0f2bb2520973b19b1e8bfab7f53ab670",
"score": "0.60459507",
"text": "def auth_hash\n OmniAuth::Utils.deep_merge(super(), {\n 'uid' => @uid,\n 'user_info' => {\n 'name' => @username\n }\n })\n end",
"title": ""
},
{
"docid": "08d8a17503526ecafaf5cf01f8ec61b1",
"score": "0.6042069",
"text": "def initialize\n @auth_accounts = Hash.new do |h, uri|\n h[uri] = {}\n end\n\n @default_auth = nil\n end",
"title": ""
},
{
"docid": "9802170b4ea652e37217ec101a16fa14",
"score": "0.60274774",
"text": "def apply_omniauth(omniauth)\r\n self.email = omniauth['user_info']['email'] if email.blank?\r\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\r\n end",
"title": ""
},
{
"docid": "ef064ce032db9e4ab42426fe0baec4b9",
"score": "0.6027214",
"text": "def create\n @user = User.find_by(username: params[:username])\n @auth = request.env[\"omniauth.auth\"]\n if @user == nil && @auth == nil\n reject_credentials\n else\n if @user != nil\n if @user.authenticate(params[:password])\n start_session(@user.id)\n else\n reject_credentials\n end\n elsif check_credentials(@auth.uid) != nil\n start_session(check_credentials(@auth.uid).id)\n else\n user = User.new_twitter_user(@auth)\n start_session(user.id)\n end\n end\n end",
"title": ""
},
{
"docid": "bc05ca1c2707ac8c8d5a7c17675f9844",
"score": "0.6025148",
"text": "def build_profile_from_omniauth(auth)\n self.provider = auth.provider\n self.uid = auth.uid\n self.name = auth.info.name\n self.email = auth.info.email\n parse_description(auth)\n self\n end",
"title": ""
},
{
"docid": "380f829e24d74f08e4f965e0a3727068",
"score": "0.60222703",
"text": "def apply_omniauth(omni)\n self.authentications.build(:provider => omni['provider'],\n :uid => omni['uid'],\n :token => omni['credentials']['token'],\n :token_secret => omni['credentials']['secret'])\n\n self.send(\"set_#{omni['provider']}_info\", omni)\n end",
"title": ""
},
{
"docid": "085a3ee2cb3093871a62622c60041026",
"score": "0.60199296",
"text": "def initialize(username, password)\n self.username = username\n self.password = password\n start_authentication_workflow\n end",
"title": ""
},
{
"docid": "b76a2ca4417e24d8eacf071571677f05",
"score": "0.601523",
"text": "def callback\n @user = User.find_by_hash(auth_hash)\n if @user\n login(@user)\n redirect_to \"/\" and return\n else\n # We store the authorization so that the user cannot modify\n # the provider/uid details in the form\n @authorization = Authorization.create_from_hash(auth_hash)\n session[:auth_id] = @authorization.id\n @user = User.new_from_hash(auth_hash)\n end\n end",
"title": ""
},
{
"docid": "c6bac3ea6ab480e774cbfcfe05ee679f",
"score": "0.60128623",
"text": "def http_auth_hash\n keys = [http_authentication_key, :password]\n Hash[*keys.zip(decode_credentials).flatten]\n end",
"title": ""
},
{
"docid": "c6bac3ea6ab480e774cbfcfe05ee679f",
"score": "0.60128623",
"text": "def http_auth_hash\n keys = [http_authentication_key, :password]\n Hash[*keys.zip(decode_credentials).flatten]\n end",
"title": ""
},
{
"docid": "cac22da7cf1ba2fb5568177d770c6be3",
"score": "0.60125554",
"text": "def create\n if auth_hash = request.env[\"omniauth.auth\"]\n @user = User.find_or_create_by_omniauth(auth_hash)\n set_session_and_redirect\n else\n @user = User.find_by(username: params[:username])\n if @user && @user.authenticate(params[:password])\n set_session_and_redirect\n else\n redirect_to login_path #Does not allow for field w/errors and does not keep data.\n #not rendering log in for extra security. User needs to reenter information.\n\n flash[:message] = \"There was an error with your request. Please try again.\"\n end\n end\n end",
"title": ""
},
{
"docid": "37fc4167ee1c992a10c73eff16976a75",
"score": "0.6012442",
"text": "def initialize(code: nil, login: nil, password: nil)\n # code (arg) - exchange for access token\n @authenticator = if code.present?\n Oauth.new(code)\n else\n Standard.new(login, password)\n end\n\n end",
"title": ""
},
{
"docid": "0e5e9d190e03ca4c39860462854aaf51",
"score": "0.60103005",
"text": "def create\n user = User.find_for_authentication(email: user_params[:email])\n\n if user && user.valid_password?(user_params[:password])\n user.generate_authentication_token\n\n expose({\n user_id: user.id,\n token: user.authentication_token\n })\n else\n error! :unauthenticated\n end\n end",
"title": ""
},
{
"docid": "bc4030235c895f6a2544ab68cf970ce0",
"score": "0.6006936",
"text": "def new\n auth_hash = request.env['omniauth.auth']\n session[:auth_provider] = auth_hash[:provider]\n\n # look up auth_field, auth_value of User by provider, from config/initializers/omniauth.rb\n # Currently CAS is our only provider\n auth_config = ResearchMatch::Application.config.auth_providers[session[:auth_provider].to_sym]\n if auth_config\n auth_field = auth_config[:auth_field].to_s\n auth_value = auth_hash[auth_config[:auth_value]].to_s\n session[:auth_field] = auth_field\n session[:auth_value] = auth_value\n else\n flash[:error] = \"There were problems identifying your auth provider. Please try again or contact support.\"\n redirect_to home_path\n return\n end\n\n\n user = User.where(auth_field => auth_value).first\n if user.present?\n UserSession.new(user).save\n session[:user_id] = user.id # TODO remove (use only @user_session)\n redirect_to dashboard_path\n else\n if session[:auth_provider].to_sym == :google_oauth2\n session[:info_hash] = auth_hash[:info]\n end\n puts 'redirect_to new_user_path'\n redirect_to new_user_path\n end\n end",
"title": ""
},
{
"docid": "5f74c097a80fd00669b17f1908edf63e",
"score": "0.6006754",
"text": "def identity_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "4cc105a7d845d3e84897b9d2400d2370",
"score": "0.5999068",
"text": "def create_or_update_identity_from_omniauth_hash\n # Create or update an identity from the attributes mapped in the mapper\n identity = identities.find_or_initialize_by(uid: omniauth_hash_map.uid, provider: omniauth_hash_map.provider)\n identity.properties.merge!(omniauth_hash_map.properties)\n identity.save\n end",
"title": ""
},
{
"docid": "ba3646495a2d1ca5bfdda3f35e599bae",
"score": "0.5997459",
"text": "def create_new_user_and_identity(auth, params)\n user = User.create!(\n first_name: auth.info[:first_name],\n last_name: auth.info[:last_name],\n email: auth.info[:email],\n oauth_signup: true,\n # referred_by_user_id => params.andand[\"rid\"]\n )\n user.confirm!\n create_new_identity(user, auth)\n end",
"title": ""
},
{
"docid": "f3a19be03aa0e11474e75c669fab3aa3",
"score": "0.599358",
"text": "def auth\n @auth ||= Hash.new\n\n if !@auth[:username] && @headers['Authorization']\n str = Base64.decode64 @headers['Authorization'].split[1]\n username, password = str.split(\":\", 2)\n @auth = {:username => username, :password => password}.merge @auth\n end\n\n @auth\n end",
"title": ""
},
{
"docid": "38631c798dba4a2b927b7f127d9f26f7",
"score": "0.59891015",
"text": "def create\n if auth_hash\n @user = User.from_omniauth(auth_hash, current_user.first.username) \n else\n @user = User.new(user_params)\n session[:current_user] = params[:user][:username]\n end\n respond_to do |format|\n if @user.save\n format.html { redirect_to action: \"show\", id: @user.username }\n format.json { render :index, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a0b4387b25dce51106561db76b0c600",
"score": "0.598107",
"text": "def apply_omniauth(omniauth)\n case omniauth['provider']\n when 'facebook'\n self.apply_facebook(omniauth)\n when 'twitter'\n self.apply_twitter(omniauth)\n end\n authentications.build(hash_from_omniauth(omniauth))\n end",
"title": ""
},
{
"docid": "b89ad90af5e24bf3f28954840a4cb333",
"score": "0.5979532",
"text": "def initialize(app_id, app_secret, api_key, email, password)\n\n merge!(\n {\n applicationCredentials: {\n applicationId: app_id,\n applicationSecret: app_secret\n },\n userCredentials: {\n apiKey: api_key,\n email: email,\n password: password \n }\n }\n )\n end",
"title": ""
},
{
"docid": "ee59d97fe35fcaabed9e3bf20fbff754",
"score": "0.5968405",
"text": "def initialize(user, password)\n @user = user\n @password = password\n\n # In the constructor, try to authenticate and get the access_token and\n # client_id\n authenticate\n end",
"title": ""
},
{
"docid": "33f67f518c3e4d6527cd3750adec2730",
"score": "0.5967578",
"text": "def create\n @omniauth = request.env[\"omniauth.auth\"]\n \n authentication = Authentications.find_by_provider_and_uid(@omniauth['provider'], @omniauth['uid'])\n\n if(@@logingIn ==0) \n registering(authentication)\n elsif(@@logingIn ==1)\n signingIn(authentication)\n end\n\nend",
"title": ""
},
{
"docid": "71ac001d0519a449c30634e1cfe85e08",
"score": "0.5967438",
"text": "def create_new_identity(user, auth)\n Identity.create! do |id|\n id.provider = auth['provider']\n id.uid = auth['uid']\n id.user = user\n end\n user\n end",
"title": ""
},
{
"docid": "919267e33e78411de2abcc14d747111b",
"score": "0.59621245",
"text": "def initialize(email, password)\n response = self.class.post(api_url(\"sessions\"), body: { email: email, password: password })\n raise 'Invalid email or password' if response.code == 404\n @auth_token = response[\"auth_token\"]\n\n end",
"title": ""
},
{
"docid": "72c30f008728b38bb0cd9e2f9c6e7a3e",
"score": "0.5960537",
"text": "def authorization_hash\n Base64.encode64(\"#{BASIC_AUTH.fetch(:username)}:#{BASIC_AUTH.fetch(:password)}\").strip\n end",
"title": ""
}
] |
46e4d6366705b5b7017ab4e154bf7b24
|
Checks if the the reservation surpases the total allowed time
|
[
{
"docid": "eaf3aa00393daf08603d1e0f056754c6",
"score": "0.0",
"text": "def max_usage_time(current_time, max_usage)\n statuses = Reservation.statuses\n start_time = (current_time.to_time - max_usage.hours).to_datetime\n active_reservations = equipment.reservations\n .where('start_time >= ? AND start_time < ?', start_time, current_time)\n .where('status = ?', statuses[:confirmed])\n used_time = active_reservations.sum { |res| ((res.end_time - res.start_time) / 3600) }\n used_time\n end",
"title": ""
}
] |
[
{
"docid": "336468a35776d688bd922ce6ad08922a",
"score": "0.7096849",
"text": "def valid_timing\n errors.add(:review, \"Invalid timing for review\") unless !reservation.nil? && reservation.status == \"accepted\" && reservation.checkout < Time.current\n end",
"title": ""
},
{
"docid": "4e2c27b95843a81e62d7b5c6184c7842",
"score": "0.7062196",
"text": "def reservation_available\n if timeslot_contains_reservations?\n errors.add(:base, I18n.t('reservation.reservation_available'))\n end\n end",
"title": ""
},
{
"docid": "a20a05a469cbee8886201a2015d920e1",
"score": "0.70181316",
"text": "def restaurant_must_be_within_capacity\n unless self.restaurant.is_available?(self.begin_time, self.people)\n errors.add(:begin_time, \"is not available for \" + pluralize(self.people, \"person\"))\n end\n end",
"title": ""
},
{
"docid": "60788372f097916307c46eb724d51222",
"score": "0.6917585",
"text": "def is_available\n return unless start_time.present? && end_time.present?\n\n reservation_hours = (end_time - start_time) / 1.hour\n day = start_time.wday\n st = start_time\n et = reservation_hours > 24 ? end_time.end_of_day : end_time\n while reservation_hours > 0 do\n unless available_at(st, et, day)\n errors.add(:start_time, I18n.t('activerecord.errors.models.reservation.attributes.date.available_hours'))\n return\n end\n if overnight?\n st = start_time.beginning_of_day\n end\n et = reservation_hours > 24 ? end_time.end_of_day : end_time\n day = (day + 1) % 7\n reservation_hours -= 24\n end\n end",
"title": ""
},
{
"docid": "af34ec275e9db22252d84309a0751da3",
"score": "0.6867283",
"text": "def availability(seats, time, restaurant, user)\n taken_seats = reservations.where(time: ((time-2.hours+1.minute)..(time+2.hours-1.minute))).sum(:seats)\n puts taken_seats\n taken_seats + seats <= capacity\n end",
"title": ""
},
{
"docid": "1e027c5637ee1caf0d7cf3eeef2e8aa9",
"score": "0.6857942",
"text": "def valid_reservation_time?(reservation_time)\n reservation_h = reservation_time.strftime(\"%H\").to_i\n start_h = start_time.strftime(\"%H\").to_i\n end_h = end_time.strftime(\"%H\").to_i\n if start_h < reservation_h && reservation_h < end_h\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "5e3acc3407fc56d7710794e62beb1b41",
"score": "0.6840191",
"text": "def timeslot_contains_reservations?\n return start_dt.blank? || end_dt.blank? || existing_reservations?\n end",
"title": ""
},
{
"docid": "2c1b380fadcb6ee759c22ffa10faddd6",
"score": "0.68318707",
"text": "def duration_allowed?\n max_duration = equipment_model.category.maximum_checkout_length\n if max_duration == \"unrestricted\" || (self.class == Reservation && self.checked_in)\n return true\n elsif self.duration > max_duration\n errors.add(:base, equipment_model.name + \"cannot be reserved for more than \" + max_duration.to_s + \" days at a time.\\n\")\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "305a7138b3b545f0e732232b3f78f741",
"score": "0.6773151",
"text": "def no_other_reservations_on_this_time_period\n item_reservations.each do |ir|\n item = ir.item\n amount_available = item.get_availability(pick_up_time.to_datetime, return_time.to_datetime, id)\n if ir.amount > amount_available\n if amount_available > 0\n errors.add(:items, errors.generate_message(:items, :too_few_available, { :item_title => item.title, :count => amount_available.to_s }))\n else\n errors.add(:items, errors.generate_message(:items, :none_available, { :item_title => item.title }))\n end \n end\n end \n end",
"title": ""
},
{
"docid": "71457e256401dad2a06bea97059e7220",
"score": "0.663452",
"text": "def validate\n\t\tif not isEmpty(self.time)\n\t\t\terrors.add(:time, \"is already occupied.\")\n\t\tend\n\t\tif not Schedule.isValidTimeSlot(self.schedule, self.time)\n\t\t\terrors.add(:time, \"is not a valid timeslot.\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5d6554c0e86fa6b60ce3693222101333",
"score": "0.6610206",
"text": "def valid_venue_time?\n valid_time = self.venue.matches.all? do |match|\n !(match.start_time >= self.start_time && match.start_time <= self.end_time || match.end_time >= self.start_time && match.end_time <= self.end_time)\n end\n errors.add(:start_time, \"The venue is not available for this time\") unless valid_time\n end",
"title": ""
},
{
"docid": "c44c9bf9f269e4a2b980d48ed6328576",
"score": "0.6601223",
"text": "def is_scheduled?(time)\n diff = (time-base_time)\n if (departure_time.minutes < diff && diff < departure_time.minutes + duration.minutes)\n return true\n else # it could be by a lot.\n #Say our base time ended up at midnight tomorrow becase it's after midnight\n # then our diff < -24 hourse\n diff = diff + 24.hours\n departure_time.minutes < diff && diff < departure_time.minutes + duration.minutes\n end\n end",
"title": ""
},
{
"docid": "3143e607e4fa1ce26368cd5e370cde6f",
"score": "0.6585283",
"text": "def available?(reservations = [])\n return true if self.class == Reservation && self.status != 'reserved'\n all_res = reservations.dup\n all_res << self if self.class != Reservation\n all_res.uniq!\n eq_objects_needed = same_model_count(all_res)\n if equipment_model.num_available(start_date, due_date) < eq_objects_needed\n errors.add(:base, equipment_model.name + \" is not available for the full time period requested.\\n\")\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "eb1fd7c2e7ebe98af4888eb25df767e5",
"score": "0.6557359",
"text": "def free_time_frame?\n started_booking_time = Booking.where(start_time: start_time)\n\n if started_booking_time.present? && (started_booking_time.ids.first != id)\n errors.add(:start_time, 'Sorry, this hour is already booked')\n end\n end",
"title": ""
},
{
"docid": "4acd42139950140811118cddf8419473",
"score": "0.65569514",
"text": "def reservation_time\n\t\trestaurant = Restaurant.find(self.restaurant_id)\n\t\tday = self.requested_date_time.strftime(\"%A\").downcase\n\n\t\topen_time = get_time(restaurant, day, \"open\")\n\t\tclose_time = get_time(restaurant, day, \"close\")\n\t\tcheck_if_restaurant_closed(open_time)\n\n\t\tif open_time\n\t\t\topen_time = convert_time_to_decimal(open_time)\n\t\t\tclose_time = convert_time_to_decimal(close_time)\n\t\t\tclose_time = close_time + 24 if close_time < open_time # Add a full day if close time is less than open time\n\t\t\trequested_time = convert_time_to_decimal(self.requested_date_time)\n\t\t\tlatest_reservation_time = close_time - 0.5 # Subtract half hour from close time\n\t\t\tcheck_reservation_during_allowed_hours(open_time, latest_reservation_time, requested_time)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "89213255867bb9a8918c7d9add9408da",
"score": "0.6488214",
"text": "def delivery_time_can_not_be_too_soon\n if time < Time.now + @@starttime\n errors.add(\"Ora di consegna:\", \"ci vogliono almeno #{@@starttime/60} minuti per l\\'elaborazione.\n Quindi ordinazioni prima delle #{(Time.now + @@starttime).strftime(\"%H:%M\")} non possono essere accettate.\")\n end\n end",
"title": ""
},
{
"docid": "6abb7fec71f8c92d5fef39fa2a2db194",
"score": "0.64686453",
"text": "def booking_is_available?(user, service, order_time)\n order_time > Time.new + 6.hours and user.id != service.user_id\n end",
"title": ""
},
{
"docid": "e3472c58a4165053a0a97dc45b65ecd2",
"score": "0.64684117",
"text": "def remaining?\n return true if max_times.zero?\n registrations.count < max_times\n end",
"title": ""
},
{
"docid": "756c079a284e75568321a0a944bd18c9",
"score": "0.64344317",
"text": "def validate_positive_times\n return true if (time_type == \"gift_given\" || time_type == \"penalty\") || start.nil? || finish.nil?\n if r = start >= finish\n errors.add(:start, \"must come before finish\")\n end\n r\n end",
"title": ""
},
{
"docid": "4d766de5735abf2594a9172bc01f2ddc",
"score": "0.6407757",
"text": "def time_collision_validation\n\t\tappointments = Appointment.all\n\n\t\t#if duration is equals to 0, it means it is fixed pay. \n\t\t#Here, duration is set to 0 so it will not be validated \n\t\t#This will execute if is_pay_per hour is set to 0\n\t\tif @start_date.present? && @start_time.present? && duration == 0.to_s\n\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\t\t\n\t\t\tappointments.each do |a|\n\t\t\t\t# will ensure that the appointment to compare will not be compared to itself in the database if it exists\n\t\t\t\tif a.id.to_s != @appointment_id.to_s\n\t\t\t\t\t# compare fixed-pay input to pay per hour appointment\n\t\t\t\t\tif a.task.is_pay_per_hour && start_at < a.end_at && start_at >= a.start_at \n\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\terrors.add(:start_date, \"An appointment is already \n\t\t\t\t\t\t\tset at #{a.start_at.strftime(\"%I:%M%p\")}, #{a.start_at.strftime(\"%d/%m/%Y\")} \n\t\t\t\t\t\t\tto #{a.end_at.strftime(\"%I:%M%p\")} on #{a.end_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\tbreak\n\n\n\t\t\t\t\t\t#compare fixed-pay input to fixed pay appointment\n\t\t\t\t\telsif !a.task.is_pay_per_hour && start_at == a.start_at \n\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\terrors.add(:start_date, \"A fixed pay appointment is aleady set at #{a.start_at.strftime(\"%I:%M%p\")}\n\t\t\t\t\t\t\t, #{a.start_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend \t\n\t\t\t\tend \t\n\t\t\tend\n\n\n\t\t\t\t#Here, duration should be present and will be always validated\n\t\t\t\t#This will execute if is_pay_per hour is set to 1\n\t\t\telsif @start_date.present? && @start_time.present? && duration.present?\n\t\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\t\t\tend_at = Time.parse(\"#{@start_date} #{@start_time}\") + (@duration.to_f.hours+ (1.hours))\n\n\t\t\t\tappointments.each do |a|\n\t\t\t\t\t# will ensure that the appointment to compare will not be compared to itself in the database if it exists\n\t\t\t\t\tif a.id.to_s != @appointment_id.to_s\n\t\t\t\t\t\t# compare pay per hour input to pay per hour appointment\n\t\t\t\t\t\tif a.task.is_pay_per_hour && start_at < a.end_at && a.start_at < end_at \n\n\t\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\t\terrors.add(:start_date, \"An appointment already \n\t\t\t\t\t\t\t\texists at #{a.start_at.strftime(\"%I:%M%p\")}, #{a.start_at.strftime(\"%d/%m/%Y\")} \n\t\t\t\t\t\t\t\tto #{a.end_at.strftime(\"%I:%M%p\")} on #{a.end_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\t\t#compare pay per hour input to fixed pay appointment\n\t\t\t\t\t\telsif !a.task.is_pay_per_hour && a.start_at <= end_at && a.start_at >= start_at\n\n\t\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\t\terrors.add(:start_date, \"A fixed pay appointment is aleady set at #{a.start_at.strftime(\"%I:%M%p\")}\n\t\t\t\t\t\t\t\t, #{a.start_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\t\tbreak\t\t\t\t\n\t\t\t\t\t\tend\t\t\t\n\t\t\t\t\tend \n\t\t\t\tend\n\t\t\tend \n\t\tend",
"title": ""
},
{
"docid": "16ed173c8cda8679881ac5d387118086",
"score": "0.6385634",
"text": "def valid?(time=Time.now.utc)\n time>not_before && time<self.not_after\n end",
"title": ""
},
{
"docid": "feb93a674016f7c60a2e4be2be4e9add",
"score": "0.6369594",
"text": "def is_correct_time? #:doc:\n if(self.endTime && self.startTime && (self.endTime<=>self.startTime)==-1)\n errors.add([:starTime,:endTime],\"Attenzione l'ora di inizio è piu grande dell'ora di fine\")\n end\n end",
"title": ""
},
{
"docid": "bacb20d2d2ec15d9946c1a02be6f8af8",
"score": "0.6349107",
"text": "def reservations_exist_in_block\n if timeslot_contains_reservations?\n errors.add(:base, I18n.t('reservation.reservations_exist_in_block'))\n end\n end",
"title": ""
},
{
"docid": "3cec7e6a781a7fd7099e5aecbc8cf10f",
"score": "0.63363093",
"text": "def exclusive_schedule\n if Schedule.where('init >= ? AND init <= ?', init, finish).any?\n errors.add(:base, \"Já existe uma reserva para esse horário\")\n end\n end",
"title": ""
},
{
"docid": "bf1add167abd931c5865963889e437d8",
"score": "0.62827784",
"text": "def check_capacity\n result = true\n\n user = User.find_by_id(self.user_id)\n days = (Date.parse(self.to_date.to_s) - Date.parse(self.from_date.to_s)).to_i\n\n (0..days).each do |i|\n date = self.from_date + i.day\n\n if get_total_capacity(self.user_id, date) > 100 \n result = false\n end\n end\n\n result\n end",
"title": ""
},
{
"docid": "36703ff26b9e675dd4c0f2b3e3949686",
"score": "0.62700915",
"text": "def validate_negative_times\n return true if (time_type != \"penalty\" && time_type != \"gift_given\") || start.nil? || finish.nil?\n if r = start <= finish\n errors.add(:start, \"must come after finish, for penalties\")\n end\n r\n end",
"title": ""
},
{
"docid": "b831a5b88352e62af5c5ecd6f40ece13",
"score": "0.62427986",
"text": "def not_in_past?\n #return true if self.class == Reservation && self.status != 'reserved'\n if (start_date < Date.today) || (due_date < Date.today)\n errors.add(:base, \"Reservation cannot be made in the past.\\n\")\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "a4e509229b98d2f2430a76acf88ca9c4",
"score": "0.6240854",
"text": "def validate_time(start_time, end_time)\n\t\t\t\ttime_now = Time.now.strftime(\"%m/%d/%Y %H:%M\")\n\t\t\t\tappointments = Appointment.all\n\t\t\t\ttoday = start_time.split[0]\n\t\t\t\ttoday_appts = appointments.where(start_time: today)\n\t\t\t\tresult = false\n\n\t\t\t\tif start_time > time_now\n\t\t\t\t\tif today_appts.length == 0\n\t\t\t\t\t\treturn true\n\t\t\t\t\tend\n\t\t\t\t\ttoday_appts.each do |appt|\n\t\t\t\t\t\tif start_time <= appt.end_time && appt.start_time <= end_time\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tresult = true\n\t\t\t\t\t\tend\n\t\t\t\t\tend#end of each loop\n\t\t\t\tend#end of if start_time\n\t\t\t\tresult\n\t\t\tend",
"title": ""
},
{
"docid": "bc14262b0c9dc9d54759f0c5a9bb8c27",
"score": "0.62294966",
"text": "def too_may_guests_in_room__true()\n if @guests.check_in_count() > @capacity\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "0fc2eb8720838222b43e45749281ba81",
"score": "0.62290317",
"text": "def check_time(attempt_time, service) \n\t\tif ((User.get_time - last_attempt[service]['time'].to_i) >= attempt_time)\n\t\t\tself.add_service_attempt(service)\t\t\t\n\t\t\treturn false\n\t\tend\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "efe34e93937ac317d6c26bd80681ddf3",
"score": "0.622302",
"text": "def has_appointment?(date, time)\n datetime = Temporal.generate_datetime(date, time)\n\n !is_available?(datetime, 20) #the time is broken up into 20 minute blocks\n end",
"title": ""
},
{
"docid": "6121c45897521f80fd75e33afcd78920",
"score": "0.6222572",
"text": "def res_block_check(id, mt)\n # Access database\n print \"ENTERING ROUTINE WITH RESTAURANT ID: \" << id.inspect << \"...\\n\"\n @res = Reservation.where(\"restaurants_id = ? AND meal_time = ?\", id, mt)\n print \"Found a total of \" << @res.size.inspect << \" records corresponding the ID...\\n\\n\\n\"\n # Acquire reservation block counter\n timeBlock = 4 # Restaurant.find(params[:restaurants_id]).time_per_block\n #tableCapacity = 4 # will subtract from timeBlock via equation (timeBlock - (tableCapacity/timeBlock))\n if @res.size < timeBlock\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "22e8c6a1cf55974e05bfda0638e9aed6",
"score": "0.62205493",
"text": "def valid_time\n return if init.nil? || finish.nil?\n if init < Week.init || init > Week.finish\n errors.add(:init, \"Deve ser no périodo desta semana\")\n elsif finish < Week.init || finish > Week.finish\n errors.add(:finish, \"Deve ser no périodo desta semana\")\n elsif finish < init\n errors.add(:finish, \"Deve ser maior que a data de início\")\n end\n end",
"title": ""
},
{
"docid": "6cca3b5c7da77551c2eabab8fab69545",
"score": "0.62157816",
"text": "def time_is_within_scheduled_days\n \tif start_time\n \t\tschedule = Schedule.find_by(id: Piece.find_by(id: piece_id).schedule_id)\n\t update_day = nil\n\t schedule.days.each do |day|\n\t \t\tupdate_day = day if start_time >= day.start_time and start_time <= day.end_time\n\t \t\tbreak if !update_day.nil?\n\t end\n\t update_day.nil? ? errors.add(:start_time, \"must be during one of the scheduled times\") : update_attribute(:day, update_day)\n\t else\n\t \tupdate_attribute(:day, nil)\n\t end\n end",
"title": ""
},
{
"docid": "fbd8bb02f584db423c99a7d143313d0f",
"score": "0.6211635",
"text": "def time_period_for_room_reservation\n time_period = (self.start_date.year * 12 + self.start_date.month) - (Date.today.year * 12 + Date.today.month)\n errors.add(:start_date, \"you can book your room before 6 months only\") if time_period > 6\n end",
"title": ""
},
{
"docid": "87ac0595585fc59511c5349803b87ecc",
"score": "0.61968786",
"text": "def available_for?(reservation)\n return false if staff_only? && !reservation.staff? # TODO handle staff reservations properly\n return false unless ready_for_checkout?\n return false if reservation.start_date.blank? || reservation.end_date.blank?\n if reservation.staff?\n reservation_start_date_with_buffer = reservation.start_date + 1.second\n reservation_end_date = reservation.end_date - 1.second\n else\n reservation_start_date_with_buffer = reservation.start_date - 1.day - (category.buffer_days_between_checkouts.to_i * 1.day)\n reservation_end_date = reservation.end_date\n end\n conditions = [['(start_date <= :start_date AND end_date >= :end_date)'],\n ['(start_date <= :end_date AND end_date >= :end_date)'],\n ['(start_date <= :start_date AND end_date >= :end_date)'],\n ['(start_date >= :start_date AND end_date <= :end_date)'],\n ['(start_date >= :start_date AND start_date <= :end_date)'],\n \t\t['(end_date >= :start_date AND end_date <= :end_date)']]\n reservations.find(:all, :conditions => [\"submitted = true\n AND equipment_reservation_id != #{reservation.id} \n AND (#{conditions.join(\" OR \")})\", \n { :start_date => reservation_start_date_with_buffer, :end_date => reservation_end_date }]).empty?\n end",
"title": ""
},
{
"docid": "cd4d63f86d1c7807f1f35c475cf1253a",
"score": "0.61845934",
"text": "def check_end_time\n return unless self.end_time?\n calculate_total_time unless self.total_time?\n end",
"title": ""
},
{
"docid": "f9300ed0319bad8f860e9390fd16cd75",
"score": "0.6175179",
"text": "def check_time\t\n\t\treturn unless errors.blank? #this will ensure the right error count on top area\n\t\tif @start_date.present? && @start_time.present?\n\t\t\t#concatenate start_date and start_time\n\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") \n\t\t\t#variable that holds the time 12 hours from now\n\t\t\tstart_at_plus_12_hours = Time.now + (12.hours)\n\t\t\tif start_at <= Time.now\n\t\t\t\terrors.add(:start_date, \"Please do not enter a past date or past time.\")\n\t\t\t\terrors.add(:start_time, \"Please do not enter a past date or past time.\")\n\t\t\telsif start_at < start_at_plus_12_hours \n\t\t\t\terrors.add(:start_date, \"Please only enter a time 12 hours from now\")\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "668432f20d1cc732f62aa2c49679f355",
"score": "0.617299",
"text": "def available\n self.listing.reservations.each do |r|\n if self.checkin.nil? || !(r.checkin && r.checkin < self.checkin)\n errors.add(:checkin, \"checkin and checkout unavailable\")\n # elsif (r.checkin && r.checkin < self.checkin) == false\n # errors.add(:checkin, \"checkin and checkout unavailable\")\n end\n end\n end",
"title": ""
},
{
"docid": "93874dd6ba57c11b9ebc2d67b910bb5d",
"score": "0.61706257",
"text": "def expired?\n conf_item_hold_time = SystemConfiguration::Variable.get_value('booking.item_hold_time', '0').to_i\n hold_time_diff_in_hours = ((DateTime.now.to_time - self.creation_date.to_time).to_f * 24).to_i\n expired = (hold_time_diff_in_hours > conf_item_hold_time)\n expired && !force_allow_payment\n end",
"title": ""
},
{
"docid": "7259d6fe0be1cb4fef6fd17fab0fe0f7",
"score": "0.6166086",
"text": "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end",
"title": ""
},
{
"docid": "9fde9871339e337f64ef7a37b23f8ded",
"score": "0.61564505",
"text": "def relevant_time?\n\t\tself.start < Time.now && self.end >Time.now \n\tend",
"title": ""
},
{
"docid": "6e89913744165c1a64f6888f97d2dcb4",
"score": "0.6139856",
"text": "def time_allow(get_time, min_period_time, max_period_time)\n to_time = Time.parse(get_time)\n now_time = Time.now\n return to_time - now_time < max_period_time - min_period_time && to_time - now_time > min_period_time\n end",
"title": ""
},
{
"docid": "5858f44f1cf37f4138d55dc394d70a69",
"score": "0.6139773",
"text": "def is_soon?\n\t\treturn @start_time < Time.now + 60*30\n\tend",
"title": ""
},
{
"docid": "9edabd54008ca8f4939be15b9eb7393e",
"score": "0.6120843",
"text": "def check_future\n current_start = DateTime.strptime(self.start_time,\"%m/%d/%y %H:%M\").to_time\n current_end = DateTime.strptime(self.end_time,\"%m/%d/%y %H:%M\").to_time \n\n # checks start time of appt is before end time #\n if current_start < current_end\n if current_start > Time.now && current_end > Time.now\n @valid = true\n else\n @valid = false\n end\n end\n @valid\n p @valid\n end",
"title": ""
},
{
"docid": "ea72be76954854b6dfa27d70555e809f",
"score": "0.61190736",
"text": "def check_expired \n\t\t@current_epoch_time = DateTime.now.strftime('%s').to_i\n\t\texpired_required_trips = []\n\t\texpired_listed_trips = []\n\n\t\t# Find the expired trips and add them to the expired arrays\n\t\tcurrent_user.trips_requested.each do |trip_index|\n\t\t\t@trip = Trip.find_by(_id: trip_index) \n\t\t\tif @trip.date < @current_epoch_time\n\t\t\t\texpired_required_trips << trip_index\n\t\t\tend\n\t\tend\n\t\tcurrent_user.trips_driving.each do |trip_index|\n\t\t\t@trip = Trip.find_by(_id: trip_index)\n\t\t\tif @trip.date < @current_epoch_time\n\t\t\t\texpired_listed_trips << trip_index\n\t\t\tend\n\t\tend\n\n\t\tcurrent_user.trips_requested = current_user.trips_requested - expired_required_trips\n\t\tcurrent_user.trips_driving = current_user.trips_driving - expired_listed_trips\n\n\t\tcurrent_user.past_trips_requested = current_user.past_trips_driven + expired_required_trips\n\t\tcurrent_user.past_trips_driven = current_user.past_trips_driven + expired_listed_trips\n\n\t\tcurrent_user.save!\n\n\t\trender json: {\n\t\t\tstatus: 'success',\n\t\t\tuser: current_user\n\t\t}\n\n\tend",
"title": ""
},
{
"docid": "701cca77cdcc493c190e493b9d1687e3",
"score": "0.61051786",
"text": "def is_valid_time?(timeBegin, timeEnd)\n\n\t\t#zone = Timezone.get('America/Chicago').now.zone\n\n\t\t#freebusy method only responds to a couple of months (maybe <=3)\n\t\tresponse = @client.execute(api_method: @service.freebusy.query,\n\t\t\t\t\t body: JSON.dump({\n\t\t\t timeMin: timeBegin,\n\t\t\t timeMax: timeEnd,\n\t\t\t timeZone: 'America/Chicago',\n\t\t\t items:[ id: ENV['NSCS_Calendar_ID']]\n\t\t\t }),\n\t\t\t headers: {'Content-Type' => 'application/json'})\n\t\t@client.authorization.refresh!\n\t\tevents = JSON.parse(response.body)\n\t\t\n\t\t#TODO iteratife over events.\n\t\t\n\tend",
"title": ""
},
{
"docid": "56e6b504f9bbf19b71db371ac85dddb3",
"score": "0.6099902",
"text": "def must_choose_at_least_one_time\n \tif compact_times_available.size <= 0\n \t\tself.errors[:base] << \"Must choose at least one time slot\"\n \tend\n end",
"title": ""
},
{
"docid": "d700515661399ca354018533be0a7c41",
"score": "0.60988736",
"text": "def check_phase_estimation\n return false if !life_cycle_phase\n planned_hours_phase = self.project.projects_phases_joins.where(\"life_cycle_phase_id = ?\", self.life_cycle_phase.id).first.planned_hours_phase\n if self.new_record?\n sum_hours_tasks = self.project.tasks.where(\"life_cycle_phase_id = ?\", self.life_cycle_phase.id).sum(\"planned_hours\")\n else\n sum_hours_tasks = self.project.tasks.where(\"life_cycle_phase_id = ? AND id <> ?\", self.life_cycle_phase.id, self.id).sum(\"planned_hours\")\n end\n sum_hours_tasks = sum_hours_tasks + self.planned_hours\n if (sum_hours_tasks) > planned_hours_phase\n errors.add(:planned_hours, I18n.t(\"screens.alerts.tasks_exceeded_in_hours\"))\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "bf54cc7cad01fdfde57a26de9e3061c5",
"score": "0.6091754",
"text": "def time_taken?(model, ss_obj, params)\n stime = time_format(params[:stime_h], params[:stime_m], params[:stime_p])\n etime = time_format(params[:etime_h], params[:etime_m], params[:etime_p])\n\n # Invalid time, do not care\n return false if stime.nil? || etime.nil?\n\n time_wanted = get_range_times(stime, etime)\n\n # Get the days in an array.\n # If nothing is checked, get the\n # fuck out of here, man! Evolution!\n days = checked_days(params)\n return false if days.size == 0\n\n ss_obj.section_settings.each { |s| return true if has_conflict?(s.time_slot, days, time_wanted) }\n \n false\n end",
"title": ""
},
{
"docid": "c338fd965621b069e9babafe84277b68",
"score": "0.60902715",
"text": "def more_than_a_day_passed?(start_time, end_time)\n end_time - start_time > 60 * 60 * 24\n end",
"title": ""
},
{
"docid": "afe367ecefdff11021580be7e6e4bc0e",
"score": "0.6087568",
"text": "def is_slot_already_passed?\n\t\tunless self.date_of_booking != Time.zone.now.beginning_of_day \n\t\t\tunless self.resource.next_time_slots.include?(self.resource.timeslots[self.slot])\n\t\t\t\tself.errors[:slot_avaibility] << \"=> This slot is already passed\"\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "007d63ee1909970727c09e095e07b1a5",
"score": "0.60865647",
"text": "def date_time_check?\n booking_date_time = booking_date.to_datetime\n booking = Booking.where(\"cleaner_id = ? and booking_date > ? and booking_date < ?\", cleaner_id, booking_date_time - 2.hours, booking_date_time + 2.hours)\n if booking.present?\n errors.add('Sorry', \"This Cleaner #{cleaner.first_name} is not available in your select time\")\n end\n end",
"title": ""
},
{
"docid": "2cc9b0b485b105b9c12204e82d04e81d",
"score": "0.60672724",
"text": "def create\n\n @booking = Booking.new(booking_params)\n \n start_time=@booking.start_time.time\n end_time=@booking.end_time.time\n\n # General case 1 : The starting time should always be lesser than the Ending time\n # General case 2 : One player should not play for more than 4 hours\n \n if start_time>=end_time || TimeDifference.between(start_time, end_time).in_hours > 4 || TimeDifference.between(start_time, end_time).in_minutes < 10\n flash[:notice]=\"Invalid BookingTime\"\n return redirect_to new_booking_path\n end\n \n if Booking.where(:date=>@booking.date).select(:start_time,:end_time,:date).present?\n\n @b=Booking.where(:date=>@booking.date).select(:start_time,:end_time,:date)\n else\n @booking.save\n flash[:notice]=\"Booking saved\"\n\n return redirect_to home_index_path\n end\n\n @count=0\n @b.each do |booking|\n\n \n if (start_time.hour..end_time.hour).overlaps?(booking.start_time.hour..booking.end_time.hour)\n @count=@count+1\n if(start_time.hour==booking.end_time.hour && start_time.min>=booking.end_time.min)\n @count=@count-1\n end\n \n if(end_time.hour==booking.start_time.hour && end_time.min<=booking.start_time.min)\n @count=@count-1\n end\n end\n\n end\n\n if @count<4\n flash[:notice]=\"Available\"\n @booking.save\n redirect_to @booking\n else\n redirect_to new_booking_path\n flash[:notice]= \"Slot not available\"\n end\n\n end",
"title": ""
},
{
"docid": "63a1e3cfe27ebb4fc2888b9532364c8c",
"score": "0.60588557",
"text": "def validate_with_shift_times # see alias_method_chain above\n #s_time = (start_time.hour * 2) + (start_time.min/30)\n #e_time = (params[:issue][:end_time].hour * 2) + (params[:issue][:end_time].min/30)\n\n #if (e_time<=s_time) && (e_time == 0 || e_time == 1)\n # #errors.add :due_date, :greater_than_start_date\n # end_time = Issue.time_list[e_time+48] #assuming user knows what he's doing, automatically adjusts the time to next day\n #end\n\n if self.end_time and self.start_time and self.end_time <= self.start_time\n errors.add :due_date, :greater_than_start_date\n end\n\n end",
"title": ""
},
{
"docid": "bed783c40ea514cb5fb2da14908d245c",
"score": "0.6049882",
"text": "def starvation?()\n\n @hunger_counter >= @starvation_level\n end",
"title": ""
},
{
"docid": "35800a4cc78130178fb205988f0378c0",
"score": "0.604295",
"text": "def are_reservable?\n reservable = true\n @restaurant.tables.find_each do |table|\n table.bookings.find_each do |booking|\n next unless @end_date.between?(booking.start_time, booking.end_time) ||\n @start_date.between?(booking.start_time, booking.end_time)\n reservable = false\n end\n end\n reservable\n end",
"title": ""
},
{
"docid": "9435a81a9935ff38d350f7312a113eba",
"score": "0.6021167",
"text": "def can_cancel?\n !canceled? && reserve_start_at > Time.current && actual_start_at.nil? && actual_end_at.nil?\n end",
"title": ""
},
{
"docid": "014ef86cb7ee9b123dc84d66712e3e57",
"score": "0.6019643",
"text": "def validate_for_another_reservation\n if start_at && end_at && BUSY_STATUSES.include?(self.status)\n errors.add(:start_at, 'Another reservation already exists for these dates.') if exists_other_reservations_in_same_period?\n end\n end",
"title": ""
},
{
"docid": "617464f20bf8b8e38c9b1f86b3e262c4",
"score": "0.6017084",
"text": "def puede_coger_vacaciones\n if start_time.past?\n errors.add(:pasado, \": aun no inventamos vacaciones al pasado\")\n end\n\n if empleado.periodo_vacacionals.count > 0\n if empleado.periodo_vacacionals.count > 1\n errors.add(:periodos, \": tienes demasiados\")\n else\n primer_periodo = empleado.periodo_vacacionals.first\n dias_restantes = (primer_periodo.end_time - primer_periodo.start_time).to_int\n if dias_restantes < 8\n errors.add(:dias, \": has pedido demasiados\")\n end\n end\n\n acts_en_periodo = empleado.actividads\n .where(\"start_time <= ?\", end_time)\n .where(\"end_time >= ?\", start_time)\n .where(finalizado: false)\n .count\n\n vacs_en_periodo = empleado.periodo_vacacionals\n .where(\"start_time <= ?\", end_time)\n .where(\"end_time >= ?\", start_time)\n .count\n\n if acts_en_periodo > 0 && vacs_en_periodo > 0\n errors.add(:tareas, \": tienes tareas pendientes esas fechas\")\n end\n end\n end",
"title": ""
},
{
"docid": "82ed0d7807131ad9d5ccf457c5bd955f",
"score": "0.5990071",
"text": "def charged?\n return (@time <= 0)\n end",
"title": ""
},
{
"docid": "1f10ff507d664d9dacc35c1ade290219",
"score": "0.5982971",
"text": "def is_available(pu_time = Time.now, dr_time = nil, not_counting_rental = nil)\n dr_time = pu_time if dr_time.nil?\n self.reload\n result = true\n self.rentals.each do |rental|\n next if rental == not_counting_rental\n # Get either the actual drop off time, or if it's nil\n # then the anticipated drop off time.\n # (If we have an actual_drop_off_time anyway)\n dropoff_time = rental.actual_drop_off_time\n dropoff_time ||= rental.drop_off_time if !rental.drop_off_time.nil? && Time.now < rental.drop_off_time\n\n if (dr_time > rental.pick_up_time &&\n (dropoff_time.nil? || dropoff_time > pu_time))\n result = false\n end\n end\n result\n end",
"title": ""
},
{
"docid": "3940cdd1c134b44a8ddd6e63f9d97ca5",
"score": "0.5976107",
"text": "def free?\n time_now >= end_time\n end",
"title": ""
},
{
"docid": "c00328510cb352417b9e769b94131b95",
"score": "0.5975884",
"text": "def create\n @reservation = Reservation.new(reservation_params)\n @room = Room.where(\"room_number LIKE ?\", @reservation.room_number)\n if session[:role] != \"admin\"\n @member = Member.where(\"email LIKE ?\", session[:email])\n else\n @member = Member.where(\"email LIKE ?\", params[:members_email])\n if @member.nil? or @member.empty?\n flash[:notice] = \"Member not found !\"\n render 'reservations/newreservation' and return\n end\n end\n @current_reservations = Reservation.where(\"room_number LIKE ? and ? <= end_time and start_time <= ? \", @reservation.room_number,\n @reservation.start_time, @reservation.end_time)\n if not @current_reservations.nil? and not @current_reservations.empty?\n flash[:notice] = \"This room is not available at this time. Conflicts with other reservation which starts at #{@current_reservations.first.start_time} \"\n render 'reservations/newreservation' and return\n end\n\n\n if @reservation.start_time > @reservation.end_time\n flash[:notice] = \"ERROR: Booking start time can't be greater than end time\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time + 2.hours < @reservation.end_time\n flash[:notice] = \"ERROR : Reservation can be made only for 2 hours at a time\"\n render 'reservations/newreservation' and return\n end\n\n if Time.now + 7.days < @reservation.start_time\n flash[:notice] = \"ERROR : Reservation can be made only 1 week in advance from today\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time == @reservation.end_time\n flash[:notice] = \"ERROR: Please book the room for atleast 1 minute!\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time > @reservation.end_time\n flash[:notice] = \"ERROR: Booking start time can't be greater than end time\"\n render 'reservations/newreservation' and return\n end\n\n if Time.now - 5.minutes >= @reservation.start_time\n flash[:notice] = \"ERROR: Booking start time should not be less than current time\"\n render 'reservations/newreservation' and return\n end\n\n #User can only reserve one room at a perticular date and time without extra permission from admin\n @user_reservations = Reservation.where(\"members_id = ? and ? <= end_time and start_time <= ? \", @member.first.id,\n @reservation.start_time, @reservation.end_time)\n if not @user_reservations.empty? and @member.first.isMultipleReservationAllowed != \"Yes\"\n flash[:notice] = \"ERROR : You already have reservation from #{@reservation.start_time} to #{@reservation.end_time} .\n You can't book room during this time interval. Contact Administrator if you want to book multiple rooms with\n overlapping time intervals\"\n render 'reservations/newreservation' and return\n end\n\n @reservation.room_id = @room.first.id\n @reservation.status = \"Booked\"\n @member.first.reservations << @reservation\n SendEmail.reservation_email(@member.first, @reservation).deliver\n\n\n respond_to do |format|\n if @member.first.save\n @member.first.reservations.each do |res|\n end\n\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' and return }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97c023aa790339dd5f4010887af74f70",
"score": "0.5975473",
"text": "def slot_valid? \n\t\tavailable_slots = self.resource.available_time_slot(self.date_of_booking.strftime(\"%Y%m%d\") )\n\t\tavailable_slots.each do | slot |\n\t\t\treturn if slot[1] == self.slot.to_i\n\t\tend\n\t\t\tself.errors[:slot_invalid] << \"=> This slot is invalid\"\n\tend",
"title": ""
},
{
"docid": "1e46337e7800354723272f8bec967fcf",
"score": "0.59502137",
"text": "def is_valid?\n # Expiration date is nil, or equal to or greater than today?\n (self.expiration.nil? || self.expiration >= Date.current) &&\n # Limit is set to 0 (for unlimited) or limit is greater than the current used count.\n (self.limit == 0 || self.limit > self.used)\n\tend",
"title": ""
},
{
"docid": "413adb51c9b982de75074bf4285646b2",
"score": "0.5936677",
"text": "def covers?(time)\n start_time <= time && time < end_time\n end",
"title": ""
},
{
"docid": "413adb51c9b982de75074bf4285646b2",
"score": "0.5936677",
"text": "def covers?(time)\n start_time <= time && time < end_time\n end",
"title": ""
},
{
"docid": "d92d5313cdefcaa945335ce82e79c9fc",
"score": "0.59342116",
"text": "def has_time_to_solve?\n self.expires_at ? Time.now.utc + self.time_to_solve < self.expires_at : true\n end",
"title": ""
},
{
"docid": "d92d5313cdefcaa945335ce82e79c9fc",
"score": "0.59342116",
"text": "def has_time_to_solve?\n self.expires_at ? Time.now.utc + self.time_to_solve < self.expires_at : true\n end",
"title": ""
},
{
"docid": "9f551686ab2278637364b29ac8d04ee1",
"score": "0.5926953",
"text": "def check_times\n if start_end_times.count > 0 && !start_end_times.nil?\n start_end_times.each do |t|\n return true if t.check_time_ranges\n end\n\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "605283a8e4cf2eb145c2593912134824",
"score": "0.59214187",
"text": "def check_overlapping_dates\n # compare this new reservation againsts existing reservations\n if start_date.present? and end_date.present?\n listing.reservations.each do |old_reservation|\n if overlap?(self, old_reservation)\n return errors.add(:The_dates_are_not_available, \"\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "69cf57753cef6c8cdfb1c42409a2c860",
"score": "0.59179586",
"text": "def available?(start_date, end_date)\n unless self.reservations.any? { |res| start_date.to_date.between?(res.checkin, res.checkout) || end_date.to_date.between?(res.checkin, res.checkout)} \n true\n end\n end",
"title": ""
},
{
"docid": "5c2f5ab26867e621e8536b5dbbf451aa",
"score": "0.5917557",
"text": "def is_booking_possible?(member, tour)\n return false unless tour.current_bookings.to_i < tour.max_capacity\n return false unless tour.difficulty <= member.ability\n return false if member.tours.include?(tour)\n return true\n end",
"title": ""
},
{
"docid": "fc54652bdf6e1cdfadabb135cc107e56",
"score": "0.5911995",
"text": "def checkRoomAvailibilty(date, time, scheduleTable)\n j=0\n while j < scheduleTable.size\n if date == scheduleTable[j][\"Date\"] && time == scheduleTable[j][\"Time\"] && self.building == scheduleTable[j][\"Building\"] && self.roomNum == scheduleTable[j][\"Room\"] && \"true\" == scheduleTable[j][\"Available\"]\n return true\n else\n j+=1\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "355e89e6b959b884897c659a35e24fef",
"score": "0.5907955",
"text": "def ensure_seat_is_free\n\t\tseat=Seat.find(seat_id)\n\t \tunless(seat.reservation==nil)\n\t \t\tself.errors.add(:alert, \"Seat is already taken!\")\n\t \tend\n\tend",
"title": ""
},
{
"docid": "4ebdb2e8655806315ef92a5a6e7878f1",
"score": "0.5897484",
"text": "def make_reservation\n \n node_obj = Nodes.new\n hash_details_of_resources = node_obj.get_details_of_resources\n \n # finds which resources are for reservation\n ids = []\n reservations = []\n reservations = params[:reservations]\n # puts \"Autes einai oi krathseis pou thelw na kanw\"\n # puts reservations\n\n # control for empty request for reservation\n reservation_table = []\n if reservations == nil \n redirect_to :back\n flash[:danger] = \"You must select a timeslot to make a reservation. Please try again\" \n else\n\n #control for up to 8 timeslots reservation \n\n hash_num_limition = Hash.new\n reservations.each do |element|\n hash_num_limition[element.split('/')[0]] = 0 \n end\n\n reservations.each do |element|\n hash_num_limition[element.split('/')[0]] = hash_num_limition[element.split('/')[0]]+1\n end\n\n flag_limit = false\n hash_num_limition.each_value do |value|\n if value>8\n flag_limit = true\n break\n end\n end\n\n if flag_limit == true\n redirect_to :back\n flash[:danger] = \"Please choose at most 8 timeslots for every resource.\" \n else\n #control for forgotten timeslots \n old_timeslot = false\n reservations.each do |reservation|\n if reservation.split('/')[1] <= Time.zone.now.to_s[0...-9]\n old_timeslot = true\n break\n end\n end\n \n if old_timeslot == true\n redirect_to :back\n flash[:danger] = \"Please select a time from now on\" \n else\n\n \n # Checks if there is two different dates of reservations (case of 24hours schedule) and keeps the shorter\n reservation_date_num = 0\n reservation_date = \"\"\n reservations.each do |reservation|\n date = reservation.split('/')[1][0...-6]\n if date != reservation_date\n if date < reservation_date && reservation_date != \"\"\n reservation_date = date\n reservation_date_num +=1\n elsif reservation_date == \"\"\n reservation_date = date\n reservation_date_num +=1\n end\n \n end\n end\n\n reservations.each do |reservation|\n if !ids.include?(reservation.split('/')[0])\n ids << reservation.split('/')[0]\n end\n end\n\n puts \"reservation_date_num\"\n puts reservation_date_num\n\n # constructs a table with the reservations. 1 for selected timeslot and 0 for non-selected\n if reservation_date_num >= 2 || reservation_date == Time.zone.today.to_s\n\n today = Time.zone.today.to_s\n tomorrow = (Time.zone.today + 1.day).to_s\n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n\n #Upologismos gia sthles\n columns = Array.new(48)\n columns[0]= \"Name\"\n (0..47).each do |n|\n if (n % 2 == 0) \n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:00\"\n else\n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:30\"\n end\n end\n\n today_and_tommorow_columns = []\n today_and_tommorow_columns << \"Name\"\n\n columns.each do |element|\n if element > time_now && element != \"Name\"\n today_and_tommorow_columns << today + \" \" + element \n end\n end\n\n columns.each do |element|\n if element <= time_now && element != \"Name\" \n today_and_tommorow_columns << tomorrow + \" \" + element\n end\n end\n\n #Upologismos gia rows\n rows = Array.new(ids.length){Array.new(49,0)}\n rows.each_index do |i|\n rows[i][0] = ids[i]\n end\n\n reservation_table = rows.map{|r| Hash[ *today_and_tommorow_columns.zip(r).flatten ] }\n else\n ids.each_index do |i|\n h = Hash.new\n r_name = ids[i]\n h[\"Name\"] = r_name\n (0..47).each do |n|\n if (n % 2 == 0) \n h[\"#{reservation_date}#{n<20 ? \" 0#{n / 2}\" : \" #{n / 2}\"}:00\"] = 0\n else\n h[\"#{reservation_date}#{n<20 ? \" 0#{n / 2}\" : \" #{n / 2}\"}:30\"] = 0\n end\n end\n #if the last half hour of a day selected, we reserve a node until \"23:59\" \n h[reservation_date + \" 23:59\"] = 0\n reservation_table << h\n end\n end\n #Sumplhrwnw o kathe hash me tis krathseis \n reservation_table.each do |element|\n reservations.each do |reservation|\n if reservation.split('/')[0] == element[\"Name\"]\n element[reservation.split('/')[1]] =1\n end\n end\n end\n puts ids\n\n \n # array_with_reservations: table filled with hashes of the reservations to be done \n array_with_reservations = []\n num = 0\n #Compute valid_from and valid_until for each reservation request \n valid_from = \"\"\n valid_until = \"\"\n puts \"Auto einai to reservation table afou to gemisw\"\n puts reservation_table.inspect\n reservation_table.each do |element|\n element.each do |key,value|\n #puts key\n #puts value\n if num ==0\n if value ==1\n #puts \"mpika \"\n valid_from = key\n #puts valid_from\n num += 1\n end\n else \n if value ==0\n valid_until = key\n #stelnw krathsh \n #element[\"Name\"]\n\n valid_from = valid_from + \":00 \" #+ Time.zone.now.to_s.split(' ')[2]\n valid_from = Time.zone.parse(valid_from)\n valid_until = valid_until + \":00 \" #+ Time.zone.now.to_s.split(' ')[2]\n valid_until = Time.zone.parse(valid_until)\n #reserveNode(node_list_uuids[element[\"Name\"]],params[:user_slice],valid_from,valid_until)\n \n h = Hash.new\n h = {\"valid_from\" => valid_from, \"valid_until\"=> valid_until, \"resources\"=> [hash_details_of_resources[element[\"Name\"]][\"uuid\"]] }\n if array_with_reservations.length == 0\n array_with_reservations << h\n else\n flag = 0\n array_with_reservations.each do |reservation|\n if reservation[\"valid_from\"] == valid_from && reservation[\"valid_until\"] == valid_until && !reservation[\"resources\"].include?(hash_details_of_resources[element[\"Name\"]][\"uuid\"])\n reservation[\"resources\"] << hash_details_of_resources[element[\"Name\"]][\"uuid\"]\n flag =1\n break \n end\n end\n if flag == 0\n array_with_reservations << h\n end\n end\n puts \"Tha kanw krathsh me valid_from\"\n puts valid_from\n puts \"kai valid_until\"\n puts valid_until\n # puts \"Gia ton \"+element[\"Name\"] + \"me uuid=\" + @node_list_uuids[element[\"Name\"]]\n num = 0\n end\n end\n end\n end\n puts \"\"\n puts \"Auto einai to array me ta reservation pou prepei na ginoun\"\n puts array_with_reservations\n\n # Making reservations\n results_of_reservations = []\n array_with_reservations.each do |reservation|\n results_of_reservations << reserveNode(reservation[\"resources\"],params[:user_slice],reservation[\"valid_from\"],reservation[\"valid_until\"])\n end\n \n flash_msg = []\n results_of_reservations.each do |result|\n if !result.to_s.include?(\"OK\") \n flash_msg << result.to_s \n end\n end \n if flash_msg.length !=0\n flash[:danger] = flash_msg\n else\n flash[:success] = \"Successful reservation!\"\n end\n redirect_to :back \n end\n\n end\n\n \n end \n end",
"title": ""
},
{
"docid": "5d07136ca873dd5b475a389f7eb93e94",
"score": "0.58900124",
"text": "def time_expired?\n (Time.now - @duration) > @start_time\n end",
"title": ""
},
{
"docid": "09175bceef67f43d9eb3822673177354",
"score": "0.58873355",
"text": "def is_vacant?(curr_time) \n\t\tcurr_hour = curr_time.hour\n\t\tcurr_min = curr_time.min\n\t\tcurr_sec = curr_time.sec\n\t\tearliest_time = Time.new(curr_time.year,curr_time.month,curr_time.day,8,30,0,curr_time.utc_offset)\n\t\tlatest_time = Time.new(curr_time.year,curr_time.month,curr_time.day,22,0,0,curr_time.utc_offset)\n\n\t\t# check if too early or too late for classes\n\t\treturn true, nil if !(curr_time.between? earliest_time,latest_time)\n\t\t\n\t\tclass_sched = complete_sched(curr_time)\n\n\t\t# now check if any classes coincide with the current time\n\t\tvacant = false\n\t\tn = class_sched.length\n\t\tnext_class_time = nil\n\t\tfor i in 0...n\n\t\t\tvacant = !Room.time_intersects(class_sched[i], curr_time)\n\t\t\thour = class_sched[i][\"start_time\"].split(':')[0].to_i\n\t\t\tmin = class_sched[i][\"start_time\"].split(':')[1].to_i\n\t\t\tseconds = 0\n\t\t\tclass_time = Time.new(curr_time.year, curr_time.month, curr_time.day, hour, min, seconds,\n\t\t\t\tcurr_time.utc_offset)\n\t\t\t\n\t\t\tif !vacant\n\t\t\t\treturn vacant, next_class_time\n\t\t\tend\n\n\t\t\tif curr_time < class_time\n\t\t\t\tnext_class_time = class_time\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\n\t\treturn true, next_class_time\n\tend",
"title": ""
},
{
"docid": "75c01a4e584814c7e36704e3182749e1",
"score": "0.588675",
"text": "def check_hours\n if @recorder.current_recording_hours >= @rec_show.req_recording_hours\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "714c981012f8459c4e4a72d9abca4f1d",
"score": "0.58757865",
"text": "def check_expiration\n reservation = Reservation.find(params[:id])\n return unless reservation.booking_request_expired?\n\n flash[:danger] = 'Booking request has expired.'\n redirect_to your_reservations_path\n end",
"title": ""
},
{
"docid": "180d3aeeef413b9af027b44f7aae68a0",
"score": "0.5867875",
"text": "def availibility(party_size, date)\n\t\treserved = reservations.sum(:party_size)\n party_size <= (capacity - reserved)\n end",
"title": ""
},
{
"docid": "3d4eb86c423010e3aefa8bfaa2ae7630",
"score": "0.58604383",
"text": "def max_reserved_time\n @max_reserved_time_s && ( @max_reserved_time_s * 1000.0 ).round\n end",
"title": ""
},
{
"docid": "db1072984cd767edf4d4c790a6c439ce",
"score": "0.5859397",
"text": "def take_booking\n puts \"How many people will be in your party?\"\n answerBooking = gets.chomp.to_i\n\n if @capacity >= answerBooking\n true\n @capacity = @capacity - answerBooking\n # Test to see if capacity counter is working # puts \"we have #{@capacity} left\"\n else\n false\n puts \"We cannot fit that many people at this point in time.\"\n puts \"The maximum number of dinners is #{@capacity}\"\n end\n # what time\n end",
"title": ""
},
{
"docid": "6a7751425c9eaf13b39581dda827ceb6",
"score": "0.58588743",
"text": "def sum_time(time)\n @ip_object = Ip.find_by_ip(@ip)\n if @ip_object.nil?\n Ip.create(ip: @ip, time: 0)\n @ip_object = Ip.find_by_ip(@ip)\n end\n # debugger\n @ip_object.update_attribute(:time, @ip_object.time + time)\n if @ip_object.time >= 60\n Reservation.where(ip: @ip).each do |reservation|\n reservation.seat.reserved = false\n reservation.seat.prereserved = false\n reservation.seat.save\n reservation.destroy\n end\n @ip_object.update_attribute(:time, 0)\n end\n\n end",
"title": ""
},
{
"docid": "cecf89f87aaf637b61e3ee1f98c3ed48",
"score": "0.5858265",
"text": "def overdue?\n !self.attempt_next_contact_by.nil? && self.attempt_next_contact_by < Time.current\n end",
"title": ""
},
{
"docid": "8b9409905ca4868bdc170c3a1241062a",
"score": "0.5852932",
"text": "def verify_start_time time\n\n # Check that there are currently\n # records on the day to iterate through\n dsym = self.class.date_symbol time\n return true if not self.class.days_index[dsym]\n\n self.class.days_index[dsym].each do |record|\n\n next if record.end_time == :running\n next if record == self\n if time < record.end_time\n raise ArgumentError, \"Time conflict with existing record\" if time_in_record? time, record\n end\n end\n true\n end",
"title": ""
},
{
"docid": "3082ef74868285b47e17a6a28c6f164e",
"score": "0.58529115",
"text": "def quantity_eq_model_allowed?(reservations = [])\n max = equipment_model.maximum_per_user\n return true if max == \"unrestricted\"\n #count number of model for given and reserver's reservations, excluding those that don't overlap\n if same_model_count(get_overlapping_reservations(reservations)) > max\n errors.add(:base, \"Cannot reserve more than \" + equipment_model.maximum_per_user.to_s + \" \" + equipment_model.name.pluralize + \".\\n\")\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "49858c0eb2ddbc0d19992831f3af06bc",
"score": "0.584529",
"text": "def relevant_time?\n\t\tself.start <= DateTime.now && self.end >= DateTime.now\n\t\t# (self.start.hour <= DateTime.now.hour) (self.start.minute <= DateTime.now.minute) && (self.end.hour >\tDateTime.now.hour) \n\tend",
"title": ""
},
{
"docid": "cb488d3039f64b16e3cdc0236d7f6571",
"score": "0.58443713",
"text": "def is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n is_valid = true\n\n # if there was not submission then the response is valid\n if resubmission_times.nil? || latest_review_phase_start_time.nil?\n return is_valid\n end\n\n resubmission_times.each do |resubmission_time|\n # if the response is after a resubmission that is\n # before the latest_review_phase_start_time (check second condition below)\n # then we are good - the response is valid and we can break\n if (self.updated_at > resubmission_time.resubmitted_at)\n break\n end\n\n # this means there was a re-submission before the\n # latest_review_phase_start_time and we dont have a response after that\n # so the response is invalid\n if (resubmission_time.resubmitted_at < latest_review_phase_start_time)\n is_valid = false\n break\n end\n end\n\n is_valid\n end",
"title": ""
},
{
"docid": "5c006b070529a70d9171064787054462",
"score": "0.58439463",
"text": "def meets_temporal_constraints?(time, &block)\n !find_failed_temporal_constraint(time, &block) &&\n !find_failed_occurence_constraint(true, &block)\n end",
"title": ""
},
{
"docid": "11ca16738929ea9776feb4f15599459f",
"score": "0.58377194",
"text": "def not_renewable?\n return true unless self.class == CartReservation || self.status == \"reserved\"\n reserver.reservations.each do |res|\n if res.equipment_model == self.equipment_model && res.due_date.to_date == self.start_date.to_date && res.is_eligible_for_renew?\n errors.add(:base, res.equipment_model.name + \" should be renewed instead of re-checked out.\\n\")\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "4fe3803b10f3bddad2b69f9e18a7c169",
"score": "0.5836361",
"text": "def credit_check(proposed_hours)\n credits >= proposed_hours\n end",
"title": ""
},
{
"docid": "6195983e64e61462635afe1944f3db36",
"score": "0.583466",
"text": "def available\n # do not run on reservations that don't matter anymore\n return if self.checked_in || self.due_date < Date.current\n return unless equipment_model\n if equipment_model.num_available(start_date, due_date) <= 0\n errors.add(:base, equipment_model.name + \" is not available for the full time period requested.\\n\")\n end\n end",
"title": ""
},
{
"docid": "f3aa49344591275a1854be4a91e892ba",
"score": "0.5833932",
"text": "def seat_availability(bus,bus_start_date)\n \n Booking.where(start_date: bus_start_date, bus_id: bus.id).count < bus.capacity # seat capacity.\n \n end",
"title": ""
},
{
"docid": "db37b6f7b6a5110a4de0a9c083f03451",
"score": "0.58234215",
"text": "def expired?\n remaining.zero?\n end",
"title": ""
},
{
"docid": "d141f79499e7fdf5433479da360a659f",
"score": "0.58226514",
"text": "def check_overlaps_cargo_department\n\t\t# if some day of availabilityes overlaps whith new period availability.\t\n\t\tav=Availability.where(:department_id => department_id).where('upper(cargo) like ?',\"#{cargo.upcase}\")\n\t\t\t.where(\"((desde - ?) * (? - hasta)) >= 0\", hasta, desde).where(:status => true)\n\n\t\tif av.count>0 # availabilit\n\t\t\t\t\terrors.add(:cargo,\" Ya existe un periodo de disponibilidad mínima para el cargo: '#{cargo}' cuyas fechas coinciden.\")\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9e672e874b4ae5f6935b55f01267f639",
"score": "0.582251",
"text": "def check_allow_overtime\n\n return if self.contract.nil?\n\n @overtime_rate_count = Rate.count(:conditions => [\"category = 'Overtime' and active = ? and contract_id = ?\", true, contract_id])\n \n if @overtime_rate_count == 0 && self.contract.allowOvertime?\n\n self.contract.allowOvertime = false\n self.contract.save(false)\n\n end\n \n end",
"title": ""
},
{
"docid": "34d67df5323197716ee81137c0110293",
"score": "0.5821889",
"text": "def check_date\n\t\tif self.hasError\n\t\t\terrors.add(\"\", \"You entered Invalid date: \\n - \"+self.interviewer.name)\n\t\t\t# puts \"===================CHECKDATE===================\"\n\t\telsif Time.at(self.sched_end.to_i) <= Time.at(self.sched_start.to_i)\n\t\t\terrors.add(\"\", \"Start time cannot be greater than end time \\n - \"+self.interviewer.name)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cb5894e03134d3ea7028269e33a26392",
"score": "0.58215415",
"text": "def check_possible_times\n @possible_times = Event::POSSIBLE_TIMES_CONST\n end",
"title": ""
},
{
"docid": "8079ea1df75d009eba0db198d57fe0b4",
"score": "0.58187306",
"text": "def quantity_cat_allowed?(reservations = [])\n max = equipment_model.category.maximum_per_user\n return true if max == \"unrestricted\"\n #count number in category for given and reserver's reservations, excluding those that don't overlap\n if same_category_count(get_overlapping_reservations(reservations)) > max\n errors.add(:base, \"Cannot reserve more than \" + equipment_model.category.maximum_per_user.to_s + \" \" + equipment_model.category.name.pluralize + \".\\n\")\n return false\n end\n return true\n end",
"title": ""
}
] |
2576f5184499183cd0fca008568f6076
|
Format multiple log messages.
|
[
{
"docid": "eba15643293084b74245bc82a49a771e",
"score": "0.6680799",
"text": "def format_multiple_messages(level, label, messages)\n super(level, label, messages) do |*args|\n args.unshift(LEVELS[level])\n end\n end",
"title": ""
}
] |
[
{
"docid": "32e51bdffcff446fc27da13e5818e4c8",
"score": "0.72494286",
"text": "def format_multiple_messages(level, label, messages, &block)\n args = [level.to_s.upcase, timestamp]\n args = block.call(*args) if block\n\n header = sprintf(self.class::FORMAT_STRINGS[:header], *args)\n messages.unshift(nil)\n header + messages.join(\"\\n \")\n end",
"title": ""
},
{
"docid": "6dfa159d640c0dac18b58c95cdd39b46",
"score": "0.70170444",
"text": "def format_multiple_messages(level, label, messages)\n super(level, label, messages) do |*args|\n [args.last]\n end\n end",
"title": ""
},
{
"docid": "4d2c2a21b4942d50967d97ceeb26e035",
"score": "0.6569147",
"text": "def format_log(sev, _time, _prog, msg); end",
"title": ""
},
{
"docid": "55d7deeda1ca7b3426dbf7efbd8cd496",
"score": "0.64648336",
"text": "def format\n logid = generate_logid\n time = @time.iso8601(3)\n @records.map{|record| record.format(logid, time)}.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "75a022407ebd5f4fd65b1e5f528936b7",
"score": "0.6406744",
"text": "def format_message *message\n message.map( &method( :format_message_segment ) ).join( ' ' )\n end",
"title": ""
},
{
"docid": "830b56f65e7d5401915a45eec47e3695",
"score": "0.6405841",
"text": "def format_messages(filters=nil)\n\n formatted_message = String.new\n build_message = lambda { |param| formatted_message << param.message << \"\\n\"}\n filters ? filter_contents(filters).each(&build_message) : @collection.each(&build_message)\n formatted_message\n end",
"title": ""
},
{
"docid": "cc73f2cd000333d37cafbe0af4346adb",
"score": "0.6401976",
"text": "def format(*formatters); end",
"title": ""
},
{
"docid": "5f44552fb4c34fd48273eddfcbb167d9",
"score": "0.6340899",
"text": "def format_log(raw)\n return \"...\" unless raw\n raw.split(\"\\n\").map do |l|\n # clean stuff we don't need\n l.gsub!(/I\\s+|\\(\\w*\\)|within bounds/, \"\") # gsub(/\\(\\w*\\)/, \"\"\")\n # if ok, span is green\n ok = l =~ /\\[ok\\]/\n if l =~ /\\[\\w*\\]/\n # get some data we want...\n l.gsub(/\\[\\S*\\s(\\S*)\\]\\W+INFO: (\\w*-?\\w*|.*)?\\s\\[(\\w*)?\\]/, \"<span class='gray'>\\\\1</span> | <span class='#{ok ? 'green' : 'red'}'>\\\\3</span> |\").\n # take only the integer from cpu\n gsub(/cpu/, \"cpu %\").gsub(/(\\d{1,3})\\.\\d*%/, \"\\\\1\").\n # show mem usage in mb\n gsub(/memory/, \"mem mb\").gsub(/(\\d*kb)/) { ($1.to_i / 1000).to_s }\n else\n l.gsub(/\\[\\S*\\s(\\S*)\\]\\W+INFO: \\w*\\s(\\w*)/, \"<span class='gray'>\\\\1</span> | <span class='act'>act</span> | \\\\2\")\n end\n\n end.reverse.join(\"</br>\")\n end",
"title": ""
},
{
"docid": "c15934f5cf37298135ab859cb6dba237",
"score": "0.6321185",
"text": "def format_log(data)\n lines = []\n data.each do |log|\n next unless log.is_a?(Hash)\n lines << \"[#{log[:time].strftime('%F %T')}] #{log[:line]}\"\n end\n lines.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "edeae8db01fc52af57d31be0d3f4ea65",
"score": "0.62870497",
"text": "def log_formatter; end",
"title": ""
},
{
"docid": "f27f8aa890b830b69b86239b086e8baa",
"score": "0.62357897",
"text": "def format_log(sev, time, prog, msg)\n \"[#{sev.downcase}]: #{msg}\\n\"\n end",
"title": ""
},
{
"docid": "e39608a1947fd49b92a8d25e260e7654",
"score": "0.6232948",
"text": "def format_logs _logs\n have_multi_row = streaming? # either false (default), or true based on streaming\n logs_to_render = if not _logs.empty? then _logs else logs end\n logs_formatted = logs_to_render.map do |log|\n entry = format_log_entry log\n have_multi_row = true unless entry.find_index{|e| e.to_s.include?(\"\\n\")}.nil?\n entry\n end\n [have_multi_row, logs_formatted]\n end",
"title": ""
},
{
"docid": "75862c242c816aa48c632c473a062b74",
"score": "0.62244964",
"text": "def log(*messages)\n\t\tfor message in messages\n\t\t\tputs message\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ca8ba8c80245d87e111b341a1dcef1b3",
"score": "0.62144846",
"text": "def log_fmt\n res = []\n if errors.length > 0\n res << \"#{errors.join(\"\\n\\n\")}\"\n res << \"=\"*50\n res << \"#{errors.length} with errors\"\n end\n res << \"#{success.uniq.length} Schemas passed\"\n res.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "5416eb38548de37df392ffed8c011379",
"score": "0.6207511",
"text": "def format(report)\n lines = []\n\n report.messages.sort.each do |level, messages|\n messages.each do |message|\n lines << '%s: %s: line %s, column %s: %s' % [\n report.file,\n level,\n message[:line],\n message[:column],\n message[:message]\n ]\n end\n end\n\n return lines.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "8a9c91d30fffa9bf9b37f9551b5acc4d",
"score": "0.61541975",
"text": "def format_and_send(level, *msgs, &block)\n check_log_file\n if block\n if @log.send(\"#{level}?\")\n msgs = Array(block.call)\n else\n msgs = []\n end\n end\n\n msgs.flatten.each do |item|\n case item\n when Exception then\n log_exception(level, item, :debug)\n else\n @log.send(level, item)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "83daddb1225b630989285586fed69268",
"score": "0.6129236",
"text": "def format_log(sev, _time, _prog, msg)\n \"[#{sev.downcase}]: #{msg}\\n\"\n end",
"title": ""
},
{
"docid": "f1c8db34f5ff92976b9e89b5672780e2",
"score": "0.61217546",
"text": "def combined_log\n messages.join.strip\n end",
"title": ""
},
{
"docid": "20295a3ff3bc61aa86e064d21265d0d6",
"score": "0.6116495",
"text": "def format_message(msg, formatter)\n ts = timestamp\n header = formatter[:header] || ''\n header << ' ' unless header[-1] == ' ' || header.length == 0\n\n ts_length = ts.length\n header_length = header.length\n\n formatted_msg = msg.split(\"\\n\").map.with_index do |line, index|\n ts = ' ' * ts_length unless index.zero?\n header = ' ' * header_length unless index.zero?\n header = color(header, formatter[:color])\n line = color(line, formatter[:color])\n\n \"#{ts} #{header}#{line}\\n\"\n end\n\n formatted_msg.join\n end",
"title": ""
},
{
"docid": "1e8a4138b090b74c12978cce87a296b1",
"score": "0.61080116",
"text": "def format_syslog_msg(msg)\n\t\t\t\n\t\t\tcont=\"\"\n\t\t\ti=1\n\t\t\t\t\n\t\t\twhile i<10;\n\n\t\t\t\tfirst,rest=msg.split(\", \",2)\n\t\t\t\t\n\t\t\t\tif i!=2\n\t\t\t\t\tcont+=split_msg(first) + \",\\n\"\n\t\t\t\tend\t\t\n\t\t\t\t\n\t\t\t\tmsg=rest\n\t\t\t\ti+=1\n\n\t\t\tend\n\n\t\t\tfirst,rest=msg.split(\"}\",2)\n\t\t\tcont+=split_msg(first) + \",\\n\"\n\n\t\t\treturn cont\n\t\tend",
"title": ""
},
{
"docid": "b72a58a0e8f4be6be61868cd7d187333",
"score": "0.6050565",
"text": "def format_message(severity, timestamp, progname, msg)\n @log_format = DEFAULT_FORMAT if @log_format.nil?\n @log_format % [severity[0..0], timestamp, $$, severity, progname, msg]\n end",
"title": ""
},
{
"docid": "4d7f4cf84a068ec124291b2644497a16",
"score": "0.59757257",
"text": "def formated_log(log)\n log.select { |line| line.match(REGEX_POST) }.map do |line|\n \"#{line[DATA]} FROM: #{line[IP]} TO: #{line[PATH].upcase}\"\n end\nend",
"title": ""
},
{
"docid": "329b42425f634ec8c4c10654df7be9ed",
"score": "0.5958074",
"text": "def format_single_message(level, label, message)\n super(level, label, message) do |*args|\n [args.last]\n end\n end",
"title": ""
},
{
"docid": "26ae53b4a60b525f5aaa493457afe2a2",
"score": "0.59485614",
"text": "def log(*args)\n level = args.grep(Integer).first || 1\n title = args.grep(Symbol).first\n message = args.grep(String).first\n options = args.grep(Hash).first || {}\n options[:indent] ||= LeapCli.indent_level\n if message && LeapCli.log_level >= level\n print \" \" * (options[:indent]+1)\n if options[:indent] > 0\n print '- '\n else\n print '= '\n end\n if title\n prefix = case title\n when :error then ['error', :red, :bold]\n when :warning then ['warning', :yellow, :bold]\n when :info then ['info', :cyan, :bold]\n when :updated then ['updated', :cyan, :bold]\n when :updating then ['updating', :cyan, :bold]\n when :created then ['created', :green, :bold]\n when :removed then ['removed', :red, :bold]\n when :nochange then ['no change', :magenta]\n when :loading then ['loading', :magenta]\n when :missing then ['missing', :yellow, :bold]\n when :run then ['run', :magenta]\n when :failed then ['FAILED', :red, :bold]\n when :completed then ['completed', :green, :bold]\n when :ran then ['ran', :green, :bold]\n when :bail then ['bailing out', :red, :bold]\n else [title.to_s, :cyan, :bold]\n end\n if options[:host]\n print \"[%s] %s \" % [Paint[options[:host], prefix[1], prefix[2]], prefix[0]]\n else\n print \"%s \" % Paint[prefix[0], prefix[1], prefix[2]]\n end\n if FILE_TITLES.include?(title) && message =~ /^\\//\n message = LeapCli::Path.relative_path(message)\n end\n elsif options[:host]\n print \"[%s] \" % options[:host]\n end\n puts \"#{message}\"\n if block_given?\n LeapCli.indent_level += 1\n yield\n LeapCli.indent_level -= 1\n end\n end\n end",
"title": ""
},
{
"docid": "79ed55f0eef9eaf19419a223de48bd70",
"score": "0.59419876",
"text": "def log_formatter=(_arg0); end",
"title": ""
},
{
"docid": "cb2cc610971ee0ecf73fe7a94c8fb88d",
"score": "0.59250903",
"text": "def format(log_record)\n lvl = case log_record.level\n when JavaUtilLogger::Level::WARNING then 'WARN'\n when JavaUtilLogger::Level::SEVERE then 'ERROR'\n when JavaUtilLogger::Level::FINEST then 'DEBUG'\n else log_record.level\n end\n java.lang.String.format(@format_string,\n log_record.millis,\n log_record.logger_name,\n log_record.logger_name,\n lvl,\n log_record.message,\n log_record.thrown)\n end",
"title": ""
},
{
"docid": "a08ad265971a29b8a0b6c1945437e311",
"score": "0.59162545",
"text": "def formatter\n proc { |severity, time, _progname, msg|\n formatted_severity = sprintf(\"%-5s\", severity.to_s)\n formatted_time = time.strftime(\"%Y-%m-%d %H:%M:%S\")\n \"[#{formatted_severity} #{formatted_time} #{$$}] #{msg.to_s.strip}\\n\"\n }\n end",
"title": ""
},
{
"docid": "88c88747aab7d89da8297cb772515a67",
"score": "0.58824587",
"text": "def log(*args)\n level = args.grep(Integer).first || 1\n title = args.grep(Symbol).first\n message = args.grep(String).first\n options = args.grep(Hash).first || {}\n unless message && LeapCli.log_level >= level\n return\n end\n\n # prefix\n clear_prefix = colored_prefix = \"\"\n if title\n prefix_options = case title\n when :error then ['error', :red, :bold]\n when :fatal_error then ['fatal error:', :red, :bold]\n when :warning then ['warning:', :yellow, :bold]\n when :info then ['info', :cyan, :bold]\n when :updated then ['updated', :cyan, :bold]\n when :updating then ['updating', :cyan, :bold]\n when :created then ['created', :green, :bold]\n when :removed then ['removed', :red, :bold]\n when :nochange then ['no change', :magenta]\n when :loading then ['loading', :magenta]\n when :missing then ['missing', :yellow, :bold]\n when :skipping then ['skipping', :yellow, :bold]\n when :run then ['run', :magenta]\n when :failed then ['FAILED', :red, :bold]\n when :completed then ['completed', :green, :bold]\n when :ran then ['ran', :green, :bold]\n when :bail then ['bailing out', :red, :bold]\n when :invalid then ['invalid', :red, :bold]\n else [title.to_s, :cyan, :bold]\n end\n if options[:host]\n clear_prefix = \"[%s] %s \" % [options[:host], prefix_options[0]]\n colored_prefix = \"[%s] %s \" % [Paint[options[:host], prefix_options[1], prefix_options[2]], prefix_options[0]]\n else\n clear_prefix = \"%s \" % prefix_options[0]\n colored_prefix = \"%s \" % Paint[prefix_options[0], prefix_options[1], prefix_options[2]]\n end\n elsif options[:host]\n clear_prefix = colored_prefix = \"[%s] \" % options[:host]\n end\n\n # transform absolute path names\n if title && FILE_TITLES.include?(title) && message =~ /^\\//\n message = LeapCli::Path.relative_path(message)\n end\n\n log_raw(:log, nil) { [clear_prefix, message].join }\n if LeapCli.log_in_color\n log_raw(:stdout, options[:indent]) { [colored_prefix, message].join }\n else\n log_raw(:stdout, options[:indent]) { [clear_prefix, message].join }\n end\n\n # run block, if given\n if block_given?\n LeapCli.indent_level += 1\n yield\n LeapCli.indent_level -= 1\n end\n end",
"title": ""
},
{
"docid": "4f6d0c4139f99a67cd9f19e1b6b205a9",
"score": "0.58784026",
"text": "def format_log(message, level=:info)\n header = case level.intern\n when :warn\n \"WARN:\".yellow\n when :error\n \"ERROR:\".red\n end\n [header, message].compact.join(\" \")\n end",
"title": ""
},
{
"docid": "dc46bfba06bb3577ba2d8726cde72835",
"score": "0.58745044",
"text": "def format_message(severity, datetime, progname, msg)\n \"[%s %6d] %s\\n\" % [ datetime.strftime(\"%Y-%m-%d %H:%M:%S\"), thread_id, msg ]\n end",
"title": ""
},
{
"docid": "3f68fdd1b009d4d8fe602e973ab4837a",
"score": "0.5845765",
"text": "def colorize_logging; end",
"title": ""
},
{
"docid": "1607ef2ff145aa4ccece99b55897aeb0",
"score": "0.58205533",
"text": "def default_formatter\n proc do |log|\n h = {severity: log_level(log), tags: log.tags, class: log.name}\n h[:message] = log.message if log.exception\n h.merge!(log.payload) if log.payload\n h\n end\n end",
"title": ""
},
{
"docid": "9268c97394a90bd1ef22149aa791f4fb",
"score": "0.5816758",
"text": "def log_formatted_vars(level, loc, msg, *args)\n formatted = sprintf(msg, *args)\n log(level, loc, formatted)\n end",
"title": ""
},
{
"docid": "6e164840974ce6f121d67a95e1d2312f",
"score": "0.5808826",
"text": "def default_formatter\n Proc.new do |log|\n tags = log.tags.collect { |tag| \"[#{tag}]\" }.join(\" \") + \" \" if log.tags && (log.tags.size > 0)\n\n message = log.message.to_s\n message << \" -- \" << log.payload.inspect if log.payload\n message << \" -- \" << \"#{log.exception.class}: #{log.exception.message}\\n#{(log.exception.backtrace || []).join(\"\\n\")}\" if log.exception\n\n duration_str = log.duration ? \"(#{'%.1f' % log.duration}ms) \" : ''\n\n \"#{log.level.to_s[0..0].upcase} [#{$$}:#{log.thread_name}] #{tags}#{duration_str}#{log.name} -- #{message}\"\n end\n end",
"title": ""
},
{
"docid": "29fb4cb62fb3ebcf0284881a0bfcadfb",
"score": "0.5808321",
"text": "def format(*formatters)\n @formatters ||= Array.new\n @formatters += formatters\n end",
"title": ""
},
{
"docid": "088baf1f5e2a8560361afba8bd2ce308",
"score": "0.58046407",
"text": "def log_msgs\n @msg_log.logMessages.each do |msg|\n # DLM: you can filter on log channel here for now\n if /openstudio.*/.match(msg.logChannel) #/openstudio\\.model\\..*/\n # Skip certain messages that are irrelevant/misleading\n next if msg.logMessage.include?(\"Skipping layer\") || # Annoying/bogus \"Skipping layer\" warnings\n msg.logChannel.include?(\"runmanager\") || # RunManager messages\n msg.logChannel.include?(\"setFileExtension\") || # .ddy extension unexpected\n msg.logChannel.include?(\"Translator\") || # Forward translator and geometry translator\n msg.logMessage.include?(\"UseWeatherFile\") # 'UseWeatherFile' is not yet a supported option for YearDescription\n \n # Report the message in the correct way\n if msg.logLevel == OpenStudio::Info\n @runner.registerInfo(msg.logMessage)\n elsif msg.logLevel == OpenStudio::Warn\n @runner.registerWarning(\"[#{msg.logChannel}] #{msg.logMessage}\")\n elsif msg.logLevel == OpenStudio::Error\n @runner.registerError(\"[#{msg.logChannel}] #{msg.logMessage}\")\n elsif msg.logLevel == OpenStudio::Debug && @debug\n @runner.registerInfo(\"DEBUG - #{msg.logMessage}\")\n end\n end\n end\n @runner.registerInfo(\"Total Time = #{(Time.new - @start_time).round}sec.\")\n end",
"title": ""
},
{
"docid": "f2b0439f20820dff4279fab84de4f54f",
"score": "0.5786959",
"text": "def format_message( severity, datetime, progname, msg )\n\t\tself.formatter.call( severity, datetime, progname, msg )\n\tend",
"title": ""
},
{
"docid": "cbecfa6839d9bc874dc4c4ddfb23c00d",
"score": "0.5775716",
"text": "def format_message(*args)\n old_format_message(*args)\n end",
"title": ""
},
{
"docid": "c2341526849112913959b1accab86e31",
"score": "0.57584286",
"text": "def format(*formatters)\n\n @formatters ||= Array.new\n @formatters += formatters\n\n end",
"title": ""
},
{
"docid": "cc2a1c77284a791e6c4c14201f20f813",
"score": "0.5757271",
"text": "def format_messages(messages)\n\t messages.map do |message|\n time = message.created_at.in_time_zone(\"Pacific Time (US & Canada)\")\n {\n :color => message.user.color,\n :time => time.strftime(\"%b%e-%l:%M%P\"), # \"Dec 7 - 1:20pm\"\n :username => message.user.name,\n :message => message.message\n }\n\t\tend\n end",
"title": ""
},
{
"docid": "fee75fd9486c6c75d5be4886fd5714ff",
"score": "0.57421905",
"text": "def format(log)\n return '' unless log\n # remove whitespaces, single and double quotes\n log.gsub(/\\s+/, \" \").gsub(/['\"]/, '')\n end",
"title": ""
},
{
"docid": "7fd7815a513b553e649e3ab496730a8d",
"score": "0.57355416",
"text": "def default_formatter\n Proc.new do |log|\n tags = log.tags.collect { |tag| \"[#{tag}]\" }.join(\" \") + \" \" if log.tags && (log.tags.size > 0)\n\n message = log.message.to_s\n message << \" -- \" << log.payload.inspect if log.payload\n message << \" -- \" << \"#{log.exception.class}: #{log.exception.message}\\n#{(log.exception.backtrace || []).join(\"\\n\")}\" if log.exception\n\n duration_str = log.duration ? \"(#{'%.1f' % log.duration}ms) \" : ''\n\n \"#{SemanticLogger::Appender::Base.formatted_time(log.time)} #{log.level.to_s[0..0].upcase} [#{$$}:#{log.thread_name}] #{tags}#{duration_str}#{log.name} -- #{message}\"\n end\n end",
"title": ""
},
{
"docid": "955819c320a5456f8247859c84a573ff",
"score": "0.5732625",
"text": "def format_log_message( message )\n\t\treturn message.to_s[ 0 ... self.max_message_bytesize ].dump\n\tend",
"title": ""
},
{
"docid": "061bac618e85e32c91066dadcb9da5cb",
"score": "0.57255477",
"text": "def format( event )\n msg = format_obj(event.data)\n severity_text = ::Logging::LNAMES[event.level]\n preamble = \"#{Time.now.utc.strftime(\"%Y-%m-%d %H:%M:%S\")}\\tUTC\\t[#{severity_text}]\\t[#{hostname}]\\t[#{app_name}]\\t[#{$$}]\\t\"\n full_message = preamble + (msg || '[nil]')\n full_message.gsub!(/\\n/,' ')\n full_message += \"\\n\" unless full_message =~ /\\n$/\n return full_message\n end",
"title": ""
},
{
"docid": "14480c0e7c80d57481e74c29d73ca59e",
"score": "0.5712433",
"text": "def prepare_log(message, files)\n\t\tdata = \">------------------------------------ \\n\"\n\t\tdata += \"Message: #{message} \\n\" \n\t\tdata += \"Version: #{@version} \\n\"\n\t\tdata += \"Files: \\n\"\n\t\tfiles.each do |file|\n\t\t\tputs file\n\t\t\tif(file.start_with?('@'))\n\t\t\t\tfile.slice!('@')\n\t\t\tend\n\t\t\tdata += file + \"\\n\"\n\t\tend\n\t\ttime = Time.new\n\t\tdata += \"Time #{time.strftime(\"%Y-%m-%d %H:%M:%S\")} \\n\"\n\t\tdata += \"------------------------------------ <\\n\"\n\t\t#puts data\n\t\twrite_log(data)\n\tend",
"title": ""
},
{
"docid": "3c08d7678a6f810168d0faf13f97d081",
"score": "0.5694076",
"text": "def log_multiline(msg)\n lines = msg.split(\"\\n\")\n lines[1..-1].each_with_index do |_v, i|\n lines[i + 1] = \" #{lines[i + 1]}\"\n end\n log(lines.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "66f1e5c9b4eb6e405fcad51dff91a444",
"score": "0.5687069",
"text": "def apply_formatters!(payload)\n formatters.each do |formatter|\n begin\n formatter.format(payload)\n rescue => e\n error \"Formatter error encountered (<#{formatter}>): #{e.class} - #{e}\"\n end\n end\n end",
"title": ""
},
{
"docid": "cc21f60e35df150136cf7590c3d905fc",
"score": "0.56863344",
"text": "def log_general(prefix, format_hash, format_str = LOG_FORMAT)\n format_hash[:time] = Time.now.strftime(TIME_FORMAT)\n name = format(FILE_FORMAT,\n channel: prefix,\n year: @last_time_check.year,\n month: @last_time_check.month,\n day: @last_time_check.day)\n file = File.file?(name) ? File.open(name, 'a') : File.new(name, 'a')\n @log_files[prefix] = file\n @log_files[prefix].puts(format(format_str, format_hash))\n end",
"title": ""
},
{
"docid": "2c17daa8b1264432e58370018d3bec9a",
"score": "0.56821364",
"text": "def handle_logger( format, directive, slice )\n fmt = format + 's'\n fmt = color_scheme.color(fmt, COLOR_ALIAS_TABLE[directive]) if colorize?\n\n format_string << fmt\n sprintf_args << DIRECTIVE_TABLE[directive].dup\n\n if slice\n numeric = Integer(slice) rescue nil\n if numeric\n raise ArgumentError, \"logger name slice must be an integer greater than zero: #{numeric}\" unless numeric > 0\n sprintf_args.last <<\n \".split(::Logging::Repository::PATH_DELIMITER)\" \\\n \".last(#{slice}).join(::Logging::Repository::PATH_DELIMITER)\"\n else\n format_string << \"{#{slice}}\"\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "06e46988b57e3653668bfcfde6c0801e",
"score": "0.5672871",
"text": "def format(level, context, message)\n msg = message.to_s.strip\n\n if message.ndc.any?\n msg = \"#{timestamp} [#{thread_name}] #{format_level(level)} #{context} #{message.ndc.join(' ')} - #{msg}\"\n else\n msg = \"#{timestamp} [#{thread_name}] #{format_level(level)} #{context} - #{msg}\"\n end\n\n with_backtrace(message, msg)\n end",
"title": ""
},
{
"docid": "7f1785ae722ccb581d0ce6cb69d2e94c",
"score": "0.5672125",
"text": "def message\n logs = ordered_logs\n longest_key = logs.flatten.inject(0) { |count, key| count < key.to_s.length ? key.to_s.length : count }.next\n \"\\n\\n**********\\n\\n\" << logs.map { |keys| render_section(keys, longest_key) }.join << error_and_bt(longest_key)\n end",
"title": ""
},
{
"docid": "e2e14729b479c36e0cceb2e19140d485",
"score": "0.566814",
"text": "def formatter\n Proc.new{|severity, time, progname, msg|\n \"#{msg.to_s}\\n\"\n }\n end",
"title": ""
},
{
"docid": "d2385df3626c5a31fc8bcc717af3ef28",
"score": "0.5668062",
"text": "def format\n lines = [\n separator,\n format_row([\"Date\", \"From\", \"Subject\"]),\n separator,\n rows.collect { |row| format_row(row) },\n separator,\n ]\n lines.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "40d3654f08a11da5b6f6e244e506e14d",
"score": "0.56644255",
"text": "def format_messages(messages, query)\n if messages.empty?\n messages\n else\n [\"#{t(\"pattern_or_description_contains\", query: query)}:\\n\"] + messages\n end\n end",
"title": ""
},
{
"docid": "c5f624fc63ebea6470d72d84ed89515f",
"score": "0.5660822",
"text": "def do_logging(log)\n log.deb \"This is DEB\"\n log.inf \"This is INF\"\n log.prt \"This is PRT\"\n log.wrn \"This is WRN\"\n log.err \"This is ERR\"\n log.fat \"This is FAT\"\nend",
"title": ""
},
{
"docid": "ce7b3b23e21f49df8e82aebe7fc8379a",
"score": "0.5620159",
"text": "def format_file_msg(msg)\n\n\t\t\tcont=\"\"\n\t\t\tfirst,second=msg.split(\", \")\n\t\t\tcont+=split_msg(first) + \",\\n\"\n\t\t\tcont+=split_msg(second) + \",\\n\"\n\t\t\treturn cont\n\n\t\tend",
"title": ""
},
{
"docid": "20a7e3bca833bb3a433309604b8a14c8",
"score": "0.56085336",
"text": "def formatter\n proc do |severity, datetime, progname, msg|\n processid=Process.pid\n message = \"<#{pri(severity)}>#{datetime.strftime(datetime_format)} #{@hostname} \"\n\n # Include process ID in progname/log tag - RFC3164 § 5.3\n if progname\n message << \"#{progname}[#{processid}]: \"\n else\n message << \"#{$0}[#{processid}]: \"\n end\n\n # Support logging JSON to Syslog\n if @format == :json && msg.is_a?(Hash)\n message << MultiJson.dump(msg)\n else\n message << massage_message(msg,severity,processid)\n end\n\n if @input_uri.scheme == 'tcp'\n message << \"\\r\\n\"\n end\n message\n end\n end",
"title": ""
},
{
"docid": "0e5e00806dc67e3d21260e04c2b0a55f",
"score": "0.5599193",
"text": "def log_formatted(level = nil, loc = nil, msg, args)\n formatted = sprintf(msg, *args)\n log(level, loc, formatted)\n end",
"title": ""
},
{
"docid": "5e62165f511be056f8d248559584124b",
"score": "0.5599119",
"text": "def print(logger, tokenized_log)\n format = self.format\n msg_idx = 0\n tokenized_log.each do |seq, rep|\n seq.size.times do |sidx|\n # in fact we don't need unpack because message contains its string\n # index and we track message index\n messages[msg_idx][:msg] = strings[messages[msg_idx][:msg]]\n logger.print(logger.construct(messages[msg_idx]))\n msg_idx = msg_idx + 1\n end\n if rep > 1\n msg_idx = msg_idx + seq.size * ( rep - 1 )\n logger.print(logger.construct({\n level: Logger::INFO,\n timestamp: messages[msg_idx - 1][:timestamp],\n msg: \"last #{seq.size} messages repeated #{rep - 1} times\"\n }))\n end\n end\n raise \"bad dedup indexing #{msg_idx} vs #{messages.size}\" if msg_idx != messages.size\n end",
"title": ""
},
{
"docid": "29ea046290a26fd5b6c61200c59f0b03",
"score": "0.55907226",
"text": "def call(log, logger)\n hash = SemanticLogger::Formatters::Raw.new.call(log, logger)\n hash.delete(:message) if hash[:exception] && (hash[:message] == hash[:exception][:message])\n hash.delete(:time)\n hash.delete(:level_index)\n hash.delete(:exception)\n hash[:file] = \"#{hash[:file]}:#{hash.delete(:line)}\" if hash.key?(:file)\n hash\n end",
"title": ""
},
{
"docid": "665ebffba86f68ef88dd81ca637f322c",
"score": "0.55787754",
"text": "def format(*args)\n args.join(' ') << \"\\r\\n\"\n end",
"title": ""
},
{
"docid": "f7d5aab087e28d5d10e772e7b437b24c",
"score": "0.55782723",
"text": "def format_message(severity, datetime, progname, msg)\n if !@nest_string\n @nest_string = \" \" * self.nest_size\n end\n msg = \"#{@nest_string}#{msg}\"\n (@formatter || @default_formatter).call(severity, datetime, progname, msg)\n end",
"title": ""
},
{
"docid": "f508e17f71da9c59ae5b00a5823b1b7d",
"score": "0.55689883",
"text": "def tee_log(**msgs)\n msgs.each { |level, msg| $logger.public_send(level, msg) }\n msgs.values.join(\"\\n\") + \"\\n\"\nend",
"title": ""
},
{
"docid": "2b4360bac9a6232be5e5d63c4ee2bc56",
"score": "0.55630696",
"text": "def logging_format(logger)\n default_formatter = Logger::Formatter.new\n logger.formatter = proc do |severity, datetime, progname, msg|\n default_formatter.call(severity, datetime, \"(#{progname})\", msg.to_s)\n end\n logger\n end",
"title": ""
},
{
"docid": "2faff8dd6293b46cd48096007b74779a",
"score": "0.55627775",
"text": "def do_log(log)\n log.debug \"This is a message with level DEBUG\"\n log.info \"This is a message with level INFO\"\n log.warn \"This is a message with level WARN\"\n log.error \"This is a message with level ERROR\"\n log.fatal \"This is a message with level FATAL\"\nend",
"title": ""
},
{
"docid": "a84818a94c015957004b31e7562f15c5",
"score": "0.5545507",
"text": "def format_message(severity, timestamp, progname, msg)\n tags = @level_map[severity]\n if tags\n @environment.notify(:msg => msg, :tags => tags)\n end\n end",
"title": ""
},
{
"docid": "9cd378c43d7f589a2e97d1b2a53cfee4",
"score": "0.5542728",
"text": "def format_handler_messages(handler, messages)\n unless messages.empty?\n \"#{t(\"handler_contains\", handler: handler)}:\\n\\n\" + messages.join(\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "fc61aeb4d31100c315faca85198cbaf0",
"score": "0.55340743",
"text": "def format(level, context, message)\n @formatter.format(level, context, message)\n end",
"title": ""
},
{
"docid": "d7c0e239313e556c9e77f19746424d88",
"score": "0.55333334",
"text": "def formatted_message(msg)\n [\n '[Cloudenvoy]',\n \"[#{loggable.class}]\",\n loggable.message&.id ? \"[#{loggable.message.id}]\" : nil,\n ' ',\n msg\n ].compact.join\n end",
"title": ""
},
{
"docid": "b3c2afd007856461bdab956d37322ac2",
"score": "0.55086035",
"text": "def handle_level( format, directive, precision )\n if colorize_levels?\n name_map = ::Logging::LNAMES.map { |name| color_scheme.color((\"#{format}s\" % name), name) }\n var = \"@name_map_#{name_map_count}\"\n layout.instance_variable_set(var.to_sym, name_map)\n self.name_map_count += 1\n\n format_string << '%s'\n format_string << \"{#{precision}}\" if precision\n sprintf_args << \"#{var}[event.level]\"\n else\n format_string << format + 's'\n format_string << \"{#{precision}}\" if precision\n sprintf_args << DIRECTIVE_TABLE[directive]\n end\n\n nil\n end",
"title": ""
},
{
"docid": "a0f3584f34faf27571b52d18dd15bba0",
"score": "0.55074894",
"text": "def parse_log_lines(lines)\n lines.map do |line|\n if line =~ /\\*err\\*|\\*crit\\*/\n [:error, line.gsub(/\\*err\\*|\\*crit\\*/, \"\") ]\n elsif line =~ /\\*warning\\*/\n [:warning, line.gsub(\"*warning*\", \"\")]\n else\n [:normal, line.gsub(/\\*\\w*\\*/, \"\")]\n end\n end \n end",
"title": ""
},
{
"docid": "6f5bf7195849daf2d46f0e781e74d800",
"score": "0.5505641",
"text": "def log( *msg )\n\t\t\toutput = colorize( msg.flatten.join(' '), 'cyan' )\n\t\t\t$stderr.puts( output )\n\t\tend",
"title": ""
},
{
"docid": "fe3c996429c4a132303aaeaa322496f6",
"score": "0.5504946",
"text": "def format_single_message(level, label, message)\n super(level, label, message) do |*args|\n args.unshift(LEVELS[level])\n end\n end",
"title": ""
},
{
"docid": "6f47eb5ad6d365b45934c360d669525a",
"score": "0.5492815",
"text": "def formatted_message(msg)\n \"[Cloudenvoy][#{loggable.class}] #{msg}\"\n end",
"title": ""
},
{
"docid": "36da8a35c5c40295e6525bff3dbc77e3",
"score": "0.5491174",
"text": "def /(args)\n args.respond_to?(:to_ary) ? self.format(*args.to_ary) : self.format(args)\n end",
"title": ""
},
{
"docid": "faa06324da36c4b4ae3cac5846961b31",
"score": "0.54829407",
"text": "def format_of_last_log\n # validation will only execute if logs has been updated\n return unless logs && logs_changed? &&\n !logs.empty?\n\n entry = logs.last\n\n # Validate Formatting\n unless entry.class == Hash\n errors.add(:log_entry, 'is not a Hash')\n return\n end\n\n # Validate correct number of parameters and valid hash keys\n if entry.length == 5\n unless entry['date_worked'] && entry['date_submitted'] && entry['time_worked'] && entry['stage'] && entry['text']\n errors.add(:log_entry, 'wrong parameter key. Keys should be date_worked, time_worked, stage, text.')\n return\n end\n elsif entry.length < 5\n errors.add(:log_entry, 'parameter is missing from new entry. Keys should be date_worked, time_worked, stage, text.')\n return\n else\n errors.add(:log_entry, 'wrong number of parameters. Keys should be date_worked, time_worked, stage, text.')\n end\n\n # Validate that dates are integers\n begin\n date_worked = Integer(entry['date_worked'])\n Integer(entry['time_worked'])\n\n # validate that date_worked is not in the future\n unless date_worked <= DateTime.now.to_i\n errors.add(:log_entry, \"date_worked can't be in the future\")\n return\n end\n\n rescue\n errors.add(:log_entry, 'date_worked and time_worked must be integers')\n end\n\n # Validate that stage is a string\n unless entry['stage'].class == String\n errors.add(:log_entry, 'stage must be a string')\n return\n end\n\n # Validate that text is a string\n unless entry['text'].class == String\n errors.add(:log_entry, 'text must be a string')\n return\n end\n end",
"title": ""
},
{
"docid": "1bd9384c538a579863584d62b6c856b1",
"score": "0.54796284",
"text": "def format_message(severity, timestamp, progname, msg)\n \"#{timestamp.strftime '%Y-%m-%d %H:%M:%S'} #{severity.chars.first} #{msg}\\n\"\n end",
"title": ""
},
{
"docid": "ace9acc8d389c1ca12a44d868b9b0c3c",
"score": "0.54657596",
"text": "def log_message(message, log_type = \"INFO\")\n stamp = \"#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S\")}|#{log_type}> \"\n message = \"\" if message.nil?\n message = message.inspect unless message.is_a?(String)\n message.split(\"\\n\").map{|l| \"#{stamp}#{l}\"}.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "784f45581f2b592c640dd2a3b9cdbeff",
"score": "0.54636973",
"text": "def log( *msg )\n\toutput = colorize( msg.flatten.join(' '), 'cyan' )\n\t$stderr.puts( output )\nend",
"title": ""
},
{
"docid": "57db8fb8618db6d48ca87408eff5135e",
"score": "0.5437274",
"text": "def formatting; end",
"title": ""
},
{
"docid": "71fd04714c2872cedec064961d3c6385",
"score": "0.5436197",
"text": "def format(tag, time, record)\n if json?\n record.to_msgpack\n elsif msgpack?\n { @record_log_tag => record }.to_msgpack\n else\n \"#{record[@record_log_tag]}\\n\"\n end\n end",
"title": ""
},
{
"docid": "3f5ea2fbb2c30ad3a4f091799a516f6b",
"score": "0.54330355",
"text": "def run_all_formatters\n format_webs\n format_adrs\n format_phones\n end",
"title": ""
},
{
"docid": "07959fd68154c45b3a15faf360c1a0d4",
"score": "0.5432431",
"text": "def formatters(io)\n fmts = [Airbrussh::ConsoleFormatter.new(io, self)]\n fmts.unshift(Airbrussh::LogFileFormatter.new(log_file)) if log_file\n fmts\n end",
"title": ""
},
{
"docid": "a9349a3bf89d8edee3dbc563f056eed7",
"score": "0.54316777",
"text": "def formatter\n @log.formatter\n end",
"title": ""
},
{
"docid": "a26aba7454e5508084fa748b79781ce2",
"score": "0.54285115",
"text": "def format(level, context, message)\n msg = message.to_s.strip\n\n if message.ndc.any?\n msg = \"#{LEVEL_EMOTICON_MAP[level]} - #{context} #{message.ndc.join(' ')} - #{msg}\"\n else\n msg = \"#{LEVEL_EMOTICON_MAP[level]} - #{context} - #{msg}\"\n end\n\n with_backtrace(message, msg)\n end",
"title": ""
},
{
"docid": "2d044e97204ab51266749268bfeda727",
"score": "0.5425481",
"text": "def log(*args)\n level = args.grep(Integer).first || 1\n title = args.grep(Symbol).first\n message = args.grep(String).first\n options = args.grep(Hash).first || {}\n host = options[:host]\n if title\n title = title.to_s\n end\n if @log_level < level || (title.nil? && message.nil?)\n return\n end\n\n #\n # transform absolute path names\n #\n if title && FILE_TITLES.include?(title) && message =~ /^\\//\n message = LeapCli::Path.relative_path(message)\n end\n\n #\n # apply filters\n # LogFilter will not be defined if no platform was loaded.\n #\n if defined?(LeapCli::LogFilter)\n if title\n title, filter_flags = LogFilter.apply_title_filters(title)\n else\n message, filter_flags = LogFilter.apply_message_filters(message)\n return if message.nil?\n end\n options = options.merge(filter_flags)\n end\n\n #\n # set line prefix\n #\n if (host)\n host = host.split('.').first\n end\n prefix = prefix_str(host, title)\n\n #\n # write to the log file, always\n #\n log_raw(:log, nil, prefix) { message }\n\n #\n # log to stdout, maybe in color\n #\n if @log_in_color\n if options[:wrap]\n message = message.split(\"\\n\")\n end\n if options[:color]\n if host\n host = colorize(host, options[:color], options[:style])\n elsif title\n title = colorize(title, options[:color], options[:style])\n else\n message = colorize(message, options[:color], options[:style])\n end\n elsif title\n title = colorize(title, :cyan, :bold)\n end\n # new colorized prefix:\n prefix = prefix_str(host, title)\n end\n log_raw(:stdout, options[:indent], prefix) { message }\n\n #\n # run block indented, if given\n #\n if block_given?\n @indent_level += 1\n yield\n @indent_level -= 1\n end\n end",
"title": ""
},
{
"docid": "ade93322408aa6cfe7fda8d36ca43e8d",
"score": "0.542396",
"text": "def formatted_message(msg)\n if msg.is_a?(String)\n formatted_message_as_string(msg)\n else\n # Delegate object formatting to logger\n msg\n end\n end",
"title": ""
},
{
"docid": "ce7e3d80366c635993c5c33be210599f",
"score": "0.54109764",
"text": "def logger_formatter_impl(severity, time, _progname, msg)\n msg_str =\n case msg\n when ::String\n msg\n when ::Exception\n \"#{msg.message} (#{msg.class})\\n\" << (msg.backtrace || []).join(\"\\n\")\n else\n msg.inspect\n end\n timestr = time.strftime(\"%Y-%m-%d %H:%M:%S\")\n header = format(\"[%<time>s %<sev>5s]\", time: timestr, sev: severity)\n styles = log_header_severity_styles[severity]\n header = @terminal.apply_styles(header, *styles) if styles\n \"#{header} #{msg_str}\\n\"\n end",
"title": ""
},
{
"docid": "d0f3a452f62ed766a3e02afc89a0153b",
"score": "0.5398219",
"text": "def call(log, logger)\n h = default_formatter.call(log, logger)\n\n h[:short_message] = h.delete(:message)\n if h[:short_message].nil?\n h[:short_message] = log.exception.nil? ? \"<no-exception-message>\" : log.exception.message\n end\n h[:level] = logger.level_map[log.level]\n h[:level_str] = log.level.to_s\n h[:duration_str] = h.delete(:duration)\n h\n end",
"title": ""
},
{
"docid": "5672a9f5978ede02b02174cffd4ffd8b",
"score": "0.5397392",
"text": "def format_changelog(changelog_entries)\n changelog_entries = changelog_entries.\n sort_by(&:subcategory).\n group_by { |entry| [entry.category, entry.change] }\n\n changelog = ''\n CATEGORIES.each do |category|\n category_changes = changelog_entries.\n filter { |(changelog_category, _change), _changes| changelog_category == category }\n\n next if category_changes.empty?\n changelog.concat(\"## #{category}\\n\")\n category_changes.each do |group, entries|\n change = entries.first.change\n subcategory = entries.first.subcategory\n pr_numbers = entries.map(&:pr_number).compact.sort\n if pr_numbers.count > 0\n formatted_pr_numbers = pr_numbers.map do |number|\n \"[##{number}](https://github.com/18F/identity-idp/pull/#{number})\"\n end.join(', ')\n formatted_pr_numbers = \" (#{formatted_pr_numbers})\"\n else\n formatted_pr_numbers = ''\n end\n\n changelog.concat(\"- #{subcategory}: #{change}#{formatted_pr_numbers}\\n\")\n end\n\n changelog.concat(\"\\n\")\n end\n\n changelog.strip\nend",
"title": ""
},
{
"docid": "20b75704621ac42d2d7938bd1521d29a",
"score": "0.5396398",
"text": "def test_multiple_messages\n @entries << ::Sawmill::Entry::Message.new(@levels.get(:INFO), Time.utc(2009, 10, 20, 8, 30, 45, 120000), 'rails', nil, 'Hello')\n @entries << ::Sawmill::Entry::Message.new(@levels.get(:ERROR), Time.utc(2009, 10, 20, 8, 30, 46, 980000), 'rails', nil, 'Something bad happened!')\n _run_test(\"[INFO 2009-10-20 08:30:45.12 rails .] Hello\\n[ERROR 2009-10-20 08:30:46.98 rails .] Something bad happened!\\n\")\n end",
"title": ""
},
{
"docid": "43f0dd8ef7a8eac6d29500de95da0282",
"score": "0.5386072",
"text": "def formatted; end",
"title": ""
},
{
"docid": "43f0dd8ef7a8eac6d29500de95da0282",
"score": "0.5386072",
"text": "def formatted; end",
"title": ""
},
{
"docid": "247a3ad86ed9571400742f5286b9ad0b",
"score": "0.5382409",
"text": "def format(tag, time, record)\n return [tag, record].to_msgpack\nend",
"title": ""
},
{
"docid": "06ef0fe6722353b0e2ff9b972f0c9749",
"score": "0.53763574",
"text": "def display_n_log(msg, log_file)\n puts msg\n log_file.puts msg\n end",
"title": ""
},
{
"docid": "9cf85fecd8f89a7df3fd01eff797f9fe",
"score": "0.5365285",
"text": "def format(*args)\n args_s = args.size\n raise ArgumentError.new(\"wrong number of arguments\") if args_s > 2\n args.last.each { |key,val| send(\"#{key}=\", val) } if args_s == 2\n @format = args.first if args_s > 0\n @format\n end",
"title": ""
},
{
"docid": "beaf0deda877f395f396573262b3bbd2",
"score": "0.5363738",
"text": "def format_to_new_ine\n @writer.formatter = proc do |severity, datetime, _progname, msg|\n \"\\n#{msg}\"\n end\n @logger.formatter = proc do |severity, datetime, _progname, msg|\n \"\\n#{msg}\"\n end\n end",
"title": ""
},
{
"docid": "0caec9d00468e5321d6c7ccf70459ffa",
"score": "0.53614366",
"text": "def log_message(lvl_name, message)\n str = self.format.dup\n str.gsub!(/\\$L/, lvl_name.upcase)\n str.gsub!(/\\$T/, time_string)\n str.gsub!(/\\$B/, caller[3])\n str.gsub!(/\\$M/, message.to_s)\n output_message str\n end",
"title": ""
},
{
"docid": "94d0e31d25427ac08f8010ab98b35525",
"score": "0.53550375",
"text": "def extract_logs(logs)\n\t@@string = \"\"\n\n\tlogs.each { |v|\n\t\tcase v.level\n\t\t\twhen (:info or :notice or :warning or :err or :alert or :emerg or :crit)\n\t\t\t\t@@string << \"\\n\\t\" + v.time.to_s + \": \" + v.message \n\t\t\telse # /:debug/ or /:info/ \n\t\t\t\tdo_nothing\n\t\tend #case v.level\n\n\t} # logs.each { |v|\n\n\treturn @@string\n\nend",
"title": ""
},
{
"docid": "94ddb0d793b03be673f3192b8edc3709",
"score": "0.53484684",
"text": "def log severity, message\n end",
"title": ""
}
] |
79f10206b5a413983c529dd7e261b419
|
Must be overridden by subclass. Should return a model instance, or nil
|
[
{
"docid": "b59620f6ac095690c441909fe729e7a5",
"score": "0.0",
"text": "def load_by_id(_id, _context)\n raise NotImplementedError\n end",
"title": ""
}
] |
[
{
"docid": "317be8fc1895cf8498224ad9255a279b",
"score": "0.7544714",
"text": "def model\n @model ||= Model.new(self)\n end",
"title": ""
},
{
"docid": "18a587a6624887d14e285b75ed5b7116",
"score": "0.7249147",
"text": "def model\n return @model\n end",
"title": ""
},
{
"docid": "18a587a6624887d14e285b75ed5b7116",
"score": "0.7249147",
"text": "def model\n return @model\n end",
"title": ""
},
{
"docid": "e2464c24f6e5c42b89014623e12ed92d",
"score": "0.7245459",
"text": "def model\n self.public_send(self.class._attributes.first)\n end",
"title": ""
},
{
"docid": "6c7f9a5f8370036f40d28777c6ea891e",
"score": "0.72244424",
"text": "def model\n return @model\n end",
"title": ""
},
{
"docid": "d9986209e7126d0985d39ab03a463d40",
"score": "0.72018176",
"text": "def model\n __getobj__\n end",
"title": ""
},
{
"docid": "690cb413156e020a7269b607d820c814",
"score": "0.708148",
"text": "def model\n self.class.model\n end",
"title": ""
},
{
"docid": "690cb413156e020a7269b607d820c814",
"score": "0.708148",
"text": "def model\n self.class.model\n end",
"title": ""
},
{
"docid": "21b7064c6a5c40aa372d01521dbc7b9f",
"score": "0.70751536",
"text": "def model\n nil\n end",
"title": ""
},
{
"docid": "21b7064c6a5c40aa372d01521dbc7b9f",
"score": "0.70751536",
"text": "def model\n nil\n end",
"title": ""
},
{
"docid": "84d7b691d0cc3e3f9825646c34fdac6f",
"score": "0.70534885",
"text": "def model\n @model ||= resource.model\n end",
"title": ""
},
{
"docid": "cbe47a4e9d450098d470e10b3c4131bc",
"score": "0.70481277",
"text": "def get_mobj(mname=nil) @model_class.instance; end",
"title": ""
},
{
"docid": "510cf9564a5ddb78391745657c017313",
"score": "0.6965596",
"text": "def model\n self\n end",
"title": ""
},
{
"docid": "40d90b7329fa9b8e3e55e27a6d7201b7",
"score": "0.68873453",
"text": "def to_model\n __getobj__\n end",
"title": ""
},
{
"docid": "a7c6b55e6a03334130ad30edd9b0501e",
"score": "0.68662715",
"text": "def model_class\n return @model_class || self.class.model_class\n end",
"title": ""
},
{
"docid": "631b287f62905ef1986e9998a2cf32b8",
"score": "0.68603027",
"text": "def model\n self::Model\n end",
"title": ""
},
{
"docid": "c509981549daacfd693b8009c5023a3d",
"score": "0.6820022",
"text": "def model\n @model\n end",
"title": ""
},
{
"docid": "c509981549daacfd693b8009c5023a3d",
"score": "0.6820022",
"text": "def model\n @model\n end",
"title": ""
},
{
"docid": "c509981549daacfd693b8009c5023a3d",
"score": "0.6820022",
"text": "def model\n @model\n end",
"title": ""
},
{
"docid": "c509981549daacfd693b8009c5023a3d",
"score": "0.6820022",
"text": "def model\n @model\n end",
"title": ""
},
{
"docid": "1bf759d982be972417d6efb5542646b2",
"score": "0.6757257",
"text": "def find\n super.first\n end",
"title": ""
},
{
"docid": "1e325be867a459b6c297125937898988",
"score": "0.6756555",
"text": "def obj\n @model\n end",
"title": ""
},
{
"docid": "cc22c4cbe895350218e9d68a6f090186",
"score": "0.67362946",
"text": "def first\n @model_class.first\n end",
"title": ""
},
{
"docid": "cc22c4cbe895350218e9d68a6f090186",
"score": "0.67362946",
"text": "def first\n @model_class.first\n end",
"title": ""
},
{
"docid": "32225823908983c64bb0cb1f80b95d68",
"score": "0.6707245",
"text": "def get_model\n return model_classes[item_type].new()\n end",
"title": ""
},
{
"docid": "587156d19075f50acba82b94c35363ff",
"score": "0.669073",
"text": "def model\n self.class.const_get(:MODEL)\n end",
"title": ""
},
{
"docid": "f117d5061b6041bd47981b83bc6fef7f",
"score": "0.6583013",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "f117d5061b6041bd47981b83bc6fef7f",
"score": "0.658264",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "340a0c1d847ca9dbdba8f15399d6941b",
"score": "0.65697896",
"text": "def get_model(from_get_recordset: false)\n return @model if instance_variable_defined?(:@model) && @model\n return (@model = self.class.model) if self.class.model\n\n # Delegate to the recordset's model, if it's defined.\n unless from_get_recordset # prevent infinite recursion\n if (recordset = self.get_recordset)\n return @model = recordset.klass\n end\n end\n\n # Try to determine model from controller name.\n begin\n return (@model = self.class.name.demodulize.match(/(.*)Controller/)[1].singularize.constantize)\n rescue NameError\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "7d9b381c17c45f6c6220273c5e74a2ae",
"score": "0.6553335",
"text": "def base_class\n S::Model\n end",
"title": ""
},
{
"docid": "19d9764a2c7f930b2a464848744cafcd",
"score": "0.652991",
"text": "def model_class; end",
"title": ""
},
{
"docid": "6265538153486275b1da60852e4a1ca4",
"score": "0.6524027",
"text": "def find_model(record)\n raise_must_override\n end",
"title": ""
},
{
"docid": "0997d8630022d54092fa6793f35f6462",
"score": "0.6491611",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "0997d8630022d54092fa6793f35f6462",
"score": "0.6491611",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "0997d8630022d54092fa6793f35f6462",
"score": "0.6491611",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "ecd521cbac4b9df7fd1c48b303c21c5d",
"score": "0.646593",
"text": "def model\n provider.model\n end",
"title": ""
},
{
"docid": "1f2f99d2422663264b56acb8c3a93cf5",
"score": "0.6454036",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "4e2a3679423dfef02d81b6271955a9a2",
"score": "0.6450778",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "4e2a3679423dfef02d81b6271955a9a2",
"score": "0.6450778",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "cab4a4efa6798a079d2c8b75513bb3fb",
"score": "0.6438201",
"text": "def model\n @model ||= operation.run\n end",
"title": ""
},
{
"docid": "4a88cc5480eedc82a4500ed2a9663091",
"score": "0.64355904",
"text": "def model\n @model ||= ::Video.find model_id\n end",
"title": ""
},
{
"docid": "dcd34e2eb8ecf65175bcec0933e81bba",
"score": "0.6429243",
"text": "def model\n if object[inheritance_column]\n object[inheritance_column].constantize\n else\n original_class\n end\n end",
"title": ""
},
{
"docid": "ea242b12ad87363f04ec73002756eb97",
"score": "0.6406177",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "86f6b9252e34472ca26a4a4d9ef24009",
"score": "0.6403474",
"text": "def model_class\n self.class.const_get('MODEL')\n end",
"title": ""
},
{
"docid": "3329dd6533ad4762d446e1f50fa76903",
"score": "0.6398239",
"text": "def to_model\n self\n end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.6385807",
"text": "def model; end",
"title": ""
},
{
"docid": "4b86006ad973acc11995800926184ca9",
"score": "0.6384388",
"text": "def default_model()\n nil\n end",
"title": ""
},
{
"docid": "3610036d8c0b79ad4a5439a749b3811a",
"score": "0.6369531",
"text": "def concrete_model\n self.class\n end",
"title": ""
},
{
"docid": "abb4ac51dc08a1b6165c737fce9c3996",
"score": "0.63386965",
"text": "def base_model\n BaseModel\n end",
"title": ""
},
{
"docid": "925678cc7531c7ab89f9cb8aacf6e0ec",
"score": "0.63281584",
"text": "def to_model\n match\n end",
"title": ""
},
{
"docid": "457b879edb5884880f73d58f2a04b12f",
"score": "0.63031954",
"text": "def find_record\n self.class.model_klass.find(params[:id])\n end",
"title": ""
},
{
"docid": "60f9b8f83b3a669b0ab15724e7531fd1",
"score": "0.62948775",
"text": "def model_class\n @model_class ||= mapping.to\n end",
"title": ""
},
{
"docid": "1095e49968cab28f3772681c0b2fd0dc",
"score": "0.62791616",
"text": "def model\n @model ||= if self.class.path_to_model\n m = eval(self.class.path_to_model)\n if m\n if m.respond_to?(:_controller=)\n m.send(:_controller=, self)\n end\n else\n fail \"No model object found at path: #{self.class.path_to_model}\"\n end\n m\n end\n end",
"title": ""
},
{
"docid": "10ce85f30fe7492edd9b2a9962496219",
"score": "0.62157226",
"text": "def find_model_argument(*args)\n # First a valid model object is searched for.\n model = args.find { |arg|\n arg.is_a?(Sketchup::Model) && model.valid?\n }\n # Then we look for objects that might return a valid model object.\n unless model\n entity ||= args.find { |arg|\n arg.respond_to?(:model) &&\n arg.model.is_a?(Sketchup::Model) && arg.model.valid?\n }\n if entity\n model = entity.model\n end\n end\n # We should only return valid objects.\n unless model && model.valid?\n return nil\n end\n model\n end",
"title": ""
},
{
"docid": "0ba535b5cc69af7b60c3fe54e96e7640",
"score": "0.6214019",
"text": "def model\n # A bit of 'caching': lookups based on namespace can be quite slow\n unless @model.nil?\n return @model\n end\n \n # Should return nil if this is not an association\n if property?\n return nil\n end\n\n if @model = model_from_options || model_from_namespace\n @model\n else\n raise RuntimeError, 'Could not find association model for %s (%s :%s)' % [@cls, @options[:association], @name]\n end\n end",
"title": ""
},
{
"docid": "0b710ac9723b6bad0c6ac79d4ecf53b0",
"score": "0.6193113",
"text": "def class\n @model.class\n end",
"title": ""
},
{
"docid": "ee68171f07403e9a7c06c68aa24876a9",
"score": "0.61899686",
"text": "def method_missing msg, *args, &block\n model = begin;\n Object.const_get msg\n rescue NameError\n end\n \n if model and model.respond_to?(:descends_from_active_record?) and model.descends_from_active_record?\n model.find args.first\n else\n super\n end\nend",
"title": ""
},
{
"docid": "338fcb86c92c71399633c72b30a19d8b",
"score": "0.6178417",
"text": "def buildModel(json)\n classname = name.downcase\n\n model = where(\"id\").eq(json[\"id\"]).first\n if model.present?\n if model.wrap(json)\n model.lastSyncAt = Time.now if model.respond_to?(:lastSyncAt)\n return model\n end\n else\n newModel = self.new\n return newModel if newModel.wrap(json)\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "4f0dca958f4c2c346cde5712ffdba4f7",
"score": "0.6177071",
"text": "def model\n end",
"title": ""
},
{
"docid": "a025b76eb303df77dc77997954bddf52",
"score": "0.6176627",
"text": "def model\n options.key?(:collection) ? call(:collection).klass : collection\n end",
"title": ""
},
{
"docid": "49579a6f838ed19cad2722767c3bf9b9",
"score": "0.6173907",
"text": "def record\n @record ||= SomeModel.new\n end",
"title": ""
},
{
"docid": "95f4605618d5f3f150a522e9bb1e8b37",
"score": "0.6172722",
"text": "def model\r\n\t\t\t@model ||= json['model']\r\n\t\tend",
"title": ""
},
{
"docid": "3ac0ef13ebd04a887912b084fbfa4d8d",
"score": "0.6172678",
"text": "def true_class\n return ModelProxy\n end",
"title": ""
},
{
"docid": "2a7091f7eb3555da6e9084fa7f6aa0f2",
"score": "0.61711514",
"text": "def get!(key)\n model = get(key)\n return model if model\n\n raise ActiveRecord::ShardFor::RecordNotFound\n end",
"title": ""
},
{
"docid": "ac3beaa03e11516fbe0e216aa51b9fcd",
"score": "0.6168933",
"text": "def model\n @model ||= @fact_model.model\n end",
"title": ""
},
{
"docid": "74ae5b0fcd72bc738fb93dbf6beffc6a",
"score": "0.61407894",
"text": "def model\n @filtered_rset.model\n end",
"title": ""
},
{
"docid": "82490b1c41433ea4285f96e9cd9055ac",
"score": "0.6140196",
"text": "def parent_model\n return @parent_model if @parent_model\n\n if parent_model_name && parent_model_class\n parent_id_param = \"#{parent_model_name}_id\"\n if params[parent_id_param]\n @parent_model = parent_model_class.find_by(find_parent_by => params[parent_id_param])\n end\n end\n\n @parent_model\n end",
"title": ""
},
{
"docid": "934f301af6e88638d63332ed26938c0e",
"score": "0.6127977",
"text": "def to_model\n m = if self.keys.include?('event_type_ssim')\n EventSolrDoc.new\n else\n ActiveFedora::Base.load_instance_from_solr(id, self)\n end\n m.class == ActiveFedora::Base ? self : m\n end",
"title": ""
},
{
"docid": "45fcd85947a300e02594742f58ed8b64",
"score": "0.6125923",
"text": "def get_model\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/response/model'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n _response = execute_request(_request)\n\n # Validate response against endpoint and global error codes.\n return nil if _response.status_code == 404\n validate_response(_response)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n Person.from_hash(decoded)\n end",
"title": ""
},
{
"docid": "0f231c74122c213ddff5eb573b9d09b4",
"score": "0.612534",
"text": "def find_record_by(model)\n raise_must_override\n end",
"title": ""
},
{
"docid": "7b5d03d9ef19832d8613b45edb7deee1",
"score": "0.6116916",
"text": "def model_class\n @model_class ||= derived_model_class_name.constantize\n end",
"title": ""
},
{
"docid": "b0b2e81b8d305d7f1252fd971204dc6f",
"score": "0.6115198",
"text": "def get_model( options )\n return options[:model] if options[:model]\n return options[:node].getModel if options[:node] && options[:node].resource? && options[:node].getModel\n default_model\n end",
"title": ""
},
{
"docid": "d9dbe15bd9be2bc4e2d73e146c6439d5",
"score": "0.61030495",
"text": "def target_model\n self.class.target_model\n end",
"title": ""
},
{
"docid": "3c473763aa69b1047f3630d8bec0d467",
"score": "0.6087288",
"text": "def get(obj)\n collection, query = get_type_info(obj)\n\n record = retrieve(collection, query, limit: 1).first\n return nil unless record\n\n obj.class.new(record)\n end",
"title": ""
},
{
"docid": "3dc388d6c64dba61ac8e55481d64a241",
"score": "0.6085921",
"text": "def get_model(model_type, name)\n klass = class_for_type(model_type)\n result = model_store.get(klass, name) || Backyard.global_store.model_store.get(klass, name)\n if result.nil? && Backyard.name_based_database_lookup\n result = find_model_from_database(klass, name)\n put_model(result, name) if result\n result\n else\n reload_model(result)\n end\n end",
"title": ""
},
{
"docid": "908fab092dfd6d4f26acce0ffa7ca055",
"score": "0.60505855",
"text": "def model(name_or_type)\n table = Brief::Model.table\n\n table.fetch(name_or_type) do\n table.values.find do |k|\n k.name == name_or_type\n end\n end\n end",
"title": ""
},
{
"docid": "908fab092dfd6d4f26acce0ffa7ca055",
"score": "0.60505855",
"text": "def model(name_or_type)\n table = Brief::Model.table\n\n table.fetch(name_or_type) do\n table.values.find do |k|\n k.name == name_or_type\n end\n end\n end",
"title": ""
},
{
"docid": "35599d2fbe96ae3443d62254220c8a07",
"score": "0.6049389",
"text": "def parent_model_class\n self.class.parent_model_class\n end",
"title": ""
},
{
"docid": "7f4f8899d5ac2451cb8999531792da41",
"score": "0.6026507",
"text": "def model\n parts.first\n end",
"title": ""
},
{
"docid": "ff406522ba9b9f6e7e7a2d54385da9bd",
"score": "0.601839",
"text": "def model\n @type.constantize\n end",
"title": ""
},
{
"docid": "ff406522ba9b9f6e7e7a2d54385da9bd",
"score": "0.601839",
"text": "def model\n @type.constantize\n end",
"title": ""
},
{
"docid": "2fc392624ad51c9af489df97184a60aa",
"score": "0.6005823",
"text": "def model\n return Sketchup.active_model if not @rep\n @rep.model\nend",
"title": ""
},
{
"docid": "8ea1f0a56f0d5cb9e4c683ececf67a05",
"score": "0.5998411",
"text": "def model_from_options #nodoc\n @options[:class_name].nil? ? nil : @options[:class_name].constantize\n end",
"title": ""
},
{
"docid": "27b372dc9a5582a75918849fc3c3b2bd",
"score": "0.5997261",
"text": "def _default_wrap_model; end",
"title": ""
},
{
"docid": "0d587ef8eae5cd71765e4c272ed1b7e1",
"score": "0.59914833",
"text": "def find_record(id)\n @model_class.find(id)\n end",
"title": ""
},
{
"docid": "0d587ef8eae5cd71765e4c272ed1b7e1",
"score": "0.59914833",
"text": "def find_record(id)\n @model_class.find(id)\n end",
"title": ""
},
{
"docid": "9760dee984d88f5b8bac79083d741c01",
"score": "0.5967295",
"text": "def model\n end",
"title": ""
},
{
"docid": "9760dee984d88f5b8bac79083d741c01",
"score": "0.5967295",
"text": "def model\n end",
"title": ""
},
{
"docid": "9760dee984d88f5b8bac79083d741c01",
"score": "0.5967295",
"text": "def model\n end",
"title": ""
},
{
"docid": "de89118f6d0f5c668d17db7342533cbc",
"score": "0.59620637",
"text": "def parent\n o = Object.const_get(parent_model) rescue nil\n o && o.get(parent_id)\n end",
"title": ""
},
{
"docid": "036f44535c57107dbd1d1c2fda9e5051",
"score": "0.5949795",
"text": "def single_record!\n if use_eager_all?\n obj = clone(:all_called=>true).all.first\n\n if opts[:eager_graph]\n obj = clone(:all_called=>true).where(obj.qualified_pk_hash).unlimited.all.first\n end\n\n obj\n else\n super\n end\n end",
"title": ""
},
{
"docid": "2195b0b81c2c8e61489f39911d8bd373",
"score": "0.5935808",
"text": "def model_class\n self.class.models[implementation_model_name]\n end",
"title": ""
}
] |
0efaa2ee58ade48f2a607f51def2930a
|
List of all applicable validators from both the policy and its parent
|
[
{
"docid": "ef08285a9810e5d796a467c69a34fdba",
"score": "0.81783384",
"text": "def validators\n parent_validators = self == Tram::Policy ? [] : superclass.validators\n (parent_validators + local_validators).uniq\n end",
"title": ""
}
] |
[
{
"docid": "6ee2b3e82333eec4e7bf5f1488f821e4",
"score": "0.710864",
"text": "def validators\n []\n end",
"title": ""
},
{
"docid": "19bf32ab4588729b33bc7deeb0ec740d",
"score": "0.68133575",
"text": "def validator_instances\n @validator_instances ||= validators.map { |klass| klass.new(context, options.merge(parent_validator: self)) }\n .select(&:valid_in_context?)\n end",
"title": ""
},
{
"docid": "485ae3b337e83a42dc0c89c1beb33132",
"score": "0.65834874",
"text": "def validators\n @validators ||= ContextualValidators.new(self)\n end",
"title": ""
},
{
"docid": "0cdfe6e3363724e8222aabb8b86f9e7a",
"score": "0.6573007",
"text": "def reflect_on_all_validations\n self.read_inheritable_attribute(:validations) || []\n end",
"title": ""
},
{
"docid": "32b2725f3ed946abbcbb1ba2281b524f",
"score": "0.6363523",
"text": "def validators\n @validators ||= Settler.validations_for(self.key)\n end",
"title": ""
},
{
"docid": "8908056634845f786cb72491cca7fc6e",
"score": "0.63043064",
"text": "def fields!\n @validators.keys.find_all { |key| @validators[key].is_a? ::Proc }\n end",
"title": ""
},
{
"docid": "7355483ccfbafb0269e837175dd9f5ad",
"score": "0.62783617",
"text": "def validators\n @validators = [ChecklistCriteriaValidator.new(product_test),\n ::Validators::QrdaCat1Validator.new(product_test.bundle, false, product_test.c3_test, true, product_test.measures)]\n @validators\n end",
"title": ""
},
{
"docid": "ed17516347239ecfb03866258066fe86",
"score": "0.6255747",
"text": "def default_validators\n []\n end",
"title": ""
},
{
"docid": "eccd51223fc018ac89d2608675ac66fb",
"score": "0.6243117",
"text": "def all(&block)\n @validators <<\n if block_given?\n opts = @options.dup\n opts[:optional] = false\n val = ValidatorBuilder.new(self, opts, &block)\n @keys << val.keys\n ->(obj) { val.validators.map { |v| v.call(obj) }.all? }\n else\n ANY\n end\n end",
"title": ""
},
{
"docid": "e141b9a223b38eb35296fe0982ba87ac",
"score": "0.6242681",
"text": "def expand_on_ancestors(validators)\n delegator_class.ancestors.each do |ancestor|\n next if delegator_class == ancestor # ancestor includes itself\n\n validator_ancestor = validators[ancestor]\n\n next unless validator_ancestor\n\n add_allowlist(validator_ancestor.allowed_method_names)\n end\n end",
"title": ""
},
{
"docid": "7a594d6ea6f5a0109475f2b2b9d9ce45",
"score": "0.6209799",
"text": "def eh_validators\n [::Validators::CMSQRDA1HQRSchematronValidator.new(product_test.bundle.version, as_warnings: false),\n ::Validators::EncounterValidator.new,\n ::Validators::CoreClinicalDataElementValidator.new(product_test.measures),\n ::Validators::QrdaCat1Validator.new(product_test.bundle, false, product_test.c3_test, true)]\n end",
"title": ""
},
{
"docid": "9cb4e68b9ebe16e250d9bde877f5dc43",
"score": "0.6205558",
"text": "def program_specific_validators\n return eh_program_specific_validators if product_test.reporting_program_type == 'eh'\n return ep_program_specific_validators if product_test.reporting_program_type == 'ep'\n\n []\n end",
"title": ""
},
{
"docid": "915b511c7c2fd10cd9f3c554916fe15d",
"score": "0.60925925",
"text": "def each_validator\n self.class.validations.each do |attribute, validators|\n validators.each { |validator| yield(attribute, validator) }\n end\n end",
"title": ""
},
{
"docid": "1548e157848b19092287a91dffe60a83",
"score": "0.6036511",
"text": "def ep_validators\n [::Validators::CMSQRDA3SchematronValidator.new(product_test.bundle.version, as_warnings: false),\n ::Validators::QrdaCat3Validator.new(nil, false, true, false, product_test.bundle),\n Cat3PopulationValidator.new(product_test.expected_measures)]\n end",
"title": ""
},
{
"docid": "f75a2c7b7a85b4ba256e5aaf995dc4aa",
"score": "0.5844639",
"text": "def subconfigs!\n @validators.keys.find_all { |key| @validators[key] == SUBCONFIG }\n end",
"title": ""
},
{
"docid": "6b63f892214b6439293225a11e5e87fa",
"score": "0.58361256",
"text": "def validators_for(attribute)\n \n return [] if @object.nil?\n return [] unless @object.class.respond_to?(:validators_on)\n \n attribute = attribute.to_s.sub(/_id$/, '').to_sym\n @object.class.validators_on(attribute).uniq\n \n end",
"title": ""
},
{
"docid": "25b230a32f205a5ea24d74da83f6bf74",
"score": "0.58298784",
"text": "def validations\n []\n end",
"title": ""
},
{
"docid": "dd56a3408c10dd4807fabab7a7201098",
"score": "0.58151567",
"text": "def only(&block)\n @validators <<\n if block_given?\n val = ValidatorBuilder.new(self, @options, &block)\n lambda do |obj|\n obj.is_a? Hash and val.validators.map { |v| v.call(obj) }.all? and\n obj.symbolize_keys.keys.map { |k| k.in?(val.keys) }.all?\n end\n else\n ANY\n end\n end",
"title": ""
},
{
"docid": "f84ef7c87587f0ff25c6f38f9286be34",
"score": "0.5679784",
"text": "def local_validators\n @local_validators ||= []\n end",
"title": ""
},
{
"docid": "92628b1719ce0bdd7e9a4349384ca552",
"score": "0.561059",
"text": "def validation_rules\n []\n end",
"title": ""
},
{
"docid": "c2a0fe809fde6ab8024e0e2466172973",
"score": "0.55964535",
"text": "def validate!\n self.class.validators.each do |validator|\n validator.validate!(self)\n end\n nil\n end",
"title": ""
},
{
"docid": "545b48bc18849c88a28087941f0a40dc",
"score": "0.55940926",
"text": "def validations(tf = true)\n if tf\n local_validations + collect_inherited(:local_validations)\n else\n local_validations\n end\n end",
"title": ""
},
{
"docid": "fce4018d894d278dc30ff2d6a612b313",
"score": "0.5526721",
"text": "def validators(attr, options, *blacklist)\n options.map.with_object({}) do |(key, opts), obj|\n name = key.to_s\n\n next if blacklist.map(&:to_s).include? name\n next if %w(allow_nil if unless on message).include? name\n\n opts = {} unless opts.is_a? Hash\n obj[key] = find_validator_by_name(name).new(attributes: attr, **opts)\n end\n end",
"title": ""
},
{
"docid": "6b8ce8951e1f1112a74674646a79f2fc",
"score": "0.5524139",
"text": "def validations_for_diff\n []\n end",
"title": ""
},
{
"docid": "c2dc885d034d945d5af435e70636c1cb",
"score": "0.548672",
"text": "def descendants_with_active_validation\n [].tap do |descendants|\n k = base_class.superclass\n while k.respond_to?(:active_validation) && k.instance_methods.include?(:manifest)\n descendants << k\n k = k.superclass\n end\n end\n end",
"title": ""
},
{
"docid": "70fdf2bc8bb1274c709ee1ae287c0719",
"score": "0.53690577",
"text": "def each(&block)\n @@validator_initializers.each(&block)\n end",
"title": ""
},
{
"docid": "dead04663317d045a1803115c7240a0e",
"score": "0.53453505",
"text": "def errors\n execute_lifecycle(:before, :validation) if self.respond_to? :execute_lifecycle\n errs = []\n self.class.validations.each do |validation|\n errs << (validation.is_a?(Proc) ? self.instance_exec(&validation) : self.send(validation))\n end\n # remove nils\n errs = errs.flatten.select { |x| !x.nil? }\n errs\n end",
"title": ""
},
{
"docid": "618eaec954f7a9656712c78b0d1ae37e",
"score": "0.5296882",
"text": "def validate_parents\n parent_relationships.each do |relationship|\n parent = relationship.get(self)\n unless parent.valid?\n unless errors[relationship.name].include?(parent.errors)\n errors[relationship.name] = parent.errors\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7b20cd8bc2633d109291012ba00f5957",
"score": "0.52954847",
"text": "def validity_policy\n -> policy_predicates, ctx {\n Fn.either.(Fn.tests.(Fn.all?, policy_predicates), Fn.success, Fn.failure ).(ctx)\n }.curry\n end",
"title": ""
},
{
"docid": "b621d962ac8b158e71adaffb03b8aaa9",
"score": "0.5273739",
"text": "def parameter_validations\n @parameter_validations ||= []\n end",
"title": ""
},
{
"docid": "dbed5f052023bae11d0403d32dc9b11e",
"score": "0.52461594",
"text": "def policy_scopes; end",
"title": ""
},
{
"docid": "b17cd9bcf66f4d8c115578990de6351e",
"score": "0.5242145",
"text": "def validators_on(name)\n ::Kernel.raise Errors::NotImplemented\n end",
"title": ""
},
{
"docid": "5b00bea72133dbe517dec6e093fb7646",
"score": "0.52338994",
"text": "def get_parent_outypes_courses_schema_constraints\n path = \"/d2l/api/lp/#{$lp_ver}/courses/schema\"\n _get(path)\n # returns a JSON array of SchemaElement blocks\nend",
"title": ""
},
{
"docid": "e2a305cb513a5d567c7f2a76988db536",
"score": "0.5218527",
"text": "def each_validator(validators_configuration, &block)\n return to_enum(:each_validator,\n validators_configuration) unless block_given?\n validators_configuration.each_pair do |key, configuration|\n begin\n initializer = @@validator_initializers.fetch(key)\n rescue KeyError => e\n Jekyll.logger.warn(\"#{e.message}\")\n next\n end\n yield(key, initializer.call(configuration))\n end\n end",
"title": ""
},
{
"docid": "9c102491e6f321f4a617b06c73a26296",
"score": "0.5198011",
"text": "def validate\n validations = self.class.meta_eval { @validations }\n\n validations.each do |v|\n raise \"#{self.class}.#{v[:name]} #{v[:options][:message]}\" unless\n v[:proc].call(send(v[:name]))\n end\n\n self\n end",
"title": ""
},
{
"docid": "d2748b642bff77a199fac1ff1ca50110",
"score": "0.51797324",
"text": "def validate(_options = 0)\n []\n end",
"title": ""
},
{
"docid": "c24bccd5338bf8f268f30a6e191f3130",
"score": "0.51416826",
"text": "def get_validators(*params); raise('Stub or mock required.') end",
"title": ""
},
{
"docid": "f562d6ce2135e550dacbe545d629f069",
"score": "0.5129642",
"text": "def applied_policies\n return @applied_policies\n end",
"title": ""
},
{
"docid": "f939960c91ea153d6a9836ab4be8cc45",
"score": "0.512354",
"text": "def field_validations\n @filters.each do |filter|\n validate_field_presence(filter.field_name) if filter.required?\n end\n end",
"title": ""
},
{
"docid": "3ae07b06e5d74ac59c65e07d0fb38d8c",
"score": "0.51176167",
"text": "def load_validators(model, params)\n\n end",
"title": ""
},
{
"docid": "ad74902180b5a7a0f4c5ba8cd90934bd",
"score": "0.51168716",
"text": "def validate_with(&block)\n validators << block\n end",
"title": ""
},
{
"docid": "91b7890cc1d707e99c4ccf2732275edf",
"score": "0.51134676",
"text": "def policy_constraints\n extensions[R509::Cert::Extensions::PolicyConstraints]\n end",
"title": ""
},
{
"docid": "17602e0806c6d8c77f13c9ab9e1f0f59",
"score": "0.51102513",
"text": "def contraints(p_module_object)\n\t\tconstraints = []\n\t\tmin = self.find_property('MIN')\n\t\tif ! min.nil?\n\t\t\tconstraints << ConstraintChecker::Constraints::Min.new(p_module_object, min.value)\n\t\tend\n\t\tmax = self.find_property('MAX')\n\t\tif !max.nil?\n\t\t\tconstraints << ConstraintChecker::Constraints::Max.new(p_module_object, max.value)\n\t\tend\n\t\tconstraints \n\n\tend",
"title": ""
},
{
"docid": "468c7619be6687db0f430cd0f1eb58e5",
"score": "0.51089793",
"text": "def validate(validator)\n validators << validator unless validators.include?(validator)\n end",
"title": ""
},
{
"docid": "6ff0363ea4e5e0e0b4fc4f5d5e4c0ccf",
"score": "0.50951666",
"text": "def valid_validation_parameter\n %i[\n validate\n criteria\n value\n source\n minimum\n maximum\n ignore_blank\n dropdown\n show_input\n input_title\n input_message\n show_error\n error_title\n error_message\n error_type\n other_cells\n ]\n end",
"title": ""
},
{
"docid": "2a397568a64a3a0cdebe64f50fa29669",
"score": "0.50947046",
"text": "def rules\n self.class.rules\n end",
"title": ""
},
{
"docid": "dccff0aee16d09c31d6f074eb6446416",
"score": "0.50715744",
"text": "def check_local_validators(klass, attributes, validator)\n ids = []\n klass.all.each do |obj|\n obj.valid?\n attributes.each do |attr|\n ids << obj.id if obj.errors[attr.to_sym].present?\n end\n end\n ids = ids.flatten.uniq\n [ids, \" #{ids.count} records that have an invalid #{attributes}. See the #{validator} for further details\"]\n end",
"title": ""
},
{
"docid": "f2fe80fdce5f0c5bcd66826111ad991e",
"score": "0.5069088",
"text": "def validations\n CompiledValidations.new(@validations, @allow_keys)\n end",
"title": ""
},
{
"docid": "5742cbfe7d4f2e1cc32f779267f42fc1",
"score": "0.50554234",
"text": "def validations_for(klass)\n validations[klass] ||= []\n end",
"title": ""
},
{
"docid": "691df2abbd76a5dd9023fb8b7e03b791",
"score": "0.50464284",
"text": "def aliases!\n @validators.keys.find_all { |key| @validators[key].is_a? ::Symbol }\n end",
"title": ""
},
{
"docid": "5b9bfbaf93ec2403a17b3927a510bfdd",
"score": "0.50453585",
"text": "def delegated_policies\n @delegated_policies ||= self.class.delegations.transform_values do |block|\n new_subject = instance_eval(&block)\n\n # never delegate to nil, as that would immediately prevent_all\n next if new_subject.nil?\n\n policy_for(new_subject)\n end\n end",
"title": ""
},
{
"docid": "fe406f0ed77252b15811d7fddb5e77c1",
"score": "0.5039773",
"text": "def requireds\n\t\tHash[ select {|i,f| f.required? } ]\n\tend",
"title": ""
},
{
"docid": "1510f61be7b7cb041177c94a4af74488",
"score": "0.502879",
"text": "def none(&block)\n @validators <<\n if block_given?\n val = ValidatorBuilder.new(self, @options, &block)\n ->(obj) { val.validators.map { |v| v.call(obj) }.none? }\n else\n ANY\n end\n end",
"title": ""
},
{
"docid": "d1617648a55664d4465068beb2f14a96",
"score": "0.5013783",
"text": "def any(&block)\n @validators <<\n if block_given?\n val = ValidatorBuilder.new(self, @options, &block)\n @keys << val.keys\n ->(obj) { val.validators.map { |v| v.call(obj) }.any? }\n else\n ANY\n end\n end",
"title": ""
},
{
"docid": "e5c165740eaa844a6917158bd695cbc5",
"score": "0.5011666",
"text": "def validate\n self.class.validations.each do |(method, args, opts)|\n send(method, *args) if !opts[:if] || instance_exec(&opts[:if])\n end\n end",
"title": ""
},
{
"docid": "be2cdbc57a0b0786d130f0570549d52f",
"score": "0.50100327",
"text": "def validations_for_path\n []\n end",
"title": ""
},
{
"docid": "5541d32fd7a23dab8da8f78451e24676",
"score": "0.5002848",
"text": "def reflect_on_validations_for(attr_name)\n self.reflect_on_all_validations.select do |reflection|\n reflection.name == attr_name.to_sym\n end\n end",
"title": ""
},
{
"docid": "d6ace734c91ab6baa83d57b14fe0f313",
"score": "0.49975792",
"text": "def validate\n return [] unless country_data\n applicable_keys = country_data[PhoneData::VALIDATIONS].reject { |key, _value| KEYS_TO_SKIP.include?(key) }\n applicable_keys.map do |phone_type, validations|\n full = \"^(#{validations[PhoneData::VALID_PATTERN]})$\"\n phone_type.to_sym if normalized_number =~ Regexp.new(full)\n end.compact\n end",
"title": ""
},
{
"docid": "0f32635234b3b931406dfc239d1be30e",
"score": "0.4991328",
"text": "def valid_policy\n double validate!: nil, validate: double(valid?: true, invalid?: false)\nend",
"title": ""
},
{
"docid": "4940478bc51f2ff924203a43510bc806",
"score": "0.49892905",
"text": "def find_all_resources options\n policy_scope(resource_class)\n end",
"title": ""
},
{
"docid": "d446db8983a2bfe62b7ea66003958d25",
"score": "0.49867654",
"text": "def _validation_errors()\n errors = []\n @flows.each_value { |f| errors += f._validation_errors() }\n errors\n end",
"title": ""
},
{
"docid": "33825ef3c9c876b6f23d792f1ea88625",
"score": "0.49864084",
"text": "def partition_validations\n @post_load_validations = @validations.select(&:deferred?)\n @pre_load_validations = @validations.reject(&:deferred?)\n end",
"title": ""
},
{
"docid": "6847884a2dd74521f72264c77a414eef",
"score": "0.49675053",
"text": "def validate\n [perform_validation].flatten.compact\n end",
"title": ""
},
{
"docid": "c4435f33c98e5c9ffdd2fb471801b4dc",
"score": "0.49578357",
"text": "def validations\n {\n 'Plan' => {\n 'Name' => 'string'\n },\n 'Company' => {\n 'Name' => 'string'\n }\n }\n end",
"title": ""
},
{
"docid": "3f0c22189bef3fd7769c43f6e9ce1db7",
"score": "0.495184",
"text": "def determine_useful_validations\n useful_checks = [\n useful_validations_for_qrda_type,\n useful_validations_for_measure_type\n # TODO: Add useful_validations_for_performance_rate\n ]\n useful_checks.inject(:&)\n end",
"title": ""
},
{
"docid": "6073c551d9e7cb5e9e4e2c7b292c693b",
"score": "0.49415013",
"text": "def validator(*states)\n @validator ||= if superclass.respond_to? :validator\n superclass.validator.clone\n\n else\n validator_klass =\n if states[0].is_a? Class and states[0] <= NotNaughty::Validator\n states.shift\n else\n NotNaughty::Validator\n end\n \n validator_klass.new(*states)\n end\n end",
"title": ""
},
{
"docid": "6f8fee872b3443305e1369595c783840",
"score": "0.49398056",
"text": "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end",
"title": ""
},
{
"docid": "9a7532907c69654aec9a4c77b9a9893c",
"score": "0.49268067",
"text": "def validate_signers\n signers.map(&:valid?)\n end",
"title": ""
},
{
"docid": "5c9a295a5311f9a00d3857dc1dd32d97",
"score": "0.49185118",
"text": "def validate_ownership\n buyer_items.each { |item| item.validate_owner seller }\n seller_items.each { |item| item.validate_owner buyer }\n end",
"title": ""
},
{
"docid": "8b25b6d504dff503008b920cfc8bb6a0",
"score": "0.49168763",
"text": "def get_validations(model)\n validators = model._validate_callbacks.map {|callback| callback.raw_filter} # Gives the Validators or the symbols (name of model defined validation methods) \n validators.delete_if {|x| x.to_s.include? \"ActiveModel::Validations\"} # We only want custom validation methods\n model_method_names = validators.collect {|x| if x.class == Symbol then x end } # example would be :validate_month\n model_method_names.delete_if{|x| x == nil }\t\t\t\t\t \n validators.delete_if {|x| x.class == Symbol } \t\t\t\t # separating the model validations and the validator validations\n methods = validators.map{ |validator| validator.class.instance_method(:validate) } # -----/\n model_method_names.each do |def_name| methods << model.instance_method(def_name) end # Building array of UnboundMethods -----/ \n return methods\n end",
"title": ""
},
{
"docid": "5db1c10bca7ef155f71a982828ca900e",
"score": "0.49135637",
"text": "def token_issuance_policies\n return @token_issuance_policies\n end",
"title": ""
},
{
"docid": "7781ef11e92f8145cc3329396da7aeb9",
"score": "0.4903884",
"text": "def policy_classes\n fetch_policies! unless @fetched\n @policy_classes\n end",
"title": ""
},
{
"docid": "dde52976d33d7e24c6cfd025cf3ebb5e",
"score": "0.4892011",
"text": "def intended_policies\n return @intended_policies\n end",
"title": ""
},
{
"docid": "df1b8f026ba111f4a29d5d3e67310db2",
"score": "0.48685333",
"text": "def valid_children\n allowed_children_and_descendants.select {|child| child.allowed_parent?(self)}\n end",
"title": ""
},
{
"docid": "2142aae31de365cbde4e59648ec86f20",
"score": "0.48683318",
"text": "def validate\n validate_root\n validate_associated\n valid?\n end",
"title": ""
},
{
"docid": "188b7a36cba471570746fcdcb751dccb",
"score": "0.48635566",
"text": "def restrictions\n return @restrictions\n end",
"title": ""
},
{
"docid": "dd6e94cd7b579d4c83d6666892388ace",
"score": "0.4862621",
"text": "def errors\n self.class.validator.call self\n end",
"title": ""
},
{
"docid": "e9e73c310714aaa848bb2fc70ffed7f8",
"score": "0.48619908",
"text": "def requirements\n []\n end",
"title": ""
},
{
"docid": "fd18befb80b8c0aca53e54a148e885f9",
"score": "0.48604277",
"text": "def warnings\n @validator ? @validator.warnings : []\n end",
"title": ""
},
{
"docid": "d0f647dd10e987b16fb22a03ea838e39",
"score": "0.4857368",
"text": "def rules\n return @rules\n end",
"title": ""
},
{
"docid": "584e53f171fec2bba6efd494c5c8a096",
"score": "0.48568204",
"text": "def rules\n rule_applier.rules\n end",
"title": ""
},
{
"docid": "2dbfa7b4c85ebc5ce9c781f3f6875b5e",
"score": "0.4854006",
"text": "def validate(validator, *args); validation_chain.validate(validator, *args); end",
"title": ""
},
{
"docid": "375950b6de53433b7d1ec1def3214c63",
"score": "0.48386452",
"text": "def validator\n validators.fetch(options[current_option_key])\n end",
"title": ""
},
{
"docid": "0fbfa245df3e06cb3385165670ae2262",
"score": "0.48269555",
"text": "def validate(*values)\n values.all?{|val| @validators.any?{|validator| validator.validate(val)}}\n end",
"title": ""
},
{
"docid": "016604526c4352f12e7abb84f1d7c79c",
"score": "0.48264354",
"text": "def validation_errors\n errors = []\n ErrorCompiler.with_errors(errors) do |e|\n check_schools_consistency_in_each_round(e)\n check_legitimate_progress_through_rounds(e)\n check_wildcards(e)\n end\n errors\n end",
"title": ""
},
{
"docid": "23ff3a8c01d531deebf6f15b2c3a3b96",
"score": "0.4823765",
"text": "def rules_for(table)\n by_string, ages = rules_by_string(table, [])\n by_regexp, ages = rules_by_regexp(table, ages)\n for_all, ages = rules_for_all(table, ages)\n\n valid_rules = by_string + by_regexp + for_all\n valid_rules.sort { |a, b| b[:age] <=> a[:age] }\n end",
"title": ""
},
{
"docid": "281918be3958f82f3597b41e07576833",
"score": "0.48231378",
"text": "def validate()\n\t\trules.values.each do |aRule|\n\t\t\tsubrule_invokations = aRule.all_actions.select { |act| act.kind_of?(ApplySubrule) }\n\t\t\tsubrule_invokations.each do |invokation|\n\t\t\t\traise LexerRuleError, \"Reference to unknown subrule '#{invokation.rulename}' in rule '#{aRule.name}'.\" unless rules.has_key? invokation.rulename\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5e2e3f968c1005f40237b3ab72c8e3ab",
"score": "0.48160496",
"text": "def validate_me(validator)\n validator.validate self, checks\n end",
"title": ""
},
{
"docid": "212b1633b2a05b29f1bf7180dff53ee2",
"score": "0.48127243",
"text": "def exercise1\n parse_data MinMaxValidator\n validators.count(&:valid?)\n end",
"title": ""
},
{
"docid": "dc3af7f213afdbe3d32af58791a64c97",
"score": "0.48024857",
"text": "def validate\n begin\n validatable_rules.map{ |k, v| self.send(\"validate_\" + k.to_s) }\n rescue Errors::ValidationError => e\n raise decorate_error e\n end\n end",
"title": ""
},
{
"docid": "377cff24473d2bc8376f3517335c48ed",
"score": "0.48013905",
"text": "def validates_acceptance_of(*fields)\n validators.add(AcceptanceValidator, *fields)\n end",
"title": ""
},
{
"docid": "b5c8df81ba5a824f40ac01cd38925690",
"score": "0.48002788",
"text": "def process_validates validator\n hash_arg = validator.last\n return unless hash? hash_arg\n\n value = hash_access(hash_arg, FORMAT)\n\n if hash? value\n value = hash_access(value, WITH)\n end\n\n if value\n check_regex value, validator\n end\n end",
"title": ""
},
{
"docid": "d1410e3f7630d2103ca3d257297459fc",
"score": "0.4792798",
"text": "def submission_errors\n execution_errors.select do |execution_error|\n true if execution_error.has_attribute?('validator_type') && execution_error[:validator_type] == :submission_validation\n end\n end",
"title": ""
},
{
"docid": "0ddaa895e27bc8b9436ea52182e082ef",
"score": "0.4785817",
"text": "def validates_each(*attributes, &block)\n validator.add_validation(*attributes, &block)\n end",
"title": ""
},
{
"docid": "0ddaa895e27bc8b9436ea52182e082ef",
"score": "0.4785817",
"text": "def validates_each(*attributes, &block)\n validator.add_validation(*attributes, &block)\n end",
"title": ""
},
{
"docid": "be75c3aa1c7c3fad1e08425fce1d3573",
"score": "0.47786954",
"text": "def requirements\n []\n end",
"title": ""
},
{
"docid": "3de1efbb66f8dfd0f4e295dd3845d833",
"score": "0.4763557",
"text": "def validate(init)\n if init.has_key?('configSets')\n check_config_sets(init)\n end\n init.each do |config,config_data|\n next if config == 'configSets'\n context config do\n compare(config_data, $types)\n end\n end\nend",
"title": ""
},
{
"docid": "ae4119c37ee599165f09bcae1ce13f6e",
"score": "0.47602588",
"text": "def each_path_validation\n return enum_for(__method__) unless block_given?\n\n @node.xpath('pathValidation').each do |element|\n yield PathValidation.new(element)\n end\n end",
"title": ""
},
{
"docid": "c48eb6c1d28454af8f61e6f5395df820",
"score": "0.47530374",
"text": "def validator; end",
"title": ""
},
{
"docid": "6ad43d45bdb6f89ae9f3a3d28c6157c7",
"score": "0.4734335",
"text": "def min_max_validator\n validators&.find { |validator| validator.is_a? validator_class }\n end",
"title": ""
}
] |
8fdaa50b2f1c510d67043e3799ba3dc1
|
GET /ariaquenuploads/1 GET /ariaquenuploads/1.json
|
[
{
"docid": "fd92c49a8bd72b260c687c34f34421f5",
"score": "0.7069001",
"text": "def show\n @ariaquenupload = Ariaquenupload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ariaquenupload }\n end\n end",
"title": ""
}
] |
[
{
"docid": "8e84a874ed433cea5f483d9302e2715e",
"score": "0.727587",
"text": "def show\n @upload = @event.uploads.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "367d7883137e5534896e49afdc10bcdb",
"score": "0.70499027",
"text": "def show\n @upload = @posting.uploads.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "fbb15a8743a75f27d4ab3fb86aa97736",
"score": "0.70212686",
"text": "def index\n @user = current_user\n @uploads = current_user.uploads\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "757ce74790ef6bb148e5145af308bdc3",
"score": "0.70197767",
"text": "def index\n @uploads = @event.uploads\n\n respond_to do |format|\n format.html\n format.json { render json: @uploads.map{|upload| upload.to_jq_upload } }\n end\n end",
"title": ""
},
{
"docid": "e85f02b948b6a9d5aa16595576f4fcb0",
"score": "0.70132244",
"text": "def index\n @uploads = @posting.uploads\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "d025213e83e4bce8025c738ce734ac17",
"score": "0.7012688",
"text": "def upload id\n get_request \"uploads/#{id}\"\n end",
"title": ""
},
{
"docid": "eaeffdc70c8fde34c3e025258955ee28",
"score": "0.6978407",
"text": "def index\n @uploads = Upload.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: { files: @uploads.map{|upload| upload.to_jq_upload } } }\n end\n end",
"title": ""
},
{
"docid": "c8061a5b02ab4947d71e5158c0323662",
"score": "0.6901337",
"text": "def index\n begin\n @user = User.find(params[:user_id])\n @uploads = @user.uploads\n rescue\n @uploads = Upload.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "b1d6389fc79c71cc0d46b4c5bfb700f1",
"score": "0.68865997",
"text": "def index\n @uploads = Upload.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "b1d6389fc79c71cc0d46b4c5bfb700f1",
"score": "0.68865997",
"text": "def index\n @uploads = Upload.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "62c41299f3dd7071176edde163ba7818",
"score": "0.6831266",
"text": "def list_floor_plans \n get(\"/files.json/floorplan/images\")\nend",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "d44bf25ef8d0dd6f4e8cdf736f297669",
"score": "0.6735035",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "dca085ddc27f9d50f218d94c6c1f7f07",
"score": "0.6700616",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "a439b79dd40d4033f97e30e567c74431",
"score": "0.66537505",
"text": "def index\n @roof = Roof.find(params[:roof_id])\n @photos = @roof.photos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos.where(:user_id => current_user._id).collect { |p| p.to_jq_upload }.to_json }\n #format.json { render json: @photos }\n end\n end",
"title": ""
},
{
"docid": "fd1d55b003d07c1689c0f3da710829fe",
"score": "0.66219944",
"text": "def index\n render :json =>{ files: Upload.all }.to_json\n end",
"title": ""
},
{
"docid": "0d7177dbab75d9a300cfc7eb95706702",
"score": "0.6618924",
"text": "def show\n @file_upload = FileUpload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @file_upload }\n end\n end",
"title": ""
},
{
"docid": "0d7177dbab75d9a300cfc7eb95706702",
"score": "0.6618924",
"text": "def show\n @file_upload = FileUpload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @file_upload }\n end\n end",
"title": ""
},
{
"docid": "1f6bb467e5aa2a274bedd65deb94cc0b",
"score": "0.6613569",
"text": "def index\n if params.has_key?(:album_id)\n album = Album.find(params[:album_id])\n @multiuploads = album.multiuploads\n else\n @multiuploads = Multiupload.all\n end\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @multiuploads.map{|multiupload| multiupload.to_jq_upload } }\n end\n end",
"title": ""
},
{
"docid": "9ac9d8d6b6fa9c0108ddeb494284f382",
"score": "0.6601252",
"text": "def index\n @admin_photos = @login_user.photos.order(\"created_at DESC\").page(params[:page]).per(18)\n # respond_to do |format|\n # format.json { render :json => @admin_photos.collect { |p| p.to_jq_upload }.to_json }\n # end\n \n end",
"title": ""
},
{
"docid": "98133c828f081e784038507e6753cadb",
"score": "0.65964705",
"text": "def show\n @uploaded_file = UploadedFile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uploaded_file }\n end\n end",
"title": ""
},
{
"docid": "83eeb31271988afd60178f126a3bc4cd",
"score": "0.65271914",
"text": "def show\n @imageupload = Imageupload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @imageupload }\n end\n end",
"title": ""
},
{
"docid": "195e56d984345776287e917c7bfcb0e7",
"score": "0.6524495",
"text": "def index\n @uploaded_files = UploadedFile.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploaded_files }\n end\n end",
"title": ""
},
{
"docid": "da194d8d7722f21045448f59a692362a",
"score": "0.6519338",
"text": "def index\n\n #load current_user's folders\n @directories = current_user.directories.order(\"name desc\")\n\n @cloud_files = current_user.cloud_files.order(\"name desc\")\n # este es para crear un archivo nuevo en el form\n @cloud_file = CloudFile.new\n\n ## para subir archivos en S3\n @uploader = CloudFile.new.avatar\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cloud_files }\n end\n end",
"title": ""
},
{
"docid": "9a9f6a979c8228c8355526dfdb735043",
"score": "0.6516846",
"text": "def show\n @multiupload = Multiupload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @multiupload }\n end\n end",
"title": ""
},
{
"docid": "86c97b5da2176c865d8a78f6ab83c5e2",
"score": "0.65154827",
"text": "def index\n @uploads = current_user.purchase_uploads\n filter_uploads\n respond_to do |format|\n format.html\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "f9d1eebe51c0cc7d6074d55b3b79211e",
"score": "0.65100956",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guide_story_photos.map{|upload| upload.to_jq_upload } }\n end\n end",
"title": ""
},
{
"docid": "ed49a2be98c8e763a9d5dcf69449bf37",
"score": "0.65071684",
"text": "def as_file_upload\n as_json(:only=>[:id, :graveyard_id, :user_id, :caption, :sort_order]).merge({\n name: upload_file_name,\n size: upload_file_size,\n url: path.virtual,\n thumbnailUrl: thumbnail_path.virtual,\n deleteType: 'DELETE',\n deleteUrl: \"/photos/#{id}\"\n })\n end",
"title": ""
},
{
"docid": "c61c5d8a1dfea085f75dda71f2c0e295",
"score": "0.6487691",
"text": "def myphotos\n @uploads = current_user.uploads\n filter_uploads\n respond_to do |format|\n format.html\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "b0f2cb6ce352ca72d6eb9468995a9ae4",
"score": "0.648643",
"text": "def peek_uploads(base, cookie)\r\n\t\tres = send_request_raw({\r\n\t\t\t'method' => 'GET',\r\n\t\t\t'uri' => \"#{base}mods/documents/uploads/\",\r\n\t\t\t'cookie' => cookie\r\n\t\t})\r\n\r\n\t\treturn res\r\n\tend",
"title": ""
},
{
"docid": "ae78694640ba1cad9e139fc5021235ec",
"score": "0.6458496",
"text": "def show\n @upload = Upload.user_find(current_user,params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end",
"title": ""
},
{
"docid": "59e1a3b257ef57632b5508053c22a970",
"score": "0.64370906",
"text": "def show\n @uploader = Uploader.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uploader }\n end\n end",
"title": ""
},
{
"docid": "1b5b72fd907cb6fe3a1b0516ce1ab2e8",
"score": "0.64353853",
"text": "def index\n @song_uploads = SongUpload.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @song_uploads }\n end\n end",
"title": ""
},
{
"docid": "55738e9a860ebf3c4b71616bf3a2129d",
"score": "0.6434848",
"text": "def api_json\n {\n id: id,\n name: file_set\n }\n end",
"title": ""
},
{
"docid": "152a333e5fa0093358f545f3e6533a7b",
"score": "0.6432369",
"text": "def index\n if params[:price_id].to_i > 0\n @uploads = Price.find(params[:price_id]).uploads.viewable_by(current_user).to_a\n else\n @uploads = Upload.viewable_by(current_user).to_a.paginate\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads.map{|upload| upload.to_jq_upload(current_user) } }\n end\n end",
"title": ""
},
{
"docid": "9583890f0f1495f21e473aca3b2b0f7a",
"score": "0.6417091",
"text": "def show\n @upload_pic = UploadPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload_pic }\n end\n end",
"title": ""
},
{
"docid": "f2e93396c87e3b5a901040f28aa5e3bf",
"score": "0.6409875",
"text": "def index\n @uploads = current_user.favorite_uploads\n filter_uploads\n respond_to do |format|\n format.html\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "32cbd80a756fe680e5ffa4f55b163f22",
"score": "0.6409346",
"text": "def get_files\n entries = params[:home][:_json]\n @chrome_user.user_latest_uploads.present? ? @chrome_user.user_latest_uploads.delete_all : \"\"\n entries.each do |entry|\n puts entry\n @chrome_user.user_latest_uploads.create!(file_name: entry)\n end \n render json: {\"success\" => true}\n end",
"title": ""
},
{
"docid": "e23a2bf3e5403a42e4e3725a579ad3b5",
"score": "0.63653",
"text": "def images\n @images = @event.uploads.where(:upload_content_type => [\"image/png\", \"image/gif\", \"image/jpe\", \"image/jpeg\"])\n\n respond_to do |format|\n format.json { render json: @images.map{|image| image.to_redactor_img } }\n end\n\n end",
"title": ""
},
{
"docid": "935ca960d9ce497614fdb378b4386ba7",
"score": "0.6360984",
"text": "def index\n @user_song_uploads = UserSongUpload.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_song_uploads }\n end\n end",
"title": ""
},
{
"docid": "f524fd14fe89a7f833a1426b81a5ca3f",
"score": "0.63566756",
"text": "def images\n @images = @user.uploads.images.paginate(:page => @page, :per_page => @per_page, :order => 'created_at desc')\n respond_to do |format|\n format.js { render :json => basic_uploads_json(@images) }\n end\n end",
"title": ""
},
{
"docid": "68862d45debecf762e33158776db2329",
"score": "0.63565475",
"text": "def index\n authorize! :read, AssignmentUpload\n\n if !params.has_key?(:assignment_id) || !params.has_key?(:user_id)\n redirect_to root_path and return # TODO: Render error page instead\n end\n\n @uploads = AssignmentUpload.where(:assignment_id => params[:assignment_id], :user_id => params[:user_id])\n\n respond_to do |format|\n format.json { render json: @uploads.map{|upload| upload.to_jq_upload } }\n end\n end",
"title": ""
},
{
"docid": "5d88c9da2c1583e11a311869aa4cb617",
"score": "0.63558024",
"text": "def index\n @uploads = Upload.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @uploads }\n format.json { render :json => @uploads }\n end\n end",
"title": ""
},
{
"docid": "9313b9794b6bf5754bca3ff63f8a4459",
"score": "0.63496196",
"text": "def get_upload_url\n url_service = UploadUrlFetcher.new(@context, unsafe_params[:id])\n\n result = url_service.fetch_url(unsafe_params)\n\n render json: result\n end",
"title": ""
},
{
"docid": "2fb9e0d837afbb16d2a84dc4205694b2",
"score": "0.633147",
"text": "def index\n @photos = LocationPhoto.page(params[:page]).per(24)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos.map{|upload| upload.to_jq_upload } }\n end\n end",
"title": ""
},
{
"docid": "3b6a66e2c755da246b395d603284b322",
"score": "0.63080585",
"text": "def project_uploads(project_id, query={})\n perform_get(\"/api/1/projects/#{project_id}/uploads\", :query => query)\n end",
"title": ""
},
{
"docid": "937d7dd7f170620f4b6c355860899019",
"score": "0.6307462",
"text": "def show\n @company_avatar = CompanyAvatar.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @company_avatar.to_jq_upload }\n end\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "08fb249f7c8ac7ba6416e89295fa56ce",
"score": "0.6271901",
"text": "def index\n @uploads = Upload.all\n end",
"title": ""
},
{
"docid": "b8e4961b93161d6a79ba6df049d7c2e5",
"score": "0.6271674",
"text": "def show_upload\n @storage = current_user.storages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "ab26e033bdb38dae99f798c8763aa301",
"score": "0.6249776",
"text": "def show\n @upload = Upload.find(params[:id])\n directory = \"uploads/#{@upload.workobject_id}\"\n directory = \"uploads_task/#{@upload.task_id}\" unless @upload.task_id.nil?\n directory = \"uploads_contract/#{@upload.contract_id}\" unless @upload.contract_id.nil?\n path = File.join(directory, @upload.filename)\n send_file path, :type => \"Content-Type\", :disposition => 'attachment; filename='+@upload.filename\n\n# respond_to do |format|\n# format.html # show.html.erb\n# format.json { render json: @upload }\n# end\n end",
"title": ""
},
{
"docid": "2dbe0f9066a852df788e3f028d9a72db",
"score": "0.62274677",
"text": "def index\n current_page = params[:page]\n per_page = params[:per_page] || 10 # could be configurable or fixed in your app\n @uploads = Upload.where(:user_id => current_user.id).order(:upload_type, :upfile_file_name).paginate({:page => current_page, :per_page => per_page})\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @uploads }\n format.json { render json: @uploads.map{|upload| upload.to_jq_upload } }\n format.js { render json: @uploads.map{|upload| upload.to_jq_upload } }\n end\n end",
"title": ""
},
{
"docid": "e6c63bd6dc2756cfc53e498512b68389",
"score": "0.6226577",
"text": "def show\n @upload = Upload.find(params[:id])\n directory = \"uploads/#{@upload.workobject_id}\"\n directory = \"uploads_task/#{@upload.task_id}\" unless @upload.task_id.nil?\n path = File.join(directory, @upload.filename)\n send_file path, :type => \"Content-Type\", :disposition => 'attachment; filename='+@upload.filename\n\n# respond_to do |format|\n# format.html # show.html.erb\n# format.json { render json: @upload }\n# end\n end",
"title": ""
},
{
"docid": "f68526e2cba4f93440a9c566579b7243",
"score": "0.62254363",
"text": "def video_upload_path\n render json: TudouClient.video_upload_path\n end",
"title": ""
},
{
"docid": "7057ffdd5a487e329dd7324e94bf5a38",
"score": "0.62190855",
"text": "def new\n @ariaquenupload = Ariaquenupload.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ariaquenupload }\n end\n end",
"title": ""
},
{
"docid": "074696aed60b185fb048b845295f9831",
"score": "0.6202181",
"text": "def show\n @song_upload = SongUpload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @song_upload }\n end\n end",
"title": ""
},
{
"docid": "573f0472b38e9e90d7d1a9483ca9dd56",
"score": "0.61907476",
"text": "def show\n @fieldtrip = Fieldtrip.find(params[:id])\n # @observations = Observation.\n @corals = Coral.all\n\n @files = Dir.glob(\"app/assets/images/tagged_raw_thumbs/*\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fieldtrip }\n end\n end",
"title": ""
},
{
"docid": "2e340d3681e26c6be5969ad008434ff0",
"score": "0.6181627",
"text": "def index\n @pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @pictures.collect { |p| p.to_jq_upload }.to_json }\n format.xml { render :xml => @pictures.collect { |p| p.to_jq_upload }.to_xml }\n end\n end",
"title": ""
},
{
"docid": "eefcff203fb371af44f082d6808dbab4",
"score": "0.61778516",
"text": "def index\n @upload_photos = UploadPhoto.all\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"title": ""
},
{
"docid": "006c2d8762089f6f000a074b7b493746",
"score": "0.61764354",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @purchase.upload }\n end\n end",
"title": ""
},
{
"docid": "2bf14bbd39d50da78916084466144713",
"score": "0.6160855",
"text": "def index\n @media_files = MediaFile.all\n render json: @media_files\n end",
"title": ""
},
{
"docid": "8171deb016576e4b853db2eb229df0a3",
"score": "0.615932",
"text": "def index\n @files = current_user.uploads\n @files = Upload.by_user(current_user)\n end",
"title": ""
},
{
"docid": "5fced192c8cb20865dfd68b8b423de6c",
"score": "0.6142913",
"text": "def index\n render json: Pic.all\n end",
"title": ""
},
{
"docid": "eaf17d8753a562db16fac1fba7fb2d67",
"score": "0.61249954",
"text": "def index\n @image_files = ImageFile.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @image_files }\n end\n end",
"title": ""
},
{
"docid": "d05ac5c56d6a01b02a10c66c526f3cff",
"score": "0.61201495",
"text": "def index #:nodoc:\n @data_file = Mokio::DataFile.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_file.map{|upload| upload.to_jq_upload } }\n end\n end",
"title": ""
},
{
"docid": "2443e3fe5f8fd9561e6c63de95a271e3",
"score": "0.61174446",
"text": "def aws_uploads\n render json: {\n policy: aws_s3_upload_policy_document,\n signature: aws_s3_upload_signature,\n key: params[:doc][:directory] + \"/\" + params[:doc][:filename],\n success_action_redirect: \"/\"\n }\n end",
"title": ""
},
{
"docid": "bdc61849bde8f036eef831c468a0d54a",
"score": "0.6110978",
"text": "def index\n @uploads = Upload.where(nil)\n filter_uploads\n respond_to do |format|\n format.html {\n if current_user\n @favorites = current_user.favorite_uploads\n @purchases = current_user.purchase_uploads\n end\n }\n format.json { render json: @uploads }\n end\n end",
"title": ""
},
{
"docid": "4cf90a0cd44d2f9e82d69f89cadc2dbd",
"score": "0.6104274",
"text": "def show\n @ufile = Ufile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ufile }\n end\n end",
"title": ""
},
{
"docid": "e743890360070377238d4895094bc8f9",
"score": "0.61004186",
"text": "def index\n @uploads = Upload.all\nend",
"title": ""
},
{
"docid": "9d3af69fcd4e2f72b57169f02c54a5b8",
"score": "0.6099367",
"text": "def show\n render_json_for_api @filepath\n end",
"title": ""
},
{
"docid": "9d3af69fcd4e2f72b57169f02c54a5b8",
"score": "0.6099367",
"text": "def show\n render_json_for_api @filepath\n end",
"title": ""
},
{
"docid": "e4eec739b5254367b0b7bd796f37796a",
"score": "0.60920805",
"text": "def show\n @ss_coral = SsCoral.find(params[:id])\n @fieldtrips = Fieldtrip.all\n\n @files = Dir.glob(\"/Users/jmadin/Dropbox/web/trimodal/size_structure_thumbs/*\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ss_coral }\n end\n end",
"title": ""
},
{
"docid": "e0759ac816b2194ece7fbc39561e1e68",
"score": "0.60866785",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_with(@upload)\n end",
"title": ""
},
{
"docid": "b4636831fcbbc4e4b0ef97377718a595",
"score": "0.6079109",
"text": "def index\n @creative = Creative.find(params[:creative_id])\n @pictures = @creative.pictures.load\n @picture = Picture.new\n\n respond_to do |format|\n format.html # index.html.erb\n # format.json { render json: @pictures }\n format.json { render json: @pictures.map{|pic| pic.to_jq_download } }\n end\n end",
"title": ""
},
{
"docid": "41c22011a15b077d84ea580197ca2fcf",
"score": "0.60749733",
"text": "def show_files\n @uploads = resource.latest_file_states\n respond_to { |format| format.js }\n end",
"title": ""
},
{
"docid": "8aaa2a3aea0cda8b33d431d4a6a0810f",
"score": "0.60684747",
"text": "def show\n @cloud_file = current_user.cloud_files.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cloud_file }\n end\n end",
"title": ""
},
{
"docid": "4ed70082b013ba0655d582a80f474a5b",
"score": "0.6068429",
"text": "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @upload }\n format.json { render :json => @upload }\n end\n end",
"title": ""
},
{
"docid": "9825152b1baab6428ad72662248af2b6",
"score": "0.60669684",
"text": "def uploads\n self.user.uploads.where(:client_id => self.id.to_s)\n end",
"title": ""
}
] |
372434b86f8a86b3a8daf4cd21a9953e
|
Override this to configure the incoming email address
|
[
{
"docid": "10c4f6bd3a7920be6fbd93b013a7eebd",
"score": "0.7179087",
"text": "def incoming_email_address\n Integral::Settings.contact_email\n end",
"title": ""
}
] |
[
{
"docid": "324f140ac84525b2a60a333fdc072939",
"score": "0.7345379",
"text": "def initialize_email\n with_config do |config, _|\n @email_to = config[\"email\"][\"to\"] rescue nil\n end\n end",
"title": ""
},
{
"docid": "a45d84a4e22d2bafc0c4ea619dd938cf",
"score": "0.7014237",
"text": "def setup_email_for_email_address(e, sent_at = Time.current)\n\t\tsetup_email(e.email, e.name, sent_at)\n\t\t@body[:email_address] = e\n\tend",
"title": ""
},
{
"docid": "2905159ff898ff997d75f08018a2d106",
"score": "0.68805546",
"text": "def casein_config_email_from_address\n \"instapost@rcode5.com\"\n end",
"title": ""
},
{
"docid": "4c164fbd4781c65f5c9847e7febe3ba5",
"score": "0.67628825",
"text": "def reply_to_email_address=(value)\n unless value.nil?\n if value.kind_of?(EmailAddress)\n @reply_to_email_address = value\n elsif value.kind_of? String\n @from_email_address = EmailAddress.new(value)\n else\n raise StandardError(\"Invalid type for reply_to_email_address, type of 'EmailAddress' or 'String' was expected\")\n end\n end\n end",
"title": ""
},
{
"docid": "d48b165c1d7b9dff586da6b271b9f2f0",
"score": "0.67195606",
"text": "def apply_to_action_mailer(klass=ActionMailer::Base)\n klass.smtp_settings = smtp_config\n\n email_opts = email_config\n klass.default_options = email_config.select { |k,v| %i(from reply_to).include?(k) }\n\n uri = URI.parse(email_opts[:base_url]) rescue nil\n if uri\n host_with_port = uri.host\n host_with_port += \":#{uri.port}\" unless uri.port == uri.default_port\n klass.default_url_options = {\n host: host_with_port,\n protocol: uri.scheme,\n }\n end\n end",
"title": ""
},
{
"docid": "c0995e4f965e4f27422094f94833b291",
"score": "0.67137474",
"text": "def kryptonite_config_email_from_address\n \t\t'donotreply@kryptonitecms.com'\n \tend",
"title": ""
},
{
"docid": "f8d12ca785dd2109ec7e05e58917913e",
"score": "0.6697552",
"text": "def smtp_envelope_to=(val); end",
"title": ""
},
{
"docid": "edf6a7977b2bb8caaba9a3000d47f04a",
"score": "0.6665512",
"text": "def recipient_email_address=(value)\n @recipient_email_address = value\n end",
"title": ""
},
{
"docid": "869bed100560662e2841ffb2686823ff",
"score": "0.6615288",
"text": "def email_config\n @email_config || Service.email_config\n end",
"title": ""
},
{
"docid": "9fdb51048b25a1f6ad1e3e1dafbc58aa",
"score": "0.6615172",
"text": "def email=(str)\r\n self['email'] = self.class.base_email(str)\r\n end",
"title": ""
},
{
"docid": "115b31aa6a2a6163558304d4f15076fc",
"score": "0.66088176",
"text": "def outgoing_email_address\n Integral::Settings.contact_email\n end",
"title": ""
},
{
"docid": "1181973d23295adf67f845d3c854817c",
"score": "0.65992844",
"text": "def from_email_address=(value)\n unless value.nil?\n if value.kind_of? EmailAddress\n @from_email_address = value\n elsif value.kind_of? String\n @from_email_address = EmailAddress.new(value)\n else\n raise StandardError(\"Invalid type for reply_to_email_address, type of 'EmailAddress' or 'String' was expected\")\n end\n end\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969443",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969414",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969414",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969414",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969414",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969414",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969414",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "7807fe38b78fee3adc585ba6a36a57a8",
"score": "0.65969414",
"text": "def email_address=(value)\n @email_address = value\n end",
"title": ""
},
{
"docid": "c2df95c6d5a9d0df573ebc226e09fd92",
"score": "0.6579678",
"text": "def mailboxer_email ; end",
"title": ""
},
{
"docid": "b230e04114c3df7bf550cac98664a1af",
"score": "0.6562623",
"text": "def smtp_envelope_from=(val); end",
"title": ""
},
{
"docid": "96212015ec21366f7a57fb0a922913ec",
"score": "0.65616435",
"text": "def email\n @email ||= options[:email]\n end",
"title": ""
},
{
"docid": "73825e25fd7fbb4e344d87781368cfa9",
"score": "0.65515494",
"text": "def setup_email\n @from = \"#{APP[:name].capitalize}<no-reply@juscribe.com>\"\n @sent_on = Time.now\n end",
"title": ""
},
{
"docid": "33f8f147ec1c980a2191833b0582d4db",
"score": "0.6549984",
"text": "def sender_email\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b8350178aeb6167660032d5c9193bf18",
"score": "0.6544343",
"text": "def enable_email\n self.recieve_email = true\n end",
"title": ""
},
{
"docid": "02ac0894d22d43b6e14803afe485d1ca",
"score": "0.65252364",
"text": "def set_email_host\n unless ( ActionMailer::Base.default_url_options.has_key?( :host ) )\n ActionMailer::Base.default_url_options[ :host ] = request.host_with_port\n end\n end",
"title": ""
},
{
"docid": "218fa5804753612b503aa791948d9e0e",
"score": "0.6519599",
"text": "def set_contact_email\n @contact_email = 'me(at)geneangelo(dot-com)'\n end",
"title": ""
},
{
"docid": "237d18f568d6a771aefa67cf1fe39e2d",
"score": "0.65119445",
"text": "def setup_email\n self.email = self.user.email if self.user\n end",
"title": ""
},
{
"docid": "8e39885d93c70557df649978ac2840bf",
"score": "0.65026027",
"text": "def mailto=(mail)\n config[\"mailto\"]=mail\n end",
"title": ""
},
{
"docid": "bd03b11dab4692fd22fea0d6ffd57ad7",
"score": "0.64971733",
"text": "def handle_email\r\n self.email = (self.is_faculty ? Faculty.find_by_name(self.faculty_name).email : self.student_email)\r\n end",
"title": ""
},
{
"docid": "6eaab51e1b82687754a5deed6c5fc4db",
"score": "0.64925545",
"text": "def receiver_email\n Rails.configuration.x.contact_email\n end",
"title": ""
},
{
"docid": "7746a75461ee0b65d423f1c6d808f501",
"score": "0.649203",
"text": "def email_address=(val)\n super(val.strip)\n end",
"title": ""
},
{
"docid": "ffb7e7415a54c4e9196daf0906110663",
"score": "0.6462151",
"text": "def set_mail_url\n UserMailer.default_url_options[:host] = request.host_with_port\n end",
"title": ""
},
{
"docid": "e3ef66cfadfe6a4a3f4f277abdd555aa",
"score": "0.6460054",
"text": "def email; end",
"title": ""
},
{
"docid": "3505b3bc0560b0b9fbb788986e9244a0",
"score": "0.6447189",
"text": "def email=(_arg0); end",
"title": ""
},
{
"docid": "370ccb146c34120feb4b702c16b534ed",
"score": "0.6434496",
"text": "def reply_to_email_address\n @reply_to_email_address\n end",
"title": ""
},
{
"docid": "b826e2be3997d79531dc045dfca6e9d0",
"score": "0.6413038",
"text": "def from_email_address\n @from_email_address\n end",
"title": ""
},
{
"docid": "fd659ad44f4f0f4e152c44d94da33a9a",
"score": "0.64118266",
"text": "def email\n @email ||= parsed_params['data']['email']\n end",
"title": ""
},
{
"docid": "2df81980d358386fff3c07f768ac4fa1",
"score": "0.6407989",
"text": "def bolt_config_email_from_address\n 'donotreply@toolbox-design.co.uk'\n end",
"title": ""
},
{
"docid": "1d33d94529aa5067e88ba4e3a55d3e00",
"score": "0.63930035",
"text": "def smtp_address\n @attributes[:smtp_address]\n end",
"title": ""
},
{
"docid": "1d33d94529aa5067e88ba4e3a55d3e00",
"score": "0.63930035",
"text": "def smtp_address\n @attributes[:smtp_address]\n end",
"title": ""
},
{
"docid": "edb318d9fca0fbc2731b7cb4e2b2c52e",
"score": "0.63919586",
"text": "def set_SenderEmail(value)\n set_input(\"SenderEmail\", value)\n end",
"title": ""
},
{
"docid": "7ba7ed4cac1bbebd7540630eb714a9d7",
"score": "0.6355716",
"text": "def casein_config_email_from_address\n 'donotreply@caseincms.com'\n end",
"title": ""
},
{
"docid": "30980cda87f4e2edeba13135e14cce8e",
"score": "0.63513285",
"text": "def sender_email=(v)\n @sender_email = validate_email(v, __method__)\n end",
"title": ""
},
{
"docid": "e9273b59e99b2637fa9690bfa62a30e3",
"score": "0.63492006",
"text": "def email_address=(emailAddress)\n @email_address = emailAddress\n end",
"title": ""
},
{
"docid": "ec48636f2badce15e62e95effab90dfe",
"score": "0.6345938",
"text": "def email=(value)\n # This is a stub, used for indexing. The method is dynamically generated.\n end",
"title": ""
},
{
"docid": "541a2d7a4804106a1caac859b6721cef",
"score": "0.6345005",
"text": "def mailto; end",
"title": ""
},
{
"docid": "f0ca8f1796294b299ca652d2e0839ac5",
"score": "0.6341443",
"text": "def after_create\n return unless Settings.email.enable\n Pony.mail :to => Settings.email.to ,\n :from => Settings.email.from ,\n :subject => \"#{author} - #{subject}\" ,\n :body => body ,\n :via => :smtp ,\n :smtp => { :host => Settings.email.host ,\n :port => Settings.email.port ,\n :tls => Settings.email.tls ,\n :user => Settings.email.from ,\n :password => Settings.email.pass ,\n :auth => Settings.email.auth ,\n }\n end",
"title": ""
},
{
"docid": "e75c723a93973b03fcec52e80178dddc",
"score": "0.6340013",
"text": "def incoming_email\n return self.magic_email(\"request-\")\n end",
"title": ""
},
{
"docid": "1edbd9e39993389a5aa94f05466980d5",
"score": "0.6327241",
"text": "def setup_email(recipient_addr)\n #from \"no_reply <#{SMTP_USER}>\" #This generates error!\n from SMTP_USER\n recipients recipient_addr\n sent_on Time.now\n content_type \"text/plain\" #default\n #content_type \"text/html\" #Don't forget to add <br /> tags to the template\n #headers {}\n end",
"title": ""
},
{
"docid": "234cc90f5db52c6e206ea83d3f8666ee",
"score": "0.6325931",
"text": "def set_RequesterEmail(value)\n set_input(\"RequesterEmail\", value)\n end",
"title": ""
},
{
"docid": "2bcb0ef2f3675803eafdc3f029717774",
"score": "0.6302708",
"text": "def email_to; det.form(:name, 'configSmtpEmail').text_field(:id, 'to'); end",
"title": ""
},
{
"docid": "eea08309a970a2f2d54f93fb9a1f7675",
"score": "0.6292416",
"text": "def email\n end",
"title": ""
},
{
"docid": "3ae190d69d0d2dc85b420d7d548c87cb",
"score": "0.62711424",
"text": "def setup_email(user_or_email) #user or guest\n if user_or_email.is_a?(User)\n @recipients = user_or_email.email.to_s\n @body[:user] = user_or_email # auto assign an user\n else\n @recipients = \"#{user_or_email}\"\n end \n \n @from = \"info@bestdebates.com\"\n @subject = \"BestDebates.com: \"\n @sent_on = Time.now\n end",
"title": ""
},
{
"docid": "4655fde5fabe36e64ef219fc99db957b",
"score": "0.62632716",
"text": "def initialize(config=nil)\n super config, 'email'\n @smtp_server = @config['smtp-server']\n @port = @config['port']\n @tls = @config['tls']\n @user = @config['user']\n @password = @config['password']\n end",
"title": ""
},
{
"docid": "ecdefae92ce49217b1e1134d1ad9bcc4",
"score": "0.62607336",
"text": "def email=(e)\r\n super\r\n if email_changed?\r\n @old_email = email_was\r\n self.email_conf_token = UUIDTools::UUID.timestamp_create.to_s\r\n self.auth_email = email.blank? ? nil : email.downcase\r\n end\r\n end",
"title": ""
},
{
"docid": "3f4599ded65f861643a07f4326c71578",
"score": "0.62541604",
"text": "def recipient_email=(v)\n @recipient_email = validate_email(v, __method__)\n end",
"title": ""
},
{
"docid": "f9d295aef6a0a6abd366091412af1689",
"score": "0.62488544",
"text": "def caseadilla_config_email_from_address\n 'donotreply@caseadillacms.com'\n end",
"title": ""
},
{
"docid": "653a0027f55be7cf18df93c3871180c5",
"score": "0.62482536",
"text": "def mailboxer_email(_)\n self.email\n end",
"title": ""
},
{
"docid": "9c344ec76612b057414e20b947aa7578",
"score": "0.62473965",
"text": "def setup_email(user)\n @recipients = \"#{user.email}\"\n @from = AppConfig.contact_email\n @subject = \"[\"+AppConfig.site_name+\"] \"\n @sent_on = Time.now\n @body[:user] = user\n end",
"title": ""
},
{
"docid": "b19ffc1c34008829eeabbb542a8d4859",
"score": "0.62402296",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "b19ffc1c34008829eeabbb542a8d4859",
"score": "0.62402296",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "b19ffc1c34008829eeabbb542a8d4859",
"score": "0.62402296",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "b19ffc1c34008829eeabbb542a8d4859",
"score": "0.62402296",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "b19ffc1c34008829eeabbb542a8d4859",
"score": "0.62402296",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "b19ffc1c34008829eeabbb542a8d4859",
"score": "0.62402296",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "b19ffc1c34008829eeabbb542a8d4859",
"score": "0.62402296",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "22844f4198917d7ed763386d9fedba15",
"score": "0.62233144",
"text": "def sender_email\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "6fab28be150d9c426a1509ea7ce76f6a",
"score": "0.6221919",
"text": "def email=(value)\n @email = value\n end",
"title": ""
},
{
"docid": "eb9a700d7c971e518b01484f91192927",
"score": "0.62217987",
"text": "def email=(value)\n reset_agent\n @email = value\n end",
"title": ""
},
{
"docid": "1d5ef5561745b55f3a8fd876dd914c7d",
"score": "0.6218291",
"text": "def email_address\n preferred_email || email\n end",
"title": ""
},
{
"docid": "e86b38d5303b342561880f9cf50393fa",
"score": "0.62091583",
"text": "def contact_i_t_email_address=(value)\n @contact_i_t_email_address = value\n end",
"title": ""
},
{
"docid": "c9498e56d9aab5b15e74ef9d8b8e88ff",
"score": "0.6207492",
"text": "def email_options\n @email_options = {} if @email_options.nil?\n @email_options\n end",
"title": ""
},
{
"docid": "450a0e9f03d06db8774513978bf4b346",
"score": "0.6195904",
"text": "def email_domain\n Config.guest_user_email_domain || \"example.com\"\n end",
"title": ""
},
{
"docid": "f8c7de564b38c9b6cdda4d59d4d4984d",
"score": "0.619547",
"text": "def setup_email(user)\n @recipients = \"#{user.email}\"\n @from = \"#{@admin_email}\"\n @subject = \"[#{@network_name}] \"\n @sent_on = Time.now\n @body[:user] = user\n end",
"title": ""
},
{
"docid": "86498bc63e178c5a79e34ab5adaf84d2",
"score": "0.6190246",
"text": "def email_settings=(value)\n @email_settings = value\n end",
"title": ""
},
{
"docid": "68d7219171221d5aa71219e460646115",
"score": "0.6186749",
"text": "def prepare_email\n self.email = email.downcase.strip if email\n end",
"title": ""
},
{
"docid": "68d7219171221d5aa71219e460646115",
"score": "0.6186749",
"text": "def prepare_email\n self.email = email.downcase.strip if email\n end",
"title": ""
},
{
"docid": "aa3b675555112e2fc50d18fc776f224f",
"score": "0.61781347",
"text": "def email\n Email.new @api\n end",
"title": ""
},
{
"docid": "0dddadafaeabe57a2b11f78c6b4bf0d4",
"score": "0.6161183",
"text": "def mailto\n config[\"mailto\"]\n end",
"title": ""
},
{
"docid": "098259b7af9dd923e98d912e6ea6a557",
"score": "0.6155588",
"text": "def welcome_email(email)\n admin_address = Rails.configuration.oc_malone_admin_address || \"\"\n email[:to] = [admin_address, email[:to].to_s]\n mail(email)\n end",
"title": ""
},
{
"docid": "0001bc781a45e91f3e8b171e72e80c0b",
"score": "0.6152341",
"text": "def process_email\n if self.email.nil?\n return\n end\n self.email.downcase!\n domain = self.email.split(\"@\")[1]\n if domain\n self.domain = \"@\" + domain\n end\n end",
"title": ""
},
{
"docid": "a07f2da6ef5d4f55991a0ea63e59c09b",
"score": "0.61514354",
"text": "def notify_email; email; end",
"title": ""
},
{
"docid": "55838c77384fcbe01483155f02465147",
"score": "0.61384165",
"text": "def smtp=(_arg0); end",
"title": ""
},
{
"docid": "b7fedf2166232154744be77ed142ad20",
"score": "0.6134086",
"text": "def email_address\n self.dig_for_string(\"emailAddress\")\n end",
"title": ""
},
{
"docid": "2a5af3ee447dbf1b865b1c56ee14e630",
"score": "0.6133771",
"text": "def email_from; det.form(:name, 'configSmtpEmail').text_field(:id, 'from'); end",
"title": ""
},
{
"docid": "5058dae75c80e9de5c76075919721643",
"score": "0.612577",
"text": "def set_EmailAddress(value)\n set_input(\"EmailAddress\", value)\n end",
"title": ""
},
{
"docid": "5058dae75c80e9de5c76075919721643",
"score": "0.612577",
"text": "def set_EmailAddress(value)\n set_input(\"EmailAddress\", value)\n end",
"title": ""
},
{
"docid": "5058dae75c80e9de5c76075919721643",
"score": "0.612577",
"text": "def set_EmailAddress(value)\n set_input(\"EmailAddress\", value)\n end",
"title": ""
},
{
"docid": "866529c2163563ccf72b87df473364c2",
"score": "0.6114868",
"text": "def mail_defaults(event)\n {\n to: to(event),\n base_url: \"https://#{domain(event)}\",\n dealership: dealership(event),\n support_email: Lynr.config('app').support_email,\n }\n end",
"title": ""
},
{
"docid": "66d71245b502220433b54b23d0814a42",
"score": "0.61094964",
"text": "def mail_to\n email\n end",
"title": ""
},
{
"docid": "5fbf75ba7bbbe6cde74629681d9dee2f",
"score": "0.6105315",
"text": "def set_EmailAddress(value)\n set_input(\"EmailAddress\", value)\n end",
"title": ""
},
{
"docid": "5fbf75ba7bbbe6cde74629681d9dee2f",
"score": "0.6105315",
"text": "def set_EmailAddress(value)\n set_input(\"EmailAddress\", value)\n end",
"title": ""
},
{
"docid": "115ee032b0494604c65cfa4e6258d533",
"score": "0.6097292",
"text": "def mail_address\n get(MAIL_ADDRESS)\n end",
"title": ""
},
{
"docid": "017b415c1630d9c3ba41cab4469ca38b",
"score": "0.6093267",
"text": "def mailing_address=(value)\n @mailing_address = value\n end",
"title": ""
},
{
"docid": "91a5010ab7011afee27beee39fe4c59b",
"score": "0.6089815",
"text": "def mail(args)\n # Fixes SMTP trying to send emails without email addresses\n return if args[:to].nil?\n super\n end",
"title": ""
},
{
"docid": "ac788628401eab30b680937aaa3a00cb",
"score": "0.60846704",
"text": "def email(p, args)\n email = args[0]\n if !email || email == \"\"\n p.event(\"New email address not given\")\n\t\treturn\n end\n \n p.email = email\n p.event(\"Email address changed to\", email)\nend",
"title": ""
},
{
"docid": "65bafbadcc362252cc5918e2fcf1c3b7",
"score": "0.60808396",
"text": "def route_email(topic)\n recipient_email = if topic == t('blacklight.feedback.form.topic.options.membership.option')\n CONTACT_EMAILS['dc_admin']\n elsif topic == t('blacklight.feedback.form.topic.options.research.option')\n CONTACT_EMAILS['research_question']\n end\n recipient_email || super\n end",
"title": ""
},
{
"docid": "5a133fe67c8e4599c265567206a85c9d",
"score": "0.6073185",
"text": "def make_email_format\n self.email = self.email + \"@\" +self.school.email_postfix \n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "3cec28429090adaead2735d591d56ace",
"score": "0.0",
"text": "def council_params\n params.require(:council).permit(:designator, :number)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496729",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958585",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69237685",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6895071",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67869943",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.67445725",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.668381",
"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.6638182",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66302425",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6627488",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65639997",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.64919555",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6478558",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6454667",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64012396",
"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.63839936",
"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.6365647",
"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.6339444",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6337142",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6326974",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63207066",
"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.63158226",
"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.63153416",
"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.6307222",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6302766",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.6301276",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.62975216",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.629241",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.629241",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62796533",
"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.6274467",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267973",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.6257074",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62556005",
"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.6253268",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6235937",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6229283",
"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": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6228986",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62284905",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.622684",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200802",
"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.61919236",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6184593",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61810327",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6164044",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.61617863",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6156518",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.6155467",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61354053",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61343485",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61204326",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61169004",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61169004",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61157626",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.6111809",
"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.6104543",
"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.6104543",
"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.6098137",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6098137",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6086392",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6085739",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.6085733",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.60790676",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.607553",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6069313",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60672545",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.6067154",
"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.6067105",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064792",
"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.60634184",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.60632914",
"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.6058432",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6048923",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6048879",
"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.6048879",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.60472274",
"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.6041843",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60351795",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.603075",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6026434",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021914",
"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.6021314",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.60178083",
"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.60156524",
"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.60095096",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6007318",
"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.6007318",
"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.6007018",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60057443",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.6002585",
"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.60017353",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60017353",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6001735",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59996015",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5999499",
"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.5999499",
"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.59949625",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5994718",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5994533",
"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.59923065",
"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.5992183",
"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": ""
}
] |
70ef61bfa0d6b2d2dd6f36a9018b5710
|
GET /page_templates/new GET /page_templates/new.json
|
[
{
"docid": "9490e2f5940fb5e10c5a84a70e88419a",
"score": "0.78366274",
"text": "def new\n @page_template = PageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=>@page_template}\n end\n end",
"title": ""
}
] |
[
{
"docid": "962885558c3c77097f60ac4cb8618073",
"score": "0.7528082",
"text": "def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"title": ""
},
{
"docid": "962885558c3c77097f60ac4cb8618073",
"score": "0.7528082",
"text": "def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"title": ""
},
{
"docid": "bb9db5c5a3f90d51a17f365d88d3ae92",
"score": "0.72560394",
"text": "def new\n @template = Template.new(row)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"title": ""
},
{
"docid": "7df5057f319c5259f004889dcf057f06",
"score": "0.7242347",
"text": "def new\n @admin_template_type = TemplateType.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_type }\n end\n end",
"title": ""
},
{
"docid": "53cde2155b8a3a28f0a2719add57d001",
"score": "0.71737427",
"text": "def new_template\n template :new\n end",
"title": ""
},
{
"docid": "40bacc6a29a04c97005e84693c3cf762",
"score": "0.71469915",
"text": "def new\n @template_type = TemplateAuthor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template_type }\n end\n end",
"title": ""
},
{
"docid": "8f4f17d37859d8377d6f3fe7f306abf9",
"score": "0.706015",
"text": "def new\n @account = Account.find(params[:account_id])\n @templates = @account.templates\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"title": ""
},
{
"docid": "26fc8e7cb4852d4d6bb8dcd43db10867",
"score": "0.70038205",
"text": "def new\n @page = Page.new\n @public_tags = Tag.public.all\n @private_tags = Tag.private.all\n @templates = Template.all\n @uploads = Upload.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "5fd9356d4a7107da56de0e30976de085",
"score": "0.69864464",
"text": "def new\n @news_template = NewsTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_template }\n end\n end",
"title": ""
},
{
"docid": "96a78063fcd9240853c46a4f65d96108",
"score": "0.69814783",
"text": "def new\n @template = Template.find(params[:template_id])\n @placeholder = Placeholder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @placeholder }\n end\n end",
"title": ""
},
{
"docid": "4b1cbb0cbd2adf13ec7d9ff10456ac81",
"score": "0.6969796",
"text": "def new\n # creating page moved to before_filter\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "190c7b576c6bc5723d3213b28e9b8d10",
"score": "0.69554406",
"text": "def new\n @page_template = PageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_template }\n end\n end",
"title": ""
},
{
"docid": "44214c09604b7fe1d76532d82f4aaf24",
"score": "0.69463444",
"text": "def new\n @resume_template = ResumeTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resume_template }\n end\n end",
"title": ""
},
{
"docid": "5b2dea75a67f9ae0e0c95f02a49c5e78",
"score": "0.69327545",
"text": "def new\n @db_template = DbTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @db_template }\n end\n end",
"title": ""
},
{
"docid": "6e899fefa3cb7f0970759f7fd96b9e27",
"score": "0.6914397",
"text": "def create\n @template = Templates::Template.find(templates_page_params[:template_id])\n @template_page = Templates::Page.new(templates_page_params)\n\n respond_to do |format|\n if @template_page.save\n format.html { redirect_to @template, notice: t('flash.template.pages.create.notice') }\n format.json { render action: 'show', status: :created, location: @template_page }\n else\n format.html { render action: 'new' }\n format.json { render json: @template_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "dc0a0ee446f124d50e7cfc43c9e9211b",
"score": "0.69088864",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "9c9ed96a0a76f1a866cb1dcd4869abd7",
"score": "0.69072014",
"text": "def new\n @ticket_template = @current_account.ticket_templates.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket_template }\n end\n end",
"title": ""
},
{
"docid": "de838b80ba1f28fe2786a42a7bebd680",
"score": "0.68742",
"text": "def new\n @usertemplate = Usertemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usertemplate }\n end\n end",
"title": ""
},
{
"docid": "affd1a1cb35dc36c8f56a49c6c9137f4",
"score": "0.6851638",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "affd1a1cb35dc36c8f56a49c6c9137f4",
"score": "0.6851638",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "affd1a1cb35dc36c8f56a49c6c9137f4",
"score": "0.6851638",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "e83347ba66d9cf122dfd44db8d361cf9",
"score": "0.6839376",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "29e9de382ce478b9d5b7c4b112414b0a",
"score": "0.68369657",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "29e9de382ce478b9d5b7c4b112414b0a",
"score": "0.68369657",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "d89d88dcb488b2acf0e3af27a9893512",
"score": "0.6831022",
"text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end",
"title": ""
},
{
"docid": "d422a078a5797052290f74c75a61ee50",
"score": "0.68291587",
"text": "def new\n @pageType = \"new\"\n @patient = Patient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patient }\n end\n end",
"title": ""
},
{
"docid": "b79d1bd827a703ea288d18dd6d4eac3e",
"score": "0.68248826",
"text": "def new\n @citation_template = CitationTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @citation_template }\n end\n end",
"title": ""
},
{
"docid": "d498b830ddd0600000369b9e81f2becc",
"score": "0.6805757",
"text": "def new\n @tt = Tt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tt }\n end\n end",
"title": ""
},
{
"docid": "0e5e8f4939186794caefdab53de38f8b",
"score": "0.6782764",
"text": "def create\n @page_template = PageTemplate.new(page_template_params)\n\n respond_to do |format|\n if @page_template.save\n format.html { redirect_to @page_template, :notice=>\"Page template was successfully created.\" }\n format.json { render :json=>@page_template, :status=>:created, :location=>@page_template }\n else\n format.html { render :action=>\"new\" }\n format.json { render :json=>@page_template.errors, :status=>:unprocessable_entry }\n end\n end\n end",
"title": ""
},
{
"docid": "96dad183f9965f431f750f88eca07bad",
"score": "0.6778623",
"text": "def new\n @notify_template = NotifyTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notify_template }\n end\n end",
"title": ""
},
{
"docid": "6bf080f358d9363a19d5c8643f1bb1da",
"score": "0.677382",
"text": "def new\n @admin_template_category = TemplateCategory.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_category }\n end\n end",
"title": ""
},
{
"docid": "4629e2b9a5f57572f62f689cf526e593",
"score": "0.677195",
"text": "def new\n @set_template = SetTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @set_template }\n end\n end",
"title": ""
},
{
"docid": "f0df7c720c940085c36e0f085f0c5c1f",
"score": "0.67488724",
"text": "def new\n @html_template = HtmlTemplate.new\n\n drop_breadcrumb('新增')\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @html_template }\n end\n end",
"title": ""
},
{
"docid": "4b4776127dda4edc2436243b32900d49",
"score": "0.6734879",
"text": "def new\n @template_author = TemplateAuthor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template_author }\n end\n end",
"title": ""
},
{
"docid": "986729f7a43db95d2a9c919e605917d8",
"score": "0.67330784",
"text": "def new\n @email_template = EmailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_template }\n end\n end",
"title": ""
},
{
"docid": "9a466ac005ef2945f887bfb6677e0d48",
"score": "0.6721183",
"text": "def new\n @programset_template = ProgramsetTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programset_template }\n end\n end",
"title": ""
},
{
"docid": "d310dfe26313a3abf037322f059a640a",
"score": "0.6716707",
"text": "def new\n @admin_template_source = TemplateSource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_source }\n end\n end",
"title": ""
},
{
"docid": "c95e6599001c08249d09add42b4e5d85",
"score": "0.6715352",
"text": "def new\n @message_template = MessageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_template }\n end\n end",
"title": ""
},
{
"docid": "c95e6599001c08249d09add42b4e5d85",
"score": "0.6715352",
"text": "def new\n @message_template = MessageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_template }\n end\n end",
"title": ""
},
{
"docid": "b3b7c60393957c7efec103ad102a942f",
"score": "0.671109",
"text": "def new\n @inventory_template = InventoryTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inventory_template }\n end\n end",
"title": ""
},
{
"docid": "246438778a8e9a743370b615d650deed",
"score": "0.67090434",
"text": "def new\n @requirement_template = RequirementTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requirement_template }\n end\n end",
"title": ""
},
{
"docid": "bc7e4511174cdfc9334edaf7a19197ab",
"score": "0.67086995",
"text": "def new\n @element = @template.elements.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @element }\n end\n end",
"title": ""
},
{
"docid": "f1ed27e612d4c8b872a719c586a45b78",
"score": "0.67016643",
"text": "def new\n @notification_template = NotificationTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notification_template }\n end\n end",
"title": ""
},
{
"docid": "a8cb36ef4e5562f2843b55c079921039",
"score": "0.667387",
"text": "def new_json_template\n Template.json_template(response_body[response_body.length - 1])\n end",
"title": ""
},
{
"docid": "a0cd2962a7bce37b5bca6a09e11e4de8",
"score": "0.6669408",
"text": "def new\n @page = Page.new(parent_id: params[:page_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "fe383fb2dac6a7b80906c94d173f6e57",
"score": "0.6667526",
"text": "def new_article\n authorize! :create, Page\n @templates = Page.templates\n end",
"title": ""
},
{
"docid": "188208ea27e649f35c5202c61fff1b88",
"score": "0.66520596",
"text": "def new\n @page = Page.new\n @tags = Tag.all\n respond_to do |format|\n format.html \n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "363160e6e4b632280bd2c38507e52155",
"score": "0.66444075",
"text": "def new\n @instruction_template = InstructionTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @instruction_template }\n end\n end",
"title": ""
},
{
"docid": "bf21c34f0b664e234ceeaa0d9cb79b70",
"score": "0.6643444",
"text": "def new\n @label_template = Spree::LabelTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @label_template }\n end\n end",
"title": ""
},
{
"docid": "9dd7ca5de88945b2a80dddadba22cc07",
"score": "0.663462",
"text": "def new\n @breadcrumb = 'create'\n @contract_template_term = ContractTemplateTerm.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contract_template_terms }\n end\n end",
"title": ""
},
{
"docid": "653bf2c9c6670bc8d708dc263b8bdb18",
"score": "0.6618703",
"text": "def new\n @new_page = Page.new\n @user = current_user\n @site = @user.sites.find_by_subdomain!(request.subdomain)\n @pages = @site.pages.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "05fe9b58aade4f65bcaa190e3a032696",
"score": "0.6614457",
"text": "def new\n @new_template = AimTemplate.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_template }\n format.js # { render :layout => false } \n end\n end",
"title": ""
},
{
"docid": "9845ce073380ea7acefab478629a56eb",
"score": "0.66042966",
"text": "def new\n @template = current_user.templates.new\n end",
"title": ""
},
{
"docid": "8b556ec77af87a629098c6baa46b7242",
"score": "0.66010493",
"text": "def new\n @sql_template = SqlTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sql_template }\n end\n end",
"title": ""
},
{
"docid": "8e0744c29419394408aad85c135f3f4b",
"score": "0.65989405",
"text": "def new\n @admin_page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_page }\n end\n end",
"title": ""
},
{
"docid": "2b2e8f0afc4e43f1b1a045641f8ba567",
"score": "0.6596213",
"text": "def new\n @page_view = PageView.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_view }\n end\n end",
"title": ""
},
{
"docid": "0dadbdabbe9aedccf33b70de6c17bf5b",
"score": "0.6593687",
"text": "def create\n @page_template = PageTemplate.new(page_template_params)\n\n respond_to do |format|\n if @page_template.save\n format.html { redirect_to admin_page_template_path(@page_template), notice: 'Page template was successfully created.' }\n format.json { render :show, status: :created, location: @page_template }\n else\n format.html { render :new }\n format.json { render json: @page_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff5635e08d1bfafb57aedcb88026f254",
"score": "0.65866846",
"text": "def new\n @tmplt = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tmplt }\n end\n end",
"title": ""
},
{
"docid": "41af62f88316377c6fc54c82dd90e0c0",
"score": "0.65797395",
"text": "def new\n @page = Page.new\n @page.id = 0\n\n respond_to do |format|\n format.html { render action: \"new\" } #new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "7ff5637985334e34337f03bd2fc68641",
"score": "0.657949",
"text": "def new\n @page_part = PagePart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_part }\n end\n end",
"title": ""
},
{
"docid": "2ae5144dddfa45e38d51e4abe317b07a",
"score": "0.6578251",
"text": "def new\n @page_section = Admin::PageSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_section }\n end\n end",
"title": ""
},
{
"docid": "ceee4ba6910af2cfdd5af07ef2195c12",
"score": "0.6574913",
"text": "def new\n @lt = Lt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lt }\n end\n end",
"title": ""
},
{
"docid": "4376a769296d3f3829a63ba31584c1b5",
"score": "0.6572841",
"text": "def new\n @admin_template_author = TemplateAuthor.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_author }\n end\n end",
"title": ""
},
{
"docid": "fee3402a0c1da786a6042a254a80217e",
"score": "0.6563989",
"text": "def new\n @admin_action_name = \"Создание элемента\"\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "be58a49692ce4ab7bb2ecbfb6dc093ab",
"score": "0.6560726",
"text": "def new\n # @page = Page.new\n @page = current_user.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "46bac5aad2bdc1ad3dfdab64f618560b",
"score": "0.6559208",
"text": "def new\n @page = Page.new(:path => params[:path].present? ? CGI::unescape(params[:path]) : nil)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "32a74e5a054e720e1f2199fb00b57182",
"score": "0.65557086",
"text": "def new\n @mail_template = MailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mail_template }\n end\n end",
"title": ""
},
{
"docid": "25c1fb96a12b26a109cb91fa13cce737",
"score": "0.65549606",
"text": "def new\n @phase_template = PhaseTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phase_template }\n end\n end",
"title": ""
},
{
"docid": "07283497362ecbc3b57466751ce2de08",
"score": "0.6551379",
"text": "def new\n @static_page = StaticPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @static_page }\n end\n end",
"title": ""
},
{
"docid": "759f354b77f9744853462e7b96a9a9a9",
"score": "0.65314794",
"text": "def new\n @new_template = Template.new\n config = YAML.load_file(RAILS_ROOT + \"/config/config.yml\")\n @regions = config[\"regions\"].split(\",\")\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_template }\n end\n end",
"title": ""
},
{
"docid": "9ba58228295f91764f0f9f22d39f49c1",
"score": "0.6518695",
"text": "def new\n @gtpl = Gtpl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gtpl }\n end\n end",
"title": ""
},
{
"docid": "be0f57f095034c7bdc47197bc727ced3",
"score": "0.6515735",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n end\n end",
"title": ""
},
{
"docid": "be0f57f095034c7bdc47197bc727ced3",
"score": "0.6515735",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n end\n end",
"title": ""
},
{
"docid": "be0f57f095034c7bdc47197bc727ced3",
"score": "0.6515735",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n end\n end",
"title": ""
},
{
"docid": "17d7da60333d97967bcd96628c11fd45",
"score": "0.6512395",
"text": "def new\n json_404\n end",
"title": ""
},
{
"docid": "c580e093a7e267426e649d30d8e40307",
"score": "0.65108645",
"text": "def new\n @mainpage = Mainpage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mainpage }\n end\n end",
"title": ""
},
{
"docid": "701033e822aa80cc48ecb2844c1a0653",
"score": "0.6510214",
"text": "def new\n @admin_template_package = TemplatePackage.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_package }\n end\n end",
"title": ""
},
{
"docid": "b382e2ba8896ea96b10da3af583e6857",
"score": "0.650991",
"text": "def new\n @page_version = PageVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_version }\n end\n end",
"title": ""
},
{
"docid": "12f9e1749d22925d896f318443e45be3",
"score": "0.65089667",
"text": "def new\n @template = Template.new\n end",
"title": ""
},
{
"docid": "8f2321e08b90f2edb5e854f329fc5f51",
"score": "0.65047765",
"text": "def new_using_template\n respond_to do |format|\n format.html #new_using_template.html.erb\n end\n end",
"title": ""
},
{
"docid": "42bc2f4fb922564c632d5789f5b4e282",
"score": "0.65019876",
"text": "def new\n @artifact_type_template = ArtifactTypeTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artifact_type_template }\n end\n end",
"title": ""
},
{
"docid": "eef5da1223d9473bca45a73f194bd671",
"score": "0.6495238",
"text": "def new\n @page = Page.new\n # create the translation object for however many locales there are\n # so the form will properly create all of the nested form fields\n @locales.length.times {@page.page_translations.build}\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"title": ""
},
{
"docid": "6826f606193c20b6cb3c12735b0cc2a7",
"score": "0.64831674",
"text": "def new(page = 'New Page')\n @page = Page.new(:name => page)\n render\n end",
"title": ""
},
{
"docid": "cac7a3fbbd7e5555d1764f471842ba02",
"score": "0.64829427",
"text": "def new\n @switch = Switch.new\n @templates = Template.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @switch }\n end\n end",
"title": ""
},
{
"docid": "87ad022337915e3df6577ead4746e4d2",
"score": "0.6472101",
"text": "def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @template }\n end\n end",
"title": ""
}
] |
3f6b48986e67bafbd2607f6f8e4905b7
|
Berechne den Winkel zwischen zwei Ebenen
|
[
{
"docid": "68be6def75f64b7c4d1e0ee45ed0f3ee",
"score": "0.0",
"text": "def winkel(rhs)\n n = normalen_vektor\n m = rhs.normalen_vektor\n cos = (n * m).abs / (n.norm * m.norm)\n # Floating Point Ungenauigkeiten, können dazu führen, dass cos > 1.0\n # Dieser Fall wird hier abgefangen, damit acos keine Exception wirft\n if cos > 1.0\n cos = 1.0\n end\n Math.acos( cos )\n end",
"title": ""
}
] |
[
{
"docid": "07f4aba74008200310213b63a5f3de3f",
"score": "0.61349875",
"text": "def zuruecksetzen()\n end",
"title": ""
},
{
"docid": "30858be404aadc463f81dcd378f80d17",
"score": "0.6123226",
"text": "def letzte_komponente\n \n end",
"title": ""
},
{
"docid": "efd221d44e5b5949a411062c8e1cd22f",
"score": "0.58722275",
"text": "def w; self[W]; end",
"title": ""
},
{
"docid": "43e4da1d9f716ca10d7f18fe7654ac99",
"score": "0.565514",
"text": "def blam!\n berzerk? ? w00t! : super\n end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5643485",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5643485",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5643485",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5643485",
"text": "def specie; end",
"title": ""
},
{
"docid": "cb60debbc4128a7ed01d0fcb1575d265",
"score": "0.55867696",
"text": "def sichtbar_machen()\n @dach.sichtbar_machen\n @gebaedekoerpe.sichtbar_machen\n @fenster.sichtbar_machen\n @tuer.sichtbar_machen\n end",
"title": ""
},
{
"docid": "459ac5a4151046aab3c72a26f655bbb8",
"score": "0.5557128",
"text": "def horizontal_bewegen(anzahl_punkte)\n @fuss.horizontal_bewegen(anzahl_punkte)\n @stiel.horizontal_bewegen(anzahl_punkte)\n @schirm.horizontal_bewegen(anzahl_punkte)\n @leuchtstrahl1.horizontal_bewegen(anzahl_punkte)\n @leuchtstrahl2.horizontal_bewegen(anzahl_punkte)\n @leuchtstrahl3.horizontal_bewegen(anzahl_punkte)\n @leuchtstrahl4.horizontal_bewegen(anzahl_punkte)\n end",
"title": ""
},
{
"docid": "430cc85c18405c4360420dd836c79e26",
"score": "0.5540959",
"text": "def unsichtbar_machen()\n end",
"title": ""
},
{
"docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2",
"score": "0.5531709",
"text": "def weber; end",
"title": ""
},
{
"docid": "5dec2bc2c590bffe9db39d41b59a9cc2",
"score": "0.5492469",
"text": "def sichtbar_machen()\n # TODO\n end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.5487182",
"text": "def schubert; end",
"title": ""
},
{
"docid": "4c35f6ca5fe84e33b2f153f398c2726a",
"score": "0.5481817",
"text": "def sichtbar_machen()\n end",
"title": ""
},
{
"docid": "1f07a6c3fdf370d8fc2b4439ed9c6069",
"score": "0.5427554",
"text": "def unsichtbar_machen\n @fuss.unsichtbar_machen\n @stiel.unsichtbar_machen\n @schirm.unsichtbar_machen\n @leuchtstrahl1.unsichtbar_machen\n @leuchtstrahl2.unsichtbar_machen\n @leuchtstrahl3.unsichtbar_machen\n @leuchtstrahl4.unsichtbar_machen\n end",
"title": ""
},
{
"docid": "7cdb702ad83bd8794204a7b8f17dbda8",
"score": "0.5422409",
"text": "def vertikal_bewegen(anzahl_punkte)\n @fuss.vertikal_bewegen(anzahl_punkte)\n @stiel.vertikal_bewegen(anzahl_punkte)\n @schirm.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl1.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl2.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl3.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl4.vertikal_bewegen(anzahl_punkte)\n end",
"title": ""
},
{
"docid": "5772fb7c8effe494d6de0963bd2da378",
"score": "0.54152435",
"text": "def langsam_vertikal_bewegen(entfernung)\n absolute_entfernung = entfernung\n if sichtbar? \n delta = 1\n if entfernung < 0 \n delta = -1\n absolute_entfernung = - entfernung\n end \n x_delta = 0\n y_delta = delta\n Leinwand.gib_einzige_instanz().\n bewege(self,absolute_entfernung,x_delta,y_delta)\n end \n @spitze = @spitze + Punkt.new(0,entfernung)\n end",
"title": ""
},
{
"docid": "7c20079157a60b667c026cd898314f79",
"score": "0.53854936",
"text": "def otrzymane_wiadomosci\n\twiadomosci=[]\n\twhile(!@kolejka_wiadomosci.empty?)\n\t\twiadomosc=@kolejka_wiadomosci.pop(true) rescue nil\n\t\tbreak if wiadomosc.nil?\n\t\twiadomosci << wiadomosc\n\t\tyield wiadomosc if block_given?\n\tend\n\twiadomosci\n end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.5376388",
"text": "def suivre; end",
"title": ""
},
{
"docid": "03b39b39e83da2f7d3740246f051f69c",
"score": "0.5365228",
"text": "def eplore\n end",
"title": ""
},
{
"docid": "a748420c022928a271be3a1483dd398e",
"score": "0.53253406",
"text": "def sichtbar_machen\n @fuss.sichtbar_machen\n @stiel.sichtbar_machen\n @schirm.sichtbar_machen\n unless @tag\n @leuchtstrahl1.sichtbar_machen\n @leuchtstrahl2.sichtbar_machen\n @leuchtstrahl3.sichtbar_machen\n @leuchtstrahl4.sichtbar_machen\n end\n end",
"title": ""
},
{
"docid": "453bdfab62c5ef73c11d25e61e924ef4",
"score": "0.5312938",
"text": "def horizontal_bewegen(anzahl)\n bewegen_um_punkt(Punkt.new(anzahl,0)) \n end",
"title": ""
},
{
"docid": "98c315a38118572b3af83e33aa559d0f",
"score": "0.5298385",
"text": "def unsichtbar_machen()\n @fuss.unsichtbar_machen()\n @stiel.unsichtbar_machen()\n @schirm.unsichtbar_machen()\n @leuchtstrahl1.unsichtbar_machen()\n @leuchtstrahl2.unsichtbar_machen()\n @leuchtstrahl3.unsichtbar_machen()\n @leuchtstrahl4.unsichtbar_machen()\n end",
"title": ""
},
{
"docid": "009c1c83bb1a48b1e059286eda19dfa2",
"score": "0.5265484",
"text": "def funktionsname\n\tanweisung\nend",
"title": ""
},
{
"docid": "6612dfeea60e299536306aae4b79d8d8",
"score": "0.5262468",
"text": "def sub_e\n end",
"title": ""
},
{
"docid": "9e2ab91bd510e3a4dce26db68c627a1c",
"score": "0.5251188",
"text": "def intelligenter_zug(spielfeld, aktueller_spieler)\n zug = nil\n\n spieler = spielfeld.spieler\n gegner = nil\n for s in spieler\n if s.name != aktueller_spieler.name\n gegner = s\n break\n end\n end\n\n # 1. Regel: Zuerst nach einer Gewinnsituation suchen\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Wenn der aktuelle Spieler in einer Reihe bereits zwei Felder\n # besetzt hält und das dritte frei ist, dann natürlich das nehmen\n if (frei.size == 1) and (besetzt[aktueller_spieler].size == 2)\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n\n if zug.nil?\n # 2. Regel: Suche dann nach den Reihen, in denen der Gegner bereits\n # genau 2 Felder besetzt hat und das dritte Feld noch frei ist.\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Gefährlich, wenn Gegner zwei besetzt hält. Wie in der vorherigen\n # Lektion gelernt, erhält man zum Index des aktuellen Spielers\n # in der Spielerliste den Index des Gegners mit der Bitoperation 1^wer\n if (frei.size == 1) and (besetzt[gegner].size == 2)\n # Jetzt muss der Spieler unbedingt das eine freie Feld besetzen!\n # Andernfalls kann der Gegner im nächsten Zug gewinnen.\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n end\n\n # Eckensituation bestimmen\n ecken = {\n 1 => 0, # links oben\n 3 => 0, # rechts oben\n 7 => 0, # links unten\n 9 => 0 # rechts unten\n }\n gegen_ecken = [[1, 9], [9, 1], [3, 7], [7, 3]]\n for z in spielfeld.zuege\n feld = z.nummer\n # Gegner besetzt die Ecke, wenn:\n # feld ist eine Ecke und Gegner besetzt sie\n if (ecken[feld] != nil) and (z.spieler == gegner)\n # Markiere Ecke als vom Gegner besetzt\n ecken[feld] = 1\n end\n end\n\n # 3. Regel: Immer in die Mitte setzten, falls dort frei ist\n # Vorsicht vor der XOX Situation an der Diagonale!\n if zug.nil?\n frei = spielfeld.freie_felder\n mitte = 5\n if frei.include?(mitte)\n zug = Zug.new(aktueller_spieler, mitte)\n else\n # Aha, Mitte ist bereits besetzt.\n # Sofern sie vom aktuellen Spieler besetzt ist, dann nach der XOX\n # Situation Ausschau halten und den nächsten Zug nicht in eine Ecke setzen.\n # XOX (oder OXO) Situation besteht, wenn\n # Ecke 1 und 9 vom Gegner besetzt und aktueller Spieler auf 5 oder\n # Ecke 3 und 7 vom Gegner besetzt und aktueller Spieler auf 5.\n for ecken_paar in gegen_ecken\n besetzt, frei_ecken = spielfeld.reihen_status([ecken_paar[0], mitte, ecken_paar[1]])\n if besetzt[gegner].include?(ecken_paar[0]) and besetzt[gegner].include?(ecken_paar[1])\n if besetzt[aktueller_spieler].include?(mitte)\n # Jetzt also nicht in eine freie Ecke setzen, sondern auf\n # die Felder 2, 4, 6 oder 8, sofern sie frei sind.\n xox_felder = [2, 4, 6, 8]\n for f in xox_felder\n if !frei.include?(f)\n xox_felder.delete(f)\n end\n end\n # Von den freien Ausweichfeldern zufällig eines nehmen\n feld = zufalls_feld(xox_felder)\n if feld != nil\n zug = Zug.new(aktueller_spieler, feld)\n break\n end\n end\n end\n end\n\n end\n end\n\n # 4. Regel: Verteidige gegenüberliegende Ecke\n frei = spielfeld.freie_felder\n if zug.nil?\n # Wenn Ecke 1 besetzt, dann setze auf 9, oder umgekehrt (sofern frei).\n # Wenn Ecke 3 besetzt, dann setze auf 7, oder umgekehrt (sofern frei).\n for ecken_paar in gegen_ecken\n if (ecken[ecken_paar[0]] > 0) and (frei.include?(ecken_paar[1]))\n zug = Zug.new(aktueller_spieler, ecken_paar[1])\n break # nicht weitersuchen\n end\n end\n end\n\n # 5. Regel: Setze in irgendeine freie Ecke.\n # Verwende Variablen 'frei' und 'ecken' von oben\n if zug.nil?\n for ecke in ecken.keys\n if frei.include?(ecke)\n zug = Zug.new(aktueller_spieler, ecke)\n break # nicht weitersuchen\n end\n end\n end\n\n # Andernfalls Zufallszug machen\n if zug.nil?\n zug = zufalls_zug(spielfeld, aktueller_spieler)\n end\n\n zug\n end",
"title": ""
},
{
"docid": "7f8ab34241952cb7a8a77e20b63d112f",
"score": "0.52218103",
"text": "def witcher; end",
"title": ""
},
{
"docid": "e54fd8efd962a174a9d84f7cbdfd2ab6",
"score": "0.52130055",
"text": "def sichtbar_machen\n @sichtbar = true\n zeichnen()\n puts(self) \n end",
"title": ""
},
{
"docid": "481f54b8027982e40b1f52de8f3d87e3",
"score": "0.51730794",
"text": "def jeweler; end",
"title": ""
},
{
"docid": "481f54b8027982e40b1f52de8f3d87e3",
"score": "0.51730794",
"text": "def jeweler; end",
"title": ""
},
{
"docid": "481f54b8027982e40b1f52de8f3d87e3",
"score": "0.51730794",
"text": "def jeweler; end",
"title": ""
},
{
"docid": "5cf37e44936d3f53c71e314f10bc00d2",
"score": "0.51625913",
"text": "def sichtbar_machen()\n @fuss.sichtbar_machen()\n @stiel.sichtbar_machen()\n @schirm.sichtbar_machen()\n @leuchtstrahl1.sichtbar_machen()\n @leuchtstrahl2.sichtbar_machen()\n @leuchtstrahl3.sichtbar_machen()\n @leuchtstrahl4.sichtbar_machen()\n end",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c766",
"score": "0.51535225",
"text": "def terpene; end",
"title": ""
},
{
"docid": "b7d3fc1d5dda51cfe551c7b3ab381984",
"score": "0.5113336",
"text": "def bewegen(key)\n \n # Bewegung nach Rechts \n if key == :right then \n\t\t\n\t\tif @feld[@position_y][@position_x +1] == 0 or \t\t\t# FALL: Gärtner fährt auf leeres Feld\n\t\t @feld[@position_y][@position_x +1] == 5 then \t\t# FALL: Gärtner fährt gegen Ecke\n\t\t\t\t@position_x = @position_x + 1\n\t\t\t\n\t\telsif @feld[@position_y][@position_x +1] == 1 then # FALL: Gartner fährt gegen Wand\n\t\t\t\t@position_x = @position_x\n\t\t\t\t\n\t\telsif @feld[@position_y][@position_x +1] == 3 then\t# FALL: Gärtner fährt gegen Gießkanne\t\t\n\t\t\n\t\t\tif\t@feld[@pos_g_y][@pos_g_x + 1] == 0 then \t# FALL: Ist Feld neben der Gießkanne frei??\n\t\t\t\t\t@position_x = @position_x + 1\t\t\t\t# Bewege den Gärtner\t\t\t\n\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t# Alter Wert im Array wird auf 0 gesetzt -> leeres Feld \t\t \n\t\t\t\t\t@pos_g_x = @pos_g_x +1 \t\t\t\t\t\t# X-Position wird verändern -> bewegt sich ein Feld (im Array) nach rechts\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t# Gießkanne wird gelöscht\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t# Gießkanne wird neu gesetzt\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \t\t\t\t# Neuer Wert wird im Array an neuer Position gesetzt\n\t\t\t\t\t\n\t\t\telsif @feld[@pos_g_y][@pos_g_x + 1] == 5 then\t\n\t\t\t\t\t@position_x = @position_x + 1\t\t\t\t\n\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t \n\t\t\t\t\t@pos_g_x = @pos_g_x +1 \t\t\t\t\t\t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \n\t\t\t\t\talert \"GAME OVER!\"\n\t\t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\n\t\t\t\n\t\t\telsif @feld[@pos_g_y][@pos_g_x + 1] == 1 then\t\n\t\t\t\t\t@position_x = @position_x\n\t\t\t\t\t@pos_g_y = @pos_g_y\n\t\t\t\t\t\n\t\t\telsif @feld[@pos_g_y][@pos_g_x + 1] == 2 then\t\n\t\t\t\t\t@sonnenblume.remove\n\t\t\t\t\t@feld[@pos_s_y][@pos_s_x] = 3\n\t\t\t\t\t\n\t\t\t\t\t@position_x = @position_x + 1\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t \n\t\t\t\t\t@pos_g_x = @pos_g_x +1 \t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \n\t\t\t\t\talert \"Du hast gewonnen!\"\n\t\t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\n\t\t\tend\n\t\t\t\n\t\t\t\n\t\tend # Ende der if feld = 0 Verzweigung\n\t\t\n\t\t\n\t # Bewegung nach Links\n\t elsif key == :left then\n\t\t \n\t\tif @feld[@position_y][@position_x -1] == 0 or\n\t\t\t@feld[@position_y][@position_x -1] == 5 then\n\t\t\t\t@position_x = @position_x - 1\n\t\t\n\t\telsif @feld[@position_y][@position_x -1] == 1 then \n\t\t\t\t\t@position_x = @position_x\n\t\t\t\n\t\telsif @feld[@position_y][@position_x -1] == 3 then \n\t\t\t\t\t\n\t\t\tif\t@feld[@pos_g_y][@pos_g_x - 1] == 0 then \n\t\t\t\t\t@position_x = @position_x - 1\n\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t \n\t\t\t\t\t@pos_g_x = @pos_g_x -1 \t\t\t\t\t\t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \t\n\t\t\t\t\n\t\t\telsif @feld[@pos_g_y][@pos_g_x - 1] == 5 then \n\t\t\t\t\t@position_x = @position_x - 1\n\t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t \n\t\t\t\t\t@pos_g_x = @pos_g_x -1 \t\t\t\t\t\t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \n\t\t\t\t\talert \"Game over!\"\n\t\t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\t\t\t\t\t\t\t\n\t\t\t\n\t\t\telsif @feld[@pos_g_y][@pos_g_x - 1] == 1 then\t\n\t\t\t\t\t@position_x = @position_x\n\t\t\t\t\t@pos_g_y = @pos_g_y\n\t\t\t\t\t\n\t\t\telsif @feld[@pos_g_y][@pos_g_x - 1] == 2 then\t\n\t\t\t\t\t@sonnenblume.remove\n\t\t\t\t\t@feld[@pos_s_y][@pos_s_x] = 3\n\t\t\t\t\t\n\t\t\t\t\t@position_x = @position_x - 1\t\n\t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t \n\t\t\t\t\t@pos_g_x = @pos_g_x - 1 \t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen() \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \n\t\t\t\t\talert \"Du hast gewonnen!\"\n\t\t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\n\t\t\tend\n\t\tend\n\t\t\n\t\t\n\t \n\t elsif key == :down then\n\t\t \n\t\tif @feld[@position_y+1][@position_x] == 0 or \n\t\t\t@feld[@position_y+1][@position_x] == 5 then\n\t\t\t\t@position_y = @position_y + 1\n\t\t\t\t\n\t\telsif @feld[@position_y+1][@position_x] == 1 then\n\t\t\t\t@position_y = @position_y\n\t\t\t\t\n\t\telsif @feld[@position_y+1][@position_x] == 3 then \n\t\t\t\t\n\t\t\tif\t@feld[@pos_g_y+1][@pos_g_x] == 0 then \n\t\t\t\t\t@position_y = @position_y + 1\n\t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t\n\t\t\t\t\t@pos_g_y = @pos_g_y + 1\t\t\t\t\t\t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \t\n\t\t\t\t\n\t\t\telsif\t@feld[@pos_g_y+1][@pos_g_x] == 5 then \n\t\t\t\t\t@position_y = @position_y + 1\n\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t\n\t\t\t\t\t@pos_g_y = @pos_g_y + 1\t\t\t\t\t\t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \t\n\t\t\t\t\talert \"Game over!\"\t\n\t\t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\t\t\n\t\t\t\n\t\t\telsif @feld[@pos_g_y + 1][@pos_g_x] == 1 then\t\n\t\t\t\t\t@position_x = @position_x\n\t\t\t\t\t@pos_g_y = @pos_g_y\n\t\t\t\n\t\t\telsif @feld[@pos_g_y + 1][@pos_g_x] == 2 then\t\n\t\t\t\t\t@sonnenblume.remove\n\t\t\t\t\t@feld[@pos_s_y][@pos_s_x] = 3\n\t\t\t\t\t\n\t\t\t\t\t@position_y = @position_y + 1\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t \n\t\t\t\t\t@pos_g_y = @pos_g_y + 1 \t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen() \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \n\t\t\t\t\talert \"Du hast gewonnen!\"\n\t\t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\n\t\t\tend\n\t\t\n\t\tend\n\t\n\t \n\t elsif key == :up then\n\t\t \n\t\tif @feld[@position_y-1][@position_x] == 0 or\n\t\t\t@feld[@position_y-1][@position_x] == 5 then\n\t\t\t\t@position_y = @position_y - 1\n\t\t\n\t\telsif \t@feld[@position_y-1][@position_x] == 1 then\n\t\t\t\t\t@position_y = @position_y\n\t\t\t\t\n\t\telsif \t@feld[@position_y-1][@position_x] == 3 then \n\t\t\t\t\n\t\t\tif\t@feld[@pos_g_y-1][@pos_g_x] == 0 then \n\t\t\t\n\t\t\t\t\t@position_y = @position_y - 1\n\t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t\n\t\t\t\t\t@pos_g_y = @pos_g_y - 1\t\t\t\t\t\t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \t\t\n\t\t\t\t\n\t\t\telsif\t@feld[@pos_g_y-1][@pos_g_x] == 5 then \n\t\t\t\t\t@position_y = @position_y - 1\n\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t\n\t\t\t\t\t@pos_g_y = @pos_g_y - 1\t\t\t\t\t\t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen( ) \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \n\t\t\t\t\talert \"Game over!\"\n\t\t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\t\t\t\t\n\t\t\t\n\t\t\telsif @feld[@pos_g_x][@pos_g_y - 1] == 1 then\t\n\t\t\t\t\t@position_x = @position_x\n\t\t\t\t\t@pos_g_y = @pos_g_y\n\t\t\t\t\t\n\t\t\telsif @feld[@pos_g_y - 1][@pos_g_x] == 2 then\t\n\t\t\t\t\t@sonnenblume.remove\n\t\t\t\t\t@feld[@pos_s_y][@pos_s_x] = 3\n\t\t\t\t\t\n\t\t\t\t\t@position_y = @position_y - 1\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 0 \t\t\t\t \n\t\t\t\t\t@pos_g_y = @pos_g_y - 1 \t\n\t\t\t\t\t@giesskanne.remove\t\t\t\t\t\t\t\n\t\t\t\t\tgiesskanne_neu_setzen() \t\t\t\t\t\n\t\t\t\t\t@feld[@pos_g_y][@pos_g_x] = 3 \n\t\t\t\t\talert \"Du hast gewonnen!\"\t\t\t\t\n \t\t\t\tclear\n \t\t\t\tbutton \"Spiel neu starten\"\n \t\t\t\tbutton \"Spiel beenden\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n end",
"title": ""
},
{
"docid": "713a40dddc55c245bfa4c68268e4509c",
"score": "0.5102548",
"text": "def zlosniwa\r\n raise # ponownie zglasza biezacy wyjatek\r\n raise \"Houston, we've got a problem!\" # zglasza RuntimeError\r\n raise InterfaceException, \"Blad klawiatury\", caller # ustawia komunikat i slad stosu\r\nend",
"title": ""
},
{
"docid": "a72590dae01e5492750b328b2a5af0b9",
"score": "0.5093316",
"text": "def bewohner()\n return @inventar.find_all() do |b|\n b.is_a?(Bewohner)\n end\n end",
"title": ""
},
{
"docid": "8396ef3a6d2703c11fda0b52c8a704b6",
"score": "0.50826424",
"text": "def cp_e\n end",
"title": ""
},
{
"docid": "a49d362d99ce1e3b3bd13463892f319a",
"score": "0.50773203",
"text": "def An()\n return @RownanieWielomianu.first.Wspolczynnik\n end",
"title": ""
},
{
"docid": "1598ff40e2a3382d913e92b385271d8a",
"score": "0.50692123",
"text": "def entferne_objekt(gegenstand_oder_bewohner)\n @inventar.delete(gegenstand_oder_bewohner)\n end",
"title": ""
},
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.5053485",
"text": "def private; end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.50524014",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "1dcc2365afd90278976f3be5ee067a28",
"score": "0.50350964",
"text": "def add_self_to_getters(right_elements); end",
"title": ""
},
{
"docid": "345c215c0bf1d4dd3613aa3e47531c52",
"score": "0.50278944",
"text": "def all_howl\n @wolves.each { |wolf| wolf.howl }\n end",
"title": ""
},
{
"docid": "33b84ef3e863765ad5ce1cc2f7f68bf2",
"score": "0.50208735",
"text": "def waiver\n end",
"title": ""
},
{
"docid": "ee927502c251b167dc506cf6cfafcc30",
"score": "0.50160635",
"text": "def upc_e; end",
"title": ""
},
{
"docid": "3ec813ed6ebf9299e8c784e409201193",
"score": "0.50076103",
"text": "def sichtbar_machen\n @backgrund.sichtbar_machen\n @baum1.sichtbar_machen\n @baum2.sichtbar_machen\n @baum3.sichtbar_machen\n @haus1.sichtbar_machen\n @haus2.sichtbar_machen\n @haus3.sichtbar_machen\n @hund1.sichtbar_machen\n @hund2.sichtbar_machen\n end",
"title": ""
},
{
"docid": "5ec366fbdcda59614c9cf8751dff8a08",
"score": "0.50071484",
"text": "def celebration; end",
"title": ""
},
{
"docid": "bc34515c98b9c5fffa929cb373185091",
"score": "0.5005069",
"text": "def elemento\n \n @elemento\n end",
"title": ""
},
{
"docid": "1f60ec3e87d82a4252630cec8fdc8950",
"score": "0.49939787",
"text": "def berlioz; end",
"title": ""
},
{
"docid": "412b9189de5a3d9f45bafaecd74ae112",
"score": "0.49805945",
"text": "def tow\n auto_shop.tow_vehicle\n end",
"title": ""
},
{
"docid": "412b9189de5a3d9f45bafaecd74ae112",
"score": "0.49805945",
"text": "def tow\n auto_shop.tow_vehicle\n end",
"title": ""
},
{
"docid": "991b6f12a63ef51664b84eb729f67eed",
"score": "0.49717066",
"text": "def formation; end",
"title": ""
},
{
"docid": "da5a7957d97b66cc73e862a4bebe3e85",
"score": "0.49699333",
"text": "def element; end",
"title": ""
},
{
"docid": "da5a7957d97b66cc73e862a4bebe3e85",
"score": "0.49699333",
"text": "def element; end",
"title": ""
},
{
"docid": "da5a7957d97b66cc73e862a4bebe3e85",
"score": "0.49699333",
"text": "def element; end",
"title": ""
},
{
"docid": "da5a7957d97b66cc73e862a4bebe3e85",
"score": "0.49699333",
"text": "def element; end",
"title": ""
},
{
"docid": "1c6436423282ddf03f5b31c8ddb4ee5d",
"score": "0.49562302",
"text": "def bellini; end",
"title": ""
},
{
"docid": "d3cd7045d81236f80b2241964baa2ac5",
"score": "0.493915",
"text": "def konversiMenit(menit) \n # =================================\n # Area Kode Kode di sini\n \n \n \n # =================================\n end",
"title": ""
},
{
"docid": "5cbefacd8d994a074597b280b9d8f968",
"score": "0.49384627",
"text": "def unsichtbar_machen\n loeschen()\n @sichtbar = false \n end",
"title": ""
},
{
"docid": "a696cd1868a1c3267c742238f0b44472",
"score": "0.49365008",
"text": "def ausschalten()\n @schirm.farbe_aendern('orange')\n @leuchtstrahl1.unsichtbar_machen()\n @leuchtstrahl2.unsichtbar_machen()\n @leuchtstrahl3.unsichtbar_machen()\n @leuchtstrahl4.unsichtbar_machen()\n end",
"title": ""
},
{
"docid": "0971ccd5ea2c63929e29ca743f4c7de2",
"score": "0.49289566",
"text": "def show\n @wod\n end",
"title": ""
},
{
"docid": "c7609a555dddcf6186039257afad676a",
"score": "0.4922616",
"text": "def folge_berechnen(tn,jahr)\n folge = [ \"\" ]\n ges_einsaetze = \"28.12.#{jahr}\".to_date.cweek\n ger_schalter = 1\n namen = prio_bilden(tn,folge,ges_einsaetze,ger_schalter)\n zaehler = 0\n while folge.size <= ges_einsaetze\n namen.each do |name|\n unless tn[name].find_index(folge.size) || folge.size > ges_einsaetze\n folge << name\n zaehler += 1\n end\n end\n if zaehler == 0\n if namen.size < tn.size && ger_schalter == 1\n ger_schalter = 0\n else\n folge << \"nicht besetzt!\"\n ger_schalter = 1\n end\n end\n zaehler = 0\n namen = prio_bilden(tn,folge,ges_einsaetze,ger_schalter)\n end\n return folge \n end",
"title": ""
},
{
"docid": "7e94e809eb94fad33e6725cb5b0964e4",
"score": "0.4912971",
"text": "def oben() \n return @fahrbahn.obere_linke_ecke().y() \n end",
"title": ""
},
{
"docid": "0d5061a1536580180ddf88884acfa35d",
"score": "0.48974127",
"text": "def dodaj_do_wyslania_po_akceptacji(jid,wiadomosc,typ)\n\twiad={:do => jid, :wiadomosc => wiadomosc, :typ => typ}\n\t@wiadomosci_do_wyslania << wiad\n end",
"title": ""
},
{
"docid": "fcbedadc5c0aaa6b55a6b18ae1a7d083",
"score": "0.48931614",
"text": "def feruchemist; end",
"title": ""
},
{
"docid": "c229ccf3ea0f43c73bdc3ad370fb5b7b",
"score": "0.4889511",
"text": "def in_law; end",
"title": ""
},
{
"docid": "a86c2a09304964318225c9edecaf4b00",
"score": "0.488295",
"text": "def to_wires_event; self; end",
"title": ""
},
{
"docid": "7c23260a6599098fab0bd56380a84d64",
"score": "0.48794314",
"text": "def warner\n Dynamic[:warner]\n end",
"title": ""
},
{
"docid": "493f655987514d9d90d5069b1ba309b2",
"score": "0.48749828",
"text": "def layer\n end",
"title": ""
},
{
"docid": "390d16bcad618dae17616a3b1fbde785",
"score": "0.48639283",
"text": "def test_wertgleichheit()\n assert(@rp1==@rp1,\"Keine korrekte Pruefung fuer identische Objekte\")\n assert(@rp1==@rp1_6, \"Keine korrekter Vergleich fuerr inhaltsgleiche Objekte\")\n assert(@rp1==@rp1_1, \"Keine korrekter Vergleich für inhaltsgleiche Objekte\")\n assert_equal(false,@rp1==@rp5, \"Fehler: Gleichheit für ungleiche Objekte\")\n assert(@rp0_1==@rp0_2,\"Keine korrekte Prüfung bei 0-Zaehler und leerem Wort\")\n # Arbeitet der Vergleich auch mit Objekten anderen Typs korrekt\n assert_nothing_raised(\"Test auf Wertgleichheit mit Objekten anderen Typs darf keinen Fehler werfen\"){!(@rp1==7)}\n end",
"title": ""
},
{
"docid": "58d403de66889c95aa55149bf3d94f83",
"score": "0.48582214",
"text": "def gestionDroite()\n\t\t#choix technique\n\t\t@tabTechnique.each{ |t|\n\t\t\t@list.append_text(\"#{t}\")\n\t\t}\n\n\t\t@list.signal_connect('changed'){ |widget|\n\t\t\tHeader.penalite()\n\t\t\t@techniqueChoisie=widget.active_text()\n\t\t\t@techniqueObjet=@Techniques.creer(@techniqueChoisie)\n\t\t\t@nbEtape= recuperationNbEtape()\n\t\t\t@etapeEnCours=1\n\t\t\tactualisation()\n\t\t}\n\n\t\t#etapes\n\t\t@boutonEtapePrec.signal_connect('clicked'){\n\t\t\tif @etapeEnCours-1 > 0\n\t\t\t\t@etapeEnCours=@etapeEnCours-1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boutonEtapeSuiv.signal_connect('clicked'){\n\t\t\tif @etapeEnCours+1 <= @nbEtape\n\t\t\t\t@etapeEnCours=@etapeEnCours+1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boxEtape.add(@boutonEtapePrec)\n\t\t@boxEtape.add(@labelEtape)\n\t\t@boxEtape.add(@boutonEtapeSuiv)\n\n\t\t#explication\n @boxExplication.set_hexpand(true)\n @boxExplication.set_vexpand(true)\n\n @texteContenu.set_line_wrap(true)\n @boxTexte.add(@texteContenu)\n @boxContour.pack_start(@boxTexte, :expand => true, :fill => true)\n @boxExplication.pack_start(@boxContour, :expand => true, :fill => true)\n\n\t\t#add a la box\n\t\t@boxInfo.add(@labelChoix)\n\t\t@boxInfo.add(@list)\n\t\t@boxInfo.add(@labelChoix2)\n\t\t@boxInfo.add(@boxEtape)\n\t\t@boxInfo.add(@boxExplication)\n\tend",
"title": ""
},
{
"docid": "0edd32d6de1a10ae51ca22d79cc2077b",
"score": "0.48506108",
"text": "def mitch_hedberg; end",
"title": ""
},
{
"docid": "942cd891f0010bed62984c2a5d837f81",
"score": "0.48447672",
"text": "def extraer_elemento \n \n aux = @elemento\n @elemento = @elemento.next\n aux.value\n end",
"title": ""
},
{
"docid": "cd4490d159e2aee5100034f02e9c525b",
"score": "0.4841935",
"text": "def wagner; end",
"title": ""
},
{
"docid": "be410b61f42a7288c2b93fe492258e16",
"score": "0.4831137",
"text": "def einschalten() \n @schirm.farbe_aendern('gelb')\n @leuchtstrahl1.sichtbar_machen()\n @leuchtstrahl2.sichtbar_machen()\n @leuchtstrahl3.sichtbar_machen()\n @leuchtstrahl4.sichtbar_machen()\n @leuchtstrahl1.farbe_aendern('gelb')\n @leuchtstrahl2.farbe_aendern('gelb')\n @leuchtstrahl3.farbe_aendern('gelb')\n @leuchtstrahl4.farbe_aendern('gelb')\n end",
"title": ""
},
{
"docid": "f770ae63fb884e694e3b281097224966",
"score": "0.48162988",
"text": "def test_kopieren()\n rp1_kopie = @rp1.kopieren()\n assert(rp1_kopie.wort==@rp1.wort && rp1_kopie.zaehler()== @rp1.zaehler(),\"Keine korrekte Kopie des Inhalt\")\n assert(!@rp1_kopie.equal?(@rp1), \"Keine Kopie: es wurde nur eine Referenz auf self erzeugt\")\n end",
"title": ""
},
{
"docid": "b391795fe08d36b56853f0025c9e54f3",
"score": "0.48110875",
"text": "def gestionDroite()\n\t\t#choix technique\n\t\t@tabTechnique.each{ |t|\n\t\t\t@list.append_text(\"#{t}\")\n\t\t}\n\n\t\t@list.signal_connect('changed'){ |widget|\n\t\t\t@techniqueChoisie=widget.active_text()\n\t\t\t@techniqueObjet=@Techniques.creer(@techniqueChoisie)\n\t\t\t@nbEtape= recuperationNbEtape()\n\t\t\t@etapeEnCours=1\n\t\t\tactualisation()\n\t\t}\n\n\t\t#etapes\n\t\t@boutonEtapePrec.signal_connect('clicked'){\n\t\t\tif @etapeEnCours-1 > 0\n\t\t\t\t@etapeEnCours=@etapeEnCours-1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boutonEtapeSuiv.signal_connect('clicked'){\n\t\t\tif @etapeEnCours+1 <= @nbEtape\n\t\t\t\t@etapeEnCours=@etapeEnCours+1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boxEtape.add(@boutonEtapePrec)\n\t\t@boxEtape.add(@labelEtape)\n\t\t@boxEtape.add(@boutonEtapeSuiv)\n\n\t\t#explication\n @boxExplication.set_hexpand(true)\n @boxExplication.set_vexpand(true)\n\n @texteContenu.set_line_wrap(true)\n @boxTexte.add(@texteContenu)\n @boxContour.pack_start(@boxTexte, :expand => true, :fill => true)\n @boxExplication.pack_start(@boxContour, :expand => true, :fill => true)\n\n\t\t#add a la box\n\t\t@boxInfo.add(@labelChoix)\n\t\t@boxInfo.add(@list)\n\t\t@boxInfo.add(@labelChoix2)\n\t\t@boxInfo.add(@boxEtape)\n\t\t@boxInfo.add(@boxExplication)\n\tend",
"title": ""
},
{
"docid": "13f6133e409fce36de11146b12e38457",
"score": "0.4800711",
"text": "def element?; end",
"title": ""
},
{
"docid": "13f6133e409fce36de11146b12e38457",
"score": "0.4800711",
"text": "def element?; end",
"title": ""
},
{
"docid": "7d81086c4d1c4fd43bbee306b98a7fbe",
"score": "0.47932762",
"text": "def muster_erzeugen()\n end",
"title": ""
},
{
"docid": "ad2aa1b576f77b25897bf1b86523fb16",
"score": "0.47759455",
"text": "def set_werk\n @werk = Werk.find(params[:id])\n end",
"title": ""
},
{
"docid": "b5962fbedd259c345e0973e07f63c931",
"score": "0.47724178",
"text": "def wf_name; h.wf_name; end",
"title": ""
},
{
"docid": "cdd16ea92eae0350ca313fc870e10526",
"score": "0.47722203",
"text": "def who_we_are\r\n end",
"title": ""
},
{
"docid": "5cff9e3d29ec2e61cbb7d0b7f3ad9540",
"score": "0.47702613",
"text": "def weightPolls()\n\n end",
"title": ""
},
{
"docid": "1a9823f99e3188b29fe84fd243085700",
"score": "0.47541505",
"text": "def wander\n perturb_direction\n walk\n end",
"title": ""
},
{
"docid": "641d9c31f0abcb0af08078c84d93e737",
"score": "0.47539523",
"text": "def currentWeight() weighins.last.weight end",
"title": ""
},
{
"docid": "aa17253cd64fd9f17f063f8bcb2cc779",
"score": "0.4751635",
"text": "def adjust w\n end",
"title": ""
},
{
"docid": "aa17253cd64fd9f17f063f8bcb2cc779",
"score": "0.4751635",
"text": "def adjust w\n end",
"title": ""
},
{
"docid": "ab39aaa7dc9c5fff643a487ee592465b",
"score": "0.47469634",
"text": "def weight; end",
"title": ""
},
{
"docid": "270d587b9336f9e127032e690db4f7f5",
"score": "0.474236",
"text": "def sibling; end",
"title": ""
},
{
"docid": "b7c841cc1303b1629af7be1dcdd0db69",
"score": "0.47419724",
"text": "def w\n self[3]\n end",
"title": ""
},
{
"docid": "396b6a408d37b69a94eea4461109f839",
"score": "0.47297055",
"text": "def tower_1\n @@tower_1\n end",
"title": ""
},
{
"docid": "6b047b55172488806f9e4ab0e79905b2",
"score": "0.47190613",
"text": "def preamp\n @ole.Preamp\n end",
"title": ""
},
{
"docid": "751e01e026811b9c1188f52590844b8a",
"score": "0.47120222",
"text": "def active_element; end",
"title": ""
},
{
"docid": "a72adb30bdd2dc997548171e9a21aac4",
"score": "0.47111008",
"text": "def utiliser( objet )\n\t\t@jeu.joueur.utiliserObjet( objet )\n\t\trafraichir\n\tend",
"title": ""
},
{
"docid": "38fac9b8d1fad7e62e6069d8be8bc59d",
"score": "0.47030318",
"text": "def ausgabe\n\t\t@name\n\tend",
"title": ""
},
{
"docid": "97c5af340ba5e8f6958c50b6024fbc34",
"score": "0.4686328",
"text": "def england\n end",
"title": ""
},
{
"docid": "f96096399a5d513216d8dc55682dd6b6",
"score": "0.46842223",
"text": "def ToCoStoiPrzyA()\n return @RownanieWielomianu.first.WspolczynnikPomocniczy\n end",
"title": ""
},
{
"docid": "54dd2868222a8c7001ff7ade23bcdfc6",
"score": "0.46839908",
"text": "def invention; end",
"title": ""
},
{
"docid": "07b3d7f12f89ddadda2345b51b146e5c",
"score": "0.46747434",
"text": "def element_state; end",
"title": ""
}
] |
1bc6d0e31233676f5d06a44a285b3726
|
Fetch API Credentials for a client Author: Puneet Date: 29/01/2018 Reviewed By:
|
[
{
"docid": "3f1dcbc3df05620cd9c1513fde1323d6",
"score": "0.6644634",
"text": "def fetch_api_credentials\n\n # Return error if this request was not a XHR request\n if request.xhr?.nil?\n service_response = Result::Base.error(\n error: 'sc_1',\n error_message: 'not allowed',\n http_code: GlobalConstant::ErrorCode.forbidden\n )\n else\n service_response = ClientManagement::GetClientApiCredentials.new(params).perform\n end\n\n render_api_response(service_response)\n\n end",
"title": ""
}
] |
[
{
"docid": "644f026a18a7a83308227b89edc0133c",
"score": "0.68528956",
"text": "def fetch_api_credentials\n\n @client_api_credentials = ClientApiCredential.where(client_id: @client_id).last\n \n return validation_error(\n 'cm_gcac_2',\n 'invalid_api_params',\n ['invalid_client_id'],\n GlobalConstant::ErrorAction.mandatory_params_missing\n ) unless @client_api_credentials.present?\n\n success\n\n end",
"title": ""
},
{
"docid": "115257991e900fe263592a7bd5242d21",
"score": "0.66482705",
"text": "def fetch_api_credentials\n\n\n\n r = ClientManagement::ApiCredentials::Fetch.new(client_id: @client_id,\n show_keys_enable_flag: @show_keys_enable_flag,\n email_already_sent_flag: @email_already_sent_flag).perform\n return r unless r.success?\n\n api_credentials = r.data[:api_keys]\n\n @last_expiring_api_credentials = api_credentials.first\n\n return error_with_data(\n 'j_sakidmj_1',\n 'something_went_wrong',\n GlobalConstant::ErrorAction.default\n ) if @last_expiring_api_credentials.blank?\n\n @data_to_sync = {\n ost_token_id: @token_id,\n api_endpoint: GlobalConstant::SaasApi.api_endpoint_for_current_version,\n api_key: @last_expiring_api_credentials[:key],\n api_secret: @last_expiring_api_credentials[:secret]\n }\n\n success\n\n end",
"title": ""
},
{
"docid": "344ddf3f66631da52a3fb7999499db9a",
"score": "0.648324",
"text": "def credentials_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: CredentialApi#credentials_get ...\"\n end\n \n # resource path\n path = \"/credentials\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n query_params[:'user_id'] = opts[:'user_id'] if opts[:'user_id']\n query_params[:'connector_id'] = opts[:'connector_id'] if opts[:'connector_id']\n query_params[:'attr_key'] = opts[:'attr_key'] if opts[:'attr_key']\n query_params[:'attr_value'] = opts[:'attr_value'] if opts[:'attr_value']\n query_params[:'created_at'] = opts[:'created_at'] if opts[:'created_at']\n query_params[:'updated_at'] = opts[:'updated_at'] if opts[:'updated_at']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\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\n auth_names = ['quantimodo_oauth2']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'inline_response_200_11')\n if Configuration.debugging\n Configuration.logger.debug \"API called: CredentialApi#credentials_get. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "c2c7a387357ac4b6582a355cc2b9b291",
"score": "0.6439146",
"text": "def fetch_api_credentials_data\n\n #@api_credentials_data = ClientManagement::ApiCredentials::Fetch.new(client_id: @client_id).perform\n\n r = ClientManagement::ApiCredentials::Fetch.new(client_id: @client_id,\n show_keys_enable_flag: @show_keys_enable_flag,\n email_already_sent_flag: @email_already_sent_flag).perform\n return r unless r.success?\n\n @api_credentials_data = r.data[:api_keys]\n\n success\n end",
"title": ""
},
{
"docid": "6727223774d7f10c4aa0676fbe5257a0",
"score": "0.6412577",
"text": "def client\n Authorize.new_client(API_KEY, API_SECRET)\n end",
"title": ""
},
{
"docid": "130f1004c05f42827e7f8638f431a272",
"score": "0.6385225",
"text": "def fetch_api_credentials\n\n api_credentials = KitSaasSharedCacheManagement::ApiCredentials.new([@client_id]).fetch[@client_id]\n if api_credentials.length == 0\n return error_with_data(\n 's_cm_ac_f_4',\n 'something_went_wrong',\n GlobalConstant::ErrorAction.default,\n @client_id\n )\n end\n\n @api_credentials_data = api_credentials\n\n success\n end",
"title": ""
},
{
"docid": "c4186a5c19ce6603deb41de470bfd55e",
"score": "0.63842255",
"text": "def fetch_api_credentials\n\n api_credentials = KitSaasSharedCacheManagement::ApiCredentials.new([@client_id]).fetch[@client_id]\n if api_credentials.length == 0\n return error_with_data(\n 'a_s_dm_fd_2',\n 'something_went_wrong',\n GlobalConstant::ErrorAction.default,\n @client_id\n )\n end\n\n @api_keys = api_credentials\n\n success\n end",
"title": ""
},
{
"docid": "903989428fdb759bee280c4134123b97",
"score": "0.6298385",
"text": "def authors\n @authors ||= Sappiamo::API::Authors.new(credentials)\n end",
"title": ""
},
{
"docid": "a00b513333ac53442785d9a926b02ba9",
"score": "0.6249071",
"text": "def get_credentials!\n uri = URI(CREDS_ENDPOINT)\n req = Net::HTTP::Post.new(uri.request_uri)\n req.basic_auth(@api_key, \"\")\n resp = Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |https|\n https.request(req)\n end\n\n if resp.is_a?(Net::HTTPSuccess)\n JSON.parse(resp.body, {:symbolize_names => true})\n else\n raise CredentialsError.new(\"Error retrieving credentials; please try again shortly (#{resp.body})\")\n end\n end",
"title": ""
},
{
"docid": "40e798a7305b712ee4cb172b4839e611",
"score": "0.62470603",
"text": "def user_credentials\n # Build a per-request oauth credential based on token stored in session\n # which allows us to use a shared API client.\n @authorization ||= (\n auth = self.api_client.authorization.dup\n auth.redirect_uri = to('/auth')\n auth.update_token!(session)\n auth\n )\n end",
"title": ""
},
{
"docid": "18d3f54f0fe966d6df97567fa93f9279",
"score": "0.6243433",
"text": "def credentials\n {\n client_id: client_id,\n client_secret: client_secret,\n auth_code: auth_code\n }\n end",
"title": ""
},
{
"docid": "11f5c4ad019dfb1498057d9fe2a786a0",
"score": "0.61853325",
"text": "def credentials\n @apikey ? [@apikey, ''] : [@email, @password]\n end",
"title": ""
},
{
"docid": "d56fb537f7137c226bfd055755e5dddc",
"score": "0.6148498",
"text": "def generate_credentials\n self.client_id = ApiClient.unique_random(field_name: 'client_id')\n self.client_secret = ApiClient.unique_random(field_name: 'client_secret')\n end",
"title": ""
},
{
"docid": "6a8c2d370dca6827c6abc7bb2ff7520a",
"score": "0.61445385",
"text": "def credentials(authorizer)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n return credentials if credentials\n\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the resulting code after authorization\"\n puts url\n code = gets\n opts = { user_id: user_id, code: code, base_url: OOB_URI }\n authorizer.get_and_store_credentials_from_code(opts)\nend",
"title": ""
},
{
"docid": "8f6254793ac0d93273456318981a12bd",
"score": "0.6126264",
"text": "def fetch_client_details\n if is_ost_kyc_default_client?\n @campaign_api_key = GlobalConstant::PepoCampaigns.api_key\n @campaign_api_secret_d = GlobalConstant::PepoCampaigns.api_secret\n success\n else\n @client = Client.get_from_memcache(@hook.client_id)\n @client_pepo_campaign_detail_obj = ClientPepoCampaignDetail.get_from_memcache(@hook.client_id)\n @campaign_api_key = @client_pepo_campaign_detail_obj.api_key\n decrypt_api_secret\n end\n end",
"title": ""
},
{
"docid": "b27f275a7a40e4cdec6f81a8d466160f",
"score": "0.611711",
"text": "def fetch_api_codewars_user_info\n private_fetch_user_info\n end",
"title": ""
},
{
"docid": "9e5711bcac7a04d3d48cfa45ceebfcb8",
"score": "0.6060665",
"text": "def extra_auth_headers\n if client_id && using_basic_auth?\n { 'X-Ably-ClientId' => Base64.urlsafe_encode64(client_id) }\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "07a59453b7a3337459073d6d8a297698",
"score": "0.60510725",
"text": "def print_creds\n p \"in print creds\"\n # extract client_id from auth header\n client_id = request.headers['client']\n\n# update token, generate updated auth headers for response\n new_auth_header = {}\n new_auth_header['rest'] = 'testAAXX'\n\n# update response with the header that will be required by the next request\n response.headers.merge!(new_auth_header)\n\n end",
"title": ""
},
{
"docid": "223fc056e7107270bb096bfa8e4ca8f9",
"score": "0.6029549",
"text": "def get_oauth_authorizations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OAuthApi.get_oauth_authorizations ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/oauth/authorizations\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'OAuthAuthorizationListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OAuthApi#get_oauth_authorizations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0d0a7599faef31cf8737abf58d4fe03e",
"score": "0.5996802",
"text": "def get_oauth_authorization_with_http_info(client_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OAuthApi.get_oauth_authorization ...\"\n end\n \n \n # verify the required parameter 'client_id' is set\n fail ArgumentError, \"Missing the required parameter 'client_id' when calling OAuthApi.get_oauth_authorization\" if client_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/oauth/authorizations/{clientId}\".sub('{format}','json').sub('{' + 'clientId' + '}', client_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'OAuthAuthorization')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OAuthApi#get_oauth_authorization\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "bc296ee576f6aad87f52a5b319378033",
"score": "0.5991123",
"text": "def credentials(client_keys)\n developer_access_token = ENV['API_AI_DEVELOPER_ACCESS_TOKEN'] || client_keys[:developer_access_token]\n client_access_token = ENV['API_AI_CLIENT_ACCESS_TOKEN'] || client_keys[:client_access_token]\n\n {\n client_access_token: client_access_token,\n developer_access_token: developer_access_token\n }\n end",
"title": ""
},
{
"docid": "bdf08e1669c36e0fbd87941bc38facea",
"score": "0.5965571",
"text": "def custom_credentials \r\n app = App.find_by_subdomain(@request.query_parameters[\"app\"])\r\n \r\n # {\r\n # client_id: app.consumer_key,\r\n # client_secret: app.consumer_secret\r\n # }\r\n {\r\n consumer_key: app.consumer_key,\r\n consumer_secret: app.consumer_secret\r\n }\r\n end",
"title": ""
},
{
"docid": "a1ebe53d145aee29e1814566936baec3",
"score": "0.59422255",
"text": "def create_client_api_credentials\n return unless @client_api_needed\n\n result = generate_api_key_salt\n return unless result.success?\n\n api_salt = result.data\n\n api_credential = ClientApiCredential.new(\n client_id: @client_id,\n api_key: ClientApiCredential.generate_random_app_id,\n api_secret: ClientApiCredential.generate_encrypted_secret_key(api_salt[:plaintext]),\n api_salt: api_salt[:ciphertext_blob],\n expiry_timestamp: (Time.now+10.year).to_i\n )\n\n api_credential.save!\n\n end",
"title": ""
},
{
"docid": "0af2f6994e1e00d252ed3f496770d6f3",
"score": "0.5928241",
"text": "def post_auth_method authToken\n #just get the current user's information and print it out to the console\n userInfo = RestClient.get('https://api.mypurecloud.com/api/v2/users/me', {:Authorization => 'Bearer ' + authToken})\n\n puts JSON.pretty_generate (JSON.parse(userInfo))\n\nend",
"title": ""
},
{
"docid": "e4d7a2f6335ed9af7774b21d4b756627",
"score": "0.5907798",
"text": "def credentials\n n = Netrc.read\n auth = n[\"api.newrelic.com\"]\n\n if auth.nil?\n abort \"Plese authenticate first.\"\n else\n auth\n end\n end",
"title": ""
},
{
"docid": "b7f66cc7d6a67db8193f67b6966339ba",
"score": "0.5907209",
"text": "def credentials\n\t\t@oauth_client ||= OAuth::Consumer.new(key, secret)\n\tend",
"title": ""
},
{
"docid": "4bde42101da430a42aef0fe0f1018fe7",
"score": "0.59032166",
"text": "def client_credential_key\n @client_credential_key\n end",
"title": ""
},
{
"docid": "d5eb0d24184e0f0dc6cffffaca20ff64",
"score": "0.5889911",
"text": "def authorisation_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuthorisationApi.authorisation_get ...\"\n end\n # resource path\n local_var_path = \"/api/Authorisation\"\n\n # query parameters\n query_params = {}\n query_params[:'locationId'] = opts[:'location_id'] if !opts[:'location_id'].nil?\n query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?\n query_params[:'password'] = opts[:'password'] if !opts[:'password'].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', 'text/json', 'application/xml', 'text/xml'])\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 => 'AuthorisationResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthorisationApi#authorisation_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4d85ee286b513b24cc1330f480fd3ff3",
"score": "0.58893263",
"text": "def credentials\n @credentials ||= Plaid::Credentials.new(@client)\n end",
"title": ""
},
{
"docid": "14bf05f07dfc2b86a29bbd0a6cc5f33a",
"score": "0.5872278",
"text": "def get_auth\n { :user => @client.get_user, :pass => @client.get_pass }\n end",
"title": ""
},
{
"docid": "ee728b8616f7ba82609f671896c34e72",
"score": "0.5871543",
"text": "def authorize(user)\n FileUtils.mkdir_p(File.dirname(@CREDENTIALS_PATH))\n client_secrets = Google::APIClient::ClientSecrets.load\n @@client_secrets = ENV['GOOGLE_CALENDAR_SECRET']\n\n @@client_id = Google::Auth::ClientId.from_file(@CLIENT_SECRETS_PATH)\n\n @@token_store = Google::Auth::Stores::FileTokenStore.new(file: @CREDENTIALS_PATH)\n\n @@authorizer = Google::Auth::UserAuthorizer.new(@@client_id, @SCOPE, @@token_store)\n\n user_id = user\n code = gets \n credentials = authorizer.get_and_store_credentials_from_code(user_id: user_id, code: code, base_url: @OOB_URI)\n # credentials = @@authorizer.get_credentials(user_id)\n auth_client = client_secrets.to_authorization\nend",
"title": ""
},
{
"docid": "5396a6a11577ff40ebee59ce267ab575",
"score": "0.5868734",
"text": "def client_credentials\n @client_credentials ||= OAuth2::Strategy::ClientCredentials.new(self)\n end",
"title": ""
},
{
"docid": "2f8223c72a8cd3fa96e7d0f945f37366",
"score": "0.58226687",
"text": "def client_params\n case @client.options[:auth_scheme]\n when :request_body\n {'client_id' => @client.id, 'client_secret' => @client.secret}\n else\n {:headers => {'Authorization' => authorization(@client.id, @client.secret)}}\n end\n end",
"title": ""
},
{
"docid": "e0cf4c87d75c1aaa40f842114f921a6b",
"score": "0.580888",
"text": "def initialize(params)\n\n @client_id = params[:client_id]\n\n @api_credential = nil\n\n end",
"title": ""
},
{
"docid": "d22e4b80f02819d51289bfee42074f4f",
"score": "0.5787486",
"text": "def setCredentials\n if @token.blank?\n creds = Base64.strict_encode64(\"#{@clientID}:#{@clientSecret}\")\n return \"basic #{creds}\"\n else\n return \"bearer #{@token}\"\n end\n end",
"title": ""
},
{
"docid": "c7ba66352a8e163045095dc3d15a39c7",
"score": "0.578683",
"text": "def credentials(version = nil)\n validate_headers_for_server(version)\n result = case @credentials[:method]\n when :CLIENTLOGIN\n {:email => @credentials[:email],\n :password => @credentials[:password],\n :logintoken => @credentials[:logintoken],\n :logincaptcha => @credentials[:logincaptcha]}\n when :OAUTH\n {:oauth_consumer_key => @credentials[:oauth_consumer_key],\n :oauth_consumer_secret => @credentials[:oauth_consumer_secret],\n :oauth_verification_code => @credentials[:oauth_verification_code],\n :oauth_token => @credentials[:oauth_token],\n :oauth_token_secret => @credentials[:oauth_token_secret],\n :oauth_callback => @credentials[:oauth_callback],\n :oauth_method => @credentials[:oauth_method],\n :oauth_request_token => @credentials[:oauth_request_token]}\n end\n client_lib = 'AwApi-Ruby-%s|' % AdwordsApi::ApiConfig::CLIENT_LIB_VERSION\n user_agent = @credentials[:user_agent] || $0\n user_agent = client_lib + user_agent\n user_agent_symbol = (version == :v13) ? :useragent : :userAgent\n result[user_agent_symbol] = user_agent\n result[:developerToken] = @credentials[:developer_token]\n unless @use_mcc\n if @credentials[:client_customer_id]\n result[:clientCustomerId] = @credentials[:client_customer_id]\n elsif @credentials[:client_email] and version != :v201109\n result[:clientEmail] = @credentials[:client_email]\n end\n end\n if version != :v13\n result[:validateOnly] = 'true' if @validate_only\n result[:partialFailure] = 'true' if @partial_failure\n end\n return result.reject {|k,v| v.nil?}\n end",
"title": ""
},
{
"docid": "22297e7316e7874f0ff807638317b874",
"score": "0.57813436",
"text": "def client_params\n {\n :site => \"https://basecamp.com/#{account_id}/api/v1\",\n :token_url => \"/authorization/token?type=refresh&refresh_token=#{refresh_token}\",\n :authorize_url => \"/authorization/new\"\n }\n end",
"title": ""
},
{
"docid": "e236129954b6424e004c269ff94b94b7",
"score": "0.5781171",
"text": "def perform\n\n r = validate_client\n return r unless r.success?\n\n r = fetch_api_credentials\n return r unless r.success?\n\n r = decrypt_api_secret\n return r unless r.success?\n\n success_with_data(\n api_credentials: {\n api_key: @client_api_credentials.api_key,\n api_secret: @api_secret_d\n }\n )\n\n end",
"title": ""
},
{
"docid": "5f587fc72a08ef95a80fa6f39f2db53d",
"score": "0.57795",
"text": "def user_provided_credentials\n user_authorizer.get_and_store_credentials_from_code(user_id: user_id, code: user_provided_code, base_url: BASE_URL)\n end",
"title": ""
},
{
"docid": "f998bb4a28b38a4d82350c690e63a7b9",
"score": "0.5775396",
"text": "def credentials\n \tfile = File.read(\"../Credentials.json\")\n\t \tfileParse = JSON.parse(file)\n\t\t authorisation = 'Basic '+Base64.strict_encode64(fileParse['API_LoginCommon']+\":\"+fileParse['transaction_keyCommon'])\n\t\t #Invoice\n\t\t #authorisation = 'Basic '+Base64.strict_encode64(fileParse['API_Login']+\":\"+fileParse['transaction_key'])\n\t\t authorisation\n\t\tend",
"title": ""
},
{
"docid": "67f1f9263beaef335122c8cea4b4bd6d",
"score": "0.5771921",
"text": "def get_auth(api_key)\n response = RestClient.get \"#{BASE_URL}#{AUTH_URL}\", {'Api-Key' => api_key, 'Accept' => VERSION}\n token = JSON.parse(response.body)[\"token\"]\n #authorization = 'Service ' + token\n authorization = 'Admin ' + token\n end",
"title": ""
},
{
"docid": "b7cb9ea3f9c0478e89b8e68a92766308",
"score": "0.57659566",
"text": "def get_oauth_clients_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OAuthApi.get_oauth_clients ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/oauth/clients\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'OAuthClientEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OAuthApi#get_oauth_clients\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ff254770d83d27ce3192557b61da317a",
"score": "0.57574075",
"text": "def credentials\n {\n client_id: @client_id,\n institution: @institution,\n p_key: @p_key\n }\n end",
"title": ""
},
{
"docid": "56dfea06fb7329716316ec56f7950a84",
"score": "0.57517344",
"text": "def fetch_client_token\n\n @client_token = CacheManagement::ClientToken.new([@client_token_id]).fetch[@client_token_id]\n return validation_error(\n 'e_tss_b_1',\n 'invalid_api_params',\n ['invalid_client_token_id'],\n GlobalConstant::ErrorAction.default\n ) if @client_token.blank?\n\n @client_id = @client_token[:client_id]\n\n success\n\n end",
"title": ""
},
{
"docid": "903873132c75e426f7392c92b5dca1f6",
"score": "0.5749358",
"text": "def api_client\n client = Google::APIClient.new(\n :application_name => 'Ruby Calendar sample',\n :application_version => '1.0.0')\n \n file_storage = Google::APIClient::FileStorage.new(CREDENTIAL_STORE_FILE)\n if file_storage.authorization.nil?\n client_secrets = Google::APIClient::ClientSecrets.load\n client.authorization = client_secrets.to_authorization\n client.authorization.scope = 'https://www.googleapis.com/auth/calendar'\n else\n client.authorization = file_storage.authorization\n end\n client\n end",
"title": ""
},
{
"docid": "12c8e63722bb6298e778d5fa94c05bf0",
"score": "0.57414395",
"text": "def get_authors\n return @client.raw(\"get\", \"/content/authors\")\n end",
"title": ""
},
{
"docid": "e97939b4f8d7ca9e8689bfeb5784135f",
"score": "0.5737097",
"text": "def get_api_key\n enterprise = get_enterprise\n Octo::Authorization.find_by_username(enterprise.name).apikey\n end",
"title": ""
},
{
"docid": "6c9550f94b90a345fbbc004b796ebd45",
"score": "0.5724437",
"text": "def auth\n auth_type = 'cookie'\n auth_type = 'api_key' if api_key_headers?\n auth_owner = method(\"#{auth_type}_owner\").call\n 'Bearer ' + codec.encode(auth_owner.as_payload) # encoded user info\n end",
"title": ""
},
{
"docid": "7976323ca50100f3cfdbbe3b706fb6fa",
"score": "0.5705175",
"text": "def get_credentials(enterprise)\n ent_id = get_enterprise_id(enterprise)\n request = Net::HTTP::Get.new(\"#{@conf.location}/admin/enterprises/#{ent_id}/credentials\")\n request.add_field('accept', 'application/vnd.abiquo.publiccloudcredentialslist+json')\n puts \"Retrieving credentials for enterprise #{enterprise}...\"\n send_request(request).body\n end",
"title": ""
},
{
"docid": "61fae89777431c1b78ebabfecede9d0e",
"score": "0.5704029",
"text": "def credentials\n creds = {}\n keyauth_creds = KeyauthCredential.where(:consumer, self, api_client: api_client)\n creds['key-auth'] = keyauth_creds if keyauth_creds\n basicauth_creds = BasicauthCredential.where(:consumer, self, api_client: api_client)\n creds['basic-auth'] = basicauth_creds if basicauth_creds\n jwt_creds = JWTCredential.where(:consumer, self, api_client: api_client)\n creds['jwt'] = jwt_creds if jwt_creds\n creds\n end",
"title": ""
},
{
"docid": "ccf16699be577a12f8c47e95a9267573",
"score": "0.56887037",
"text": "def api_auth_header\n \"#{self.user}:#{self.api_key}\"\n end",
"title": ""
},
{
"docid": "9cc5f83a87e59c200f856aeb95353a77",
"score": "0.5687974",
"text": "def auth_client\n @auth_client ||=\n Octokit::Client.new login: ENV['GITHUB_LOGIN'], password: ENV['GITHUB_PASSWORD']\n end",
"title": ""
},
{
"docid": "8cf8fb66accc1767968b80ba9154b845",
"score": "0.5687683",
"text": "def credentials; end",
"title": ""
},
{
"docid": "480c583c71bf178325d85fb605a71e6d",
"score": "0.568363",
"text": "def author_roles\n @author_roles ||= Sappiamo::API::AuthorRoles.new(credentials)\n end",
"title": ""
},
{
"docid": "494698caf4d67f8598e11e62bf3f8d06",
"score": "0.56683713",
"text": "def fetch_client_token\n\n @client_token = CacheManagement::ClientToken.new([@client_token_id]).fetch[@client_token_id]\n return validation_error(\n 'cum_lu_4',\n 'invalid_api_params',\n ['invalid_client_token_id'],\n GlobalConstant::ErrorAction.default\n ) if @client_token.blank?\n\n success\n\n end",
"title": ""
},
{
"docid": "71e152edd2660cc28f354a60cf64e3c9",
"score": "0.56677854",
"text": "def fetch_client_token_secure\n @client_token_secure = CacheManagement::ClientTokenSecure.new([@client_token_id]).fetch[@client_token_id]\n\n returnvalidation_error(\n 'e_gtss_2',\n 'invalid_api_params',\n ['invalid_client_token_id'],\n GlobalConstant::ErrorAction.default\n ) if @client_token_secure.blank?\n\n @api_response_data[:client_bt_addresses] = {\n erc20_contract_address: @client_token_secure[:token_erc20_address],\n airdrop_contract_address: @client_token_secure[:airdrop_contract_address],\n reserve_uuid: @client_token_secure[:reserve_uuid],\n reserve_address: @client_token_secure[:reserve_address],\n airdrop_holder_address: @client_token_secure[:airdrop_holder_address]\n }\n\n success\n\n end",
"title": ""
},
{
"docid": "c888a67a43f5b0e85167365859c70e95",
"score": "0.566231",
"text": "def auth\n client.auth\n end",
"title": ""
},
{
"docid": "25e9ebe4380d0471f144f75c36737580",
"score": "0.56490135",
"text": "def get_user_info\n response = RestClient.get 'https://iapi.merck.com/oauth2/v1/userinfo',\n { 'Authorization' => 'Bearer ' + params[\"token\"] }\n if response.code == 200\n JSON.parse(response)\n end\n rescue RestClient::Unauthorized => e\n # TODO what to do with the exception? :)\n puts 'You are so unauthorized :O'\n nil\n end",
"title": ""
},
{
"docid": "54261a5149c3d02301414de9db465df4",
"score": "0.5646389",
"text": "def crt_fetch_credentials\n creds, expiration = fetch_credentials\n crt_creds = Aws::Crt::Auth::StaticCredentialsProvider.new(\n creds.access_key_id,\n creds.secret_access_key,\n creds.session_token\n )\n [crt_creds, expiration]\n end",
"title": ""
},
{
"docid": "c9700d26a9d8f6771d1285e5a65aebb3",
"score": "0.5639857",
"text": "def client_credential\n if client_credential_key && client_credential_secret\n ::Signet::OAuth1::Credential.new(\n client_credential_key,\n client_credential_secret\n )\n elsif !client_credential_key && !client_credential_secret\n nil\n else\n raise ArgumentError,\n \"The client credential key and secret must be set.\"\n end\n end",
"title": ""
},
{
"docid": "93c664bdc6ca047cc5404d5181b49ed9",
"score": "0.562601",
"text": "def get_clients token\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Accounts/GetClients\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n request = Net::HTTP::Get.new uri.request_uri\n request['Authorization'] = get_authorization_header token \n\n response = http.request request\n puts \"#{response.code} #{response.message}\"\n \n if response.kind_of? Net::HTTPSuccess\n feed = JSON.parse response.body\n if feed[\"value\"]\n for client in feed[\"value\"]\n puts \"#{client['Id']} #{client['Email']}\"\n end\n end \n end\nend",
"title": ""
},
{
"docid": "2f6f8dff700e1f796b896c6fe7edadd7",
"score": "0.56191295",
"text": "def take_json (client_id, token)\n\turi = URI.parse(KEYCLOAK_REALM_URL + client_id)\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Authorization\"] = \"bearer \" + token\n\n\treq_options = {\n \tuse_ssl: uri.scheme == \"https\",\n\t}\n\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n \thttp.request(request)\n\tend\nend",
"title": ""
},
{
"docid": "997673ef23d99b7cc3e010f7ab7bdca0",
"score": "0.5614022",
"text": "def authorize\n create_token_file\n client_id = Google::Auth::ClientId.from_hash CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = 'default'\n credentials = authorizer.get_credentials user_id\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n\n credentials\nend",
"title": ""
},
{
"docid": "3142f866d0a6f40a4710f38dd141b119",
"score": "0.5613858",
"text": "def obtain_auth_data(username, password, client_id, client_secret)\n conn = Faraday.new(:url => AUTH_API_URL) do |faraday|\n faraday.adapter Faraday.default_adapter\n end\n\n response = conn.post do |req|\n req.headers['Content-Type'] = 'application/json'\n req.body = {\n 'grant_type' => 'password',\n 'scope' => 'organizations apps issues features account twitter_client_apps beta software answers',\n 'username' => username,\n 'password' => password,\n 'client_id' => client_id,\n 'client_secret' => client_secret\n }.to_json\n end\n JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "0241111a26c0e2a099566756765d2412",
"score": "0.5613511",
"text": "def authorize\n client_id = Google::Auth::ClientId.new(CREDENTIALS_PATH['installed']['client_id'], CREDENTIALS_PATH['installed']['client_secret'])\n # CREDENTIALS_PATH['installed']['client_id'] # Google::Auth::ClientId.from_file CREDENTIALS_PATH\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE, token_store\n user_id = \"default\"\n credentials = authorizer.get_credentials user_id\n\n if credentials.nil?\n url = authorizer.get_authorization_url base_url: OOB_URI\n puts \"Open the following URL in the browser and enter the \" \\\n \"resulting code after authorization:\\n\" + url\n code = \"4/1AfDhmrjKqjOnmdD6-sGTL658hi6uc5qua8ylpFT5Hsow3LsDZk_vPF30HcU\" # gets\n puts gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "a52f28ea549270c79e8d23fa2581b628",
"score": "0.5612437",
"text": "def client_context\n # Use static access token from environment.\n { access_token: Expertiza::GitHub::Application.secrets.github_access_token }\n end",
"title": ""
},
{
"docid": "b7e80024365e743ef5d4201393f31df4",
"score": "0.56088096",
"text": "def client_creds\n return @rpcclient, @host, @port, @share, @user, @pass, @domain\n end",
"title": ""
},
{
"docid": "19fbdf411ca12e8e6f05ddfaa7ab1b42",
"score": "0.56065613",
"text": "def custom_credentials\n account = Account.find_by!(subdomain: @request.subdomain)\n {\n client_id: account.twitter_consumer_key,\n client_secret: account.twitter_consumer_secret\n }\n end",
"title": ""
},
{
"docid": "3629ca3036bdb9476a302a222af32d03",
"score": "0.560591",
"text": "def get_mentions\n RestClient.get \"https://#{@username}:#{@password}@convore.com/api/account/online.json\"\n end",
"title": ""
},
{
"docid": "25787de210697d4ab5d4c22d09c84e79",
"score": "0.5603236",
"text": "def api_key\n @auth[:username]\n end",
"title": ""
},
{
"docid": "fe2b72025945ba1cacf9f177d5bc3517",
"score": "0.56012374",
"text": "def show\n authorize @api_client\n end",
"title": ""
},
{
"docid": "e91d2672a1f669e3feec8e02034beb3f",
"score": "0.5596679",
"text": "def get_credentials\n client_id = Google::Auth::ClientId.from_file(credential_fpath)\n token_store = Google::Auth::Stores::FileTokenStore.new( :file => token_store_fp)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, OAuth2_SCOPE_read_photo, token_store)\n \n user_id = ENV['USER']\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI )\n puts \"Open #{url} in your browser and enter the resulting code:\"\n code = STDIN.gets\n # @@logger.debug \"gets code : #{code.inspect }\".green\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n \n # OK to use credentials\n # @@logger.debug \"Google API credentials : #{credentials.inspect}\"\n credentials\n end",
"title": ""
},
{
"docid": "842217582cb75647973751d17f4d5787",
"score": "0.55921113",
"text": "def authenticate_client\n clients = ApiClient.where(client_id: @client_id)\n return nil unless clients.present? && clients.any?\n\n clnt = clients.first\n clnt.secret == @client_secret ? clnt : nil\n end",
"title": ""
},
{
"docid": "ea5e69077c63f768417c147615bc386a",
"score": "0.5583656",
"text": "def fetch_token_credential options = {}\n options[:connection] ||= Faraday.default_connection\n request = generate_token_credential_request options\n request_env = request.to_env options[:connection]\n request_env[:request] ||= request\n response = options[:connection].app.call request_env\n return ::Signet::OAuth1.parse_form_encoded_credentials response.body if response.status.to_i == 200\n message = if [400, 401, 403].include? response.status.to_i\n \"Authorization failed.\"\n else\n \"Unexpected status code: #{response.status}.\"\n end\n message += \" Server message:\\n#{response.body.to_s.strip}\" unless response.body.to_s.strip.empty?\n raise ::Signet::AuthorizationError.new(\n message, request: request, response: response\n )\n end",
"title": ""
},
{
"docid": "c9f3982edf7bed2ef08d911ab68efe58",
"score": "0.5576042",
"text": "def fetch_client_token\n\n @client_token = CacheManagement::ClientToken.new([@client_token_id]).fetch[@client_token_id]\n\n return validation_error(\n 'e_t_fh_2',\n 'invalid_api_params',\n ['invalid_client_id'],\n GlobalConstant::ErrorAction.default\n ) if @client_token.blank?\n\n success\n\n end",
"title": ""
},
{
"docid": "6cf8f6ed5dd31b37bf8470b162728be0",
"score": "0.5576019",
"text": "def get_auth_client\n @auth_client\n end",
"title": ""
},
{
"docid": "027052d386dc27ae20f00e2e523f5d2c",
"score": "0.55748343",
"text": "def fetch_client\n @client = Client.get_client_for_api_key_from_memcache(@api_key)\n end",
"title": ""
},
{
"docid": "469800907b10d6d2c5c3e98e6c1cf30c",
"score": "0.55743235",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::RedisTokenStore.new\n authorizer = Google::Auth::UserAuthorizer.new(\n client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n if credentials.nil?\n url = authorizer.get_authorization_url(\n base_url: OOB_URI)\n puts \"Open the following URL in the browser and enter the \" +\n \"resulting code after authorization\"\n puts url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI)\n end\n credentials\nend",
"title": ""
},
{
"docid": "ace134f8f8321ef0bf31792421d3d806",
"score": "0.55693924",
"text": "def author\n @author_data ||= read(\"/user/#{@author}/about.json\", :handler => \"User\")\n end",
"title": ""
},
{
"docid": "3cfbf4d93fd5f948a9ef4cd6bb16afb4",
"score": "0.5568936",
"text": "def makeAuthAPICall(url = API_BASE)\n request_url = \"#{url}/client/#{@client_id}/authenticate?apikey=#{@api_key}\"\n begin\n response = RestClient.get(request_url)\n return response\n rescue RestClient::Exception => error\n begin\n response = JSON.parse(error.response)\n\n unless response\n raise InvalidRequestException, \"The Import API returned: #{error.http_code} #{error.message}\"\n end\n\n raise InvalidRequestException,\n \"The Import API returned: #{response['code']} #{response['message']}. Reasons: #{response['reasons']}\"\n rescue JSON::ParserError, TypeError => json_parse_error\n raise InvalidResponseException,\n \"RestClientError: #{error.class}\\n Message: #{error.message}\\n Response Code: #{error.http_code}\\n Full Response: #{error.response}\"\n end\n end\n end",
"title": ""
},
{
"docid": "329571681b25e23ba2e1346f508bf1d7",
"score": "0.55684656",
"text": "def authenticate\n init_client\n uri = @client.authorization.authorization_uri\n code = scrape_web_and_return_code(uri)\n @client.authorization.code = code\n @client.authorization.fetch_access_token!\n @drive = @client.discovered_api('drive', 'v2')\n end",
"title": ""
},
{
"docid": "2874190ff8df566038d18007f08c1b62",
"score": "0.55652696",
"text": "def auth\n begin\n product_response = client.auth.get(access_token)\n pretty_print_response(product_response)\n content_type :json\n { auth: product_response }.to_json\n rescue Plaid::PlaidAPIError => e\n error_response = format_error(e)\n pretty_print_response(error_response)\n content_type :json\n error_response.to_json\n end\n end",
"title": ""
},
{
"docid": "08866c8a315de0c6ffd9260183832cce",
"score": "0.5557788",
"text": "def details\n response = cs_get \"/clients/#{client_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"title": ""
},
{
"docid": "d0876657eb19756a2fd6a201b2b1fdd5",
"score": "0.5555722",
"text": "def auth\n { username: api_key, password: api_secret}\n end",
"title": ""
},
{
"docid": "c1b92dd96904428d56bacd1069345a99",
"score": "0.5553367",
"text": "def get_with_client_token(path, params = {})\n params[:oauth_token] = Stagehand.get_client_token\n HTTParty.get(Stagehand.config.resource_host + path, query: params).parsed_response\n end",
"title": ""
},
{
"docid": "0563857e226451e3f4191b5be1235875",
"score": "0.5552531",
"text": "def api_credential(declaration_opts={})\n required_in_production({\n :type => :string,\n :default => DUMMY_API_KEY,\n }.merge(declaration_opts))\n end",
"title": ""
},
{
"docid": "cd666628bceb5fcc3ced3cdbfeebfcbb",
"score": "0.5549013",
"text": "def get_credentials\n print \"Your name: \"\n @author_name = STDIN.gets.strip.to_s\n print \"Your Emailaddress: \"\n @emailaddr = STDIN.gets.strip.to_s\n print \"Choose a password: \"\n @pw = STDIN.gets.strip.to_s\n get_credentials if commit_credentials == false\n end",
"title": ""
},
{
"docid": "a90980782ceaaa5cbf8784a76cab4e87",
"score": "0.5544999",
"text": "def fetch_client_token\n\n @client_token = CacheManagement::ClientToken.new([@client_token_id]).fetch[@client_token_id]\n\n return validation_error(\n 'e_t_s_1',\n 'invalid_api_params',\n ['invalid_client_token_id'],\n GlobalConstant::ErrorAction.default\n ) if @client_token.blank?\n\n success\n\n end",
"title": ""
},
{
"docid": "83136bbb571861305c8900a90daf36b1",
"score": "0.5544573",
"text": "def client_credential_secret\n @client_credential_secret\n end",
"title": ""
},
{
"docid": "f29524147c631adec5dc0f2a60177605",
"score": "0.5543612",
"text": "def creditors\n @creditors ||= Services::CreditorsService.new(@api_service)\n end",
"title": ""
},
{
"docid": "b05468a4c8919c8f151c9bacec5e1294",
"score": "0.5542632",
"text": "def credentials\n auth_hash['credentials']\n end",
"title": ""
},
{
"docid": "b05468a4c8919c8f151c9bacec5e1294",
"score": "0.5542632",
"text": "def credentials\n auth_hash['credentials']\n end",
"title": ""
},
{
"docid": "e789b9eefbaabbd51ac4cc2bdf5074c7",
"score": "0.55361354",
"text": "def fetch_api_console_data\n\n result = CacheManagement::ClientApiCredentials.new([@client_id]).fetch[@client_id]\n return validation_error(\n 'e_tss_tw_2',\n 'invalid_api_params',\n ['invalid_client_id'],\n GlobalConstant::ErrorAction.default\n ) if result.blank?\n\n # Create OST Sdk Obj\n ost_sdk = OSTSdk::Saas::Services.new(\n api_key: result[:api_key],\n api_secret: result[:api_secret],\n api_base_url: GlobalConstant::SaasApi.v1dot1_base_url,\n api_spec: true\n )\n\n @ost_spec_sdk_obj = ost_sdk.services.actions\n\n api_spec_service_response = @ost_spec_sdk_obj.create(api_spec_params)\n\n return api_spec_service_response unless api_spec_service_response.success?\n\n api_spec_service_response.data[:request_uri].gsub!(GlobalConstant::SaasApi.base_url, GlobalConstant::SaasApi.display_only_base_url)\n\n @api_response_data[:api_console_data] = {\n transaction_kind: {\n create: api_spec_service_response.data\n }\n }\n\n success\n end",
"title": ""
},
{
"docid": "3d58c250b1bf0e1fbac03ec85ee10c3d",
"score": "0.5531279",
"text": "def client_id\n ENV['ORCID_CLIENT_ID']\n end",
"title": ""
},
{
"docid": "a63869f19489abeb3a3f935de04fac3c",
"score": "0.55309284",
"text": "def fetch_additional_headers\n api_key = params.fetch('api_key', '')\n { 'Authorization' => api_key }\n end",
"title": ""
},
{
"docid": "d30310194f0cd3467f9d391dec692ca0",
"score": "0.5524989",
"text": "def initialize(params)\n @client_id = params[:client_id]\n @api_credentials = nil\n @response_data = {api_credentials: []}\n end",
"title": ""
},
{
"docid": "c433fd1f08499835dc698155b0c8c979",
"score": "0.55242836",
"text": "def client_params\n { \n :consumer_key => config[:consumer_key],\n :consumer_secret => config[:consumer_secret],\n :access_token => config[:access_token],\n :access_token_secret => config[:access_token_secret]\n }\n end",
"title": ""
},
{
"docid": "da496327369086b5d7b5289e88c03c38",
"score": "0.55194485",
"text": "def github_client\n Octokit::Client.new access_token: self.setting.user_with_token.client_token\n end",
"title": ""
},
{
"docid": "72fe8a894c3ae8636b8bdc2f571ffbff",
"score": "0.55193347",
"text": "def authorize\n client_id = Google::Auth::ClientId.from_file(ENV['CAL_CREDENTIALS_FILE'])\n token_store = Google::Auth::Stores::FileTokenStore.new(file: ENV['CAL_TOKEN_FILE'])\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCOPE, token_store)\n user_id = 'default'\n credentials = authorizer.get_credentials(user_id)\n\n if credentials.nil?\n url = authorizer.get_authorization_url(base_url: OOB_URI)\n puts 'Open the following URL in the browser and enter the ' \\\n \"resulting code after authorization:\\n\" + url\n code = gets\n credentials = authorizer.get_and_store_credentials_from_code(\n user_id: user_id, code: code, base_url: OOB_URI\n )\n end\n credentials\nend",
"title": ""
},
{
"docid": "d1c11412651c6a9081ee42a0a40d66e7",
"score": "0.55161124",
"text": "def oauth2_authorization(client,owner)\n Oauth2Authorization.find_by_oauth2_client_id_and_oauth2_resource_owner_id(client.id,owner.id)\n end",
"title": ""
}
] |
89bc72de5c653ae73585980429ea0744
|
POST /prescribtions POST /prescribtions.json
|
[
{
"docid": "41c887fb978e5f2f7e21cbbf44e09ca5",
"score": "0.67857987",
"text": "def create\n @prescribtion = Prescribtion.new(prescribtion_params)\n\n respond_to do |format|\n if @prescribtion.save\n format.html { redirect_to @prescribtion, notice: 'Prescribtion was successfully created.' }\n format.json { render :show, status: :created, location: @prescribtion }\n else\n format.html { render :new }\n format.json { render json: @prescribtion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "7afe6ee9d70dbc11b2056ed8b0a17bc3",
"score": "0.64532876",
"text": "def index\n @prescribtions = Prescribtion.all\n end",
"title": ""
},
{
"docid": "34b90bc2fffadcbc8e208c5dc20d86e6",
"score": "0.6441915",
"text": "def create\n\t\tnew_prescription = current_user.prescriptions.create!(rx_params)\n\t\trender json: new_prescription\n\tend",
"title": ""
},
{
"docid": "d6b2ef618ed6f741882e0f3fa4f59921",
"score": "0.6354895",
"text": "def create\n @subscribtion = Subscribtion.new(params[:subscribtion])\n\n respond_to do |format|\n if @subscribtion.save\n format.html { redirect_to @subscribtion, notice: 'Subscribtion was successfully created.' }\n format.json { render json: @subscribtion, status: :created, location: @subscribtion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscribtion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b666ccb068bb19cda207691932cb6506",
"score": "0.6346363",
"text": "def create\n @prescription = @user.prescriptions.build(params[:prescription])\n\n respond_to do |format|\n if @prescription.save\n format.json { render json: @prescription, status: :created, location: @prescription }\n else\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "139a410866580abd4a75296f5fce6325",
"score": "0.6272258",
"text": "def subscribe\n\n Subscriber.create(:address => params[:address], :countries => params[:countries])\n \n if params[:countries] == 'all'\n\n RestClient.post(\"https://api:%s\" \\\n \"@api.mailgun.net/v3/lists/all@coronanews.ca/members\" % ENV['MAILGUN_APIKEY'],\n :subscribed => true,\n :address => params[:address])\n\n render json: :OK\n \n else\n\n for country in params[:countries] do\n RestClient.post(\"https://api:%s\" \\\n \"@api.mailgun.net/v3/lists/%s@coronanews.ca/members\" % [ ENV['MAILGUN_APIKEY'], country ],\n :subscribed => true,\n :address => params[:address])\n \n end \n render json: :OK\n\n end\n end",
"title": ""
},
{
"docid": "9674100f95cf4ff91d7545b0f179d26c",
"score": "0.6183803",
"text": "def create_subscriptions(scope:, **options)\n \t\tresponse = client.post(subscriptions_path , scope, options)\n\n \t\tSubscription.new(subscription_id: response[\"_id\"], url: response[\"url\"], payload: response)\n \tend",
"title": ""
},
{
"docid": "ddb844849480b206ada330b8085c9d5d",
"score": "0.6140184",
"text": "def create\n authorize! :create, Prescription\n @prescription = Prescription.new(prescription_params)\n if @prescription.save\n respond_with @prescription, serializer: PrescriptionSerializer\n #render json: {success: true, message: \"Prescriptions Updated!\"}\n else\n render json: {success: false, errors: @prescription.errors}\n end\n end",
"title": ""
},
{
"docid": "aa192fd6b54dbaa162639481047d1d09",
"score": "0.6098563",
"text": "def create\n @prescripcion = Prescripcion.new(prescripcion_params)\n\n respond_to do |format|\n if @prescripcion.save\n format.html { redirect_to @prescripcion, notice: 'Prescripcion was successfully created.' }\n format.json { render :show, status: :created, location: @prescripcion }\n else\n format.html { render :new }\n format.json { render json: @prescripcion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbae78f13d70e90fd25268c0dc83758f",
"score": "0.60612476",
"text": "def send_subscription(sender)\n begin\n response = RestClient.post(\n \"#{@environment}/pre-approvals?email=#{@email}&token=#{@token}\", \n sender.to_json, \n {\n content_type: \"application/json;charset=ISO-8859-1\",\n accept: \"application/vnd.pagseguro.com.br.v3+xml;charset=ISO-8859-1\"\n }\n )\n xml = Nokogiri::XML(response)\n data = Subscription::Serializer.new(xml).preapproval_code\n Rails.logger.info { \"SUCCESS -- PREAPPROVAL: #{data[:code]} > MSG: SUBSCRIBED\" }\n return { :error => false, :code => data[:code] }\n\n rescue RestClient::ExceptionWithResponse => e\n error = PsegRecurring::Error.new(e.response).process\n return { :error => true, :detail => error[:errors] }\n\n rescue StandardError => e\n Rails.logger.error { \"STD ERROR -- MSG: #{e.response}\" }\n return { :error => true, :detail => e.response }\n end\n end",
"title": ""
},
{
"docid": "404153c2cfe8914aa901d0edb85a0f30",
"score": "0.6060524",
"text": "def create\n @subscription = @user.subscriptions.new(subscription_params)\n if @subscription.save\n render json: @subscription\n else\n render json: { error: @subscription.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "438dc323da196a06598a4296778352a5",
"score": "0.60517985",
"text": "def set_prescribtion\n @prescribtion = Prescribtion.find(params[:id])\n end",
"title": ""
},
{
"docid": "826de76bb12b52f753cbd412a1ed7b82",
"score": "0.6011241",
"text": "def create\n @prescri = Prescri.new(prescri_params)\n respond_to do |format|\n if @prescri.save\n format.html { redirect_to @prescri, notice: '新处方生成.' }\n format.json { render action: 'show', status: :created, location: @prescri }\n else\n format.html { render action: 'new' }\n format.json { render json: @prescri.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff10206373479a3e5e4d51fd4896649a",
"score": "0.5924717",
"text": "def create_subscription(url, events)\n params = { url: url, events: events }\n\n request :post,\n '/v3/subscriptions.json',\n params\n end",
"title": ""
},
{
"docid": "68d18496b06131f801f77c1dfba21b7e",
"score": "0.5894642",
"text": "def resubscribe\n list_subscriptions = @email_account.list_subscriptions.\n where(:list_id => params[:list_id],\n :list_name => params[:list_name],\n :list_domain => params[:list_domain],\n :unsubscribed => true)\n\n list_subscriptions.each do |list_subscription|\n list_subscription.resubscribe()\n end\n\n render :json => {}\n end",
"title": ""
},
{
"docid": "a2c0ef136db4f72aff3526b0de300351",
"score": "0.587128",
"text": "def subscribe topics\n client.post('/user/subscribe', { topics: Array(topics) })\n end",
"title": ""
},
{
"docid": "9c826c469e36b9550748bf19f01edf06",
"score": "0.58692396",
"text": "def create\n @subscribe = Subscribe.new(subscribe_params)\n\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @subscribe }\n else\n format.html { render :new }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fe319d43358a3402ef0ddc4f4facd81",
"score": "0.58507186",
"text": "def create(**options, &block)\n call(\n method: :post,\n path: \"/subscriptions\",\n data: options,\n &block\n )\n end",
"title": ""
},
{
"docid": "d3d1de42fd5ae21829cebbac15471d84",
"score": "0.58183056",
"text": "def create\n @subscription = params[:subscription].nil?? Subscription.init(params[:url], params[:group], current_user.id) : Subscription.new(params[:subscription]) \n respond_to do |format|\n if @subscription.save\n format.json { render json: @subscription, :include => [:subscription_group, :feed], :methods => :unread_count, status: :created, location: @subscription }\n else\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "333088b4ed9bf18a032eab1b32881357",
"score": "0.5818265",
"text": "def create\n @admin_subscribe = Admin::Subscribe.new(admin_subscribe_params)\n\n respond_to do |format|\n if @admin_subscribe.save\n format.html { redirect_to @admin_subscribe, notice: 'Subscribe was successfully created.' }\n format.json { render :show, status: :created, location: @admin_subscribe }\n else\n format.html { render :new }\n format.json { render json: @admin_subscribe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea87bbc141e5e27f5891aa253b60bc0b",
"score": "0.5816188",
"text": "def create\n @subscribe = Subscribe.new(params[:subscribe])\n\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to @subscribe, :notice => t('controller.successfully_created', :model => t('activerecord.models.subscribe')) }\n format.json { render :json => @subscribe, :status => :created, :location => @subscribe }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @subscribe.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6eb9c2f9022c87d833f13ac394595668",
"score": "0.5814628",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to subscriptions_url, notice: t('subscription.notice.created') }\n format.json { render :show, status: :created, location: @subscription }\n end\n end\n end",
"title": ""
},
{
"docid": "1f73faa4933aaba2a325d69d34b43f39",
"score": "0.57940763",
"text": "def create\n render_invalid_parameter(\"Parameter is missing or the value is empty: subscription\") and return if params[:subscription].blank?\n optional_target_names = (params[:subscription][:optional_targets] || {}).keys.select { |key| !key.to_s.start_with?(\"subscribing_to_\") }\n optional_target_names.each do |optional_target_name|\n subscribing_param = params[:subscription][:optional_targets][optional_target_name][:subscribing]\n params[:subscription][:optional_targets][\"subscribing_to_#{optional_target_name}\"] = subscribing_param unless subscribing_param.nil?\n end\n super\n render status: 201, json: subscription_json if @subscription\n end",
"title": ""
},
{
"docid": "a34d0a93fe26309a80f96f308f2ecb88",
"score": "0.57900107",
"text": "def create\n FeedSubscription.add current_user.profile, @subject\n current_user.profile.publish_subscription @subject, true\n \n respond_to do |format|\n format.html { redirect_to_subject }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a5e270aee2690ab50c582f6907663866",
"score": "0.5736962",
"text": "def subscribe_params\n params.require(:subscribe).permit(:user_id, :activity_id, :chosen_date)\n end",
"title": ""
},
{
"docid": "c4b489ddb7439c173192a00442876ed9",
"score": "0.5733411",
"text": "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.subscriber = @user\n @subscription.save\n respond_with(@subscription)\n end",
"title": ""
},
{
"docid": "6a4c5c025ab0e4337a5a3f59b49cfd99",
"score": "0.571119",
"text": "def create\n @subscription = @subscriber.subscriptions.build(params[:subscription])\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to polymorphic_url([@subscriber,@subscription]), notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80eb9baf48f794ed948473c0f4ec4f30",
"score": "0.57089543",
"text": "def subscribe(subscribed_user)\n active_subscriptions.create(subscribed_id: subscribed_user.id)\n end",
"title": ""
},
{
"docid": "cd3832d583aa8d0d75fc666a2f3c37ba",
"score": "0.57058364",
"text": "def index\n @prescriptions = Prescription.all\n render json: @prescriptions\n end",
"title": ""
},
{
"docid": "53eb3a3c3738a6d9bed46c6ead185897",
"score": "0.570516",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n flash[:success] = 'Subscription was successfully created.'\n format.html { redirect_to @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ba68977518b2719c4638f1c5e66ca3e",
"score": "0.5701653",
"text": "def index\n @prescripcions = Prescripcion.all\n end",
"title": ""
},
{
"docid": "40a23373f114ac14e983a1d9c1c6d932",
"score": "0.56965977",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_path, notice: 'Please check your email to confirm your subscription' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f59a075e9c1ee9d500ed21daea1d4550",
"score": "0.5689182",
"text": "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscribtion was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c77a1d057aa05ed258b1ade358f9f83",
"score": "0.56802833",
"text": "def create_newsletter_subscription(params)\n request(:post, 'api/0/newsletter', params)\n nil\n end",
"title": ""
},
{
"docid": "250371d4c44bd6c807626796c90b36a4",
"score": "0.56784916",
"text": "def create\n @subscriptions = Subscription.where(follower_id: current_user.id)\n @sub = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @sub.save\n # Tell the UserMailer to send a welcome email after save\n UserMailer.with(user: current_user).follow_email(current_user).deliver_now\n\n format.html { redirect_to subscriptions_path, notice: 'Sub was successfully created.' }\n format.json { render :show, status: :created, location: @sub }\n format.js\n else\n format.html { render :new }\n format.json { render json: @sub.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "2053cfce8bddfa19d5cf19cbde1988a9",
"score": "0.56783706",
"text": "def subscribe_to_list( list_id, options={})\n post(\"/lists/subscribers/create.json\", options.merge(:list_id => list_id))\n end",
"title": ""
},
{
"docid": "352ba00e001f53c66e78c8638555541c",
"score": "0.56502634",
"text": "def create\n # @coupon = Coupon.new(coupon_params)\n @coupon = @restaurant.coupons.new(coupon_params)\n\n respond_to do |format|\n if @coupon.save\n @subscriptions = Subscription.all\n\n @subscriptions.each do |subs|\n if subs.restaurant_id == @coupon.restaurant_id\n @client = Twilio::REST::Client.new ENV['account_sid'], ENV['auth_token']\n\n @client.account.messages.create({\n :from => '+19548585330',\n :to => '+1'+subs.customer.phone_number,\n :body => \"#{@restaurant.name} has a new offer for you, click #{ coupon_url(@coupon.id, phone_number: subs.customer.phone_number ) } to claim it!\"\n })\n end\n end\n format.html { redirect_to only_path(@restaurant), notice: 'Coupon was successfully created.' }\n format.json { render :show, status: :created, location: @coupon }\n else\n format.html { render :new }\n format.json { render json: @coupon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6f5ec295d5f502edeb3c47942921a25",
"score": "0.5646732",
"text": "def subscribe_to_list( list )\n email_subscriptions.create :list => list\n end",
"title": ""
},
{
"docid": "d6f5ec295d5f502edeb3c47942921a25",
"score": "0.5646732",
"text": "def subscribe_to_list( list )\n email_subscriptions.create :list => list\n end",
"title": ""
},
{
"docid": "245705b6fb50b7344103fcbd9261c85a",
"score": "0.5636676",
"text": "def create\n\t\t@subscribe = Subscribe.new(subscribe_params)\n\t\tif @subscribe.save\n\t\t\tflash[:notice] = \"Thank you for your subscription\"\n\t\t\tredirect_to post_path(@post)\n\t\telse\n\t\t\tflash[:alert] = \"Error in Subscription\"\n\t\t\trender :new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "31f2eb2f6c6727ac650110b06183dda9",
"score": "0.5630014",
"text": "def subscription_params\n params.require(:subscription).permit(:subscribable_id, :subscribable_type, types: [:company_page, :vacancies, :events])\n end",
"title": ""
},
{
"docid": "1eeeff6711456069e56e4e833a3fb51b",
"score": "0.56104827",
"text": "def prescribtion_params\n params.require(:prescribtion).permit(:patient_id, :doctor_id)\n end",
"title": ""
},
{
"docid": "a4cfeb937ab622d935b12b042e97fa4e",
"score": "0.56082076",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n if require_org?\n org = Organization.create(name: org_name)\n current_user.update!(type: 'OrgnaizationTenant', organization_id: org.id)\n @subscription.organization_id = org.id\n else\n @subscription.frequancey = 'Monthly'\n end\n @subscription.user_id = current_user.id\n @subscription.status = 'active'\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_path, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { redirect_to plans_path, notice: 'Fail to Subscribe' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6008c38eb2e639d120435d1c936a9d91",
"score": "0.5606854",
"text": "def subscribe(subreddit)\n subscriptions.create(subreddit: subreddit)\n end",
"title": ""
},
{
"docid": "f0caab283580fb91c8a3fae47d2a46d1",
"score": "0.5605727",
"text": "def create\n @subscriber = Subscriber.new(subscriber_params)\n if @subscriber.save\n render json: @subscriber, status: :created\n else\n render json: @subscriber.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5136dd101ca95b88aa3c2b17bbc62c1e",
"score": "0.56048286",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_path, notice: 'You have successfully subscribed to Pixie!' }\n format.json { render action: 'show', status: :created, location: @subscription}\n else\n format.html { render action: 'new', notice: 'You have not subscribed to Pixie yet!' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "922d4276b1c51dc65066cdb1e71b3bc8",
"score": "0.5601531",
"text": "def post_init\n send_data I3::IPC.format(I3::IPC.message_type_subscribe,\n @subscription_list.to_json)\n end",
"title": ""
},
{
"docid": "bf93eb7de5912a92b4db505b71ebac3f",
"score": "0.55988544",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n if @subscription.save\n render :show, status: :created, location: @subscription\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e590b816ac656dcbcb6540b00ef89795",
"score": "0.5598155",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e590b816ac656dcbcb6540b00ef89795",
"score": "0.5598155",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c7f9628ff505a710524280b8e8ac121",
"score": "0.55970824",
"text": "def subscription_requests\n @subscriptionRequests = UserConnection.where(tipster_id: current_user.id)\n render json: { data: @subscriptionRequests }.to_json\n end",
"title": ""
},
{
"docid": "368a91452a7a84d7b63e4ddadad82439",
"score": "0.5595855",
"text": "def create\n @target.create_subscription(subscription_params)\n return_back_or_ajax\n end",
"title": ""
},
{
"docid": "dae188b203563e18d34c668e358eb6d1",
"score": "0.559291",
"text": "def create\n subscriptions = Subscription\n .where(subscription_status_id: 11)\n .where(plan_id: params[:plan])\n .select(:id,:plan_id,:user_id,:created_at)\n subscriptions = subscriptions.map{ |x| \n current_plan = Plan.where(id:x.plan_id).select(:id,:price,:expiration_days).first\n profit = ((current_plan.price * params[:daily_value].to_f) / 100).round(2)\n allowed = true\n allowed = x.rewards.where(reward_type_id:11).count == 0 ? (false) : (true)\n allowed = !allowed ? (x.created_at.beginning_of_day + 5.days < Time.zone.now.beginning_of_day) : (true)\n\n x.rewards.create(value: profit, \n reward_type_id: 11,\n reward_status_id: 11,\n currency_id: 11,\n user_id:x.user_id) if allowed\n }.reject(&:blank?) if subscriptions.count(:id) > 0\n render json: subscriptions, status:200\n end",
"title": ""
},
{
"docid": "145104f45fcc09b085ab63e355d9ded3",
"score": "0.55924666",
"text": "def create\n result = SubscribeToProtocol.run!(\n protocol_name: protocol_subscription_create_params[:protocol_name],\n person: current_user,\n start_date: start_date,\n only_if_not_subscribed: true\n )\n render status: :created, json: result\n end",
"title": ""
},
{
"docid": "2bac9661fba7b012cae3376bfc2c4474",
"score": "0.5591984",
"text": "def create_subscription(options = {})\n build_response(make_request(:post, url: 'subscriptions', options: options))\n end",
"title": ""
},
{
"docid": "09db33bf2e206c17133398d759803027",
"score": "0.5586408",
"text": "def create\n # @user = current_user\n \n @presription = current_user.presriptions.build(presription_params)\n\n respond_to do |format|\n if @presription.save\n format.html { redirect_to stream_path, notice: 'Presription was successfully created.' }\n format.js {}\n format.json { render :show, status: :created, location: @presription }\n else\n format.html { render :new }\n format.json { render json: @presription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faa971a4ac72b69835d4f5158a06d23d",
"score": "0.55860853",
"text": "def create\n @tema = Tema.find(params[:tema_id])\n subscription_re = @tema.subscriptions.build(user_id: current_user.id)\n if subscription_re.save\n answer2(current_user, @tema)\n else\n redirect_back(fallback_location: root_path, alert: 'Subscription could not be sent.')\n end\n end",
"title": ""
},
{
"docid": "5bb64dbcc110b1b29fd459dd05d41765",
"score": "0.55856746",
"text": "def create\n @offer = Offer.find(params[:offer_id])\n @subscription = @offer.subscriptions.create(params[:subscription])\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to thanks_offer_path(@offer), notice: 'Offer was successfully created.' }\n format.json { render json: @offer, status: :created, location: @offer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "999fb1d89558ad4c3ee95f170328593f",
"score": "0.55657744",
"text": "def subscribe\n @subscription.subscribe(with_email_subscription: params[:with_email_subscription].to_s.to_boolean(true),\n with_optional_targets: params[:with_optional_targets].to_s.to_boolean(true))\n return_back_or_ajax\n end",
"title": ""
},
{
"docid": "4324838484ac48fcc86e2b398b4b3d11",
"score": "0.55656934",
"text": "def create\n # create and save subscription with strong params\n @subscription = Subscription.new(subscription_params)\n if @subscription.save\n render :json => @subscription\n # respond_to do |format|\n # format.html { redirect_to subscription_url(@subscription), notice: 'Subscription was successully created.'}\n # end\n else\n render :json => @subscription.errors, status: :unprocessable_entity\n # respond_to do |format|\n # format.html { render action: 'new', notice: @subscription.errors }\n # format.json { render json: @subscription.errors, status: :unprocessable_entity }\n # end\n end\n end",
"title": ""
},
{
"docid": "937df8c5315039261ffba7508b82595b",
"score": "0.55583686",
"text": "def create\n @subscription = Subscription.new subscription_params\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n # format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n # format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e302d0805d9e261344c922d9fc5ed0e4",
"score": "0.5557616",
"text": "def add_subscription\n requestor = params[:requestor]\n target = params[:target]\n \n if !requestor.nil? and !target.nil? \n new_subscription = Subscription.new(:requestor => requestor, :target => target)\n \n if new_subscription.save\n render json: {\n success: true\n }, status: :created\n else\n render json: {\n success: false,\n errors: new_subscription.errors\n }, status: :unprocessable_entity\n end\n \n else\n render json: {\n success: false,\n error: \"JSON input parameter is empty or invalid\"\n }, status: :unprocessable_entity\n \n end\n \n end",
"title": ""
},
{
"docid": "67bd0c721000d4c74d3cdf25f0265196",
"score": "0.5552427",
"text": "def set_prescri\n @prescri = Prescri.find(params[:id])\n end",
"title": ""
},
{
"docid": "66fad622c6f895d8f63a88ac8e288309",
"score": "0.55461556",
"text": "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.user = current_user\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, :notice => t('controller.successfully_created', :model => t('activerecord.models.subscription')) }\n format.json { render :json => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acff28efbacbd29df35b624a87550287",
"score": "0.5521961",
"text": "def create\n # @topic = Topic.new(params[:topic])\n # authorize! :create, @topics\n\n \n @topic.user_id = current_user.id\n @topic.last_poster_id = current_user.id\n @topic.last_post_at = Time.now\n \n Subscription.subscribe(@topic,current_user) \n \n respond_to do |format|\n if @topic.save\n format.html { redirect_to @topic, notice: 'Topic was successfully created.' }\n format.json { render json: @topic, status: :created, location: @topic }\n else\n format.html { render action: \"new\" }\n format.json { render json: @topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30c08fafe7bdd9204ad5f1019fbec637",
"score": "0.5519616",
"text": "def create\n @prescription = Prescription.new(prescription_params)\n\n respond_to do |format|\n if @prescription.save\n format.html { redirect_to @prescription, notice: 'Prescription was successfully created.' }\n format.json { render :show, status: :created, location: @prescription }\n else\n format.html { render :new }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fb2462635ff85b8d1c4ed1751d2dcf5",
"score": "0.5514794",
"text": "def subscribe(action: :sub, skip_initial_defaults: false)\n client.post(\n '/api/subscribe',\n sr_name: read_attribute(:display_name),\n action: action,\n skip_initial_defaults: skip_initial_defaults\n )\n end",
"title": ""
},
{
"docid": "229201a160b19e7f92a39296e62c2154",
"score": "0.55016685",
"text": "def create\n if params[:subscribe] == \"yes\"\n user = current_user\n user.subscription = true\n user.save!\n else\n flash[:success] = \"Your subscription preferences have been updated!\"\n end\n end",
"title": ""
},
{
"docid": "e4bdf3dfc024f30881e87a1a0e023df8",
"score": "0.5494777",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13a84d3aa3cfc5d198022ea0965c110e",
"score": "0.54876494",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { render partial: 'partials/subscriptions' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { redirect_to controller: 'subscriptions' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32a1877385d2eddc2c8b2029050b4530",
"score": "0.54853874",
"text": "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.legislator = current_legislator\n respond_to do |format|\n if @subscription.save\n flash[:notice] = 'You are now subscribed to a weekly email about the priorities of ' + current_legislator.name_with_title.possessive + ' constituents'\n format.html { redirect_to \"/\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44ed0fb52cb9e3c5cb03850ea24f199a",
"score": "0.54853076",
"text": "def subscribe_to_list\n end",
"title": ""
},
{
"docid": "72155baff317834f16c718b99be46dee",
"score": "0.5483627",
"text": "def create\n unless @subscription\n subscription = current_user.create_subscription(subscription_params)\n render json: subscription and return\n end\n\n data = {\n error: 'subscription already exists for this user.'\n }\n render json: data, status: :unprocessable_entity\n end",
"title": ""
},
{
"docid": "b84f375ca7c7ee170e350d1ca880310b",
"score": "0.5475351",
"text": "def create_subscription(options)\n api_post(make_subscription_url(options.merge({:use_subscription_id => true})))\n end",
"title": ""
},
{
"docid": "b6844648013d571616493fef7fa16987",
"score": "0.5474913",
"text": "def subscription_params\n params.require(:subscription).permit!\n end",
"title": ""
},
{
"docid": "09df97ad40adc3c96303bd2aa0b5194e",
"score": "0.5471803",
"text": "def create_subscription(data)\r\n Subscription.new.create(data)\r\n end",
"title": ""
},
{
"docid": "bec52d4e57b533727c7852e6b79aac28",
"score": "0.54703486",
"text": "def create\n begin\n @prescription = current_user.prescriptions.new(prescription_params)\n @prescription.save!\n @prescription.comments.create(message: params[:prescription][:message], role: current_user.full_name) if params[:prescription][:message].present?\n render_success_response \"Prescription sent to admin successfully\"\n rescue => e\n bad_request_error(e.message)\n end\n end",
"title": ""
},
{
"docid": "6fe6dee2cfb225638d6bf1801e6769d6",
"score": "0.5464443",
"text": "def create_subscriptions(accountId, model) path = \"/api/v2/accounts/#{accountId}/subscriptions\"\n post(path, model, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "4d72a974811703b1d7e3d507b7fb1f03",
"score": "0.546307",
"text": "def subscribe(example_subscription)\n user_subs.create(subscription_id: example_subscription.id)\n end",
"title": ""
},
{
"docid": "e3071985211b3f94b6a722f588f937a3",
"score": "0.54613036",
"text": "def create\n @prescription = @patient.prescriptions.build(\n prescription_params.merge(\n date_prescribed: Time.zone.now,\n active: true\n )\n )\n\n respond_to do |format|\n if @prescription.save\n flash_message('Prescription successfully created')\n if params[:start_pa] == '1'\n if @prescription.initiate_pa(current_user)\n flash_message('Your prior authorization request was successfully started.')\n end\n end\n format.html { redirect_to @patient }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "7f1a77b894e0a45170ffe8c386e606ee",
"score": "0.5460189",
"text": "def create\n @patient = Patient.find(params[:patient_id])\n @prescription = @patient.prescriptions.build(prescription_params.merge({\n date_prescribed: Time.zone.now, \n active: true}))\n \n respond_to do |format|\n if @prescription.save\n if @prescription.pa_required\n start_pa(@prescription)\n end\n flash_message('Prescription successfully created')\n format.html { redirect_to @patient }\n format.json { render :show, status: :created, location: @prescription }\n else\n format.html { render :new }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dd54af3128744b8d76701a38d56d783",
"score": "0.5458264",
"text": "def push_subscriptions(options = {})\n get('push_subscriptions', options).map do |row|\n Strava::Webhooks::Models::Subscription.new(row)\n end\n end",
"title": ""
},
{
"docid": "cb6a7335855b3dcf0773b2ccd7ffc01a",
"score": "0.5457795",
"text": "def destroy\n @prescribtion.destroy\n respond_to do |format|\n format.html { redirect_to prescribtions_url, notice: 'Prescribtion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "db577711052e14704f20026a492a7e10",
"score": "0.5456702",
"text": "def create_subscribe_for_author\n Subscription.create(user: self.user, question: self)\n end",
"title": ""
},
{
"docid": "40137a1968f29089e49051c35db71379",
"score": "0.54548913",
"text": "def destroy\n @prescri.destroy\n respond_to do |format|\n format.html { redirect_to prescris_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3988fe0f96255ec7d350849adb0144ea",
"score": "0.5446196",
"text": "def create\n @subscribe = Subscribe.new(params[:subscribe])\n\n respond_to do |format|\n if @subscribe.save\n format.html { redirect_to(@subscribe, :notice => 'Subscribe was successfully created.') }\n format.xml { render :xml => @subscribe, :status => :created, :location => @subscribe }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscribe.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bcf21f3fbb6594447d56d2291bfb39d",
"score": "0.5446022",
"text": "def push_new_subscription\n notification = Hash.from_xml(request.body())\n render :text => \"Request accepted.\"\n if notification.has_key?('new_subscription_notification')\n account_code = notification['new_subscription_notification']['account']['account_code']\n sub_code = notification['new_subscription_notification']['subscription']['uuid']\n plan_code = notification['new_subscription_notification']['subscription']['plan']['plan_code']\n @uuid = notification['new_subscription_notification']['subscription']['uuid']\n logger.info \"Recurly push notification: new_subscription_notification for account #{account_code}\"\n # because in the signup process the customer could technically make more than one subscription saved to the database\n # using .last to target the last one they created >> the subscription they intended to checkout with\n new_subscription = Subscription.where(:user_id => account_code, :subscription_frequency => plan_code).last\n new_subscription.active unless new_subscription.nil?\n new_subscription.uuid = @uuid\n new_subscription.save\n # end\n end\n rescue Recurly::Resource::NotFound => e\n logger.error \"Recurly: #{e.message}\"\n rescue ActiveRecord::RecordNotFound => e\n logger.error \"Customer record not found: #{e.message}\"\n end",
"title": ""
},
{
"docid": "e382614957d4c7bbb769d1dc74a01808",
"score": "0.5429455",
"text": "def sendy_registraion\n uri = URI('http://newsletter.cannabis-initiative.ch/subscribe')\n Net::HTTP.post_form(uri, list: ENV[\"SENDY_LIST_#{I18n.locale.upcase}\"],\n email: @supporter.email,\n name: \"#{@supporter.first_name} #{@supporter.last_name}\")\n end",
"title": ""
},
{
"docid": "cae08d7da15bd1df6ac976157ab7641a",
"score": "0.5427724",
"text": "def create\n @prequestionnaire = Prequestionnaire.new(prequestionnaire_params)\n\n respond_to do |format|\n if @prequestionnaire.save\n format.html { redirect_to thanks_path(thanks: 'prequestionnaire'), notice: 'Prequestionnaire was successfully created.' }\n format.json { render :show, status: :created, location: @prequestionnaire }\n else\n format.html { render :new }\n format.json { render json: @prequestionnaire.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5cf9e243e8ec0c4c4982f46cdf7b773a",
"score": "0.5421257",
"text": "def new\n @visit = Visit.find(params[:visit_id])\n @favourite_prescriptions = FavouritePrescription.where(:user_id=>current_user).map{ |fp| [fp.name, fp.id] }\n @prescription = @visit.prescriptions.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @prescription }\n end\n end",
"title": ""
},
{
"docid": "eb9129c7ebb4d48f3790bf86c5e8970f",
"score": "0.5420252",
"text": "def subscribe_params\n params.require(:subscribe).permit(:project_id, :title, :fee, :type_guide_id, :start, :end, :publish, :observation,\n fields_attributes: [:id, :_destroy, :label, :field_type, :max_size, :file_white_list, :required, :unique, :only_number])\n end",
"title": ""
},
{
"docid": "e17a243404b3e91dd4a999c7b75c93e6",
"score": "0.5419578",
"text": "def create_unsubscribes(data)\n # `data` should be a list of hashes, with each hash containing *at least* an `address` key.\n split_return = []\n if data.length >= 1000 then\n resp, resp_l = create_unsubscribes data[999..-1]\n split_return.push(resp)\n split_return.concat(resp_l)\n data = data[0..998]\n elsif data.length == 0 then\n return nil, []\n end\n\n valid = []\n # Validate the unsubscribes given\n while not data.empty? do\n unsubscribe = data.pop\n # unsubscribes MUST contain a `address` key.\n if not unsubscribe.include? :address then\n raise Mailgun::ParameterError.new \"Unsubscribe MUST include a :address key: #{unsubscribe}\"\n end\n\n unsubscribe.each do |k, v|\n # Hash values MUST be strings.\n # However, unsubscribes contain an array of tags\n if v.is_a? Array\n unsubscribe[k] = v.map(&:to_s)\n elsif !v.is_a? String\n unsubscribe[k] = v.to_s\n end\n end\n\n valid.push unsubscribe\n end\n\n response = @client.post(\"#{@domain}/unsubscribes\", valid.to_json, { \"Content-Type\" => \"application/json\" })\n return response, split_return\n end",
"title": ""
},
{
"docid": "acca23fa782f312c69180d40c61ba354",
"score": "0.54194975",
"text": "def subscription_params\n params.require(:subscription).permit(:follower_id, :followed_id)\n end",
"title": ""
},
{
"docid": "67429cc13585ebeb556b8f96f08e716f",
"score": "0.5414448",
"text": "def create\n @planned_responce = Subscription.find(params[:subscription_id]).planned_responces.build(params[:planned_responce])\n\n respond_to do |format|\n if @planned_responce.save\n format.html { redirect_to([@planned_responce.subscription, @planned_responce], :notice => 'Planned responce was successfully created.') }\n format.xml { render :xml => @planned_responce, :status => :created, :location => [@planned_responce.subscription, @planned_responce] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @planned_responce.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "396b60aac27edd376156788baec9b960",
"score": "0.5411981",
"text": "def create\n @prescription = Prescription.new(prescription_params)\n\n respond_to do |format|\n if @prescription.save\n format.html { redirect_to @prescription, notice: 'Prescription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @prescription }\n else\n format.html { render action: 'new' }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4da299c0c548f0df9efe55c53dab0304",
"score": "0.5400963",
"text": "def create\n @visit = Visit.find(params[:visit_id])\n if !params[:favourite_prescription].blank?\n @favourite_prescription = FavouritePrescription.find(params[:favourite_prescription])\n @favourite_prescription.prescription_medicines.each do |medicine|\n @prescription = @visit.prescriptions.new\n @prescription.medicine = medicine.medicine\n @prescription.frequency = medicine.frequency\n @prescription.duration = medicine.duration\n @prescription.route = medicine.route\n @prescription.save\n end\n respond_to do |format|\n format.html { redirect_to visit_prescriptions_url }\n end\n else\n @prescription = @visit.prescriptions.build(params[:prescription])\n\n respond_to do |format|\n if @prescription.save\n format.html { redirect_to visit_prescriptions_url }\n format.json { render :json => @prescription, :status => :created, :location => [@prescription.visit, @prescription] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @prescription.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "16fa3a0e17b1990b344721d7e0097fa0",
"score": "0.5399698",
"text": "def subscription_params\n params.require(:subscription).permit(:user_id, :pub_id)\n end",
"title": ""
},
{
"docid": "f34a279549e3a17bb47034909316b986",
"score": "0.5399574",
"text": "def subscribe(dict, userId:nil, overwriteAll:false)\n if overwriteAll\n params = {}\n else\n params = subscription(userId)\n end\n\n dict.each { |k, v| params[k] = v }\n @cachedHash = nil # bcs the subscriptions count changes\n api = getAPI(:subscription, :PUT, { userId: userId })\n return @nr.simpleAPI(api, jdict:params)\n end",
"title": ""
},
{
"docid": "c94bd19189fcbc14ef76c0369e35e39a",
"score": "0.5396258",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.user_id = current_user.id\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "297956160a596b4ac970fd5067d88b7d",
"score": "0.5394439",
"text": "def new\n @subscribtion = Subscribtion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscribtion }\n end\n end",
"title": ""
},
{
"docid": "bf39572b1fb00605368dbc18635587e0",
"score": "0.5388979",
"text": "def subscribe_to(question)\n self.subscriptions.find_or_create_by(question: question)\n end",
"title": ""
}
] |
187c9ff61fce8c4c202b04866d91d1da
|
Returns the value of attribute element.
|
[
{
"docid": "da5a7957d97b66cc73e862a4bebe3e85",
"score": "0.0",
"text": "def element; end",
"title": ""
}
] |
[
{
"docid": "e144797064ca6c74908dc9a89226ca50",
"score": "0.8007108",
"text": "def attribute(attribute_name)\n element.attribute_value attribute_name\n end",
"title": ""
},
{
"docid": "ad0aa4ed97207bc5da87a23f4db3dbfa",
"score": "0.79929554",
"text": "def attribute_value(attribute_name)\r\n assert_exists\r\n @element.get_attribute(attribute_name) || ''\r\n end",
"title": ""
},
{
"docid": "e05120a30142041e92ea739b7b08397b",
"score": "0.7894451",
"text": "def attribute(attribute_name)\n @element.attribute_value attribute_name\n end",
"title": ""
},
{
"docid": "2b2e3b051a9b3afb931ddbc80f03edc5",
"score": "0.782795",
"text": "def attr_val(xpath)\n attr = @attr.at_xpath(xpath)\n if attr\n attr.value\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "b9a0bccacca31212dba4d929fdb28859",
"score": "0.7803427",
"text": "def attribute_value\n end",
"title": ""
},
{
"docid": "32ac2b09bf1f5b5bea299d4f49dc34b3",
"score": "0.77683324",
"text": "def attribute_value(attribute_name)\n attribute_name = attribute_name.to_s.tr('_', '-') if attribute_name.is_a?(::Symbol)\n element_call { @element.attribute attribute_name }\n end",
"title": ""
},
{
"docid": "60ef43774e617eb2640a8a369efc87eb",
"score": "0.7747173",
"text": "def getAttribute\n \tif(@nodeValues.size > @index)\n \t tmp = @nodeValues[@index]\n \t result = @xmlTool.searchForAttribute(tmp, @attributeElementName, @attributName)\n \t return result\n \telse\n \t return \"\"\n end\n end",
"title": ""
},
{
"docid": "8cc8381841c56b531110691ee6046379",
"score": "0.77021056",
"text": "def value\n @xml_element.attributes['value']\n end",
"title": ""
},
{
"docid": "25879246cbcd5b4238f175d7f9baa189",
"score": "0.76755387",
"text": "def attribute_value\n end",
"title": ""
},
{
"docid": "1e3be65dec69742fd4c896f620a3d2ab",
"score": "0.7666089",
"text": "def attr_val(xpath)\n Utilities::attr_val(@entry, xpath)\n end",
"title": ""
},
{
"docid": "6eb4c587d20827c06044ef8371d76eaf",
"score": "0.76381147",
"text": "def attr_val(xpath)\n attr = @entry.at_xpath(xpath)\n if attr\n attr.value\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "a0f3befa384edc64153c6a054e9bc096",
"score": "0.7631645",
"text": "def attr_val(xpath)\n Utilities.attr_val(@entry, xpath)\n end",
"title": ""
},
{
"docid": "64cfc493ca5694db12a67560444d9580",
"score": "0.75572574",
"text": "def read_attribute_value()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "b91149e846a1e143d65c6ef57654d6b0",
"score": "0.75393957",
"text": "def help_get_attribute_value(xml_element, attribute_name)\n if xml_element && !xml_element.attribute(attribute_name).nil?\n return xml_element.attribute(attribute_name).value\n end\n return nil\n end",
"title": ""
},
{
"docid": "62e0fe7b4dac56b85b6a67907b116359",
"score": "0.7536397",
"text": "def value\n val = attr_val('./cda:value/@value')\n if val\n val\n else\n @attr.at_xpath('./cda:value').inner_text\n end\n end",
"title": ""
},
{
"docid": "f1f5e6339572e0ad80de3da038a521c4",
"score": "0.7412984",
"text": "def value\n self.attrs[:value]\n end",
"title": ""
},
{
"docid": "acdf642bf74a3d12d3da5f91d5df8fd8",
"score": "0.73736084",
"text": "def value\n attribute KAXValueAttribute\n end",
"title": ""
},
{
"docid": "96a52e2e0c1ce75c663832c8e985da33",
"score": "0.7351579",
"text": "def value\n attributes.fetch(:value)\n end",
"title": ""
},
{
"docid": "96a52e2e0c1ce75c663832c8e985da33",
"score": "0.7351579",
"text": "def value\n attributes.fetch(:value)\n end",
"title": ""
},
{
"docid": "2aea416e98ef0cdc727070f561e27abe",
"score": "0.7348339",
"text": "def [](name)\n attr = get_attribute(name)\n return attr.value unless attr.nil?\n return nil\n end",
"title": ""
},
{
"docid": "2aea416e98ef0cdc727070f561e27abe",
"score": "0.7348339",
"text": "def [](name)\n attr = get_attribute(name)\n return attr.value unless attr.nil?\n return nil\n end",
"title": ""
},
{
"docid": "5e7c9c0bb269a0da40c7354d53f68138",
"score": "0.7330888",
"text": "def get_attribute(node, attr_name)\n node.attribute(attr_name)\n end",
"title": ""
},
{
"docid": "58b838ecef8f76812080af513995422c",
"score": "0.7328272",
"text": "def value\n @attributes[:value]\n end",
"title": ""
},
{
"docid": "58b838ecef8f76812080af513995422c",
"score": "0.7328272",
"text": "def value\n @attributes[:value]\n end",
"title": ""
},
{
"docid": "58b838ecef8f76812080af513995422c",
"score": "0.7328272",
"text": "def value\n @attributes[:value]\n end",
"title": ""
},
{
"docid": "f35be0dca1cfb657dc6d38b4a322468b",
"score": "0.7308811",
"text": "def get_attr(name)\n @elem.attributes[name.to_s]\n end",
"title": ""
},
{
"docid": "59cf2bd54360b064858ef5235f74be2e",
"score": "0.7304201",
"text": "def get_attribute(element, attribute)\n element.attribute(\"#{attribute}\")\n end",
"title": ""
},
{
"docid": "75380bbd473e250d35dacbd2152dd76a",
"score": "0.72354674",
"text": "def getAttributeElement\n return @attributeElementName\n end",
"title": ""
},
{
"docid": "c4cdafc3da112d6007687b5343d680aa",
"score": "0.7224774",
"text": "def attribute(element, name)\n element[name]\n end",
"title": ""
},
{
"docid": "28c32f70d84a02c6f33bdc1601d2c076",
"score": "0.722385",
"text": "def value(node, attribute)\n node.send(attribute)\n end",
"title": ""
},
{
"docid": "34e27b7f05a053979e337c910060174b",
"score": "0.7204815",
"text": "def value\n subject[attr_name]\n end",
"title": ""
},
{
"docid": "d71e988a7ab1730c011874ee9443ed51",
"score": "0.71958715",
"text": "def attrGet(name)\n idx = attrIndex(name)\n value = nil\n\n if idx >= 0\n value = @attrs[idx][1]\n end\n\n return value\n end",
"title": ""
},
{
"docid": "9f253c25c24d2851fb22f30bf38efbb6",
"score": "0.7192918",
"text": "def get_value(attribute)\n send(attribute)\n end",
"title": ""
},
{
"docid": "3699fc206a90d1b5a929950c1e64b51e",
"score": "0.71298015",
"text": "def value\r\n assert_exists\r\n attribute_value('value')\r\n end",
"title": ""
},
{
"docid": "b1d15412afc06e79db5a9e62dbaa8290",
"score": "0.71295863",
"text": "def get_attribute(attributeLocator)\n return get_string(\"getAttribute\", [attributeLocator,])\n end",
"title": ""
},
{
"docid": "acaa53c98566d53570ae26512474ffad",
"score": "0.7100942",
"text": "def attribute(attr)\n get_attribute(attr)\n end",
"title": ""
},
{
"docid": "85770610c8ec14aaad54b6fce8be997c",
"score": "0.705319",
"text": "def extract_attr_value(xml)\n raise \"abstract method called\"\n end",
"title": ""
},
{
"docid": "84996caf420c66f83a5af34da5a0b091",
"score": "0.6986796",
"text": "def value\n element.getValue\n end",
"title": ""
},
{
"docid": "2546493d4cff6c5076357f774466de4f",
"score": "0.69750494",
"text": "def get_attr(el, attr)\n return el.attributes[attr]\nend",
"title": ""
},
{
"docid": "c2080c75e18e7b9c724af1704854421e",
"score": "0.69387543",
"text": "def get_attribute(name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "c2080c75e18e7b9c724af1704854421e",
"score": "0.69387543",
"text": "def get_attribute(name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "c2080c75e18e7b9c724af1704854421e",
"score": "0.69387543",
"text": "def get_attribute(name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "af212cbea97473b5804e4fa4c0a8ca59",
"score": "0.69274354",
"text": "def get_attribute(name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "127a3c120587ddf3f0b8083209580f0a",
"score": "0.69239306",
"text": "def [](a)\n @attribute_values[a]\n end",
"title": ""
},
{
"docid": "d5fdce95524a0b60ef9583e19d13efa9",
"score": "0.69166595",
"text": "def custom_attribute_value(id)\n ca = custom_attribute(id)\n ca ? ca.attribute_value : nil\n end",
"title": ""
},
{
"docid": "22219e112c0887216dc5db9592695114",
"score": "0.6914016",
"text": "def getXmlAttribute\n return @xmlAttribute\n end",
"title": ""
},
{
"docid": "913a1c48379548b531943710dd2081a2",
"score": "0.6905984",
"text": "def attribute(attr)\n @attributes[attr]\n end",
"title": ""
},
{
"docid": "a4aa360e94a82e6d1fd5f8c989e67872",
"score": "0.6900775",
"text": "def get(name)\n found = attribute(name)\n\n return found ? found.value : nil\n end",
"title": ""
},
{
"docid": "7d31f61ebbbd0ce0af3b0132d618b51b",
"score": "0.68992734",
"text": "def get_attr(attr)\n self.attrs[attr]\n end",
"title": ""
},
{
"docid": "4dc8390d31fac2cf7272095b14016f25",
"score": "0.68818223",
"text": "def element_value(locator)\n element(locator).attribute('value') if exists?(locator)\n end",
"title": ""
},
{
"docid": "1193ef3034572d8a94fb81d489798314",
"score": "0.6873784",
"text": "def get_out_val\n self.attrs[:value]\n end",
"title": ""
},
{
"docid": "1193ef3034572d8a94fb81d489798314",
"score": "0.6873784",
"text": "def get_out_val\n self.attrs[:value]\n end",
"title": ""
},
{
"docid": "e17b43528db221c9f2df3c3af83291f5",
"score": "0.6872876",
"text": "def value_at(position, attribute: nil)\n node = xml_doc.at_css(position)\n node or return\n attribute ? node[attribute] : node.text\n end",
"title": ""
},
{
"docid": "34d27790766722bd4850feb51912a7a8",
"score": "0.68677866",
"text": "def attribute(name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "3999142ddc4e684d6c471091b4f55c2d",
"score": "0.6867645",
"text": "def attribute_value(row,attribute)\n row[attribute.to_s]\n end",
"title": ""
},
{
"docid": "ef248fc8eccfb401f494227b4b74bf9b",
"score": "0.6860964",
"text": "def element\n \"RequestedAttribute\"\n end",
"title": ""
},
{
"docid": "69a7718a1322947b441d484326b61fc9",
"score": "0.6852562",
"text": "def getAttribute(name)\n attr = getAttributeNode(name)\n if attr.nil?\n ''\n else\n attr.nodeValue\n end\n end",
"title": ""
},
{
"docid": "2b94f613ed971387effde7e7392933ad",
"score": "0.6846007",
"text": "def attribute_value\n validatable.send(options[:attribute])\n end",
"title": ""
},
{
"docid": "7310edb6ee13a830212f453be6708129",
"score": "0.6820728",
"text": "def attribute(name)\n get_selenium_elements[@index].attribute(name)\n end",
"title": ""
},
{
"docid": "aa975fc8ee060d583a3441e8055c6e92",
"score": "0.67966914",
"text": "def getAttribute(name)\n getAttributeFromNode(@xml,name) ;\n end",
"title": ""
},
{
"docid": "67b3fcc25aadf710e6fa4e1088299eda",
"score": "0.6796334",
"text": "def attribute(name)\n bridge.element_attribute self, name\n end",
"title": ""
},
{
"docid": "67b3fcc25aadf710e6fa4e1088299eda",
"score": "0.6796334",
"text": "def attribute(name)\n bridge.element_attribute self, name\n end",
"title": ""
},
{
"docid": "7d5c54ffd0c3e6ba9ee3da5588b01dce",
"score": "0.6796231",
"text": "def get_attr(k)\n self.page_attrs.find_by_attr_key(k)&.attr_value\n end",
"title": ""
},
{
"docid": "581b5d4813d1635112678bb0f6f72355",
"score": "0.67940557",
"text": "def get_attribute(name)\n attributes.find { |a| a.name == name }\n end",
"title": ""
},
{
"docid": "600e165af9c32066711e78b816d128c6",
"score": "0.67705816",
"text": "def get_value\n read_attribute('string_value')\n end",
"title": ""
},
{
"docid": "cf1cc946f5ac683bd6e5ea9e780da216",
"score": "0.6770301",
"text": "def value\n `#{@element}.value`\n end",
"title": ""
},
{
"docid": "3498c809d06cffd97c10fec6e79ce19d",
"score": "0.6761774",
"text": "def get_attribute name\n @attributes[name]\n end",
"title": ""
},
{
"docid": "327b52e29371b04d871edfcf7b34dfc6",
"score": "0.67613864",
"text": "def get_attribute(attribute_name)\n attributes[attribute_name]\n end",
"title": ""
},
{
"docid": "4b817d63208a0704ca350720b5475c21",
"score": "0.6759289",
"text": "def attribute(name)\n read_attribute(name)\n end",
"title": ""
},
{
"docid": "23ec52bcf885366f12e833fc292cead8",
"score": "0.67563295",
"text": "def attribute_value(row,attribute)\n row\n end",
"title": ""
},
{
"docid": "3d88ffb1ec791bea6fd44cb176c24966",
"score": "0.6753096",
"text": "def extract_attr_value(xml)\n default_when_xpath_err { @path.first(xml).elements.to_a }\n end",
"title": ""
},
{
"docid": "d54258bd28c624250bddf450ceb958c0",
"score": "0.67332006",
"text": "def attribute(element, name, namespace=nil)\n element.attribute(name)\n end",
"title": ""
},
{
"docid": "53530d10f939450f46059713e60e1110",
"score": "0.6698454",
"text": "def get_attribute_value(id)\n\t\t\tattribute = @attributes[id]\n\t\t\treturn attribute.is_a?(Array) ? attribute.last : attribute if attribute\n\t\t\t@imports.each do |import|\n\t\t\t\tnext if !import\n\t\t\t\tvalue = import.get_attribute_value(id)\n\t\t\t\treturn value if value\n\t\t\tend\n\t\t\treturn @parent ? @parent.get_attribute_value(id) : nil\n\t\tend",
"title": ""
},
{
"docid": "27140d306900d7f5a93f469723a87d4a",
"score": "0.66821563",
"text": "def value\n @element.value\n end",
"title": ""
},
{
"docid": "4375aa2296edfeaccf534874b747e24c",
"score": "0.6681948",
"text": "def attribute_value(attribute_name)\r\n #puts attribute_name\r\n assert_exists()\r\n return_value = get_attribute_value(attribute_name)\r\n @@current_level = 0\r\n return return_value\r\n end",
"title": ""
},
{
"docid": "1c7e73c2af7e7912e32713620dc2074a",
"score": "0.6679226",
"text": "def attribute(selector, &callback)\n Attribute.new(nil, selector, &callback).value(node)\n end",
"title": ""
},
{
"docid": "95adca170a0c4f4f9744bc7455782f82",
"score": "0.6675395",
"text": "def attribute(name)\n\t\t\tattributes.select{|n| n[:name] == name}[0]\n\t\tend",
"title": ""
},
{
"docid": "95adca170a0c4f4f9744bc7455782f82",
"score": "0.6675395",
"text": "def attribute(name)\n\t\t\tattributes.select{|n| n[:name] == name}[0]\n\t\tend",
"title": ""
},
{
"docid": "00d287d2b4f0be8b2b8bf018864c5224",
"score": "0.6670398",
"text": "def attribute(doc, selector_or_element, attribute)\n if selector_or_element.is_a? String\n target_element = element(doc, selector_or_element)\n else\n target_element = selector_or_element\n end\n\n # No node found, can't find an attribute\n if target_element.respond_to?(:length) && target_element.length == 0\n return nil\n end\n return nil if target_element.nil?\n\n target_element.attribute(attribute).text\n end",
"title": ""
},
{
"docid": "7ce13d90980b3658b62b2e73d31fbaed",
"score": "0.66653514",
"text": "def [](attribute_name)\n\n return @value_cache[attribute_name] if (!@touched && @value_cache[attribute_name])\n\n if attribute_name.nil? then return '' end\n\n value = nil\n attribute_name = attribute_name.to_s\n\n if @attributes[attribute_name].nil? then \n short_attrib_name = attribute_name.split('.')[-1]\n \n if !@attributes[short_attrib_name].nil? then\n value = @attributes[short_attrib_name]\n \n else\n attrib_value = nil\n @attributes.each_pair { |key, value|\n key = key.to_s\n key_array = key.split('.')\n implicit_attr_name = key_array[2]\n\n if !implicit_attr_name.nil? and implicit_attr_name == attribute_name then\n attrib_value = @attributes[key_array[0]+'.'+key_array[1]+'.'+attribute_name]\n end\n }\n value = attrib_value \n end\n \n else \n value = @attributes[attribute_name]\n end\n\n @value_cache[attribute_name] = value\n return value\n\n end",
"title": ""
},
{
"docid": "492e0f4443fc36a88df5fca98918cd09",
"score": "0.66252756",
"text": "def get_attribute(name)\n # Interface method\n end",
"title": ""
},
{
"docid": "0581ec7d1a58d409d0035389aa4a95e9",
"score": "0.66245705",
"text": "def [](attr)\n return self.attributes[attr.to_s]\n end",
"title": ""
},
{
"docid": "3fc41946fba6ba8a7a27c8220c57b5bf",
"score": "0.66243607",
"text": "def attr(attribute_code)\n @custom_attributes&.find { |a| a.attribute_code == attribute_code.to_s }&.value\n end",
"title": ""
},
{
"docid": "f610513c086807c4ff739126a3c57926",
"score": "0.6623446",
"text": "def [](attribute)\n @tag.scan(/#{attribute}\\s*=\\s*\\\"([^\"]+)\\\"/)[0][0] rescue nil\n end",
"title": ""
},
{
"docid": "ffde2c8167c8b38fa82eed10209f9255",
"score": "0.6616522",
"text": "def getAttributeString(name)\n getAttributeStringFromNode(@xml, name) ;\n end",
"title": ""
},
{
"docid": "74382a5a374404799e245ebb37f68ad0",
"score": "0.66159606",
"text": "def get_attribute(attribute_name)\n @attributes[attribute_name]\n end",
"title": ""
},
{
"docid": "93c3ce8f7435ffb4a0ed092a80f2ffec",
"score": "0.6615478",
"text": "def value_from_element(element)\n element.attributes[\"value\"].try(:value) || \"on\"\n end",
"title": ""
},
{
"docid": "cfe5a50969b49152e2c50b959ef4f4da",
"score": "0.66053957",
"text": "def get_atom_attrb xml, name\n xml.attributes[name.to_s]\n end",
"title": ""
},
{
"docid": "2c79b4b05e54992f25837f11d7a17e9d",
"score": "0.6602171",
"text": "def _attribute(name = @name)\n @attributes[name.to_sym]\n end",
"title": ""
},
{
"docid": "2c79b4b05e54992f25837f11d7a17e9d",
"score": "0.6602171",
"text": "def _attribute(name = @name)\n @attributes[name.to_sym]\n end",
"title": ""
},
{
"docid": "c1200aac964244a55f3bc51467edfa16",
"score": "0.6595712",
"text": "def [](attr)\n\t\tdesc = System.command(\"cleartool describe -short -aattr #{attr} #{@name}@@\")\n\t\traise \"error reading attribute #{attr} for element #{@name}\" if desc.failed?\n\t\ts = desc.out0\n\t\ts = s[1..-2] if s[0] == '\"' && s[-1] == '\"'\n\t\treturn s\n\tend",
"title": ""
},
{
"docid": "e271332ca4b685c15e2cae84312b7baf",
"score": "0.65945685",
"text": "def [](name)\n %x{\n if (name === 'href') {\n return #{self}.getAttribute(name, 2) || '';\n }\n else {\n return #{self}.getAttribute(name) || '';\n }\n }\n end",
"title": ""
},
{
"docid": "5dc06334b51cfc04e11e603d7ba29d85",
"score": "0.658097",
"text": "def value\n val = attr_val('./cda:value/@value')\n val ||= attr_val('./cda:value/@extension')\n if val\n val\n else\n @entry.at_xpath('./cda:value').inner_text\n end\n end",
"title": ""
},
{
"docid": "5dc06334b51cfc04e11e603d7ba29d85",
"score": "0.658097",
"text": "def value\n val = attr_val('./cda:value/@value')\n val ||= attr_val('./cda:value/@extension')\n if val\n val\n else\n @entry.at_xpath('./cda:value').inner_text\n end\n end",
"title": ""
},
{
"docid": "5a17af7b4249f32c14d8927fce01f312",
"score": "0.65794396",
"text": "def argument\n @xml_element.attributes['argument']\n end",
"title": ""
},
{
"docid": "211253ed4395434360b74a139d0c8960",
"score": "0.65791625",
"text": "def attribute_value(row,attribute)\n row.send(attribute)\n end",
"title": ""
},
{
"docid": "950ad066eb449ca38119fa229c923be3",
"score": "0.6572203",
"text": "def [](key)\n attributes[key].value\n end",
"title": ""
},
{
"docid": "6fa2e58600e1e44905b9fda47142ce6b",
"score": "0.6554544",
"text": "def attribute(selector)\n @node.find(selector).text\n rescue Capybara::ElementNotFound\n nil\n end",
"title": ""
},
{
"docid": "81ede671cbb3c9a249b43e1f3b1126a2",
"score": "0.6550351",
"text": "def [](attribute)\n @element[attribute]\n end",
"title": ""
},
{
"docid": "5c6b19006e6668f2daf5ad7ccb9c0376",
"score": "0.65434945",
"text": "def value_for_attribute(attribute)\n if attribute.root_only?\n consumer.spec.send(attribute.name)\n else\n consumer.send(attribute.name) if consumer.respond_to?(attribute.name)\n end\n rescue => e\n results.add_error('attributes', \"Unable to validate `#{attribute.name}` (#{e}).\")\n nil\n end",
"title": ""
},
{
"docid": "b60a7d2f486a899e9f9f49f6a461e7a9",
"score": "0.65422165",
"text": "def get_attribute( name )\n attr = fetch( name, nil )\n if attr.nil?\n return nil if name.nil?\n # Look for prefix\n name =~ Namespace::NAMESPLIT\n prefix, n = $1, $2\n if prefix\n attr = fetch( n, nil )\n # check prefix\n if attr == nil\n elsif attr.kind_of? Attribute\n return attr if prefix == attr.prefix\n else\n attr = attr[ prefix ]\n return attr\n end\n end\n element_document = @element.document\n if element_document and element_document.doctype\n expn = @element.expanded_name\n expn = element_document.doctype.name if expn.size == 0\n attr_val = element_document.doctype.attribute_of(expn, name)\n return Attribute.new( name, attr_val ) if attr_val\n end\n return nil\n end\n if attr.kind_of? Hash\n attr = attr[ @element.prefix ]\n end\n return attr\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "eac3076674bb06e9e639c169d55f378e",
"score": "0.0",
"text": "def set_dis_indiastate\n @dis_indiastate = DisIndiastate.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": ""
}
] |
b650a5949162969ce90dfed50bf9eb64
|
GET /weapon_infos/new GET /weapon_infos/new.xml
|
[
{
"docid": "639efd0a223c3296e42299b17a2e05ac",
"score": "0.7950689",
"text": "def new\n @weapon_info = WeaponInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @weapon_info }\n end\n end",
"title": ""
}
] |
[
{
"docid": "35e219892d9c1a09bad8da37890ff7ea",
"score": "0.73990816",
"text": "def create\n @weapon_info = WeaponInfo.new(params[:weapon_info])\n\n respond_to do |format|\n if @weapon_info.save\n flash[:notice] = 'WeaponInfo was successfully created.'\n format.html { redirect_to(@weapon_info) }\n format.xml { render :xml => @weapon_info, :status => :created, :location => @weapon_info }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @weapon_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58332f04c3ebc3a19500515c9d71ba1f",
"score": "0.72469187",
"text": "def new\n @weapon = Weapon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weapon }\n end\n end",
"title": ""
},
{
"docid": "44e8c24efa701a276786bc9441a2fe99",
"score": "0.68610287",
"text": "def new\n @weapon_kind = WeaponKind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weapon_kind }\n end\n end",
"title": ""
},
{
"docid": "da1f124bacc4c271103265c44ccf82dd",
"score": "0.6752034",
"text": "def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"title": ""
},
{
"docid": "a33b1c3027f00fe7b632070f0fcb4106",
"score": "0.67430604",
"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": "a83173640f77272bfb6f58a0a65c7e67",
"score": "0.6734958",
"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": "42fb83d2214651b2ae5e6e5e2843bf3c",
"score": "0.6731452",
"text": "def new\n @item = Item.factory('local')\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "99c280775d8974bd512c498f9f586845",
"score": "0.67240626",
"text": "def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"title": ""
},
{
"docid": "99c280775d8974bd512c498f9f586845",
"score": "0.67240626",
"text": "def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"title": ""
},
{
"docid": "da9386683a03140c0a6fb19108098932",
"score": "0.6718391",
"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": "e86b979e1174fb15312ea51a561def6b",
"score": "0.6616424",
"text": "def new\n\n @silicon = Silicon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @silicon }\n end\n end",
"title": ""
},
{
"docid": "45ed51e10eee94be81a46733ae19a6a2",
"score": "0.6611821",
"text": "def new\n\t\t@clicker = Clicker.new\t\t\t\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @clicker }\n end\n end",
"title": ""
},
{
"docid": "1719dd6032489074ed130e5975bc56b3",
"score": "0.66083735",
"text": "def new\n @weapons_type = WeaponsType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weapons_type }\n end\n end",
"title": ""
},
{
"docid": "961a7809afd4d3fd99281a30198b33bc",
"score": "0.6602337",
"text": "def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"title": ""
},
{
"docid": "39769b1c311f72039d81898058d71bf0",
"score": "0.6588311",
"text": "def show\n @weapon_info = WeaponInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @weapon_info }\n end\n end",
"title": ""
},
{
"docid": "a7713c0bba70fef760d43b5aacad9fe9",
"score": "0.65777683",
"text": "def create\n @weapon = Weapon.new(params[:weapon])\n\n respond_to do |format|\n if @weapon.save\n format.html { redirect_to @weapon, notice: 'Weapon was successfully created.' }\n format.json { render json: @weapon, status: :created, location: @weapon }\n else\n format.html { render action: \"new\" }\n format.json { render json: @weapon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b73e6a56c834fd25f7a9fce89dac53e6",
"score": "0.6564617",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @software }\n end\n end",
"title": ""
},
{
"docid": "aafce46fd8ae3038da7eb4511b92a69f",
"score": "0.65428585",
"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": "46ccc161d659c671a7ad67992bbba8c0",
"score": "0.65291893",
"text": "def new\n @gift = Gift.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gift }\n end\n end",
"title": ""
},
{
"docid": "9d0c1a01f6fc2e53d656966a7e2ccf28",
"score": "0.6524662",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @infraction_type }\n end\n end",
"title": ""
},
{
"docid": "61e8a9d7e9b4dc5ef2c68eb2ca47a04c",
"score": "0.6491907",
"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.6491907",
"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": "d91e926b51eb1c9cefc85ae639987c01",
"score": "0.6487419",
"text": "def create\n @weapon = Weapon.new(weapon_params)\n\n respond_to do |format|\n if @weapon.save\n format.html { redirect_to @weapon, notice: 'Weapon was successfully created.' }\n format.json { render :show, status: :created, location: @weapon }\n else\n format.html { render :new }\n format.json { render json: @weapon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d91e926b51eb1c9cefc85ae639987c01",
"score": "0.6487419",
"text": "def create\n @weapon = Weapon.new(weapon_params)\n\n respond_to do |format|\n if @weapon.save\n format.html { redirect_to @weapon, notice: 'Weapon was successfully created.' }\n format.json { render :show, status: :created, location: @weapon }\n else\n format.html { render :new }\n format.json { render json: @weapon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "005503f0cb4af04a97c028430c10ccbb",
"score": "0.64829576",
"text": "def new\n @probe = Probe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @probe }\n end\n end",
"title": ""
},
{
"docid": "278cc721a4f0a7eaf338a9bed4140c3d",
"score": "0.64791816",
"text": "def new\n logger.debug 'new_some interesting information'\n @comdty = Comdty.new\n setvariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comdty }\n end\n end",
"title": ""
},
{
"docid": "fcc3578574cfad3fb7f2b42a7d8cbedd",
"score": "0.6476291",
"text": "def new\n @enemy = EnemyTemplate.new\n @title = \"New enemy\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @enemy }\n end\n end",
"title": ""
},
{
"docid": "09659b5e0a0b570d5c8019b81ae00efa",
"score": "0.647507",
"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": "0a4647f22b65271cd627cad52bbec2b8",
"score": "0.64677835",
"text": "def new\n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"title": ""
},
{
"docid": "324c79de34f3e883f424733dc3634f2a",
"score": "0.64610404",
"text": "def new\n @serie = Serie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @serie }\n end\n end",
"title": ""
},
{
"docid": "ccff1356b0ec7aeabc85118a7dd7841a",
"score": "0.6453613",
"text": "def new\n @universe = Universe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @universe }\n end\n end",
"title": ""
},
{
"docid": "40304aae29716fc3dcdfcfd3228087aa",
"score": "0.64498645",
"text": "def new\n @threat = Threat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @threat }\n end\n end",
"title": ""
},
{
"docid": "30dea46655319ef1b6e230320f661315",
"score": "0.64420253",
"text": "def new\n @shot = Shot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shot }\n end\n end",
"title": ""
},
{
"docid": "1fe1f72067a32845ab1f38611f7a89c2",
"score": "0.6441847",
"text": "def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"title": ""
},
{
"docid": "d489848f8b0fb63d94c5acbcb3d77ea7",
"score": "0.6433978",
"text": "def new\n @league_item = LeagueItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @league_item }\n end\n end",
"title": ""
},
{
"docid": "f6f391b98729bc25f56e03acc3f9172d",
"score": "0.6428391",
"text": "def new\n @title = \"New item\"\n @item = ItemTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6424356",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "2d503b23b083f187e8932c30eec5927b",
"score": "0.6412629",
"text": "def create\n @weapon = Weapon.new(weapon_params)\n\n respond_to do |format|\n if @weapon.save\n format.html { redirect_to @weapon, notice: \"Weapon was successfully created.\" }\n format.json { render :show, status: :created, location: @weapon }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @weapon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e71b8c126284413ea993da246b2560d",
"score": "0.64049196",
"text": "def new\n @foyer = Foyer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @foyer }\n end\n end",
"title": ""
},
{
"docid": "3bcd4b67bdf0b98b53ac23d0bc820c60",
"score": "0.6400994",
"text": "def new\n @patron = Patron.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patron }\n end\n end",
"title": ""
},
{
"docid": "31dcc2b67bb031a21116ffebc295e116",
"score": "0.6398287",
"text": "def new\n @galerie = Galerie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @galerie }\n end\n end",
"title": ""
},
{
"docid": "71bf7f2b80d8a96ab29101a02f587c17",
"score": "0.6390123",
"text": "def new\n @software = Software.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @software }\n end\n end",
"title": ""
},
{
"docid": "71bf7f2b80d8a96ab29101a02f587c17",
"score": "0.6390123",
"text": "def new\n @software = Software.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @software }\n end\n end",
"title": ""
},
{
"docid": "71bf7f2b80d8a96ab29101a02f587c17",
"score": "0.6390123",
"text": "def new\n @software = Software.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @software }\n end\n end",
"title": ""
},
{
"docid": "81111f6303187f327da158b8fffbec4b",
"score": "0.6386437",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @game }\n end\n end",
"title": ""
},
{
"docid": "576b88a54f5c1a38f0a4ded66b8b25d3",
"score": "0.63857085",
"text": "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @unit }\n end\n end",
"title": ""
},
{
"docid": "b05143a1ddbdfa9e602d2b5517e17e2a",
"score": "0.6384387",
"text": "def new\n @spiel = Spiel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spiel }\n end\n end",
"title": ""
},
{
"docid": "b43d1152becde26d0ae5a63697498838",
"score": "0.6383567",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"title": ""
},
{
"docid": "698e2bf585730348c8f855a9c7e3e45f",
"score": "0.6380115",
"text": "def new\n# @fossil = Fossil.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fossil }\n end\n end",
"title": ""
},
{
"docid": "f0447f2677d297d1a7d8b160121f0797",
"score": "0.6379825",
"text": "def new\n @web_info = WebInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_info }\n end\n end",
"title": ""
},
{
"docid": "2cce25f6b5d51737ad6bba796e165006",
"score": "0.6377532",
"text": "def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @monkey }\n end\n end",
"title": ""
},
{
"docid": "b4293148eeeac376018e3c6c81c8d633",
"score": "0.63758767",
"text": "def new\n @upgrade = Upgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @upgrade }\n end\n end",
"title": ""
},
{
"docid": "45b2f4b5c9d629109b0d49871a1b0214",
"score": "0.6375775",
"text": "def new\n @oil = Oil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oil }\n end\n end",
"title": ""
},
{
"docid": "45b2f4b5c9d629109b0d49871a1b0214",
"score": "0.6375775",
"text": "def new\n @oil = Oil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oil }\n end\n end",
"title": ""
},
{
"docid": "22dc12226554bc09bbf1ef8763f190bf",
"score": "0.63691294",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"title": ""
},
{
"docid": "209fa970bceea9c36d315ee11ce3b04c",
"score": "0.6367086",
"text": "def new\n @hacker = Hacker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hacker }\n end\n end",
"title": ""
},
{
"docid": "f3b1e6ee12a73ca28bd6bdb3f0056519",
"score": "0.6366843",
"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": "b4957f81084647d3ca66506476da06c2",
"score": "0.63561076",
"text": "def new\n @soft = Soft.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @soft }\n end\n end",
"title": ""
},
{
"docid": "618a7f645eee6bd5b626fa55983d0827",
"score": "0.63525987",
"text": "def new\n @fight = Fight.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fight }\n end\n end",
"title": ""
},
{
"docid": "4467834b8f230f7816c7828c091099ee",
"score": "0.63491863",
"text": "def new\n @supporter = Supporter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @supporter }\n end\n end",
"title": ""
},
{
"docid": "8c951fbd52102aa3f9894c53fe41da51",
"score": "0.63453484",
"text": "def new\n @drop = @npc.drops.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @drop }\n end\n end",
"title": ""
},
{
"docid": "da5650308391476567919f4eb2fb3356",
"score": "0.63401145",
"text": "def new\n @clicker = Clicker.new\n\n \n respond_to do |format|\n \n format.html # new.html.erb\n \nformat.xml { render :xml => @clicker }\n \n end\n \nend",
"title": ""
},
{
"docid": "9978c29e8db8b3cf15f16150b31845b8",
"score": "0.6340065",
"text": "def new\n @battle = Battle.new\n @ships = Ship.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @battle }\n end\n end",
"title": ""
},
{
"docid": "05299d447b7289b78fe2b61b6c925c94",
"score": "0.6339348",
"text": "def new\n @member_info = MemberInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member_info }\n end\n end",
"title": ""
},
{
"docid": "d615495fb7aff2920199cb1591c32466",
"score": "0.63386184",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"title": ""
},
{
"docid": "374e85a5181b1672f4028c9e564be913",
"score": "0.63352674",
"text": "def new\n @ship_methods = ShipMethods.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship_methods }\n end\n end",
"title": ""
},
{
"docid": "f91ff30d142c6502b46e6ea52d5419c7",
"score": "0.6335052",
"text": "def new\n @funder = Funder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @funder }\n end\n end",
"title": ""
},
{
"docid": "4c987b2a06489e3bb5324b86095d9e4c",
"score": "0.6334751",
"text": "def new\n @purchase_information = PurchaseInformation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @purchase_information }\n end\n end",
"title": ""
},
{
"docid": "ec346aa4a24d377db34503373808b7c5",
"score": "0.63332355",
"text": "def new\r\n @info_class = InfoClass.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @info_class }\r\n end\r\n end",
"title": ""
},
{
"docid": "ee74080ca89a9eec7acf464aa7f7c579",
"score": "0.63282263",
"text": "def new\n @needle = Needle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @needle }\n end\n end",
"title": ""
},
{
"docid": "18480dd8ef266c0da75f85cd6b767ebc",
"score": "0.632196",
"text": "def new\n @it_device = ItDevice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @it_device }\n end\n end",
"title": ""
},
{
"docid": "ad359172d15d6e5503201d7563822e71",
"score": "0.6319737",
"text": "def new\n @intelligence = Intelligence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @intelligence }\n end\n end",
"title": ""
},
{
"docid": "432408d532bbd0e8d958accf1008ae84",
"score": "0.6319537",
"text": "def new\r\n @item = Item.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @item }\r\n end\r\n end",
"title": ""
},
{
"docid": "3d6bc91f3f2310d0e859c37c35b626e8",
"score": "0.6314236",
"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.6313532",
"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": "dcad0425a2b1bdcc83da3b427e6e93c6",
"score": "0.631276",
"text": "def new\n respond_to do |format|\n format.html { # new.html.erb\n @flyer_info = FlyerInfo.new\n }\n end\n end",
"title": ""
},
{
"docid": "4c9050809fa686a4a2e92f895efe27a0",
"score": "0.63119197",
"text": "def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"title": ""
},
{
"docid": "5f14b77650831d419613f417f696da26",
"score": "0.6306692",
"text": "def new\n @vegetable = Vegetable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vegetable }\n end\n end",
"title": ""
},
{
"docid": "2b8327055fd2ae17d33a67616222f41a",
"score": "0.630368",
"text": "def new\n @pokemon = Pokemon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pokemon }\n end\n end",
"title": ""
},
{
"docid": "ca6a39849d6cbfb489d1e4a8e8390fed",
"score": "0.6303549",
"text": "def new\n @lek = Lek.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lek }\n end\n end",
"title": ""
},
{
"docid": "8211e39d1b0d7671a343459133b3373a",
"score": "0.6302242",
"text": "def new\n @page_title = \"Power Units\"\n @power_unit = PowerUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @power_unit }\n end\n end",
"title": ""
},
{
"docid": "085485e231e7eee2c8fa64a34c34e0d5",
"score": "0.6298014",
"text": "def new\n @product_info = ProductInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_info }\n end\n end",
"title": ""
},
{
"docid": "aa7c3f2285b230938439c8865a179ad4",
"score": "0.62891555",
"text": "def new\n @diet = Diet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @diet }\n end\n end",
"title": ""
},
{
"docid": "608e09195eaf7c1a45638fcc212766ec",
"score": "0.6286912",
"text": "def new\n @bonus = Bonu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bonus }\n end\n end",
"title": ""
},
{
"docid": "8a233f7b0a12e23fcdf06dc7aa3700d3",
"score": "0.6286586",
"text": "def new\n @shop = Shop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shop }\n end\n end",
"title": ""
},
{
"docid": "ae7e96b1e93a6f76f5cd7c7e966f60d0",
"score": "0.62855583",
"text": "def create\n @weapon = Weapon.new(weapon_params)\n\n if @weapon.save\n render json: @weapon, status: :created, location: @weapon\n else\n render json: @weapon.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d2e2dfce8283a4e964aaa1d9e248a9db",
"score": "0.6279919",
"text": "def new\n @services_charger = ServicesCharger.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @services_charger }\n end\n end",
"title": ""
},
{
"docid": "cc6e22b7596cfed4bd4036eafcf0468d",
"score": "0.627742",
"text": "def new\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n format.xml { render xml: @item }\n end\n end",
"title": ""
},
{
"docid": "9abc5616cdb5f9f895f8948372547e6f",
"score": "0.62773573",
"text": "def new\n @boat_storage_equipment = BoatStorageEquipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boat_storage_equipment }\n end\n end",
"title": ""
},
{
"docid": "67f1e8bdcc8494dec97ea9accde32343",
"score": "0.6275739",
"text": "def new\n @menu = uhook_new_menu\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @menu }\n end\n end",
"title": ""
},
{
"docid": "05b90463a5f309181be53ae97bed6707",
"score": "0.6273701",
"text": "def new\n @item = BudgetItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "3b67635fdae2104771c4170ad5384f20",
"score": "0.6273698",
"text": "def new\n @nom = Nom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nom }\n end\n end",
"title": ""
},
{
"docid": "92549f188802a45167eb076f967c293f",
"score": "0.6272013",
"text": "def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"title": ""
}
] |
b6de2d8aae89dad8263948e17c1eacf3
|
Finds all occurrences of a given file path, within all data directories.
|
[
{
"docid": "4de4f08cc616af6a936c89ab0ea5cd65",
"score": "0.6674702",
"text": "def all_data_files(path)\n each_data_file(path).to_a\n end",
"title": ""
}
] |
[
{
"docid": "dd118bc4c884c3aefe7c20f8444dc932",
"score": "0.70598406",
"text": "def find_data_file(path)\n each_data_path(path).find { |full_path| File.file?(full_path) }\n end",
"title": ""
},
{
"docid": "2e849af6f166798e581f9a30149d0954",
"score": "0.68263763",
"text": "def find_files( path )\n file_paths.each_with_object([]) do |search_path,obj|\n found = File.join( search_path, path )\n obj << found if File.exist? found\n end.reverse.uniq\n end",
"title": ""
},
{
"docid": "e956e5a88ca2722fd9e92dcc9d492cd0",
"score": "0.67632616",
"text": "def list_files_from (path,opts = {})\n safe_fetch do\n list_files = Set.new\n var = \"Search in #{path} at #{@host}... \"\n cmd = \"find #{path}\"\n cmd = \"(cd #{path} && ls \" ### dont know why cd alone doesn't work\n cmd << \"-td */\" if opts[:directories]\n cmd << opts[:regexp] if opts[:regexp]\n cmd << \" 2>/dev/null)\"\n out = @ssh.exec!(cmd)\n list_files = out.split\n list_files = out.split(\"/\\n\") if opts[:directories]\n\n var << \"Found #{list_files.size} entries\\n\"\n Logger.<<(__FILE__,\"INFO\",var)\n list_files\n end\n end",
"title": ""
},
{
"docid": "86d82fc90ae5e20d523adeb548e017f8",
"score": "0.673646",
"text": "def find\r\n scanner = DirectoryScanner.new\r\n scanner.setBasedir(@context.root)\r\n scanner.setCaseSensitive(false)\r\n scanner.setIncludes(@includes.to_java :String) unless @includes.empty?\r\n scanner.setExcludes(@excludes.to_java :String) unless @excludes.empty?\r\n scanner.scan\r\n scanner.included_files.collect{|f| @context.filepath_from_root(f) }\r\n end",
"title": ""
},
{
"docid": "4bea79cebb0368840eb003928446b176",
"score": "0.67177516",
"text": "def find_files dir = test_dir\n glob file_pattern(dir)\n end",
"title": ""
},
{
"docid": "b3a587363d927d32020c92203c4f91ec",
"score": "0.6669622",
"text": "def find\n results = [] unless block_given?\n # paths = @path.is_a?(String) ? [@path] : @path\n\n begin\n exclude_dir_regex = @exclude_dir\n rescue => ex\n puts \"--exclude_dir regex Skipping, #{ex.message}\"\n exit\n end\n\n begin\n file_regex = (Regexp.new(@regex) if @regex)\n rescue => ex\n puts \"--rname regex : Skipping, #{ex.message}\"\n exit\n end\n\n recursively_find_file(exclude_dir_regex, path, results, file_regex)\n\n block_given? ? nil : results\n end",
"title": ""
},
{
"docid": "561750d848da46996d0a693d9e96f94e",
"score": "0.6653211",
"text": "def do_find(path)\n dalli_params = {\n path: path,\n request: 'which_filesets'\n }\n unless (items = cache.read(dalli_params))\n items = {}\n model.find(:all,\n conditions: (\"basename(path) = basename('#{path}') AND \" +\n \"path LIKE '%#{path}'\"),\n order: \"path\",\n include: [ { filesets: :lpp }]).each do |f|\n items[f.path] = ((items[f.path] || []) + f.filesets.map { |fileset| fileset.lpp.name }).sort.uniq\n end\n rc = cache.write(dalli_params, items) # Need to do something with rc\n end\n items\n end",
"title": ""
},
{
"docid": "450bfe4f387c95f53b8a6917872a7834",
"score": "0.66339916",
"text": "def find_files(path)\n entries = Dir[path + \"/*\"]\n puts entries.size\n entries.select! { |entry| File.file?(entry) }\n entries\n end",
"title": ""
},
{
"docid": "591a0b372f53dd9aa489f8db4cf1d192",
"score": "0.6605914",
"text": "def files_listing path\n cmd = \"find #{path} -type f \"\n cmd += \"-regextype posix-extended \"\n cmd += \"-regex \\\"#{@file_regexp}\\\" \" if @file_regexp\n out = exec_cmd(cmd)\n end",
"title": ""
},
{
"docid": "354792377b2f35d76983d94a06229fb7",
"score": "0.6572907",
"text": "def all_matching_files\n @all_matching_files ||= find_files\n end",
"title": ""
},
{
"docid": "354792377b2f35d76983d94a06229fb7",
"score": "0.6572907",
"text": "def all_matching_files\n @all_matching_files ||= find_files\n end",
"title": ""
},
{
"docid": "6e542ee4b6b5fc7562b5fd013ef5f30d",
"score": "0.65516037",
"text": "def find(path); end",
"title": ""
},
{
"docid": "6e542ee4b6b5fc7562b5fd013ef5f30d",
"score": "0.65516037",
"text": "def find(path); end",
"title": ""
},
{
"docid": "843ff209acd93bb75239ef1f8572304e",
"score": "0.6532563",
"text": "def paths\n f = File.open(@path)\n f.grep(FILE_NAME_PATTERN) { $1 }\n end",
"title": ""
},
{
"docid": "b6c249c6af1eb0fd1cba7d1feb4ead01",
"score": "0.65238804",
"text": "def find_files\n find_files_recursive(@build_result_dir, '')\n end",
"title": ""
},
{
"docid": "3a58272405ff3cf6d3d616535456bab3",
"score": "0.6518328",
"text": "def scan\n results = []\n dirs.each do |dir|\n files_in_dir = Dir.glob(File.join(dir,'**','*'))\n results.concat(files_in_dir)\n end\n @known_files = results\n end",
"title": ""
},
{
"docid": "6249a82c6cd787e5b9b131ab1871bc27",
"score": "0.64993525",
"text": "def get_files_in_path(path)\n puts \"Scanning for files in directory: #{path}\"\n Dir.entries(path).reject { |f| File.directory? f }\nend",
"title": ""
},
{
"docid": "b73884ec7c7a5a58eff38881067eaee5",
"score": "0.63969904",
"text": "def find(dirs); end",
"title": ""
},
{
"docid": "55f2c3461437815cae196acb82a75cb0",
"score": "0.6366798",
"text": "def find_paths(dir=\"\")\n base = File.join(@source, dir)\n entries = Dir.chdir(base) { filter_entries(Dir[\"*\"]) }\n paths = []\n\n entries.each do |entry|\n absolute_path = File.join(base, entry)\n relative_path = File.join(dir, entry)\n\n if File.directory?(absolute_path)\n paths.concat find_paths(relative_path)\n else\n paths << absolute_path\n end\n end\n paths\n end",
"title": ""
},
{
"docid": "6eea7dbe5ad9d7251f45fd6d06982fbd",
"score": "0.6356638",
"text": "def search_in(files, host, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b28a1fd5b5ff4dd98c1bb5e04e9cd680",
"score": "0.6356461",
"text": "def all_data_paths(path)\n each_data_path(path).to_a\n end",
"title": ""
},
{
"docid": "9fa46feb40247e938ac73fdbab7c64fa",
"score": "0.6326463",
"text": "def scan_file(path)\n keys = []\n File.open(path, 'rb') do |f|\n f.read.scan(pattern) do |match|\n key = extract_key_from_match(match, path)\n keys << key if valid_key?(key)\n end\n end\n keys\n end",
"title": ""
},
{
"docid": "3a7ee85da54ae9d7b2681ad662e7b1cb",
"score": "0.63259923",
"text": "def enumerate_files search_path\n Enumerator.new do |e|\n Dir\n .glob(search_path)\n .each do |filename|\n if File.file?(filename)\n $stderr.puts \"Reading #{filename}\" if $verbose\n File.open filename do |file|\n e.yield file.read()\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "f14dd7551b786032216250b1e87b233e",
"score": "0.63197947",
"text": "def find_files(base_dir, flags); end",
"title": ""
},
{
"docid": "2c727c096aadea5e1b6bd88dd7221eae",
"score": "0.63181984",
"text": "def search_filenames\n # * => all files\n # r => search from its subdirectories\n # i => ignore cases\n # l => list file name\n # c => show word occurence count\n # w => words\n\n args = set_args\n # grep -ril '#keyword1' --include=\\*.rb *\n `grep -ril '#{args}' #{search_extension} *`\n end",
"title": ""
},
{
"docid": "79daf5afa73fd12af45ea376f33b3c2d",
"score": "0.6303742",
"text": "def traverse_files\n result = []\n paths = config[:paths].select { |p| File.exist?(p) }\n if paths.empty?\n log_warn \"search.paths #{config[:paths].inspect} do not exist\"\n return result\n end\n Find.find(*paths) do |path|\n is_dir = File.directory?(path)\n hidden = File.basename(path).start_with?('.')\n not_incl = config[:include] && !path_fnmatch_any?(path, config[:include])\n excl = path_fnmatch_any?(path, config[:exclude])\n if is_dir || hidden || not_incl || excl\n Find.prune if is_dir && (hidden || excl)\n else\n result << yield(path)\n end\n end\n result\n end",
"title": ""
},
{
"docid": "a3900c16387ce06d84a941782a0caf3d",
"score": "0.62977654",
"text": "def list\n\t\t\tbegin\n\n\t\t\t\t# Prepare result, array of absolute paths for found files\n # within given directory. Also empty cache\n\t\t\t\tresult = []\n @scan_history = {}\n\n\t\t\t\t# Recursively scan current folder for files\n\t\t\t\tFind.find(@scan_path) do |current_full_path|\n\n\t\t\t\t\t# Get filename, prune if dot\n\t\t\t\t\tfilename = File.basename(current_full_path)\n Find.prune if filename[0] == ?.\n\n # Get extension\n extension = File.extname(current_full_path)\n\n\t\t\t\t\t# Check for file extension, if provided\n\t\t\t\t\tif @scan_extension && extension.eql?(@scan_extension)\n\n # Get foldername\n folder_name = File.dirname(current_full_path)\n\n # Get number of files parsed in current folder, default 0\n folder_depth = @scan_history.fetch(folder_name, nil) || 0\n Logging[self].debug \"At #{folder_name}\" if folder_depth == 0\n\n # If the desired depth hasn't been reached\n unless folder_depth == @scan_depth\n\n # Increase current depth\n folder_depth += 1\n\n # Add and log result\n Logging[self].warn \"Result: '#{current_full_path}'\"\n result << current_full_path\n\n # Update cache, proceed no further in this folder\n @scan_history[folder_name] = folder_depth\n Find.prune\n end\n\t\t\t\t\telse\n\t\t\t\t\t\n\t\t\t\t\t\t# Either move beyond this file, if we're searching\n\t\t\t\t\t\t# for specific files (filtered by extension), or add\n # the path to the result (since no filter applied)\n\t\t\t\t\t\t@scan_extension ? next : (result << current_full_path)\n\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\n end # find block\n\n # Log final result length\n Logging[self].info \"Retrieved #{result.length} results\"\n\n\t\t\t\t# Return result\n\t\t\t\tresult\n\n\t\t\t# Rescue any exceptions\n\t\t\trescue Exception => e\n\t\t\t\tLogging[self].error e\n nil\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "b8b661904204c4262e836a3b3dbfae2a",
"score": "0.62938607",
"text": "def search q\n @db.fetch('SELECT * FROM files WHERE path MATCH ?', q).all\n end",
"title": ""
},
{
"docid": "2cd5b5784007de6ea56702cec3a6541a",
"score": "0.6291267",
"text": "def find_files(search_pattern, opts = {})\n fetch!\n search_pattern = Regexp.new(search_pattern)\n res = []\n unless @repo.empty?\n tree = @repo.head.target.tree\n _find_files(search_pattern, tree, nil, res)\n end\n res\n end",
"title": ""
},
{
"docid": "e34cdf4e3a58a7f20e072325bc6dc864",
"score": "0.62693536",
"text": "def scan(dir,match=/\\.cha$/)\n files = []\n if not dir.split('/').pop =~ /^\\./ and File.directory?(dir)\n Dir.foreach(dir) do |file|\n path = File.join(dir,file)\n \n if File.directory?(path)\n# puts \"SCANNING #{path}\"\n scan(path,match).each { |pair| files.push pair }\n elsif file =~ match\n files.push path\n end\n end\n end\n\n return files\nend",
"title": ""
},
{
"docid": "2e189dc14816c65b6a7e45e664daabb9",
"score": "0.6247707",
"text": "def find_data_dir(path)\n each_data_path(path).find { |full_path| File.directory?(full_path) }\n end",
"title": ""
},
{
"docid": "53ad71d73376aa25416fbedd34dd34d2",
"score": "0.62202144",
"text": "def glob_data_paths(pattern,&block)\n return enum_for(:glob_data_paths,pattern).to_a unless block_given?\n\n DataPaths.paths.each do |path|\n Dir.glob(File.join(path,pattern),&block)\n end\n end",
"title": ""
},
{
"docid": "63bf4db5550d5b3e1a76132791e67070",
"score": "0.6209128",
"text": "def find_in(dir); end",
"title": ""
},
{
"docid": "1202438161d7ecd2c9bc3c94fd4fbbe2",
"score": "0.62053937",
"text": "def find_with_glob(path, find_flags = 0, gave_char_class = false, dir: nil)\n parts = path_parts(normalize_path(path, dir: dir))\n return fs if parts.empty? # '/'\n\n entries = Globber.expand(path).flat_map do |pattern|\n parts = path_parts(normalize_path(pattern, dir: dir))\n find_with_glob_recurser(fs, parts, find_flags, gave_char_class).flatten\n end\n\n case entries.length\n when 0 then nil\n when 1 then entries.first\n else entries\n end\n end",
"title": ""
},
{
"docid": "3411c82df6bd185a5ca8f49a7f446f65",
"score": "0.6196032",
"text": "def search\n Dir.glob(@config.target_file_pattern, File::FNM_CASEFOLD).each do |file_path|\n next if FileTest.directory?(file_path)\n\n extension = get_extension(file_path)\n tokens = get_tokens(file_path, extension)\n search_romaji(extension, tokens, file_path)\n end\n\n nil\n end",
"title": ""
},
{
"docid": "1d92158a481d36795e9870524f67f54d",
"score": "0.617767",
"text": "def searchABatch(directory, extension, searchString)\n return Dir.entries(directory).select{|file| File.open(file, \"r\").include?(searchString)}\nend",
"title": ""
},
{
"docid": "64d33f6e01192942ce100ea997c4e1de",
"score": "0.6174652",
"text": "def find_files(path)\r\n Dir.entries(path).reject {|f| f =~ /^\\./} || Array.new\r\nend",
"title": ""
},
{
"docid": "e5b2e64e5c0db6e323cc8b0f588d45ed",
"score": "0.61570245",
"text": "def scan_file(path)\n keys = []\n text = read_file(path)\n text.scan(@pattern) do |match|\n src_pos = Regexp.last_match.offset(0).first\n location = occurrence_from_position(path, text, src_pos, raw_key: strip_literal(match[0]))\n next if exclude_line?(location.line, path)\n\n key = match_to_key(match, path, location)\n next unless key\n\n key += ':' if key.end_with?('.')\n next unless valid_key?(key)\n\n keys << [key, location]\n end\n keys\n rescue Exception => e # rubocop:disable Lint/RescueException\n raise ::I18n::Tasks::CommandError.new(e, \"Error scanning #{path}: #{e.message}\")\n end",
"title": ""
},
{
"docid": "4423fc46504f4dab104844197467ed73",
"score": "0.6150394",
"text": "def files\n @files = []\n Find.find(@path) do |path|\n if File.directory? path\n if File.basename(path)[0] == ?.\n Find.prune # don't look any further into this directory.\n else\n next\n end\n else\n @files << path\n end\n end\n @files.size\n end",
"title": ""
},
{
"docid": "3dac3067e92d9e107f8232648ecb867e",
"score": "0.6129417",
"text": "def findPaths (conf)\n puts aktTime()+' collecting files...'\n STDOUT.flush #write out immediately\n\tconf[:saveDirs].each do |d|\n\t\tif File.directory?(d)\n\t\t\tDir.chdir(d)\n\t\t\tgetFiles(conf)\n\t\telse\n\t\t\tputs \"\\nWarning: Directory: \\n\"+d+\" **not** found !\"\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "4794003266bf3319aa3205eec1bc913a",
"score": "0.6123771",
"text": "def find_files(*paths)\n Find.find(*paths).select do |path|\n File.file?(path)\n end\n end",
"title": ""
},
{
"docid": "0fd4d427ba3911fbb10407d7b4776971",
"score": "0.6106341",
"text": "def find_and_save(path='.')\n @logger.info(\"searching in sources: #{@names}\")\n @sources.flat_map { |name, source| source.find_and_save(path) }\n end",
"title": ""
},
{
"docid": "8b6d299ef46543d942faf1384f183b94",
"score": "0.60998625",
"text": "def files() = files_path.glob('**/*')",
"title": ""
},
{
"docid": "13e8aaa96d98b5ba06833302f018763b",
"score": "0.60985994",
"text": "def find_files( directory, pattern='*')\n `find -H '#{directory}' -name \"#{pattern}\"`.split(\"\\n\").reject{|f| f==directory}\n end",
"title": ""
},
{
"docid": "86f8cba6282ed69bfde1ab5316882aa4",
"score": "0.60953367",
"text": "def find_files_in_dir dir\n unless dir.exist?\n warn \"Can't find files in dir %s as it doesn't exist!\",\n dir.relative_path_from(project.path + '..').to_s\n return []\n end\n Dir.chdir dir do\n Dir['**/*'].map { |path| Pathname(path) }\n end\n end",
"title": ""
},
{
"docid": "f206239e4975951b069d44a990a6f0d2",
"score": "0.6087217",
"text": "def files_in_path\n Dir.glob(\"#{@path}/**/*/**\") | Dir.glob(\"#{@path}/**\")\n end",
"title": ""
},
{
"docid": "73419168d6e5970519dc801ebc1d2dbd",
"score": "0.60844314",
"text": "def find_files(search_pattern, opts = {})\n raise \"Missing implementation\"\n end",
"title": ""
},
{
"docid": "73419168d6e5970519dc801ebc1d2dbd",
"score": "0.60844314",
"text": "def find_files(search_pattern, opts = {})\n raise \"Missing implementation\"\n end",
"title": ""
},
{
"docid": "d0797aace58a16ad7ed5059340f10aa4",
"score": "0.60836065",
"text": "def find(root, params)\n FileSearcher.call(root, params)\nend",
"title": ""
},
{
"docid": "a76d3f8d284ef492baf24e529b5d88dc",
"score": "0.6082206",
"text": "def all_data_dirs(path)\n each_data_dir(path).to_a\n end",
"title": ""
},
{
"docid": "9ab744e6c2d5461701d6d9f8c70568a6",
"score": "0.60810995",
"text": "def find_all_paths\n found_paths = []\n \n explore(found_paths, nil, @start_node)\n \n found_paths\n end",
"title": ""
},
{
"docid": "876714293265f8b6572f271cf37f92ff",
"score": "0.6057258",
"text": "def each_existing_path pattern, pathname_test = :exist?, &blk # :yields: corresponding_pathname\n attempts = []\n raise \"No paths to search for #{pattern}\" if @search_paths.nil? || @search_paths.empty?\n @search_paths.each do |path|\n path = (path + pattern).expand_path\n matches = Array(Pathname.glob(path).select(&pathname_test))\n attempts << path.to_s\n matches.each(&blk)\n end\n attempts\n end",
"title": ""
},
{
"docid": "98a3b7e0353db1ea9844608928def9eb",
"score": "0.60518205",
"text": "def grep_multiple(folder, search)\n\n folder = File.expand_path(folder)\n return nil if folder.nil? || search.nil? || !File.directory?(folder)\n folder = folder[0..-2] if folder =~ %r{/$} #remove trailing slash if present\n \n data, benchmark = safe_utf8_exec(options.grep_folder, search, folder)\n \n hash = {}\n \n #convert data from \n # file:line\n #into \n # file => [lines]\n data.each_line do |line|\n file, str = line.split(\":\", 2)\n file = url_from_file(file)\n hash[file] ||= []\n hash[file] << str\n end\n \n [hash, benchmark]\nend",
"title": ""
},
{
"docid": "e4869980fd4ac452b3b7131273d1ea54",
"score": "0.60449857",
"text": "def lookup(glob, flags=0)\n pwd = File.expand_path(Dir.pwd)\n home = File.expand_path('~')\n while pwd != '/' && pwd != home\n paths = Dir.glob(File.join(pwd, glob), flags)\n return paths unless paths.empty?\n break if ROOT_INDICATORS.any?{ |r| File.exist?(File.join(pwd, r)) }\n pwd = File.dirname(pwd)\n end\n return []\n end",
"title": ""
},
{
"docid": "0ea7c1f1f082717c45c94981ec2f9599",
"score": "0.6038328",
"text": "def find_files(dir, pattern, &block)\n require 'find'\n\n Find.find(dir) do |p|\n if p =~ Regexp.compile(pattern)\n yield p\n end\n end\nend",
"title": ""
},
{
"docid": "f09831ed43738d957c36cd2d22036ab4",
"score": "0.6036609",
"text": "def find_files\n @files = []\n\n Dir.foreach(configured_file_path) do |file_name|\n next if file_name == '.' || file_name == '..'\n next if file_name =~ /^\\./ && Ferver.configuration.serve_hidden == false\n\n found_file = FoundFile.new(configured_file_path, file_name)\n @files << found_file if found_file.valid?\n end\n end",
"title": ""
},
{
"docid": "963c0726b3224b70dfe676c04b761b10",
"score": "0.6021957",
"text": "def find_files(search_pattern, opts = {})\n Dir.chdir(@top_dir)\n Dir.glob(\"**/*#{search_pattern}*\").map do |path|\n next if File.directory?(path)\n next unless File.readable?(path)\n begin\n mt = mime_type_for_file(path)\n {\n name: path,\n url: get_url_for_path(path),\n mime_type: mt,\n size: File.size(path)\n }\n rescue\n debug \"Can't seem to look at '#{path}'\"\n nil\n end\n end.compact\n end",
"title": ""
},
{
"docid": "1589be9e33f98e4a9df8c09c3ad46371",
"score": "0.60145277",
"text": "def get_files (path, files_found) \n\t\tif File.directory? path\n\t\t\tDir.foreach path do |file| \n\t\t\t\tif (!EXCLUDED_FILES.include? file)\n\t\t\t\t\tget_files(path+file, files_found) \n\t\t\t\tend\n\t\t\tend\n\t\telsif File.file? path\n\t\t\tfiles_found << path\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ed8dd7bcb996cd622fc41ee3935b9524",
"score": "0.6009837",
"text": "def search_paths\n # NOTE: Do not cache this list, specific generators\n # will modify it with their own lookups\n create_search_paths.select { |path| File.directory?(path) }\n end",
"title": ""
},
{
"docid": "61067a9d0e5626412a04cac4768a6a40",
"score": "0.60038245",
"text": "def find_in(dir)\n results = {}\n\n Dir.glob(\"#{dir}/*\") do |item|\n next if File.basename(item)[0] == ?.\n\n if File.directory?(item)\n results.update(find_in(item))\n else\n CommentPattern.all.each do |comment_pattern|\n if comment_pattern.serves?(item)\n results.update(\n extract_annotations_from(item, comment_pattern.comment_regexp(tag))\n )\n end\n end\n end\n end\n\n results\n end",
"title": ""
},
{
"docid": "053ac8c9912535eeb96ffbccb180365c",
"score": "0.5996892",
"text": "def search_path\n result = []\n\n result += $LOAD_PATH.map { |path| File.expand_path('facter', path) }\n\n if @environment_vars.include?(\"FACTERLIB\")\n result += @environment_vars[\"FACTERLIB\"].split(File::PATH_SEPARATOR)\n end\n\n # silently ignore bad search paths from $LOAD_PATH and FACTERLIB\n result = result.select { |path| valid_search_path?(path) }\n\n # This allows others to register additional paths we should search.\n # We are assuming that these are already absolute paths.\n result += Facter.search_path.select do |path|\n valid = valid_search_path?(path)\n Facter.warn \"Excluding #{path} from search path. Fact file paths must be an absolute directory\" unless valid\n valid\n end\n\n # remove any dups\n result.uniq\n end",
"title": ""
},
{
"docid": "a0848a8b3c8919e0d77a9cb7b921f448",
"score": "0.59918505",
"text": "def recursive_search(dir,patterns,\n excludes=[/\\.svn/, /,v$/, /\\.cvs$/, /\\.tmp$/,\n /^RCS$/, /^SCCS$/])\n results = Hash.new{|h,k| h[k] = ''}\n\n Find.find(dir) do |path|\n fb = File.basename(path) \n next if excludes.any?{|e| fb =~ e}\n if File.directory?(path)\n if fb =~ /\\.{1,2}/ \n Find.prune\n else\n next\n end\n else # file...\n File.open(path, 'r') do |f|\n ln = 1\n while (line = f.gets)\n patterns.each do |p|\n if line.include?(p)\n results[p] += \"#{path}:#{ln}:#{line}\"\n end\n end\n ln += 1\n end\n end\n end\n end\n return results\nend",
"title": ""
},
{
"docid": "5b361643cbc4df6df3e6197e0335ce17",
"score": "0.5982232",
"text": "def list_files\n Find.find(path) do |element| yield element end\n end",
"title": ""
},
{
"docid": "e512f7bf9688294c158e99917eda29e4",
"score": "0.5975006",
"text": "def search(search_string)\n root = EmployeeFolder.root\n result = []\n key = search_string.downcase\n Dir.glob(\"#{root}/*/*\") do |folder|\n next unless Dir.exist? folder\n next unless folder[key]\n\n employee_spec = parse_dir folder\n next if project? employee_spec\n\n result << employee_spec.to_employee\n end\n result\n end",
"title": ""
},
{
"docid": "01820d70f2bce88e2f98bf7545d30eae",
"score": "0.59614825",
"text": "def find_files(query, extension=nil)\n search_key = \"#{query}.#{extension}\"\n $cached_findings ||= Hash.new([])\n if $cached_findings[search_key].size > 0\n return $cached_findings[search_key]\n end\n \n # TODO: Cache this method\n query = absolute_to_relative(query)\n query = query.gsub(\"../\", \"\")\n regex = regex_for(query, extension)\n\n matches = all_filenames.to_a.select { |filename|\n match = filename =~ regex\n (File.extname(filename) != \"\" || extension.nil?) && (match)\n }.sort_by {|filename|\n filename.to_s\n }.sort_by { |filename|\n\n basename = File.basename(filename)\n match = basename == [filename, extension].compact.join(\".\")\n partial_match = basename == [\"_\"+query, extension].compact.join(\".\")\n\n score = filename.split(query).join.length\n\n if match\n score\n elsif partial_match\n score + 10\n else\n score + 100\n end\n\n }\n $cached_findings[search_key] = matches\n # If we query with a *, return all results. Otherwise, first result only.\n query.include?('*') ? $cached_findings[search_key] : $cached_findings[search_key][0..0]\n end",
"title": ""
},
{
"docid": "a5bfcc152ca988d2eb084d690617fe9e",
"score": "0.5958129",
"text": "def find file\n unless defined? @find_dirs_glob\n base_dirs = ENV['WMII_CONFPATH'].to_s.split(/:+/).unshift(DIR)\n ruby_dirs = base_dirs.map {|dir| File.join(dir, 'ruby') }\n @find_dirs_glob = '{' + base_dirs.zip(ruby_dirs).join(',') + '}'\n end\n\n Dir[\"#{@find_dirs_glob}/#{file}\"].first\n end",
"title": ""
},
{
"docid": "bacb66c255051a11ce36725574982fa1",
"score": "0.5951457",
"text": "def find(pattern)\n patterns= [pattern].flatten\n contents=[]\n self.each_pair do |path, content|\n patterns.each do |pattern|\n contents << content if Content.path_match? path, pattern\n end\n end\n contents\n end",
"title": ""
},
{
"docid": "5b8fa8e60da0d54a0648d9342dcdea9f",
"score": "0.59429795",
"text": "def search_file(pattern, file)\n node = ast_from_file(file)\n search node, pattern\n end",
"title": ""
},
{
"docid": "8bba0c8669a16e14a9446189b9aca1ec",
"score": "0.5942856",
"text": "def search\n return Fast.debug(&method(:execute_search)) if debug_mode?\n\n execute_search do |file, results|\n results.each do |result|\n binding.pry if @pry # rubocop:disable Lint/Debugger\n report(file, result)\n end\n end\n end",
"title": ""
},
{
"docid": "c1ed3b96a686ddaa4fb90af3b7ba7813",
"score": "0.5926842",
"text": "def find_files()\n require 'find'\n directory = File.dirname(__FILE__) + '/../templates/' + @template\n @files = Array.new()\n Find.find(directory) do |f|\n if FileTest.file?f\n @files.push(f)\n end\n end\n @files\n end",
"title": ""
},
{
"docid": "af41284372f4767aff6567cb5f93c4be",
"score": "0.5926567",
"text": "def all_apf_finder( path_and_file = self.file_name_and_contents.path_and_file, all_apf_arr = [] )\n apf_files = find_apf( path_and_file )\n if apf_files.count > 0\n all_apf_arr << apf_files\n apf_files.each do |apf_file|\n if File.exists? apf_file\n path_and_file = apf_file\n all_apf_finder( path_and_file, all_apf_arr )\n else\n if self.hints_hash['file_does_not_exist']\n self.hints_hash['file_does_not_exist'] << apf_file\n else\n self.hints_hash = self.hints_hash.merge( 'file_does_not_exist' => [ apf_file ] )\n end\n end\n end\n end\n all_apf_arr\n end",
"title": ""
},
{
"docid": "01aad30fd0e0e9b9635a5f9798612c9d",
"score": "0.59255415",
"text": "def find_file(*path)\n f = File.join(path)\n if File.exists?(f)\n yield f\n end\n end",
"title": ""
},
{
"docid": "614a6ae82ea5b775388409af94ed1ce9",
"score": "0.5913781",
"text": "def search(pattern)\n entries.inject(Rush::SearchResults.new(pattern)) do |results, entry|\n if !entry.dir? and matches = entry.search(pattern)\n results.add(entry, matches)\n end\n results\n end\n end",
"title": ""
},
{
"docid": "f0dacb6561c79a99720218428fb5a2e5",
"score": "0.59002924",
"text": "def _find_files(*paths)\n paths.flatten!\n paths.map! { |p| Pathname.new(p) }\n files = paths.select(&:file?)\n\n (paths - files).each do |dir|\n files << _find_files(dir.children)\n end\n\n files.flatten.map(&:to_s)\n end",
"title": ""
},
{
"docid": "809211f48a56d69c2417a149b9ee0540",
"score": "0.5885503",
"text": "def searchFor\n %w{*.lua */*.lua}\n end",
"title": ""
},
{
"docid": "ca5e8eaf6c23ac07f411ed778b4c6695",
"score": "0.58807695",
"text": "def scan_file(path)\n ast, comments = path_to_ast_and_comments(path)\n\n ast_to_occurences(ast) + comments_to_occurences(path, ast, comments)\n rescue Exception => e # rubocop:disable Lint/RescueException\n raise ::I18n::Tasks::CommandError.new(e, \"Error scanning #{path}: #{e.message}\")\n end",
"title": ""
},
{
"docid": "0cf2f85a48d4ddb0531ba475fc50a079",
"score": "0.58661604",
"text": "def _find_files(*paths)\n paths.flatten.map do |path|\n path = Pathname.new(path)\n path.file? ? [path.to_s] : _find_files(path.children)\n end.flatten\n end",
"title": ""
},
{
"docid": "cac736927ad7db43f6b63e35599a9f55",
"score": "0.58612627",
"text": "def each_data_file(path)\n return enum_for(:each_data_file,path) unless block_given?\n\n each_data_path(path) do |full_path|\n yield(full_path) if File.file?(full_path)\n end\n end",
"title": ""
},
{
"docid": "af5437ca8eb7b27d1e2a0d651014c1f6",
"score": "0.5851528",
"text": "def locate()\n \n search = Dir.pwd()\n\n search = search.split(File::SEPARATOR)\n\n while not File.directory? File.join(search) + File::SEPARATOR + DATADIRNAME and File.join(search) != ''\n search.pop\n end\n \n if File.directory? File.join(search) + File::SEPARATOR + DATADIRNAME\n @library_dir = File.join(search) + File::SEPARATOR\n end \n\n \n end",
"title": ""
},
{
"docid": "d9d5bd4012dedbd74b2268b10cb37bee",
"score": "0.58488256",
"text": "def sapi_files_found(sapi, priority = '*')\n ::Dir.glob(sapi_file_path(sapi, priority)) + ::Dir.glob(sapi_file_path(sapi))\n end",
"title": ""
},
{
"docid": "a3f653117add8b2dfdebf347912da05a",
"score": "0.58209336",
"text": "def load_file_path!\n @files = FilepathScanner.call(\n include_paths,\n exclude_path_regexps,\n recursive_scan: recursive_include\n )\n end",
"title": ""
},
{
"docid": "b6400f3ef30f850c48ad059919bb84a7",
"score": "0.581305",
"text": "def find(file, paths)\n if(Pathname.new(file).absolute?)\n return unless (timestamp = mtime(file))\n @logger.debug(\"Found #{file}\")\n [ file, timestamp ]\n else\n paths.each do |path|\n fullpath = File.expand_path((File.join(path, file)))\n next unless (timestamp = mtime(fullpath))\n @logger.debug(\"Found #{file} in #{fullpath}\")\n return([ fullpath, timestamp ])\n end\n return(nil)\n end\n end",
"title": ""
},
{
"docid": "a94b6b0d2f337d961bdc0339a02092f6",
"score": "0.58079803",
"text": "def all_files() = path.glob('**/*').select(&:file?).map(&:to_s)",
"title": ""
},
{
"docid": "f0f1f90011017b3d9a0a47bfa0d74e6f",
"score": "0.58001804",
"text": "def find_files_recursive (base_directory, relative_path)\n result = []\n directory = File.join(base_directory, relative_path)\n Dir.foreach(directory) do |file|\n relative_file = relative_path.empty? ? file : File.join(relative_path, file)\n if matchesFilters(file, relative_file)\n full_path = File.join(base_directory, relative_file)\n if File.directory?(full_path)\n result = result + find_files_recursive(base_directory, relative_file)\n else\n result << relative_file\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "c397a200711c88461dfa4818094cec4c",
"score": "0.5795731",
"text": "def search_in_project phrase_we_have_now\n result_files_with_phrase = []\n path_to_files = File.join(DIRECTORY_PATH, '**/*.rb')\n files_to_check = []\n Dir.glob(path_to_files) do |rb_file|\n files_to_check << rb_file\n end\n raise \"files_to_check is empty !\" if files_to_check.length == 0\n #Looking for files where occurs: phrase_we_have_now\n files_to_check.each do |one_file|\n file = File.open(one_file, \"r\") do |f|\n f.each_line do |line|\n reg = /.*#{@phrase_we_have_now}.*/\n if line.match?(reg)\n result_files_with_phrase << one_file\n end\n end\n end\n end\n if result_files_with_phrase.length == 0\n puts \"\\n\\e[31m\\e[1;4mThe phrase: '#{@phrase_we_have_now}' not found in files.\\e[31m\"\n exit\n end\n result_files_with_phrase.uniq.sort\n end",
"title": ""
},
{
"docid": "b1ba5bd3c25d65f3dedea1a179ed503c",
"score": "0.57849914",
"text": "def search_all_paths(word)\n\n\tsearch_project_paths(word)\n\tsearch_bundle_paths(word)\n\t\n\t$best_paths.uniq!\n\t$package_paths.uniq!\n\t\n\t{ :exact_matches => $best_paths, :partial_matches => $package_paths }\n\t\nend",
"title": ""
},
{
"docid": "6db110e80aa93a817924c51ec3933afe",
"score": "0.5783331",
"text": "def path(match, options={})\n return [] if options[:from]\n\n found = []\n $LOAD_PATH.uniq.map do |path|\n list = Dir.glob(File.join(File.expand_path(path), match))\n list = list.map{ |d| d.chomp('/') }\n found.concat(list)\n end\n found.concat(data_path(match, options))\n found\n end",
"title": ""
},
{
"docid": "f618f7b122c7453b2ab8180caf1bfb5b",
"score": "0.5777515",
"text": "def find_sauce_files(cwd=@opts[:basedir], depth=@opts[:search_depth], file_ext=@opts[:sauce_file_extension])\n files = []\n (0..depth).each do |i|\n prefix = \"*/\"*i\n files << Dir.glob(File.join(cwd, \"#{prefix}*#{file_ext}\"))\n end\n return files.flatten.uniq\n end",
"title": ""
},
{
"docid": "839c1fad0a7a730b1680fee57900b444",
"score": "0.57730323",
"text": "def find_files( config )\n files = []\n config.each do |c|\n Config.verify_config_dirs( c )\n\n dir = c[\"directory\"].chomp(\"/\")\n recursive = Config.convert_yaml_bools( c[\"recursive\"] ) \n \n if File.directory? dir \n unless recursive\n Dir.glob( \"#{dir}/*\" ).each do |d|\n files << d unless File.directory? d or File.symlink? d\n end\n else\n Dir.glob(\"#{dir}/**/*\").each do |d|\n files << d unless File.directory? d or File.symlink? d \n end \n end\n else\n Dir.glob( dir ).each do |d|\n files << d \n end\n end\n end\n files\nend",
"title": ""
},
{
"docid": "b001acc0a298a980eda8bb0c4c8b242b",
"score": "0.57691634",
"text": "def find_files(*file_patterns)\n FileFinder.new.version(self).files(file_patterns)\n end",
"title": ""
},
{
"docid": "ec763ee6c9a91514ae625a22c68927ff",
"score": "0.57661444",
"text": "def site_files\n exclude = %r/tmp$|bak$|~$|CVS|\\.svn/o\n\n rgxp = %r/\\A#{data}\\/?/o\n paths = Hash.new {|h,k| h[k] = []}\n\n Find.find(data) do |p|\n next if exclude =~ p\n\n if test(?d, p)\n paths[p.sub(rgxp, '')]\n next\n end\n dir = ::File.dirname(p).sub(rgxp, '')\n paths[dir] << p.sub(rgxp, '')\n end\n\n paths\n end",
"title": ""
},
{
"docid": "d183aa302e74ad1784fde9faeb09c196",
"score": "0.575922",
"text": "def find(path, dir: nil)\n parts = path_parts(normalize_path(path, dir: dir))\n return fs if parts.empty? # '/'\n\n find_recurser(fs, parts)\n end",
"title": ""
},
{
"docid": "8b3ab819888a64a44715f41a513b9c67",
"score": "0.57589734",
"text": "def [](path)\n dsearch(path.split('/'))\n end",
"title": ""
},
{
"docid": "44049d9a4b03cf85f373275839387eed",
"score": "0.57564944",
"text": "def scan(dir)\n puts \"Scanning '#{dir}' for asdoc files...\"\n\n found = []\n\n Search.find_all(@asdoc,dir,@excludes) do |path|\n found << {:path => path, :package => ProjectTools.package(path)}\n end\n\n found.each { |file| log(\"Adding #{file[:path]}\") }\n\n found\n end",
"title": ""
},
{
"docid": "e07dd8ca2cb28f10af309bb1a749d9fb",
"score": "0.57450294",
"text": "def search_file(dirs, filename)\n findings = dirs.collect do |dir|\n abs_path = File.join(File.expand_path(dir), filename)\n if File.exist?(abs_path)\n abs_path\n end\n end\n findings.delete(nil)\n findings\n end",
"title": ""
},
{
"docid": "afbad43f9f44fb893687d096a3f89a40",
"score": "0.5740541",
"text": "def glob(path, pattern, flags=0)\n flags |= ::File::FNM_PATHNAME\n path = path.chop if path[-1,1] == \"/\"\n\n results = [] unless block_given?\n queue = entries(path).reject { |e| e.name == \".\" || e.name == \"..\" }\n while queue.any?\n entry = queue.shift\n\n if entry.directory? && !%w(. ..).include?(::File.basename(entry.name))\n queue += entries(\"#{path}/#{entry.name}\").map do |e|\n e.name.replace(\"#{entry.name}/#{e.name}\")\n e\n end\n end\n\n if ::File.fnmatch(pattern, entry.name, flags)\n if block_given?\n yield entry\n else\n results << entry\n end\n end\n end\n\n return results unless block_given?\n end",
"title": ""
},
{
"docid": "b57392056d8490d1ed1043ac26f8a247",
"score": "0.5735932",
"text": "def files_for_directory(path)\n directory = find_preferred_file(\n @new_resource.cookbook_name, \n :remote_file, \n path, \n @node[:fqdn],\n @node[:platform],\n @node[:platform_version]\n )\n\n unless (directory && ::File.directory?(directory))\n raise NotFound, \"Cannot find a suitable directory\"\n end\n\n directory_listing = Array.new\n Dir[::File.join(directory, '**', '*')].sort { |a,b| b <=> a }.each do |file|\n next if ::File.directory?(file)\n file =~ /^#{directory}\\/(.+)$/\n directory_listing << $1\n end\n directory_listing\n end",
"title": ""
},
{
"docid": "573897cc1f98e833904b6a54411128c1",
"score": "0.57202727",
"text": "def files_in(dir)\n Dir.chdir(dir) do\n Dir.glob('**/*').select { |f| File.file?(f) }\n end\nend",
"title": ""
},
{
"docid": "81fece67cf270c8a252303f157db01d4",
"score": "0.56942075",
"text": "def search_in(files, host, options = {})\n files.flat_map { |file| KnownHosts.new(file).keys_for(host, options) }\n end",
"title": ""
},
{
"docid": "d43af0a6af935aa5ed431ab384d8beac",
"score": "0.56931496",
"text": "def grep_search search_dir\n args = ['-r']\n end",
"title": ""
}
] |
7080ae6166a1a1da8114fbeb317968a8
|
Sets the left hand side of assignment or boolean.
|
[
{
"docid": "a883baa818bd81fcf0ccfcf02b35a30d",
"score": "0.6843975",
"text": "def lhs= exp\n expect(*ASSIGNMENT_BOOL)\n @my_hash_value = nil\n self[1] = exp\n end",
"title": ""
}
] |
[
{
"docid": "6f72bd5d7b8191f66f67af02b52411cb",
"score": "0.6556447",
"text": "def requires_assignment\n _assign if !@_assigned\n end",
"title": ""
},
{
"docid": "5c32e087e8c834a32cead6591fedd3bb",
"score": "0.655166",
"text": "def lhs\n expect(*ASSIGNMENT_BOOL)\n self[1]\n end",
"title": ""
},
{
"docid": "47198fb49bed7541cf62a3b1844d6cb3",
"score": "0.6450887",
"text": "def assign?\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "65642e8db53bd930bff6bcc60eddb199",
"score": "0.6242407",
"text": "def assignment=(value)\n @assignment = value\n end",
"title": ""
},
{
"docid": "ed43670a4d9503c2b2cf7ca13e7dfb2c",
"score": "0.62237173",
"text": "def conditional_assignment(variable, value, bool = true)\n if current_scope.has_definition?(variable.type, variable.name) == bool\n variable.value = value\n\n current_scope.add_definition(variable)\n\n buffer_assignment_value(variable.value)\n end\n end",
"title": ""
},
{
"docid": "105c384dff8932ada297efbf935eb42d",
"score": "0.61421204",
"text": "def assignment\n expr = conditional\n\n if match?(:equal)\n equals = previous\n value = expression\n\n if expr.is_a?(Ringo::Variable)\n name = expr.name\n return Ringo::Assign.new(name, value)\n elsif expr.is_a?(Ringo::Get)\n return Ringo::Set.new(expr.object, expr.name, value)\n end\n\n error(equals, \"Invalid assignment target.\")\n end\n\n return expr\n end",
"title": ""
},
{
"docid": "a6070c9cd905ad2118d24c6cade67868",
"score": "0.6125838",
"text": "def assignment\n @name = get_name\n match '='\n expression\n emit_ln \"LEA #{@name} (PC),A0\"\n emit_ln 'MOVE D0,(A0)'\nend",
"title": ""
},
{
"docid": "6c2aec6b901e17f8a9dcd1872bc8d88d",
"score": "0.61216",
"text": "def assign!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n\n type = ASSIGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 373:10: '='\n match( 0x3d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 47 )\n\n end",
"title": ""
},
{
"docid": "634de0ca14039e27d2d41ed69fd14026",
"score": "0.61036444",
"text": "def assignment\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n begin\n # at line 539:4: lhsassignment '=' rhsassignment ';'\n @state.following.push( TOKENS_FOLLOWING_lhsassignment_IN_assignment_678 )\n lhsassignment\n @state.following.pop\n match( T__39, TOKENS_FOLLOWING_T__39_IN_assignment_680 )\n @state.following.push( TOKENS_FOLLOWING_rhsassignment_IN_assignment_682 )\n rhsassignment\n @state.following.pop\n match( T__31, TOKENS_FOLLOWING_T__31_IN_assignment_684 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "2cad68e25ff2bba83ee222e43d6f333e",
"score": "0.6097159",
"text": "def assignment?(node); end",
"title": ""
},
{
"docid": "2cad68e25ff2bba83ee222e43d6f333e",
"score": "0.6097159",
"text": "def assignment?(node); end",
"title": ""
},
{
"docid": "2cad68e25ff2bba83ee222e43d6f333e",
"score": "0.6097159",
"text": "def assignment?(node); end",
"title": ""
},
{
"docid": "89dadd4ceff5125ddcf3e5b6cf0a1624",
"score": "0.60017085",
"text": "def assign\n\t\tself.status = :assigned\n\tend",
"title": ""
},
{
"docid": "e6ac0df9e3dcbea048efa92ba802c707",
"score": "0.5997436",
"text": "def _assign\n Memory::Value.new @left_operand.value.clone, @left_operand.type.id\n end",
"title": ""
},
{
"docid": "9de051c45af265bc458bbb0c57d7667d",
"score": "0.5989721",
"text": "def hard=(boolean)\n @hard = !! boolean\n end",
"title": ""
},
{
"docid": "457fbdd14fe4f4e3181ec33008f69316",
"score": "0.5929559",
"text": "def assign!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 48 )\n\n type = ASSIGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 400:9: {...}? => '='\n raise FailedPredicate( \"ASSIGN\", \" @tagMode \" ) unless ( ( @tagMode ) )\n match( 0x3d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 48 )\n\n end",
"title": ""
},
{
"docid": "062e8be199d0c37867e61c39f80b1622",
"score": "0.5860155",
"text": "def assignment_method?\n false\n end",
"title": ""
},
{
"docid": "8232ae5573d5c711d0e6319bd68bb535",
"score": "0.58521277",
"text": "def label_assign!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 10)\n\n type = LABEL_ASSIGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 16:16: '='\n match(?=)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 10)\n\n end",
"title": ""
},
{
"docid": "64b31148bfb6671fb512e1f557d6df7e",
"score": "0.5830764",
"text": "def assignment_intialize\n\t\tif(@puret and @puref)\n\t\t\treturn false\n\t\tend\n\t\tif(@num_negative == 0 or @puret)\n\t\t\t@assignments = [1]\n\t\telsif(@num_positive == 0 or @puref)\n\t\t\t@assignments = [-1]\n\t\telsif(@best_guess <0)\n\t\t\t@assignments = [-1,1]\n\t\telse\n\t\t\t@assignments = [1,-1]\n\t\tend\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "550948d497df15013f44c29072df178f",
"score": "0.5830698",
"text": "def left=(_arg0); end",
"title": ""
},
{
"docid": "550948d497df15013f44c29072df178f",
"score": "0.5830698",
"text": "def left=(_arg0); end",
"title": ""
},
{
"docid": "4cf6f51521aa9a716ef6a30b3a0a4ca0",
"score": "0.58224547",
"text": "def assignment_method?\n !comparison_method? && method_name.to_s.end_with?('=')\n end",
"title": ""
},
{
"docid": "807240884eafcde8106bbcd85587520c",
"score": "0.58097416",
"text": "def assign_operator()\n\n\n\n # 289:5: ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' )\n alt42 = 12\n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n case look_ahead(1)\n when :EQUAL\n alt42 = 1\n when :PLUS\n alt42 = 2\n when :MINUS\n alt42 = 3\n when :TIMES\n alt42 = 4\n when :SLASH\n alt42 = 5\n when :ECOMMERCIAL\n alt42 = 6\n when :PIPE\n alt42 = 7\n when :WEDGE\n alt42 = 8\n when :MODULUS\n alt42 = 9\n when :LEFT_ANGULAR_BRACKET\n alt42 = 10\n when :RIGHT_ANGULAR_BRACKET\n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n look_ahead42_11 = look_ahead(2)\n if look_ahead42_11 == :RIGHT_ANGULAR_BRACKET \n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n look_ahead42_12 = look_ahead(3)\n if look_ahead42_12 == :RIGHT_ANGULAR_BRACKET \n alt42 = 11\n elsif look_ahead42_12 == :EQUAL \n alt42 = 12\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n end\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n end\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n\n end\n case alt42\n when 1\n # 289:9: '='\n match(:EQUAL)\n when 2\n # 290:9: '+' '='\n match(:PLUS)\n match(:EQUAL)\n when 3\n # 291:9: '-' '='\n match(:MINUS)\n match(:EQUAL)\n when 4\n # 292:9: '*' '='\n match(:TIMES)\n match(:EQUAL)\n when 5\n # 293:9: '/' '='\n match(:SLASH)\n match(:EQUAL)\n when 6\n # 294:9: '&' '='\n match(:ECOMMERCIAL)\n match(:EQUAL)\n when 7\n # 295:9: '|' '='\n match(:PIPE)\n match(:EQUAL)\n when 8\n # 296:9: '^' '='\n match(:WEDGE)\n match(:EQUAL)\n when 9\n # 297:9: '%' '='\n match(:MODULUS)\n match(:EQUAL)\n when 10\n # 298:9: '<' '<' '='\n match(:LEFT_ANGULAR_BRACKET)\n match(:LEFT_ANGULAR_BRACKET)\n match(:EQUAL)\n when 11\n # 299:9: '>' '>' '>' '='\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:EQUAL)\n when 12\n # 300:9: '>' '>' '='\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:EQUAL)\n end\n\n\n\n end",
"title": ""
},
{
"docid": "7391b237de552ec5771258dd01135252",
"score": "0.58024603",
"text": "def operator=(_arg0); end",
"title": ""
},
{
"docid": "8d194fae74e93b8aa17b6ecfe538fcaa",
"score": "0.57681626",
"text": "def assignment?\n Types::ASSIGNABLE_VARIABLES.include?(node.type)\n end",
"title": ""
},
{
"docid": "1e67a69b9877a943e2b4687839a4304c",
"score": "0.57492095",
"text": "def is_assigned=(value)\n @is_assigned = value\n end",
"title": ""
},
{
"docid": "1e67a69b9877a943e2b4687839a4304c",
"score": "0.57492095",
"text": "def is_assigned=(value)\n @is_assigned = value\n end",
"title": ""
},
{
"docid": "0fd776fd51be952cb9760b3c2030ee5d",
"score": "0.57400876",
"text": "def attribute_assignment(node)\n if node.left_value.message.is_a?(Sexp) && node.left_value.message.to_s =~ /_id$/\n receiver = node.left_value.receiver.to_s\n @assignments[receiver] = true\n end\n end",
"title": ""
},
{
"docid": "64caa7877c2c438816353133d64e01e3",
"score": "0.57211035",
"text": "def value_if_true=(value)\n @value_if_true = value\n end",
"title": ""
},
{
"docid": "36adb0d89c35818900fa7270d773a46e",
"score": "0.5697378",
"text": "def assignment?\n index_assignment? || attribute_assignment?\n end",
"title": ""
},
{
"docid": "32d25b469ba30ff262ec54d6070b3ac9",
"score": "0.5673587",
"text": "def check_disjunctive_assignment(node); end",
"title": ""
},
{
"docid": "db09a784e1eb8f287a65ab8f94e681c0",
"score": "0.56713367",
"text": "def do_assignment(leadin)\n ident = leadin.type == :LET ? (expect [:ident]).value : leadin.value\n\n expect [:assign]\n\n @variables[ident] = if @lexer.peek_next_type == :string\n @lexer.next.value\n else\n expression_value\n end\n end",
"title": ""
},
{
"docid": "8d3d4a58bbc4afbdfd76a566b00a652f",
"score": "0.5654661",
"text": "def attribute_assignment(node)\n if node.left_value.message.to_s =~ /_id$/\n subject = node.left_value.subject.to_s\n @assignments[subject] = true\n end\n end",
"title": ""
},
{
"docid": "feb64b99e5dc7536d85638a759575fe0",
"score": "0.56490314",
"text": "def set(value)\n super(value == :true)\n end",
"title": ""
},
{
"docid": "89a6dff8100f5c048ed4fa2bc98bba13",
"score": "0.5643561",
"text": "def immutable=(bool)\n nil\n end",
"title": ""
},
{
"docid": "42d5c4022098fad6ddb9c75cb5d622cb",
"score": "0.56205493",
"text": "def on_opassign(variable, operator, value)\n return on_assign(variable, value).updated(:op_assign)\n end",
"title": ""
},
{
"docid": "2f7fe2b6625aee24670076d042b8611b",
"score": "0.5616023",
"text": "def assigning?\n !assign_stack.empty?\n end",
"title": ""
},
{
"docid": "e537bd3be86c76c27dd2215fd0863672",
"score": "0.5615678",
"text": "def assignment\n name = get_name\n comment name\n define_variable name\n match \"=\"\n comment \"=\"\n expression\n emitln \"leaq #{name}(%rip), %rdx\"\n emitln \"movl %eax, (%rdx)\"\nend",
"title": ""
},
{
"docid": "072db92ae923ba129a5ebb7b2bd482b1",
"score": "0.5608035",
"text": "def left=(value)\n @left = value\n end",
"title": ""
},
{
"docid": "072db92ae923ba129a5ebb7b2bd482b1",
"score": "0.5608035",
"text": "def left=(value)\n @left = value\n end",
"title": ""
},
{
"docid": "a1107fa3114544e85ca52de02345bf19",
"score": "0.5605972",
"text": "def ac= val\n @ac_on? = val",
"title": ""
},
{
"docid": "4ec26a5cb6593b9019e8e699793b1124",
"score": "0.5575157",
"text": "def _assign\n configure_logger() # Sets up loggers\n\n # Consumers can optionally return false from assign if they don't want exposure to be logged\n assign_val = assign(@_assignment, **@inputs)\n @_in_experiment = assign_val || assign_val == nil ? true : false\n @_assigned = true\n end",
"title": ""
},
{
"docid": "afe6c3b287013290fad19746269c78c2",
"score": "0.55701476",
"text": "def ctAssignment?(store)\n store.isCT(Helpers.getNameOfVarOrConst(left), false)\n end",
"title": ""
},
{
"docid": "a079f48a0cdaae2809f3b284714ca00b",
"score": "0.55514246",
"text": "def rhs\n expect :attrasgn, :safe_attrasgn, *ASSIGNMENT_BOOL\n\n if self.node_type == :attrasgn or self.node_type == :safe_attrasgn\n if self[2] == :[]=\n self[4]\n else\n self[3]\n end\n else\n self[2]\n end\n end",
"title": ""
},
{
"docid": "5cb3a38f59d7acf19367c68a786494ea",
"score": "0.5519878",
"text": "def left=(other)\n raise TypeError, 'Left must be a node or nil.' unless other.is_a?(Node) || other.nil?\n\n @left = other\n end",
"title": ""
},
{
"docid": "980948db36dacd7503712461b7da48a7",
"score": "0.5514193",
"text": "def rhs= exp\n expect :attrasgn, :safe_attrasgn, *ASSIGNMENT_BOOL\n @my_hash_value = nil\n\n if self.node_type == :attrasgn or self.node_type == :safe_attrasgn\n self[3] = exp\n else\n self[2] = exp\n end\n end",
"title": ""
},
{
"docid": "ab48a74ea11e2e3e55113298c042df83",
"score": "0.5497055",
"text": "def set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n type = SET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 158:7: 'set'\n match( \"set\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 37 )\n\n end",
"title": ""
},
{
"docid": "a81e2a11a9aa900048dd1e6d547d7a87",
"score": "0.5486139",
"text": "def assignment?\n selector.to_s[-1] == ASSIGN_SUFFIX\n end",
"title": ""
},
{
"docid": "c158b5b589fe31ba305b8c0d0148289d",
"score": "0.5484218",
"text": "def expr=(p1)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "393d41baeb997f51879919f0f4602d41",
"score": "0.5471268",
"text": "def compile_assign(scope, left, right)\n # transform \"foo.bar = baz\" into \"foo.bar=(baz) - FIXME: Is this better handled in treeoutput.rb?\n # Also need to handle :call equivalently.\n if left.is_a?(Array) && left[0] == :callm && left.size == 3 # no arguments\n return compile_callm(scope, left[1], (left[2].to_s + \"=\").to_sym, right)\n end\n\n source = compile_eval_arg(scope, right)\n atype = nil\n aparam = nil\n @e.save_register(source) do\n atype, aparam = get_arg(scope, left)\n atype = :addr if atype == :possible_callm\n end\n\n if atype == :addr\n @global_scope.globals << aparam\n @global_constants << aparam\n elsif atype == :ivar\n ret = compile_eval_arg(scope, :self)\n @e.save_to_instance_var(source, ret, aparam)\n return [:subexpr]\n end\n\n if !(@e.save(atype, source, aparam))\n err_msg = \"Expected an argument on left hand side of assignment - got #{atype.to_s}, (left: #{left.inspect}, right: #{right.inspect})\"\n error(err_msg, scope, [:assign, left, right]) # pass current expression as well\n end\n return [:subexpr]\n end",
"title": ""
},
{
"docid": "1883e3b73e6e5becc8c8a0d6f7396ff9",
"score": "0.5465671",
"text": "def on_assign(node)\n reset_assignment_value\n value_stack.add_stack\n end",
"title": ""
},
{
"docid": "4a748d2c98c7171ad5dd55e5bd5cd40b",
"score": "0.5465228",
"text": "def hint=( bool )\n @hint = !!bool\n end",
"title": ""
},
{
"docid": "ee77537ccbb04f4ae0fc6d1a563f2a65",
"score": "0.54652196",
"text": "def first_assignment?(node); end",
"title": ""
},
{
"docid": "00e290a3361050477557c3318493d8c9",
"score": "0.5464618",
"text": "def set_present\n set_value( true )\n end",
"title": ""
},
{
"docid": "6c56016b93ce307e69068bc992742721",
"score": "0.5462439",
"text": "def equals!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = EQUALS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 155:10: '='\n match( 0x3d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end",
"title": ""
},
{
"docid": "ff52e60f3da9e44f8456366b7529a5ed",
"score": "0.54611105",
"text": "def raw=(bool)\n @raw = (bool ? true : false)\n end",
"title": ""
},
{
"docid": "6732ee8d2e0342d6a67ecd3764b94145",
"score": "0.54600954",
"text": "def value_if_false=(value)\n @value_if_false = value\n end",
"title": ""
},
{
"docid": "51cbad9e02c74376c94463ff7998480f",
"score": "0.54491544",
"text": "def assigned?(node)\n return false unless (parent = node.parent)&.assignment?\n\n lhs, _method, _rhs = *parent\n node == lhs\n end",
"title": ""
},
{
"docid": "4ca65f9ffbee95475f2bfcadcbbb05ec",
"score": "0.5444044",
"text": "def eq!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 69 )\n\n type = EQ\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 190:6: '=='\n match( \"==\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 69 )\n\n end",
"title": ""
},
{
"docid": "b4f64ae920d96ca0c247892e5cf399f1",
"score": "0.5428958",
"text": "def set\n false\n end",
"title": ""
},
{
"docid": "b0e0f98b11f2d4c095604812ddbeabae",
"score": "0.5427241",
"text": "def eq!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 53 )\n\n type = EQ\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 380:6: '=='\n match( \"==\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 53 )\n\n end",
"title": ""
},
{
"docid": "f10bd56fd0221c1bcb007440a5b02280",
"score": "0.54194105",
"text": "def assign_boolean_param_if_used(attr_name, value)\n\t\tsend \"#{attr_name}=\", value.present? if value\n\tend",
"title": ""
},
{
"docid": "87c96177c26ff9601a4615207efd617e",
"score": "0.539724",
"text": "def left(value)\n @ole.Left = value\n nil\n end",
"title": ""
},
{
"docid": "87c96177c26ff9601a4615207efd617e",
"score": "0.539724",
"text": "def left(value)\n @ole.Left = value\n nil\n end",
"title": ""
},
{
"docid": "71d98c2190f3b9017fa16b59aa98e872",
"score": "0.53947514",
"text": "def attribute_assignment?\n !BINARY_OPERATORS.include?(selector) && !UNARY_OPERATORS.include?(selector) && assignment? && !mlhs?\n end",
"title": ""
},
{
"docid": "04be6c2b034d2795f59892d93ac08810",
"score": "0.53910637",
"text": "def lhsassignment\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n __IDENTIFIER7__ = nil\n __IDENTIFIER8__ = nil\n\n begin\n # at line 542:2: ( arrayaccess | IDENTIFIER '.' IDENTIFIER | 'this' '.' IDENTIFIER | IDENTIFIER )\n alt_19 = 4\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == IDENTIFIER )\n case look_19 = @input.peek( 2 )\n when T__32 then alt_19 = 1\n when T__40 then alt_19 = 2\n when T__39 then alt_19 = 4\n else\n raise NoViableAlternative( \"\", 19, 1 )\n end\n elsif ( look_19_0 == T__41 )\n alt_19 = 3\n else\n raise NoViableAlternative( \"\", 19, 0 )\n end\n case alt_19\n when 1\n # at line 542:5: arrayaccess\n @state.following.push( TOKENS_FOLLOWING_arrayaccess_IN_lhsassignment_695 )\n arrayaccess\n @state.following.pop\n\n when 2\n # at line 543:5: IDENTIFIER '.' IDENTIFIER\n match( IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_lhsassignment_701 )\n match( T__40, TOKENS_FOLLOWING_T__40_IN_lhsassignment_703 )\n match( IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_lhsassignment_705 )\n\n when 3\n # at line 544:5: 'this' '.' IDENTIFIER\n match( T__41, TOKENS_FOLLOWING_T__41_IN_lhsassignment_712 )\n match( T__40, TOKENS_FOLLOWING_T__40_IN_lhsassignment_714 )\n __IDENTIFIER7__ = match( IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_lhsassignment_716 )\n # --> action\n\n \t\t if( not @current_class.instance_variables[__IDENTIFIER7__.text].nil?)\n \t\t\t \t@stack_operands.push(@current_class.instance_variables[__IDENTIFIER7__.text].address)\n \t\t\t \t@stack_types.push(@current_class.instance_variables[__IDENTIFIER7__.text].type)\n \t\t\t else\n \t\t\t raise \"Variable #{__IDENTIFIER7__.text} not declared as instance of #{@current_class.name}\"\n \t\t\t end\n \t\t \n # <-- action\n\n when 4\n # at line 553:5: IDENTIFIER\n __IDENTIFIER8__ = match( IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_lhsassignment_728 )\n # --> action\n\n \t # Verificar que exista en algun scope y meterlo en pila de operandos\n \t\t\t if(not @current_method.nil?)\n \t\t\t if(not @current_method.local_variables[__IDENTIFIER8__.text].nil?)\n \t\t\t @stack_operands.push(@current_method.local_variables[__IDENTIFIER8__.text].address)\n \t\t\t @stack_types.push(@current_method.local_variables[__IDENTIFIER8__.text].type)\n \t\t\t elsif( not @current_class.instance_variables[__IDENTIFIER8__.text].nil?)\n \t\t\t @stack_operands.push(@current_class.instance_variables[__IDENTIFIER8__.text].address)\n \t\t\t @stack_types.push(@current_class.instance_variables[__IDENTIFIER8__.text].type)\n \t\t\t else\n \t\t\t raise \"Variable #{__IDENTIFIER8__.text} not declared neither in #{@current_class.name} or its method #{@current_method.name}\"\n \t\t\t end\n \t\t\t else\n \t\t\t \tif( not @current_class.instance_variables[__IDENTIFIER8__.text].nil?)\n \t\t\t \t @stack_operands.push(@current_class.instance_variables[__IDENTIFIER8__.text].address)\n \t\t\t \t @stack_types.push(@current_class.instance_variables[__IDENTIFIER8__.text].type)\n \t\t\t else\n \t\t\t raise \"Variable #{__IDENTIFIER8__.text} not declared as instance of #{@current_class.name}\"\n \t\t\t end\n \t\t\t end\n \t \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__, 15 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "2ec2448a6318afe1c59bb520d50a03d0",
"score": "0.5383135",
"text": "def func1 val\n if val = 1 # should be conditional assignment ==\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "2a9f3731b61876a4c970b439fb35fe48",
"score": "0.5365644",
"text": "def compile_assignment(identifier)\n shift :equal\n\n if identifier.type == :identifier\n variable = set(identifier)\n value = compile_vexpression\n variable.value = value\n else\n value = compile_vexpression\n variable = identifier\n end\n\n code :set, variable, value\n end",
"title": ""
},
{
"docid": "8a4e1a5e7d94325aaa1c7fdfcc24c7f3",
"score": "0.5359517",
"text": "def buffer_assignment_value(value)\n @assignment_value = value\n end",
"title": ""
},
{
"docid": "9c4e8f57dc78c55489322701b05ae61a",
"score": "0.5347132",
"text": "def equal!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n\n\n\n type = EQUAL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 54:8: '='\n match( 0x3d )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 33 )\n\n\n end",
"title": ""
},
{
"docid": "02c7593ea5af3c04b05628cee03e5c55",
"score": "0.5343675",
"text": "def reset_assignment_value\n @assignment_value = nil\n end",
"title": ""
},
{
"docid": "e88f086dca1d2ed5860d513cbbb55c95",
"score": "0.53034997",
"text": "def enable=(arg)\n # We implement our own setter to handle values being passed in as strings\n # rather than booleans\n parsed = arg.to_s.downcase\n\n @enable = parsed == \"true\"\n end",
"title": ""
},
{
"docid": "3465750d4facc99752862e3c0dd3a343",
"score": "0.5297202",
"text": "def assignment_type\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n\n value = nil\n\n\n type = nil\n\n\n begin\n # at line 101:5: type= ( '=' | '+=' | '-=' | '*=' | '/=' )\n type = @input.look\n\n if @input.peek(1) == T__37 || @input.peek(1) == T__39 || @input.peek(1) == T__42 || @input.peek(1) == T__45 || @input.peek(1) == T__49\n @input.consume\n @state.error_recovery = false\n\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n mse = MismatchedSet( nil )\n raise mse\n\n end\n\n\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = type.text \n # <-- action\n end\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n\n end\n\n return value\n end",
"title": ""
},
{
"docid": "cd788fabd47921a626004cec3eb71933",
"score": "0.52902514",
"text": "def assign(var_expr_leq)\n @ast||=Root.new\n var,expr=var_expr_leq.lhs,var_expr_leq.rhs\n @ast.body << Assign.new(var,expr)\n end",
"title": ""
},
{
"docid": "4247a795fcca4b3632d4b4652ec248a5",
"score": "0.5280595",
"text": "def non_blocking=(p1)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "894af2b06d0628dcb5feec7c4b9f6eba",
"score": "0.5275135",
"text": "def assignment_value\n return @assignment_value\n end",
"title": ""
},
{
"docid": "2ce8a1ac93debbecfc1b56dd3ce70220",
"score": "0.52720386",
"text": "def left=(value)\n self[self.nested_set_options[:left_column]] = value\n end",
"title": ""
},
{
"docid": "a06663fd3fa2cf4f5fa08deca9b8cdad",
"score": "0.5268181",
"text": "def left=(n)\n @view__.left = n\n n\n end",
"title": ""
},
{
"docid": "f76882f21e536182e92c8f1d6ed3250a",
"score": "0.52589893",
"text": "def pass=(pass); end",
"title": ""
},
{
"docid": "2771f264d9a3240a299912a9bfe92a60",
"score": "0.5249816",
"text": "def compile_assign(scope, left, right)\n # transform \"foo.bar = baz\" into \"foo.bar=(baz) - FIXME: Is this better handled in treeoutput.rb?\n # Also need to handle :call equivalently.\n if left.is_a?(Array) && left[0] == :callm && left.size == 3 # no arguments\n return compile_callm(scope, left[1], (left[2].to_s + \"=\").to_sym, right)\n end\n\n source = compile_eval_arg(scope, right)\n atype = nil\n aparam = nil\n @e.save_register(source) do\n args = get_arg(scope,left,:save)\n atype = args[0] # FIXME: Ugly, but the compiler can't yet compile atype,aparem = get_arg ...\n aparam = args[1]\n atype = :addr if atype == :possible_callm\n end\n\n if atype == :addr\n @global_scope.globals << aparam\n @global_constants << aparam\n elsif atype == :ivar\n # FIXME: The register allocation here\n # probably ought to happen in #save_to_instance_var\n @e.pushl(source)\n ret = compile_eval_arg(scope, :self)\n @e.with_register do |reg|\n @e.popl(reg)\n @e.save_to_instance_var(reg, ret, aparam)\n end\n return [:subexpr]\n end\n\n if !(@e.save(atype, source, aparam))\n err_msg = \"Expected an argument on left hand side of assignment - got #{atype.to_s}, (left: #{left.inspect}, right: #{right.inspect})\"\n error(err_msg, scope, [:assign, left, right]) # pass current expression as well\n end\n return [:subexpr]\n end",
"title": ""
},
{
"docid": "da847adee4de0815b01ae8ab72e69557",
"score": "0.52438056",
"text": "def setLeft(nodeCurrent, nodeLeft)\n return nodeCurrent.setLeft(nodeLeft)\n end",
"title": ""
},
{
"docid": "d1a6a6da59ad6ff022f0f8c3290eb5ba",
"score": "0.5239603",
"text": "def value=(value)\n p assigned: value\nend",
"title": ""
},
{
"docid": "450308872a04be48f3a30130ae9e3a36",
"score": "0.5236803",
"text": "def check_assignment(assignment_name)\n assignment_row(assignment_name).checkbox.set\n end",
"title": ""
},
{
"docid": "50da009c1cddbf103de786b878e01a6c",
"score": "0.5235079",
"text": "def left?; end",
"title": ""
},
{
"docid": "605de7e27b6e56a83f338bb3db8c6236",
"score": "0.52346903",
"text": "def assign_state\n if self.employee_id.nil?\n self.assign_state = false\n else\n self.assign_state = true\n end \nend",
"title": ""
},
{
"docid": "c5293b8c562b026c913bf48d5d2cb440",
"score": "0.52252746",
"text": "def assignment\n return @assignment\n end",
"title": ""
},
{
"docid": "01eac3c3d9499689a1a5e14654956b27",
"score": "0.5224819",
"text": "def ^ other\n call_enum \"boolean\", other, :eor\n end",
"title": ""
},
{
"docid": "0f75e6ee8159b18239771433c2004cb4",
"score": "0.52174914",
"text": "def test=(test)\n @test = test ? true : false\n end",
"title": ""
},
{
"docid": "43fe0e45b9244c8bc143f267908a5de7",
"score": "0.521483",
"text": "def set?\n self == :set\n end",
"title": ""
},
{
"docid": "d40d4e6d7dff7a0bd84b7cf3bfe4aa2c",
"score": "0.5210635",
"text": "def enable_exam=(state)\n @enable_exam = ActiveRecord::Type::Boolean.new.cast(state)\n end",
"title": ""
},
{
"docid": "00e7440f96c18d81b788f787ec58790d",
"score": "0.5202021",
"text": "def assign(*args)\n commit('assign', *args)\n end",
"title": ""
},
{
"docid": "d2044e817d7eab1e0f483bace645c147",
"score": "0.5183152",
"text": "def just_assignment(number)\r\n foo = number + 3\r\nend",
"title": ""
},
{
"docid": "de7db9c72cd31cf0c35962e3088c450d",
"score": "0.5179314",
"text": "def just_assignment(number)\n foo = number + 3\nend",
"title": ""
},
{
"docid": "de7db9c72cd31cf0c35962e3088c450d",
"score": "0.5179314",
"text": "def just_assignment(number)\n foo = number + 3\nend",
"title": ""
},
{
"docid": "81563444e8beb95cc43b6813817091b4",
"score": "0.51596326",
"text": "def asgn_left?\n OP_ASSIGN.include?(parent_type) && parent.node.children.first.equal?(node)\n end",
"title": ""
},
{
"docid": "19e781da141a570a1c5cdaeef82b65fb",
"score": "0.515633",
"text": "def sync=(p1)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "91ebb68855ceceef337d7eba42cbc699",
"score": "0.514817",
"text": "def &(other)\n false\n end",
"title": ""
},
{
"docid": "e40564838b9e359178c6bd5e8541a423",
"score": "0.5135522",
"text": "def right=(_arg0); end",
"title": ""
},
{
"docid": "e40564838b9e359178c6bd5e8541a423",
"score": "0.5135522",
"text": "def right=(_arg0); end",
"title": ""
},
{
"docid": "917546c74f380b96cfd04440ab16b75a",
"score": "0.5131307",
"text": "def k_set!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 63 )\n\n\n\n type = K_SET\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 505:3: 'set'\n match( \"set\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 63 )\n\n\n end",
"title": ""
}
] |
96d1c34a162b6c0a897b94696f2ab6ea
|
Returns an array of strings that represent date modifiers
|
[
{
"docid": "776d3b6419c1ab2545d73082b2289f28",
"score": "0.0",
"text": "def adjustments\n @adjustments ||= parse(str)\n end",
"title": ""
}
] |
[
{
"docid": "41daf9b7fb6913cce2fa681b4a53e4c8",
"score": "0.672304",
"text": "def date_array\n return [self.year, self.month, self.day]\n end",
"title": ""
},
{
"docid": "41daf9b7fb6913cce2fa681b4a53e4c8",
"score": "0.672304",
"text": "def date_array\n return [self.year, self.month, self.day]\n end",
"title": ""
},
{
"docid": "41daf9b7fb6913cce2fa681b4a53e4c8",
"score": "0.672304",
"text": "def date_array\n return [self.year, self.month, self.day]\n end",
"title": ""
},
{
"docid": "7f6065a32bc369b5c4d4d6be8f464369",
"score": "0.6559931",
"text": "def date_fragments\n []\n end",
"title": ""
},
{
"docid": "b24408a508ee456aef7c587aae85b855",
"score": "0.6428993",
"text": "def date_fields\n return []\n end",
"title": ""
},
{
"docid": "07ebbe7797e56793374c003f08a1a6e2",
"score": "0.6218453",
"text": "def date_reformatting(date)\n d = Date.parse(date.gsub(/^(\\d+)(.)(\\d+)/, '\\3\\2\\1'))\n [d.month, d.day, d.year]\nend",
"title": ""
},
{
"docid": "8dc8f55e84b05ddf64a0ab2a8d45d42c",
"score": "0.62124413",
"text": "def dates_for_select\n return [['','']] + self.dates.map{|date| [date.strftime(\"%B %d, %Y\"), date.strftime(\"%Y-%m-%d\")]}\n end",
"title": ""
},
{
"docid": "22e8a867a8d40fdef4a638fc1bf84076",
"score": "0.62083703",
"text": "def view_dates\n dates_in_array = self.dates.split(',').join(\" \")\n end",
"title": ""
},
{
"docid": "11f0c49ebced628104d76f6c1df04a3c",
"score": "0.61798114",
"text": "def modified_ext\n months = [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"]\n @data['mtime'].nil? ? \"\" : \"#{months[@data['mtime'].month-1]} #{@data['mtime'].year}\"\n end",
"title": ""
},
{
"docid": "57c7141ece819dae8c754b9915521372",
"score": "0.61324525",
"text": "def date_s\n [\n Date::ABBR_MONTHNAMES[@date.mon], # month eg Jan\n @date.mday.to_s.rjust(2, '0'), # day of month\n (@date.year % 100).to_s.rjust(2, '0') # 2 digit year\n ].join('/')\n end",
"title": ""
},
{
"docid": "7849568456db270e2e0f7532fd301fae",
"score": "0.6035123",
"text": "def date_format_options\n Import::DATE_FORMATS.map do |f|\n format = f.gsub('%', '').gsub(/[dmY]/) do\n {'d' => 'DD', 'm' => 'MM', 'Y' => 'YYYY'}[$&]\n end\n [format, f]\n end\n end",
"title": ""
},
{
"docid": "f8bb6ba693a844e3ff695b88446eec0c",
"score": "0.60171056",
"text": "def date_format_options\n Import::DATE_FORMATS.map do |f|\n format = f.delete('%').gsub(/[dmY]/) do\n {'d' => 'DD', 'm' => 'MM', 'Y' => 'YYYY'}[$&]\n end\n [format, f]\n end\n end",
"title": ""
},
{
"docid": "3cff15382aca6e6e2037737bf99f290a",
"score": "0.59892535",
"text": "def date_array(user_string)\n user_string.scan(/\\d+(?=-)|(?<=-)\\d+|\\d+(?=\\/)|(?<=\\/)\\d+/)\n end",
"title": ""
},
{
"docid": "6bd47e34201fd7e71269ecd377f2a45c",
"score": "0.59483147",
"text": "def _exdates\n Array(exdate).flatten\n rescue StandardError\n []\n end",
"title": ""
},
{
"docid": "fa8e17ffcd3112bb1ac5670234bbe3a3",
"score": "0.59256256",
"text": "def path(d=@d)\n [d.year.to_s, Date::MONTHNAMES[d.month].downcase[0..2], d.day.to_s]\n end",
"title": ""
},
{
"docid": "5af78d100fde8f4d44f377776e681855",
"score": "0.59019715",
"text": "def dates(item)\n [item.start_date, item.end_date].each_with_index.map {|date, i|\n month = date && date.month ? Date::MONTHNAMES[date.month] : \"\"\n year = date && date.year ? date.year : \"\"\n item.is_current && i == 1 ? \"Present\" : \"#{month} #{year}\".strip\n }.reject {|date| date.size == 0}.join(\" - \")\n end",
"title": ""
},
{
"docid": "bd7a2f55a2520b1a227e5f0e532cb7c3",
"score": "0.5878584",
"text": "def values_for_expire\n # The sequence in dictionary is important\n dates_names = I18n.t(:\"periods.expire_dates\").values\n # TODO: get dates tag from dictionary to avoid dependency from local defining\n dates_tag = [\"1Y\", \"1M\", \"1W\", \"1D\"]\n dates_names.enum_for(:each_with_index).collect{|name, index| [name, dates_tag[index]]}\n end",
"title": ""
},
{
"docid": "62b34a6c2bb9781f0f86357c76a1ec26",
"score": "0.58660865",
"text": "def datetime_array\n return [self.year, self.month, self.day, self.hour, self.min, self.sec]\n end",
"title": ""
},
{
"docid": "62b34a6c2bb9781f0f86357c76a1ec26",
"score": "0.58660865",
"text": "def datetime_array\n return [self.year, self.month, self.day, self.hour, self.min, self.sec]\n end",
"title": ""
},
{
"docid": "62b34a6c2bb9781f0f86357c76a1ec26",
"score": "0.58660865",
"text": "def datetime_array\n return [self.year, self.month, self.day, self.hour, self.min, self.sec]\n end",
"title": ""
},
{
"docid": "84c36556c395274278c819ab649586a0",
"score": "0.58658963",
"text": "def days_array\n day = self.beginning_of_month.wday\n day = 7 if day == 0 #mimics cwday\n array = []\n array[day - 1] = 1\n (2..self.end_of_month.mday).each {|i| array << i }\n array\n end",
"title": ""
},
{
"docid": "ebfe5aec04436cdade6944d589e962ff",
"score": "0.58627003",
"text": "def get_date_range_arr\n (@rsv_start...@rsv_end).to_a.map { |day| day.to_s }\n end",
"title": ""
},
{
"docid": "72eb45cc9b96d6bb727c72ba09d0c946",
"score": "0.58614933",
"text": "def dateToFriendlyDate(date)\n return [Date::MONTHNAMES[date.slice(5, 2).to_i], date.slice(8, 2).to_i.to_s, date.slice(0, 4).to_i.to_s, date.slice(5, 2).to_i]\nend",
"title": ""
},
{
"docid": "df3df4526859644b73d9b03bb1b5ca23",
"score": "0.5856258",
"text": "def dates_array\n dates_in_array = self.dates.split(',')\n end",
"title": ""
},
{
"docid": "ce5e3a51a70bdefa166f1a54be804adf",
"score": "0.58548456",
"text": "def date_extract_options\n [\n {\n 'Day' => DateComponents::DAY,\n 'Month' => DateComponents::MONTH,\n 'Day of week' => DateComponents::DAY_OF_WEEK,\n 'Hour of day' => DateComponents::HOUR,\n 'Month of year' => DateComponents::MONTH_OF_YEAR\n }\n ]\n end",
"title": ""
},
{
"docid": "e0cb1e7ac396c55a07463012647ee0f6",
"score": "0.5820989",
"text": "def all_possible_date_number_regex\n formats = []\n\n # All possible formats includes these delimeters\n\n delimeters = ['/', '-', '\\.', ' ']\n\n delimeters.each do |delimeter|\n # \\s* makes sure that any whitepace character (0 or more) if present is neglected\n delimeter = \"\\s*#{delimeter}\\s*\"\n formats << \"#{day}#{delimeter}#{month}#{delimeter}#{year}\"\n formats << \"#{year}#{delimeter}#{month}#{delimeter}#{day}\"\n formats << \"#{month}#{delimeter}#{day}#{delimeter}#{year}\"\n formats << \"#{month}#{delimeter}#{year}#{delimeter}#{day}\"\n\n formats << \"#{day}#{delimeter}#{month}#{delimeter}#{year_short}\"\n formats << \"#{year_short}#{delimeter}#{month}#{delimeter}#{day}\"\n formats << \"#{month}#{delimeter}#{day}#{delimeter}#{year_short}\"\n formats << \"#{month}#{delimeter}#{year_short}#{delimeter}#{day}\"\n end\n\n # special uncommon formats not used\n # formats << \"#{day}\\.#{month} #{year}\" count - 8\n # formats << \"#{day}:#{month}-#{year}\" count - 1\n # formats << \"#{month}/#{day} #{year}\" count - 1\n # formats << \"#{day} #{month}-#{year}\" count - 2\n # formats << \"#{day}#{month}/#{year}\" count - 3\n\n return regex_from_formats(formats)\n end",
"title": ""
},
{
"docid": "c93c1f1dc0a98c6b1822d4d33fc4df42",
"score": "0.5794163",
"text": "def get_date_options\n date_range = (1..31)\n date_options = [];\n date_range.each do |d| \n item = [d, d]\n date_options.push item\n end\n date_options\n end",
"title": ""
},
{
"docid": "c93c1f1dc0a98c6b1822d4d33fc4df42",
"score": "0.5794163",
"text": "def get_date_options\n date_range = (1..31)\n date_options = [];\n date_range.each do |d| \n item = [d, d]\n date_options.push item\n end\n date_options\n end",
"title": ""
},
{
"docid": "8ad2404fe84de97933b0dca4b7493ebf",
"score": "0.57616746",
"text": "def get_year_array()\n date_array = get_past_dates()\n short_date_array = date_array.map{|date| date[0..3].to_i }\n short_date_array.unshift(\"x\")\n end",
"title": ""
},
{
"docid": "56cb4836a5f99ca8cb5f32778dac82a0",
"score": "0.57453036",
"text": "def ymd_header\n (@report.start_date.to_date..@report.end_date.to_date).to_a\n end",
"title": ""
},
{
"docid": "fec823b8071dfbe44d7e8a9019258717",
"score": "0.572777",
"text": "def _rdates\n Array(rdate).flatten\n rescue StandardError\n []\n end",
"title": ""
},
{
"docid": "b82800ca8667aa3df9d5392561b5f98e",
"score": "0.5702484",
"text": "def month_list\n\t\tmonth_list = Array.new\n\t\tmonth_list[0] = [\"1\", \"Jan\"]\n\t\tmonth_list[1] = [\"2\", \"Feb\"]\n\t\tmonth_list[2] = [\"3\", \"Mar\"]\n\t\tmonth_list[3] = [\"4\", \"Apr\"]\n\t\tmonth_list[3] = [\"5\", \"May\"]\n\t\tmonth_list[3] = [\"6\", \"Jun\"]\n\t\tmonth_list[3] = [\"7\", \"Jul\"]\n\t\tmonth_list[3] = [\"8\", \"Aug\"]\n\t\tmonth_list[3] = [\"9\", \"Sep\"]\n\t\tmonth_list[3] = [\"10\", \"Oct\"]\n\t\tmonth_list[3] = [\"11\", \"Nov\"]\n\t\tmonth_list[3] = [\"12\", \"Dec\"]\n\n\t\tmonth_list\n\t\t#will return array like this [[\"Mr\", \"Mr\"], [\"Ms\", \"Ms\"], [\"Mrs\", \"Mrs\"]] \n\tend",
"title": ""
},
{
"docid": "16aaaba82cb437594a6f97cdde404292",
"score": "0.5697473",
"text": "def time_format(date)\n [date.year, \"%02d\" % date.month]\n end",
"title": ""
},
{
"docid": "7433ab872a1b4463b3dde089aeaa6558",
"score": "0.5690988",
"text": "def additional_authors_w_dates\n results = []\n mods_ng_xml.plain_name.each { |n|\n results << n.display_value_w_date\n }\n results.delete(main_author_w_date)\n results\n end",
"title": ""
},
{
"docid": "3a1c5bfecce7b0e79f68099ce0c1efb3",
"score": "0.56816363",
"text": "def extract_date_elements(date_string)\n date_parts = date_string.split('/')\n\n year = date_parts.fetch(2).to_i + 2000\n month = date_parts.fetch(0).to_i\n day = date_parts.fetch(1).to_i\n\n [day, month, year]\n end",
"title": ""
},
{
"docid": "987c12f89b787c318eb08c5cd5c4b9de",
"score": "0.56766534",
"text": "def russian_names_of_months\n [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\",\n \"Октября\", \"Ноября\", \"Декабря\"]\n end",
"title": ""
},
{
"docid": "5ca8391ddcaed998f340fe18c5db4eac",
"score": "0.56690216",
"text": "def date_fields\n return [:air_date, :off_air_date]\n end",
"title": ""
},
{
"docid": "3de0e1ea4c5747e9482983924c01e809",
"score": "0.5661538",
"text": "def translated_month_names\n if @options[:use_short_month]\n [nil, \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\",\n \"Oct\", \"Nov\", \"Dec\"]\n else\n [nil, \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\",\n \"August\", \"September\", \"October\", \"November\", \"December\"]\n end\n end",
"title": ""
},
{
"docid": "d90399e393dc37462a916f30e8e7df70",
"score": "0.56512094",
"text": "def all_month_name_regex\n formats = []\n\n # Space/Slash/Pipe (0 or more occurences followed by a local month name string([a-z]*))\n # [a-z] can be replaced by [[:alpha:]] but then regex matching is very slow\n #\n month_str_regex_back = \"([\\s\\/\\|]*)([a-z]*)\" # [a-z] can be replaced by [[:alpha:]] but then regex matching is very slow\n\n # local month name string(\\w*) followed by Space/Slash/Pipe (0 or more occurences)\n month_str_regex_front = \"([a-z]*)([\\s\\/\\|]*)\"\n\n # regex for full month name in english\n month_regex = \"#{month_str_regex_front}#{month_name}#{month_str_regex_back}\"\n\n # regex for short month name in english\n month_regex_short = \"#{month_str_regex_front}#{month_name_short}#{month_str_regex_back}\"\n\n str_delimeters = ['/', '-', '\\.', ' ']\n\n str_delimeters.each do |str_delimeter|\n delimeter_regex = \"\\s*#{str_delimeter}\\s*\"\n\n\n # ALL COMBINATION IS REPETED TWICE FOR year & year_short\n formats << \"#{day}#{delimeter_regex}#{month_regex}#{delimeter_regex}#{year}\"\n formats << \"#{day}#{delimeter_regex}#{month_regex}#{delimeter_regex}#{year_short}\"\n\n formats << \"#{year}#{delimeter_regex}#{month_regex}#{delimeter_regex}#{day}\"\n formats << \"#{year_short}#{delimeter_regex}#{month_regex}#{delimeter_regex}#{day}\"\n\n\n formats << \"#{month_regex}#{delimeter_regex}#{day}#{delimeter_regex}#{year}\"\n formats << \"#{month_regex}#{delimeter_regex}#{day}#{delimeter_regex}#{year_short}\"\n\n formats << \"#{month_regex}#{delimeter_regex}#{year}#{delimeter_regex}#{day}\"\n formats << \"#{month_regex}#{delimeter_regex}#{year_short}#{delimeter_regex}#{day}\"\n\n\n # ABOVE COMBINATION IS REPETED FOR month_regex_short\n\n formats << \"#{day}#{delimeter_regex}#{month_regex_short}#{delimeter_regex}#{year}\"\n formats << \"#{day}#{delimeter_regex}#{month_regex_short}#{delimeter_regex}#{year_short}\"\n\n formats << \"#{year}#{delimeter_regex}#{month_regex_short}#{delimeter_regex}#{day}\"\n formats << \"#{year_short}#{delimeter_regex}#{month_regex_short}#{delimeter_regex}#{day}\"\n\n formats << \"#{month_regex_short}#{delimeter_regex}#{day}#{delimeter_regex}#{year}\"\n formats << \"#{month_regex_short}#{delimeter_regex}#{day}#{delimeter_regex}#{year_short}\"\n\n formats << \"#{month_regex_short}#{delimeter_regex}#{year}#{delimeter_regex}#{day}\"\n formats << \"#{month_regex_short}#{delimeter_regex}#{year_short}#{delimeter_regex}#{day}\"\n end\n\n return regex_from_formats(formats)\n end",
"title": ""
},
{
"docid": "74cc7ed3c55ccd7cfb29436a273a994a",
"score": "0.56303453",
"text": "def find_dates\n rgx = %r{([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})}\n @dates = []\n\n find @dates, @date_rgx, rgx\n end",
"title": ""
},
{
"docid": "1a5900216871963f0acbd3b824a36692",
"score": "0.5630253",
"text": "def date_string_to_array(string)\n gsub = string.gsub(/\\D/, ',')[0..-3]\n\n gsub_to_a = gsub.split(',')\n end",
"title": ""
},
{
"docid": "bb3cddb3b1bcc20eabe4dcaf0e7722e6",
"score": "0.56128466",
"text": "def elements\n [\n DiaryDateElement.new(:datetime, 'Effective date'),\n DiaryElement.new(:content),\n ]\n end",
"title": ""
},
{
"docid": "4c1a21b3f5741582ebaa60a8f44ac1c0",
"score": "0.5600321",
"text": "def build_date_array(year, month)\n date_array = Array.new\n # cycle through days in month creating one key in the array for each day\n for d in (1..self.days_in_month(year, month))\n if d < 10 then\n # if date is 1-9 make sure it is 01-09\n d = \"0#{d}\"\n end\n if year == Time.now.year && month == Time.now.month && d == Time.now.day && configurableValue(:Line_Calendar, :colordate) == \"yes\" then\n configurableValue(:Line_Calendar, :hicolor) == \"yes\" ? date_array[d] = HI_COLOR : date_array[d] = \"\"\n date_array[d.to_i] += Line_Calendar::COLORS[configurableValue(:Line_Calendar, :color)] + d.to_s + Line_Calendar::END_COLOR\n else\n date_array[d.to_i] = d\n end\n end\n # remove 0 key for 1 to 1 mapping in array\n date_array.shift\n # make sure all dates are two digits\n date_array.each do |d|\n end\n return date_array\n end",
"title": ""
},
{
"docid": "2154d87fba6374ee33812275cacb903d",
"score": "0.5589776",
"text": "def dates(reference) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize\n date = reference.at \"./front/date\"\n return [] if date.nil? || date[:year].nil? || date[:year].empty?\n\n d = date[:year]\n d += \"-#{month(date[:month])}\" if date[:month] && !date[:month].empty?\n d += \"-#{date[:day]}\" if date[:day]\n # date = Time.parse(d).strftime \"%Y-%m-%d\"\n [BibliographicDate.new(type: \"published\", on: d)]\n end",
"title": ""
},
{
"docid": "70fe392c70f3d48c22c39cccbf4e1f5e",
"score": "0.5545639",
"text": "def mdays\n @rrule.getByMonthDay.to_a\n end",
"title": ""
},
{
"docid": "3e5e75e1d2c3de8c4053f7f825c5d051",
"score": "0.55337054",
"text": "def inspect\n \"the month is \" +\n humanize_list(@parts) { |m| Date::MONTHNAMES[m] }\n end",
"title": ""
},
{
"docid": "68f56b7431063a9c2e18e730d445c221",
"score": "0.5531472",
"text": "def month_groups(sd,ed)\n (sd..ed).map{|d| [Date::MONTHNAMES[d.month], d.year]}.uniq\n end",
"title": ""
},
{
"docid": "e98e46e3aaeb0cee73e589741e2f0ef0",
"score": "0.5496298",
"text": "def mmddyy\n mmdd = [:month, :day].map do |m|\n m = @added.send(m)\n string = if m < 10 ; \"0\" + m.to_s\n else ; m.to_s\n end\n end.join(\"-\")\n mmdd + '-' + @added.year.to_s[2,2]\n end",
"title": ""
},
{
"docid": "54396c14cc1c32a7917252d421e919a4",
"score": "0.54642075",
"text": "def cal_array\n date_array = Array.new(35, \"\")\n position = @date.beginning_of_month.wday\n @date.beginning_of_month.upto @date.end_of_month do |next_date|\n date_array[position] = next_date\n position += 1\n end\n date_array\n end",
"title": ""
},
{
"docid": "eb012df015980ca9a146aa43e5e3ae52",
"score": "0.546226",
"text": "def date_value\n @value.map do |date|\n date.split(\"/\").map do |d|\n if year_only(date.split(\"/\"))\n Date.parse(d).strftime(\"%Y\")\n else\n Date.parse(d).strftime(\"%m/%d/%Y\")\n end\n end.join(\"-\")\n end\n rescue => e\n Rails.logger.warn e.message\n @value\n end",
"title": ""
},
{
"docid": "a857cf7f6dab1432ec66314f7de7e6d0",
"score": "0.5455403",
"text": "def date_conversion(date)\n [ merch_year_from_date(date), julian_to_merch(date.month) ]\n end",
"title": ""
},
{
"docid": "7677a9f1aeea61d5417dc00c9d17e818",
"score": "0.54386145",
"text": "def dates\n res = Array.new\n @debut.upto(@fin) { |x| res << x }\n res.pop\n res\n end",
"title": ""
},
{
"docid": "c3bf4fc50a9c6bac0a980bc3de0ccbda",
"score": "0.5438532",
"text": "def to_array\n [ @minutes, @hours, @days, @months, @weekdays ]\n end",
"title": ""
},
{
"docid": "fa9d97a426f313760d4534cd69fbf00c",
"score": "0.54375625",
"text": "def modifier_names\n [modifier_name]\n end",
"title": ""
},
{
"docid": "f54fdc0968a19ad1261ccefac0ea4611",
"score": "0.542837",
"text": "def calculated_dates\n [period1_from_date,period1_end_date,\n period2_from_date, period2_end_date] \n end",
"title": ""
},
{
"docid": "b86deb2f9e501d84e8b953f97644f8d6",
"score": "0.5423063",
"text": "def last_14_iso_dates\n last_14_days.map{ |date| date.iso8601 }\n end",
"title": ""
},
{
"docid": "6b3e4cb12133b0d9ab62c344afac86e7",
"score": "0.54177016",
"text": "def mayan_tzolkin_date(number, name)\n [number, name]\n end",
"title": ""
},
{
"docid": "0fde74329201a3966ada6d43929e34c9",
"score": "0.5416932",
"text": "def day_names\r\n names = @options[:day_names] || translated_day_names\r\n names.unshift(nil) if names.size < 8\r\n names\r\n end",
"title": ""
},
{
"docid": "680b4d1c6b8b5cdd078b4e9e46eb9694",
"score": "0.54133034",
"text": "def datetimes\n data = JSON.parse(rdate || \"[]\")\n data.map { |pair| pair.map { |str| DateTime.parse(str) } }\n end",
"title": ""
},
{
"docid": "8cbd0a24750ca7a6da9496a1043a96d2",
"score": "0.5387579",
"text": "def dates\n swing_dates.order(\"date ASC\").collect{|sd| sd.date}\n end",
"title": ""
},
{
"docid": "680410fa73482783e87a43a9cabe07a4",
"score": "0.537831",
"text": "def formats\n []\n end",
"title": ""
},
{
"docid": "7c4ca48545687b8692a284d29d6e1110",
"score": "0.5376669",
"text": "def day_names\n get_day_names(DAY_NAMES)\n end",
"title": ""
},
{
"docid": "02dabc7848c8ea91c2ef3d4c57818213",
"score": "0.53749514",
"text": "def get_month_options\n month_options = (1..12).collect do |mm|\n [ Date::MONTHNAMES[mm], mm ]\n end\n month_options\n end",
"title": ""
},
{
"docid": "02dabc7848c8ea91c2ef3d4c57818213",
"score": "0.53749514",
"text": "def get_month_options\n month_options = (1..12).collect do |mm|\n [ Date::MONTHNAMES[mm], mm ]\n end\n month_options\n end",
"title": ""
},
{
"docid": "b2520c70bd22b86b3b3dde06b5d50dcd",
"score": "0.53650695",
"text": "def day_fields\n []\n end",
"title": ""
},
{
"docid": "703f2df7a92beee472150aac40de83fc",
"score": "0.53623635",
"text": "def dates\n [].tap do |dates|\n dates << submitted_date if submitted_date.present?\n dates << available_date if available_date.present?\n dates << issued_date if issued_date.present?\n dates << created_date if created_date.present?\n end\n end",
"title": ""
},
{
"docid": "0b9c11adb0c5614d86368a2720caeee6",
"score": "0.5362053",
"text": "def build_day_array(year, month)\n day_array = Array.new\n # cycle through number of days in the month and build an array with one entry per day\n for d in (1..self.days_in_month(year, month))\n day_array[d] = Line_Calendar::ABBR_DAYNAMES[self.day_in_month(year, month, d)] # populates array with abbreviated daynames\n end\n # remove the 0 entry and move everything up one\n day_array.shift\n return day_array\n end",
"title": ""
},
{
"docid": "c790914295181a62dd85a2f446fc76ca",
"score": "0.5355877",
"text": "def get_templates()\n array = OpenStudio::StringVector.new\n array << 'DOE Ref Pre-1980'\n array << 'DOE Ref 1980-2004'\n array << '90.1-2004'\n array << '90.1-2007'\n # array << '189.1-2009' # if turn this on need to update space_type_array for stripmall\n array << '90.1-2010'\n array << '90.1-2013'\n\n return array\n end",
"title": ""
},
{
"docid": "ff7a7b92bf1588054cf620df8de5fb85",
"score": "0.534648",
"text": "def aztec_xihuitl_date(month, day)\n [month, day]\n end",
"title": ""
},
{
"docid": "dd69675f7753296863f9fce1edc4c515",
"score": "0.534385",
"text": "def months\n (0..length_in_months - 1).map do |i|\n self.starts_on + i.months\n end\n end",
"title": ""
},
{
"docid": "359b9c773b1885ed1c6748a8f653f400",
"score": "0.5343485",
"text": "def time_format(date)\n [DATE_FORMAT % [date.year, date.month, date.day]]\n end",
"title": ""
},
{
"docid": "09f5a869c9e3b53612db15dfc8894f1d",
"score": "0.53321",
"text": "def extracted_values\n [\n [+\" novembre 2018 \", +\"12,10%\"],\n [+\"octobre 2018 \", +\"11,95%\"],\n [+\" septembre 2018 \", +\"11,95%\"],\n [+\" novembre 2018 \", +\"18,50%\"],\n [+\"octobre 2018 \", +\"17,50%\"],\n [+\" septembre 2018 \", +\"17,50%\"]\n ]\n end",
"title": ""
},
{
"docid": "b5962d5d3920a39d7bf30d83e9a0df18",
"score": "0.5329662",
"text": "def print_date_in_array_format\n time = Time.new\n print \"Time in array format : [#{time.day} , #{time.month}, #{time.year}]\" \nend",
"title": ""
},
{
"docid": "c1e6d17c7534cc95c46489b5cf078e28",
"score": "0.53288513",
"text": "def time_format(date)\n [date.year]\n end",
"title": ""
},
{
"docid": "8476513a9b941ed00cfe1012928e0966",
"score": "0.5322714",
"text": "def readable_inspect\n strftime(\"%a, %d %b %Y\")\n end",
"title": ""
},
{
"docid": "6aedbd6141a08cd6630167bdf22a0e38",
"score": "0.5322684",
"text": "def date_time_reference\n dtm_elements = []\n dtm_elements << 'DTM'\n dtm_elements << '405'\n dtm_elements << check.batch.date.strftime(\"%Y%m%d\")\n dtm_elements.join(@element_seperator)\n end",
"title": ""
},
{
"docid": "00d9114a8bbcf7d58cc886d703c2df3e",
"score": "0.5321647",
"text": "def date_toStr\n dayArr = Array.new\n @date.each do |day, value|\n\t value = value.to_s\n\t if value.length == 1\n\t value = \"0\" + value # pad extra zero\n\t end\n\t dayArr << value\n\tend\n\treturn dayArr.join( \"-\" )\n end",
"title": ""
},
{
"docid": "620a63a304cceb81ebdc74343e7a0c55",
"score": "0.5321597",
"text": "def period_date_functions(period_type)\n if period_type == \"weekly\"\n return [\"beginning_of_week\".to_sym, \"last_week\".to_sym, \"group_by_week_created\", :convert_to_week_num]\n elsif period_type == \"monthly\"\n return [\"beginning_of_month\".to_sym, \"last_month\".to_sym, \"group_by_month_created\", :convert_to_month_num]\n elsif period_type == \"quarterly\"\n return [\"beginning_of_quarter\".to_sym, \"last_quarter\".to_sym, \"group_by_quarter_created\", :convert_to_quarter_num]\n else\n return [\"\".to_sym, \"\".to_sym]\n end\n end",
"title": ""
},
{
"docid": "fbe141f134dff8b4339114cc806a30ee",
"score": "0.5321302",
"text": "def release_dates\n table = release_info.at(\"a[href^='/calendar/?region']\").parent.parent.parent.parent rescue nil\n regions = table.css(\"b a[href^='/calendar/?region']\").map { |node| node.text } rescue []\n links = table.css(\"b a[href^='/calendar/?region']\").map { |node| node[\"href\"] } rescue []\n codes = links.map { |link| link.split(\"=\").last.downcase } unless links.empty?\n dates = table.css(\"td[align='right']\").map { |node| node.text.strip }\n \n array = []\n 0.upto(regions.size - 1) do |i|\n array << {:code => codes[i], :region => regions[i], :date => dates[i].parse_date}\n end\n \n array\n end",
"title": ""
},
{
"docid": "a58576cc96693b5e6a25d713ec46d0f1",
"score": "0.53209984",
"text": "def date_string; end",
"title": ""
},
{
"docid": "06b1bcc825880342ba3f1597c339a998",
"score": "0.53172505",
"text": "def end_date_form_options\n available_months.map do |date|\n label = \"#{Date::ABBR_MONTHNAMES[date.month]} #{date.end_of_month.day}, #{date.year}\"\n value = date.strftime(\"%Y-%m\") # YYYY-MM\n [label, value]\n end\n end",
"title": ""
},
{
"docid": "dc50bfd385a64bd3fea7d4930cd7a89c",
"score": "0.5316593",
"text": "def dct_temporal_dates\n items = @resource.datacite_dates.map(&:date).reject(&:blank?)\n items.map! do |dt|\n\n Date.iso8601(dt)&.strftime('%Y-%m-%d')\n rescue ArgumentError\n nil\n\n end\n items.compact\n\n # the below is the old stuff. We don't have ranges in our dates.\n # items = dates.map(&:to_s).compact\n # year_range_items = dates.map do |i|\n # (i.range_start.year..i.range_end.year).to_a.map(&:to_s) if i.range_start && i.range_end && i.range_start.year && i.range_end.year\n # end\n # (items + year_range_items).compact.flatten.uniq\n end",
"title": ""
},
{
"docid": "c97fb7643d7e16c9772781efb795edc0",
"score": "0.53117436",
"text": "def readable_inspect\n strftime(\"%a, %d %b %Y\")\n end",
"title": ""
},
{
"docid": "0b60bf4e8b6c118d83e42a8d41d0cc90",
"score": "0.5307951",
"text": "def x_axis_dates\n last_14_days.map do |date|\n iso_hash = Date._iso8601(date.iso8601)\n \"#{Date::ABBR_MONTHNAMES[iso_hash[:mon]]} %02d\" % [iso_hash[:mday]]\n end\n end",
"title": ""
},
{
"docid": "9fe6c8e6539f87b8506176c7bf9fdcae",
"score": "0.5302298",
"text": "def list_all_months(*a)\r\n\ta.each do |a|\r\n\t\t\"#{a}\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "54b6f7799bd626c42fa723713edd1e91",
"score": "0.5293134",
"text": "def load_dates(doc)\n result = []\n\n # 245 contains creation dates\n [[\"f\", \"inclusive\"], [\"g\", \"bulk\"]].each do |code, date_type|\n field = doc.css('datafield[tag=\"245\"] subfield[code=\"%s\"]' % [code]).text\n\n next if field.empty?\n\n result << string_to_date(field, 'date_label' => 'creation', 'date_type' => date_type)\n end\n\n # 260 contains publication dates\n [\"e\", \"c\"].each do |code|\n field = doc.css('datafield[tag=\"260\"]').first_or_empty.css('subfield[code=\"%s\"]' % [code]).text\n\n next if field.empty?\n\n result << string_to_date(field,\n 'date_type' => 'single',\n 'date_label' => 'publication')\n end\n\n result\n end",
"title": ""
},
{
"docid": "1c84da3f5caa46c705a9844ec1970294",
"score": "0.5289303",
"text": "def get_templates\n array = OpenStudio::StringVector.new\n array << 'DOE Ref Pre-1980'\n array << 'DOE Ref 1980-2004'\n array << '90.1-2004'\n array << '90.1-2007'\n # array << '189.1-2009' # if turn this on need to update space_type_array for RetailStripmall\n array << '90.1-2010'\n array << '90.1-2013'\n array << 'NREL ZNE Ready 2017'\n\n return array\n end",
"title": ""
},
{
"docid": "148397da2e2a4af4d0efe22b71ff793e",
"score": "0.5273877",
"text": "def date_reformatting(date)\n Date.parse(date).strftime'[%m, %d, %Y]'\nend",
"title": ""
},
{
"docid": "b470c089eafe42fbc70be35e2f7f1951",
"score": "0.52736384",
"text": "def modifiers\n @@modifiers ||= []\n end",
"title": ""
},
{
"docid": "b470c089eafe42fbc70be35e2f7f1951",
"score": "0.52736384",
"text": "def modifiers\n @@modifiers ||= []\n end",
"title": ""
},
{
"docid": "4c6e0ddfbed92abd4ea934473d0d0f8e",
"score": "0.5270558",
"text": "def inspect\n \"the month is \" +\n humanize_list(@months) { |m| Date::MONTHNAMES[m] }\n end",
"title": ""
},
{
"docid": "683d93144500553cb3b1e5ab62f50c31",
"score": "0.5262165",
"text": "def months\n (1..12).to_a\n end",
"title": ""
},
{
"docid": "c25828a5260461144dcffed6d36dbe68",
"score": "0.5256145",
"text": "def yearly_dates\n date_value ? clean_years : []\n end",
"title": ""
},
{
"docid": "18e753f61973bd4eea8b8cc1960302cf",
"score": "0.52527934",
"text": "def publish_month_and_year\n [publish_on.month, publish_on.year]\n end",
"title": ""
},
{
"docid": "b65464b8414bacd0700345354da1d86a",
"score": "0.52495366",
"text": "def day_names(format: :one_letter)\n case format\n when :abbr\n Date::ABBR_DAYNAMES\n when :full\n Date::DAYNAMES\n else\n Date::DAYNAMES.map { |day| day.first } # default is one char day names\n end\n end",
"title": ""
},
{
"docid": "55f3086efe68d2a45f6b10253daf663a",
"score": "0.5244192",
"text": "def month_names\r\n names = @options[:month_names] || translated_month_names\r\n names.unshift(nil) if names.size < 13\r\n names\r\n end",
"title": ""
},
{
"docid": "067c528a2543627448c016d09880060a",
"score": "0.5236979",
"text": "def readable_inspect\n strftime('%a, %d %b %Y')\n end",
"title": ""
},
{
"docid": "59feb6388d0b9cad9b69ad0ba9a02b77",
"score": "0.5235068",
"text": "def date\n if self.day\n day = \"#{self.day}, \"\n else\n day = self.day\n end\n\n date = [self.month.publication_month, day, self.article_year].reject(&:blank?).join(\" \").to_s\n end",
"title": ""
},
{
"docid": "300e8349ef88222ea66e11e3d5d51818",
"score": "0.5234213",
"text": "def modified_date(file)\n modified_month(file) + \"-\" + modified_day(file) + \"-\" + modified_year(file)\nend",
"title": ""
},
{
"docid": "0ebd8d9e596ca110ac1ae10a1076f30c",
"score": "0.52329695",
"text": "def dct_temporal_dates # rubocop:disable Metrics/AbcSize\n items = dates.map(&:to_s).compact\n year_range_items = dates.map do |i|\n (i.range_start.year..i.range_end.year).to_a.map(&:to_s) if i.range_start && i.range_end && i.range_start.year && i.range_end.year\n end\n (items + year_range_items).compact.flatten.uniq\n end",
"title": ""
},
{
"docid": "99f391d5dea71c58a31cc5844615e99a",
"score": "0.5231406",
"text": "def entries(stamp_pattern = nil); []; end",
"title": ""
}
] |
c30bd28204c5cb1233e6b5ce38b39851
|
Copies handlers from the `source_list` onto the current handler list. If a block is given, only the entries that return a `true` value from the block will be copied.
|
[
{
"docid": "0583cfdb2800c379d7ce38f5742949ea",
"score": "0.7148923",
"text": "def copy_from(source_list, &block); end",
"title": ""
}
] |
[
{
"docid": "cbe6734b425fcb80f252ece67953fed2",
"score": "0.5380155",
"text": "def source_list(label, *list)\n _logger.warn \"Duplicate source_list '#{label}'\" if @result.source_lists.has_key?(label)\n @result.source_lists[label] += list\n end",
"title": ""
},
{
"docid": "7bf0d08b01feba9347e78460a298d88d",
"score": "0.52227193",
"text": "def selective_copy(directory, &block)\n Dir[File.join(source_paths, directory)].each do |filename|\n file = filename.to_s.gsub(\"#{Engine.root.to_s}/\", '')\n copy_file file\n end\n end",
"title": ""
},
{
"docid": "316d27f02679eec605dfb01c7484ac33",
"score": "0.5009096",
"text": "def copy_blocks\n @blocks.map(&:dup)\n end",
"title": ""
},
{
"docid": "8003309fb098660751d3000fcf2523da",
"score": "0.49694237",
"text": "def select!(&block)\n #@file_list = FileList.all(*to_a.select{ |f| block.call(f) })\n @file_list = @file_list.select{ |f| block.call(f) }\n end",
"title": ""
},
{
"docid": "112f2da55d721cd163e497c1f31ffca6",
"score": "0.49169305",
"text": "def restore\n if is_source?\n @next.data.each { |_data| yield _data if block_given? } if @next\n end\n end",
"title": ""
},
{
"docid": "8fe7c4ff645dabcec8fe61885b00d92e",
"score": "0.48908597",
"text": "def each_copy(&block)\n @by_copy.each(&block)\n end",
"title": ""
},
{
"docid": "ffe3fad34cb847ec0eb7e1bf6305d7ed",
"score": "0.4889207",
"text": "def safe_copy(pathlist, &block)\n # Copy code into a temp directory so we don't confuse editors while snapshotting\n curdir = Dir.pwd\n tmpdir = Dir.mktmpdir\n\n copy_files_to_dir(pathlist, tmpdir) \n Dir.chdir(tmpdir)\n\n if block\n yield\n FileUtils.remove_entry_secure(tmpdir)\n Dir.chdir(curdir)\n else\n return tmpdir\n end\n end",
"title": ""
},
{
"docid": "8ce5236d9a121e5f5df6935f546d2e49",
"score": "0.48477432",
"text": "def backup\n unless is_target?\n @before.data.each { |_data| yield _data if block_given? } if @before\n end\n end",
"title": ""
},
{
"docid": "5876e9fd94dbab62533fefc917c68093",
"score": "0.4809591",
"text": "def copy_list \n\n\tend",
"title": ""
},
{
"docid": "4114fd3df1f6d966288bf6d30213e663",
"score": "0.48008412",
"text": "def source(source_name, &block)\n @watched_sources ||= []\n @watched_sources << source_name unless @watched_sources.include?(source_name)\n watch_for(source_name)\n instance_eval(&block)\n end",
"title": ""
},
{
"docid": "7500f73a040b66e25e91d7359e76c4d1",
"score": "0.4780581",
"text": "def blocklists; end",
"title": ""
},
{
"docid": "6291a133220806385c2c88e11a995895",
"score": "0.47480622",
"text": "def process_block exp\n exp = exp.dup\n exp.shift\n\n exp.map! do |e|\n process e\n end\n\n exp.unshift :rlist\n end",
"title": ""
},
{
"docid": "04fa78adc12d942d54f63de249af06e2",
"score": "0.47309893",
"text": "def each_request_target_with_headers(&block)\n\t\ttarget_requests('AND wmap_requests.headers IS NOT NULL').each do |req|\n\t\t\tblock.call(req)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cb3186c8d8d5bf5a5778561e5cb84925",
"score": "0.4720961",
"text": "def scan_sources(options={})\n return enum_for(__method__,options) unless block_given?\n\n @lockfile.sources.map do |source|\n case source\n when Source::Git\n case source.uri\n when /^git:/, /^http:/\n unless internal_source?(source.uri)\n yield Results::InsecureSource.new(source.uri)\n end\n end\n when Source::Rubygems\n source.remotes.each do |uri|\n if (uri.scheme == 'http' && !internal_source?(uri))\n yield Results::InsecureSource.new(uri.to_s)\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "43f29c68408461ca17c4469b5d904114",
"score": "0.46639684",
"text": "def each\n @source.each do |elem|\n yield DropDelegation.wrap_element(elem)\n end\n end",
"title": ""
},
{
"docid": "426d176ef00a7f018552dbc9b1744a0a",
"score": "0.46509635",
"text": "def verify_property source_list, &block\n count = 0\n source_list.each do |source|\n target = @dst + source.relative_path_from(@src)\n if target.exist?\n count += 1\n yield source, target, source.basename.to_s\n end\n end\n assert count > 0, 'There was no file to test'\n end",
"title": ""
},
{
"docid": "f0f9d8e594e6681090c1afdd2391d9df",
"score": "0.46509093",
"text": "def source *args, &block\n instance_eval &block if block_given?\n end",
"title": ""
},
{
"docid": "2706544121d1c477266dd5a2a6317180",
"score": "0.4611157",
"text": "def add_source(source)\n all << source unless all.any? { |s| s.url == source || s.name == source.name }\n end",
"title": ""
},
{
"docid": "b19c2ea79343aa3641087e1af859d3b2",
"score": "0.4601416",
"text": "def duplicate(&block)\n @on_duplicate = block\n end",
"title": ""
},
{
"docid": "79217f945cc8c1142356a45a185b73b6",
"score": "0.45956436",
"text": "def each_request_target_with_body(&block)\n\t\ttarget_requests('AND wmap_requests.body IS NOT NULL').each do |req|\n\t\t\tblock.call(req)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ebe0a9c57ebd2db4ed38ac6951224f08",
"score": "0.45942357",
"text": "def transfer_block(source, destination, block_opening = nil)\n if block_opening.nil?\n File.open(source) do |f|\n f.each do |line|\n destination.puts line\n end\n end\n else\n File.open(source) do |f|\n block_opened = false\n f.each do |line|\n if !block_opened && line.start_with?(block_opening)\n destination.puts line\n block_opened = true\n elsif block_opened && !line.start_with?('}')\n destination.puts line\n elsif block_opened && line.start_with?('}')\n destination.puts line\n break\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "d1169e3482f7c3a7dddbc8ee0f1dd2f7",
"score": "0.45879903",
"text": "def copy_content\n @tocopy.each do |pair|\n src = pair[0]\n dst = File.expand_path(File.join(@temp_path, pair[1] || ''))\n dstdir = File.dirname(dst)\n FileUtils.mkpath(dstdir) unless File.exist?(dstdir)\n FileUtils.cp_r(src, dst)\n end\n\n # clear out the list of things to copy so that snippets can\n # re-load it and call copy_content again if needed\n @tocopy = []\n end",
"title": ""
},
{
"docid": "9492892f104b9fca0cbf3f58af451da7",
"score": "0.45865217",
"text": "def do_changedblock(block)\n result = []\n result << begin_changedblock(block)\n result << block.collect do |line|\n send(classify(line), line)\n end\n result << end_changedblock(block)\n result.compact\n end",
"title": ""
},
{
"docid": "1de1ddaa9024b3a354617b65070cdc06",
"score": "0.4585473",
"text": "def each_dest(&block)\n return enum_for(:each_dest) unless block_given?\n\n if @dest.kind_of?(Array)\n @dest.each(&block)\n elsif @dest\n yield @dest\n end\n end",
"title": ""
},
{
"docid": "2a0c3abe4db6ac9bf0156b383e9d0e0c",
"score": "0.45842418",
"text": "def copy_override_snippet(block, source, uri)\n info block: block, message: \"copying snippet #{source}\"\n copy_proc = block.document.attr 'copy_snippet'\n if copy_proc\n # Delegate to a proc for copying if one is defined. Used for testing.\n copy_proc.call(uri, source)\n else\n destination = ::File.join block.document.options[:to_dir], uri\n destination_dir = ::File.dirname destination\n FileUtils.mkdir_p destination_dir\n FileUtils.cp source, destination\n end\n end",
"title": ""
},
{
"docid": "f03a915a09fcaf1b690177b618f34794",
"score": "0.4559601",
"text": "def run_tests(&block)\n\n @sources.each do |source|\n result = test_source(File.absolute_path(source))\n block.call({ :source => source, :result => result })\n end\n\n end",
"title": ""
},
{
"docid": "b4acadbb210103442ceeff39451bf63d",
"score": "0.4559051",
"text": "def source\r\n @_source ||= @_block.call\r\n end",
"title": ""
},
{
"docid": "9a80a7c5debd0f2a690851a6ad59a3f4",
"score": "0.455827",
"text": "def copy_override_snippet(block, source, uri)\n info block: block, message: \"copying snippet #{source}\"\n copy_proc = block.document.attr 'copy_snippet'\n if copy_proc\n # Delegate to a proc for copying if one is defined. Used for testing.\n copy_proc.call(uri, source)\n else\n destination = ::File.join block.document.options[:to_dir], uri\n destination_dir = ::File.dirname destination\n FileUtils.mkdir_p destination_dir\n FileUtils.cp source, destination\n end\n end",
"title": ""
},
{
"docid": "11993a1f92a43e3de6216c295cbafb78",
"score": "0.45125648",
"text": "def copy(sql, source: nil, &block)\n copy_handler = if block_given?\n block\n elsif source && File.exist?(source.to_s)\n lambda { |data| file_copy_handler(source, data) }\n elsif source.respond_to?(:read) && source.respond_to?(:eof?)\n lambda { |data| io_copy_handler(source, data) }\n end\n\n run_in_mutex(Vertica::Query.new(self, sql, copy_handler: copy_handler))\n end",
"title": ""
},
{
"docid": "fb1c046a79cc76767828893f7ba139b6",
"score": "0.4511022",
"text": "def each_request_target_with_headers(&block)\n\t\ttarget_requests('AND requests.headers IS NOT NULL').each do |req|\n\t\t\tblock.call(req)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "16165c9d8d44435cd7e7936b39a15251",
"score": "0.44921064",
"text": "def <<(block)\n blocks << block\n end",
"title": ""
},
{
"docid": "5d27a01e75e00a5bd6d695fc0c8556c6",
"score": "0.4479623",
"text": "def each_chunk_from(source_or_content)\n if source_or_content.is_a?(String)\n yield source_or_content\n elsif content_is_really_a_checksum? && source_or_content.nil?\n yield read_file_from_filebucket\n elsif source_or_content.nil?\n yield ''\n elsif self.class.standalone?\n yield source_or_content.content\n elsif source_or_content.local?\n chunk_file_from_disk(source_or_content) { |chunk| yield chunk }\n else\n chunk_file_from_source(source_or_content) { |chunk| yield chunk }\n end\n end",
"title": ""
},
{
"docid": "ba0b0533f4b494fa257a7f92d36d9964",
"score": "0.44520435",
"text": "def source_lib(name, hash)\n raise \"not a hash\" unless hash.is_a?(Hash)\n check_hash hash,[:sources, :includes, :dependencies, :toolchain, :file_dependencies, :output_dir]\n raise \":sources need to be defined\" unless hash.has_key?(:sources)\n bblock = SourceLibrary.new(name)\n bblock.set_sources(hash[:sources])\n bblock.set_includes(hash[:includes]) if hash.has_key?(:includes)\n bblock.set_tcs(hash[:toolchain]) if hash.has_key?(:toolchain)\n bblock.set_dependencies(hash[:dependencies]) if hash.has_key?(:dependencies)\n bblock.file_dependencies = hash[:file_dependencies] if hash.has_key?(:file_dependencies)\n bblock.set_output_dir(hash[:output_dir]) if hash.has_key?(:output_dir)\n all_blocks << bblock\n end",
"title": ""
},
{
"docid": "1ae0d93bb1f445d929f0417c4703c9be",
"score": "0.4448926",
"text": "def clean(&block)\n @target.files.each do |object|\n unless @source.files.include? object.key\n block.call(object)\n object.destroy\n end\n end\n end",
"title": ""
},
{
"docid": "95fe9d4188e49028914764d1130b1726",
"score": "0.44409838",
"text": "def update( search_nodes )\n if has_target_predicate? then\n search_nodes.each do |node|\n if node.slot_filled?(@slot_name) then\n unless @target_predicate.apply(node[@slot_name].to_a).empty?\n yield( node )\n end \n end\n end\n else\n search_nodes.each do |node|\n yield( node )\n end\n end\n end",
"title": ""
},
{
"docid": "a4d11f3052dc94f9ad6eb80ec29be038",
"score": "0.4438332",
"text": "def read(aSource,&aBlock)\n\t\tdefault_values.each do |k,v|\n\t\t\tdone = false\n\t\t\tif block_given? && ((newv = yield(k,v,aSource && aSource[k])) != nil)\n\t\t\t\tself[k] = newv\n\t\t\t\tdone = true\n\t\t\tend\n\t\t\tcopy_item(aSource,k) if !done && aSource && !aSource[k].nil?\n\t\tend\n\t\tself\n\tend",
"title": ""
},
{
"docid": "77d6faf75c1cbe673ce1e0ba03bce1df",
"score": "0.44263774",
"text": "def map_send(method, options={}, &block)\n\n map = {}\n list.each do |file|\n if dest = block.call(file)\n map[file] = dest\n end\n end\n\n if options[:safe] or !options[:force] or SAFE_METHODS.include?(method) \n ensure_safe(map)\n end\n\n map.each do |src, dest|\n fileutils.__send__(method, src, dest, options)\n end\n FileList.all(*map.values)\n end",
"title": ""
},
{
"docid": "2d950ee0c2d1ceaba5d9974c6801f580",
"score": "0.44259351",
"text": "def apply_locked_source_options(options_from_lock)\n options = options_from_lock.inject({}) do |acc, (key, value)|\n acc[key.to_sym] = value\n acc\n end\n source_options.merge!(options)\n raise ChefCLI::InvalidLockfile, \"Invalid source_options provided from lock data: #{options_from_lock_file.inspect}\" unless valid?\n end",
"title": ""
},
{
"docid": "d2257ff5fa32c3c3d669709a6a476e62",
"score": "0.4419187",
"text": "def map(list, &block)\n array = []\n list.each do |ele|\n array << block.call(ele)\n end\n\n array\nend",
"title": ""
},
{
"docid": "0338b61a6efe2df9cf33d83db7a929df",
"score": "0.44158942",
"text": "def add_block_container_to_list(*args, &block)\n block_container = self.build_block_container(*args, &block)\n if blocks[block_container.name].nil?\n blocks[block_container.name] = [block_container]\n else\n blocks[block_container.name] << block_container\n end\n end",
"title": ""
},
{
"docid": "1edf80af3782ca36a0a9f5000a5dbe96",
"score": "0.4414567",
"text": "def cxx_configuration(&block)\n @all_blocks = []\n block.call\n end",
"title": ""
},
{
"docid": "e6303aaa9400a083207fc0f76dd32d75",
"score": "0.4414054",
"text": "def map(&block)\n dup.map!(&block)\n end",
"title": ""
},
{
"docid": "94b15bc46b0bbbb3ab5d81d324f2d25b",
"score": "0.44108933",
"text": "def to_source\n (['.block'] + collect{|e| e.to_source} + ['.bend']).flatten\n end",
"title": ""
},
{
"docid": "1b7fec29498cc48db6041824365772a2",
"score": "0.4410797",
"text": "def merge(&_block)\n if permit?\n yield\n else\n self\n end\n end",
"title": ""
},
{
"docid": "de308949671e57d0cebc3512b2383699",
"score": "0.44105405",
"text": "def processed_source=(_); end",
"title": ""
},
{
"docid": "de308949671e57d0cebc3512b2383699",
"score": "0.44105405",
"text": "def processed_source=(_); end",
"title": ""
},
{
"docid": "903421d816c3c0ff33fda01fbd001717",
"score": "0.44102794",
"text": "def list(list_name, opts, &block)\n options = {\n :workflow_state_filter => nil,\n :fields => nil,\n :conditions => nil,\n :forms => nil \n }.update(opts)\n self.lists[list_name] = Struct.new(:block,*options.keys)[block,*options.values]\n end",
"title": ""
},
{
"docid": "4e18ec769babb1aac335cc19dad0192f",
"score": "0.4409896",
"text": "def _merge_when(hash, &block)\n hash[:conditions] = Sequel.virtual_row(&block) if block\n\n if merge_when = @opts[:merge_when]\n clone(:merge_when => (merge_when.dup << hash.freeze).freeze)\n else\n clone(:merge_when => [hash.freeze].freeze)\n end\n end",
"title": ""
},
{
"docid": "a53d1ad78402ede0eebf0ebfa2f4dd4b",
"score": "0.4395047",
"text": "def each_request_target_with_body(&block)\n\t\ttarget_requests('AND requests.body IS NOT NULL').each do |req|\n\t\t\tblock.call(req)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0878a16d231e49dc6876447dec049b72",
"score": "0.439198",
"text": "def preprocess(&block) #:nodoc:\n return false if block && !block[self]\n server_list.each { |server| server.preprocess }\n block.nil? || block[self]\n end",
"title": ""
},
{
"docid": "7fa2946be6021dcf73dc0ee3c817f15c",
"score": "0.43854243",
"text": "def proxy(&block)\n if block_given?\n @proxy = block\n else\n if @proxy.is_a? Proc\n @proxy.call\n else\n @proxy\n end\n end\n end",
"title": ""
},
{
"docid": "0c8d7c0473f87b1c88aa3dd7599f2422",
"score": "0.4363729",
"text": "def each_target(&block)\n\t\ttargets.each do |target|\n\t\t\tblock.call(target)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0c8d7c0473f87b1c88aa3dd7599f2422",
"score": "0.4363729",
"text": "def each_target(&block)\n\t\ttargets.each do |target|\n\t\t\tblock.call(target)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bf1c07c164e1ecccf0f973fb20d1a68d",
"score": "0.43531728",
"text": "def add_sources(marshaller)\n source_dir = (source_type == SOURCE_TYPE_INTERNAL) \\\n ? SystemProperties::getCenterInternalDirectory \\\n : SystemProperties::getCenterExternalDirectory\n\n ha_configured = CommonSql.ha_configured?\n\n ConfigurationSource.get_all_sources_by_type(source_type).each do |source|\n source_xml = marshaller.factory.createConfigurationSourceType\n central_server_address = nil\n if ha_configured\n central_server_address = SystemParameter.where(\n :key => SystemParameter::CENTRAL_SERVER_ADDRESS,\n :ha_node_name => source.ha_node_name).first.value\n else\n central_server_address = SystemParameter.where(\n :key => SystemParameter::CENTRAL_SERVER_ADDRESS).first.value\n end\n source_xml.downloadURL =\n \"http://\" + central_server_address + \"/\" + source_dir\n source.configuration_signing_keys.find_each do |key|\n source_xml.getVerificationCert.add(key.cert.to_java_bytes)\n end\n marshaller.root.source.add(source_xml)\n end\n end",
"title": ""
},
{
"docid": "6db88972baaf16a3bf5105f512703665",
"score": "0.43458605",
"text": "def copy_source_values\n devfail \"Somehow got asked to copy source values without any metadata\" unless metadata\n\n # Take each of the stats and set them as states on the local file\n # if a value has not already been provided.\n [:owner, :mode, :group, :checksum].each do |metadata_method|\n param_name = (metadata_method == :checksum) ? :content : metadata_method\n next if metadata_method == :owner and !Puppet.features.root?\n next if metadata_method == :checksum and metadata.ftype == \"directory\"\n next if metadata_method == :checksum and metadata.ftype == \"link\" and metadata.links == :manage\n\n if Puppet.features.microsoft_windows?\n next if [:owner, :group].include?(metadata_method) and !local?\n end\n\n if resource[param_name].nil? or resource[param_name] == :absent\n resource[param_name] = metadata.send(metadata_method)\n end\n end\n\n if resource[:ensure] == :absent\n # We know all we need to\n elsif metadata.ftype != \"link\"\n resource[:ensure] = metadata.ftype\n elsif @resource[:links] == :follow\n resource[:ensure] = :present\n else\n resource[:ensure] = \"link\"\n resource[:target] = metadata.destination\n end\n end",
"title": ""
},
{
"docid": "4b5ffa6f7e1c304890e2358a7bb642fd",
"score": "0.43363166",
"text": "def clone_pre_copy_hook(clone_source_object, _opts = {})\n clone_source_object\n end",
"title": ""
},
{
"docid": "7a026194e8948e7d88452ef2dc122be4",
"score": "0.43334737",
"text": "def push(source)\n if source\n if source.kind_of?(Array)\n source.each {|s| self.push(s) }\n elsif source.kind_of?(Container)\n source.all_sources.each {|s| self.push(s) }\n else\n if source.extension?\n @extensions << source unless @extensions.include?(source)\n elsif source.replacement?\n @replacements << source unless @replacements.include?(source)\n else\n @normal_sources << source unless @normal_sources.include?(source)\n end\n end\n end\n clear_cache!\n self\n end",
"title": ""
},
{
"docid": "1730c17b2ee8c9c8a31c5dbd924e58ce",
"score": "0.43208036",
"text": "def map_statements!(&ruby_block)\n @statements.map! do |stmnt|\n stmnt = ruby_block.call(stmnt)\n stmnt.parent = self unless stmnt.parent\n stmnt\n end\n end",
"title": ""
},
{
"docid": "6e54e0e4373f03e4c07f6beb34a2573a",
"score": "0.4310419",
"text": "def allow_if(&block)\n @allow_if << block\n return self\n end",
"title": ""
},
{
"docid": "4b1ff84ef39c070592ae8ce5c1b6ce8b",
"score": "0.43097466",
"text": "def source=(statement); end",
"title": ""
},
{
"docid": "c9aa13cf8aff0b078c46fcf5aae5f3cb",
"score": "0.43065453",
"text": "def map list, &block\n list.map(&block)\nend",
"title": ""
},
{
"docid": "d3a4bad7da8ee059cb187eecb40fc197",
"score": "0.4306476",
"text": "def traverse(parent, &block)\n @source_elements.traverse(self, &block)\n yield parent, self\n end",
"title": ""
},
{
"docid": "2c16c92b600560191e13ad437a2a7cd5",
"score": "0.4303139",
"text": "def cxx_configuration(&block)\n @myblock = block\n @all_blocks = []\n end",
"title": ""
},
{
"docid": "64eb7c8110326bfbdfc5bda8edbbfd0e",
"score": "0.42834494",
"text": "def list_block()\n\nend",
"title": ""
},
{
"docid": "5e1090c9f021df75986e51581e1de0e5",
"score": "0.42813712",
"text": "def setup_list_items\n all_recs = []\n\n item_attribs = source_class.permitted_params\n list_attribs = list_class.permitted_params\n\n matching_attribs = (list_attribs & item_attribs).map(&:to_s)\n raise(FphsGeneralError, 'no matching attributes') if matching_attribs.empty?\n\n source_class.where(id: new_item_ids).each do |item|\n id = item.id\n if item.attribute_names.include? 'master_id'\n master = item.master\n master.current_user = current_user\n end\n matched_vals = item.attributes.slice(*matching_attribs)\n matched_vals[:record_id] = id\n matched_vals[:record_type] = full_source_type_name\n matched_vals[:master_id] = from_master_id unless list_class.no_master_association\n matched_vals[assoc_attr] = list_id\n new_list_instance = list_class.new(matched_vals)\n new_list_instance.send :write_attribute, :user_id, current_user.id\n all_recs << new_list_instance\n end\n all_recs\n end",
"title": ""
},
{
"docid": "7cde3479ba908cb1954b8e15ab33048e",
"score": "0.42802823",
"text": "def map(destination_symbol, source = nil, &transform_block)\n\n source = destination_symbol if source.nil?\n source = source.to_sym if source.is_a? String\n if source.is_a? Symbol\n temp_source = raw_transform_map[source]\n raise \"Input row does not contain symbol #{source}\" unless temp_source\n source = temp_source\n end\n\n raise \"Invalid source specified\" unless source.is_a? Proc\n\n value = transform_block.nil? ?\n guarded(source) :\n guarded(->(row) { transform_block.call(source.call(row)) })\n\n if transform_map[destination_symbol].respond_to? :append_mapping\n transform_map[destination_symbol].append_mapping value\n else\n raise \"#{destination_symbol} appears to have been mapped multiple times, but it is not an array\" unless transform_map[destination_symbol].nil?\n transform_map[destination_symbol] = value\n end\n end",
"title": ""
},
{
"docid": "0a195f7fed03aa76ca67a2cc84666e84",
"score": "0.42798778",
"text": "def on trigger, &block\n @handlers[trigger] = [] unless @handlers.key? trigger\n @handlers[trigger] << block\n end",
"title": ""
},
{
"docid": "c28bf381e219a2c0997fe89c8e263411",
"score": "0.42742434",
"text": "def filtered_copy(src_dir, dest_dir, filters_def = Registry[:filters_def])\n self.copy(:todir => dest_dir.to_s) do\n self.filterset do\n filters_def['filters'].each do |filter|\n token = filter.keys.first\n value = filter[token]\n self.filter(:token => token, :value => value)\n end\n end\n\n filters_def['filtered_files'].each do |includes_pattern|\n self.fileset(:dir => src_dir.to_s, :includes => includes_pattern)\n end\n end\n\n self.copy(:todir => dest_dir.to_s) do\n self.fileset(:dir => src_dir.to_s, :includes => '**/*',\n :excludes => filters_def['filtered_files'].join(','))\n end\n end",
"title": ""
},
{
"docid": "845aed525634052e3fd42dda15084d44",
"score": "0.42722264",
"text": "def each(&block)\n list.each &block\n end",
"title": ""
},
{
"docid": "76bf391ef3438475292cbebee075ad5b",
"score": "0.42673278",
"text": "def __yield\n return if (source = @_undies_source_stack.pop).nil?\n if source.file?\n instance_eval(source.data, source.source, 1)\n else\n instance_eval(&source.data)\n end\n end",
"title": ""
},
{
"docid": "935c921efd237606893441a24dbce39c",
"score": "0.42671746",
"text": "def all(&block)\n @callback_map[:all] = block\n end",
"title": ""
},
{
"docid": "f0ff4fadab45d2f7a6ff45096522187e",
"score": "0.42671284",
"text": "def read(aSource, &aBlock)\n\t\t\t\tdefault_values.each do |k, v|\n\t\t\t\t\tdone = false\n\t\t\t\t\tif block_given? && ((newv = yield(k, v, aSource && aSource[k])) != nil)\n\t\t\t\t\t\tself[k] = newv\n\t\t\t\t\t\tdone = true\n\t\t\t\t\tend\n\t\t\t\t\tcopy_item(aSource, k) if !done && aSource && !aSource[k].nil?\n\t\t\t\tend\n\t\t\t\tself\n\t\t\tend",
"title": ""
},
{
"docid": "4cbbf99504370902118caaa2be18521b",
"score": "0.42527252",
"text": "def copy_depdencies(source_dir, target_dir, &block)\n\tdependecyManager = DependencyManager.new(source_dir, target_dir)\n\tdependecyManager.instance_eval(&block)\n\tdependecyManager.perform_file_copy\nend",
"title": ""
},
{
"docid": "ad2dfee43592d9f6cc82a4fbb9a3652b",
"score": "0.42484972",
"text": "def __yield\n return if @_undies_source_stack.nil? || (source = @_undies_source_stack.pop).nil?\n if source.file?\n instance_eval(source.data, source.source, 1)\n else\n instance_eval(&source.data)\n end\n end",
"title": ""
},
{
"docid": "a8503e86898652beb331a5f18aa3e2da",
"score": "0.42444518",
"text": "def sh4LowerConstPool(list)\n newList = []\n currentPool16 = []\n currentPool32 = []\n list.each {\n | node |\n if node.is_a? Instruction\n case node.opcode\n when \"jmp\", \"ret\"\n newList << node\n if not currentPool16.empty?\n newList << ConstPool.new(codeOrigin, currentPool16, 16)\n currentPool16 = []\n end\n if not currentPool32.empty?\n newList << ConstPool.new(codeOrigin, currentPool32, 32)\n currentPool32 = []\n end\n when \"move\"\n if node.operands[0].is_a? Immediate and not (-128..127).include? node.operands[0].value\n poolEntry = nil\n if (-32768..32767).include? node.operands[0].value\n currentPool16.each { |e|\n if e.value == node.operands[0].value\n poolEntry = e\n end\n }\n if !poolEntry\n poolEntry = ConstPoolEntry.new(codeOrigin, node.operands[0].value, 16)\n currentPool16 << poolEntry\n end\n else\n currentPool32.each { |e|\n if e.value == node.operands[0].value\n poolEntry = e\n end\n }\n if !poolEntry\n poolEntry = ConstPoolEntry.new(codeOrigin, node.operands[0].value, 32)\n currentPool32 << poolEntry\n end\n end\n newList << Instruction.new(codeOrigin, \"move\", [poolEntry, node.operands[1]])\n elsif node.operands[0].is_a? LabelReference\n poolEntry = nil\n currentPool32.each { |e|\n if e.value == node.operands[0].asmLabel\n poolEntry = e\n end\n }\n if !poolEntry\n poolEntry = ConstPoolEntry.new(codeOrigin, node.operands[0].asmLabel, 32)\n currentPool32 << poolEntry\n end\n newList << Instruction.new(codeOrigin, \"move\", [poolEntry, node.operands[1]])\n else\n newList << node\n end\n else\n newList << node\n end\n else\n newList << node\n end\n }\n if not currentPool16.empty?\n newList << ConstPool.new(codeOrigin, currentPool16, 16)\n end\n if not currentPool32.empty?\n newList << ConstPool.new(codeOrigin, currentPool32, 32)\n end\n newList\nend",
"title": ""
},
{
"docid": "d5f4fbee1ed44bf16e730b3a579cd3c8",
"score": "0.42373386",
"text": "def update(source)\n copy(source, false)\n end",
"title": ""
},
{
"docid": "d59121482405887f6b7e5ac99c450638",
"score": "0.42360234",
"text": "def sources *names\n ## reader\n return @sources if names.size == 0\n ## affectation\n names.each do |sname|\n s = @flow.sources(sname)\n @sources << s if s\n raise \"Unknown source #{sname} in monitor #{name}!\" unless s\n end\n end",
"title": ""
},
{
"docid": "f504f395454ef9c7a8cb7811d3e738da",
"score": "0.42321602",
"text": "def anonymous_blocklists; end",
"title": ""
},
{
"docid": "451fef05c196daf1defea40f46686ad3",
"score": "0.422443",
"text": "def initialize_copy(source)\n super\n\n @files = {}\n @directories = {}\n @parent = nil\n\n source.directories.map(&:dup).each do |new_directory|\n add_directory(new_directory)\n end\n\n source.files.map(&:dup).each do |new_file|\n add_file(new_file)\n end\n end",
"title": ""
},
{
"docid": "f2c90aa1f54df467d56e2d75fce6f0af",
"score": "0.42137665",
"text": "def push(block)\n @names[block.name.to_s] ||= []\n @names[block.name.to_s] << block\n end",
"title": ""
},
{
"docid": "c5b951e044a76bc9182ded704a07a36d",
"score": "0.4204771",
"text": "def select_from(list, &instructions)\n list.map do |item|\n if instructions.call(item)\n item\n end\n end.compact\nend",
"title": ""
},
{
"docid": "ba59237c46d29e2121d882c83cfe1a26",
"score": "0.41928813",
"text": "def each_request_target_with_path(&block)\n\t\ttarget_requests('AND wmap_requests.path IS NOT NULL').each do |req|\n\t\t\tblock.call(req)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "510bc0080e035fc78234484e9cd8cf03",
"score": "0.4189474",
"text": "def each(&block)\n @list.each(&block)\n end",
"title": ""
},
{
"docid": "d33c30e2b7327e9e7b3d2bae12bc705b",
"score": "0.41856745",
"text": "def set_url(*raw_urls, &block)\n raw_urls = raw_urls.first if raw_urls.size == 1\n @source.set_url(raw_urls, &block)\n end",
"title": ""
},
{
"docid": "76d300b8dab4487feb40f731b2ab25f4",
"score": "0.41825846",
"text": "def map_nodes!(&ruby_block)\n @statement = ruby_block.call(@statement)\n @statement.parent = self unless @statement.parent\n end",
"title": ""
},
{
"docid": "4a981a62cd9858203d9cebf844282487",
"score": "0.41806346",
"text": "def keeping_connection_proxy(shard, &_block)\n last_block = block\n\n begin\n self.block = shard\n yield\n ensure\n self.block = last_block || nil\n end\n end",
"title": ""
},
{
"docid": "391427bb6d34321c8c6391cf462a5b50",
"score": "0.41791907",
"text": "def update_files(&block)\n \n get_template_entries.each do |entry|\n \n next if entry.directory?\n \n entry.get_input_stream do |is|\n \n data = is.sysread\n \n if CONTENT_FILES.include?(entry.name)\n process_entry(data, &block)\n end\n \n @output_stream.put_next_entry(entry.name)\n @output_stream.write data\n \n end\n end\n end",
"title": ""
},
{
"docid": "ece9e71a3771f6d9c883bd968e6e0457",
"score": "0.41737756",
"text": "def copy_actions\r\n end",
"title": ""
},
{
"docid": "bcf7864a65fcad5ca25f379e3d6e337c",
"score": "0.41736436",
"text": "def source\n\t\t\t@source_config ||= ConfigurationDefinition.new\n\t\t\tyield @source_config if block_given?\n\t\tend",
"title": ""
},
{
"docid": "ab0f7fa24bf927e7c5b41e6ded4fe067",
"score": "0.41716242",
"text": "def update\n sources = Fenix::Store::Converter::Flattener.sources params[:sources]\n respond_to do |format|\n if @host.set_sources sources\n format.html { redirect_to source, notice: 'SourceList was successfully updated.' }\n format.json { render :show, status: :ok, location: source }\n else\n format.html { render :edit }\n format.json { render json: source.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9be64a356e0d3734dd45d15b948b30a1",
"score": "0.41713992",
"text": "def map_inputs!(&ruby_block)\n @inputs.map! do |input|\n input = ruby_block.call(input)\n input.parent = self unless input.parent\n input\n end\n end",
"title": ""
},
{
"docid": "4eeadc032cfce11a121ac06cb8290ec2",
"score": "0.4170884",
"text": "def from(original_action, options = {}, &block)\n return if options.empty?\n @watched_actions ||= []\n @watched_actions << original_action unless @watched_actions.include?(original_action)\n @watched_actions_map ||= {}\n @watched_actions_map[@watched_sources.last] ||= {}\n @watched_actions_map[@watched_sources.last][original_action] ||= []\n action_map = { name: options[:to] }\n action_map[:conditions] = []\n unless options[:conditions].nil?\n if options[:conditions].respond_to?(:each)\n options[:conditions].each do |condition|\n action_map[:conditions] << condition\n end\n else\n action_map[:conditions] << options[:conditions]\n end\n else\n action_map[:conditions] << { if: true }\n end\n action_map[:yield] = block_given? ? block : -> { }\n @watched_actions_map[@watched_sources.last][original_action] << action_map\n end",
"title": ""
},
{
"docid": "8e61de62ecebc255e6762609cfe0cdb2",
"score": "0.41592738",
"text": "def duplicate\n super do |cloned_resource|\n cloned_resource.title = \"Copy #{@resource.title[0...Integral.title_length_maximum - 5]}\"\n cloned_resource.view_count = 0\n cloned_resource.build_active_block_list(content: @resource.active_block_list.content, listable: cloned_resource)\n cloned_resource.tag_list = @resource.tag_list_on(@resource.tag_context)\n cloned_resource.slug = @resource.slug\n cloned_resource.status = :draft\n cloned_resource.published_at = nil\n end\n end",
"title": ""
},
{
"docid": "8d5241afd09b0477583187c084b2aa62",
"score": "0.41580668",
"text": "def <<(block)\n # parent assignment pending refactor\n #block.parent = self\n @blocks << block\n end",
"title": ""
},
{
"docid": "ea1698b77c784f580e31e9341671a3e2",
"score": "0.41580284",
"text": "def add_sources(sources)\n sources_ready = EventMachine::MultiRequest.new\n\n sources.each do |source|\n sources_ready.add(source)\n end\n\n sources_ready.callback do\n sources.each do |source|\n source.proxies.each do |proxy|\n @proxies << proxy unless @proxies.include? proxy\n end\n end\n end\n\n sources_ready\n end",
"title": ""
},
{
"docid": "28e1a06806fa1ed99d83310ab50567fa",
"score": "0.41534865",
"text": "def filter(controller = nil)\n if controller\n reload\n if block_given?\n begin\n yield\n ensure\n reload\n end\n end\n else\n yield if block_given?\n end\n self\n end",
"title": ""
},
{
"docid": "9734829d57a038ecf46638b435f32cea",
"score": "0.41518277",
"text": "def map_events!(&ruby_block)\n @events.map! do |event|\n event = ruby_block.call(event)\n event.parent = self unless event.parent\n event\n end\n end",
"title": ""
},
{
"docid": "4a20fd124b82c9c5a17a3df2929ce56a",
"score": "0.4147928",
"text": "def merge_configurations( list, options = {}, &block )\n invoke_merge = merge_configuration_method( options )\n \n list.inject( format_hash_keys({}) ) do |config, c|\n second = format_hash_keys( block_given? ? yield( c ) : c )\n config.send( invoke_merge, second ) if second\n config\n end\n end",
"title": ""
},
{
"docid": "67757bd484a387eda890e7e881f725c4",
"score": "0.41470724",
"text": "def each(&block)\n @list.each_value &block\n end",
"title": ""
},
{
"docid": "47d12729555b1d6ff605f5b04a3d22ef",
"score": "0.41457143",
"text": "def map_outputs!(&ruby_block)\n @outputs.map! do |output|\n output = ruby_block.call(output)\n output.parent = self unless output.parent\n output\n end\n end",
"title": ""
}
] |
fd07885f05f431413e0a130b6200a085
|
PATCH/PUT /search/1 PATCH/PUT /search/1.json
|
[
{
"docid": "447f1f985b62bc19dc2284d8dc856f5c",
"score": "0.6469013",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { render :show, status: :ok, location: @search }\n else\n format.html { render :edit }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b681a4253fc8413773c218900d6fc8ea",
"score": "0.6872071",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to :root }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "193b99d40d2fce3bdbf6173feaf27c45",
"score": "0.67801315",
"text": "def update\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c0c0ff70ae4a7506462df7956c49ea7",
"score": "0.67640746",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5df48163149b90dd2366ca3aec8183d",
"score": "0.67413795",
"text": "def update\n @search = Search.find(params[:url => @url])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd91dd1e6f4bef7635fab3be5a594447",
"score": "0.66794574",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, :notice => 'Search was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd5b2d7e513c76346008a4a66e1f1175",
"score": "0.66763663",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd5b2d7e513c76346008a4a66e1f1175",
"score": "0.66763663",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd5b2d7e513c76346008a4a66e1f1175",
"score": "0.66763663",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd5b2d7e513c76346008a4a66e1f1175",
"score": "0.66763663",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd5b2d7e513c76346008a4a66e1f1175",
"score": "0.66763663",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd5b2d7e513c76346008a4a66e1f1175",
"score": "0.66763663",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9cffcb3c834c75ff70e19b81970da3",
"score": "0.66479653",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9cffcb3c834c75ff70e19b81970da3",
"score": "0.66479653",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c259fd7606df2df7f36a9d4a07aea938",
"score": "0.66361284",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c259fd7606df2df7f36a9d4a07aea938",
"score": "0.66361284",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c259fd7606df2df7f36a9d4a07aea938",
"score": "0.66361284",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7adac3dd74faa6a772c5ac0d06486c73",
"score": "0.6620144",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "569bc26cc5a6fc1266d1952ad6d7710f",
"score": "0.6585714",
"text": "def update_search(id, params = {})\n put(\"/searches/#{id}\", params)\n end",
"title": ""
},
{
"docid": "e44432ea9612ebc86dcd3222d3c55ace",
"score": "0.6579684",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to after_write_path }\n format.json { render :show, status: :ok, location: @search }\n end\n end\n end",
"title": ""
},
{
"docid": "94098761cc2951c8ed098c913ed8a41f",
"score": "0.6543636",
"text": "def update\n @search = Search.find(params[:id])\n \n # join array params to strings to write to database\n params[:search][:regions] = params[:search][:regions].join(\"; \") unless (params[:search][:regions].class.name == \"String\" || params[:search][:regions].nil?)\n params[:search][:subjects] = params[:search][:subjects].join(\"; \") unless (params[:search][:subjects].class.name == \"String\" || params[:search][:subjects].nil?)\n params[:search][:sizes] = params[:search][:sizes].join(\"; \") unless (params[:search][:sizes].class.name == \"String\" || params[:search][:sizes].nil?)\n \n # set params if they are nil\n params[:search][:regions] ||= \"false\"\n params[:search][:subjects] ||= \"false\"\n params[:search][:sizes] ||= \"false\"\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76fa65e57fb8b58f6126f4e00a7253d8",
"score": "0.6485251",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @search }\n else\n format.html { render action: 'edit' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b251edde12e7a63e573038b5a1e7e29a",
"score": "0.63700336",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to(@search, :notice => 'Search was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b251edde12e7a63e573038b5a1e7e29a",
"score": "0.63700336",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to(@search, :notice => 'Search was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "005cba72b5b43b8201131a0ab2a73627",
"score": "0.63235354",
"text": "def update\n @search = current_search\n @search.step += 1\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to new_search_path }\n # format.json { head :no_content }\n else\n format.html { render \"searches/steps/step#{@search.step - 1}\" }\n # format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2aaa71c66577abaf97b10108b690ef3a",
"score": "0.63120407",
"text": "def update\n @jobsearch = Jobsearch.find(params[:id])\n\n respond_to do |format|\n if @jobsearch.update_attributes(params[:jobsearch])\n format.html { redirect_to @jobsearch, notice: 'Jobsearch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jobsearch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f77e9d5485a7d9a3978ea452c54c8b8a",
"score": "0.6307079",
"text": "def update\n respond_to do |format|\n if @search.update_attributes(params[:search])\n flash[:notice] = 'Search was successfully updated.'\n format.html { redirect_to(@search) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de044ec75b7b302683e37768801847a6",
"score": "0.63041854",
"text": "def update\n respond_to do |format|\n if @api_v1_base_search.update(api_v1_base_search_params)\n format.html { redirect_to @api_v1_base_search, notice: 'Base search was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_base_search }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_base_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dd0108a3d93605fb67339dd8931d5cb",
"score": "0.62446606",
"text": "def update\n\n respond_to do |format|\n if @search.update(saved_search_params)\n notify_user :notice, 'Search was successfully updated.'\n format.html { redirect_back(fallback_location: root_path) }\n format.json { render :show, status: :ok, location: @search }\n else\n notify_user :alert, \"Cannot update this search because: \" + @search.errors.full_messages.join(';')\n format.html { redirect_back(fallback_location: root_path) }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d8ce3ad92473dd978434711c8f0b9ca",
"score": "0.6234548",
"text": "def update\n @search = Search.find(params[:id])\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n flash[:notice] = 'Search was successfully updated.'\n format.html { redirect_to(@search) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ceb26d22705e5bb91ba8dc5df2aec936",
"score": "0.62181485",
"text": "def update\n respond_to do |format|\n if @flexible_search.update(flexible_search_params)\n format.html { redirect_to @flexible_search, notice: 'Flexible search was successfully updated.' }\n format.json { render :show, status: :ok, location: @flexible_search }\n else\n format.html { render :edit }\n format.json { render json: @flexible_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cec45fbaad1252f535385ce7039f0b73",
"score": "0.6201211",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n format.js\n else\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "fc45b8a8bb64bf7ead5fd4363473fbaf",
"score": "0.61969906",
"text": "def update\n expire_action :action => :index\n expire_action :action => :show\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { render :show, status: :ok, location: @search }\n else\n format.html { render :edit }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acbf5b796c7ae3e69b3f02f2a8e76ef2",
"score": "0.61953413",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n @results = @search.results.paginate(:page => params[:page], :per_page => per_page) if @search.present?\n format.html { redirect_to @search }\n format.js\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"title": ""
},
{
"docid": "2e9766ad60c726f3a454f99fcffe7a4b",
"score": "0.6186118",
"text": "def update\n @providers = search_providers\n\n respond_to do |format|\n if @search.update_attributes(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f55fa88202547af122d32c21bbcb8c0e",
"score": "0.6184725",
"text": "def update\n respond_to do |format|\n if @person_search.update(person_search_params)\n format.html { redirect_to @person_search, notice: 'Person search was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_search }\n else\n format.html { render :edit }\n format.json { render json: @person_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cd8c329dac4105ef250f2fc92bbc633",
"score": "0.6171117",
"text": "def update\n @search = Search.find(params[:id])\n @search.selectedRefID = params[:selectedRefID]\n @search.selectedUPC = params[:selectedUPC]\n @search.selectedISBN = params[:selectedISBN]\n @search.pictureUrl = params[:pictureUrl]\n @search.title = params[:title]\n\n respond_to do |format|\n if @search.update_attributes(params[:search])\n session[:search_id] = params[:id]\n format.html { redirect_to price_list_path, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"results\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1a33cfc9913bfd181f4c21117e2fcd4",
"score": "0.61543775",
"text": "def update\n @search = Search.find(params[:id])\n params[:search][:regions] = params[:search][:regions].join(\"; \") unless (params[:search][:regions].class.name == \"String\" || params[:search][:regions].nil?)\n params[:search][:subjects] = params[:search][:subjects].join(\"; \") unless (params[:search][:subjects].class.name == \"String\" || params[:search][:subjects].nil?)\n params[:search][:sizes] = params[:search][:sizes].join(\"; \") unless (params[:search][:sizes].class.name == \"String\" || params[:search][:sizes].nil?)\n \n respond_to do |format|\n if @search.update_attributes(params[:search])\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4fd13967b6bbbb2b0dd33b5b4629c02",
"score": "0.61451274",
"text": "def update\n respond_to do |format|\n if @saved_search.update(saved_search_params)\n format.html { redirect_to @saved_search, notice: 'Saved search was successfully updated.' }\n format.json { render :show, status: :ok, location: @saved_search }\n else\n format.html { render :edit }\n format.json { render json: @saved_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4fd13967b6bbbb2b0dd33b5b4629c02",
"score": "0.61451274",
"text": "def update\n respond_to do |format|\n if @saved_search.update(saved_search_params)\n format.html { redirect_to @saved_search, notice: 'Saved search was successfully updated.' }\n format.json { render :show, status: :ok, location: @saved_search }\n else\n format.html { render :edit }\n format.json { render json: @saved_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4455e4100f0c90d3e797ea35ee279ffe",
"score": "0.61382455",
"text": "def update\n @search = Dog.search(params[:q])\n respond_to do |format|\n if @dog.update(dog_params)\n format.html { redirect_to @dog, notice: 'Dog was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e573b9f9b469ec1b3c0a13167beaf00",
"score": "0.6125714",
"text": "def update(args) # :nodoc:\n # In versions before Splunk 5.0, updating a saved search requires passing \n # a +search+ argument, or it will return an error or set the search to \n # empty. This is fixed in 5.0, but while the 4.x series is supported, we \n # set the search field on args if it's not already set. This, of course, \n # has a race condition if someone else has set the search since the last \n # time the entity was refreshed.\n #\n # You might want to check if \"search\" is in the +requiredFields+ list\n # on the entity, but that isn't always returned.\n if !args.has_key?(:search) && !args.has_key?(\"search\")\n args[:search] = fetch(\"search\")\n end\n super(args)\n end",
"title": ""
},
{
"docid": "24414642fbaddaaf227165f71a268bcd",
"score": "0.61180264",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n @search.locations.destroy_all\n params[:search][:locations_attributes].each do |location|\n @search.locations.create(\n address: location[1][:address],\n lat: location[1][:lat],\n lng: location[1][:lng]\n ) unless !location[1][:address].present?\n end\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n format.json { render :show, status: :ok, location: @search }\n else\n format.html { render :edit }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e9747341948892a61dc0140f70f156f",
"score": "0.61115223",
"text": "def update\n respond_to do |format|\n if @ifs_search.update(ifs_search_params)\n format.html { redirect_to @ifs_searches_path, notice: \"Ifs search was successfully updated.\" }\n format.json { render :show, status: :ok, location: @ifs_search }\n else\n format.html { render :edit }\n format.json { render json: @ifs_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96586e6b731745c168de1fb16b915f88",
"score": "0.60945684",
"text": "def update\n @search_concept = SearchConcept.find(params[:id])\n\n respond_to do |format|\n if @search_concept.update_attributes(params[:search_concept])\n format.html { redirect_to @search_concept, notice: 'Search concept was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search_concept.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9c8589364d123ddff8115265fb40526",
"score": "0.60826087",
"text": "def update\n @opsearch = Opsearch.find(params[:id])\n\n respond_to do |format|\n if @opsearch.update_attributes(params[:opsearch])\n format.html { redirect_to(@opsearch, :notice => 'Opsearch was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @opsearch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0083db7ae507767370e0a572d8daf7a2",
"score": "0.6081968",
"text": "def update\n @search_set = SearchSet.find(params[:id])\n\n respond_to do |format|\n if @search_set.update_attributes(params[:search_set])\n format.html { redirect_to @search_set, notice: 'Search set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "946c415dd9f41331bf0ab3f377ad0820",
"score": "0.6055095",
"text": "def update\n respond_to do |format|\n if @search_box.update(search_box_params)\n format.html do\n redirect_to @search_box, notice: notice_message('updated')\n end\n format.json { render :show, status: :ok, location: @search_box }\n else\n format.html { render :edit }\n format.json do\n render json: @search_box.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6e05debaea43de73c2480e86f0cd38e3",
"score": "0.603627",
"text": "def update!(**args)\n @search_type = args[:search_type] if args.key?(:search_type)\n @values = args[:values] if args.key?(:values)\n end",
"title": ""
},
{
"docid": "5ee0f5719ea67b869c08d177d959a5f1",
"score": "0.6025103",
"text": "def update\n @tire_search = TireSearch.find(params[:id])\n\n respond_to do |format|\n if @tire_search.update_attributes(params[:tire_search])\n format.html { redirect_to '/saved_searches', notice: 'Saved search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tire_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32d904618891374bd007588b408cd909",
"score": "0.60134614",
"text": "def update\n @product_search = ProductSearch.find(params[:id])\n\n respond_to do |format|\n if @product_search.update_attributes(params[:product_search])\n format.html { redirect_to @product_search, :notice => 'Product search was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product_search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d7fd76f9762358695479baa5d53d4c3",
"score": "0.5994841",
"text": "def update\n\n @url = params[:query_url]\n respond_to do |format|\n if @search.update(search_params)\n format.html { redirect_to @search, notice: 'Search was successfully updated.' }\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"title": ""
},
{
"docid": "4e0d1ff4bbcaf7904174ff8f0b7b69d8",
"score": "0.599414",
"text": "def test_update_search\n saved_search_name = temporary_name()\n ss = @service.saved_searches.create(saved_search_name,\n :search => \"search *\")\n\n ss.update(:description => \"boris\",\n :search => \"search index=_internal *\")\n ss.refresh()\n assert_equal(\"boris\", ss[\"description\"])\n assert_equal(\"search index=_internal *\", ss[\"search\"])\n end",
"title": ""
},
{
"docid": "cc8f39c7e4537b9330be5469186b677a",
"score": "0.59491813",
"text": "def update\n @search_key = SearchKey.find(params[:id])\n\n respond_to do |format|\n if @search_key.update_attributes(params[:search_key])\n format.html { redirect_to @search_key, notice: 'Search key was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search_key.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba0a4e2abd8bcd59ec6970968e9a159b",
"score": "0.59352297",
"text": "def update\n @search_type = SearchType.find(params[:id])\n\n respond_to do |format|\n if @search_type.update_attributes(params[:search_type])\n format.html { redirect_to @search_type, notice: 'Search type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8644a0e24cc2fd229c06e30fd18e5757",
"score": "0.59317213",
"text": "def update\n respond_to do |format|\n if @search_query.update(search_query_params)\n format.html { redirect_to @search_query, notice: 'Search query was successfully updated.' }\n format.json { render :show, status: :ok, location: @search_query }\n else\n format.html { render :edit }\n format.json { render json: @search_query.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8644a0e24cc2fd229c06e30fd18e5757",
"score": "0.59317213",
"text": "def update\n respond_to do |format|\n if @search_query.update(search_query_params)\n format.html { redirect_to @search_query, notice: 'Search query was successfully updated.' }\n format.json { render :show, status: :ok, location: @search_query }\n else\n format.html { render :edit }\n format.json { render json: @search_query.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1a746e1a3426e5ed95a291fc7196d89",
"score": "0.59131604",
"text": "def update\n respond_to do |format|\n if @apartment_search.update(apartment_search_params)\n format.html { redirect_to @apartment_search, notice: 'Apartment search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @apartment_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9958052a7d02eea0c91ffa522ce4d1d",
"score": "0.5898348",
"text": "def update\n @motor_search = Motor::Search.find(params[:id])\n\n respond_to do |format|\n if @motor_search.update_attributes(params[:motor_motor_search])\n format.html { redirect_to @motor_search, notice: 'Motor search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @motor_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a3462c4765a0fadca5fa37452ab76ee",
"score": "0.589371",
"text": "def update\n @visit_search = VisitSearch.find(params[:id])\n\n respond_to do |format|\n if @visit_search.update_attributes(params[:visit_search])\n format.html { redirect_to @visit_search, notice: 'Visit search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @visit_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e2829225ecc2edae33e05ad51ecdeae",
"score": "0.58769906",
"text": "def update\n @search_string = SearchString.find(params[:id])\n\n respond_to do |format|\n if @search_string.update_attributes(params[:search_string])\n format.html { redirect_to @search_string, notice: 'Search string was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search_string.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "747202b290551814e62c0f54f776ccfc",
"score": "0.5871243",
"text": "def update\n @searchre = Searchre.find(params[:id])\n\n respond_to do |format|\n if @searchre.update_attributes(params[:searchre])\n format.html { redirect_to @searchre, notice: 'Searchre was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @searchre.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b70e6f959a05557f20a57684d02b865",
"score": "0.5870732",
"text": "def update\n respond_to do |format|\n if @result.update(search_params)\n format.html { redirect_to @result, notice: 'Result was successfully updated.' }\n format.json { render :show, status: :ok, location: @result }\n else\n format.html { render :edit }\n format.json { render json: @result.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d623a270da8d6f4155066ea8cd7f957",
"score": "0.5857448",
"text": "def update\n respond_to do |format|\n if @searchv.update(searchv_params)\n format.html { redirect_to @searchv, notice: 'Searchv was successfully updated.' }\n format.json { render :show, status: :ok, location: @searchv }\n else\n format.html { render :edit }\n format.json { render json: @searchv.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bb96bde9eddf95ee29bffe68fee485f",
"score": "0.5850621",
"text": "def update\n @search_engine = SearchEngine.find(params[:id])\n\n respond_to do |format|\n if @search_engine.update_attributes(params[:search_engine])\n format.html { redirect_to @search_engine, notice: 'Search engine was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @search_engine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c85655bad1be1994b96f9ff19dd80e8e",
"score": "0.5824005",
"text": "def update\n respond_to do |format|\n if @search_item.update(search_item_params)\n format.html { redirect_to @search_item, notice: 'Search item was successfully updated.' }\n format.json { render :show, status: :ok, location: @search_item }\n else\n format.html { render :edit }\n format.json { render json: @search_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84fc98bc85c9f0bc939cd178fcd88424",
"score": "0.58125013",
"text": "def update\n @dynamic_search = DynamicSearch.find(params[:id])\n\n respond_to do |format|\n if @dynamic_search.update_attributes(params[:dynamic_search])\n flash[:notice] = 'DynamicSearch was successfully updated.'\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n else\n format.html { render :action => \"index\" }\n format.xml { render :xml => @dynamic_search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67a11a7d30a0986c60e93dd765197ba9",
"score": "0.58032453",
"text": "def update\n @search_bin = SearchBin.find(params[:id])\n\n respond_to do |format|\n if @search_bin.update_attributes(params[:search_bin])\n format.html { redirect_to @search_bin, :notice => 'Search bin was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @search_bin.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44ba583bc91c7fca6b5ff6a8c205a8dd",
"score": "0.5802765",
"text": "def update\n respond_to do |format|\n if @custom_search_engine.update_attributes(params[:custom_search_engine])\n flash[:success] = I18n.t('human.success.update', item: I18n.t('human.text.cse'))\n format.html { redirect_to cse_path(@custom_search_engine) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom_search_engine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1d4fb3fbc2c66bcb55b1a942b0c6649",
"score": "0.5796801",
"text": "def index document = {}, params = {}\n params[:doc] = document\n uri = uri_by_appending('update')\n response = http_client.post(uri + '?wt=json', {\n add: params\n })\n yield JSON.parse(response.body) if block_given? && response.code == 200.to_s\n response\n end",
"title": ""
},
{
"docid": "209e0c59bad3299ff4b30b062a8c5631",
"score": "0.5791465",
"text": "def update!(**args)\n @linked_resource = args[:linked_resource] if args.key?(:linked_resource)\n @relative_resource_name = args[:relative_resource_name] if args.key?(:relative_resource_name)\n @search_result_subtype = args[:search_result_subtype] if args.key?(:search_result_subtype)\n @search_result_type = args[:search_result_type] if args.key?(:search_result_type)\n end",
"title": ""
},
{
"docid": "768551b9da9f81e8323fb282843c3c6f",
"score": "0.57787263",
"text": "def update\n @json = Json.find(params[:id])\n\n if @json.update(json_params)\n head :no_content\n else\n render json: @json.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3b96fff625d278f3de0432ef5785d7c3",
"score": "0.577703",
"text": "def update(*args)\n respond_to do |format|\n if @object.update_attributes(params[@model_path.gsub('-', '_')]) #NOTE may be use just write on id without find before?\n format.html { redirect_to ooorest.index_path, notice: \"successfully update\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @object.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6eeca78cc935860962053c65bd0c0bbb",
"score": "0.57677543",
"text": "def update\n @flickr_search = FlickrSearch.find(params[:id])\n\n respond_to do |format|\n if @flickr_search.update_attributes(params[:flickr_search])\n flash[:notice] = 'FlickrSearch was successfully updated.'\n format.html { redirect_to(flickr_searches_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @flickr_search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3800deb48f8aab5ea8b1266c1a15a2f9",
"score": "0.57677305",
"text": "def update!(**args)\n @files = args[:files] if args.key?(:files)\n @incomplete_search = args[:incomplete_search] if args.key?(:incomplete_search)\n @kind = args[:kind] if args.key?(:kind)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
},
{
"docid": "b02f5a73cafcf032137ede5fc920e9d3",
"score": "0.5767029",
"text": "def update\n respond_to do |format|\n if @yelp_search.update(yelp_search_params)\n format.html { redirect_to @yelp_search, notice: 'Yelp search was successfully updated.' }\n format.json { render :show, status: :ok, location: @yelp_search }\n else\n format.html { render :edit }\n format.json { render json: @yelp_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.57623255",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "4652aa5690801ce64040f4416ec92cd6",
"score": "0.575928",
"text": "def update\n respond_to do |format|\n if @advanced_search.update(advanced_search_params)\n format.html { redirect_to @advanced_search, notice: \"Advanced search was successfully updated.\" }\n format.json { render :show, status: :ok, location: @advanced_search }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @advanced_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "965b7c6ff6f3f5e55562b0c9f0e06df1",
"score": "0.5758471",
"text": "def update\n @saved_search = SavedSearch.find(params[:id])\n\n respond_to do |format|\n if @saved_search.update_attributes(params[:saved_search])\n format.html { redirect_to(@saved_search, :notice => 'Saved search was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @saved_search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69f0d39a7ca300f84696e32e6a561892",
"score": "0.5754574",
"text": "def update\n respond_to do |format|\n if @search.update(search_params)\n if @search.model == \"Prize\"\n format.html { redirect_to search_path(@search, format: 'pdf'), notice: 'Search Results:' }\n format.json { render :show, status: :ok, location: @search }\n else\n format.html { redirect_to @search, notice: 'Search Results:' }\n format.json { render :show, status: :ok, location: @search }\n end\n else\n format.html { render :edit }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n if @search.select.include?(\"titlei\") || @search.select.include?(\"sonicpartner\")\n if @search.search.include?(\"yes\")\n @search.search = true\n @search.save!\n else\n @search.search = false\n @search.save!\n end\n end\n end\n end",
"title": ""
},
{
"docid": "65bfbce0961ffed6613058a0dc2ec3dd",
"score": "0.5753613",
"text": "def update\n respond_to do |format|\n if @value_for_search.update(value_for_search_params)\n format.html { redirect_to @value_for_search, notice: 'Value for search was successfully updated.' }\n format.json { render :show, status: :ok, location: @value_for_search }\n else\n format.html { render :edit }\n format.json { render json: @value_for_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "486ab0666f1d33158fd38b18b493a8c8",
"score": "0.5750166",
"text": "def update\n @search_index = SearchIndex.find(params[:id])\n\n respond_to do |format|\n if @search_index.update_attributes(params[:search_index])\n flash[:notice] = 'SearchIndex was successfully updated.'\n format.html { redirect_to(@search_index) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @search_index.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.5744566",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "d591867673105c05cfedb26ba67418e2",
"score": "0.5742392",
"text": "def update_internal_search\n @resource&.identifier&.update_search_words!\n end",
"title": ""
},
{
"docid": "dbdb2cfe3b46116f7ec83ff33fd7e381",
"score": "0.5741953",
"text": "def update document = {}, params = {}\n unless document[:id].nil? || document[:id].match(/^\\*/i)\n delete('id:' + document[:id])\n end\n\n response = index(document, params)\n yield JSON.parse(response.body) if block_given? && response.code == 200.to_s\n response\n end",
"title": ""
},
{
"docid": "b2d5fc83a907f25e5176864fa6beb3d0",
"score": "0.5739345",
"text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end",
"title": ""
},
{
"docid": "72316b119cd82d8b4f91d0a15506ea59",
"score": "0.573756",
"text": "def update\n respond_to do |format|\n\n unless @company.nil?\n rdf = getJsonld(@company[:content]).to_json\n usdl = getJsonld(@company[:usdl]).to_json\n #puts \"sending to elasticsearch@#{ENV['elastic_search_ip']}\"\n @es_client.index index: 'companies', type: 'rdf', id: @copmany.name, body: rdf\n @es_client.index index: 'companies', type: 'usdl', id: @company.name, body: usdl\n @company.json = rdf\n end\n if @company.update(company_params)\n\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6f5ed150cd34d182eb80fd8e9858d4f",
"score": "0.572853",
"text": "def update\n @t_search = TSearch.find(params[:id])\n\n respond_to do |format|\n if @t_search.update_attributes(params[:t_search])\n flash[:notice] = 'TSearch was successfully updated.'\n format.html { redirect_to(@t_search) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @t_search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2c22063cd7628a5c5dc8cc6371f36cd",
"score": "0.57252544",
"text": "def update\n @site_search = SiteSearch.find(params[:id])\n\n respond_to do |format|\n if @site_search.update_attributes(params[:site_search])\n format.html { redirect_to @site_search, notice: 'Site search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5e03a850370a5043760361eb7fae7c1",
"score": "0.5723301",
"text": "def update\n @searchresult = Searchresult.find(params[:id])\n\n respond_to do |format|\n if @searchresult.update_attributes(params[:searchresult])\n format.html { redirect_to @searchresult, notice: 'Searchresult was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @searchresult.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01e696332e1500a5f50208cc5d0fa381",
"score": "0.5722134",
"text": "def update\n respond_to do |format|\n if @car_search.update(car_search_params)\n format.html { redirect_to @car_search }\n format.json { render :show, status: :ok, location: @car_search }\n else\n format.html { render :edit }\n format.json { render json: @car_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f86187f68b00f56fc8537950c9b02b1",
"score": "0.57197624",
"text": "def update!(**args)\n @linked_resource = args[:linked_resource] if args.key?(:linked_resource)\n @modify_time = args[:modify_time] if args.key?(:modify_time)\n @relative_resource_name = args[:relative_resource_name] if args.key?(:relative_resource_name)\n @search_result_subtype = args[:search_result_subtype] if args.key?(:search_result_subtype)\n @search_result_type = args[:search_result_type] if args.key?(:search_result_type)\n end",
"title": ""
},
{
"docid": "633629acf6a77811ea51a1c0f5fb7122",
"score": "0.5713624",
"text": "def update\n respond_to do |format|\n if @google_search.update(google_search_params)\n format.html { redirect_to @google_search, notice: 'Google search was successfully updated.' }\n format.json { render :show, status: :ok, location: @google_search }\n else\n format.html { render :edit }\n format.json { render json: @google_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
1cca383443ea76374b40c5fe7478563d
|
User doesn't want to order
|
[
{
"docid": "98cbb9e01a79a1eb41d0a2e76b653235",
"score": "0.0",
"text": "def pass(sender)\n reply \"Okay, if you say so... (foreveralone)\"\n\n add_to_hash(sender, \"Not ordering\", store['orders_hash'])\n end",
"title": ""
}
] |
[
{
"docid": "c51c8c497fddd5cb84e581768c801d5a",
"score": "0.7020395",
"text": "def order_placed_online?\n !( self.is_not_halouser? || user_intakes.blank? || user_intakes.first.order.blank? )\n end",
"title": ""
},
{
"docid": "4049cb28f512f4427955f97c27369afb",
"score": "0.68872947",
"text": "def no_order!\n @orders = []\n end",
"title": ""
},
{
"docid": "2fd87ef0720d45277de5ed2c923c7936",
"score": "0.6747203",
"text": "def cannot_edit(_order)\n !session[:is_administrator] && _order.id < 5\n end",
"title": ""
},
{
"docid": "5684c9d140f1ee60018f835b6672dda9",
"score": "0.6743188",
"text": "def cannot_edit(_order)\n !session[:is_administrator] && _order.id < 100\n end",
"title": ""
},
{
"docid": "855dc159b0b04b0b337ccca02db62a01",
"score": "0.6635281",
"text": "def not_only_on_order?(access_data)\n access_data.include?('On Order') && access_data.length > 1\n end",
"title": ""
},
{
"docid": "5cb66b9d135804d02d603c3cc3177628",
"score": "0.6629846",
"text": "def cannot_edit(_order)\n !session[:is_administrator] && !_order.approver_id.blank?\n end",
"title": ""
},
{
"docid": "eece37393b554fb9601be8639f06e2a0",
"score": "0.6628954",
"text": "def compete_in_order?\n false\n end",
"title": ""
},
{
"docid": "8725211ed68b6dfeb077fe0212d053cb",
"score": "0.66105324",
"text": "def ordered?\n false\n end",
"title": ""
},
{
"docid": "a16b9a0461e52134bc77ca92215216ce",
"score": "0.65815866",
"text": "def compete_in_order\n false\n end",
"title": ""
},
{
"docid": "840d97111d07ae1c2c349d695e210637",
"score": "0.65807533",
"text": "def not_heard_by(user)\n random_order.id_not_in(user.listened_to_ids)\n end",
"title": ""
},
{
"docid": "7183c9ad12fbd31f397d4cf3112bf456",
"score": "0.6563897",
"text": "def unpaid_order(user_id = self.owner.id)\n result = orders.where(\"paid_on IS NULL AND user_id = ? AND reorder_id IS NULL\", user_id)\n return (result.any?) ? result.first : false\n end",
"title": ""
},
{
"docid": "5ef4b9165fe8b600866fb5305c8fe74f",
"score": "0.65575683",
"text": "def is_only_placed_order(user_id)\n Spree::Order.where(user_id: user_id).first.id == self.id\n end",
"title": ""
},
{
"docid": "2c04afea1beb13390bf95fb7566bacb7",
"score": "0.64596415",
"text": "def bought_by?(user)\n order && order.bought_by?(user)\n end",
"title": ""
},
{
"docid": "5a6039faa9fc6125bc3626675e74e3d6",
"score": "0.6443765",
"text": "def disable_orders\n flash[:error] = \"Bestellungen sind aktuell nicht mehr erforderlich. Sie können ab Di. den 9.3. innerhalb der Öffnungszeiten wieder Medien aus dem Freihandbestand vor Ort ausleihen.\"\n redirect_to(root_path)\n false\n end",
"title": ""
},
{
"docid": "2f4b36a79b56c02f657c125ad15e37f9",
"score": "0.6400898",
"text": "def tasks_that_are_not_yours\n Task.all.select{ |task| task.user != current_user }.reverse\n end",
"title": ""
},
{
"docid": "59f462bf5efcdd41dd32a83d679a44b5",
"score": "0.63671863",
"text": "def not_collected_order(order)\n\n\t\tprevious_state = order.state\n\n\t\torder.state = 'not_collected'\n\t\torder.save\n\n\t\t# send pusher notification for mobi site\n \tPusher.app_id = '37591'\n \tPusher.key = 'be3c39c1555da94702ec'\n \tPusher.secret = 'deae8cae47a1c88942e1'\n \tPusher['order'].trigger('not_collected', {:user_id => \"#{order.customer.id}\",:message => \"Your order: #{order.number} was not collected at #{order.store.store_name}. Please contact the store at #{order.store.manager_contact}.\"})\n\t\t\n StateEvent.create({\n :previous_state => previous_state,\n :next_state => '',\n :name => 'order',\n :user_id => self.id,\n :stateful_id => order.id,\n :stateful_type => 'order'\n })\n\n\t\torder.format_for_web_serivce\n\tend",
"title": ""
},
{
"docid": "f7458e6740ef86ae6bbf2f07358d08b1",
"score": "0.6358398",
"text": "def locked_if_order_submitted\n return false if self.logistics_order.submitted\n end",
"title": ""
},
{
"docid": "1d546082e5844066a5a9c81975fd551a",
"score": "0.6294696",
"text": "def broken_court_order?\n false\n end",
"title": ""
},
{
"docid": "751fb213b75b39854299032070173191",
"score": "0.62911373",
"text": "def not_available_items\n flag = false\n items = Item.all\n items.each do |i|\n if i.user_id && i.user_id != current_user.id\n flag = true\n break\n end\n end\n flag\n end",
"title": ""
},
{
"docid": "102e0fcb269a94c7f1e52e2f28d16164",
"score": "0.62595004",
"text": "def order?\n !!order\n end",
"title": ""
},
{
"docid": "cc95ece224550a8c74a38b4645b29e42",
"score": "0.62589556",
"text": "def only_if_mine\n if !current_user and @order.user\n redirect_to login_path(:order_id=>@order.id)\n return\n end\n unless @order.mine?(current_user, session[:order_token])\n flash[:error] = \"Whoa! That's not yours.\"\n redirect_to new_shop_order_path(@order.shop)\n end\n end",
"title": ""
},
{
"docid": "cb8f50868754860ea24bd9ff9bd93dce",
"score": "0.6248706",
"text": "def void_order(order)\n end",
"title": ""
},
{
"docid": "facb03945bc399ad3f0ef71ee491fd15",
"score": "0.62359387",
"text": "def has_allow_order?\r\n self.respond_to? :allow_order\r\n end",
"title": ""
},
{
"docid": "107e3dbc145a73dc9dd11c5bb7d708f7",
"score": "0.6198742",
"text": "def cannot_edit(_order)\n !session[:is_administrator] && _order.work_order_status_id == WorkOrderStatus::CLOSED\n end",
"title": ""
},
{
"docid": "ba4a40dcce8b6b4f320629913e899afd",
"score": "0.6147403",
"text": "def orders?\n return false unless orders.any?\n end",
"title": ""
},
{
"docid": "8af8b72f85afb5c9f258bd1b05d2b57a",
"score": "0.6119055",
"text": "def check_order_lock\n ords = @incident.orders\n redirect_to orders_path unless (ords.empty? || ords.inject(true) {|state,ord| state && ord.declined?})\n end",
"title": ""
},
{
"docid": "4e53868f7c2351ae5a28e36fce20eee6",
"score": "0.61014235",
"text": "def ensure_not_used_by_locked_orders\n return false if quantity_issued > 0\n\n return true\n end",
"title": ""
},
{
"docid": "35e52fd9667e911b6aa41bfbcaaf8e03",
"score": "0.60885817",
"text": "def guard_continue_shopping\n true\n end",
"title": ""
},
{
"docid": "46c21d8955e7b6343c1859dc3d231073",
"score": "0.6068784",
"text": "def orders?\n return false unless orders.any?\n end",
"title": ""
},
{
"docid": "230da61580358abe1cd2e3f6cd82daeb",
"score": "0.6060531",
"text": "def order_items_permission\n if (!customer_signed_in? && !admin_signed_in?) || (customer_signed_in? && Order.find(params[:id]).customer_id != current_customer.id)\n return false\n end \n end",
"title": ""
},
{
"docid": "cd666677dca85b18efd4924f861f7a0c",
"score": "0.6042186",
"text": "def give_order(order_name)\n if Rules.allowed_orders(self).include?(order_name)\n update!(order: order == order_name ? \"none\" : order_name)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "9013c76fd66ed74abc5a162bc204b971",
"score": "0.60405177",
"text": "def correct_order\n @user = User.find(params[:user_id])\n redirect_to(root_url) unless current_user?(@user)\n end",
"title": ""
},
{
"docid": "3896906004339dd835d07505cab96d2c",
"score": "0.60278004",
"text": "def unpaid_reorder(old_order_id, user_id = self.owner.id)\n reorders = orders.where(\"paid_on IS NULL AND reorder_id = ? AND user_id = ?\", old_order_id, user_id)\n return (reorders.any?) ? reorders.last : false\n end",
"title": ""
},
{
"docid": "ca99958c5ffaba2bb0006aaabc402081",
"score": "0.59932494",
"text": "def inactive\n @users = @users.all.select{|u| u if u.payment_status == false }.sort_by{ |u| -u.delinquency }\n end",
"title": ""
},
{
"docid": "db102c2fcf67d79b4f0a6af704a0296e",
"score": "0.5985389",
"text": "def purchase_order?\n true \n end",
"title": ""
},
{
"docid": "db102c2fcf67d79b4f0a6af704a0296e",
"score": "0.5985389",
"text": "def purchase_order?\n true \n end",
"title": ""
},
{
"docid": "03dba47a38d8ff680fa736c0643901c2",
"score": "0.5976448",
"text": "def may_not_be_user_required\n\t\tcurrent_user.may_not_be_user?(@user) || access_denied(\n\t\t\t\"You may not be this user to do this\", user_path(current_user))\n\tend",
"title": ""
},
{
"docid": "d44e3b2d1d018aba9676679a2de705c1",
"score": "0.5970917",
"text": "def buyer_dispute_order_cancelled(user)\n\t\t@user = user\n\t\t@url = 'http://badaboum-prod.herokuapp.com/users/sign_in'\n\t\tmail(to: @user.email, subject: 'Litige traité sur Badaboum - achat annulé')\n\tend",
"title": ""
},
{
"docid": "025dfafa792edfbd7c040b086dc36deb",
"score": "0.5961313",
"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": "d558b65c2f8ed7ce319324c0dc1ddb6f",
"score": "0.59573966",
"text": "def skippable?\n !required\n end",
"title": ""
},
{
"docid": "10107b1e66eb67494d9dd68a239e514f",
"score": "0.59515417",
"text": "def without_user\n @without_user = true\n end",
"title": ""
},
{
"docid": "80a680470b3e8d405546e3d8c36bfef6",
"score": "0.5950819",
"text": "def not_autorized!\n\t\t\tend",
"title": ""
},
{
"docid": "2d63cde1c1dbe316511c2aeff669ade3",
"score": "0.59487295",
"text": "def index\n @orders = Order.where.not(:order_status => \"cart\")\n # console\n\n end",
"title": ""
},
{
"docid": "5cace9dfeddd4c959f1ca5098bee4103",
"score": "0.5928906",
"text": "def available_for_order?(_order)\n true\n end",
"title": ""
},
{
"docid": "274cd34e06635d19a5991a98143f5787",
"score": "0.592554",
"text": "def has_pending_order\n if current_user.active_orders_count > 0\n redirect_to current_user.orders.first,\n flash: { notice: 'Tienes un pedido pendiente.' }\n end\n end",
"title": ""
},
{
"docid": "e91054ee0fad61bd2fa6df9c97135ddc",
"score": "0.59107995",
"text": "def index\n \n @orders = Order.all\n redirect_to(root_path) unless current_user.email == \"ud@thetraces.com\"\n\n #solution http://stackoverflow.com/questions/6050670/preventing-other-signed-in-users-from-accessing-edit-page\n\n #unless @Order.user.email == \"ud@thetraces.com\"\n \n \n #flash[:notice] = \"You don't have access to this page\"\n #redirect_to root_path\n #redirect_to customers_path(session[:customer_id])\n \n #end\n end",
"title": ""
},
{
"docid": "665750e1a8afd3af88af5d88a18c6f15",
"score": "0.59105766",
"text": "def destroyable?\n order_items.empty?\n end",
"title": ""
},
{
"docid": "b4c1090fe2f6fbe1a01517747517dccb",
"score": "0.59036314",
"text": "def others_from_this_owner\n Tool.where(\"user_id = ? AND id <> ?\", user_id, id).order(:name)\n end",
"title": ""
},
{
"docid": "f68fa61e5b706c69a974ef7968ce451e",
"score": "0.58978647",
"text": "def has_ordered?(user)\n self.orders.find_by(user_id: user.id)\n end",
"title": ""
},
{
"docid": "b37eab18e85238b4d792faaf5cbfed64",
"score": "0.58910626",
"text": "def can_delete?\n orders.empty?\n end",
"title": ""
},
{
"docid": "b3996716d6e85f90926d906afe28f536",
"score": "0.58908594",
"text": "def custom_order\n nil\n end",
"title": ""
},
{
"docid": "e6efb3b2e77dca278f6291f031e75227",
"score": "0.5875262",
"text": "def nag\n nagged = false\n nag_string = \"Order something,\"\n\n current_users.each do |user|\n if (store['orders_hash'][user.intern].nil? ||\n store['orders_hash'][user.intern].empty?) &&\n user != connection.config.nick\n nagged = true\n nag_string << \" @#{user}\"\n end\n end\n\n if nagged\n # If we need to nag people, send it out!\n reply nag_string\n else\n # Otherwise everyone has placed their orders in\n finish\n end\n end",
"title": ""
},
{
"docid": "f2f5efd95ac313b47238b7c82442ff23",
"score": "0.58752406",
"text": "def trying_to_takeover\n @user.email == 'ozelen@djerelo.info' && current_user.email != 'ozelen@djerelo.info'\n end",
"title": ""
},
{
"docid": "c3c0bfd3abed98f3400df7c18c0db112",
"score": "0.5872905",
"text": "def ordered?\n self.status == 'ordered'\n end",
"title": ""
},
{
"docid": "b3b27a95df51baf9118705021c8e9893",
"score": "0.587027",
"text": "def check_order\n if order.order_lines.count == 0\n order.destroy\n end\n end",
"title": ""
},
{
"docid": "8de86e0d150d7272767b2667fb80e30d",
"score": "0.5863477",
"text": "def user_not_yet_order(user, reason)\n @user = user\n @reason = reason\n mail(:to => user.email, :subject => \"[Homeaste] Refound Notify\")\n end",
"title": ""
},
{
"docid": "0527bc2b81be741a084ae510c4e4ce99",
"score": "0.58611387",
"text": "def ordered?\n true\n end",
"title": ""
},
{
"docid": "e46177d66e1fefa2239af006bfb2737c",
"score": "0.58464366",
"text": "def purchase_order?\n true\n end",
"title": ""
},
{
"docid": "c74e6225e9dacb2a3f6d022f019d0e6b",
"score": "0.58453876",
"text": "def orders_show\n redirect_to home_path if current_user.id != Order.find(params[:id]).user_id\n end",
"title": ""
},
{
"docid": "bc18c88079eef02d2586f12a932fbd6b",
"score": "0.5833338",
"text": "def expect_no_misapplication\n order = build(:order)\n order.set_quantity(@exclusive_sku, rand(5) + 1)\n order.apply_promotions!\n\n expect(order.applied_promotions.map(&:promotion).empty?).to eq(true)\n end",
"title": ""
},
{
"docid": "e9d134f002f26b3622527b2b16d5409f",
"score": "0.5820553",
"text": "def other_orders\n item.orders.where('id != ?', id || -1)\n end",
"title": ""
},
{
"docid": "19d3903c6925a20157670d8f95c7a818",
"score": "0.58182174",
"text": "def ensure_user_cancels_own_trade_orders\n ensure_user_owns_trade_order :trade_order_id\n end",
"title": ""
},
{
"docid": "7de9b691db10cb45d24b9efa458738c7",
"score": "0.5791748",
"text": "def fill_allowed?(order = @order)\n # return false if (order.order_status.nil?) # This can be removed; needed because of bad data in DEV\n # Only Admin can edit, status must be New\n return true if (admin_user? && (order.order_status_id == 1))\n return false\n end",
"title": ""
},
{
"docid": "c8a261a1dc0c9a7060b076201922749c",
"score": "0.5791128",
"text": "def allow_destroy\n return true if (admin_user? && (@order.order_status_id <= 2))\n return true if (logged_in? && (@order.order_status_id == 1))\n destroy_denied\n end",
"title": ""
},
{
"docid": "3947627e0d44e94f24ac7242895f8f57",
"score": "0.5786735",
"text": "def myorders\n @orders = current_user.orders.where(delivered_at: nil)\n end",
"title": ""
},
{
"docid": "b5766ff4c838eab5f1f1d7aa4124435d",
"score": "0.5783581",
"text": "def eligible?(order, _options = {})\n return false unless order.user\n\n nth_order?(order)\n end",
"title": ""
},
{
"docid": "7d146529de24665fbfbc64f44e64dbf1",
"score": "0.57709527",
"text": "def fill_allowed?(order = @order)\n #return false if (order.order_status.nil?) # This can be removed; needed because of bad data in DEV\n # Only Admin can edit, status must be New\n return true if (admin_user? && (order.order_status_id == 1))\n return false\n end",
"title": ""
},
{
"docid": "4bdb04854376c91079b070149dcf0226",
"score": "0.57686913",
"text": "def unpaid?\n false\n end",
"title": ""
},
{
"docid": "feff88127174da1ea8749d99e1df5b5f",
"score": "0.5762234",
"text": "def locked?\n orders_count > 0\n end",
"title": ""
},
{
"docid": "4269b6662cb58654f6333eae5c78ff9e",
"score": "0.57572746",
"text": "def complete_order\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "cecfe39fdd58ec3cbb7e903cfb3608c7",
"score": "0.5735055",
"text": "def skip_troop? troop\n false\n end",
"title": ""
},
{
"docid": "8d7a20b266c5d7a4caeef46590af047f",
"score": "0.57242626",
"text": "def require_order\n @order = current_order\n\n return if @order\n\n redirect_to(\n {controller: \"basket\", action: \"index\"},\n notice: \"We couldn't find an order for you.\"\n )\n end",
"title": ""
},
{
"docid": "0ccdcf54f275fe294ac3ca582eeffb2d",
"score": "0.5715583",
"text": "def index\n @orders = Order.where.not(currior_number: \"Delivered\")\n end",
"title": ""
},
{
"docid": "69e0ec33573ba2ad94fb73cfd69e4eeb",
"score": "0.57032037",
"text": "def set_order\n if params[:uid].blank?\n render text: 'uid is required', status: :bad_request\n return false\n end\n @order = Order.find_by uid: params[:uid]\n if @order.user_id != current_user.id\n render :status => :forbidden, :text => \"Forbidden\"\n return false\n end\n end",
"title": ""
},
{
"docid": "980e9d8337692a8e36aa6910828fba45",
"score": "0.5701084",
"text": "def available_items\n flag = false\n items = Item.all\n items.each do |i|\n if !i.user_id\n flag = true\n break\n end\n end\n flag\n end",
"title": ""
},
{
"docid": "5f393c987e50d45384f9e4f304bfc916",
"score": "0.5701033",
"text": "def ensure_not_referenced_by_any_order_item\n unless order_items.empty?\n errors.add(:base, 'Popote en commande !')\n throw :abort\n end\n end",
"title": ""
},
{
"docid": "a9683c1c63dfd856cc55410f2985b3f8",
"score": "0.5700178",
"text": "def toggle_order_status?\n if status == \"placed\" && checkout_date.nil?\n self.checkout_date = DateTime.now\n elsif status == \"unplaced\" \n if self.checkout_date.nil? || new_cart_allowed? \n self.checkout_date = nil\n else\n errors.add(:base, \"This user already has one unplaced order!\")\n false\n end\n end \n end",
"title": ""
},
{
"docid": "9fa4f82575c260f57f999c40f55fa158",
"score": "0.5685419",
"text": "def can_modify_order?(order)\n\t\t(order.status == :pending && current_user.access_allowed?(:order_processing)) ||\n\t\t(order.status == :open && (current_user == order.user || current_user.access_allowed?(:order_processing)))\n\tend",
"title": ""
},
{
"docid": "952ef277ee431cc01db1d5128485fb1a",
"score": "0.567008",
"text": "def ensure_not_referenced_by_any_order_item\n\n if order_items.count.zero?\n return true\n else\n errors.add(:base, 'Order Items present')\n return false\n end\n\n end",
"title": ""
},
{
"docid": "952ef277ee431cc01db1d5128485fb1a",
"score": "0.567008",
"text": "def ensure_not_referenced_by_any_order_item\n\n if order_items.count.zero?\n return true\n else\n errors.add(:base, 'Order Items present')\n return false\n end\n\n end",
"title": ""
},
{
"docid": "176820fc0760ca235d6d4cfaac9ab58d",
"score": "0.56621563",
"text": "def order_canceled?\n is_order? && order_params['status'] == 'canceled'\n end",
"title": ""
},
{
"docid": "b9e58b89b5a6af96b03aa4dc666d6d55",
"score": "0.5660863",
"text": "def pickup_allowed?(order = @order)\n # return false if (order.order_status.nil?) # This can be removed; needed because of bad data in DEV\n # Only Admin can edit, status must be Filled\n return true if (admin_user? && (order.order_status_id == 2))\n return false\n end",
"title": ""
},
{
"docid": "367b296c981fbf4232cd9bd55ae8b7c7",
"score": "0.56574166",
"text": "def users_own_tip_required\n @user = @game.user\n\n if @user != current_user && current_user && !current_user.admin?\n redirect_to :root, notice: 'Detta verkar inte vara ditt tips.'\n end\n end",
"title": ""
},
{
"docid": "9044e058b89a59ae7384ceb039c748d9",
"score": "0.5652486",
"text": "def pickup_allowed?(order = @order)\n #return false if (order.order_status.nil?) # This can be removed; needed because of bad data in DEV\n # Only Admin can edit, status must be Filled\n return true if (admin_user? && (order.order_status_id == 2))\n return false\n end",
"title": ""
},
{
"docid": "29b00478895fe5ea0a33df85cbbf7c51",
"score": "0.5648543",
"text": "def exhibited?\n true\n end",
"title": ""
},
{
"docid": "1f852421ac1df78ed6e121e9f98de492",
"score": "0.5642648",
"text": "def cannot_for_everyone\n #todo: cannot manage para todas las entidades que son CONSTANT\n #ejemplo: cannot [:create, :update, :destroy], User\n\n\t\tcannot [:update, :destroy], Box, name: Box::UNITS_BOX_NAME\n\n\t\tcannot :destroy, Order do |order|\n\t\t\t!order.created? # igual seria order.status != 'CREATED'. es decir que no se puede eliminar una orden que este en un estado distinto a CREATED\n\t\tend\n\n\t\tunless @user.superuser?\n\t\t\tcannot [:create, :read, :update, :destroy], User, role_id: Role.find_by_name('superuser').id\n\t\t\tcannot [:create, :read, :update, :destroy], Role, id: Role.find_by_name('superuser').id\n\t\tend\n\tend",
"title": ""
},
{
"docid": "aefdf3a2947558ecae185435a6a806d8",
"score": "0.56308293",
"text": "def require_inventory\n return false unless Spree::Config[:track_inventory_levels]\n order.completed? && !order.canceled?\n end",
"title": ""
},
{
"docid": "526f64aead1234f818eeffc3ccbf5c0a",
"score": "0.5628637",
"text": "def new_order\n is_signed_in ? order2 : order1\nend",
"title": ""
},
{
"docid": "3deca05d954d179808fc8ecc2dc8747a",
"score": "0.5626301",
"text": "def hire_order()\n return\n end",
"title": ""
},
{
"docid": "c0d8390c5760aff74da30c9fe249954f",
"score": "0.56257075",
"text": "def order_in_place?\n @order_in_place\n end",
"title": ""
},
{
"docid": "d2bb27cfdfcaba68adadc6c5ba979b87",
"score": "0.56252366",
"text": "def no_spam\n write_attribute(:spam, self.spam_according_to_akismet?) if from_public_user?\n true # don't stop the saving\n end",
"title": ""
},
{
"docid": "c15bd94b15666880586d75e9275ac8c0",
"score": "0.5622306",
"text": "def acts_as_ordered_prepare_for_destruction\n\t\treturn true unless self.class.column_names.include?( self.class.acts_as_ordered_order_attribute_name.to_s )\n\t\tmove_order_to :last if !self.acts_as_ordered_count_in_my_exclusivity.eql?( read_attribute( self.class.acts_as_ordered_order_attribute_name ) )\n\tend",
"title": ""
},
{
"docid": "301476f2e73e1456bd10562d62dd9d2e",
"score": "0.56219643",
"text": "def show\n @user = User.find(params[:id])\n @orders = @user.orders.find(:all, :conditions => ['cart_id != ?', ''])\n end",
"title": ""
},
{
"docid": "2831ac77daef33a3cc68a70446b714a0",
"score": "0.56099796",
"text": "def quotation?\n !cart?\n end",
"title": ""
},
{
"docid": "7782a7ddcb186cc0a5a6abbbe6478b11",
"score": "0.56042296",
"text": "def my_buddy_list\n @users = User.where(\"id != ?\", current_user.id).order(\"created_at\")\n end",
"title": ""
},
{
"docid": "0882b3f071b9d0da296e5b2db33c7918",
"score": "0.5602256",
"text": "def do_not_destroy_admin_user\n if @user and @user.is_the_administrator?\n redirect_to :action => 'list' and return false\n end\n end",
"title": ""
},
{
"docid": "aa05bb2dd77ea3d7636e03fcfa27c78f",
"score": "0.5595012",
"text": "def confirm\n # Cannot do with guest account\n return unless current_user \n do_checkout\n end",
"title": ""
},
{
"docid": "e85798348af9cafa1a2941c0b6f51456",
"score": "0.5594521",
"text": "def ordered?\n @ordered\n end",
"title": ""
},
{
"docid": "89347b1add39270ad2f4b6420347a766",
"score": "0.5594292",
"text": "def search_pending\n ::User.not_approved\n end",
"title": ""
},
{
"docid": "87b6a3109a3b20d07c35987b07c946eb",
"score": "0.55932367",
"text": "def ordered?\n return true if @_order\n false\n end",
"title": ""
},
{
"docid": "c6ca8f4ea2e5c76723fc6255827898da",
"score": "0.55912083",
"text": "def seller_has_buyers\n !current_user.sold_cars.empty?\n # [negate operator]Purchase.find_by(seller_id: current_user.id).empty? # same AR time in console.\n end",
"title": ""
}
] |
51ca5849b256182038170d0f8325159c
|
A hash of the Spyders[rdocref:Spyder::Group] connected to this ECC. It is index by both description and numerical index
|
[
{
"docid": "759690ab302b7ef92a353e9813f28257",
"score": "0.0",
"text": "def spyders\n build_system_layout\n @spyders\n end",
"title": ""
}
] |
[
{
"docid": "640cc000560734a0fe8dffa860c04e4b",
"score": "0.6084959",
"text": "def hash\n [group, x, y].hash\n end",
"title": ""
},
{
"docid": "e92bda2f63269ce1fad9ea1fabe3abbb",
"score": "0.58439374",
"text": "def generate_hash\n @groups.flatten.inject([]) {|hash, stone| hash << stone.to_s}.sort.hash\n end",
"title": ""
},
{
"docid": "452d6358da59480ca2f054f444a93fbf",
"score": "0.5766457",
"text": "def hash_id\n @hid\n end",
"title": ""
},
{
"docid": "648ce51406b20d5fadff0812e301d09f",
"score": "0.5747502",
"text": "def hash\n [lac, cid, radio, mcc, mnc, signal, psc, asu, ta].hash\n end",
"title": ""
},
{
"docid": "2247596c1af1ea3859d9b23958ad5b06",
"score": "0.5717761",
"text": "def hash\n self[:pc].hash\n end",
"title": ""
},
{
"docid": "57e37b6674820d34c3178118db16cf9b",
"score": "0.5701195",
"text": "def to_hash\n index_hash = Hash.new\n index_hash[\"json_claz\"] = self.class.name\n index_hash[\"group\"] = group\n cloud_instructions_array.each do |single_cig|\n index_hash[\"\"] = single_cig\n end\n index_hash\n end",
"title": ""
},
{
"docid": "7cd6462b070bf6db060e8822dbf08483",
"score": "0.5613015",
"text": "def hash\n [mcc, uf, id_antecipacao_simulada, id_conta, id_compra, id_tipo_transacao, quantidade_parcelas_antecipaveis, valor_parcela, data_hora_simulacao, taxa_antecipacao_ano, nome_estabelecimento, status, data_compra, tipo_origem_transacao, cidade, pais, latitude, longitude, id_grupo_mcc, descricao_grupo_mcc, id_produto, descricao_produto, descricao_estabelecimento, nome_fantasia_estabelecimento, detalhes].hash\n end",
"title": ""
},
{
"docid": "572f5e1ca3cb4fd17703b48234a8d9a4",
"score": "0.55802715",
"text": "def hash\n [dep_mgr_name, name, version, license].hash\n end",
"title": ""
},
{
"docid": "c43eac34a423404e56a1bcc2d7efa208",
"score": "0.55587184",
"text": "def key\n 'groupid'\n end",
"title": ""
},
{
"docid": "81d7b1300734ea62c374865317a2a1ed",
"score": "0.55557746",
"text": "def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"title": ""
},
{
"docid": "20cd6aa418e772dfc5102d936608fc94",
"score": "0.55539685",
"text": "def hash\n [sequence_number, corporate_number, process, correct, update_date, change_date, name, name_image_id, kind, prefecture_name, city_name, street_number, address_image_id, prefecture_code, city_code, post_code, address_outside, address_outside_image_id, close_date, close_cause, successor_corporate_number, change_cause, assignment_date, latest, en_name, en_prefecture_name, en_city_name, en_address_outside, furigana, hihyoji].hash\n end",
"title": ""
},
{
"docid": "5616072fd1f57b0d1e8b228ae8b201af",
"score": "0.5522479",
"text": "def getGroupObjName\r\n\t\t return \"mfiforce__group__c\"\r\n\t\tend",
"title": ""
},
{
"docid": "f2af5a04b5cfd922b831232c23bb425c",
"score": "0.5513237",
"text": "def hash\n\n self.h.fei.hash\n end",
"title": ""
},
{
"docid": "ea971fd8aab4535626f0fb83c9dd4525",
"score": "0.550439",
"text": "def hash\n [id, rfc, legal_name, commercial_name, credit_days, credit_amount, payment_method, creation_date, status, sales_contact, credit_contact, loctaion, comments, price_list, payment_term_type, email, telephones, number, account_number, default_discount, client_source, account, addresses].hash\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.5497217",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "34a1d55ef3b6dc91148bfed6742449bc",
"score": "0.5471528",
"text": "def hash\n [compute, group_by, index, multi_compute, search].hash\n end",
"title": ""
},
{
"docid": "87f0429acc6dd6083a00fb395b5ed0ca",
"score": "0.54344356",
"text": "def ecn_hash\n { model: @model,\n port: @port,\n area: @area,\n mac_address: @mac_address }\n end",
"title": ""
},
{
"docid": "a933bd34a009212230147a0de62f0958",
"score": "0.5412364",
"text": "def index\n unless @descriptor_index\n @descriptor_index = all.inject({}) do |hash,d|\n hash[d.index_key] = d\n hash\n end\n end\n @descriptor_index\n end",
"title": ""
},
{
"docid": "1de044070175042e43c5ae80743a986d",
"score": "0.5401564",
"text": "def hash\n [bin_commercial, bin_corporate, bin_country_issued, bin_credit, bin_currency, bin_debit, bin_description, bin_eu, card_id, card_status, default, expmonth, expyear, label, label2, last4digits, scheme, token].hash\n end",
"title": ""
},
{
"docid": "b24f3107eddbfd15f1636a7b773d2db4",
"score": "0.5390292",
"text": "def hash\n [@creditor_id, @creditor_name, @debt_positions].hash\n end",
"title": ""
},
{
"docid": "a673190e2e5c3ceb7686e19b249b649d",
"score": "0.53774786",
"text": "def hash\n [class_id, object_type, accessibility_summary, creation_time, datastore_kind, datastore_status, dsconfig, free_capacity_in_bytes, host_mount_status, is_encrypted, last_access_time, last_modified_time, mount_summary, parent_uuid, site, total_capacity_in_bytes, un_compressed_used_bytes, unshared_used_bytes, uuid, data_protection_peer, src_cluster, tgt_cluster].hash\n end",
"title": ""
},
{
"docid": "e9b3b4793c41a121ef24b59fb910cfef",
"score": "0.53535485",
"text": "def hash\n [id, banco, agencia, conta_corrente, especie, numero_convenio, carteira, codigo_cedente, especie_tipo, especie_documento, aceite, instrucoes, local_pagamento1, local_pagamento2, endereco_cobranca_emissor, nome_beneficiario, cnpj_beneficiario, operador, data, maquina].hash\n end",
"title": ""
},
{
"docid": "fe85257322c89459e7e4472f6234a766",
"score": "0.53407574",
"text": "def hash\n [self.class, dimension, system, name].hash\n end",
"title": ""
},
{
"docid": "0b734d3d92ea0b744d40e6d36b19d0af",
"score": "0.53370166",
"text": "def hash\n @vector\n end",
"title": ""
},
{
"docid": "e4d22bf9e63d3b2bf72f6d88ae38f542",
"score": "0.5324769",
"text": "def hash\n [ref, from, to, chg, line, loc, min, sale, plsp, incl, pror, proadj, tran, serv, dbt, adj, adjm, disc, opt, prop, bill, cust, lfln, date, qty, glref].hash\n end",
"title": ""
},
{
"docid": "9473851ebe3837486d472965b865ea56",
"score": "0.532464",
"text": "def hash\n name.hash ^ provider.hash\n end",
"title": ""
},
{
"docid": "cd3488f44e4cbcc19550e1e1423c3b22",
"score": "0.53232825",
"text": "def hash\n [class_id, object_type, hardware_status, hcl_cimc_version, hcl_driver_name, hcl_driver_version, hcl_firmware_version, hcl_model, inv_cimc_version, inv_driver_name, inv_driver_version, inv_firmware_version, inv_model, reason, software_status, status, component, hcl_status].hash\n end",
"title": ""
},
{
"docid": "25aaa5db4613080c00be30b0e859d322",
"score": "0.5320576",
"text": "def hash_code; end",
"title": ""
},
{
"docid": "a6b4ae8a5945916a5ee8730ea48e511d",
"score": "0.5312415",
"text": "def hash\n\t\treturn self.name.to_s.hash\n\tend",
"title": ""
},
{
"docid": "7121f9a4c499d5680a22686c7b2e8db5",
"score": "0.5310687",
"text": "def hash\n [cluster, options].hash\n end",
"title": ""
},
{
"docid": "7121f9a4c499d5680a22686c7b2e8db5",
"score": "0.5310687",
"text": "def hash\n [cluster, options].hash\n end",
"title": ""
},
{
"docid": "5101de56c26b6afb3718439bd7a19bf0",
"score": "0.5308605",
"text": "def hash\n [access_complexity, access_vector, authentication, availability_impact, confidentiality_impact, exploit_score, impact_score, integrity_impact, score, vector].hash\n end",
"title": ""
},
{
"docid": "6bb909c379912de94cb7dc4ab2f13477",
"score": "0.5292274",
"text": "def hash\n return Digest::MD5.hexdigest(self.describe(' '))\n end",
"title": ""
},
{
"docid": "243f2d81bccf1d76d694825513bd2681",
"score": "0.52573466",
"text": "def example_group_index\n index = Hash.new { |hash, key| hash[key] = [] }\n\n RSpec.world.example_groups.flat_map(&:descendants).each do |example_group|\n full_description = full_description(example_group)\n index[full_description] << example_group\n end\n\n index\n end",
"title": ""
},
{
"docid": "ea62ccd37c07ba5091d95648ae37687e",
"score": "0.5252266",
"text": "def hash\n [cusip, ticker, security_name, security_type, title_of_class, stock_exchange, filing_date, value, amount, type, investment_discretion, other_manager, sole_voting_authority, shared_voting_authority, no_voting_authority].hash\n end",
"title": ""
},
{
"docid": "37b0274531a5378d59cd04bb9ce92732",
"score": "0.5249754",
"text": "def hash\n\t\treturn [ self.class, self.dn ].hash\n\tend",
"title": ""
},
{
"docid": "bd7abd17f5e304ad09afaad455780f66",
"score": "0.52471757",
"text": "def hash\n @id.hash\n end",
"title": ""
},
{
"docid": "cbe4490870d506e521d4bab667e02f0d",
"score": "0.5246944",
"text": "def hash\n [audit, username, ereq_id, level, comp, error_code, s2comp, req_id, ent_id, security, subcomp].hash\n end",
"title": ""
},
{
"docid": "6fbbdf223ff8cffbbf7bcb23500f1187",
"score": "0.52296567",
"text": "def hash\n [id, numero_estabelecimento, flag_matriz, id_grupo_economico, numero_receita_federal, nome, descricao, nome_fantasia, cep, nome_logradouro, numero_endereco, bairro, cidade, complemento, uf, cep2, nome_logradouro2, numero_endereco2, bairro2, cidade2, complemento2, uf2, obs, contato, email, flag_arquivo_secr_fazenda, flag_cartao_digitado, inativo, id_moeda, id_pais, associado_spc_brasil, mcc, id_tipo_estabelecimento, correspondencia, cargo_contato, tipo_pagamento, consulta, consulta2, consulta3, terminal, data_cadastramento, usuario].hash\n end",
"title": ""
},
{
"docid": "8c99e2e1f1e0c2c1183e5c4d37b23847",
"score": "0.5229239",
"text": "def hash\n dn.hash\n end",
"title": ""
},
{
"docid": "942fa4a313720d47638792dee48d2d43",
"score": "0.52289265",
"text": "def to_hash\n @index\n end",
"title": ""
},
{
"docid": "84ff721c02ebe1a0098120ac41d9e74f",
"score": "0.5226028",
"text": "def hash\n [class_id, object_type, acs_control_gpu1state, acs_control_gpu2state, acs_control_gpu3state, acs_control_gpu4state, acs_control_gpu5state, acs_control_gpu6state, acs_control_gpu7state, acs_control_gpu8state, acs_control_slot11state, acs_control_slot12state, acs_control_slot13state, acs_control_slot14state, adjacent_cache_line_prefetch, advanced_mem_test, all_usb_devices, altitude, aspm_support, assert_nmi_on_perr, assert_nmi_on_serr, auto_cc_state, autonumous_cstate_enable, baud_rate, bme_dma_mitigation, boot_option_num_retry, boot_option_re_cool_down, boot_option_retry, boot_performance_mode, burst_and_postponed_refresh, c1auto_demotion, c1auto_un_demotion, cbs_cmn_apbdis, cbs_cmn_cpu_cpb, cbs_cmn_cpu_gen_downcore_ctrl, cbs_cmn_cpu_global_cstate_ctrl, cbs_cmn_cpu_l1stream_hw_prefetcher, cbs_cmn_cpu_l2stream_hw_prefetcher, cbs_cmn_cpu_smee, cbs_cmn_cpu_streaming_stores_ctrl, cbs_cmn_determinism_slider, cbs_cmn_efficiency_mode_en, cbs_cmn_fixed_soc_pstate, cbs_cmn_gnb_nb_iommu, cbs_cmn_gnb_smu_df_cstates, cbs_cmn_gnb_smucppc, cbs_cmn_mem_ctrl_bank_group_swap_ddr4, cbs_cmn_mem_map_bank_interleave_ddr4, cbs_cmnc_tdp_ctl, cbs_cpu_ccd_ctrl_ssp, cbs_cpu_core_ctrl, cbs_cpu_smt_ctrl, cbs_dbg_cpu_snp_mem_cover, cbs_dbg_cpu_snp_mem_size_cover, cbs_df_cmn_acpi_srat_l3numa, cbs_df_cmn_dram_nps, cbs_df_cmn_mem_intlv, cbs_df_cmn_mem_intlv_size, cbs_sev_snp_support, cdn_enable, cdn_support, channel_inter_leave, cisco_adaptive_mem_training, cisco_debug_level, cisco_oprom_launch_optimization, cisco_xgmi_max_speed, cke_low_policy, closed_loop_therm_throtl, cmci_enable, config_tdp, config_tdp_level, console_redirection, core_multi_processing, cpu_energy_performance, cpu_frequency_floor, cpu_perf_enhancement, cpu_performance, cpu_power_management, cr_qos, crfastgo_config, dcpmm_firmware_downgrade, demand_scrub, direct_cache_access, dram_clock_throttling, dram_refresh_rate, dram_sw_thermal_throttling, eadr_support, edpc_en, enable_clock_spread_spec, enable_mktme, enable_sgx, enable_tme, energy_efficient_turbo, eng_perf_tuning, enhanced_intel_speed_step_tech, epoch_update, epp_enable, epp_profile, execute_disable_bit, extended_apic, flow_control, frb2enable, hardware_prefetch, hwpm_enable, imc_interleave, intel_dynamic_speed_select, intel_hyper_threading_tech, intel_speed_select, intel_turbo_boost_tech, intel_virtualization_technology, intel_vt_for_directed_io, intel_vtd_coherency_support, intel_vtd_interrupt_remapping, intel_vtd_pass_through_dma_support, intel_vtdats_support, ioh_error_enable, ioh_resource, ip_prefetch, ipv4http, ipv4pxe, ipv6http, ipv6pxe, kti_prefetch, legacy_os_redirection, legacy_usb_support, llc_alloc, llc_prefetch, lom_port0state, lom_port1state, lom_port2state, lom_port3state, lom_ports_all_state, lv_ddr_mode, make_device_non_bootable, memory_bandwidth_boost, memory_inter_leave, memory_mapped_io_above4gb, memory_refresh_rate, memory_size_limit, memory_thermal_throttling, mirroring_mode, mmcfg_base, network_stack, numa_optimized, nvmdimm_perform_config, onboard10gbit_lom, onboard_gbit_lom, onboard_scu_storage_support, onboard_scu_storage_sw_stack, operation_mode, os_boot_watchdog_timer, os_boot_watchdog_timer_policy, os_boot_watchdog_timer_timeout, out_of_band_mgmt_port, package_cstate_limit, panic_high_watermark, partial_cache_line_sparing, partial_mirror_mode_config, partial_mirror_percent, partial_mirror_value1, partial_mirror_value2, partial_mirror_value3, partial_mirror_value4, patrol_scrub, patrol_scrub_duration, pc_ie_ras_support, pc_ie_ssd_hot_plug_support, pch_usb30mode, pci_option_ro_ms, pci_rom_clp, pcie_ari_support, pcie_pll_ssc, pcie_slot_mraid1link_speed, pcie_slot_mraid1option_rom, pcie_slot_mraid2link_speed, pcie_slot_mraid2option_rom, pcie_slot_mstorraid_link_speed, pcie_slot_mstorraid_option_rom, pcie_slot_nvme1link_speed, pcie_slot_nvme1option_rom, pcie_slot_nvme2link_speed, pcie_slot_nvme2option_rom, pcie_slot_nvme3link_speed, pcie_slot_nvme3option_rom, pcie_slot_nvme4link_speed, pcie_slot_nvme4option_rom, pcie_slot_nvme5link_speed, pcie_slot_nvme5option_rom, pcie_slot_nvme6link_speed, pcie_slot_nvme6option_rom, pcie_slots_cdn_enable, pop_support, post_error_pause, post_package_repair, processor_c1e, processor_c3report, processor_c6report, processor_cstate, psata, pstate_coord_type, putty_key_pad, pwr_perf_tuning, qpi_link_frequency, qpi_link_speed, qpi_snoop_mode, rank_inter_leave, redirection_after_post, sata_mode_select, select_memory_ras_configuration, select_ppr_type, serial_port_aenable, sev, sgx_auto_registration_agent, sgx_epoch0, sgx_epoch1, sgx_factory_reset, sgx_le_pub_key_hash0, sgx_le_pub_key_hash1, sgx_le_pub_key_hash2, sgx_le_pub_key_hash3, sgx_le_wr, sgx_package_info_in_band_access, sgx_qos, sha1pcr_bank, sha256pcr_bank, single_pctl_enable, slot10link_speed, slot10state, slot11link_speed, slot11state, slot12link_speed, slot12state, slot13state, slot14state, slot1link_speed, slot1state, slot2link_speed, slot2state, slot3link_speed, slot3state, slot4link_speed, slot4state, slot5link_speed, slot5state, slot6link_speed, slot6state, slot7link_speed, slot7state, slot8link_speed, slot8state, slot9link_speed, slot9state, slot_flom_link_speed, slot_front_nvme10link_speed, slot_front_nvme10option_rom, slot_front_nvme11link_speed, slot_front_nvme11option_rom, slot_front_nvme12link_speed, slot_front_nvme12option_rom, slot_front_nvme13option_rom, slot_front_nvme14option_rom, slot_front_nvme15option_rom, slot_front_nvme16option_rom, slot_front_nvme17option_rom, slot_front_nvme18option_rom, slot_front_nvme19option_rom, slot_front_nvme1link_speed, slot_front_nvme1option_rom, slot_front_nvme20option_rom, slot_front_nvme21option_rom, slot_front_nvme22option_rom, slot_front_nvme23option_rom, slot_front_nvme24option_rom, slot_front_nvme2link_speed, slot_front_nvme2option_rom, slot_front_nvme3link_speed, slot_front_nvme3option_rom, slot_front_nvme4link_speed, slot_front_nvme4option_rom, slot_front_nvme5link_speed, slot_front_nvme5option_rom, slot_front_nvme6link_speed, slot_front_nvme6option_rom, slot_front_nvme7link_speed, slot_front_nvme7option_rom, slot_front_nvme8link_speed, slot_front_nvme8option_rom, slot_front_nvme9link_speed, slot_front_nvme9option_rom, slot_front_slot5link_speed, slot_front_slot6link_speed, slot_gpu1state, slot_gpu2state, slot_gpu3state, slot_gpu4state, slot_gpu5state, slot_gpu6state, slot_gpu7state, slot_gpu8state, slot_hba_link_speed, slot_hba_state, slot_lom1link, slot_lom2link, slot_mezz_state, slot_mlom_link_speed, slot_mlom_state, slot_mraid_link_speed, slot_mraid_state, slot_n10state, slot_n11state, slot_n12state, slot_n13state, slot_n14state, slot_n15state, slot_n16state, slot_n17state, slot_n18state, slot_n19state, slot_n1state, slot_n20state, slot_n21state, slot_n22state, slot_n23state, slot_n24state, slot_n2state, slot_n3state, slot_n4state, slot_n5state, slot_n6state, slot_n7state, slot_n8state, slot_n9state, slot_raid_link_speed, slot_raid_state, slot_rear_nvme1link_speed, slot_rear_nvme1state, slot_rear_nvme2link_speed, slot_rear_nvme2state, slot_rear_nvme3link_speed, slot_rear_nvme3state, slot_rear_nvme4link_speed, slot_rear_nvme4state, slot_rear_nvme5state, slot_rear_nvme6state, slot_rear_nvme7state, slot_rear_nvme8state, slot_riser1link_speed, slot_riser1slot1link_speed, slot_riser1slot2link_speed, slot_riser1slot3link_speed, slot_riser2link_speed, slot_riser2slot4link_speed, slot_riser2slot5link_speed, slot_riser2slot6link_speed, slot_sas_state, slot_ssd_slot1link_speed, slot_ssd_slot2link_speed, smee, smt_mode, snc, snoopy_mode_for2lm, snoopy_mode_for_ad, sparing_mode, sr_iov, streamer_prefetch, svm_mode, terminal_type, tpm_control, tpm_pending_operation, tpm_support, tsme, txt_support, ucsm_boot_order_rule, ufs_disable, uma_based_clustering, upi_link_enablement, upi_power_management, usb_emul6064, usb_port_front, usb_port_internal, usb_port_kvm, usb_port_rear, usb_port_sd_card, usb_port_vmedia, usb_xhci_support, vga_priority, virtual_numa, vmd_enable, vol_memory_mode, work_load_config, xpt_prefetch, xpt_remote_prefetch, organization, profiles].hash\n end",
"title": ""
},
{
"docid": "c6312ea07e937673f306bf6af9a26347",
"score": "0.52200884",
"text": "def index_signature\n Digest::SHA256.new(@gems.keys.sort.join(',')).to_s\n end",
"title": ""
},
{
"docid": "2fe66cff14fdabeab11d6f696606a539",
"score": "0.5209842",
"text": "def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"title": ""
},
{
"docid": "586b0e7ad06ed3f0f3f78c2f75bcac06",
"score": "0.52088976",
"text": "def hash\n @id\n end",
"title": ""
},
{
"docid": "a8b49187f47c34d037669a3f5ad3647b",
"score": "0.51998097",
"text": "def hash\n [company_id, company_type, compnay_name, company_name_en, company_address, company_address_en, company_zip_code, company_tax_id, company_branch, company_branch_en, company_branch_code, company_phone, company_mobile, company_fax, company_website].hash\n end",
"title": ""
},
{
"docid": "b81db49b1e50ed6c1e87b1dbc1cfda10",
"score": "0.5190177",
"text": "def hash\n [adwords_grouping, adwords_label1, adwords_label2, adwords_label3, adwords_label4, adwords_label5, age_group, available_at_physical_store, book_author, book_format, book_isbn, book_publisher, category_description, color, condition, custom_label0, custom_label1, custom_label2, custom_label3, custom_label4, gender, google_product_category, music_artist, music_format, music_release_date, omit_from_feed, product_type, promotion_id1, promotion_id10, promotion_id2, promotion_id3, promotion_id4, promotion_id5, promotion_id6, promotion_id7, promotion_id8, promotion_id9, search_dts, search_lowest_price, search_lowest_url, search_position, shipping_label, size, video_director, video_format, video_rating, video_release_date, video_starring].hash\n end",
"title": ""
},
{
"docid": "5eeb42d0eaef7131134ed0cf2f190d27",
"score": "0.5178472",
"text": "def hash\n [serial_number, timestamp, description, controller_id, device_id, subdevice_id, segment_id, event_type, event_subtype, event_text, badge_id, badge_id_str, badge_extended_id, badge_issue_code, asset_id, cardholder_key, alarm_priority, alarm_ack_blue_channel, alarm_ack_green_channel, alarm_ack_red_channel, alarm_blue_channel, alarm_green_channel, alarm_red_channel, access_result, cardholder_entered, duress, controller_name, event_source_name, cardholder_first_name, cardholder_last_name, device_name, subdevice_name, must_acknowledge, must_mark_in_progress].hash\n end",
"title": ""
},
{
"docid": "748c35c5e64f7c1a08ba936e1b6c2941",
"score": "0.51692015",
"text": "def hash\n @id\n end",
"title": ""
},
{
"docid": "a1cba56b430af79143609542f3367c6c",
"score": "0.51601446",
"text": "def hash\n [description, routing_number, account_number, account_type, signatory, metadata, id, signature_url, bank_name, verified, date_created, date_modified, deleted, object].hash\n end",
"title": ""
},
{
"docid": "208720ff133829fd98a4260364882949",
"score": "0.5157374",
"text": "def hash\n [account_id, cms_user_id, company, created_at, dept, email, first_name, group_ids, host_key, id, im_group_ids, jid, job_title, language, last_client_version, last_login_time, last_name, location, personal_meeting_url, phone_country, phone_number, pic_url, pmi, role_name, status, timezone, type, use_pmi, vanity_url, verified].hash\n end",
"title": ""
},
{
"docid": "dcf7bd69fe76f644e82ccf8f7eadfee2",
"score": "0.5156277",
"text": "def scc\n group_num, ids = scc_ids\n groups = Array.new(group_num) { [] }\n ids.each_with_index { |id, i| groups[id] << i }\n groups\n end",
"title": ""
},
{
"docid": "bad5f61c8a356c9e30342f6daf2efe6b",
"score": "0.5153637",
"text": "def key_for(data)\n data.hash\n end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.5144223",
"text": "def key; end",
"title": ""
},
{
"docid": "f5afcfbdcb83a9bb7c1e2f08f7e1c78f",
"score": "0.5135752",
"text": "def hash\n value_id.hash\n end",
"title": ""
},
{
"docid": "cd4860da487a2751e1965ff71c76e02f",
"score": "0.5132788",
"text": "def hash\n [id, next_send, rrule, session, last_sent, contact_name, parameters, type, summary, text_parameters, first_occurrence, last_occurrence, recipients_count, timezone, completed, avatar, created_at].hash\n end",
"title": ""
},
{
"docid": "2995f14406c97b37355769ea977a3cb5",
"score": "0.51296926",
"text": "def hash\n [_hash, name, owner].hash\n end",
"title": ""
},
{
"docid": "ae62070fab967bac16fe28a8ddb59b00",
"score": "0.5127313",
"text": "def hash\n\t\t[@id].hash\n\tend",
"title": ""
},
{
"docid": "208a798eb4ef23df6f96fe3df024574e",
"score": "0.5124094",
"text": "def cl_hash\n if @cl_hash\n return @cl_hash\n else\n courtlistener = CourtListener.new\n @cl_hash = courtlistener.case_by_cite(cite1)\n end\n end",
"title": ""
},
{
"docid": "92dd8151bac88ac675fedee8f23f8fcc",
"score": "0.51231253",
"text": "def hash\n [anchor, cv, nullifier, proof, rk, spend_auth_sig].hash\n end",
"title": ""
},
{
"docid": "ec025ef61f39d7838cba0c635ed06693",
"score": "0.5121297",
"text": "def component_groups\n @component_groups ||=\n begin\n h = {}\n barcodes.each do |barcode|\n cid = component_dict.component_id(barcode: barcode)\n h[cid] = h.fetch(cid, []).append(barcode).uniq\n end\n h.each do |component_id, barcodes|\n h[component_id] = barcodes.sort_by do |barcode|\n component_dict.barcodes(cid: component_id)&.index(barcode)\n end\n end\n h\n end\n end",
"title": ""
},
{
"docid": "6ed84c55ed8e2b9fc012ac7d34b11482",
"score": "0.51183677",
"text": "def hash\n @label.hash\n end",
"title": ""
},
{
"docid": "0632392474ba1296a85bb39b5a22cb13",
"score": "0.51173663",
"text": "def hash\n [class_id, object_type, admin_evac_state, admin_inband_interface_state, alarm_summary, available_memory, device_mo_id, dn, ethernet_mode, ethernet_switching_mode, fault_summary, fc_mode, fc_switching_mode, firmware, inband_ip_address, inband_ip_gateway, inband_ip_mask, inband_vlan, ipv4_address, management_mode, model, name, num_ether_ports, num_ether_ports_configured, num_ether_ports_link_up, num_expansion_modules, num_fc_ports, num_fc_ports_configured, num_fc_ports_link_up, oper_evac_state, operability, out_of_band_ip_address, out_of_band_ip_gateway, out_of_band_ip_mask, out_of_band_ipv4_address, out_of_band_ipv4_gateway, out_of_band_ipv4_mask, out_of_band_ipv6_address, out_of_band_ipv6_gateway, out_of_band_ipv6_prefix, out_of_band_mac, presence, revision, rn, serial, source_object_type, switch_id, thermal, total_memory, vendor, version, registered_device].hash\n end",
"title": ""
},
{
"docid": "89b8811b725cdebf93112f8045f8852a",
"score": "0.510587",
"text": "def hash\n @matrix\n end",
"title": ""
},
{
"docid": "007a7471553652c67a33a8d828b85fdb",
"score": "0.5103992",
"text": "def hash\n @vbits.hash\n end",
"title": ""
},
{
"docid": "4826fc4b4388974dc97515aa732820a2",
"score": "0.51028556",
"text": "def hash\n [hint,name,ordinal,module_name].hash\n end",
"title": ""
},
{
"docid": "151a576539856dd71926ee48cff42ec2",
"score": "0.51016587",
"text": "def hash\n object_id\n end",
"title": ""
},
{
"docid": "64745528fee7f65be2ab5d567991e323",
"score": "0.50936174",
"text": "def hash\n [class_id, object_type, compatibility_mode, controller_key, device_name, disk_mode, disk_type, key, limit, lun_uuid, serial, shares, sharing, storage_allocation_type, unit_number, uuid, vdisk_id, vendor, virtual_disk_path, vm_identity, datastore, virtual_machine].hash\n end",
"title": ""
},
{
"docid": "1eb57cd4a9ba298988de140fd5b170eb",
"score": "0.50927365",
"text": "def se_hash_key\n [@jump_length, @sorted_jumpables]\n end",
"title": ""
},
{
"docid": "8f64127d0e4884b68dbaffc02c93f6d9",
"score": "0.5091163",
"text": "def hash\n __record_id.hash\n end",
"title": ""
},
{
"docid": "06c7650cddafe222693b14b113c3a710",
"score": "0.5087879",
"text": "def hash\n [inventory_code, plu, name, host_id, size, category, group, master_group, price_level, clerk, location, quantity, total_ex, total_inc, counter, barcode, normal_price, item_cost, tax, tax_free, is_discount, is_refund, is_void, is_surcharge, is_promotion, reason].hash\n end",
"title": ""
},
{
"docid": "4579639fce20f5aaa79f3b7f75a0aa6e",
"score": "0.5085523",
"text": "def hash\n id\n end",
"title": ""
},
{
"docid": "e8e7ce85d9470d57053198830638b052",
"score": "0.5082513",
"text": "def hash\n [color, cards, address_placement, custom_envelope, double_sided, extra_service, mail_type, return_envelope, bleed, file_original_url].hash\n end",
"title": ""
},
{
"docid": "91064a9ff23c5a87b0f72132ed264a0e",
"score": "0.50801784",
"text": "def hash\r\n id.hash\r\n end",
"title": ""
},
{
"docid": "3d7327376ab2558cefa128b3dd54945b",
"score": "0.50738263",
"text": "def hash\n [dd_service, description, display_name, service_tier].hash\n end",
"title": ""
},
{
"docid": "6d637df7319788c1a989edb85f917c64",
"score": "0.50717074",
"text": "def hash\n return @id.hash\n end",
"title": ""
},
{
"docid": "183b252a51c90fbe2095be9625849bf7",
"score": "0.50716007",
"text": "def hash\n [self.start, self.end, self.label].hash\n end",
"title": ""
},
{
"docid": "7aee491de54e701f6f0d593154f0ad92",
"score": "0.5066386",
"text": "def hash\n @name.hash\n end",
"title": ""
},
{
"docid": "15af74e45e2a0a66b0b8b8a0352bd1a0",
"score": "0.50591874",
"text": "def hash\n [auth_mode, count_per_project, email_from, email_host, email_port, email_identity, email_username, email_ssl, email_insecure, ldap_url, ldap_base_dn, ldap_filter, ldap_scope, ldap_uid, ldap_search_dn, ldap_timeout, ldap_group_attribute_name, ldap_group_base_dn, ldap_group_search_filter, ldap_group_search_scope, ldap_group_admin_dn, oidc_client_id, oidc_endpoint, oidc_name, oidc_scope, oidc_verify_cert, project_creation_restriction, quota_per_project_enable, read_only, self_registration, storage_per_project, token_expiration, verify_remote_cert, scan_all_policy].hash\n end",
"title": ""
},
{
"docid": "2e377708cde4199ef0a438c6887ceb83",
"score": "0.50520223",
"text": "def hash\n @rank.hash ^ @suit.hash\n end",
"title": ""
},
{
"docid": "bba1435ac321119e183b7312ca7c84d1",
"score": "0.5048048",
"text": "def group_key(id)\n nil\n end",
"title": ""
},
{
"docid": "ad6114c41737f08c4c7aaea5b995bd46",
"score": "0.5046804",
"text": "def cluster_by\n return @cluster_by\n end",
"title": ""
}
] |
588a975ee68e4b2ce47f7629411d4538
|
Create Schedule Override Creates a schedule override for the specified user and schedule
|
[
{
"docid": "7c147dc79af127f94a2beb22a8111a10",
"score": "0.7065556",
"text": "def create_schedule_override(identifier, body, opts = {})\n data, _status_code, _headers = create_schedule_override_with_http_info(identifier, body, opts)\n return data\n end",
"title": ""
}
] |
[
{
"docid": "702129f5418555539f9fd3da2ddd9a8d",
"score": "0.77511746",
"text": "def create_schedule_override(id, options = {})\n params = {\n override: {\n start: options[:start],\n end: options[:end],\n user: {\n id: options[:user_id],\n type: \"user\"\n }\n }\n } \n response = post \"/schedules/#{id}/overrides\", options.merge(params)\n response[:override]\n end",
"title": ""
},
{
"docid": "34b5edfc040c07f7d760163d1db6b270",
"score": "0.63493514",
"text": "def set_override(query_start:, query_end:, override_start:, override_end:,\n user_id:, schedule_id:)\n # Ruby 2.x style kw-args is required here to make hash passing easier\n\n endpoint = \"#{return_pagerduty_url(:schedules)}/#{schedule_id}/overrides?since=#{query_start}&until=#{query_end}\"\n\n data = {\n override: {\n user_id: user_id,\n start: override_start,\n end: override_end,\n }\n }\n\n post_object(endpoint, data)\n end",
"title": ""
},
{
"docid": "4a9ec4c4be8db7325ac1a928c512df7e",
"score": "0.61578035",
"text": "def attending(user, schedule)\n unless Attend.exists?(user, schedule)\n Attend.create(:user_id => user, :schedule_id => schedule)\n Attend.save\n end\n end",
"title": ""
},
{
"docid": "1504fe358ce83e6b9f9fdb9392c80c66",
"score": "0.61378014",
"text": "def create_schedule_override_with_http_info(identifier, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ScheduleOverrideApi.create_schedule_override ...\"\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling ScheduleOverrideApi.create_schedule_override\"\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 ScheduleOverrideApi.create_schedule_override\"\n end\n if @api_client.config.client_side_validation && opts[:'schedule_identifier_type'] && !['id', 'name'].include?(opts[:'schedule_identifier_type'])\n fail ArgumentError, 'invalid value for \"schedule_identifier_type\", must be one of id, name'\n end\n # resource path\n local_var_path = \"/v2/schedules/{identifier}/overrides\".sub('{' + 'identifier' + '}', identifier.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_identifier_type'].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 = @api_client.object_to_http_body(body)\n auth_names = ['GenieKey']\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 => 'CreateScheduleOverrideResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ScheduleOverrideApi#create_schedule_override\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9a72e70414dd4d6d6f2a309c0cc6c89c",
"score": "0.60523903",
"text": "def create\n\n # must remember which user built the schedule\n @schedule = @current_user.schedules.build(params[:schedule])\n\n respond_to do |format|\n if @schedule.save\n flash[:notice] = 'Schedule was successfully created.'\n format.html { redirect_to(@schedule) }\n format.xml { render :xml => @schedule, :status => :created, :location => @schedule }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "348dcaa629d20a0d148a50966c6d0db3",
"score": "0.6033994",
"text": "def build_schedule(*args)\n super(*args).tap do |schedule|\n schedule.absence = self\n end\n end",
"title": ""
},
{
"docid": "6fcbf2400b7ba53ecfc42062657f3417",
"score": "0.596426",
"text": "def create\n @schedule = current_user.schedules.build(schedule_params)\n authorize @schedule\n if Schedule.dup_time?(@schedule) || Schedule.dup_class?(@schedule)\n redirect_back(fallback_location: session[:previous], alert: 'Conflict Time!')\n elsif @schedule.save\n redirect_to @schedule, notice: 'Schedule was successfully created.'\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "4db2df39ae9cec63e93ef8a135664ec8",
"score": "0.59484524",
"text": "def create\n\t\t@schedule = Schedule.new(params[:schedule])\n\t\tcurrent_user.schedule = @schedule\n\n\t\trespond_to do |format|\n\t\t\tif current_user.save\n\t\t\t\tformat.html { redirect_to([current_user], :notice => 'Schedule was successfully created.') }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9772c0df9ae423bcd2a9a9cd0449a79f",
"score": "0.5920747",
"text": "def create\n @schedule = Schedule.new(params[:schedule])\n @schedule.assign_to = params[:users][0].to_i\n @schedule.user_id=current_user.id\n respond_to do |format|\n if @schedule.save\n format.html { redirect_to @schedule, :notice => 'Schedule was successfully created.' }\n format.json { render :json => @schedule, :status => :created, :location => @schedule }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcfd99b94357edd8d8baeeaa7b6bedb9",
"score": "0.5896993",
"text": "def allow_custom_assignment_schedule=(value)\n @allow_custom_assignment_schedule = value\n end",
"title": ""
},
{
"docid": "88fc055d3978256a9b0b980c6cef3e70",
"score": "0.58595973",
"text": "def create\n @schedule = current_user.schedules.new(schedule_params)\n \n respond_to do |format|\n if @schedule.save\n @schedule.update_weeks\n @schedule.update_days\n format.html { redirect_to @schedule, notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f405ee9894baa4120da59bd0a221f0f5",
"score": "0.5842567",
"text": "def create\n params[:schedule][:user] = current_user\n @schedule = params[:schedule][:type].constantize.new(params[:schedule])\n \n respond_to do |format|\n if @schedule.save\n format.html { redirect_to(schedule_url(@schedule), :notice => 'Schedule was successfully created.') }\n format.xml { render :xml => @schedule, :status => :created, :location => @schedule }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fc1e42732db3ac8bd2d24dd021821d6",
"score": "0.5805511",
"text": "def schedule=(value)\n @schedule = value\n end",
"title": ""
},
{
"docid": "8a5ef07b547168852efa2159eab7f92f",
"score": "0.57618326",
"text": "def schedule\n\t\t@user = load_user # private. at the very bottom\n\t\t@schedules = Schedule.all ## \n\t\t@schedule = Schedule.new ## \n\tend",
"title": ""
},
{
"docid": "6ed2269edf21a3e463d1c03ed48f69cb",
"score": "0.5760268",
"text": "def create\n @schedule = Schedule.new(schedule_params)\n if schedule_overlapping?(@schedule.salon_id, @schedule.start_time, @schedule.end_time)\n respond_to do |format|\n @salons = Salon.where(user_id: current_user.id)\n format.html { redirect_to :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n return\n end\n end\n respond_to do |format|\n if @schedule.save\n format.html { redirect_to @schedule, notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9d48a33cb1c8ae572414d1b4bbe45cc",
"score": "0.5701734",
"text": "def create\n @schedule = Schedule.new(schedule_params)\n\n if Schedule.start_date_exists? @schedule\n sched = Schedule.find_by_start_date @schedule\n redirect_to edit_user_schedule_path(@user, sched), notice: 'A schedule with this start date already exists.'\n elsif !Schedule.is_monday? @schedule.start_date\n redirect_to new_user_schedule_path(@user), notice: 'The selected start date is not a Monday.'\n else\n respond_to do |format|\n if @schedule.save\n ScheduleMailer.schedule_email(@schedule.user).deliver_later\n format.html { redirect_to user_schedules_path, notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "184a159466c340b9c0466e7c16c2e3d2",
"score": "0.56726325",
"text": "def schedule=(value)\n @schedule = value\n end",
"title": ""
},
{
"docid": "184a159466c340b9c0466e7c16c2e3d2",
"score": "0.56726325",
"text": "def schedule=(value)\n @schedule = value\n end",
"title": ""
},
{
"docid": "184a159466c340b9c0466e7c16c2e3d2",
"score": "0.56726325",
"text": "def schedule=(value)\n @schedule = value\n end",
"title": ""
},
{
"docid": "110858f9dbbd27305cdc91a26058e756",
"score": "0.5639235",
"text": "def schedule_create\n\t\t# schedule_params parameters include: user id, professor, etc. go to schedule.html\n\t\t@schedule = Schedule.new(schedule_params) # saving a new object in db\n\n\t\tif @schedule.save\n\t\t\tredirect_to '/main/class_schedule'\n\t\telse\n\t\t\t#handle error message here\n\t\t\tredirect_to '/main/class_schedule'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8347283e3846ff4f0b15c1d35df8b65e",
"score": "0.5605882",
"text": "def create_schedule_details\n\t\tMatch.create_schedule_match(self) \n\t\tif DISPLAY_PROFESSIONAL_SERVICES \n\t\t\tFee.create_group_fees(self) \n\t\t\tFee.create_user_fees(self) \n\t\tend\n\tend",
"title": ""
},
{
"docid": "d46a0baf9ddf99bb0afda93a95536b82",
"score": "0.559869",
"text": "def schedule_params\n params.require(:schedule).permit(:today, :user_id)\n end",
"title": ""
},
{
"docid": "02ef2f286b5a93aeab48a121d4ff953a",
"score": "0.5572138",
"text": "def set_user_schedule\n @user_schedule = UserSchedule.find(params[:id])\n end",
"title": ""
},
{
"docid": "02ef2f286b5a93aeab48a121d4ff953a",
"score": "0.5572138",
"text": "def set_user_schedule\n @user_schedule = UserSchedule.find(params[:id])\n end",
"title": ""
},
{
"docid": "0b28cc8fcbed549a988197f06740c943",
"score": "0.5571201",
"text": "def create\n authorize_action_for Schedule\n @schedule = current_user.schedules.new(schedule_params)\n\n respond_to do |format|\n if @schedule.save\n format.html { redirect_to @schedule, notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08d440c26f6dcfa1fc66fad76774bc6b",
"score": "0.5566151",
"text": "def schedule\n @schedule || DEFAULT_SCHEDULE\n end",
"title": ""
},
{
"docid": "4fe6cea02ed7aa6d223ad202bc81c7b6",
"score": "0.5566106",
"text": "def create\n @schedule = Schedule.new(schedule_params)\n @schedule.user = current_user\n\n respond_to do |format|\n if @schedule.save\n format.html { redirect_to @schedule, notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cd2dd75e69b62d7347e69eb3134af21",
"score": "0.55650824",
"text": "def create_from_params(params, user)\n super_return_value = super\n task_array = []\n super_return_value&.appeal.tasks.each { |task| task_array.push(task.class.to_s) }\n if super_return_value.class.to_s == \"IhpColocatedTask\" && task_array.include?(\"IhpColocatedTask\")\n appeal = super_return_value.appeal\n MetricsService.record(\"Sending VSO IHP pending notification to VA Notify for #{appeal.class} \"\\\n \"ID #{appeal.id}\",\n service: nil,\n name: \"AppellantNotification.notify_appellant\") do\n AppellantNotification.notify_appellant(appeal, @@template_name)\n end\n end\n super_return_value\n end",
"title": ""
},
{
"docid": "49befaafc5c04b566f105ed3f3968384",
"score": "0.55584514",
"text": "def schedule_params\n params.require(:schedule).permit(:title, :date_from, :date_to, :place, :content, :user_id, :color, schedule_users_attributes: [:id, :schedule_id, :user_id])\n end",
"title": ""
},
{
"docid": "29d0cee77b6c7042c7d6ea2867e43359",
"score": "0.5536245",
"text": "def create_schedule(name, desc, executor_name, schedule_data, trigger_point, options={})\n options = {\n delegated: true,\n allow_makeup: false,\n register: true\n }.merge options\n allow_makeup = options[:allow_makeup]\n delegated = options[:delegated]\n # Entire operation should reside in single transaction\n schedule = Schedule.new\n ActiveRecord::Base.transaction do\n begin\n schedule.name = name\n schedule.description = desc\n schedule.executor_name= executor_name\n schedule.data = schedule_data ? schedule_data : nil\n schedule.delegated = delegated\n now = trigger_point.to_s == 'now'\n if now\n schedule.at = Time.now\n else\n trigger_point.class == String ? schedule.crontab = trigger_point : schedule.at = trigger_point\n end\n schedule.active = true\n schedule.after = Time.now\n schedule.allow_makeup = allow_makeup\n if block_given?\n yield schedule\n end\n schedule.save!\n # Continue to create and store job\n register_schedule schedule, now if options[:register]\n Rails.logger.info \"Created schedule: #{schedule.to_s}. Next trigger is: #{schedule.next_trigger_at}.\"\n rescue\n Rollbar.error $!\n Rails.logger.error $!\n # Rethrow exception\n raise $!\n end\n end\n schedule\n end",
"title": ""
},
{
"docid": "ffe7b2460a649510a6b03af3baeae8e1",
"score": "0.5524114",
"text": "def create_calendar\n @calendar.create_schedule\n end",
"title": ""
},
{
"docid": "441af517794bde107ed5ae55af24ec96",
"score": "0.55206096",
"text": "def create\n @schedule = current_user.schedules.new(schedule_params)\n\n respond_to do |format|\n if @schedule.save\n format.html { redirect_to dashboard_path, notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cdb38b2015f2599a67d013619f57fa5c",
"score": "0.5515038",
"text": "def email_schedule_change\n notifier = ScheduleNotifier.new\n notifier.user = user\n notifier.send_notification\n end",
"title": ""
},
{
"docid": "eb028c5a4e08a242dfb265ac8881dbca",
"score": "0.5479328",
"text": "def create\n # start commit\n @applicant = Applicant.find(params[:schedule][:applicant_id])\n interviewer = Interviewer.find(params[:schedule][:interviewer_id])\n has_schedule = get_schedule(interviewer, @applicant.id)\n\n if params[:new_schedule] == 'Schedule' || params[:new_schedule] == 'Reschedule'\n\n if !params[:schedule][:sched_start].match('^\\d{2}-\\d{2}-\\d{4}$')\n hasError = true;\n end\n\n @date_and_time = '%m-%d-%Y'\n time = \"\"\n if params[:sched_time_start] != \"\" && params[:sched_time_end] != \"\"\n time_start = params[:sched_time_start].to_s+':00'\n time_end = params[:sched_time_end].to_s+':00'\n end\n\n begin\n date = DateTime.strptime(params[:schedule][:sched_start], @date_and_time).to_s.split('T')[0]\n DateTime.parse(date+' '+time_start+':00')\n DateTime.parse(date+' '+time_end+':00')\n rescue ArgumentError\n hasError = true;\n else\n params[:schedule][:sched_start] = ActiveSupport::TimeZone['Asia/Manila'].parse(date+' '+time_start+':00'+' Asia/Manila')\n params[:schedule][:sched_end] = ActiveSupport::TimeZone['Asia/Manila'].parse(date+' '+time_end+':00'+' Asia/Manila')\n end\n\n if params[:new_schedule] == \"Reschedule\"\n @schedule = has_schedule\n else\n @schedule = Schedule.new(params[:schedule])\n end\n\n if params[:schedule][:sched_start].to_s == \"\" ||\n params[:schedule][:sched_end].to_s == \"\"\n @schedule.realNil = true\n @schedule.hasError = false\n end\n if hasError && params[:schedule][:sched_start].to_s != \"\"\n @schedule.realNil = false\n @schedule.hasError = true\n else\n @schedule.sched_start = params[:schedule][:sched_start]\n @schedule.sched_end = params[:schedule][:sched_end]\n\n end\n # end if commit\n\n elsif params[:cancel_schedule] == 'Cancel'\n has_schedule.destroy\n end\n\n respond_to do |format|\n if params[:cancel_schedule] == 'Cancel'\n format.html { redirect_to(schedules_new_path(@applicant), :notice => 'Schedule was successfully cancelled.') }\n elsif @schedule.save\n if params[:new_schedule] == \"Reschedule\"\n AdminLog.create(:admin_id=>session[:admin_id], :log=>\"Reschedule -> \"+@schedule.id.to_s+\" to Applicant -> \"+@applicant.id.to_s)\n else\n AdminLog.create(:admin_id=>session[:admin_id], :log=>\"Assigned schedule -> \"+@schedule.id.to_s+\" to Applicant -> \"+@applicant.id.to_s)\n end\n format.html { redirect_to(schedules_new_path(@applicant), :notice => 'Schedule was successfully created.') }\n format.xml { render :xml => @schedule, :status => :created, :location => @schedule }\n else\n if !hasError\n @schedule.sched_start = @schedule.sched_start.strftime('%m-%d-%Y')\n @schedule.sched_end = @schedule.sched_end.strftime('%m-%d-%Y')\n end\n format.html { render :action => \"new\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f01dfddbd097cd5d320473cb59b0048",
"score": "0.5477921",
"text": "def create\n @schedule = current_user.schedules.new(schedule_params)\n if @schedule.save\n redirect_to schedules_path, notice: 'Schedule was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "8c096cd43dd22a7e8f82d542d5ce0fc6",
"score": "0.54718405",
"text": "def setSchedule(schedule)\n @schedule = schedule\n end",
"title": ""
},
{
"docid": "6212869931ab519ddbf2a77187d02a95",
"score": "0.54592395",
"text": "def user_schedule_params\n params.require(:user_schedule).permit(:schedule_id, :user_id, :user_notes, :attended, :term)\n end",
"title": ""
},
{
"docid": "d9bbff912faa9851e5a8c5fd16174125",
"score": "0.5458289",
"text": "def define_uptime(user)\n if user.role == \"Organisator\"\n @uptime = Uptime.create!(start_time: @event.start_time, user: user)\n @uptime.start_time = @event.start_time\n if @uptime.save\n redirect_to event_path(@event)\n end\n else\n ### uptime for invite people\n @event.start_event.empty? ? user_date = \"\" : user_date = @event.define_date_for_user\n @uptime = Uptime.create!(start_time: user_date, user: user)\n if @uptime.save\n redirect_to event_path(@event)\n end\n end\n end",
"title": ""
},
{
"docid": "ffdcaf4712e3d443eebde449dc38e8c3",
"score": "0.5449684",
"text": "def schedule_meeting\n end",
"title": ""
},
{
"docid": "c93554c9cb8fbfd155504b825688ea4b",
"score": "0.5433555",
"text": "def set_up_default_schedules\n (0..6).each do |day_of_week|\n @schedules[day_of_week] = Schedule.new({\n day_of_week: day_of_week,\n start_seconds: 0,\n end_seconds: 24 * 60 * 60 -1,\n service_id: @service.id\n })\n end\n end",
"title": ""
},
{
"docid": "604ec4584d5f9ccc83344bdb133b1af9",
"score": "0.5430942",
"text": "def schedule_params\n params.require(:schedule).permit(:user_id, :name, :info, :venue, :pre_strat_date, :pre_end_date, :start_date, :end_date, :repeating, :charged, :charge_amount)\n end",
"title": ""
},
{
"docid": "14ff17e2f83cf4fcd71deda46f9a948a",
"score": "0.5428332",
"text": "def create_schedule(schedule, options={})\n raise(ArgumentError, \"schedule has the wrong type\") unless schedule.is_a?(Invoicexpress::Models::Schedule)\n\n params = { :klass => Invoicexpress::Models::Schedule, :body => schedule }\n post(\"schedules.xml\", params.merge(options))\n end",
"title": ""
},
{
"docid": "c4ffe6fb07291bf417e5d291166ec2d7",
"score": "0.5405577",
"text": "def create\n\t\tverify_create_params\n\t\tverify_create_param_values\n\n\t\t@schedule = Schedule.create(name: params[:name],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttime: params[:time],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tis_active: params[:is_active],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tis_recurring: params[:is_recurring])\n\t\tparams[:days].each do |d|\n\t\t\t@schedule.schedule_days << ScheduleDay.create(day_id: d, schedule_id: @schedule.id)\n\t\tend\n\n\t\tscheduled_car = Car.find(params[:car_id])\n\t\tscheduled_car.schedules << @schedule\n\tend",
"title": ""
},
{
"docid": "2f09178bb29d91cf77f14de5538d91d2",
"score": "0.5401946",
"text": "def create_schedule(options={})\n create_request(\"nonpci\", CREATE_SCHEDULE_ACTION) do |xml|\n xml['px'].CreateSchedule do\n xml['px'].DigitalKey DirectDebit::Ezidebit::api_digital_key\n options.each { |key,value| xml['px'].send(key, value)}\n end\n end\n response = request_it!\n parse(response, \"generic_status_response\", 'CreateSchedule')\n end",
"title": ""
},
{
"docid": "c07e85fb5075c1f0d344afc9223a21d2",
"score": "0.53911453",
"text": "def schedule_params\n params.require(:schedule).permit(:user_id, :mon, :tue, :wed, :thu, :fri, :sat, :sun)\n end",
"title": ""
},
{
"docid": "5738b11f58e5e1d2307c6e18fdddb0e2",
"score": "0.53763086",
"text": "def set_schedule\n @schedule = current_user.schedules.find(params[:id])\n end",
"title": ""
},
{
"docid": "8abf66712db735635f7b63fbff546f8c",
"score": "0.5371492",
"text": "def create_social_account_and_schedule\n SocialAccount.create(profile: self)\n Schedule.create(profile: self)\n end",
"title": ""
},
{
"docid": "d6f0e1d53e2476b81eab1ea6b3c10203",
"score": "0.53659934",
"text": "def user_schedule_params\n params.require(:user_schedule).permit(:user_id, :schedule_id, :completed)\n end",
"title": ""
},
{
"docid": "6274fc3ed68a73b3c0362898a758f3f8",
"score": "0.5364994",
"text": "def create\n \n params[:days] = params[:days].to_json\n params[:schedule][:days] = params[:days]\n @schedule = Schedule.new(schedule_params)\n\n respond_to do |format|\n if @schedule.save\n @user = User.find(@schedule.user_id)\n ScheduleMailer.create_schedule(@schedule, @user).deliver_now\n format.html { redirect_to scheduler_schedules_path(user_id: @user.id), notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36d2c209008070a29acfd8b97d97e7e4",
"score": "0.5359472",
"text": "def schedule=(new_schedule)\n if new_schedule.nil?\n write_attribute(:schedule, nil)\n else\n write_attribute(:schedule, new_schedule.to_yaml)\n end\n end",
"title": ""
},
{
"docid": "e056663b431870396ad535bae37bee24",
"score": "0.5358083",
"text": "def schedule(name, data, schedule)\n puts \"Scheduling #{name}...\"\n raise \"Schedule must be a hash.\" if !schedule.is_a? Hash\n hash_to_send = {}\n schedules = []\n schedule[\"payload\"] = data.to_json\n schedule[\"name\"] = name unless schedule[\"name\"]\n schedule[\"code_name\"] = name unless schedule[\"code_name\"]\n schedules << schedule\n hash_to_send[\"schedules\"] = schedules\n add_sw_params(hash_to_send)\n# puts ' about to send ' + hash_to_send.inspect\n uri = project_url_prefix(get_project_id(data)) + \"schedules\"\n ret = post(uri, hash_to_send)\n ret\n end",
"title": ""
},
{
"docid": "729de03ece4a8cd3ce06748505e9685f",
"score": "0.53520346",
"text": "def schedule_params\n params.require(:schedule).permit(:user_id, :content)\n end",
"title": ""
},
{
"docid": "ad8073f0164be34b5e96f4ea4ef7c163",
"score": "0.5351261",
"text": "def create_schedule\n first_schedule = { Monday: '0000 0000',\n Tuesday: '0000 0000',\n Wednesday: '0000 0000',\n Thursday: '0000 0000',\n Friday: '0000 0000',\n Saturday: '0000 0000',\n Sunday: '0000 0000',\n current: true }\n second_schedule = { Monday: '0000 0000',\n Tuesday: '0000 0000',\n Wednesday: '0000 0000',\n Thursday: '0000 0000',\n Friday: '0000 0000',\n Saturday: '0000 0000',\n Sunday: '0000 0000',\n current: false }\n schedules.build(first_schedule)\n schedules.build(second_schedule)\n end",
"title": ""
},
{
"docid": "07b0d4192a88668c2e7878ab36a0fd13",
"score": "0.53461665",
"text": "def create_schedule (schedule, staff)\n\tstaff_temp = staff\n\tschedule = Array.new\n\tproject_name = Array.new\n\t\n\t#Create an array with names for each project\n\tstaff_temp.each do |person|\n\t\tproject_name.push (person.project) if (!project_name.include?(person.project))\n\tend\n\n\t#Add an author for each project to the schedule\n\tproject_name.each do |proj|\n\t\ttmp = staff_temp.select {|x| x.project.match /#{proj}/ } \n\t\tschedule.push(Review.new(tmp[0],nil))\n\tend\n\n\t#Add a reviewer to the schedule ensuring that nobody reviews their own code\n\tschedule.each do |review|\t\n\t\ttmp = staff_temp.select {|x| !x.name.include? review.author.name } \n\t\treview.reviewer = tmp[0]\n\t\tstaff_temp.delete(tmp[0])\n\tend\n\t\n\t#print out all the people that have not been used as a reviewer. This information\n\t#allows for balancing of people\n\tstaff_temp.each do |person|\n\t\tputs \"#{person.name} is unused as a reviewer\"\n\tend\n\n\tschedule\nend",
"title": ""
},
{
"docid": "5c94723e1ce3feab32ab464cf5755fb6",
"score": "0.5337912",
"text": "def set_schedule_user\n @schedule_user = ScheduleUser.find(params[:id])\n end",
"title": ""
},
{
"docid": "7541454a49cd34cb8fd55398fb2a56bc",
"score": "0.53353596",
"text": "def schedule_params\n params.require(:schedule).permit(:user_id,:days, :repeat_to)\n end",
"title": ""
},
{
"docid": "82a7d589f39b5c51f49a9b5004725b7f",
"score": "0.53342503",
"text": "def schedule(start_time, end_time)\n @changed = true\n @ews_item[:oof_settings][:oof_state] = :scheduled\n set_duration start_time, end_time\n end",
"title": ""
},
{
"docid": "4d6b6fd50ee03dd2f1a2aadb21789b44",
"score": "0.53224134",
"text": "def create\n # In case it is a reserve/ overdue/ or under-repair schedule, call relevant handler\n if params.has_key?('trigger')\n return create_on_trigger\n end\n\n # HACK - to initialize @venue on create from fix _form.html.erb to pass correct params :-(\n if params.has_key?(:kit_id)\n kit_id = params[:kit_id].to_i\n elsif params.has_key?(:kit_schedule)\n kit_id = (params[:kit_schedule][:kit_id]).to_i if params[:kit_schedule].has_key?(:kit_id)\n end\n\n @kit = ::Kit.find(kit_id)\n @kit.current_user = current_user\n @kit_schedule = @kit.kit_schedules.new(params[:kit_schedule])\n @kit_schedule.current_user = current_user\n\n respond_to do |format|\n if @kit_schedule.can_create?\n if @kit_schedule.send(::KitSchedule::EVENT_BLOCK) && @kit_schedule.save\n format.html { redirect_to @kit_schedule.program, notice: 'Kit schedule was successfully created.'}\n format.json { render json: @kit_schedule, status: :created, location: @kit_schedule }\n else\n #render :action => 'new'\n format.html { render action: \"new\" }\n format.json { render json: @kit_schedule.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to kit_schedules_path(:kit_id => @kit_schedule.kit), :alert => \"[ ACCESS DENIED ] Cannot perform the requested action. Please contact your coordinator for access.\" }\n format.json { render json: @kit_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6db0a8d1d46446f614527fc0e5dd47ba",
"score": "0.53214526",
"text": "def schedule(class_name, data, schedule)\n puts \"Scheduling #{class_name}...\"\n raise \"Schedule must be a hash.\" if !schedule.is_a? Hash\n# if !data.is_a?(Array)\n# data = [data]\n# end\n hash_to_send = {}\n hash_to_send[\"payload\"] = data\n hash_to_send[\"class_name\"] = class_name\n hash_to_send[\"schedule\"] = schedule\n add_sw_params(hash_to_send)\n# puts ' about to send ' + hash_to_send.inspect\n ret = post(\"scheduler/schedule\", hash_to_send)\n ret\n end",
"title": ""
},
{
"docid": "6db0a8d1d46446f614527fc0e5dd47ba",
"score": "0.53214526",
"text": "def schedule(class_name, data, schedule)\n puts \"Scheduling #{class_name}...\"\n raise \"Schedule must be a hash.\" if !schedule.is_a? Hash\n# if !data.is_a?(Array)\n# data = [data]\n# end\n hash_to_send = {}\n hash_to_send[\"payload\"] = data\n hash_to_send[\"class_name\"] = class_name\n hash_to_send[\"schedule\"] = schedule\n add_sw_params(hash_to_send)\n# puts ' about to send ' + hash_to_send.inspect\n ret = post(\"scheduler/schedule\", hash_to_send)\n ret\n end",
"title": ""
},
{
"docid": "bc1eddcd54dcaa8d335b5ae7d2937f3a",
"score": "0.5319898",
"text": "def schedule_meeting(params = {})\n @org_name ||= params[:orgName]\n tags = params[:tags]\n start_time = params[:startTime]\n time_zone = params[:timeZone]\n end_time = params[:endTime]\n user = params[:user]\n desc = params[:description]\n room_id = set_room_id\n\n address = join_room_helper(@server_address,@org_name, room_id, user,true)\n create_schedule(room_id, user, tags,desc, @parent_org, address,start_time,end_time, time_zone)\n end",
"title": ""
},
{
"docid": "a6fb330acf8aa9e8fff84fe42d61217e",
"score": "0.5318763",
"text": "def schedule_params\n params.require(:schedule).permit(:start_time, :end_time, :morning_ride, :evening_ride, :all_day, :weekly_ride, :custom_ride)\n end",
"title": ""
},
{
"docid": "15b828c04182ae364671db7ae346c86b",
"score": "0.53186184",
"text": "def delete_schedule_override(schedule_id, override_id)\n boolean_from_response :delete, \"/schedules/#{schedule_id}/overrides/#{override_id}\"\n end",
"title": ""
},
{
"docid": "ba2e2e62407f47b43df042bb27970fa0",
"score": "0.53133255",
"text": "def schedule_params \n params.require(:schedule).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "e065e4fa59f320e158883afd3b5f3c5c",
"score": "0.53124046",
"text": "def set_schedule\n @schedule = current_user.schedules.find(params[:id])\n end",
"title": ""
},
{
"docid": "f1d5129cf4a816e2f44d73c0fdeb3a1e",
"score": "0.53075665",
"text": "def schedule_test\n @user = grab_user\n @user.save!\n @exam = valid_exam_schedule_request?\n create_exam_user_join\n\n render json: \"Exam scheduled for #{user_params[:start_time]}\", status: :ok\n rescue StandardError => e\n render json: e.message, status: 400\n end",
"title": ""
},
{
"docid": "3f39be8b55a5dd60749f1236e406bb31",
"score": "0.530429",
"text": "def schedule\n @schedule ||= self.class.schedule_class.new(self, @batch)\n end",
"title": ""
},
{
"docid": "fa23c12efd90a8a3adc302db32a24f71",
"score": "0.52939206",
"text": "def set_occupancy_schedule(value)\n \n end",
"title": ""
},
{
"docid": "4b89fc309bdc09d2faf185471f38fc96",
"score": "0.5288786",
"text": "def schedule; end",
"title": ""
},
{
"docid": "368d5924dc4621cf8ad9c7b14691dcd9",
"score": "0.5286457",
"text": "def schedule_params\n params.require(:schedule).permit(:user_id)\n end",
"title": ""
},
{
"docid": "6177e336056efddbaffb772842abc271",
"score": "0.5284524",
"text": "def schedule_params\n params.require(:schedule).permit(:room, :date, :time_start, :time_end, :user_id)\n end",
"title": ""
},
{
"docid": "8bd52779d85caac56f8ff6beb970eb8b",
"score": "0.5284049",
"text": "def schedule_params\n params.require(:schedule).permit(:workdate, :workpart, :uid, :uname, :site)\n end",
"title": ""
},
{
"docid": "0201a3e4e1c956e357b109185a43e6cc",
"score": "0.5270949",
"text": "def create\n @save = false\n @schedule = Schedule.new(params[:schedule])\n # First check if there is a schedule that intersects\n if !@schedule.same_hours? and @schedule.save\n @save = true\n end \n end",
"title": ""
},
{
"docid": "38e7c72f2e55457a998ec84bc6aac23e",
"score": "0.52683",
"text": "def create_schedule\n mon = Day.find_by(name: 'Monday')\n tues = Day.find_by(name: 'Tuesday')\n wed = Day.find_by(name: 'Wednesday')\n thurs = Day.find_by(name: 'Thursday')\n fri = Day.find_by(name: 'Friday')\n sat = Day.find_by(name: 'Saturday')\n sun = Day.find_by(name: 'Sunday')\n\n self.schedules.create(day: mon)\n self.schedules.create(day: tues)\n self.schedules.create(day: wed)\n self.schedules.create(day: thurs)\n self.schedules.create(day: fri)\n self.schedules.create(day: sat)\n self.schedules.create(day: sun)\n end",
"title": ""
},
{
"docid": "b572493d73334880778664c042e9b96b",
"score": "0.5266112",
"text": "def initialize(args={})\n @schedule = args[:schedule] || Schedule.new\n end",
"title": ""
},
{
"docid": "4cab5cf05e513f03387f0c59ce565c19",
"score": "0.52642167",
"text": "def schedule=(new_schedule)\n write_attribute(:schedule, RecurringSelect.dirty_hash_to_rule(new_schedule).to_hash)\n end",
"title": ""
},
{
"docid": "1238f1f10564e594df7cced49ad1cb58",
"score": "0.52638674",
"text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n # assign the user inputs to variables\n schedule = runner.getOptionalWorkspaceObjectChoiceValue('schedule', user_arguments, model)\n new_start = runner.getIntegerArgumentValue('new_start', user_arguments)\n new_end = runner.getIntegerArgumentValue('new_end', user_arguments)\n new_dur = new_end - new_start\n\n runner.registerInfo(\"The new schedule duration is #{new_dur}\")\n\n # check the schedule for reasonableness\n apply_to_all_schedules = false\n if schedule.empty?\n handle = runner.getStringArgumentValue('schedule', user_arguments)\n if handle.empty?\n runner.registerError('No schedule was chosen.')\n else\n runner.registerError(\"The selected schedule with handle '#{handle}' was not found in the model. It may have been removed by another measure.\")\n end\n return false\n else\n if !schedule.get.to_ScheduleRuleset.empty?\n schedule = schedule.get.to_ScheduleRuleset.get\n elsif !schedule.get.to_Building.empty?\n apply_to_all_schedules = true\n else\n runner.registerError('Script Error - argument not showing up as schedule.')\n return false\n end\n end\n\n # get schedules for measure\n schedules = []\n if apply_to_all_schedules\n raw_schedules = model.getScheduleRulesets\n raw_schedules.each do |raw_schedule|\n if raw_schedule.directUseCount > 0\n if raw_schedule.name.get[\"OCC_SCH\"] or raw_schedule.name.get[\"LIGHT_SCH\"] or raw_schedule.name.get[\"EQUIP_SCH\"] or raw_schedule.name.get[\"ACTIVITY_SCH\"]\n schedules << raw_schedule\n end\n end\n end\n\n else\n schedules << schedule # only run on a single schedule\n end\n\n schedules.each do |schedule|\n # array of all profiles to change\n profiles = []\n\n # push default profiles to array\n default_rule = schedule.defaultDaySchedule\n profiles << default_rule\n\n # push profiles to array\n rules = schedule.scheduleRules\n rules.each do |rule|\n day_sch = rule.daySchedule\n profiles << day_sch\n end\n\n # add design days to array\n summer_design = schedule.summerDesignDaySchedule\n winter_design = schedule.winterDesignDaySchedule\n profiles << summer_design\n profiles << winter_design\n\n # reporting initial condition of model\n if apply_to_all_schedules\n runner.registerInitialCondition(\"#{schedules.size} schedules are used in this model.\")\n else\n runner.registerInitialCondition(\"Schedule #{schedule.name} has #{profiles.size} profiles including design days.\")\n end\n\n # rename schedule\n schedule.setName(\"#{schedule.name} Expanded or Contracted\")\n\n # give info messages as I change specific profiles\n runner.registerInfo(\"Adjusting #{schedule.name}\")\n\n # edit profiles\n profiles.each do |day_sch|\n old_times = day_sch.times\n old_values = day_sch.values\n\n old_start = []\n for i in 0..(old_values.length - 1)\n if i == (old_values.length - 1)\n old_start = OpenStudio::Time.new(0, 0, 0, 0)\n next\n end\n if old_values[i] <= 0.01 && old_values[i+1] > 0.01\n old_start << old_times[i+1]\n if old_start.length > 1\n old_start = old_start.min\n end\n end\n end\n old_start = old_start::hours\n\n runner.registerInfo(\"Cupcake #{old_start}\")\n\n old_end = []\n for i in 0..(old_values.length - 1)\n if i == (old_values.length - 1)\n old_end = old_times[0]\n next\n end\n if old_values[i] <= 0.01 && old_values[i-1] > 0.01\n old_end << old_times[i-1]\n if old_end.length > 1\n old_end = old_end.max\n end\n end\n end\n old_end = old_end::hours\n\n\n old_sch = old_values[old_start..old_end]\n old_dur = old_sch.length\n\n chunked = chunk_schedule(old_sch)\n\n # you can update to the method below once OS supports ruby 2.5.1\n #chunked = old_sch.chunk_while {|i,j| i == j}.to_a\n\n # clear old_values\n day_sch.clearValues\n\n # reorganize schedule based on specified start and end points\n if chunked.class == Float\n for i in new_start..new_end\n day_sch.addValue(OpenStudio::Time.new(0,i, 0, 0), chunked) # add new values\n end\n else\n chunk_values = []\n percentage = []\n for chunk in chunked\n percentage << chunk.length/old_dur.to_f\n chunk_values << chunk[0]\n end\n nhrs = []\n for p in percentage\n nhrs << (p*new_dur).round # calculate number of hours for each value\n end\n new_values = []\n for i in 0..(chunk_values.length-1)\n new_values = new_values + Array.new(nhrs[i], chunk_values[i]) # create new value array\n end\n for i in new_start..(new_start+new_values.length-1)\n day_sch.addValue(OpenStudio::Time.new(0, i, 0, 0), new_values[i-new_start]) # add new values\n end\n end\n\n end\n end\n\n # reporting final condition of model\n runner.registerFinalCondition('Expanded or contracted profiles for all schedules.')\n\n return true\n end",
"title": ""
},
{
"docid": "5343d9262ec519b270d30809799d3a92",
"score": "0.52631253",
"text": "def create\n @schedule = Schedule.new(schedule_params).tap { |schedule| schedule.payee_id = @payee.id }\n\n respond_to do |format|\n if @schedule.save\n format.html { redirect_to @payee, notice: 'Schedule was successfully created.' }\n format.json { render :show, status: :created, location: @schedule }\n else\n format.html { render :new }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6567d00a900b48e3df72e63b625a3a96",
"score": "0.52612984",
"text": "def _schedule(date)\n\t\t\t\t\t\n\t\t\t\t\t# Save\n\t\t\t\t\tself.schedule_date = date\n\n\t\t\t\t\t# Schedule to exact time in given date\n\t\t\t\t\tself.schedule_from = DateTime.compose(date, self.from)\n\t\t\t\t\t\n\t\t\t\t\t# Schedule to exact time in given date\n\t\t\t\t\tself.schedule_to = DateTime.compose(date, self.to)\n\t\t\t\t\t\n\t\t\t\t\treturn self\n\t\t\t\tend",
"title": ""
},
{
"docid": "659e11e88022b94110c9a52b0f1ee881",
"score": "0.52523",
"text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n\t # assign the user inputs to variables\n\t\targs = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments(model))\n\t\tunless args\n\t\t\treturn false\n\t\tend\n\n\t\t# create replacement schedule\n\t\truleset_name = \"optimized_cooling_setpoint_schedule\"\n\t\tdesign_day_schedule_array = []\n\t\tdefault_day_schedule_array = [\"AllDays\"]\n\t\tfor i in 1..24\n\t\t\tdesign_day_schedule_array << [i,args[\"hour_#{i}_setpoint\"]]\n\t\t\tdefault_day_schedule_array << [i,args[\"hour_#{i}_setpoint\"]]\n\t\tend\n\t\twinter_design_day = design_day_schedule_array\n summer_design_day = design_day_schedule_array\n\t\tdefault_day = default_day_schedule_array\n\t\t\n options = {\"name\" => ruleset_name,\n \"winter_design_day\" => winter_design_day,\n \"summer_design_day\" => summer_design_day,\n \"default_day\" => default_day}\n new_clg_set_sch = OsLib_Schedules.createComplexSchedule(model, options)\n\n runner.registerInfo(\"Added schedule #{new_clg_set_sch.name}\")\n\t\t\n\t\t# replace existing thermostat schedules\n\t\tthermostats = model.getThermostatSetpointDualSetpoints\n\t\tthermostats.each do |thermostat|\n\t\t\t# check for existing cooling setpoint schedule\n\t\t clg_set_sch = thermostat.coolingSetpointTemperatureSchedule\n\t\t if not clg_set_sch.empty?\n\t\t\t\t#set cooling setpoint schedule\n\t\t\t\tthermostat.setCoolingSetpointTemperatureSchedule(new_clg_set_sch)\n\t\t\telse\n\t\t runner.registerWarning(\"Thermostat '#{thermostat.name.to_s}' doesn't have a cooling setpoint schedule. Not assigning new setpoint schedule.\")\n\t\t\tend\n\t\tend #end thermostats.each do\n\n return true\n end",
"title": ""
},
{
"docid": "671b940f8b456c4f71d9a92e15827b1e",
"score": "0.52497387",
"text": "def set_schedule\n @schedule = policy_scope(Schedule).find(params[:id])\n end",
"title": ""
},
{
"docid": "ac0dee20b1c0debaaef7d6d91ab9b94e",
"score": "0.52487415",
"text": "def schedule(specifier, task)\n @project.schedules << {\n specifier: specifier,\n task: task\n }\n end",
"title": ""
},
{
"docid": "5c928e972fd2eb16aa4d476f17198926",
"score": "0.5246102",
"text": "def schedule_overrides(id, options = {})\n query_params = Hash.new\n query_params[:since] = options[:since].utc.iso8601 if options[:since]\n query_params[:until] = options[:until].utc.iso8601 if options[:until] \n query_params[:overflow] = options[:overflow] if options[:overflow]\n query_params[:editable] = options[:editable] if options[:editable]\n \n response = get \"/schedules/#{id}/overrides\", options.merge({query: query_params})\n response[:overrides]\n end",
"title": ""
},
{
"docid": "56e49631e98b66a6c7221e9c038beda3",
"score": "0.5236182",
"text": "def create\n puts \"running create\"\n @event = current_user.events.create(event_params)\n # If no days are created init then forces creation of a blank schedule\n if @event.schedule.try(:days) == nil\n @schedule = @event.create_schedule(event_id: @event.id, user_id: current_user.id)\n end\n \n #@schedule.days.create\n\n\n \n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c719a006fdb6ab028fc385cc5a824a65",
"score": "0.5229613",
"text": "def update_schedule_override_with_http_info(identifier, _alias, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ScheduleOverrideApi.update_schedule_override ...\"\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling ScheduleOverrideApi.update_schedule_override\"\n end\n # verify the required parameter '_alias' is set\n if @api_client.config.client_side_validation && _alias.nil?\n fail ArgumentError, \"Missing the required parameter '_alias' when calling ScheduleOverrideApi.update_schedule_override\"\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 ScheduleOverrideApi.update_schedule_override\"\n end\n if @api_client.config.client_side_validation && opts[:'schedule_identifier_type'] && !['id', 'name'].include?(opts[:'schedule_identifier_type'])\n fail ArgumentError, 'invalid value for \"schedule_identifier_type\", must be one of id, name'\n end\n # resource path\n local_var_path = \"/v2/schedules/{identifier}/overrides/{alias}\".sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'alias' + '}', _alias.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_identifier_type'].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 = @api_client.object_to_http_body(body)\n auth_names = ['GenieKey']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UpdateScheduleOverrideResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ScheduleOverrideApi#update_schedule_override\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7dc4d989f391f133b84dd1a6be9a875f",
"score": "0.522808",
"text": "def create\n super do |resource|\n # https://github.com/RolifyCommunity/rolify/issues/246\n params['user']['_roles'] ||= []\n params['user']['_roles'].each do |role|\n resource.add_role role\n end\n @show = params['user']['_show']\n @is_manager = params['user']['team_manager?'] || false\n if @show != 'nil'\n @show_membership = ShowMembership.create(user: resource, show: Show.find(@show))\n end\n\n @team = params['user']['_team']\n if @team != 'nil'\n @team_membership = TeamMembership.create(user:resource, team:Team.find(@team), is_manager: @is_manager)\n end\n\n # Notify webmaster there's a user to approve\n if resource.errors.empty?\n GenericMailer.new_user_notification(resource).deliver_later\n end\n end\n end",
"title": ""
},
{
"docid": "318b279c4e02d4a4afa875568bcbc1e3",
"score": "0.52266747",
"text": "def initialize(args={})\n @schedule = args[:schedule] || Schedule.new\n # ...\n end",
"title": ""
},
{
"docid": "318b279c4e02d4a4afa875568bcbc1e3",
"score": "0.52266747",
"text": "def initialize(args={})\n @schedule = args[:schedule] || Schedule.new\n # ...\n end",
"title": ""
},
{
"docid": "2c2de7df139e3050a56a3d4364cc6e6e",
"score": "0.5202449",
"text": "def schedule=(new_schedule)\n write_attribute(:schedule, new_schedule.to_hash)\n end",
"title": ""
},
{
"docid": "677ebb1ea82f31381d7d0b8dc6a3cd6f",
"score": "0.5197346",
"text": "def initialize(args = {})\n @schedule = args[:schedule] || Schedule.new\n end",
"title": ""
},
{
"docid": "073524510c1e297b83f44f028320a844",
"score": "0.5188236",
"text": "def update\n temp = current_user.schedules.build(schedule_params)\n temp.id = params[:id]\n authorize @schedule\n if Schedule.dup_time?(temp) || Schedule.dup_class?(temp)\n binding.pry\n redirect_back(fallback_location: session[:previous], alert: 'Conflict Time!')\n elsif @schedule.update(schedule_params)\n redirect_to @schedule, notice: 'Schedule was successfully updated.'\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "bc2b96b63e07680e369da3d69e7e7b46",
"score": "0.5182782",
"text": "def target_schedule=(value)\n @target_schedule = value\n end",
"title": ""
},
{
"docid": "54b1e23c0c3e1e827bc4cd3050b6e478",
"score": "0.51805377",
"text": "def schedule_params\n params.require(:schedule).permit(:title, :start, :end, :trainer_id, :account_id)\n end",
"title": ""
},
{
"docid": "4ca5d7d923e9c9125f519e619d45045a",
"score": "0.51796263",
"text": "def preop_created\n schedule_reminder(:pending)\n end",
"title": ""
},
{
"docid": "7d170629a6393dbf29e211b1eb2be9d0",
"score": "0.51783055",
"text": "def create\n @schedule_item = ScheduleItem.new(schedule_item_params)\n @schedule_item.user = current_user\n respond_to do |format|\n if @schedule_item.save\n format.html { redirect_to schedule_items_path, notice: 'Schedule item was successfully created.' }\n format.json { render :show, status: :created, location: @schedule_item }\n else\n format.html { render :new }\n format.json { render json: @schedule_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3f6aa097cd7c7ec94468abb6d8608d6",
"score": "0.51734024",
"text": "def schedule(time)\n @schedule_at = time\n end",
"title": ""
},
{
"docid": "2d70dc098ee4e11fc0db040079440054",
"score": "0.5170718",
"text": "def update!(**args)\n @can_reschedule = args[:can_reschedule] if args.key?(:can_reschedule)\n @end_time = args[:end_time] if args.key?(:end_time)\n @rollout_management_policy = args[:rollout_management_policy] if args.key?(:rollout_management_policy)\n @start_time = args[:start_time] if args.key?(:start_time)\n end",
"title": ""
},
{
"docid": "2d70dc098ee4e11fc0db040079440054",
"score": "0.5170718",
"text": "def update!(**args)\n @can_reschedule = args[:can_reschedule] if args.key?(:can_reschedule)\n @end_time = args[:end_time] if args.key?(:end_time)\n @rollout_management_policy = args[:rollout_management_policy] if args.key?(:rollout_management_policy)\n @start_time = args[:start_time] if args.key?(:start_time)\n end",
"title": ""
},
{
"docid": "395ddce948cd1f79870db2c0e0f0a69a",
"score": "0.5166522",
"text": "def modifier!\r\n self.sender_name = @@current_user.real_name\r\n # for time_place settings\r\n if self.time_place_settings\r\n unless time_including_setting\r\n self.start_datetime, self.end_datetime = self.start_date.beginning_of_day, self.end_date.end_of_day\r\n end\r\n set_schedule_time_attrs\r\n else\r\n self.start_date = self.end_date = self.start_datetime = self.end_datetime = self.schedule_day_of_week = nil\r\n end\r\n \r\n # modify place_run_id from id\r\n place_id = self.place_run_id\r\n if place_id\r\n self.place_run_id = Space.find(place_id).run_id\r\n end\r\n\r\n if !self.questionnaires.blank?\r\n self.article_class = Questionnaire_Class\r\n end\r\n end",
"title": ""
},
{
"docid": "0727daa5ed6290bd7639ac89bd012063",
"score": "0.5161554",
"text": "def schedule *args\n fill_timeline Timeline.new(), args\n end",
"title": ""
}
] |
e4dc36d3f295119bd48b5baec9e73098
|
POST /talks POST /talks.json
|
[
{
"docid": "c19f4a11b89018b1e912830f2eee65e1",
"score": "0.59236974",
"text": "def create\n # TBD: we would like to return to the 'control' screen from create, not to the default\n @talk = Talk.new(talk_params)\n @talk.person_id = current_person.id # TBD: use one of the association functions for this?\n status_set params['commit']\n respond_to do |format|\n # TBD: does this work or do we have to explicitly set the talk_id in the partner record?\n if @talk.save \n post_status_change\n # TBD: this is a bit fragile: create a partnership function to do this instead\n Partner.admin(@talk.person_id, @talk.id)\n format.html { \n # after create we generally want to go to the control page for the talk, hence:\n redirect_back_or control_talk_url(@talk)\n # are we seeing the flash?\n flash.now[:success] = 'A talk is born!'\n }\n # TBD: on format.json, do we want action: 'show' or do we want 'index'? what does 'location: model' mean?\n format.json { render action: 'control', status: :created, location: @talk }\n else\n fail_q(@talk, format, 'new')\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "f4d253965f3def04647d6b65e5501870",
"score": "0.73805135",
"text": "def create\n @talk = current_user.talks.new(params[:talk])\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to @talk, notice: 'Talk was successfully created.' }\n format.json { render json: @talk, status: :created, location: @talk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9333286499175ab979a124d63691049",
"score": "0.7333746",
"text": "def create\n @talk = Talk.new(talk_params)\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to @talk, notice: 'Talk was successfully created.' }\n format.json { render :show, status: :created, location: @talk }\n else\n format.html { render :new }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9333286499175ab979a124d63691049",
"score": "0.7333746",
"text": "def create\n @talk = Talk.new(talk_params)\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to @talk, notice: 'Talk was successfully created.' }\n format.json { render :show, status: :created, location: @talk }\n else\n format.html { render :new }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cab1150bd488d3595df1a30925bc24e",
"score": "0.7155928",
"text": "def create\n @meeting = Meeting.find(params[:meeting_id])\n @talk = @meeting.talks.new(params[:talk])\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to meeting_talk_url(@meeting,@talk), notice: 'Talk was successfully created.' }\n format.json { render json: @talk, status: :created, location: meeting_talk_url(@meeting,@talk) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c6e4e6222e6026fe63f1fb993bf0147",
"score": "0.6986116",
"text": "def create\n @talk = Talk.new(talk_params)\n @talk.meeting_id ||= params[:meeting_id]\n @talk.speaker_id ||= params[:speaker_id]\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to @talk, notice: 'Talk was successfully created.' }\n format.json { render :show, status: :created, location: @talk }\n else\n format.html { render :new }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbbb4686f008f295ca882e61a47306de",
"score": "0.68976283",
"text": "def create\n @event = Event.find(params[:event_id])\n @talk = @event.talks.new(talk_params)\n @talk.created_by = current_user\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to event_talks_path(@event), notice: 'Talk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @talk }\n else\n format.html { render action: 'new' }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "309d45817d2d8365f3a7f9926e3164a6",
"score": "0.6798237",
"text": "def create\n @talk = Talk.new(params[:talk])\n\n respond_to do |format|\n if @talk.save\n flash[:notice] = 'Talk was successfully created.'\n format.html { redirect_to(@talk) }\n format.xml { render :xml => @talk, :status => :created, :location => @talk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @talk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2f5993efb2e4581b2558c9604bbf68e",
"score": "0.67364186",
"text": "def create\n respond_to do |format|\n if @talk.save\n flash[:notice] = 'Talk was successfully created.'\n format.html { redirect_to([@talk.conference, @talk]) }\n format.xml { render :xml => @talk, :status => :created, :location => @talk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @talk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e08af64bac7502c9b5c8c4050050a90d",
"score": "0.6727565",
"text": "def create\n @talk = Talk.new(params[:talk])\n\n respond_to do |format|\n if @talk.save\n# format.html { redirect_to(@talk, :notice => 'Talk was successfully created.') }\n format.html { redirect_to(talks_path, :notice => 'Talk was successfully created.') }\n format.xml { render :xml => @talk, :status => :created, :location => @talk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @talk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b5a1bfdbfdae5a8bdb824928543c80e",
"score": "0.6650561",
"text": "def create\n @talk = PostedTalk.new(params[:posted_talk])\n @talk.sender_ip = request.remote_ip\n respond_to do |format|\n if @talk.save\n @talk.notify_organizers\n flash[:confirm] = \"Your talk ‘#{@talk.title}’ has been created. Please wait for one of the organizers to approve your talk.\"\n format.html { render :action => \"show\" }\n format.json { render json: @talk, status: :created, location: @talk }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd7ebc2359573badf04f1ada30305ca7",
"score": "0.6589099",
"text": "def talk_params\n params.require(:talk).permit(:title, :date, :slides, speaker_ids: [])\n end",
"title": ""
},
{
"docid": "e405ce219cc29c05289746adeb69a757",
"score": "0.65641385",
"text": "def talk_params\n params.require(:talk).permit(:date, :title, :description, :speaker_id, :meeting_id)\n end",
"title": ""
},
{
"docid": "db0b663adbb49b055e5f0690873d439c",
"score": "0.6509616",
"text": "def create\n\n @talk.contestant_id = current_user.id\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to @talk, notice: 'Talk was successfully created.' }\n format.json { render json: @talk, status: :created, location: @talk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a879f860e02fb3b894f8c48467fe6922",
"score": "0.64938635",
"text": "def list_talks\n @client.entries(content_type: :talk)\n .to_a\n .map { |t| make_talk t }\n end",
"title": ""
},
{
"docid": "09822201e17938310ac15946f012c613",
"score": "0.6483704",
"text": "def talk_params\n params.require(:talk).permit(:to_id, :content)\n end",
"title": ""
},
{
"docid": "56e467f1392b2ec7cf0cf03e935bdc5a",
"score": "0.6472492",
"text": "def create\n @talk = Talk.new(talk_params.merge({from_id: current_user.id}))\n\n respond_to do |format|\n if @talk.save\n format.js\n format.html { redirect_to @talk, notice: 'Talk was successfully created.' }\n format.json { render :show, status: :created, location: @talk }\n else\n format.html { render :new }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abc1d1443529047cf8aac937ded241dc",
"score": "0.64694524",
"text": "def talk_params\n params.require(:talk).permit(:speaker_name, :speaker_email, :speaker_twitter, :speaker_company, :speaker_biography, :talk_title, :talk_abstract, :talk_duration, :notes)\n end",
"title": ""
},
{
"docid": "86089a4233c4d7ad8d2b386f0d810236",
"score": "0.64537406",
"text": "def create\n @talk = @venue.talks.new(params[:talk])\n\n respond_to do |format|\n if @talk.save\n flash[:notice] = 'Talk was successfully created.'\n format.html { redirect_to(admin_venue_talks_path(@venue)) }\n format.xml { render :xml => @talk, :status => :created, :location => @talk }\n else\n format.html { render :action => 'new' }\n format.xml { render :xml => @talk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f78870ab5452368cd626e4fda796894",
"score": "0.6445851",
"text": "def create\n @lightning_talk = LightningTalk.new(params[:lightning_talk])\n\n respond_to do |format|\n if @lightning_talk.save\n format.html { redirect_to @lightning_talk, notice: 'Lightning talk was successfully created.' }\n format.json { render json: @lightning_talk, status: :created, location: @lightning_talk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lightning_talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "897f559ac18c582c5c8a852a0b9f7901",
"score": "0.64133865",
"text": "def talk_params\n params.require(:talk).permit(:villager_id, :content, :stamp_no)\n end",
"title": ""
},
{
"docid": "8a82fab09facb1e30a353a1d5aba7b0c",
"score": "0.6395686",
"text": "def create\n @talkresp = Talkresp.new(talkresp_params)\n\n respond_to do |format|\n if @talkresp.save\n format.html { redirect_to @talkresp, notice: 'Talkresp was successfully created.' }\n format.json { render :show, status: :created, location: @talkresp }\n else\n format.html { render :new }\n format.json { render json: @talkresp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6af6f07da63883c968772b6cabc986f",
"score": "0.6385542",
"text": "def talk(json)\n end",
"title": ""
},
{
"docid": "747a2f0eccdfb1a01102c5c26a3b1438",
"score": "0.6359886",
"text": "def create\n @talk = Talk.new(params[:talk])\n \n @talk.user = current_user\n respond_to do |format|\n if @talk.save\n @relay = Relay.new()\n @relay.user = @talk.user\n @relay.content = @talk.content\n @relay.talk_id = @talk.id\n @relay.save\n AdminMailer.new_talk(@talk).deliver\n session[:saved_talk_last] = @talk.updated_at\n @mid = @talk.mid\n @talks = Talk.paginate(:per_page => 10, :page => params[:page])\n # format.html { redirect_to(@talk, :notice => 'Talk was successfully created.') }\n format.html { redirect_to(@talk) }\n format.js {@talk}\n format.xml { render :xml => @talk, :status => :created, :location => @talk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @talk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef1359726fbf971ee5358343449f87ed",
"score": "0.634888",
"text": "def create\n @talk_room = TalkRoom.new(talk_room_params)\n\n respond_to do |format|\n if @talk_room.save\n format.html { redirect_to @talk_room, notice: 'Talk room was successfully created.' }\n format.json { render :show, status: :created, location: @talk_room }\n else\n format.html { render :new }\n format.json { render json: @talk_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba6ca15c3726383ed87412c974f3c483",
"score": "0.63332075",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talks }\n end\n end",
"title": ""
},
{
"docid": "938a3bc1e10a83bf3f644658d06b2e46",
"score": "0.63262385",
"text": "def create\n @mtalk = Mtalk.new(mtalk_params)\n\n respond_to do |format|\n if @mtalk.save\n format.html { redirect_to @mtalk, notice: 'Mtalk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @mtalk }\n else\n format.html { render action: 'new' }\n format.json { render json: @mtalk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "789a31a9727ceceb8fae6f1448fce89e",
"score": "0.63018113",
"text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talk }\n end\n end",
"title": ""
},
{
"docid": "6823989e182609e346dab9bd2b86448a",
"score": "0.6230757",
"text": "def talk_params\n params.require(:talk).permit(:title, :description, :theme, :required_knowledge)\n end",
"title": ""
},
{
"docid": "ba6d9e3a7712bde3120e9eeaa98607d2",
"score": "0.61909074",
"text": "def index\n respond_to do |format|\n format.html { @talks = Talk.all }\n format.json { render json: Talk.all }\n end\n end",
"title": ""
},
{
"docid": "690a730f602c74e37d721b77375fb60b",
"score": "0.61787295",
"text": "def create\n @marriage_talk = MarriageTalk.new(marriage_talk_params)\n\n respond_to do |format|\n if @marriage_talk.save\n format.html { redirect_to(@marriage_talk, notice: \"Marriage talk was successfully created.\") }\n format.json { render(:show, status: :created, location: @marriage_talk) }\n else\n format.html { render(:new) }\n format.json { render(json: @marriage_talk.errors, status: :unprocessable_entity) }\n end\n end\n end",
"title": ""
},
{
"docid": "ea7efc752082b5bfc2473d479a0bbcb5",
"score": "0.61515355",
"text": "def new\n @talk = Talk.new(length: 10, prepare: 'N/A')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talk }\n end\n end",
"title": ""
},
{
"docid": "d9debd13ee39f7aec2663b514d8abfe4",
"score": "0.6136768",
"text": "def talk_params\n params.require(:talk).permit(\n :title,\n :description,\n :duration,\n :month,\n :speaker,\n :state,\n :tag_list,\n :video,\n :resource,\n :time_event,\n :talk_date,\n :talk_time,\n :location_name,\n :location_coordinates\n )\n end",
"title": ""
},
{
"docid": "801d015c2be2f94bf59c948a65dd944d",
"score": "0.61021715",
"text": "def create\n @public_talk = PublicTalk.new(public_talk_params)\n\n respond_to do |format|\n if @public_talk.save\n format.html { redirect_to @public_talk, notice: 'Public talk was successfully created.' }\n format.json { render :show, status: :created, location: @public_talk }\n else\n format.html { render :new }\n format.json { render json: @public_talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92b8b26bf839bb62d4edd6c42834bc1e",
"score": "0.6069758",
"text": "def create\n extended_params = params[:talk].merge!({ :acceptance_status => \"pending\" })\n @talk = Talk.new(extended_params)\n @tags = Tag.find(:all)\n @types = TalkType.all\n \n # Tag handeling\n tag_names = []\n tags = []\n if(params[:item] && params[:item][:tags])\n tag_names = params[:item][:tags]\n if(params[:uncommited_tag] && params[:uncommited_tag].chomp() != \"\")\n tag_names.push(params[:uncommited_tag].chomp())\n end\n elsif(params[:uncommited_tag] && params[:uncommited_tag].chomp() != \"\")\n tag_names.push(params[:uncommited_tag].chomp())\n end\n @talk.tags = Tag.create_and_return_tags(tag_names)\n\n if current_user\n @user = current_user\n else\n @user_session = UserSession.new(params[:user])\n if @user_session.save\n @user = current_user\n flash[:warn] = 'Registreringen finnes allerede.'\n flash[:registration_already_exists] = true\n else\n @user = User.new(params[:user])\n @user.create_registration(:ticket_type => \"speaker\",\n :includes_dinner => params[:registration_includes_dinner])\n if not @user.save and @user.registration.save\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @talk.errors, :status => :unprocessable_entity }\n end\n return\n end\n end\n end\n\n @talk.users << @user\n\n respond_to do |format|\n if @talk.save\n flash[:notice] = \"Forslaget er publisert\"\n SmidigMailer.talk_confirmation(@talk, talk_url(@talk)).deliver\n format.html { redirect_to(@talk) }\n format.xml { render :xml => @talk, :status => :created, :location => @talk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @talk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5880a3c483a858a88338bbb3490efb19",
"score": "0.5984833",
"text": "def talk_params\n params.require(:talk).permit(:title, :subtitle, :article_id, :ranking, :camatalk_list, :attachment)\n end",
"title": ""
},
{
"docid": "5ce41cd53754225e241ef2b5bd9afe67",
"score": "0.59600425",
"text": "def talkresp_params\n params.require(:talkresp).permit(:user_id, :projtalk_id, :talkcontent)\n end",
"title": ""
},
{
"docid": "317bdaf31d64be92d563b39c7dcb45a6",
"score": "0.5939903",
"text": "def create\n @talklink = Talklink.new(params[:talklink])\n\n respond_to do |format|\n if @talklink.save\n format.html { redirect_to @talklink, notice: 'Talklink was successfully created.' }\n format.json { render json: @talklink, status: :created, location: @talklink }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talklink.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e729ccacad66fb18682fed1a418c829",
"score": "0.5935928",
"text": "def real_talk\n @thought = KimsThought.all.sample\n render json: @thought\n end",
"title": ""
},
{
"docid": "52a724ee10efa844032f766f9592697b",
"score": "0.5895944",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @talk }\n end\n end",
"title": ""
},
{
"docid": "ca111da031aed3f69ad115f58f878acb",
"score": "0.58854693",
"text": "def index\n @talks = Talk.all\n end",
"title": ""
},
{
"docid": "ca111da031aed3f69ad115f58f878acb",
"score": "0.58854693",
"text": "def index\n @talks = Talk.all\n end",
"title": ""
},
{
"docid": "ca111da031aed3f69ad115f58f878acb",
"score": "0.58854693",
"text": "def index\n @talks = Talk.all\n end",
"title": ""
},
{
"docid": "58e1258075b529513425ae5a796dfb28",
"score": "0.5866357",
"text": "def show\n respond_to do |format|\n format.html { @talk }\n format.json { render json: @talk }\n end\n end",
"title": ""
},
{
"docid": "ba09d91d01116034767b66d9a53368ce",
"score": "0.582873",
"text": "def talk_params\n params.require(:talk).permit(semester_ids: [], speaker_ids: [])\n end",
"title": ""
},
{
"docid": "7e82ef21ae52541c8bd50b3ca19fe26b",
"score": "0.58094823",
"text": "def talk_params\n logger.debug(\"TalksController.talk_params: params: #{params.inspect}\")\n # note: params:\n # -- \"#require\" makes sure that the parameters include a 'talk' hash\n # -- \"#permit\" allows only the white-listed fields thru\n # -- returns the params object itself\n params.require(:talk).permit(:id, :person_id, :summary, :description,\n :address, :longitude, :latitude, :talk_date, :talk_time, :talk_duration, :talk_who,\n :commit )\n end",
"title": ""
},
{
"docid": "b5e3c1660f4844cdc71b166c382d1e96",
"score": "0.5793807",
"text": "def create\n @thought = current_sapien.thoughts.new(params[:thought])\n\n respond_to do |format|\n if @thought.save\n format.html { redirect_to my_thoughts_path, notice: 'Thought was successfully created.' }\n format.json { render json: @thought, status: :created, location: @thought }\n else\n format.html { render action: \"new\" }\n format.json { render json: @thought.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4b53ea7b9cbd7badbdcb61ed0882d0a",
"score": "0.5774521",
"text": "def destroy\n @talk.destroy\n\n respond_to do |format|\n format.html { redirect_to talks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e26720229e7814981d03012d7f15567",
"score": "0.5737285",
"text": "def new\n @person = current_person\n @talk = @person.talks.build\n # NOTE: create current person as a partner only on save, in 'create'\n logger.debug(\"TalksController.new: @talk: #{@talk.inspect}\")\n end",
"title": ""
},
{
"docid": "e06eff5f01a704ee028ea212889f8acc",
"score": "0.57326853",
"text": "def speak_post(format, text, opts = {})\n data, _status_code, _headers = speak_post_with_http_info(format, text, opts)\n data\n end",
"title": ""
},
{
"docid": "9706db3465bed93e584117976ee792a2",
"score": "0.57180035",
"text": "def cast\n talk = @conference.talks.find(params[:id])\n current_user.votes.create(:talk => talk)\n\n redirect_to vote_path\n end",
"title": ""
},
{
"docid": "2d73b44a75bfeffb2e20d7641d878d10",
"score": "0.5705522",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d73b44a75bfeffb2e20d7641d878d10",
"score": "0.5705522",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d73b44a75bfeffb2e20d7641d878d10",
"score": "0.5705522",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d73b44a75bfeffb2e20d7641d878d10",
"score": "0.5705522",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "f73fd748537932b94bf702e6b32baef5",
"score": "0.5705228",
"text": "def index\n @lightning_talks = LightningTalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lightning_talks }\n end\n end",
"title": ""
},
{
"docid": "6f7aa963ba3d2fe117badb4fd2765b28",
"score": "0.5681568",
"text": "def set_talk\n @event = Event.friendly.find(params[:event_id])\n @talk = @event.talks.find(params[:id])\n end",
"title": ""
},
{
"docid": "853f63d58440ebeb7289a82bf4891ca4",
"score": "0.5677535",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "853f63d58440ebeb7289a82bf4891ca4",
"score": "0.5677535",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "853f63d58440ebeb7289a82bf4891ca4",
"score": "0.5677535",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "853f63d58440ebeb7289a82bf4891ca4",
"score": "0.5677535",
"text": "def set_talk\n @talk = Talk.find(params[:id])\n end",
"title": ""
},
{
"docid": "2673d7aadf0925893ccc0772b153ed5e",
"score": "0.5676955",
"text": "def create\n respond_to do |format|\n if @talk_attendee.save\n flash[:notice] = 'Successfully signed up to talk.'\n format.html { redirect_to(@talk.conference) }\n format.xml { render :xml => @talk_attendee, :status => :created, :location => @talk }\n else\n flash[:error] = 'Error signing up to talk.'\n format.html { redirect_to(@talk.conference) }\n format.xml { render :xml => @talk_attendee.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60d7fff92f8aab4174872530294e2b04",
"score": "0.5667004",
"text": "def create\n @quest = Quest.create(quest_params)\n\n respond_to do |format|\n if @quest.save\n #クエストを作成すると同時にそやつ自身もクエストに参加する\n current_user.user_quests.create(\n quest_id: @quest.id,\n is_owner: true\n )\n\n @quest.contents.each do |content|\n TechTagEvent.create(\n content_id: content.id,\n youtube_url: content.youtube_url\n )\n end\n format.html { redirect_to @quest, notice: \"Quest was successfully created.\" }\n format.json { render :show, status: :created, location: @quest }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @quest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b1cf1a9ad05b79130446f47d26b4e1a",
"score": "0.5657701",
"text": "def set_talk\n @talk = Talk.find_by!(id: params[:id])\n end",
"title": ""
},
{
"docid": "2f6e7753c705b4c7978e518b305365cf",
"score": "0.56220573",
"text": "def index\n @talklinks = Talklink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talklinks }\n end\n end",
"title": ""
},
{
"docid": "7f9e4b5dc07f29677b50272d3f1be469",
"score": "0.5621762",
"text": "def speaker_params\n params.require(:speaker).permit(:name, :pic, :company, :email, :title, :semester_id, :talk_date, talk_ids: [])\n end",
"title": ""
},
{
"docid": "578a25dabaf96118e88fed3461446879",
"score": "0.5619491",
"text": "def destroy\n @talk.destroy\n respond_to do |format|\n format.html { redirect_to talks_url, notice: 'Talk was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "578a25dabaf96118e88fed3461446879",
"score": "0.5619491",
"text": "def destroy\n @talk.destroy\n respond_to do |format|\n format.html { redirect_to talks_url, notice: 'Talk was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "578a25dabaf96118e88fed3461446879",
"score": "0.5619491",
"text": "def destroy\n @talk.destroy\n respond_to do |format|\n format.html { redirect_to talks_url, notice: 'Talk was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "578a25dabaf96118e88fed3461446879",
"score": "0.5619491",
"text": "def destroy\n @talk.destroy\n respond_to do |format|\n format.html { redirect_to talks_url, notice: 'Talk was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "96b885c36e17f123d0e9cb35a0e6a413",
"score": "0.5618476",
"text": "def index\n @talkresps = Talkresps.all\n end",
"title": ""
},
{
"docid": "68cc3a7d0e07ec79389642759235527f",
"score": "0.56157404",
"text": "def call(talk_form)\n link = talk_form.delete(:link)\n talk_form[:embed_code] = oembed.get(link).html\n\n talk_repo.transaction do\n speaker = find_or_create_speaker(talk_form[:speaker])\n event = find_or_create_event(talk_form[:event])\n talk = talk_repo.create(**talk_form, event_id: event.id)\n talks_speakers_repo.create(talk_id: talk.id, speaker_id: speaker.id)\n end\n end",
"title": ""
},
{
"docid": "879ca79b917b15d9b0ecca70d9dd734f",
"score": "0.5607466",
"text": "def create\n params[:thought].merge!(:person => current_person)\n @thought = nil\n @add_on = AddOn.find(params[:thought][:add_on_id]) if params[:thought][:add_on_id]\n if @add_on\n logger.info '!!! create add on thought'\n @thought = AddOnThought.subclazz_new params[:thought].merge(:add_on => @add_on, @add_on.element_name.to_sym => params[@add_on.element_name.to_sym])\n else\n logger.info '!!! create plain text thought'\n @thought = marshal_type(params[:thought])\n logger.info '!!! @thought.class.name: ' + @thought.class.name\n end\n logger.info '!!! params[:thought] ' + params[:thought].to_yaml\n respond_to do |format|\n if @thought.save\n format.html do\n @thought.update_attribute(:origin, 'web') if @thought.origin.blank?\n redirect_to thought_path(@thought)\n end\n format.xml do\n @thought.update_attribute(:origin, 'api') if @thought.origin.blank?\n render :xml => @thought, :status => :created, :location => @thought\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @thought.errors, :status => :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "2ffdad1003f9da9218110c207336f720",
"score": "0.5570898",
"text": "def create\n puts \"*\"*100\n puts session\n puts session[:voice]\n puts session[:voice].nil?\n unless session[:voice]\n session[:voice] = rand(66)\n end\n\n post = Post.create(post_params)\n cable_ready[\"timeline\"].insert_adjacent_html(selector: \"#timeline\", position: \"afterbegin\", html: render_to_string(partial: \"post\", locals: {post: post}))\n \n cable_ready[\"timeline\"].dispatch_event(\n name: \"speak\",\n detail: {\n message: \"#{post.body}\",\n voice: session[:voice]\n }\n )\n\n cable_ready.broadcast\n\n redirect_to posts_path\n end",
"title": ""
},
{
"docid": "29c189c91836f4ceeae1d5d3731b2cbf",
"score": "0.55648255",
"text": "def create\n @projtalk = Projtalk.new(projtalk_params)\n if @projtalk.save\n render json: {status: :success, projtalk: @projtalk}\n else\n render json: {status: :failed, project: @projtalk}\n end\n \n end",
"title": ""
},
{
"docid": "5f65f5adbdfe8aa243f04980703450cc",
"score": "0.5547482",
"text": "def new\n @lightning_talk = LightningTalk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lightning_talk }\n end\n end",
"title": ""
},
{
"docid": "62d8157aa747fec23fc4157d9f9f08c1",
"score": "0.55437374",
"text": "def destroy\n @talk.destroy\n respond_to do |format|\n format.html { redirect_to event_talks_path(@event) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bcba019e685d2c49c53b7d0b63e669fc",
"score": "0.55322814",
"text": "def talk_params\n valid = params.require(:talk).permit(:topic, :details, :starts_at, :duration, :event_id, :tag_list)\n date_format = '%m/%d/%Y %I:%M %p'\n offset = DateTime.now.strftime('%z')\n valid[:starts_at] = valid[:starts_at] != '' ? DateTime.strptime(valid[:starts_at], date_format).change(:offset => offset).to_s : valid[:starts_at]\n valid\n end",
"title": ""
},
{
"docid": "4e2ca9d5f8c6961bcf294b1fd43cf05b",
"score": "0.5522363",
"text": "def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n send_telegram_post_req(@question)\n\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n format.js\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n format.js { render :status => 400 }\n end\n end\n end",
"title": ""
},
{
"docid": "dedd8a4895704934f9b17490f1821f21",
"score": "0.5513396",
"text": "def destroy\n\n @talk.destroy\n respond_to do |format|\n format.html { redirect_to admin_talks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c61c442b5455ca94caf897499fa2103a",
"score": "0.55010605",
"text": "def index\n @talks = @conference.talks\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @talks }\n end\n end",
"title": ""
},
{
"docid": "d97be13651c7647857c923dc5267befa",
"score": "0.55010325",
"text": "def create\n params[:words].each do |word|\n dbword = Word.new(:word => word)\n dbword.save\n end\n \n respond_to do |format|\n format.json { head :created }\n end\n end",
"title": ""
},
{
"docid": "907c13e1bda4d925289dbef60ea89797",
"score": "0.548989",
"text": "def create\n @thought = current_user.thoughts.new(thought_params)\n\n respond_to do |format|\n if @thought.save\n format.html { redirect_to root_path, notice: 'Thought was successfully created.' }\n format.json { render :show, status: :created, location: @thought }\n else\n format.html { render :index }\n end\n end\n end",
"title": ""
},
{
"docid": "9c79403ab8e9bafb2478f9a2abed41db",
"score": "0.5478921",
"text": "def destroy\n @talk = current_user.talks.find(params[:id])\n @talk.destroy\n\n respond_to do |format|\n format.html { redirect_to talks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8914adfd0e5114b72340c59dd5fda1f1",
"score": "0.5477596",
"text": "def create\n @speech = Speech.new(speech_params)\n\n\n respond_to do |format|\n if @speech.save\n format.html { redirect_to @speech, notice: 'Speech was successfully created.' }\n format.json { render :show, status: :created, location: @speech }\n else\n format.html { render :new }\n format.json { render json: @speech.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b131c62a8bc747b867d1ac505088cf29",
"score": "0.54666775",
"text": "def create\n @sentence = Sentence.new(sentence_params)\n \n if @sentence.save\n render json: @sentence\n else\n render json: @sentence.errors\n end\n end",
"title": ""
},
{
"docid": "476da32a3392751ee021c2d91e04c051",
"score": "0.54658616",
"text": "def say(thing, type = 'TextMessage')\n request = Net::HTTP::Post.new(\"/room/#{@room_id}/speak.json\", 'Content-Type' => 'application/json')\n request.body = { message: { type: type, body: thing } }.to_json\n request.basic_auth @token, 'x'\n http = Net::HTTP.new(\"#{@subdomain}.campfirenow.com\", 443)\n http.use_ssl = true\n http.request(request)\n end",
"title": ""
},
{
"docid": "c1e22f1616247425462ea828158f52a6",
"score": "0.544905",
"text": "def create\n @speaker = Speaker.new(params[:speaker])\n\n respond_to do |format|\n if @speaker.save\n format.html { redirect_to @speaker, notice: \"Speaker #{@speaker.name} was successfully created.\" }\n format.json { render json: @speaker, status: :created, location: @speaker }\n else\n format.html { render action: \"new\" }\n format.json { render json: @speaker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fcbd49f4cf0b63d8badd69c4f67d3ddd",
"score": "0.54471815",
"text": "def create_talk_speaker(talk_id, speaker_id)\n talk_speaker = talks_speakers_repo.create(talk_id: talk_id, speaker_id: speaker_id)\n\n if talk_speaker\n Success(talk_speaker)\n else\n Failure('could not create talk_speaker')\n end\n end",
"title": ""
},
{
"docid": "41cb7c5d46cb4a3b50037c86d3842e31",
"score": "0.5445595",
"text": "def create\n responder_id = params[:responder_id] || rand.to_s[2,15]\n for ans in params[:answer].keys.select {|k| k =~ /^answer_to_question_/}\n Answer.create(:responder_id=>responder_id, :question_id=>ans[-2,2].to_i,\n :answer_text=>params['answer'][ans])\n end\n\n flash[:notice] = 'Answers were successfully created.'\n redirect_to(Poll.find(params['answer']['poll_id']))\n end",
"title": ""
},
{
"docid": "b0ef13854a6b928ce58b4946aae52803",
"score": "0.54398525",
"text": "def create\n @talklinktype = Talklinktype.new(params[:talklinktype])\n\n respond_to do |format|\n if @talklinktype.save\n format.html { redirect_to @talklinktype, notice: 'Talklinktype was successfully created.' }\n format.json { render json: @talklinktype, status: :created, location: @talklinktype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talklinktype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08a15a172c30ba1cdcf2c536c4a91d87",
"score": "0.5432931",
"text": "def index\n @mtalks = Mtalk.all\n end",
"title": ""
},
{
"docid": "9c10784cbbce45572b3b9090505140c7",
"score": "0.54281807",
"text": "def new\n @talklink = Talklink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talklink }\n end\n end",
"title": ""
},
{
"docid": "8ef5774ce87b60af15f8c0a08c3670c8",
"score": "0.54213595",
"text": "def create\n @say = Say.new(params[:say])\n @say.user_id = current_user.id\n @say.before_say_id = params[:say_id] if params[:say_id]\n save_nickname(@say.nickname)\n location = (@say.before_say or @say)\n\n respond_to do |format|\n if @say.save\n format.html { redirect_to location, notice: t('mongoid.notices.say.created') }\n format.json { render json: @say, status: :created, location: @say }\n else\n if @say.before_say\n @after_say = @say\n @say = @say.before_say\n @after_says = @say.after_says.after_popular\n format.html { render action: \"show\" }\n else\n format.html { render action: \"new\" }\n end\n format.json { render json: @say.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e32659ff2c9579b933ea129aa51345ee",
"score": "0.5418762",
"text": "def create(params)\n post \"/conversations\", params\n end",
"title": ""
},
{
"docid": "54966e9e91bc216241b10ed1631a0d26",
"score": "0.5415177",
"text": "def create\n @conversation = Conversation.new(params[:conversation])\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n format.json { render json: @conversation, status: :created, location: @conversation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54966e9e91bc216241b10ed1631a0d26",
"score": "0.5415177",
"text": "def create\n @conversation = Conversation.new(params[:conversation])\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n format.json { render json: @conversation, status: :created, location: @conversation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54966e9e91bc216241b10ed1631a0d26",
"score": "0.5415177",
"text": "def create\n @conversation = Conversation.new(params[:conversation])\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n format.json { render json: @conversation, status: :created, location: @conversation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54966e9e91bc216241b10ed1631a0d26",
"score": "0.5415177",
"text": "def create\n @conversation = Conversation.new(params[:conversation])\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n format.json { render json: @conversation, status: :created, location: @conversation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54966e9e91bc216241b10ed1631a0d26",
"score": "0.5415177",
"text": "def create\n @conversation = Conversation.new(params[:conversation])\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n format.json { render json: @conversation, status: :created, location: @conversation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67fbb9f0b015807c83dd60434eb58081",
"score": "0.5405468",
"text": "def create\n @speech = Speech.new(params[:speech])\n\n @speech[:speech_text].split(\" \").uniq.each do |speech_word|\n speech_word = speech_word.downcase.gsub(/[^a-z\\s]/, '')\n word = Word.find_by word: speech_word\n if word.nil?\n word = Word.new\n word[:word] = speech_word\n if File.exist?(\"#{Rails.root}/public/audios/#{speech_word}.mp3\")\n word[:status] = \"Completed\"\n else\n @mturk = Amazon::WebServices::MechanicalTurkRequester.new :Host => :Sandbox\n question_file = File.read(\"#{Rails.root}/app/assets/external_hit.question\")\n properties_file = Amazon::Util::DataReader.load( \"#{Rails.root}/app/assets/external_hit.properties\", :Properties )\n input = [{:words=>speech_word}]\n hits = @mturk.createHITs(properties_file, question_file, input)\n hit_id = hits[:Created].first[:HITId]\n hit_type_id = hits[:Created].first[:HITTypeId]\n word[:hit_id] = hit_id\n word[:status] = \"Posted\"\n if @mturk.host =~ /sandbox/\n word[:url] = \"http://workersandbox.mturk.com/mturk/preview?groupId=#{hit_type_id}\" # Sandbox Url\n else\n word[:url] = \"http://mturk.com/mturk/preview?groupId=#{hit_type_id}\" # Production Url\n end\n end\n word.save\n end\n end\n\n respond_to do |format|\n if @speech.save\n format.html { redirect_to @speech, notice: 'Speech was successfully created.' }\n format.json { render json: @speech, status: :created, location: @speech }\n else\n format.html { render action: \"new\" }\n format.json { render json: @speech.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
a333d11d12389a83d533c19ef40d5bb1
|
defining the method for valid number
|
[
{
"docid": "fb70a0745f48885c781daa0f4436f797",
"score": "0.68286496",
"text": "def valid_loan_amount?(input)\n Integer(input) rescue false\nend",
"title": ""
}
] |
[
{
"docid": "05bde42c711216f547310ed8f05547f4",
"score": "0.8425305",
"text": "def valid_number?(num); end",
"title": ""
},
{
"docid": "05bde42c711216f547310ed8f05547f4",
"score": "0.8425305",
"text": "def valid_number?(num); end",
"title": ""
},
{
"docid": "05bde42c711216f547310ed8f05547f4",
"score": "0.8425305",
"text": "def valid_number?(num); end",
"title": ""
},
{
"docid": "05bde42c711216f547310ed8f05547f4",
"score": "0.8425305",
"text": "def valid_number?(num); end",
"title": ""
},
{
"docid": "8f0c45af2a169e8a75643c40a679a8b5",
"score": "0.7834886",
"text": "def validate!(num)\n end",
"title": ""
},
{
"docid": "23259a62eada81846424f3aba4ef65aa",
"score": "0.75135064",
"text": "def valid?(number)\n number.to_s.to_i == number\nend",
"title": ""
},
{
"docid": "92c10f4267972dd955fd4007e1bbc39b",
"score": "0.750302",
"text": "def valid_number?(number_string) # this method will check if the user submitted a valid number that we can use in our program\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "440180752450dca046768e256e08c107",
"score": "0.74440306",
"text": "def validate num\n if num < 100 \n al100 num\n elsif num < 500\n al500 num\n elsif num < 1000\n al1000 num\n end\n end",
"title": ""
},
{
"docid": "48bdb653006f62332e14ac8041e04694",
"score": "0.74382395",
"text": "def is_valid num\n if num <= 10 && num >= 1\n 'Valid'\n else\n 'Invalid'\n end\nend",
"title": ""
},
{
"docid": "77504a1df4e6f802e93bb9df889b9846",
"score": "0.7423326",
"text": "def val_inval(numm)\n if numm >=1 && numm <= 10\n 'Valid'\n else\n 'Invalid'\n end\nend",
"title": ""
},
{
"docid": "c7041d45b121e52f0b900bc1b51785f7",
"score": "0.7397967",
"text": "def num_valid(num)\n if num < 10\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend",
"title": ""
},
{
"docid": "0fbe75764063ba088bbbbd4b9e18fc0f",
"score": "0.7392408",
"text": "def valid_phone_number(number)\r\n\r\nend",
"title": ""
},
{
"docid": "9ea135887539004f3c921d5b3a72e0a7",
"score": "0.7375891",
"text": "def checkNum\n return if @num.match(/^\\D/) # skip if number doesn't begin with a digit\n\n # Reject calls to not blessed countries and premium numbers\n # (unless VSP was forced using #n dial prefix)\n\n if(Allowed_Country != nil) then\n\t rejectCall(503,\"Calls to code #{formatNum(@num).split(' ')[0]} not allowed\") \\\n\t\tunless @num.match \"^(#{Allowed_Country.join('|')})\"\n end\n\n if(ExcludedPrefixes != nil) then\n\t rejectCall(503,\"Calls to '#{formatNum($&)}' not allowed\") if @num.match \\\n\t\t'^(' + ExcludedPrefixes.map { |x| \"(:?#{x.gsub(/\\s*/,'')})\" }.join('|') + ')'\n end\nend",
"title": ""
},
{
"docid": "350dfb35ec31e2da0d5a353c721dbc9f",
"score": "0.7364896",
"text": "def valid_number?(number)\n number.to_i.to_s == number\nend",
"title": ""
},
{
"docid": "c4d85ece735ddd8472e5a83a3f29dcf1",
"score": "0.7358881",
"text": "def valid_number?(num)\n num.to_i.to_s == num\nend",
"title": ""
},
{
"docid": "86353c714dea200472c64b54d68da65b",
"score": "0.7328538",
"text": "def valid_number?(number)\n number.to_i.nonzero?\nend",
"title": ""
},
{
"docid": "82bfd9e8109e1ac7f298c2c671fd10e3",
"score": "0.7318294",
"text": "def validate!\n raise \"number doesn't match format\" if number !~ NUMBER_FORMAT\n raise 'number cannot be nil' if number.nil?\n end",
"title": ""
},
{
"docid": "cc85a034cf6081b46d5ad4b58723ef84",
"score": "0.72796845",
"text": "def not_valid\n puts \"Please enter a valid number\"\n return get_number\nend",
"title": ""
},
{
"docid": "32b4fce62f35d4fd8bd0e4addc7b6802",
"score": "0.72718203",
"text": "def valid_number?(number)\n @numbers.include?(number)\n end",
"title": ""
},
{
"docid": "a8d80c4fd05f57029bf5624991074e7a",
"score": "0.7251616",
"text": "def number_is_valid? number\n if number.length != 10\n false\n else \n true\n end\n end",
"title": ""
},
{
"docid": "a4e45a96de1dbdc29f77d297f8265d99",
"score": "0.7241639",
"text": "def is_number_valid\n puts \"Please give me a 10 digit number to format into a phone number.\"\n @number = gets.chomp.to_i\n if (Math.log10(@number).to_i) + 1 == 10\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "51aaf6118c59ab31da85542c2d1b85c7",
"score": "0.72350854",
"text": "def valid_number?(num)\n num.to_i != 0\nend",
"title": ""
},
{
"docid": "f778a73c72ab6fb7284fd0da2fc59a09",
"score": "0.72288847",
"text": "def validate_number\n options.last =~ /\\A\\d+\\z/\n end",
"title": ""
},
{
"docid": "3fa4352490a59a7b9face8a0023a4c5f",
"score": "0.722014",
"text": "def valid_number?(number)\n if subtract_nine(number).sum%10==0\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "299188467aac8555a3aaf9bb2f001a9d",
"score": "0.7185025",
"text": "def is_valid?\n number.is_a?(Integer) &&\n number.positive? &&\n number.to_s.length == 10 &&\n !number.to_s.include?(\"0\") && !number.to_s.include?(\"1\")\n end",
"title": ""
},
{
"docid": "c742cb5f7b900b075bf508550832deb2",
"score": "0.71786815",
"text": "def valid_number?(number_string)\n\n number_string.to_i.to_s == number_string\n\nend",
"title": ""
},
{
"docid": "7c7de516b7663d5d8b3bc59bbee75503",
"score": "0.71770436",
"text": "def exactly(number); end",
"title": ""
},
{
"docid": "1ab63f3dbd0421b6ff5eec155e0285c8",
"score": "0.7176846",
"text": "def valid_number?(num)\n num.to_i() != 0\nend",
"title": ""
},
{
"docid": "1ab63f3dbd0421b6ff5eec155e0285c8",
"score": "0.7176846",
"text": "def valid_number?(num)\n num.to_i() != 0\nend",
"title": ""
},
{
"docid": "1ab63f3dbd0421b6ff5eec155e0285c8",
"score": "0.7176846",
"text": "def valid_number?(num)\n num.to_i() != 0\nend",
"title": ""
},
{
"docid": "ce52039b30fe757ba679493a65baf10c",
"score": "0.716685",
"text": "def valid?\n # check if number provided has proper format\n return false unless has_proper_format?\n validate\n end",
"title": ""
},
{
"docid": "d4906f5322bed5aa2b3ea999ea86d114",
"score": "0.7122683",
"text": "def is_result_legal? digit\n # only numerical phone numbers are accepted\n return digit.to_i.to_s == digit\n end",
"title": ""
},
{
"docid": "ace0ae283cba23f9eb5ad72083fea1e4",
"score": "0.7121113",
"text": "def isValid(num)\n if num >= 1 && num <= 10\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend",
"title": ""
},
{
"docid": "a2074c2d0f34b4b7ed1c16c501c89897",
"score": "0.71159005",
"text": "def valid_number?(arg)\n arg.to_i >= 1 && arg.to_i <= 250\n end",
"title": ""
},
{
"docid": "6511cade2460009a37515a30e8ef7065",
"score": "0.7091952",
"text": "def valid_number?(parameter)\n !/^[1-9]\\d*$/.match(parameter).nil?\n end",
"title": ""
},
{
"docid": "ac2262d2e260a8ec9c19a1529baa04ec",
"score": "0.7091311",
"text": "def check_digit\n dv\n end",
"title": ""
},
{
"docid": "04beb6b8098307c6c13310a4e955a11d",
"score": "0.7080469",
"text": "def verify(num)\n # the first check verifies that there is a digit somewhere, the second half sets the allowed format\n num.match(/\\d/) && num.match(/^\\d*.?\\d*$/)\nend",
"title": ""
},
{
"docid": "8fb7c7ce1637d2d4e32fb6a96b7ba1d2",
"score": "0.7076112",
"text": "def valid_products_number()\n \n end",
"title": ""
},
{
"docid": "f78412636e96ed29d5433dc7cbca193a",
"score": "0.70730656",
"text": "def valid_number?(num)\n (num.to_i.to_f > 0) && (num.length > 3) && (num.length < 9)\nend",
"title": ""
},
{
"docid": "85b4a1042f947e2972e2610676643cde",
"score": "0.70724666",
"text": "def valid_digit?(digit)\n digit == digit.to_i.to_s\nend",
"title": ""
},
{
"docid": "a7a74305b895a11df069ab2e6b9cf569",
"score": "0.70560503",
"text": "def validate_int(v); end",
"title": ""
},
{
"docid": "430b961b3389cf0a03e3f5974cd91e1d",
"score": "0.7007215",
"text": "def validate_number number = String.new\n self.errors << \"#{number} does not have the correct format\" unless number.match(/^[0-9]{1,4}[a-z]{0,1}$/)\n self.number = number\n end",
"title": ""
},
{
"docid": "d9bf1e86bc40740e990448937d898dfc",
"score": "0.7002758",
"text": "def valid_number?(number)\n if number == '0'\n true\n elsif number.to_i == 0\n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "a82fa01be374fcf71b75643c7fd8f7a9",
"score": "0.6997435",
"text": "def digits\n fail\n end",
"title": ""
},
{
"docid": "7e22202dac897484c8193f6aa924e083",
"score": "0.6992536",
"text": "def valid_number?(input)\n input.to_i > 0 && input.to_i <= RaEvents::Event.all.length\n end",
"title": ""
},
{
"docid": "5a0c19d463ff88c5e617f84aab6e3111",
"score": "0.6988601",
"text": "def valid_check_digits?\n ##Das Ergebnis muss 1 sein, ansonsten ist die IBAN falsch.\n numerify.to_i % 97 == 1\n end",
"title": ""
},
{
"docid": "4d7d426bd4cecd6b53f5160e15f138ac",
"score": "0.6977777",
"text": "def valid_number?(number)\n number.match(/^\\d+$/)\nend",
"title": ""
},
{
"docid": "c994ed2ca7e7d77766d80d072c7d6042",
"score": "0.69761705",
"text": "def validate!(num)\n raise \"Out of bounds\" unless is_valid?(num)\n end",
"title": ""
},
{
"docid": "0e07a546156c68d75c0ce640e1dfd71b",
"score": "0.69497037",
"text": "def invalid_number?(number)\n integer?(number) || float?(number)\nend",
"title": ""
},
{
"docid": "4ba8d84c58e0129793325516e45847fc",
"score": "0.694752",
"text": "def num_checker(num)\n if num >= 1 && num <=10\n print \"valid\"\n else\n print \"invalid\"\n end\nend",
"title": ""
},
{
"docid": "71680a9225ddc0024be37db236c61a02",
"score": "0.69389606",
"text": "def valid(bill)\n if bill < 0 \n return false \n else \n return true \n end \nend",
"title": ""
},
{
"docid": "4560424850ce223045bad93865fbbec3",
"score": "0.6932883",
"text": "def validate_number_with_unit(v); end",
"title": ""
},
{
"docid": "ee04ff25856f70bb5ace1dbffb6b0b0c",
"score": "0.6932705",
"text": "def valid? number\n raise_on_type_mismatch number\n num, check = split_number(number)\n self.of(num) == check\n end",
"title": ""
},
{
"docid": "ee04ff25856f70bb5ace1dbffb6b0b0c",
"score": "0.6932705",
"text": "def valid? number\n raise_on_type_mismatch number\n num, check = split_number(number)\n self.of(num) == check\n end",
"title": ""
},
{
"docid": "d0046acdada89170e365275689c326f5",
"score": "0.69290453",
"text": "def boxvalid(num)\n\t\t\tnum = num.to_i\n\n\t\t\tif (num > 0) && (num < 23)\n\t\t\t\treturn 0\n\t\t\telse\n\t\t\t\treturn 1\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "ccaee75865a4cf2924d065c3e47777f5",
"score": "0.6899309",
"text": "def is_valid?\n sum_all_doubled_numbers % 10 == 0\n end",
"title": ""
},
{
"docid": "2cd39f67c0bf775d490b4d359428cbab",
"score": "0.68976444",
"text": "def number_is_valid?( state, number )\n size = 'C'\n if( number > 0xFFFF )\n size = 'V'\n elsif( number > 0xFF )\n size = 'v'\n end\n return Rex::Text.badchar_index( [ number ].pack( size ), state.badchars ).nil?\n end",
"title": ""
},
{
"docid": "7d25e9234f738239676d01bfbef1558e",
"score": "0.6892874",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string && number_string.to_i > -1 && number_string.to_i < 101\nend",
"title": ""
},
{
"docid": "1ff1bdc7c8e7c7f168a47a507efd539d",
"score": "0.6888762",
"text": "def valid? \n sum = 0 \n @number.split(\"\").reverse.each_with_index do |value, index| \n value = value.to_i\n # Double every digit starting from the second to last \n value+=value if(index %2 != 0)\n \n # For digits greater than 9 split them and sum them independently\n value = value.to_s.split('').collect{|i| i.to_i}.inject(:+) if(value >= 10) \n sum +=value\n \n # make sure the number is numeric only\n end if @number =~ /^[0-9]+$/\n \n # Valid if that total is a multiple of 10 and it's not zero\n sum % 10 == 0 && sum != 0 \n end",
"title": ""
},
{
"docid": "40427e3175ccca889e2502eef6cbb927",
"score": "0.6885854",
"text": "def valida_nro\r\n vl_num = '0'..'9'\r\n unless vl_num.include?(@ult_digito) \r\n raise 'Error el ultimo caracter de la placa debe ser numerico'\r\n end\r\n end",
"title": ""
},
{
"docid": "b26fc1d2e1f48f3eb1bdcc0444e7c9d2",
"score": "0.68720096",
"text": "def validate( x )\n (x.to_s =~ /^\\d+$/ ? true : false ) && x.to_i > 0 && x.to_i <= 65535\n end",
"title": ""
},
{
"docid": "affd96934cf097d5abe853f1ca32bd0b",
"score": "0.6867513",
"text": "def special_number?(literal); end",
"title": ""
},
{
"docid": "dbb6a22c21124f6b2f326ee7ea791bc0",
"score": "0.68648064",
"text": "def checkdigit?\n @checkdigit\n end",
"title": ""
},
{
"docid": "1ebe0198bb4f4bffc20267ab99c26e68",
"score": "0.6861477",
"text": "def valid_number?(number_string)\n number_string_to.i.to_s == number_string && number_string.to_ ! = 0\nend",
"title": ""
},
{
"docid": "ad6646eee64ae60283eefb6681c1b312",
"score": "0.6857363",
"text": "def validate (x)\n ( x.to_s =~ /^\\d+$/ ? true : false ) &&\n ( x.to_i > 1 && x.to_i < 65536 )\n end",
"title": ""
},
{
"docid": "5c67ab1a097ff978af84c2482e70d2bb",
"score": "0.6856437",
"text": "def valid_input(num)\n if num.to_i().to_s() == num\n return true\n elsif num.to_f().to_s() == num\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "b08e4de8764a56fa8b3a90711ab04e2c",
"score": "0.6850025",
"text": "def valid_number?\n string_to_array(credit_number)\nend",
"title": ""
},
{
"docid": "2a12773ba0f6ef9cdbddb73fa16aefbf",
"score": "0.6847052",
"text": "def valid_number_one\n if @array_new % 10 == 0\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "da9d6c9429c1f26615a4454502131c0b",
"score": "0.68443406",
"text": "def credit_card_valid?(number)\n return false unless number.length > 10\n digits_array = number.chars.map(&:to_i)\n check_digit = digits_array.pop\n check_digit_for(digits_array) == check_digit\nend",
"title": ""
},
{
"docid": "a98bfea0e49d777bf18de9137b58042b",
"score": "0.6829603",
"text": "def final_check\n if sum_digits_over_10.sum % 10 == 0\n \"The number is valid!\"\n else\n \"The number is invalid!\"\n end\n end",
"title": ""
},
{
"docid": "afb431e4b759183ddf746716e3aa1338",
"score": "0.681836",
"text": "def valid_numeric?(input)\n input.numeric? && input.to_i.between?(1,@header.search_by_key(@location).length)\n end",
"title": ""
},
{
"docid": "276bfe253f1707b4f81ca711fd48560e",
"score": "0.68072045",
"text": "def valid_num(num)\n (num % 3 == 0 || num % 5 == 0) ? num : 0\nend",
"title": ""
},
{
"docid": "2a37e8a7635f8de2c844946776eefb56",
"score": "0.68052304",
"text": "def validate_number?(num)\n @cell[num - 1] == num\n end",
"title": ""
},
{
"docid": "f87d502a1bd9dec97bf0d45c51a5c1f4",
"score": "0.6797461",
"text": "def valid_number?(number)\n if !(number =~ /[a-zA-Z]/) && number =~ /0/ && number.to_f == 0\n false\n elsif number.to_f >= 1 && !(number =~ /[a-zA-Z]/)\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "a90673f9818fc9be6d8ba5bb19840ab4",
"score": "0.67914855",
"text": "def valid_number(number)\n number.to_s.starts_with?(\"+\") ? number : \"+#{number}\"\n end",
"title": ""
},
{
"docid": "79d96175f488e933fbeb340c50251492",
"score": "0.67890394",
"text": "def valid_mod_sequence_value?(num); end",
"title": ""
},
{
"docid": "79d96175f488e933fbeb340c50251492",
"score": "0.67890394",
"text": "def valid_mod_sequence_value?(num); end",
"title": ""
},
{
"docid": "79d96175f488e933fbeb340c50251492",
"score": "0.67890394",
"text": "def valid_mod_sequence_value?(num); end",
"title": ""
},
{
"docid": "79d96175f488e933fbeb340c50251492",
"score": "0.67890394",
"text": "def valid_mod_sequence_value?(num); end",
"title": ""
},
{
"docid": "007c2c1b8503ba24baa1267f242361db",
"score": "0.6787604",
"text": "def invalid_num\n @message[:invalid_num]\n end",
"title": ""
},
{
"docid": "73db54fe11a520833373cf156751f970",
"score": "0.6785178",
"text": "def valid_number?(number, possible_values)\n number <= 9 && number >= 1 && possible_values.include?(number.to_i)\nend",
"title": ""
},
{
"docid": "e889c39a0fb3d42c4e6e313b32139883",
"score": "0.6775548",
"text": "def valid_verhoeff? number\n Verhoeff.valid? number\n end",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
},
{
"docid": "0db4675cc99635e451cd95cbd83ed21c",
"score": "0.6775085",
"text": "def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"title": ""
}
] |
c6ebfe37bc163bc9152f1b0c3f605e56
|
POST /kegs POST /kegs.json
|
[
{
"docid": "560683aa84a7740a45f5463e80038e0c",
"score": "0.630798",
"text": "def create\n @keg = Keg.new(keg_params)\n\n respond_to do |format|\n if @keg.save\n format.html { redirect_to [:admin, @keg], notice: 'Keg was successfully created.' }\n format.json { render action: 'show', status: :created, location: @keg }\n else\n format.html { render action: 'new' }\n format.json { render json: @keg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "1e81120d95b217a49ac59ae58ea3cbbb",
"score": "0.6464784",
"text": "def create\n @keg = Keg.new(keg_params)\n\n respond_to do |format|\n if @keg.save\n format.html { redirect_to @keg, notice: 'Keg was successfully created.' }\n format.json { render action: 'show', status: :created, location: @keg }\n else\n format.html { render action: 'new' }\n format.json { render json: @keg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ea4a0cb94bc357eeec310f9786ed1c8",
"score": "0.6006797",
"text": "def keg_params\n params.require(:keg).permit(:kegweight, :kegtemp)\n end",
"title": ""
},
{
"docid": "de684e29f9fb82a4d3e239fe9c3631d4",
"score": "0.59610474",
"text": "def keg_params\n params.require(:keg).permit(:size, :price, :start_date, :end_date, :beer_id)\n end",
"title": ""
},
{
"docid": "308c171f9099f537d67a780aca8ffdec",
"score": "0.58122844",
"text": "def destroy\n @keg.destroy\n respond_to do |format|\n format.html { redirect_to kegs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78dff673863666b012ca6720eede6bd0",
"score": "0.57766664",
"text": "def build_post_content\n viking = Hash.new\n puts \"Welcome Viking! Please enter your info to register for the upcoming raid.\"\n print \"Name: \"\n viking[\"name\"] = gets.chomp\n print \"Email: \"\n viking[\"email\"] = gets.chomp\n {\"viking\" => viking}.to_json\nend",
"title": ""
},
{
"docid": "6d1a49d44347b56d90bf560672f7b675",
"score": "0.5676773",
"text": "def create\n @gig = Gig.new(params[:gig])\n\n if @gig.save\n render json: @gig, status: :created, location: @gig\n else\n render json: @gig.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "162e63ce9650d60b283f8fdd04392010",
"score": "0.56250745",
"text": "def create\n @knjige = Knjige.new(knjige_params)\n\n respond_to do |format|\n if @knjige.save\n format.html { redirect_to @knjige, notice: 'Knjige was successfully created.' }\n format.json { render :show, status: :created, location: @knjige }\n else\n format.html { render :new }\n format.json { render json: @knjige.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6de25b25df6c91a5c7e3b9108c15ca7d",
"score": "0.56235576",
"text": "def create\n @karaoke = Karaoke.new(karaoke_params)\n\n respond_to do |format|\n if @karaoke.save\n format.html { redirect_to @karaoke, notice: 'Karaoke was successfully created.' }\n format.json { render :show, status: :created, location: @karaoke }\n else\n format.html { render :new }\n format.json { render json: @karaoke.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6de25b25df6c91a5c7e3b9108c15ca7d",
"score": "0.56235576",
"text": "def create\n @karaoke = Karaoke.new(karaoke_params)\n\n respond_to do |format|\n if @karaoke.save\n format.html { redirect_to @karaoke, notice: 'Karaoke was successfully created.' }\n format.json { render :show, status: :created, location: @karaoke }\n else\n format.html { render :new }\n format.json { render json: @karaoke.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3df71d8546407ed59b6ff25fb04a6369",
"score": "0.55297583",
"text": "def destroy\n @keg.destroy\n respond_to do |format|\n format.html { redirect_to admin_kegs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "020b331b1e6c6c30f10d61db34017880",
"score": "0.53996444",
"text": "def create\n @geek = Geek.new(geek_params)\n\n respond_to do |format|\n if @geek.save\n format.html { redirect_to @geek, notice: 'Geek was successfully created.' }\n format.json { render :show, status: :created, location: @geek }\n else\n format.html { render :new }\n format.json { render json: @geek.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ecb9f5d9556349cf504effeb4994d3",
"score": "0.537257",
"text": "def create\n @gunzerker = Gunzerker.new(gunzerker_params)\n\n respond_to do |format|\n if @gunzerker.save\n format.html { redirect_to @gunzerker, notice: 'Gunzerker was successfully created.' }\n format.json { render :show, status: :created, location: @gunzerker }\n else\n format.html { render :new }\n format.json { render json: @gunzerker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db156942c3d301746ccbcec390c8073d",
"score": "0.53705853",
"text": "def set_keg\n @keg = Keg.find(params[:id])\n end",
"title": ""
},
{
"docid": "db156942c3d301746ccbcec390c8073d",
"score": "0.53705853",
"text": "def set_keg\n @keg = Keg.find(params[:id])\n end",
"title": ""
},
{
"docid": "400cb4aea337c945139bda18b879caae",
"score": "0.5341188",
"text": "def joke_params\n params.require(:joke).permit(:name, :content, :joke_id)\n end",
"title": ""
},
{
"docid": "a481f898a675024dd503cd2a5ed4b8c2",
"score": "0.5318388",
"text": "def process_gamekeys gks, json\n\tdata = {}\n\tgks.each do |key|\n\t\tSTDERR.puts \"Getting data for order #{key}\"\n\t\tdata[key] = JSON.parse(api_call \"order/#{key}\")\n\tend\n\tFile.write json, JSON.dump(data)\n\treturn data\nend",
"title": ""
},
{
"docid": "a481f898a675024dd503cd2a5ed4b8c2",
"score": "0.5318388",
"text": "def process_gamekeys gks, json\n\tdata = {}\n\tgks.each do |key|\n\t\tSTDERR.puts \"Getting data for order #{key}\"\n\t\tdata[key] = JSON.parse(api_call \"order/#{key}\")\n\tend\n\tFile.write json, JSON.dump(data)\n\treturn data\nend",
"title": ""
},
{
"docid": "51af7e204ddeae98a58a90b2bef8e34d",
"score": "0.531548",
"text": "def post_json(path, json)\n retries = 0\n begin\n r = resource(path).post(json.to_json,\n :content_type => \"application/json\",\n :accept => \"application/json\",\n :user_agent => @user_agent)\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: POST #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n return G5KJSON.parse(r)\n end",
"title": ""
},
{
"docid": "d2fe10e4603925fb3ff9c1d77b3de632",
"score": "0.530105",
"text": "def do_post(host, port)\n\tbody = get_viking_data.to_json\n\theaders = { \"Content-Type\" => \"application/x-www-form-urlencoded\",\n\t \"Content-Length\" => body.length }\n\tmake_request(host, port, :post, '/viking', headers, body)\nend",
"title": ""
},
{
"docid": "0ee04a9f7862a5cb3f27fe9badf33700",
"score": "0.52667314",
"text": "def joke_params\n params.require(:joke).permit(:joke)\n end",
"title": ""
},
{
"docid": "c439acbcb55885cd881af2b4404142cb",
"score": "0.52629656",
"text": "def joke_params\n params.require(:joke).permit(:name, :bodyText, :length, :score, :user_id, :writeDate, :minutes, :seconds)\n end",
"title": ""
},
{
"docid": "3d76e054f089adc87573c5502022ca77",
"score": "0.5249388",
"text": "def create\n @joke = Joke.new(joke_params)\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 :show, status: :created, location: @joke }\n else\n format.html { render :new }\n format.json { render json: @joke.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d76e054f089adc87573c5502022ca77",
"score": "0.5249388",
"text": "def create\n @joke = Joke.new(joke_params)\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 :show, status: :created, location: @joke }\n else\n format.html { render :new }\n format.json { render json: @joke.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20c3c6a986bea9a5e45620f3b0655672",
"score": "0.5247405",
"text": "def karaoke_params\n params.require(:karaoke).permit(:date, :score, :user_id, :song_id)\n end",
"title": ""
},
{
"docid": "0383e27d27e5479cb2d66a9cff03a6c0",
"score": "0.5224604",
"text": "def create\n @adminkefu = Kefu.new(adminkefu_params)\n\n respond_to do |format|\n if @adminkefu.save\n format.html { redirect_to adminkefu_path(@adminkefu),notice: 'Test was successfully created.' }\n format.json { render :show, status: :created, location: @adminkefu }\n else\n format.html { render :new }\n format.json { render json: @adminkefu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb33e115bf9ec336c3bbb0b2de70736a",
"score": "0.52150434",
"text": "def sentiment(text)\n RestClient.post \"http://api.datumbox.com/1.0/SentimentAnalysis.json\", {api_key: '', text: text}, {content_type: :json, accept: :json}\nend",
"title": ""
},
{
"docid": "d29e3f961726a8ec00807a1e2f728cd6",
"score": "0.5211086",
"text": "def post_json(path, data = {})\n client(path).post_json(path, data)\n end",
"title": ""
},
{
"docid": "c1e2026cb00899a478a86f6be38190fa",
"score": "0.52070177",
"text": "def create\n @kedua = Kedua.new(kedua_params)\n\n respond_to do |format|\n if @kedua.save\n format.html { redirect_to @kedua, notice: 'Kedua was successfully created.' }\n format.json { render :show, status: :created, location: @kedua }\n else\n format.html { render :new }\n format.json { render json: @kedua.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "097a4aa167aff9a523df9bd6f48127a0",
"score": "0.5203092",
"text": "def joke_params\n params.require(:joke).permit(:jokefie)\n end",
"title": ""
},
{
"docid": "8ca46f16de4621b27552a3bcc15a4315",
"score": "0.519153",
"text": "def create\n @kit = Kit.new(kit_params)\n\n if @kit.save!\n render json: @kit\n else\n render json: @kit.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e4741f2515c6133fa454db211f988f87",
"score": "0.5183288",
"text": "def json_POST_search(request)\n options = search_options(request)\n data = request.env['rack.input'].read\n JSON.parse(data).map do |topic, lat, lon|\n t = Time.now\n results = search(input, lat, lon, options).to_hash\n results[:time] = Time.now - t\n results\n end.to_json\n end",
"title": ""
},
{
"docid": "6feac1a7b201185f96ad3b16d0e6d466",
"score": "0.51686674",
"text": "def generate_gke\n json_path = '/tmp/service-account.json'\n generate_creds json_path\n\n result = {}\n data = get_cluster_config\n\n # List of currently supported minor versions\n minor_versions = data[:valid_master_versions]\n .map { |v| v[0..3] }\n .uniq\n\n channels = %w[RAPID REGULAR STABLE]\n\n result = {\n 'default_cluster_version' => data[:default_cluster_version],\n # Go through all channels and pick default_version from the first entry\n 'channels' => channels.to_h do |c|\n [c, data[:channels].select do |x|\n x[:channel] == c.to_sym\n end.first[:default_version]]\n end,\n 'versions' => minor_versions.to_h do |mv|\n [mv, data[:valid_master_versions]\n # Find the highest patch release for every minor version\n .filter { |v| v[0..3] == mv }\n # Sort them, and pick the last (max)\n .max_by(&Gem::Version.method(:new))]\n end\n }\n\n # A sample YAML equivalent of this file is committed to _data/gke.yml\n File.write '_data/gke.json', result.to_json\nend",
"title": ""
},
{
"docid": "60c728d1d80c3069dc1b0d92a4d49c27",
"score": "0.51663446",
"text": "def create\n @gig = Gig.new(params[:gig])\n\n respond_to do |format|\n if @gig.save\n format.html { redirect_to @gig, notice: 'Gig was successfully created.' }\n format.json { render json: @gig, status: :created, location: @gig }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d45e0221d9963efe5a76273701e0a8f",
"score": "0.5159099",
"text": "def create\n @kick = Kick.new(kick_params)\n\n\n if @kick.save\n render json: @kick\n else\n render json: @kick.errors\n end\n end",
"title": ""
},
{
"docid": "e85d1edcd6daf701ce327bdebdd157b4",
"score": "0.5158715",
"text": "def create\n @joke = Joke.new(params[:joke])\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": "22201f22e629399ac67e583badeab894",
"score": "0.5149807",
"text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend",
"title": ""
},
{
"docid": "28b3ba105135d3b4dd7e4906a44a6283",
"score": "0.5144957",
"text": "def index\n @kegs = Keg.all\n end",
"title": ""
},
{
"docid": "305412063a6c8472259896c5b231b265",
"score": "0.514467",
"text": "def create\n @otaku = Pusher.create_otaku(params[:otaku])\n\n if @otaku.valid?\n render json: @otaku, status: :created, location: @otaku\n else\n render json: @otaku.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2aecd63a3df518b5d3bc1f983a26b1b9",
"score": "0.51326793",
"text": "def create(json, e) \n jstring = json \n unless json.is_a? String\n jstring = JSON.generate json\n end\n response = @http.post_json(e, jstring)\n msg response, Logger::DEBUG\n return response\n end",
"title": ""
},
{
"docid": "ff480406218f63183ea11c67d87c582b",
"score": "0.5131449",
"text": "def create\n @hike = Hike.new(hike_params)\n\n respond_to do |format|\n if @hike.save\n format.html { redirect_to @hike, notice: 'Hike was successfully created.' }\n format.json { render :show, status: :created, location: @hike }\n else\n format.html { render :new }\n format.json { render json: @hike.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0dac5705ece1892e5c0bf853b2b62b10",
"score": "0.51271796",
"text": "def add_form__netzke_0__netzke_submit_endpoint(params)\n res = component_instance(:add_form__netzke_0).netzke_submit(params)\n\n if res[:set_form_values]\n # successful creation\n on_data_changed\n res[:set_form_values] = nil\n end\n res.to_nifty_json\n end",
"title": ""
},
{
"docid": "8c7a64e0d58f2d3f4ab1ae4bf07bed1b",
"score": "0.51268953",
"text": "def post_node()\n @options = {:path => '/nodes/content', :body => Megam::JSONCompat.to_json(\n=begin\n{\n \"systemprovider\" => {\n \"provider\" => {\n \"prov\" => \"chef\"\n }\n },\n \"compute\" => {\n \"ec2\" => {\n \"groups\" => \"megam\",\n \"image\" => \"ami-d783cd85\",\n \"flavor\" => \"t1.micro\"\n },\n \"access\" => {\n \"ssh-key\" => \"megam_ec2\",\n \"identity-file\" => \"~/.ssh/megam_ec2.pem\",\n \"ssh-user\" => \"ubuntu\"\n }\n },\n \"chefservice\" => {\n \"chef\" => {\n \"command\" => \"knife\",\n \"plugin\" => \"ec2 server create\",\n \"run-list\" => \"'role[opendj]'\",\n \"name\" => \"-N TestOverAll\"\n }\n }\n}\n=end\n{\"node_name\" => \"alrin.megam.co\",\"command\" => \"commands\",\"predefs\" => {\"name\" => \"rails\", \"scm\" => \"scm\", \"db\" => \"db\", \"queue\" => \"queue\"}}\n )}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n #:path => @options[:path],\n :body => @options[:body]\n )\n end",
"title": ""
},
{
"docid": "8bb432c942ad4c3a36486c5dd23df0f5",
"score": "0.5097576",
"text": "def create\n @joke_content = JokeContent.new(joke_content_params)\n\n if @joke_content.save\n render json: @joke_content, status: :created, location: @joke_content\n else\n render json: @joke_content.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "19f8d8523371dfb4a3937c0829cbec97",
"score": "0.50924647",
"text": "def create\n @kedito = Kedito.new(kedito_params)\n\n if @kedito.save\n render json: @kedito, status: :created, location: @kedito\n else\n render json: @kedito.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d07364800ca77d9b3a8536acc2009833",
"score": "0.50786006",
"text": "def create\n @jukebox = Jukebox.new(jukebox_params)\n\n respond_to do |format|\n if @jukebox.save\n format.html { redirect_to @jukebox, notice: 'Jukebox was successfully created.' }\n format.json { render action: 'show', status: :created, location: @jukebox }\n else\n format.html { render action: 'new' }\n format.json { render json: @jukebox.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0193ffeed164f4f6e200568b16d0a6d",
"score": "0.5070832",
"text": "def create\n @epk = Epk.new(epk_params)\n\n respond_to do |format|\n if @epk.save\n format.html { redirect_to @epk, notice: 'Epk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @epk }\n else\n format.html { render action: 'new' }\n format.json { render json: @epk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d6ec30dce7ef312563cfd1540c4fae8",
"score": "0.5048786",
"text": "def create\n @short_joke = ShortJoke.new(short_joke_params)\n\n respond_to do |format|\n if @short_joke.save\n format.html { redirect_to @short_joke, notice: 'Short joke was successfully created.' }\n format.json { render action: 'show', status: :created, location: @short_joke }\n else\n format.html { render action: 'new' }\n format.json { render json: @short_joke.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ad6a3c794762b86075dc353515443de",
"score": "0.5047977",
"text": "def create\nputs \"===============================> create<===================================================\"\n megam_rest.post_node(to_hash)\n end",
"title": ""
},
{
"docid": "0aeb75ebbab3a725d8f12f6cdf444e9f",
"score": "0.50434184",
"text": "def create\n @kite = current_user.kites.new(params[:kite])\n\n respond_to do |format|\n if @kite.save\n format.html { redirect_to @kite, notice: 'Kite was successfully created.' }\n format.json { render json: @kite, status: :created, location: @kite }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kite.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ba66e4bd28706216192c40e69aa94c0",
"score": "0.50345975",
"text": "def create\n megam_rest.post_predefcloud(to_hash)\n end",
"title": ""
},
{
"docid": "42cb6e0d31eb5903f1bb8dc1cced9404",
"score": "0.5027848",
"text": "def create\n @jikken = Jikken.new(jikken_params)\n\n respond_to do |format|\n if @jikken.save\n format.html { redirect_to @jikken, notice: 'Jikken was successfully created.' }\n format.json { render :show, status: :created, location: @jikken }\n else\n format.html { render :new }\n format.json { render json: @jikken.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6bfd740b4eb2151ad30a39b34be9405",
"score": "0.5020099",
"text": "def create_gig_params\n params.require(:create_gig).permit(:name, :hemisphere, :season, :fee, :imgURL)\n end",
"title": ""
},
{
"docid": "42de5a4d09b82f9492049cb2736f5f36",
"score": "0.50158656",
"text": "def joke_params\n params.require(:joke).permit(:content, :category_id)\n end",
"title": ""
},
{
"docid": "7acdb16652feaf175da3c582691caee5",
"score": "0.50094694",
"text": "def post_rest(path, json) \n run_request(:POST, create_url(path), json) \n end",
"title": ""
},
{
"docid": "2704340257aca7b18c1c09e7235b1d12",
"score": "0.50057185",
"text": "def create\n @gig = Gig.new(gig_params)\n\n respond_to do |format|\n if @gig.save\n format.html { redirect_to @gig, notice: 'Gig was successfully created.' }\n format.json { render action: 'show', status: :created, location: @gig }\n else\n format.html { render action: 'new' }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc5890e1562b624be85bdf4492e78467",
"score": "0.49986026",
"text": "def make_kv_post(request_message, server_url); end",
"title": ""
},
{
"docid": "48d635474c734ff0a1db1e9520499621",
"score": "0.49912956",
"text": "def create\n @used_bike_model = UsedBikeModel.new(used_bike_model_params)\n\n if @used_bike_model.save\n render json: @used_bike_model, status: :created\n else\n render json: @used_bike_model.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "202f9e5d999ffa49cae03ec3644ea7ad",
"score": "0.4987356",
"text": "def create\r\n @kelompok = Kelompok.new(params[:kelompok])\r\n @kelompok.parent_id=nil if @kelompok.parent_id.empty?\r\n respond_to do |format|\r\n if @kelompok.save\r\n format.html { redirect_to @kelompok, notice: 'Kelompok was successfully created.' }\r\n format.json { render json: @kelompok, status: :created, location: @kelompok }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @kelompok.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "1c9f0652038fbf8d4208eb7d8e342a27",
"score": "0.49820974",
"text": "def karaoke_params\n params.require(:karaoke).permit(:actor, :introduction, :picture, :music1, :music2, :video1, :video2, :ballot1, :vote)\n end",
"title": ""
},
{
"docid": "6a7e484d4cbd9015fe685776414ff5ec",
"score": "0.49685526",
"text": "def send_to_gengo(endpoint, params = {})\n\n # Check if this is a put\n is_put = params.delete(:is_put)\n\n query = {\n :api_key => @opts[:public_key],\n :data => params.to_json.gsub('\"', '\\\"'),\n :ts => Time.now.gmtime.to_i.to_s\n }\n\n url = URI.parse(\"http://#{@api_host}/v#{@opts[:api_version]}/#{endpoint}\")\n http = Net::HTTP.new(url.host, url.port)\n http.read_timeout = 5*60\n if is_put\n request = Net::HTTP::Put.new(url.path)\n else\n request = Net::HTTP::Post.new(url.path)\n end\n\n request.add_field('Accept', 'application/json')\n request.add_field('User-Agent', @opts[:user_agent])\n\n request.content_type = 'application/x-www-form-urlencoded'\n request.body = {\n \"api_sig\" => signature_of(query[:ts]),\n \"api_key\" => urlencode(@opts[:public_key]),\n \"data\" => urlencode(params.to_json.gsub('\\\\', '\\\\\\\\')),\n \"ts\" => query[:ts].to_i.to_s\n }.map { |k, v| \"#{k}=#{v}\" }.flatten.join('&')\n\n if @debug\n http.set_debug_output($stdout)\n end\n\n resp = http.request(request)\n\n case resp\n when Net::HTTPSuccess, Net::HTTPRedirection\n json = JSON.parse(resp.body)\n\n if json['opstat'] != 'ok'\n raise Gengo::Exception.new(json['opstat'], json['err']['code'].to_i, json['err']['msg'])\n end\n\n # Return it if there are no problems, nice...\n json\n else\n resp.error!\n end\n end",
"title": ""
},
{
"docid": "9d9990c2d68b3c171f4df000a2dcdfab",
"score": "0.49681777",
"text": "def create\n @kingdom = Kingdom.new(kingdom_params)\n\n respond_to do |format|\n if @kingdom.save\n format.html { redirect_to @kingdom, notice: 'Kingdom was successfully created.' }\n format.json { render :show, status: :created, location: @kingdom }\n else\n format.html { render :new }\n format.json { render json: @kingdom.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "daf762fbf3739c4deb293bfbda6cddc5",
"score": "0.495659",
"text": "def create\n @eeg = Eeg.new(eeg_params)\n\n respond_to do |format|\n if @eeg.save\n format.html { redirect_to @eeg, notice: 'Eeg was successfully created.' }\n format.json { render :show, status: :created, location: @eeg }\n else\n format.html { render :new }\n format.json { render json: @eeg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "feb832f698a05b4483d3ad8755dfb728",
"score": "0.4955832",
"text": "def create\n puts 'Received POST request (create)'\n @whiskey = Whiskey.new(whiskey_params)\n\n if @whiskey.save\n render json: @whiskey\n else\n render json: @whiskey.errors\n end\n end",
"title": ""
},
{
"docid": "92008bad042579793da1bda239d95223",
"score": "0.49539834",
"text": "def create\n api.post('', nil, 'application/json')\n end",
"title": ""
},
{
"docid": "aeda32948f03daccffa0bd5d31da0229",
"score": "0.49514335",
"text": "def keyword_extraction(text, n)\n RestClient.post \"http://api.datumbox.com/1.0/KeywordExtraction.json\", :api_key => @api_key, :text => text, :n => n\n end",
"title": ""
},
{
"docid": "74dc66a58eb7d0d9f52cff4bb2cdeb4e",
"score": "0.49490014",
"text": "def post(options)\n wesabe.post(options)\n end",
"title": ""
},
{
"docid": "a361cfc50c1b015e6e44ad970786948c",
"score": "0.49468714",
"text": "def create\n @jukebox = Jukebox.new(params[:jukebox])\n @jukebox.user_id = current_user.id\n\n respond_to do |format|\n if @jukebox.save\n format.html { redirect_to @jukebox, notice: 'Jukebox was successfully created.' }\n format.json { render json: @jukebox, status: :created, location: @jukebox }\n else\n format.html { render action: \"new\" }\n format.json { render json: @jukebox.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f2100c3bac9d72584d350d26a747f36",
"score": "0.49451584",
"text": "def create\n spice = Spice.create(spice_params)\n render json: spice, status: :created\nend",
"title": ""
},
{
"docid": "5e889fe05b4a4a54d2067711c5921457",
"score": "0.49353173",
"text": "def post_json(path, data = {})\n pp data if @debug\n @res = client.post(\"#{@base_uri}#{path}\", data)\n handle_error(@res)\n JSON.parse(@res.body)\n end",
"title": ""
},
{
"docid": "0e9e08cf3cbb141c282e25241063c2b0",
"score": "0.4928664",
"text": "def index\n @geeks = Geek.all\n render json: @geeks\n end",
"title": ""
},
{
"docid": "c643935a8226bedbfaf9e4ee813adec1",
"score": "0.4921066",
"text": "def create\n @jukebox = Jukebox.new(params[:jukebox])\n\n respond_to do |format|\n if @jukebox.save\n format.html { redirect_to(@jukebox, :notice => 'Jukebox was successfully created.') }\n format.xml { render :xml => @jukebox, :status => :created, :location => @jukebox }\n format.json { render :json => @jukebox, :status => :created, :location => @jukebox }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @jukebox.errors, :status => :unprocessable_entity }\n format.json { render :json => @jukebox.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d847448fdc37c32c41514d3e53015fb",
"score": "0.4920583",
"text": "def testjson_params\n params.require(:testjson).permit(:title, :start, :end, :requestor)\n end",
"title": ""
},
{
"docid": "4b9a99365ac0c21421fbc1e7da100c91",
"score": "0.4920044",
"text": "def update\n respond_to do |format|\n if @keg.update(keg_params)\n format.html { redirect_to @keg, notice: 'Keg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @keg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a981af78d63776c1b8fa4db3b8897e8",
"score": "0.4918921",
"text": "def create\n @press_kit = PressKit.new(press_kit_params)\n\n respond_to do |format|\n if @press_kit.save\n format.html { redirect_to @press_kit, notice: 'Press kit was successfully created.' }\n format.json { render :show, status: :created, location: @press_kit }\n else\n format.html { render :new }\n format.json { render json: @press_kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "221c118d3583a9f6280e781ab952c6c5",
"score": "0.4914857",
"text": "def create\n @kase = Kase.new(kase_params)\n\n respond_to do |format|\n if @kase.save\n format.html { redirect_to @kase, notice: 'Kase was successfully created.' }\n format.json { render :show, status: :created, location: @kase }\n else\n format.html { render :new }\n format.json { render json: @kase.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09a61d15529200d37150f5060da1ddd2",
"score": "0.49131265",
"text": "def create\n @giggle = Giggle.new(giggle_params)\n\n respond_to do |format|\n if @giggle.save\n format.html { redirect_to @giggle, notice: 'Giggle was successfully created.' }\n format.json { render :show, status: :created, location: @giggle }\n else\n format.html { render :new }\n format.json { render json: @giggle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a09a2c36d7635fcb107534cf75e38391",
"score": "0.4912477",
"text": "def create\n @stekker = Stekker.new(stekker_params)\n\n respond_to do |format|\n if @stekker.save\n format.html { redirect_to @stekker, notice: 'Stekker was successfully created.' }\n format.json { render :show, status: :created, location: @stekker }\n else\n format.html { render :new }\n format.json { render json: @stekker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eaa4adbce8da9f91e7f2296e17b1e621",
"score": "0.49123302",
"text": "def giggle_params\n params.require(:giggle).permit(:title, :body, :author, :image)\n end",
"title": ""
},
{
"docid": "9f316a3cadf8ddff50d5b0bdb0d1a550",
"score": "0.49089348",
"text": "def publish(message, options = {})\n error = options[:error] || false\n eot = options[:eot] || false\n request = Net::HTTP::Post.new(uri.request_uri)\n request.body = {\n :message => message, \n :error => error ? 1 : 0, \n :eot => eot ? 1 : 0\n }.to_json\n request.content_type = 'text/json'\n# request['accept'] = 'text/json'\n http.request(request)\n end",
"title": ""
},
{
"docid": "fc058279a01363f8cb20eca1832f0a9f",
"score": "0.48987472",
"text": "def create\n @mk_imatge = MkImatge.new(mk_imatge_params)\n\n respond_to do |format|\n if @mk_imatge.save\n format.html { redirect_to @mk_imatge, notice: 'Mk imatge was successfully created.' }\n format.json { render :show, status: :created, location: @mk_imatge }\n else\n format.html { render :new }\n format.json { render json: @mk_imatge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8268540dbca4d9068b3f5b348ed8be3",
"score": "0.48965463",
"text": "def create\n @joke = Joke.new(joke_params)\n @joke.user_id = current_user.id\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 :show, status: :created, location: @joke }\n else\n format.html { render :new }\n format.json { render json: @joke.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b23113f737521774795c8afcc9a3f8e8",
"score": "0.48937738",
"text": "def poke_params\n params.require(:poke).permit(:name, :location, :found, :likes, :user_id)\n end",
"title": ""
},
{
"docid": "99382b780ddae759caa2c2069bc372a2",
"score": "0.48926622",
"text": "def ghost_params\n params.require(:ghost).permit(:name, :location, :difficulty, :user_id, :image_url, :features => [])\n end",
"title": ""
},
{
"docid": "0b1808a79a6279a6afe14ee7fac1c7a2",
"score": "0.48825118",
"text": "def grape_params\n params.require(:grape).permit(:name)\n end",
"title": ""
},
{
"docid": "ba3ccb1ce94ce8fed5557785fabf2b0b",
"score": "0.48814937",
"text": "def create\n @angel = Angel.new(params[:angel])\n\n respond_to do |format|\n if @angel.save\n format.html { redirect_to :action => 'show', :key => @angel.key, notice: 'Angel was successfully created.' }\n format.json { render json: @angel, status: :created, location: @angel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @angel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36babde99d64632dc23fac6f7f5567a5",
"score": "0.4877064",
"text": "def jig_params\n params.require(:jig).permit(:name, :cleaning_charge, :repair_charge, :jig_photo, :customer_id, :aka, :note)\n end",
"title": ""
},
{
"docid": "7118a48211ca7f82bcf50de12a07dffb",
"score": "0.4874953",
"text": "def create\n @hd_ggk = current_user.ggks.new(params[:hd_ggk])\n\n respond_to do |format|\n if current_user.save\n format.html { redirect_to @hd_ggk, notice: 'Ggk was successfully created.' }\n format.json { render json: @hd_ggk, status: :created, location: @hd_ggk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hd_ggk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cca5dcaaf65911d51409458ace9d51f7",
"score": "0.48734456",
"text": "def create\n @kid_grownup = KidGrownup.new(kid_grownup_params)\n\n respond_to do |format|\n if @kid_grownup.save\n format.html { redirect_to @kid_grownup, notice: 'Kid grownup was successfully created.' }\n format.json { render :show, status: :created, location: @kid_grownup }\n else\n format.html { render :new }\n format.json { render json: @kid_grownup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1cc48cc6bea771e0de2d518e23d7912d",
"score": "0.4871516",
"text": "def create\n @grease = Grease.new(grease_params)\n\n respond_to do |format|\n if @grease.save\n format.html { redirect_to @grease, notice: 'Grease was successfully created.' }\n format.json { render :show, status: :created, location: @grease }\n else\n format.html { render :new }\n format.json { render json: @grease.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89576f3f9ea0b63d706da1a7d7172412",
"score": "0.48708853",
"text": "def create\n @geup = Geup.new(geup_params)\n\n respond_to do |format|\n if @geup.save\n format.html { redirect_to @geup, notice: 'Geup was successfully created.' }\n format.json { render :show, status: :created, location: @geup }\n else\n format.html { render :new }\n format.json { render json: @geup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4bf6819ed414c33a5c4b3ae3d58bae8",
"score": "0.48653606",
"text": "def create\n # raise params[:kit].inspect\n @kit = Kit.new(params[:kit])\n\n respond_to do |format|\n if @kit.save\n format.html { redirect_to @kit, notice: 'Kit was successfully created.' }\n format.json { render json: @kit, status: :created, location: @kit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b702be8608ddca6088d128e349364a5",
"score": "0.4858967",
"text": "def knjige_params\n params.require(:knjige).permit(:naslov, :avtor, :opis, :datum_izdaje)\n end",
"title": ""
},
{
"docid": "3836cb0d597fa8572fd484e9ab073dd2",
"score": "0.4854494",
"text": "def geek_params\n params.require(:geek).permit(:name, :hobby)\n end",
"title": ""
},
{
"docid": "27243c5c0b95eef25df4c3a8e20735b6",
"score": "0.48469633",
"text": "def create\n @kern = Kern.new(params[:kern])\n\n respond_to do |format|\n if @kern.save\n format.html { redirect_to @kern, notice: 'Kern was successfully created.' }\n format.json { render json: @kern, status: :created, location: @kern }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kern.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbd4805427a8304d68a52fc9d8189da9",
"score": "0.4846218",
"text": "def kaycy_params\n params.require(:kaycy).permit(:name, :content)\n end",
"title": ""
},
{
"docid": "30fc5638df58994cbb6de8e68624670f",
"score": "0.48364514",
"text": "def post_json(data, action)\n response = RestClient.post \"#{@url}/#{action}\", data.merge(@auth).to_json, :content_type => :json, :accept => :json\n response.body\n end",
"title": ""
},
{
"docid": "0e49e4b24a07743958da39fd79d05f55",
"score": "0.4835386",
"text": "def upload_keys\n filename = \"keys.json\"\n keys_hash = TranslationKey.pluck(:name)\n .compact\n .map { |k| [k,k] }\n .to_h\n @aws_uploader.upload_json(keys_hash, \"keys.json\", public: true)\n end",
"title": ""
},
{
"docid": "7c42133f466287d7aa0bfb9a005ee58f",
"score": "0.48330033",
"text": "def create \n spice = Spice.create(spice_params)\n render json: spice, status: :created\n\n end",
"title": ""
},
{
"docid": "35156b5f5e0a962346da7c97c7a47cf2",
"score": "0.4826832",
"text": "def create\n @postick = Postick.new(params[:postick])\n\n respond_to do |format|\n if @postick.save\n format.html { redirect_to @postick, :notice => 'Postick was successfully created.' }\n format.json { render :json => @postick, :status => :created, :location => @postick }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @postick.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad8cb72cbe9ffb7ef434662a2e7d28fe",
"score": "0.48228192",
"text": "def post_json(path, body)\n uri = build_uri(path)\n # puts \"🤖 POST #{path}\"\n # puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n http.request(post_request)\n end\n\n # puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n # puts result[:result]\n result\nend",
"title": ""
}
] |
116b056fc734ae90120d99326980d5e1
|
Redirects guest to comparisons' root.
|
[
{
"docid": "037224515b4b6d2003b0ca2b3a9c5ef7",
"score": "0.7130655",
"text": "def redirect_guest\n redirect_to explore_comparisons_path if @context.guest?\n end",
"title": ""
}
] |
[
{
"docid": "7260adb0a090fa72e82a728364778b1d",
"score": "0.6599711",
"text": "def repel_usr_guest\n redirect_to(\"/\") if session[:usr_id].nil?\n end",
"title": ""
},
{
"docid": "f35007768418c84b0c0cee0e6d837a2c",
"score": "0.6185008",
"text": "def redirect_to_user_home\n redirect_to :controller=>'virtual_machines', :action=>'index'\n end",
"title": ""
},
{
"docid": "c6931f892837e509c5716669b148f816",
"score": "0.5992651",
"text": "def redirect_to_home\n redirect_to session[:superadmin_mode] ? ubiquo.superadmin_home_path : ubiquo.home_path\n end",
"title": ""
},
{
"docid": "67aa2195db6cc4950abb1d33416c905a",
"score": "0.59260416",
"text": "def index\r\n # State machine stuff\r\n current_user.came_home\r\n eval current_user.redirect, binding()\r\n return\r\n end",
"title": ""
},
{
"docid": "5954f96f91bb2bc2dc6da04af80effe4",
"score": "0.57573724",
"text": "def redirect_to_homepage\n redirect_to frontend_root_path, status: :moved_permanently\n end",
"title": ""
},
{
"docid": "d4f24cb6c018e95bcf09e7d5e4337f0e",
"score": "0.5740543",
"text": "def guest\n\tend",
"title": ""
},
{
"docid": "9db47f14278aae3ef17c334858a34a06",
"score": "0.5701664",
"text": "def guest_checkout\n redirect_to checkout_path and return if current_user || current_order.guest_checkout?\n \n if current_order.enable_guest_checkout\n redirect_to checkout_path\n else\n redirect_to checkout_registration_url\n end\n end",
"title": ""
},
{
"docid": "42a8c115f32739854817b6e7187eb30c",
"score": "0.55966246",
"text": "def login_guest()\n login(:guest)\n end",
"title": ""
},
{
"docid": "9c315bbc9512073e5e323373d86723bd",
"score": "0.55793035",
"text": "def test_guest_access_to_userland_gives_login_screen\n get '/in/index'\n assert last_response.redirect?\n follow_redirect!\n\n assert last_request.url.ends_with?(\"/login\")\n assert last_response.ok?\n assert last_response.body.include?('Login to continue') \n end",
"title": ""
},
{
"docid": "efad039d98e2f1778844fac11d04c43d",
"score": "0.5562119",
"text": "def redirect_internal() redirect_to \"/nothing\"; end",
"title": ""
},
{
"docid": "8364d3e4cb1e5081e9b114ac1637d2d4",
"score": "0.5537989",
"text": "def user_root\r\n if logged_in?\r\n redirect_to current_user\r\n else\r\n redirect_to login_path\r\n end\r\n end",
"title": ""
},
{
"docid": "21b466dd2bc83bdc05b1ba45b7359056",
"score": "0.5524832",
"text": "def continue_as_guest\n if current_user\n redirect_to new_event_application_path(event_id: params[:event_id])\n else\n @guest = true\n render :continue_as_guest\n end\n end",
"title": ""
},
{
"docid": "136f8e0505759ee04dea42a1ffc9cf6a",
"score": "0.5479512",
"text": "def guest_link\n return guest_hearing_link if guest_hearing_link.present?\n\n \"#{VirtualHearing.base_url}?join=1&media=&escalate=1&\" \\\n \"conference=#{formatted_alias_or_alias_with_host}&\" \\\n \"pin=#{guest_pin}&role=guest\"\n end",
"title": ""
},
{
"docid": "c1ad397d3d22eda10a26fbadca77e408",
"score": "0.54715836",
"text": "def login_checkpoint\n redirect to '/' if !logged_in?\n end",
"title": ""
},
{
"docid": "ab3f8288d93794a91ba740f046bdaf30",
"score": "0.54428667",
"text": "def redirect_to(path)\n render(:status => 302, \"Location\" => path) { p { text(\"You are redirected to \"); a(path, :href => path) } }\n end",
"title": ""
},
{
"docid": "75b50b74790e192159a725e1e5ef67fe",
"score": "0.5439129",
"text": "def redirect_to_home\n redirect_to '/'\n end",
"title": ""
},
{
"docid": "3c6fc7515b521ce23b831adb71dac3f5",
"score": "0.5439024",
"text": "def index; redirect_to '/'; end",
"title": ""
},
{
"docid": "0485ec835f7ade5ffeb0e55867782613",
"score": "0.5431299",
"text": "def home\n redirect_to user_path(current_user)\n end",
"title": ""
},
{
"docid": "9bf30ffef5636b2f251ca90fe51b1f08",
"score": "0.5410355",
"text": "def redirect_non_admins_to\n \"/\"\n end",
"title": ""
},
{
"docid": "39198f6a36f1ad23f5ee25e94effff65",
"score": "0.5406728",
"text": "def reviewer_home\n redirect_to(:action => 'index')\n end",
"title": ""
},
{
"docid": "dce076162fe297d6ba1c0fee8d14c697",
"score": "0.5404396",
"text": "def authenticate\n if session[:name].nil? or session[:name] == 'guest'\n session[:name] = 'guest'\n session[:id] = \"0\"\n false\n # redirect '/home'\n else\n true\n end\n end",
"title": ""
},
{
"docid": "46295c917077bf450fd64c04b24477ad",
"score": "0.5402663",
"text": "def pcb_admin_home\n redirect_to(:action => 'index')\n end",
"title": ""
},
{
"docid": "f4b0b4d2c8794ef5122ab76b4aba52d4",
"score": "0.53896224",
"text": "def admin_agent\n redirect_to(root_url) unless current_agent.admin?\n end",
"title": ""
},
{
"docid": "4a8c61b1a86f02e2e3d1ca077ac5a646",
"score": "0.5383765",
"text": "def redirect_ok\n @agent.redirect_ok\n end",
"title": ""
},
{
"docid": "c1507ff675167b65ba73ca8b40071129",
"score": "0.53776973",
"text": "def redirects; end",
"title": ""
},
{
"docid": "0febcb20128516a3940f41c23dd03955",
"score": "0.53738153",
"text": "def expand_guest_path(destination)\n if machine.guest.capability?(:shell_expand_guest_path)\n machine.guest.capability(:shell_expand_guest_path, destination)\n else\n destination\n end\n end",
"title": ""
},
{
"docid": "b799bcd7ddbf5f65702ded8e36c9f3f9",
"score": "0.5355681",
"text": "def redirect_ok; end",
"title": ""
},
{
"docid": "b799bcd7ddbf5f65702ded8e36c9f3f9",
"score": "0.5355681",
"text": "def redirect_ok; end",
"title": ""
},
{
"docid": "51d50941e032ece4a7a2d18b72683f73",
"score": "0.53458786",
"text": "def index\n res = create_request2(root_url + '/login/auth', 'tequila.epfl.ch')\n redirect_to ('https://tequila.epfl.ch/cgi-bin/tequila/requestauth?request' + res)\n end",
"title": ""
},
{
"docid": "ac3f90916a0f744b4310ab2299454fef",
"score": "0.5337708",
"text": "def redirect_external() redirect_to \"http://www.rubyonrails.org\"; end",
"title": ""
},
{
"docid": "f62fe6456163ece2c776424c89d10bd6",
"score": "0.5323051",
"text": "def manager_home\n redirect_to(:action => 'index')\n end",
"title": ""
},
{
"docid": "f916cfbb9a030a895055e90cf4c1792a",
"score": "0.5313571",
"text": "def expand_guest_path(destination)\n if machine.guest.capability?(:shell_expand_guest_path)\n machine.guest.capability(:shell_expand_guest_path, destination)\n else\n destination.to_s.gsub('/', \"\\\\\")\n end\n end",
"title": ""
},
{
"docid": "30527275261e07d1ad96c2e5b90f6920",
"score": "0.53130704",
"text": "def after_bookingsync_sign_in_path\n root_path\n end",
"title": ""
},
{
"docid": "28d72f74023f9848e14db0c7c8351671",
"score": "0.5311724",
"text": "def guest\n allow [:show]\n end",
"title": ""
},
{
"docid": "f438e9a75fc5db3247e118ffda18644d",
"score": "0.5309891",
"text": "def set_home\n end",
"title": ""
},
{
"docid": "f644b11969839e9b2672d2685ad572db",
"score": "0.52724195",
"text": "def after_sign_in_path_for(resource)\n session[:forwarding_url] || root_path\n end",
"title": ""
},
{
"docid": "011862174116b522c0de9206d63b733d",
"score": "0.5267412",
"text": "def login\n redirect_to lato_core.root_path if core_controlSession\n end",
"title": ""
},
{
"docid": "5b232c96d3e9800a717acd3da06018ac",
"score": "0.5259802",
"text": "def redirect_to_stored(default='/')\n return_to = session[:return_to] || default\n session[:return_to] = nil\n redirect return_to\n end",
"title": ""
},
{
"docid": "61ec7c7ca3456f3c6eabc9584b26b92d",
"score": "0.5232378",
"text": "def store_and_redirect_location\n #session[:return_to] = \"/\"\n redirect_to \"/welcome/new\",:status => 401\n end",
"title": ""
},
{
"docid": "7d8637d56be5f7a034d99b02ec3524ec",
"score": "0.5226329",
"text": "def home_enquiry(*args)\n self.update_attribute(:bot_response, \"Redirected you to home page\")\n polymorphic_path(\"root\")\n end",
"title": ""
},
{
"docid": "86f8d1c4ed485a524a45686ff146294e",
"score": "0.52260774",
"text": "def home\r\n\r\n redirect_to(@current_user.home_page)\r\n end",
"title": ""
},
{
"docid": "0b823786ca182f2e7180b6c052ccb358",
"score": "0.5218702",
"text": "def auto_login\n url = params[:back_to]\n redirect_to url\n end",
"title": ""
},
{
"docid": "be6fce38ccfb9410fe3b024b95d92359",
"score": "0.5218568",
"text": "def navigating_page!\n if current_user.admin?\n redirect_to admin_root_path\n else\n redirect_to current_user.student\n end\n end",
"title": ""
},
{
"docid": "07b9be0a5cb16254b2c1face03891251",
"score": "0.51915365",
"text": "def home\n authenticate!\n end",
"title": ""
},
{
"docid": "5c45f57b6e4a8c592fd7033ec5a858f1",
"score": "0.5190826",
"text": "def go_to_browse\n redirect_to \"/browse/search\"\n end",
"title": ""
},
{
"docid": "cb87efffaaa2e7bd70a29dbac88b2a82",
"score": "0.5183787",
"text": "def redirect\n client = Signet::OAuth2::Client.new(client_options)\n if internet_connection? \n redirect_to client.authorization_uri.to_s\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "88834e6204465f43a950ecabb3977f2e",
"score": "0.51812196",
"text": "def redirect\n\t\trender 'sessions/new'\n\tend",
"title": ""
},
{
"docid": "8a1f286bd3fa72561631dac71fb60731",
"score": "0.5180389",
"text": "def redirect(options = {})\r\n end",
"title": ""
},
{
"docid": "767792d482aa8df89b8b1458cb908aab",
"score": "0.51706636",
"text": "def after_provision_path\n MnoEnterprise.router.dashboard_path || main_app.root_path\n end",
"title": ""
},
{
"docid": "43e8886bd7bd2d209b81d3566ae62075",
"score": "0.51704305",
"text": "def authenticate_gamer_or_guest!\n if gamer_session == nil && session[:guest_gamer_id] == nil\n redirect_to guest_sign_up_path\n end\n end",
"title": ""
},
{
"docid": "69608e9cfe9adf420c407cc0dbc3c88b",
"score": "0.51698667",
"text": "def guest_checkout\n @customer = Customer.new\n redirect_to new_customer_path, :alert => t('store.errors.guest_checkout_not_allowed') unless allow_guest_checkout?\n end",
"title": ""
},
{
"docid": "13019b22c88b370db04b5757f4bf66fa",
"score": "0.51599354",
"text": "def admin_home\n redirect_to(:action => 'index')\n end",
"title": ""
},
{
"docid": "795d4a8567dd551e9edac70366dbcd4f",
"score": "0.515838",
"text": "def redirect_to_root\n if @logged_in == false || session[:ignore_redirect] == true\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "18bcfc546e7246be8308a9aa7642dc6b",
"score": "0.5152574",
"text": "def go_to_admin_page\n user_name.click\n admin_link.click\n end",
"title": ""
},
{
"docid": "f796f3229646b237f135e50d6de895b4",
"score": "0.5149623",
"text": "def open\r\n visit \"/\"\r\n end",
"title": ""
},
{
"docid": "b47f8a412bf74341f91795f3c58b50a1",
"score": "0.51468855",
"text": "def redirect_to_login_page\n query_params = request.query_parameters\n query_params.merge!(return_to: request.path)\n\n target = cms_path(Homepage.default.login_page, query_params)\n\n redirect_to(target, alert: \"This page is protected. You either don't have neccessary access rights or you are not logged in.\")\n end",
"title": ""
},
{
"docid": "4176a83a47101a65168ebb5af2227a53",
"score": "0.5144664",
"text": "def backdoor\n user = User.test_user\n sign_in(user)\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "5e039ed19e6315cf4fab9d6240792770",
"score": "0.513459",
"text": "def after_sign_in_path_for(resource)\n home_passthrough_path\n end",
"title": ""
},
{
"docid": "cd6d55e9b1865b5cd09eeddc30ba6a56",
"score": "0.5132082",
"text": "def require_user\n return if current_uid\n\n store_location\n flash[:notice] = 'You must be logged in to access the page you requested'\n ret = url_for_with_proto({ controller: 'user_sessions', action: 'guest_login' })\n redirect_to(ret) && return\n end",
"title": ""
},
{
"docid": "dd1e03738b2b4ab73af81a65683d3a47",
"score": "0.51314455",
"text": "def signed_in_root_path(_)\n current_tribunal_case ? users_login_save_confirmation_path : users_cases_path\n end",
"title": ""
},
{
"docid": "faf100aabde4714c5d9c324607f84d3f",
"score": "0.51309836",
"text": "def after_sign_up_path_for(resource)\n # # signed_in_root_path(resource)\n redirect_to 'admins/confirm_user'\n # root_path\n\n end",
"title": ""
},
{
"docid": "0b5385746698b5dc643881e7a787e981",
"score": "0.51270986",
"text": "def redirect?; end",
"title": ""
},
{
"docid": "b54b7ab70b08e0c38815e99ea5a08285",
"score": "0.5115638",
"text": "def redirect_unauthenticated\n store_location\n flash[:error] = \"Please sign to access that page\"\n redirect_to root_path\n throw :halt\n end",
"title": ""
},
{
"docid": "eb768fba9aae698398bda6e64e38eea6",
"score": "0.510575",
"text": "def redirect_unauthorized_access\n if try_gesmew_current_user\n flash[:error] = Gesmew.t(:authorization_failure)\n redirect_to '/unauthorized'\n else\n store_location\n if respond_to?(:gesmew_login_path)\n redirect_to gesmew_login_path\n else\n redirect_to gesmew.respond_to?(:root_path) ? gesmew.root_path : main_app.root_path\n end\n end\n end",
"title": ""
},
{
"docid": "bbc29c055e23f15c06a7b070e8bbd0c8",
"score": "0.51033616",
"text": "def set_sign_in_redirect\n if (hash = params[:x_return_to]).present?\n session[:user_return_to] =\n \"#{request.protocol}#{request.host_with_port}/##{hash}\"\n end\n end",
"title": ""
},
{
"docid": "bbc29c055e23f15c06a7b070e8bbd0c8",
"score": "0.51033616",
"text": "def set_sign_in_redirect\n if (hash = params[:x_return_to]).present?\n session[:user_return_to] =\n \"#{request.protocol}#{request.host_with_port}/##{hash}\"\n end\n end",
"title": ""
},
{
"docid": "9be41763252779d5442f7415c2446b8a",
"score": "0.5102874",
"text": "def create\n redirect_to :root\n end",
"title": ""
},
{
"docid": "2482b7d06cb8b6213af272996eab63af",
"score": "0.50967556",
"text": "def default\n lambda { res.redirect('/', 301) }\n end",
"title": ""
},
{
"docid": "e869d83df1e1c49a22138d8fda41bf80",
"score": "0.50959235",
"text": "def goto_surveys\n node_object = TreeFolder.find_by_name('Survey')\n session[:root] = FolderNode.find_by_node_object_id(node_object.id).id\n redirect_to controller: 'tree_display', action: 'list'\n end",
"title": ""
},
{
"docid": "40acb253304421be5bef381f49f083d1",
"score": "0.50938976",
"text": "def redirect(location, status = '302'); request.redirect(location, status); end",
"title": ""
},
{
"docid": "5c3f90bcea6709b0d613b34933dd3948",
"score": "0.5089411",
"text": "def redirect(uri, verb = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f7e378abd87b84e1a35c0e603f3e3602",
"score": "0.50828695",
"text": "def redirect\n redirect_to volunteershome_url if current_user.volunteer?\n redirect_to serviceusershome_url if current_user.service_user?\n show_browser_alert\n end",
"title": ""
},
{
"docid": "49167113270e7a0accfdca8238cef986",
"score": "0.5077656",
"text": "def home\n # if user_signed_in?\n # redirect_to studios_path=end\n # end\n end",
"title": ""
},
{
"docid": "ae79a63dff67b89d15afa1bc3f8cc3d0",
"score": "0.50711757",
"text": "def redirect_to_slash_path(env)\n path = env[Rack::REQUEST_PATH] + '/'\n\n response = Rack::Response.new\n response.redirect(path)\n response.finish\n end",
"title": ""
},
{
"docid": "22e1211a3abcdef93d8d6616a7ce7077",
"score": "0.50690085",
"text": "def go_to_browse\n redirect_to \"#{get_disney_property_root_path}/browse\"\n end",
"title": ""
},
{
"docid": "5b5d3afc5079d06e32ca357a5670db57",
"score": "0.5067951",
"text": "def redirect_to_api\n redirect \"http://#{ Drop.base_uri }#{ request.path }\"\n end",
"title": ""
},
{
"docid": "5b5d3afc5079d06e32ca357a5670db57",
"score": "0.5067951",
"text": "def redirect_to_api\n redirect \"http://#{ Drop.base_uri }#{ request.path }\"\n end",
"title": ""
},
{
"docid": "e9df04d2d54d6b71602805ecfe869f79",
"score": "0.50666106",
"text": "def home\n redirect_to site_path( @domain )\n end",
"title": ""
},
{
"docid": "221fd58440cac10f77e12e385ad693fd",
"score": "0.5065375",
"text": "def signed_in_root\n path = case session[:user_type]\n when 'admin'\n users_path\n\n when 'provider'\n provider_home_path\n\n when 'patient'\n patient_home_path\n\n else\n root_path\n end\n\n path\n end",
"title": ""
},
{
"docid": "e29670d9dcf80cb8483c9160b00f354f",
"score": "0.5058329",
"text": "def redirect_path\n if @bank_dup.present?\n latest_ofxes_path\n elsif session[:current_acct].present?\n account_path(session[:current_acct])\n else\n account_path(@entry.splits.order(:id).first.account)\n end\n end",
"title": ""
},
{
"docid": "c3764b0b30fa590d292693c6a40aea40",
"score": "0.5058307",
"text": "def home_page\n return root_path unless current_user\n return admins_path if current_user.has_role? :super_admin\n return room_path(current_user.main_room) if current_user.role&.get_permission(\"can_create_rooms\") && current_user.main_room.present?\n cant_create_rooms_path\n end",
"title": ""
},
{
"docid": "51da0dba49c21944b98f46fd574fcfff",
"score": "0.5058153",
"text": "def store_location\n if logged_in_from_signup_page\n session[:forwarding_url] = root_path\n else\n session[:forwarding_url] = request.referer\n end\n end",
"title": ""
},
{
"docid": "af3c0f39c8be9e3c3586cd46447a55ce",
"score": "0.50548774",
"text": "def login_path\n root_path\n end",
"title": ""
},
{
"docid": "5d58012f3ab23c5e7eebb26024b2406a",
"score": "0.5051696",
"text": "def redirect_path\r\n !(@target =~ /invoice/i).nil? ? redirect_to(new_invoice_path) : set_reload_path\r\n end",
"title": ""
},
{
"docid": "ea2423037d0b69d07fa1eab85f3ae8e0",
"score": "0.5051078",
"text": "def portfolio_redirect\n\t\t\tredirect to '/home'\n\t\tend",
"title": ""
},
{
"docid": "c036f8133c600fc5b422430e456e859a",
"score": "0.5044348",
"text": "def test_shold_not_show_to_guest\n sign_out :user\n get :show\n assert_response :redirect\n end",
"title": ""
},
{
"docid": "70687f11f83de33ed42fd576ea73110a",
"score": "0.50427026",
"text": "def wp\n redirect_to (\"#{BASE_DOMAIN}/infos/lost/\")\n end",
"title": ""
},
{
"docid": "44a0c55eb70288fdaa4022ef8a53a84c",
"score": "0.5032671",
"text": "def after_login\n if logged_in?\n answer('/')\n else\n redirect Rs(:login, :fail => :session)\n end\n end",
"title": ""
},
{
"docid": "2825519e5956af2072b54858688d9d0f",
"score": "0.50298387",
"text": "def after_sign_in_path_for(resource)\n\n\t\tpopulate_system\t\n\t\n\t\t# session[:user_return_to] || session[:previous_url] || homes_path\n\t\t homes_path\n\t\n\tend",
"title": ""
},
{
"docid": "1d2305b4be5e1388d6517e1b104775bc",
"score": "0.5029308",
"text": "def after_sign_up_path_for(resource)\n redirect_to_home(resource)\n end",
"title": ""
},
{
"docid": "747e8a0262b21d8cf9ff8133607ea8b6",
"score": "0.5016381",
"text": "def redirects_to_root(action, exatra_params)\n it 'redirects to the root page if user is not authenticated' do\n if exatra_params\n get action, params: { id: 'amura-assignment' }\n else\n get action\n end\n expect(response).to redirect_to(root_url)\n expect(flash[:alert]).to eq('Please login with github account.')\n end\n end",
"title": ""
},
{
"docid": "025869c01a07500293b1b46c1c36728b",
"score": "0.5014139",
"text": "def goto_global_survey\n node_object = TreeFolder.find_by_name('Global Survey')\n session[:root] = FolderNode.find_by_node_object_id(node_object.id).id\n redirect_to controller: 'tree_display', action: 'list'\n end",
"title": ""
},
{
"docid": "a96ff21997bd0d60eafab0ad64b778a1",
"score": "0.501367",
"text": "def home\n\t\t\n\tend",
"title": ""
},
{
"docid": "a96ff21997bd0d60eafab0ad64b778a1",
"score": "0.501367",
"text": "def home\n\t\t\n\tend",
"title": ""
},
{
"docid": "0dc5bba171bbbf4db3d302b9d13b87c4",
"score": "0.50053823",
"text": "def after_sign_up_path_for(resource)\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "9f28af2a9ac1b40d79c0d656e0949e0f",
"score": "0.50037575",
"text": "def drill\n session[:root] = params[:root]\n redirect_to controller: 'tree_display', action: 'list'\n end",
"title": ""
},
{
"docid": "840733f7dbe49980d03c4d81600fd47a",
"score": "0.4997821",
"text": "def home\n redirect_to action: :index\n end",
"title": ""
},
{
"docid": "f2af2f37f7e9bf8b1301c93708b6ed4b",
"score": "0.4993428",
"text": "def redirect_to_admin\n redirect_to admin_tests_path if current_user.is_a?(Admin)\n end",
"title": ""
},
{
"docid": "0d9d3386c71d63dc6a97e1b38d1fdc65",
"score": "0.4988193",
"text": "def login_first\n redirect_to account_login_path(dest: (params[:dest] || request.path))\n end",
"title": ""
},
{
"docid": "e8d689ac0394a1a42bb8fc52fb602715",
"score": "0.49879476",
"text": "def landing_page\n if current_user\n redirect_to actions_path(current_user[:id])\n end\n end",
"title": ""
}
] |
b11c0375aaad0817260617d17c2266e0
|
filters need to this in charmode Create a new connection object [+server+] The reactor this connection is associated with. [+sock+] The socket for this connection. [+returns+] A connection object.
|
[
{
"docid": "73a4c3cf8d94b50be73a895152b97f4a",
"score": "0.5576785",
"text": "def initialize(server, sock)\n super(server, sock)\n case @server.service_io\n when :lineio\n @sockio = LineIO.new(@sock)\n when :packetio\n @sockio = PacketIO.new(@sock)\n else\n @sockio = SockIO.new(@sock)\n end\n @inbuffer = \"\" # buffer lines waiting to be processed\n @outbuffer = \"\" # buffer lines waiting to be output\n if @server.service_filters.include? :telnetfilter\n @initdone = false # keeps silent until we're done with negotiations\n else\n @initdone = true\n end\n @pstack = ProtocolStack.new(self)\n end",
"title": ""
}
] |
[
{
"docid": "150c0aabe4527fd202c622c3e5d62474",
"score": "0.65083504",
"text": "def request_sock\n\t\tself.check_closed\n\t\tself.connect unless @request_sock\n\t\treturn @request_sock\n\tend",
"title": ""
},
{
"docid": "150c0aabe4527fd202c622c3e5d62474",
"score": "0.65083504",
"text": "def request_sock\n\t\tself.check_closed\n\t\tself.connect unless @request_sock\n\t\treturn @request_sock\n\tend",
"title": ""
},
{
"docid": "55faf87a12815eff04aa86c108be0611",
"score": "0.6422899",
"text": "def connect\n\t\t# If we already have a connection and we aren't pipelining, close it.\n\t\tif (self.conn)\n\t\t\tif !pipelining?\n\t\t\t\tclose\n\t\t\telse\n\t\t\t\treturn self.conn\n\t\t\tend\n\t\tend\n\n\t\tself.conn = Rex::Socket::Tcp.create(\n\t\t\t'PeerHost' => self.hostname,\n\t\t\t'PeerPort' => self.port.to_i,\n\t\t\t'LocalHost' => self.local_host,\n\t\t\t'LocalPort' => self.local_port,\n\t\t\t'Context' => self.context,\n\t\t\t'SSL' => self.ssl,\n\t\t\t'SSLVersion'=> self.ssl_version,\n\t\t\t'Proxies' => self.proxies\n\t\t)\n\tend",
"title": ""
},
{
"docid": "a39aa1819c406deb10ecdda3ca75fb34",
"score": "0.63158464",
"text": "def with_connection\n connect if @sock.nil? || !@sock.alive?\n yield @sock\n end",
"title": ""
},
{
"docid": "b56ad0873357e0a8c08a16243aea264b",
"score": "0.61471796",
"text": "def get_backend_sock\r\n sock = Rex::Socket::Tcp.create(\r\n 'PeerHost' => datastore['RHOST'],\r\n 'PeerPort' => datastore['RPORT'],\r\n 'SSL' => datastore['SSL'],\r\n 'SSLVerifyMode' => 'NONE',\r\n )\r\n return sock\r\n end",
"title": ""
},
{
"docid": "8220d62cdc290961911b07a2f3d30d38",
"score": "0.6070284",
"text": "def response_sock\n\t\tself.check_closed\n\t\tself.connect unless @response_sock\n\t\treturn @response_sock\n\tend",
"title": ""
},
{
"docid": "8220d62cdc290961911b07a2f3d30d38",
"score": "0.6070284",
"text": "def response_sock\n\t\tself.check_closed\n\t\tself.connect unless @response_sock\n\t\treturn @response_sock\n\tend",
"title": ""
},
{
"docid": "83192130cb553d6c807ac98875e11849",
"score": "0.60171",
"text": "def init\n @host, @addr = @sock.peeraddr.slice(2..3)\n @connected = true\n @server.register(self)\n log.info \"(#{self.object_id}) New Connection on '#{@host}(#{@addr})'\"\n @pstack.filter_call(:init,nil)\n true\n rescue Exception\n log.error \"(#{self.object_id}) Connection#init\"\n log.error $!\n false\n end",
"title": ""
},
{
"docid": "12bcf1ab1e582bf68afb39a3bacb85ec",
"score": "0.5994233",
"text": "def connect(global = true, opts={})\n\n\t\tdossl = false\n\t\tif(opts.has_key?('SSL'))\n\t\t\tdossl = opts['SSL']\n\t\telse\n\t\t\tdossl = ssl\n\t\t\tif (datastore.default?('SSL') and rport.to_i == 443)\n\t\t\t\tdossl = true\n\t\t\tend\n\t\tend\n\n\t\tnsock = Rex::Socket::Tcp.create(\n\t\t\t'PeerHost' => opts['RHOST'] || rhost,\n\t\t\t'PeerPort' => (opts['RPORT'] || rport).to_i,\n\t\t\t'LocalHost' => opts['CHOST'] || chost || \"0.0.0.0\",\n\t\t\t'LocalPort' => (opts['CPORT'] || cport || 0).to_i,\n\t\t\t'SSL' => dossl,\n\t\t\t'SSLVersion'=> opts['SSLVersion'] || ssl_version,\n\t\t\t'Proxies' => proxies,\n\t\t\t'Timeout' => (opts['ConnectTimeout'] || connect_timeout || 10).to_i,\n\t\t\t'Context' =>\n\t\t\t\t{\n\t\t\t\t\t'Msf' => framework,\n\t\t\t\t\t'MsfExploit' => self,\n\t\t\t\t})\n\n\t\t# enable evasions on this socket\n\t\tset_tcp_evasions(nsock)\n\n\t\t# Set this socket to the global socket as necessary\n\t\tself.sock = nsock if (global)\n\n\t\t# Add this socket to the list of sockets created by this exploit\n\t\tadd_socket(nsock)\n\n\t\treturn nsock\n\tend",
"title": ""
},
{
"docid": "7baafff2d7404d7267869dabe0fb6ec4",
"score": "0.59681284",
"text": "def accept(socket)\n conn = Connection.new(socket)\n # Add this Connection to the active connection list\n @connections << conn\n # Display a splash screen.\n conn.write(\"Welcome!\\n\")\n puts \"Accepted a new connection: #{socket.peeraddr[1]}\\n\"\n return conn\n end",
"title": ""
},
{
"docid": "54372207329491d6e3053a744b8e4bdc",
"score": "0.5945972",
"text": "def new_connection(server)\n conn = connect(server)\n opts = server_opts(server)\n\n if ac = opts[:after_connect]\n if ac.arity == 2\n ac.call(conn, server)\n else\n ac.call(conn)\n end\n end\n\n if cs = opts[:connect_sqls]\n cs.each do |sql|\n log_connection_execute(conn, sql)\n end\n end\n\n conn\n end",
"title": ""
},
{
"docid": "906cca114c15b8345933a1d1dd3a06a7",
"score": "0.5898346",
"text": "def newConnection (socket, listen, context=nil)\n begin\n host = socket.peeraddr[2]\n ip = socket.peeraddr[3]\n port = socket.addr[1]\n\n self.debug \"#{host}[#{ip}/#{port}] connecting.\"\n rescue \n self.debug 'Someone failed to connect.'\n\n return\n end\n\n Thread.new {\n begin\n if listen.attributes['ssl'] != 'disabled'\n ssl = OpenSSL::SSL::SSLSocket.new socket, context\n\n timeout server.config.elements['config/server/timeout'].text.to_i do\n ssl.accept\n end\n\n socket = ssl\n end\n\n server.execute(:new_connection, (@connections.things[socket] = Incoming.new(server, socket, listen)))\n @connections.sockets.push(socket)\n\n @input[socket]\n rescue OpenSSL::SSL::SSLError, Timeout::Error\n socket.write_nonblock \"This is a SSL connection, faggot.\\r\\n\" rescue nil\n self.debug \"#{host}[#{ip}/#{port}] tried to connect to a SSL connection and failed the handshake.\"\n socket.close rescue nil\n rescue Errno::ECONNRESET\n socket.close rescue nil\n self.debug \"#{host}[#{ip}/#{port}] connection reset.\"\n rescue Exception => e\n socket.close rescue nil\n self.debug(e)\n end\n }\n end",
"title": ""
},
{
"docid": "5e9a82d10b23e276fce8e2b01119fea2",
"score": "0.5886084",
"text": "def initialize(server, sock=nil)\n @server = server # Reactor or connector associated with this session.\n @sock = sock # File descriptor handle for this session.\n @addr = \"\" # Network address of this socket.\n @accepting=@connected=@closing=@write_blocked=false\n end",
"title": ""
},
{
"docid": "25fece8f168a3fb11774cc8cd4afc9c6",
"score": "0.5882933",
"text": "def connect(global = true, opts={})\n\n dossl = false\n if(opts.has_key?('SSL'))\n dossl = opts['SSL']\n else\n dossl = ssl\n if (datastore.default?('SSL') and rport.to_i == 443)\n dossl = true\n end\n end\n\n nsock = Rex::Socket::Tcp.create(\n 'PeerHost' => opts['RHOST'] || rhost,\n 'PeerPort' => (opts['RPORT'] || rport).to_i,\n 'LocalHost' => opts['CHOST'] || chost || \"0.0.0.0\",\n 'LocalPort' => (opts['CPORT'] || cport || 0).to_i,\n 'SSL' => dossl,\n 'SSLVersion' => opts['SSLVersion'] || ssl_version,\n 'SSLVerifyMode' => opts['SSLVerifyMode'] || ssl_verify_mode,\n 'SSLCipher' => opts['SSLCipher'] || ssl_cipher,\n 'Proxies' => proxies,\n 'Timeout' => (opts['ConnectTimeout'] || connect_timeout || 10).to_i,\n 'Context' =>\n {\n 'Msf' => framework,\n 'MsfExploit' => self,\n })\n\n # enable evasions on this socket\n set_tcp_evasions(nsock)\n\n # Set this socket to the global socket as necessary\n self.sock = nsock if (global)\n\n # Add this socket to the list of sockets created by this exploit\n add_socket(nsock)\n\n return nsock\n end",
"title": ""
},
{
"docid": "8c5051ce97374eb9ca84bb4701a19e9d",
"score": "0.5843946",
"text": "def with_connection\n connect if @socket.nil? || !@socket.alive?\n yield @socket\n end",
"title": ""
},
{
"docid": "5a167aaeaa185cbe55da47a894d70dcd",
"score": "0.5763373",
"text": "def connect_nonsecure(server,port)\n\n tcp_sock=TCPSocket.open(server,port)\n yield tcp_sock if block_given?\n return tcp_sock\n\n end",
"title": ""
},
{
"docid": "b56dacc986d72d871e382e8e60c4df25",
"score": "0.57078445",
"text": "def open_connection\n\t\t\tTCPSocket.new @server, @port\n\t\tend",
"title": ""
},
{
"docid": "9d59a1c4c7539dbe78e36d29bf00fa25",
"score": "0.57036287",
"text": "def connect_socket\n TCPSocket.new @server.ip, @server.port\nend",
"title": ""
},
{
"docid": "32269b56b9186886b3c4d20276cad9e4",
"score": "0.5693814",
"text": "def create_socket_connection\n @current_call.log \"Connecting to AGI server at #{@agi_uri.host}:#{@agi_uri.port}\"\n @agi_client = TCPSocket.new @agi_uri.host, @agi_uri.port\n @agi_client.write initial_message(@agi_uri.host, @agi_uri.port, @agi_uri.path[1..-1])\n true\n rescue => e\n # If we can not open the socket to the AGI server, play/log an error message and hangup the call\n error_message = 'We are unable to connect to the A G I server at this time, please try again later.'\n @current_call.log \"====> #{error_message} <====\"\n @current_call.log e\n failover @tropo_agi_config['tropo']['next_sip_uri']\n false\n end",
"title": ""
},
{
"docid": "2cddd4e0d7bdcf56faecfa3af098c9f6",
"score": "0.5672873",
"text": "def return_socket(sock)\n hostport = get_hostport_for_socket(sock)\n if not hostport\n inet, port, host, ip = s.addr\n Util.err \"Got socket for #{ip}:#{port}, which we don't \" +\n \"know about -- closing\"\n sock.close\n return\n end\n (@sockets[hostport] ||= []) << sock\n end",
"title": ""
},
{
"docid": "717a81b26b2d1fa89641b63d02a116be",
"score": "0.56479716",
"text": "def make_new(server)\n begin\n if @use_old_connect_api\n # SEQUEL6: Remove block\n conn = @db.connect(server)\n\n if ac = @after_connect\n if ac.arity == 2\n ac.call(conn, server)\n else\n ac.call(conn)\n end\n end\n \n if cs = @connect_sqls\n cs.each do |sql|\n db.send(:log_connection_execute, conn, sql)\n end\n end\n\n conn\n else\n @db.new_connection(server)\n end\n rescue Exception=>exception\n raise Sequel.convert_exception_class(exception, Sequel::DatabaseConnectionError)\n end || raise(Sequel::DatabaseConnectionError, \"Connection parameters not valid\")\n end",
"title": ""
},
{
"docid": "570261382593157b1c47f5511bef3b30",
"score": "0.56368166",
"text": "def _server_accept_connection! server\n [ server, @one_way ? nil : server ]\n end",
"title": ""
},
{
"docid": "20ebaee538e81fece370da80b7e2a52a",
"score": "0.5598326",
"text": "def conn\n @conn ||= new_connection\n end",
"title": ""
},
{
"docid": "20ebaee538e81fece370da80b7e2a52a",
"score": "0.5598326",
"text": "def conn\n @conn ||= new_connection\n end",
"title": ""
},
{
"docid": "20ebaee538e81fece370da80b7e2a52a",
"score": "0.5598326",
"text": "def conn\n @conn ||= new_connection\n end",
"title": ""
},
{
"docid": "10869b2d6e2fa0873af4db612df9b7d4",
"score": "0.5592676",
"text": "def create_socket_connection\n @agi_uri = URI.parse @tropo_agi_config['agi']['uri']\n @agi_client = TCPSocket.new(@agi_uri.host, @agi_uri.port)\n @agi_client.write(initial_message(@agi_uri.host, @agi_uri.port, @agi_uri.path[1..-1]))\n true\n rescue => e\n # If we can not open the socket to the AGI server, play/log an error message and hangup the call\n error_message = 'We are unable to connect to the A G I server at this time, please try again later.'\n @current_call.log \"====> #{error_message} <====\"\n @current_call.log e\n failover(@tropo_agi_config['tropo']['next_sip_uri'])\n false\n end",
"title": ""
},
{
"docid": "1c4a5312b833f3706580f42b070edb31",
"score": "0.5589229",
"text": "def socket\n setup_connection unless @socket\n return @socket\n end",
"title": ""
},
{
"docid": "c60ea20ff79dcbecf6e0234652c14190",
"score": "0.5557703",
"text": "def connect\n raise RuntimeError, 'no client socket to connect with' unless @socket\n\n @socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)\n\n $log.c2s.info \"#{@host} -> TCP connection established\"\n\n # We don't send the first stanza, so establish isn't\n # called until they try to establish a stream first.\n\n self\n end",
"title": ""
},
{
"docid": "981cf2e32281ed835713bb0c1a1506b0",
"score": "0.55421215",
"text": "def socket\n return @socket unless closed?\n\n @socket ||= connect\n end",
"title": ""
},
{
"docid": "5ffbf952f8aaa8a397b09923455ee33e",
"score": "0.5523121",
"text": "def get_connection()\n conn_hdrs = {\"accept-version\" => protocol(),\n \"host\" => virt_host(), # the vhost\n }\n if heartbeats()\n conn_hdrs['heart-beat'] = heartbeats()\n end\n\n conn_hash = { :hosts => [\n {:login => login(), :passcode => passcode(), :host => host(), :port => port(),\n :ssl => usessl()},\n ],\n :connect_headers => conn_hdrs,\n }\n conn_hash[:stompconn] = ENV[\"STOMP_USESTOMP\"] ? true : false\n conn = Stomp::Connection.new(conn_hash)\n end",
"title": ""
},
{
"docid": "611eb711e5dfa17fb9a8087241b56589",
"score": "0.5520076",
"text": "def conn(server=:default)\n @conns[@servers[server]]\n end",
"title": ""
},
{
"docid": "945c80cfe6b2471ecf35564aeeff01a7",
"score": "0.5512069",
"text": "def connect(server)\n conn = super\n Sequel.synchronize{@server_connection_map[conn] = server}\n conn\n end",
"title": ""
},
{
"docid": "1e00d7ac3e6345980f43668dbdd83152",
"score": "0.5452664",
"text": "def socket\n\n\t\t\t# Connect if not already connected\n\t\t\tunless @sock || (!@sock.nil? && @sock.closed?)\n\n\t\t\t\t# If the host was dead, don't retry for a while\n\t\t\t\tif @retry\n\t\t\t\t\treturn nil if @retry > Time::now\n\t\t\t\tend\n\n\t\t\t\t# Attempt to connect, \n\t\t\t\tbegin\n\t\t\t\t\t@sock = timeout( ConnectTimeout ) {\n\t\t\t\t\t\tTCPSocket::new( @host, @port )\n\t\t\t\t\t}\n\t\t\t\t\t@status = \"connected\"\n\t\t\t\trescue SystemCallError, IOError, TimeoutError => err\n\t\t\t\t\tself.mark_dead( err.message )\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn @sock\n\t\tend",
"title": ""
},
{
"docid": "918910aac6227982d395cb3e91605033",
"score": "0.544483",
"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": "38df066f2b45b2dd51e6fe1b714f4ce7",
"score": "0.54247767",
"text": "def connect\n @socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)\n\n $log.c2s.info \"#{@host} -> TCP connection established\"\n\n # We don't send the first stanza, so establish isn't\n # called until they try to establish a stream first.\n\n self\n end",
"title": ""
},
{
"docid": "9c40ef9413bfaa6a42425b7d5d7c2500",
"score": "0.5397972",
"text": "def cork_socket(socket); end",
"title": ""
},
{
"docid": "24217f020571ca0e71d88b1b7efae7d9",
"score": "0.5397919",
"text": "def connect(server,port,client_cert_file,client_key_file)\n tcp_sock=TCPSocket.open(server,port)\n ctx = OpenSSL::SSL::SSLContext.new(:TLSv1)\n ctx.cert = OpenSSL::X509::Certificate.new(File.read(client_cert_file))\n ctx.key = OpenSSL::PKey::RSA.new(File.read(client_key_file))\n ssl_sock = OpenSSL::SSL::SSLSocket.new(tcp_sock, ctx)\n ssl_sock.connect\n yield ssl_sock if block_given?\n return ssl_sock\n end",
"title": ""
},
{
"docid": "89136b48f851f18fd9141f6e313f1d97",
"score": "0.538293",
"text": "def initialize(servers, params = {})\n params = params.dup\n\n # User configurable options\n params[:read_timeout] ||= 60\n params[:connect_timeout] ||= 30\n params[:connect_retry_interval] ||= 0.1\n params[:connect_retry_count] ||= 5\n\n # Disable send buffering since it is a RPC call\n params[:buffered] = false\n\n # For each new connection perform the Skynet handshake\n params[:on_connect] = Proc.new do |socket|\n # Reset user_data on each connection\n socket.user_data = {\n :seq => 0,\n :logger => logger\n }\n\n # Receive Service Handshake\n # Registered bool\n # Registered indicates the state of this service. If it is false, the connection will\n # close immediately and the client should look elsewhere for this service.\n #\n # ClientID string\n # ClientID is a UUID that is used by the client to identify itself in RPC requests.\n logger.debug \"Waiting for Service Handshake\"\n service_handshake = Common.read_bson_document(socket)\n logger.trace 'Service Handshake', service_handshake\n\n # #TODO When a reconnect returns registered == false need to throw an exception\n # so that this host connection is not used\n registered = service_handshake['registered']\n client_id = service_handshake['clientid']\n socket.user_data[:client_id] = client_id\n\n # Send blank ClientHandshake\n client_handshake = { 'clientid' => client_id }\n logger.debug \"Sending Client Handshake\"\n logger.trace 'Client Handshake', client_handshake\n socket.write(client_handshake.to_bson)\n end\n\n # To prevent strange issues if user incorrectly supplies server names\n params.delete(:server)\n params[:servers] = servers\n\n @socket = ResilientSocket::TCPClient.new(params)\n end",
"title": ""
},
{
"docid": "46eb6e37dac66f96428aa58e8762d25e",
"score": "0.53792566",
"text": "def ssl_socket(sock)\n raise 'SSL extension not installed' unless defined?(OpenSSL)\n\n sock = OpenSSL::SSL::SSLSocket.new(sock, @ssl_context_doublebag)\n sock.session = @ssl_session if @ssl_session\n sock.sync_close = true\n sock.connect\n print \"get: #{sock.peer_cert.to_text}\" if @debug_mode\n unless @ssl_context_doublebag.verify_mode == OpenSSL::SSL::VERIFY_NONE\n sock.post_connection_check(@hostname)\n end\n @ssl_session = sock.session\n decorate_socket sock\n sock\n end",
"title": ""
},
{
"docid": "e11f7eaaa31216aecae688665653d9dc",
"score": "0.5372124",
"text": "def add_connection(caller_id) #:nodoc:\n connection = TCPROS::Server.new(@caller_id, @topic_name, @topic_type,\n :host=>@host,\n :latched=>@is_latched,\n :last_published_msg=>@last_published_msg)\n connection.start\n connection.id = \"#{@topic_name}_out_#{@connection_id_number}\"\n @connection_id_number += 1\n @connections.push(connection)\n return connection\n end",
"title": ""
},
{
"docid": "4ca2d53e760f41b0538784c01127da19",
"score": "0.5363887",
"text": "def get_connection()\n conn_hdrs = {\"accept-version\" => \"1.1\", # 1.1 only\n \"host\" => virt_host, # the vhost\n }\n conn_hash = { :hosts => [\n {:login => login, :passcode => passcode, :host => host, :port => port},\n ],\n :connect_headers => conn_hdrs,\n }\n conn = Stomp::Connection.new(conn_hash)\n end",
"title": ""
},
{
"docid": "f32252e1e00c48dddf2d2664dd775541",
"score": "0.5357681",
"text": "def connect\n\t\t# Return existing socket\n\t\treturn @socket unless @socket.nil?\n\n\t\t# Create a TCP socket connection\n\t\tbegin\n\t\t\t@socket = TCPSocket.open(@host, @port)\n\t\trescue\n\t\t\traise \"Error: failed to connect to bloomd: #{@host}:#{@port}\"\n\t\tend\n\n\t\t# Return socket instance\n\t\t@socket\n\tend",
"title": ""
},
{
"docid": "de2dd886664e8d04be47532d828e1b85",
"score": "0.5356998",
"text": "def initialize sock, remoteHost, userdir, socketType\n @authenticated = false\n @user = nil\n @userdb = nil\n @@clients << self\n @socket = sock\n @remoteHost = remoteHost\n @socketType = socketType\n @userdir = userdir\n end",
"title": ""
},
{
"docid": "da6aef0dd9b5ce8c432a3a2b6bf3e117",
"score": "0.5343558",
"text": "def create_session(sock)\n\t\tgo = true\n\n\t\t# Give the payload a chance to run\n\t\tRex::ThreadSafe.sleep(1.5)\n\t\n\t\t# This is a hack. If the session is a shell, we check to see if it's\n\t\t# functional by sending an echo which tells us whether or not we're good\n\t\t# to go.\n\t\tif (self.session and self.session.type == 'shell')\n\t\t\tgo = _check_shell(sock)\n\t\telse\n\t\t\tprint_status(\"Trying to use connection...\")\n\t\tend\n\n\t\t# If we're good to go, create the session.\n\t\trv = (go == true) ? super : nil\n\t\t\n\t\t\n\t\tif (rv)\n\t\t\tself._handler_return_value = Claimed\n\t\tend\n\n\t\treturn rv\n\tend",
"title": ""
},
{
"docid": "af9236a7dedc6d18a7a5bd022db19f2c",
"score": "0.5335896",
"text": "def get_connection()\n conn_hdrs = {\"accept-version\" => STOMP_PROTOCOL,\n \"host\" => virt_host(), # the vhost\n }\n conn_hash = { :hosts => [\n {:login => login(), :passcode => passcode(), :host => host(), :port => port()},\n ],\n :connect_headers => conn_hdrs,\n }\n conn = Stomp::Connection.new(conn_hash)\n end",
"title": ""
},
{
"docid": "caea610f4ee0818d69c03aede773abb1",
"score": "0.53226537",
"text": "def connect(server)\n conn = super\n conn.extend(AdapterMethods)\n conn\n end",
"title": ""
},
{
"docid": "eedc7b7d3326bdd5938b5a389907dd2c",
"score": "0.5318324",
"text": "def initialize(server_addr,server_port)\n begin\n @socket = TCPSocket.new(server_addr, server_port)\n rescue Errno::ECONNREFUSED\n raise ClientError, \"Failed to connect to Chain Reactor server on #{server_addr}:#{server_port}\"\n end\n connect\n end",
"title": ""
},
{
"docid": "bde7a9612033ab65def04a752bfb3eac",
"score": "0.53146654",
"text": "def mk_active(host, port)\n if @prot == :ssl\n OpenSSL::SSL::SSLSocket.new(TCPSocket.new(host, port), @socket.context)\n else\n TCPSocket.new(host, port)\n end\n end",
"title": ""
},
{
"docid": "112bff568a234a09befc069e2e10089a",
"score": "0.53121203",
"text": "def checkout_new_socket\n begin\n socket = Socket.new(so_domain(@socktype), so_type(@socktype), 0)\n @sockaddr ||= Socket.pack_sockaddr_in(@port, @host) if ![:unix, :unigram].include?(@socktype)\n @sockaddr ||= Socket.pack_sockaddr_un(@host) if [:unix, :unigram].include?(@socktype)\n socket.connect(@sockaddr)\n if @sockopts.size > 0\n @sockopts.each{ |opt| socket.setsockopt(opt[:level], opt[:optname], opt[:optval]) } \n end\n rescue => ex\n raise ConnectionFailure, \"Failed to connect to host #{@host} and port #{@port}: #{ex}\"\n end\n\n @checked_out << socket\n @sockets << socket\n @pids[socket] = Process.pid\n socket\n end",
"title": ""
},
{
"docid": "7291efa83f70bebc0f982dc0e86006ed",
"score": "0.5305555",
"text": "def connection\n @connection ||= build_connection\n return @connection\n end",
"title": ""
},
{
"docid": "7291efa83f70bebc0f982dc0e86006ed",
"score": "0.5305555",
"text": "def connection\n @connection ||= build_connection\n return @connection\n end",
"title": ""
},
{
"docid": "486664770cc57680924b71cec6b57024",
"score": "0.53020084",
"text": "def connect\n socket = cert_path ? ssl_socket : tcp_socket\n\n yielded = yield socket\n\n socket.close\n yielded\n end",
"title": ""
},
{
"docid": "39eb913f10415ce39fb93fa9855e353c",
"score": "0.5290478",
"text": "def socket\n close if @pid && @pid != Process.pid\n return @socket if @socket and not @socket.closed?\n @socket = Socket.connect( @options )\n @pid = Process.pid\n @read_buffer = ''\n return @socket\n end",
"title": ""
},
{
"docid": "6570c8e5605d5bb7d3bef6dea557bcc5",
"score": "0.52850795",
"text": "def connect(socket)\n info \"*** Server: Received connection from #{format_addr(socket)}\"\n Connection.new(socket)\n end",
"title": ""
},
{
"docid": "a3910303a04d1ed5fc72bc03e0c3d538",
"score": "0.527708",
"text": "def create_server_socket\n\t\tself.log.info \"Creating a SERVER socket bound to: %s\" % [ endpoint ]\n\t\tsock = CZTop::Socket::SERVER.new\n\n\t\tsock.CURVE_server!( Assemblage::Auth.local_cert )\n\t\tsock.options.heartbeat_ivl = self.class.heartbeat_interval\n\t\tsock.options.heartbeat_timeout = self.class.heartbeat_timeout\n\t\tsock.options.zap_domain = ZAP_DOMAIN\n\n\t\tsock.bind( self.endpoint )\n\t\tself.log.info \"Bound to %s\" % [ sock.last_endpoint ]\n\n\t\treturn sock\n\tend",
"title": ""
},
{
"docid": "9cedfe6e5f369c5ca4071ba1f3174684",
"score": "0.52757245",
"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": "c893c22ae277ee2dbd1e11b771d6226f",
"score": "0.5260487",
"text": "def make_connect(address,port)\n#\t\tc = Connection.new()\n\t\t@connects << c\n\tend",
"title": ""
},
{
"docid": "7b15f562a52ab904c509368fb1e64ed4",
"score": "0.5258719",
"text": "def connect!\n if @conf['ssl'] == nil or @conf['ssl'] == false\n @sock = @rsock = TCPSocket.new(@conf['host'], @conf['port'])\n @is_ssl = false\n else\n @rsock = TCPSocket.new(@conf['host'], @conf['port'])\n @ssl_ctx = OpenSSL::SSL::SSLContext.new\n @ssl_ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE\n @ssl_ctx.ssl_version = :SSLv23\n @ssl_ctx.cert = OpenSSL::X509::Certificate.new(File.read(File.expand_path(@conf['ssl_crt']))) if\n @conf['ssl_crt']\n @ssl_ctx.key = OpenSSL::PKey::RSA.new(File.read(File.expand_path(@conf['ssl_key']))) if\n @conf['ssl_key']\n @sock = OpenSSL::SSL::SSLSocket.new(@rsock, @ssl_ctx)\n @sock.sync = true\n @sock.connect\n @is_ssl = true\n end\n\n @running = true\n\n @rloop = Thread.new { readloop }\n @wloop = Thread.new { writeloop }\n\n log.info(\"Started plug `#{name}` successfully!\")\n\n introduce\n\n self\n end",
"title": ""
},
{
"docid": "6d3972b1a9cacc1566a2293edd29b308",
"score": "0.525871",
"text": "def control_socket\n\t\treturn Mongrel2::Control.new( self.control_socket_uri )\n\tend",
"title": ""
},
{
"docid": "6d3972b1a9cacc1566a2293edd29b308",
"score": "0.525871",
"text": "def control_socket\n\t\treturn Mongrel2::Control.new( self.control_socket_uri )\n\tend",
"title": ""
},
{
"docid": "6fead942e63b12153972169a199f9845",
"score": "0.524095",
"text": "def connect_to_server\n ips = Array(@options[:ip])\n ips = ips.shuffle if @options[:shuffle]\n port = @options[:port] || 628\n @errors = []\n ips.each do |ip|\n begin\n @ip, @port = ip.split(':')\n @port ||= port\n socket = TCPSocket.new(@ip, @port)\n rescue SocketError, SystemCallError => e\n @errors << \"QMQP Connect Error [#{ip}:#{port}]: #{e}\"\n end\n return socket if socket\n end\n nil\n end",
"title": ""
},
{
"docid": "78b8f420f64e7db917300ec1e89f9962",
"score": "0.5237694",
"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": "4bc4cd07e8fb60a8cca1a96faa026978",
"score": "0.52225554",
"text": "def createSock\n\t$socket = TCPSocket.open(\"127.0.0.1\", 2000)\n\tputs 'Connected to server'\nend",
"title": ""
},
{
"docid": "826265ebe71c8375683728e7f4f6adc9",
"score": "0.52212554",
"text": "def connection\n #XXX duplicated code from Pooler.r to avoid proc-ing the blk\n Fiber.new do\n server = backend.next\n yield connection_class.start(Fiber.current, server.host, server.port)\n end.resume\n end",
"title": ""
},
{
"docid": "e80ec194dd8dfde5f4920905cb8ccdae",
"score": "0.5207481",
"text": "def connect_client(server, player_name, client_list)\n client = WarSocketClient.new(server.port_number)\n client_list.push(client)\n server.accept_new_client(player_name, client)\nend",
"title": ""
},
{
"docid": "4234075ae213493ef11a588fc2f9e990",
"score": "0.52074707",
"text": "def initialize(conn)\n @conn = conn\n @server = @conn.server\n @filters = [] # Filter order is critical as lowest level protocol is first.\n if @server.service_filters.include? :debugfilter\n @filters << DebugFilter.new(self)\n end\n if @server.service_filters.include? :telnetfilter\n @filters << TelnetFilter.new(self,@server)\n end\n if @server.service_filters.include? :terminalfilter\n @filters << TerminalFilter.new(self)\n end\n if @server.service_filters.include? :colorfilter\n @filters << ColorFilter.new(self)\n end\n if @server.service_filters.include? :filter\n @filters << Filter.new(self)\n end\n\n # Shared variables to facilitate inter-filter communication.\n @sga_on = false\n @echo_on = false\n @binary_on = false\n @zmp_on = false\n @eorec_on = false\n @color_on = false\n @urgent_on = false\n @hide_on = false\n @terminal = nil\n @twidth = 80\n @theight = 23\n end",
"title": ""
},
{
"docid": "f5b5879b7473b98380b11ca9d4027468",
"score": "0.5206489",
"text": "def connection\n request_socket = @context.socket(ZMQ::PULL)\n request_socket.connect(@options.recv_addr)\n\n response_socket = @context.socket(ZMQ::PUB)\n response_socket.connect(@options.send_addr)\n response_socket.setsockopt(ZMQ::IDENTITY, @options.sender_id) if @options.sender_id\n\n Connection.new(request_socket, response_socket)\n end",
"title": ""
},
{
"docid": "b67a8c1695742dc53663f7fede96ac3f",
"score": "0.52011687",
"text": "def new_connection(global: false)\n uri = global ? connection.global_uri : connection.uri\n\n Sequel.connect(uri)\n end",
"title": ""
},
{
"docid": "5f73ccbe61e3e61bdcf671bfec581bfc",
"score": "0.519912",
"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": "3c974d645fcd69cb57871d0ddd2bae57",
"score": "0.51973444",
"text": "def create_socket\n socket = Socket.new(:INET, :STREAM, 0)\n socket.setsockopt(:SOCKET, :REUSEADDR, true)\n socket.setsockopt(Socket::Option.linger(true, 60))\n\n return socket\n end",
"title": ""
},
{
"docid": "1e0bc2815cf0ffd680e9fd10441e236e",
"score": "0.5192047",
"text": "def new_connection\n self.connection = new\n end",
"title": ""
},
{
"docid": "4e8875336155668db51801ebd1841631",
"score": "0.51841265",
"text": "def build! conn\n cipher = nil\n\n protocols = @cfg_ary.map do | klass, params|\n case klass.to_s\n when Protocols::PlainProtocol.to_s, Protocols::Socks5Protocol.to_s, \\\n Protocols::ShadowsocksProtocol.to_s, Protocols::HttpSimpleProtocol.to_s\n # do nothing, these are known protocols don't need cipher\n when Protocols::TlsTicketProtocol.to_s\n # this protocol need a key\n params = {:key => (cipher ||= Cipher.build(@cipher_name, @password)).key}.merge(params)\n else\n params = {:cipher => (cipher ||= Cipher.build(@cipher_name, @password))}.merge(params)\n end\n klass.new(params)\n end\n\n protocols.each_cons(2) do | p, p1 |\n p.next_protocol = p1\n end\n\n protocols.last.tap do |p|\n p.next_protocol = conn\n end\n\n protocols.each do |p|\n case\n when conn.is_a?(ShadowsocksRuby::Connections::TCP::ClientConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :tcp_receive_from_client, :async_recv\n def_delegator :@next_protocol, :tcp_send_to_client, :send_data\n end\n when conn.is_a?(ShadowsocksRuby::Connections::TCP::RemoteServerConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :tcp_receive_from_remoteserver, :async_recv\n def_delegator :@next_protocol, :tcp_send_to_remoteserver, :send_data\n end\n when conn.is_a?(ShadowsocksRuby::Connections::TCP::LocalBackendConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :tcp_receive_from_localbackend, :async_recv\n def_delegator :@next_protocol, :tcp_send_to_localbackend, :send_data\n end\n when conn.is_a?(ShadowsocksRuby::Connections::TCP::DestinationConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :tcp_receive_from_destination, :async_recv\n def_delegator :@next_protocol, :tcp_send_to_destination, :send_data\n end\n when conn.is_a?(ShadowsocksRuby::Connections::UDP::ClientConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :udp_receive_from_client, :async_recv\n def_delegator :@next_protocol, :udp_send_to_client, :send_data\n end\n when conn.is_a?(ShadowsocksRuby::Connections::UDP::RemoteServerConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :udp_receive_from_remoteserver, :async_recv\n def_delegator :@next_protocol, :udp_send_to_remoteserver, :send_data\n end\n when conn.is_a?(ShadowsocksRuby::Connections::UDP::LocalBackendConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :udp_receive_from_localbackend, :async_recv\n def_delegator :@next_protocol, :udp_send_to_localbackend, :send_data\n end\n when conn.is_a?(ShadowsocksRuby::Connections::UDP::DestinationConnection)\n class << p\n extend Forwardable\n def_delegator :@next_protocol, :udp_receive_from_destination, :async_recv\n def_delegator :@next_protocol, :udp_send_to_destination, :send_data\n end\n end\n end \n \n protocols.first\n end",
"title": ""
},
{
"docid": "f07d1043d2298f1f1adf7d89d1189e15",
"score": "0.5180479",
"text": "def checkout_new_socket\n begin\n socket = @client.socket_class.new(@host, @port, @client.op_timeout,\n @client.connect_timeout,\n @client.socket_opts)\n socket.pool = self\n rescue => ex\n socket.close if socket\n @node.close if @node\n raise ConnectionFailure, \"Failed to connect to host #{@host} and port #{@port}: #{ex}\"\n end\n\n # If any saved authentications exist, we want to apply those\n # when creating new sockets and process logouts.\n check_auths(socket)\n\n @sockets << socket\n @checked_out << socket\n @thread_ids_to_sockets[Thread.current.object_id] = socket\n socket\n end",
"title": ""
},
{
"docid": "163303bd1fe9d47b7f1becbe4ebe9ef8",
"score": "0.5179338",
"text": "def connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, socket=nil, flag=0)\n if flag & CLIENT_COMPRESS != 0\n warn 'unsupported flag: CLIENT_COMPRESS'\n flag &= ~CLIENT_COMPRESS\n end\n @protocol = Protocol.new host, port, socket, @connect_timeout, @read_timeout, @write_timeout\n @protocol.authenticate user, passwd, db, (@local_infile ? CLIENT_LOCAL_FILES : 0) | flag, @charset\n @charset ||= @protocol.charset\n @host_info = (host.nil? || host == \"localhost\") ? 'Localhost via UNIX socket' : \"#{host} via TCP/IP\"\n query @init_command if @init_command\n return self\n end",
"title": ""
},
{
"docid": "81d2ac948e0e821cd0af83eb84c2bc2d",
"score": "0.5175931",
"text": "def open_connection\n @tcpserver = TCPSocket.new(server, port)\n @socket = OpenSSL::SSL::SSLSocket.new(@tcpserver, @context)\n\n # Synchronously close the connection & socket\n @socket.sync_close\n\n # Connect\n @socket.connect\n\n # Get the initial greeting frame\n greeting_process(one_frame)\n end",
"title": ""
},
{
"docid": "31bc7addd521f237fedaf7c34d300373",
"score": "0.5173261",
"text": "def connect\n puts \"In Wrack::Connection::SSL#connect\"\n @connection = TCPSocket.new(server, port)\n @connection = OpenSSL::SSL::SSLSocket.new(@connection)\n @connection.connect\n require 'pp'\n pp @connection\n if @connection\n set_signals\n end\n end",
"title": ""
},
{
"docid": "5dbb33609080e590a2876e91430ca0cf",
"score": "0.51731694",
"text": "def connect!\n @clients = servers.collect { |server|\n Client.new(server)\n }.compact\n end",
"title": ""
},
{
"docid": "eb644763b2bd1fee2d6a74b93399219c",
"score": "0.51726794",
"text": "def connect\n @socket = TCPSocket.open(@settings[:server], @settings[:port])\n send :user, \"#{@settings[:nick]} 0 * #{@settings[:real_name]}\"\n send :nick, @settings[:nick]\n identify @settings[:password]\n send :join, @settings[:channel]\n say @settings[:hello]\n\n !@socket.nil?\n end",
"title": ""
},
{
"docid": "476be49bda07fca481746404c869791a",
"score": "0.51650465",
"text": "def connection\n @connection || connect\n end",
"title": ""
},
{
"docid": "a2a48c958b1632574b16703b032ed683",
"score": "0.51600677",
"text": "def connect(sock)\n # construct the request\n request = Request.new\n request.version = SuperGossip::VERSION\n @headers.each do |key,val|\n request.add_header(key,val)\n end\n\n # send request\n start_time = Time.now\n uploaded_bytes = sock.write(request.to_s)\n upload_time = Time.now-start_time\n request.bytesize = uploaded_bytes\n Protocol.log {|logger| logger.info(self.class) { \"Send request:\\n#{request.to_s}\"}}\n\n # read response\n start_time = Time.now\n res = read_response(sock)\n read_time = Time.now-start_time\n\n if res.code==OK\n # send the OK response\n response = Response.new\n response.version = SuperGossip::VERSION\n response.code = OK\n response.message = 'OK'\n start_time = Time.now\n uploaded_bytes += sock.write(response.to_s)\n upload_time += (Time.now-start_time)\n [true,[uploaded_bytes,upload_time,res.bytesize,read_time]]\n else\n [false,[uploaded_bytes,upload_time,res.bytesize,read_time]]\n end\n end",
"title": ""
},
{
"docid": "77d5d443c48b2d6ba05d94846ed323e8",
"score": "0.5159824",
"text": "def open_socket\n Log.debug1(\"Connecting to content server %s:%s\", @host, @port)\n begin\n @tcp_socket = TCPSocket.new(@host, @port)\n rescue Errno::ECONNREFUSED\n Log.warning('Connection refused')\n end\n Log.debug3(\"Reconnect clb: %s\", @reconnected_clb)\n if socket_good?\n @remote_server_available_mutex.synchronize {\n @remote_server_available.signal\n }\n @reconnected_clb.call if @reconnected_clb != nil && socket_good?\n end\n end",
"title": ""
},
{
"docid": "40a9d741297635a1a0a02c6cb86c6442",
"score": "0.51555187",
"text": "def connect(context, server)\n end",
"title": ""
},
{
"docid": "bafff2e6e0430391b273b5547f0a289d",
"score": "0.5147412",
"text": "def open_conn\n\t\t@socket = TCPSocket.new('localhost', 1729)\n\t\t@socket.readline.delete(\"\\r\\n\") # receive hello packet\n\tend",
"title": ""
},
{
"docid": "31b76afce45759d480981c6f9f7f79e9",
"score": "0.51432437",
"text": "def socket; end",
"title": ""
},
{
"docid": "31b76afce45759d480981c6f9f7f79e9",
"score": "0.51432437",
"text": "def socket; end",
"title": ""
},
{
"docid": "57e8da9762f356a0f67f3220110e4b19",
"score": "0.51278365",
"text": "def socket\n return @sock if @sock and not @sock.closed?\n\n @sock = nil\n\n # If the host was dead, don't retry for a while.\n return if @retry and @retry > Time.now\n\n # Attempt to connect if not already connected.\n begin\n @sock = connect_to(@host, @port, @timeout)\n @sock.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1\n @retry = nil\n @status = 'CONNECTED'\n rescue SocketError, SystemCallError, IOError, Timeout::Error => err\n logger.warn { \"Unable to open socket: #{err.class.name}, #{err.message}\" } if logger\n mark_dead err\n end\n\n return @sock\n end",
"title": ""
},
{
"docid": "d48e0b1b764177ea786b704c333f917c",
"score": "0.51275426",
"text": "def add_connection socket\n # make safe TODO\n @connections[socket.remote_node]=socket\n end",
"title": ""
},
{
"docid": "45915aa5872074dfcfabed8346d5f0d6",
"score": "0.5126234",
"text": "def sock\n @sock ||= begin\n sockname = get_sockname\n sockname ? Socket.unpack_sockaddr_in(sockname).reverse : nil\n end\n end",
"title": ""
},
{
"docid": "a77e596e5f6f5c261cf340ff86380d17",
"score": "0.51256764",
"text": "def socket\n connect unless connected?\n @ssl_sock\n end",
"title": ""
},
{
"docid": "f55f3d4d6077ff379c2f62ce70881c51",
"score": "0.51253366",
"text": "def connection\n @connection ||= build_connection\n end",
"title": ""
},
{
"docid": "f55f3d4d6077ff379c2f62ce70881c51",
"score": "0.51253366",
"text": "def connection\n @connection ||= build_connection\n end",
"title": ""
},
{
"docid": "f55f3d4d6077ff379c2f62ce70881c51",
"score": "0.51253366",
"text": "def connection\n @connection ||= build_connection\n end",
"title": ""
},
{
"docid": "291417fc4bdd6313a79e27ef634eb2a1",
"score": "0.5122867",
"text": "def establish_connection\r\n if @socket.nil?\r\n @socket = TCPSocket.new(@host, @port)\r\n end\r\n end",
"title": ""
},
{
"docid": "291417fc4bdd6313a79e27ef634eb2a1",
"score": "0.5122867",
"text": "def establish_connection\r\n if @socket.nil?\r\n @socket = TCPSocket.new(@host, @port)\r\n end\r\n end",
"title": ""
},
{
"docid": "1d188c688fcf0e93d772f3629e553e49",
"score": "0.51225924",
"text": "def create(params)\n\t\tchannel = nil\n\t\tres = nil\n\n\t#\tbegin\n\t\t\tif (params.tcp?)\n\t\t\t\tif (params.server?)\n\t\t\t\t\tchannel = create_tcp_server(params)\n\t\t\t\telse\n\t\t\t\t\tchannel = create_tcp_client(params)\n\t\t\t\tend\n\n\t\t\t\t# Add this channel's right socket to the socket monitor\n\t\t\t\tadd_monitored_socket(channel.rsock, channel)\n\n\t\t\t\t# If we get a valid channel back, create a stream \n\t\t\t\t# representation of the left side of the socket for\n\t\t\t\t# the caller to use\n\t\t\t\tif (channel != nil)\n\t\t\t\t\tres = channel.lsock\n\t\t\t\tend\n\t\t\telsif (params.udp?)\n\t\t\t\tif (params.server?)\n\t\t\t\t\tres = create_udp_server(params)\n\t\t\t\telse\n\t\t\t\t\tres = create_udp_client(params)\n\t\t\t\tend\n\n\t\t\t\t# TODO: Datagram wrapper\n\t\t\tend\n\t#\trescue\n\t#\tend\n\n\t\treturn res\n\tend",
"title": ""
},
{
"docid": "f6314e071fc540267a57a1e31c9829d0",
"score": "0.51205945",
"text": "def get_client()\n conn_hdrs = {\"accept-version\" => protocol(),\n \"host\" => virt_host(), # the vhost\n }\n if heartbeats()\n conn_hdrs['heart-beat'] = heartbeats()\n end\n\n conn_hash = { :hosts => [\n {:login => login(), :passcode => passcode(), :host => host(), :port => port(),\n :ssl => usessl()},\n ],\n :connect_headers => conn_hdrs,\n }\n conn = Stomp::Client.new(conn_hash)\n end",
"title": ""
},
{
"docid": "70a3d039f4849d32e1dd9b7d8a10e60b",
"score": "0.5120264",
"text": "def connect\n #@connection is a singleton: only 1 connection per database\" will need testing in a multiuser situation\n if ! @connection then\n @connection = Redis.new :db=> redis_db_index, :password=> redis_instance.password, :host=> redis_instance.host, :port=> redis_instance.port\n end\n return @connection\n \n end",
"title": ""
},
{
"docid": "f421f9eb437a2369f387b1d9c7c995d4",
"score": "0.5118881",
"text": "def create_server(socket)\n Server.new(DRobyChannel.new(socket, false), interface)\n end",
"title": ""
},
{
"docid": "f421f9eb437a2369f387b1d9c7c995d4",
"score": "0.5118881",
"text": "def create_server(socket)\n Server.new(DRobyChannel.new(socket, false), interface)\n end",
"title": ""
},
{
"docid": "3a646505d956f1bf2298c4810415cac0",
"score": "0.5116106",
"text": "def socket\r\n return @sock if @sock and not @sock.closed?\r\n\r\n @sock = nil\r\n\r\n # If the host was dead, don't retry for a while.\r\n return if @retry and @retry > Time.now\r\n\r\n # Attempt to connect if not already connected.\r\n begin\r\n @sock = @timeout ? TCPTimeoutSocket.new(@host, @port, @timeout) : TCPSocket.new(@host, @port)\r\n\r\n if Socket.constants.include? 'TCP_NODELAY' then\r\n @sock.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1\r\n end\r\n @retry = nil\r\n @status = 'CONNECTED'\r\n rescue SocketError, SystemCallError, IOError, Timeout::Error => err\r\n logger.warn { \"Unable to open socket: #{err.class.name}, #{err.message}\" } if logger\r\n mark_dead err\r\n end\r\n\r\n return @sock\r\n end",
"title": ""
}
] |
9bf4c4ea0f963dec9557afd47a5611c9
|
POST /weather_statuses POST /weather_statuses.json
|
[
{
"docid": "b99d8df9cd4c753759e7c7a46cfbc8ad",
"score": "0.6849832",
"text": "def create\n @weather_status = WeatherStatus.new(params[:weather_status])\n\n respond_to do |format|\n if @weather_status.save\n format.html { redirect_to @weather_status, notice: 'Weather status was successfully created.' }\n format.json { render json: @weather_status, status: :created, location: @weather_status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @weather_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "9ae14b9a2d366878f91962abf614aec6",
"score": "0.63482714",
"text": "def create\n @weather = Weather.new(weather_params)\n\n respond_to do |format|\n if @weather.save\n format.html { redirect_to @weather, notice: 'Weather was successfully created.' }\n format.json { render :show, status: :created, location: @weather }\n else\n format.html { render :new }\n format.json { render json: @weather.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83a3168d4e423337dd481be9da8ae899",
"score": "0.6320198",
"text": "def create\n @weather = Weather.new(weather_params)\n\n respond_to do |format|\n if @weather.save\n format.html { redirect_to @weather, notice: 'Weather was successfully created.' }\n format.json { render action: 'show', status: :created, location: @weather }\n else\n format.html { render action: 'new' }\n format.json { render json: @weather.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a77a1d24641b992d9b026f3fe3bce37",
"score": "0.6302463",
"text": "def create\n\t\t@weather = Weather.new(weather_params)\n\n\t\trespond_to do |format|\n\t\t\tif @weather.save\n\t\t\t\tformat.html { redirect_to @weather, notice: 'Weather was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @weather }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @weather.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7babd598e03cbdeb59c3c06682cb70b0",
"score": "0.6094287",
"text": "def post(tweet=nil)\n @res = access_token.post(\n 'http://twitter.com/statuses/update.json',\n 'status'=> tweet\n )\n end",
"title": ""
},
{
"docid": "f4e0b677c0df4b75860276c0f6d81a7f",
"score": "0.6058881",
"text": "def create\n @weather_service = WeatherService.new(params[:weather_service])\n\n respond_to do |format|\n if @weather_service.save\n format.html { redirect_to @weather_service, notice: 'Weather service was successfully created.' }\n format.json { render json: @weather_service, status: :created, location: @weather_service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @weather_service.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09eb8ea7888fb68b34dcffecf2cdb729",
"score": "0.60414445",
"text": "def create\n @status = Status.new(params[:status])\n\n respond_to do |format|\n if @status.save\n if(!params[:status][:tweet_it].blank? && \"0\" != params[:status][:tweet_it])\n postTwitterStatus(@status)\n end\n\n format.html { redirect_to admin_status_url(@status), notice: 'Status was successfully created.' }\n format.json { render json: @status, status: :created, location: @status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b158661a37b4c253078df42fb5fc608a",
"score": "0.60345006",
"text": "def create\n @weather = Weather.new(params[:weather])\n\n respond_to do |format|\n if @weather.save\n format.html { redirect_to(@weather, :notice => 'Weather was successfully created.') }\n format.xml { render :xml => @weather, :status => :created, :location => @weather }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @weather.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd1782919e3c82d51420df4c3d5c180a",
"score": "0.59877914",
"text": "def post(content)\n post_to(\"/statuses/update.xml\", {:status => content})\n end",
"title": ""
},
{
"docid": "2fe3885a5e147d6abcc30f8d74156ad5",
"score": "0.5973025",
"text": "def create\n # puts \"=============CITY WEATHER PARAMS=============\"\n # puts city_weather_params\n # puts \"=============================================\"\n if city_weather_params['cityName'].empty?\n data = city_weather_params['zipCode']\n param = \"zip\"\n else\n data = city_weather_params['cityName']\n param = \"q\"\n end\n weather_data = JSON.parse(helpers.get_weather(data,param))\n\n puts \"=============Code=============\"\n puts weather_data\n puts weather_data.instance_of? Hash\n # puts weather_data['cod']\n puts \"=============================================\"\n\n unless weather_data['cod'] == '200'\n redirect_to '/city_weathers/new', alert: \"Bogus City!!\"\n else\n # puts \"=============CREATE RESPONSE=============\"\n # puts city_weather_params\n # puts \"=========================================\"\n # weather_id\n @city_weather = CityWeather.new(city_weather_params.merge(:weather_id => weather_data['city']['id']))\n\n # respond_to do |format|\n if @city_weather.save\n redirect_to '/', notices: \"Added!\"\n else\n format.html { render :new }\n format.json { render json: @city_weather.errors, status: :unprocessable_entity }\n end\n # end\n end\n end",
"title": ""
},
{
"docid": "4f52c73daead2e49bfb5e6eabcb1b48d",
"score": "0.5944046",
"text": "def create\n @dailyweather = Dailyweather.new(dailyweather_params)\n\n respond_to do |format|\n if @dailyweather.save\n format.html { redirect_to @dailyweather, notice: 'Dailyweather was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dailyweather }\n else\n format.html { render action: 'new' }\n format.json { render json: @dailyweather.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a38b92ba7cd2209d1e5edf62b4e4044",
"score": "0.59411937",
"text": "def create \n respond_to do |format|\n format.json { render \"create\", :status => status_for(get_tweets) }\n end\n end",
"title": ""
},
{
"docid": "489c0ebc678cccd84e822e177fdb11c2",
"score": "0.5914674",
"text": "def post(text)\n options = { :query => {:status => text}, :basic_auth => @auth }\n self.class.post(\"#{@uri}/api/twitter/statuses/update.json\", options)\n end",
"title": ""
},
{
"docid": "2326bfa86d64fab8d8624efa86cbf127",
"score": "0.5908975",
"text": "def create\n @tweet = Tweet.new(params[:tweet]['sentiment'])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5595b08143e20d7dbe26a1ae853338ba",
"score": "0.5906766",
"text": "def create\n @weather_info = WeatherInfo.new(weather_info_params)\n\n respond_to do |format|\n if @weather_info.save\n format.html { redirect_to @weather_info, notice: 'Weather info was successfully created.' }\n format.json { render :show, status: :created, location: @weather_info }\n else\n format.html { render :new }\n format.json { render json: @weather_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f859cf349012ba0351e9ebc2c4820dab",
"score": "0.59008086",
"text": "def create\n @daily_weather = DailyWeather.new(daily_weather_params)\n\n respond_to do |format|\n if @daily_weather.save\n format.html { redirect_to @daily_weather, notice: \"Daily weather was successfully created.\" }\n format.json { render :show, status: :created, location: @daily_weather }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @daily_weather.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "389e8763d1e80bf3b6b6fb4157da23b3",
"score": "0.5860035",
"text": "def create\n unless logged_in?\n render :file => 'public/401', :status => :unauthorized, :layout => false and return\n end\n\n @user = User.find(weather_station_params[:user_id])\n @weather_station = @user.weather_stations.create(weather_station_params)\n\n respond_to do |format|\n if @weather_station.save\n # Automatically update the station with weather reports\n historical_dates = (1..18).collect {|i| Date.today - i}\n @weather_station.update_from_darksky(historical_dates, true)\n\n format.html { redirect_to @weather_station, notice: 'Weather station was successfully created.' }\n format.json { render :show, status: :created, location: @weather_station }\n else\n format.html { render :new }\n format.json { render json: @weather_station.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fe502650d97e510ab3d293899a0359f",
"score": "0.58400065",
"text": "def create\n # @weather_forecast = WeatherForecast.new(weather_forecast_params)\n #\n # respond_to do |format|\n # if @weather_forecast.save\n # format.html { redirect_to @weather_forecast, notice: 'Weather forecast was successfully created.' }\n # format.json { render :show, status: :created, location: @weather_forecast }\n # else\n # format.html { render :new }\n # format.json { render json: @weather_forecast.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "bb9771e83cb29f14e7228ac4e368af08",
"score": "0.5801305",
"text": "def create\n @weather_datum = WeatherDatum.new(weather_datum_params)\n\n respond_to do |format|\n if @weather_datum.save\n format.html { redirect_to @weather_datum, notice: 'Weather datum was successfully created.' }\n format.json { render :show, status: :created, location: @weather_datum }\n else\n format.html { render :new }\n format.json { render json: @weather_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "019fbff57274251c845e81fd4e5ae20c",
"score": "0.5785427",
"text": "def create\n @weather_update = WeatherUpdate.new(weather_update_params)\n\n respond_to do |format|\n if @weather_update.save\n format.html { redirect_to @weather_update, notice: 'Weather update was successfully created.' }\n format.json { render :show, status: :created, location: @weather_update }\n else\n format.html { render :new }\n format.json { render json: @weather_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01a359438f6c3fb52d112675b1ebfce3",
"score": "0.5780039",
"text": "def post(status)\n url = URI.parse(\"http://#{@@api_url}/statuses/update.xml\")\n req = Net::HTTP::Post.new(url.path)\n \n req.basic_auth(@config[:email], @config[:password])\n req.set_form_data({'status' => status})\n \n response = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }\n Status.new_from_xml(parse(response.body).at('status'))\n end",
"title": ""
},
{
"docid": "4fc0b8297bf6368973a53ea3b86874bb",
"score": "0.577332",
"text": "def one_location_weather(city)\n JSON.parse(self.class.post(\"/weather?q={city}\" + \"#{@token}\").body)\n end",
"title": ""
},
{
"docid": "702b552b6f1b01fec2c33623059ab6e1",
"score": "0.57453763",
"text": "def create_statuses\n end",
"title": ""
},
{
"docid": "702b552b6f1b01fec2c33623059ab6e1",
"score": "0.57453763",
"text": "def create_statuses\n end",
"title": ""
},
{
"docid": "fe83302062308dacd33741329a1b5b48",
"score": "0.57377654",
"text": "def weather_params\n params.require(:weather).permit(:raining)\n end",
"title": ""
},
{
"docid": "c99643c46aaea051cf712c6ae1ca3063",
"score": "0.5710968",
"text": "def weather_statuses\n [:clear, :rainy, :stormy, :snowy, :partly_cloudy, :cloudy, :hailing, :heavy_seas, :calm_seas, :foggy, :snow_flurries, :windy, :partly_cloudy]\n end",
"title": ""
},
{
"docid": "23e5926c39408f982d85f7d09719dcdf",
"score": "0.57043207",
"text": "def tweetpost(tweet, config)\n Net::HTTP.start('twitter.com') do |http|\n req = Net::HTTP::Post.new('/statuses/update.xml')\n req.basic_auth config[:twitter_user], config[:twitter_pass]\n req.set_form_data({'status' => tweet})\n res = http.request(req).body\n end\nend",
"title": ""
},
{
"docid": "43870f70691aa0cfef5677e6aabe928b",
"score": "0.57026994",
"text": "def weather_params\n params.require(:weather).permit(:temperature, :location, :description, :icon_url)\n end",
"title": ""
},
{
"docid": "0ff76d06f3b9ea4c8128d2a2b50b91e7",
"score": "0.56890666",
"text": "def index\n response = HTTParty.get(\"http://api.openweathermap.org/data/2.5/weather?APPID=0bd53bfea661dc3aeb620e5fd01c4aff&q=#{weather_params[\"city\"]},#{weather_params[\"country\"]}\")\n if response.parsed_response[\"cod\"] == 200 \n @weather_stat = JSON.parse(response.body)\n p @weather_stat\n else\n @weather_stat = response.parsed_response\n end\n @weather_stat\n end",
"title": ""
},
{
"docid": "c9e821bd1f1d6e4ac0affeeb2bafbba0",
"score": "0.5687525",
"text": "def new\n @weather_status = WeatherStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weather_status }\n end\n end",
"title": ""
},
{
"docid": "c01d58748efee428fb2daed5b2d1203d",
"score": "0.5645954",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n @tweet.status=\"inactive\"\n @tweet.username=@uname\n @tweets = Tweet.all\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to tweet_indexn_url(@tweet), notice: 'Tweet is submitted for approval.' }\n format.json { render :indexn, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01f0536f56f4cdce3875064b115145d6",
"score": "0.56457156",
"text": "def weather_params\n params.require(:weathers).permit(:address, :latitude, :longitude, :api_key, :units)\n end",
"title": ""
},
{
"docid": "53580467fadae6cc41cc6fde7ba08ebf",
"score": "0.5643869",
"text": "def create\r\n @area = Area.last\r\n @weather = @area.weathers.insert_today_weather @area.x, @area.y\r\n\r\n if @weather\r\n render json: \"success\"\r\n else\r\n render json: \"failed\"\r\n end\r\n end",
"title": ""
},
{
"docid": "981b7360678bb44bea71f5632e6464a8",
"score": "0.56338614",
"text": "def create\n json_data = params[:status]\n if json_data && json_data[:content]\n @status = Status.new(content: json_data[:content])\n if json_data[:topics]\n json_data[:topics].each do |topic|\n @status.topics << topic\n end\n end\n @status.retweeted_id = json_data[:retweeted_id]\n respond_to do |format|\n if @status.save\n current_user.statuses << @status\n format.html { redirect_to @status, notice: 'Status was successfully created.' }\n format.json { render json: @status.as_json(user: current_user), status: :created, location: @status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n else\n render json: {}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "749fa65cdc4b2bebab831321938604bd",
"score": "0.56010735",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n if @tweet.save\n # render :show, status: :created, location: @tweet\n render json: @tweet\n else\n render json: @tweet.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "623de97843c4579df2f556a77e0ce68a",
"score": "0.5598617",
"text": "def weather_params\n\t\t\tparams.require(:weather).permit(:city, :date, :time, :temperature, :description, :windspeed)\n\t\tend",
"title": ""
},
{
"docid": "dd73d3f4aa02b37dde427b300aadaad4",
"score": "0.5590374",
"text": "def create\n @weather_log = WeatherLog.new(weather_log_params)\n\n respond_to do |format|\n if @weather_log.save\n format.html { redirect_to @weather_log, notice: 'Weather log was successfully created.' }\n format.json { render :show, status: :created, location: @weather_log }\n else\n format.html { render :new }\n format.json { render json: @weather_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f8b5d003d06f779768460d3a87765aa",
"score": "0.5585713",
"text": "def create\n params = tweet_params\n name = params[:name]\n user_id = params[:user_id]\n content = params[:content]\n @tweet = Tweet.new({user_id: user_id, content: content })\n\n if @tweet.save\n tweets = get_tweets(name)\n render json: { data: tweets }\n else\n render json: @tweet.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "50e1d8e3080e341e97f8d31a2d84a51b",
"score": "0.55813086",
"text": "def test_should_create_status_post_via_API_JSON\r\n get \"/logout\"\r\n post \"/status_posts.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :created\r\n status_post = JSON.parse(response.body)\r\n check_new_status_post(status_post) \r\n end",
"title": ""
},
{
"docid": "4ec428870a7de85d4b0e20509a2d3af0",
"score": "0.55790126",
"text": "def weather_info_params\n params.require(:weather_info).permit(:temperature, :humidity, :generated_at)\n end",
"title": ""
},
{
"docid": "32dbfdba769f23a936f016f7596ab83e",
"score": "0.55644804",
"text": "def create\r\n @tweet = Tweet.new(legislative_params)\r\n @tweet.save\r\n render json: {success: true}, status: :created\r\n end",
"title": ""
},
{
"docid": "03db1d8b8a865d6a52f51c7483b4ae37",
"score": "0.5558128",
"text": "def perform(status)\n begin\n Api.create_twit(TwitSerializer.new(status))\n rescue RestClient::Exception => e\n unless [Api::CONFLICT, Api::UNPROCESSABLE_ENTITY].include?(e.response.code)\n raise\n end\n end\n end",
"title": ""
},
{
"docid": "e4f24819305fd92ab67f0f556e7dca86",
"score": "0.5549124",
"text": "def weatherPostGenerator\n\tForecastIO.configure do |configuration|\n\t configuration.api_key = '16e00305725189eb6eff8d1c87cbc886'\n\tend\n\n\tforecast = ForecastIO.forecast(40.0506, -77.5203) #CHANGE THESE COORDINATES FOR YOUR LOCATION\n\n\tpost = \"Currently: \" + \n\t\t\temojiTranslator(forecast.currently.icon) + \" \" +\n\t\t\tforecast.currently.temperature.floor.to_s + \"°. Today: \" +\n\t\t\temojiTranslator(forecast.daily.icon) + \n\t\t\t\" \" + forecast.hourly.summary + \" H: \" +\n\t\t\tforecast.daily.data[0].temperatureMax.floor.to_s + \" L: \" +\n\t\t\tforecast.daily.data[0].temperatureMin.floor.to_s + \n\t\t\t\" Wind: \" + forecast.daily.data[0].windSpeed.floor.to_s + \" mph.\"\n\tif post.length > 200\n\t\traise \"SyntaxError\", \"Invalid length, too long to post on Yik Yak.\"\n\tend\n\treturn post\nend",
"title": ""
},
{
"docid": "0e84f84cc7d82043baa58121ba9e47f3",
"score": "0.554127",
"text": "def create\n @weather_station = WeatherStation.new(params[:weather_station])\n\n respond_to do |format|\n if @weather_station.save\n format.html { redirect_to(@weather_station, :notice => 'Weather station was successfully created.') }\n format.xml { render :xml => @weather_station, :status => :created, :location => @weather_station }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @weather_station.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "265117d48250b643071b3a12044e6ea4",
"score": "0.5519969",
"text": "def weather_params\n params.require(:weather).permit(:cityId)\n end",
"title": ""
},
{
"docid": "ae37c220dc00a851462f4c6969e8c4ff",
"score": "0.5517502",
"text": "def create\n @temperature = Temperature.new(temperature_params)\n\n respond_to do |format|\n if @temperature.save\n # POST TO STT\n\n post_uri = URI.parse(ENV[\"HTTP_STT_HTTP\"] + \"://\" + ENV[\"HTTP_STT_HOST\"] + \":\" + ENV[\"HTTP_STT_PORT\"] + ENV[\"HTTP_STT_PATH\"])\n\n\n # puts ENV[\"HTTP_STT_HTTP\"]\n\n header = {'Content-Type': 'application/json'}\n puts \"_____________________________________\"\n puts @temperature.to_json.to_s\n puts \"_____________________________________\"\n\n # Create the HTTP objects\n http = Net::HTTP.new(post_uri.host, post_uri.port)\n request = Net::HTTP::Post.new(post_uri.request_uri, header)\n request.body = @temperature.to_json.to_s\n puts \"created HTTP Objects\"\n \n # Send the request\n response = http.request(request)\n print \"inspection of request: \" ,request.inspect\n \n\n\n\n # Broadcast using websocket\n format.html { redirect_to @temperature, notice: 'Temperature was successfully created.' }\n format.json { render :show, status: :created, location: @temperature }\n else\n format.html { render :new }\n format.json { render json: @temperature.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04d22b8064e5eb8996a519690153f496",
"score": "0.5508527",
"text": "def create\n @dailyweatheractual = Dailyweatheractual.new(dailyweatheractual_params)\n\n respond_to do |format|\n if @dailyweatheractual.save\n format.html { redirect_to @dailyweatheractual, notice: 'Dailyweatheractual was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dailyweatheractual }\n else\n format.html { render action: 'new' }\n format.json { render json: @dailyweatheractual.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04f166eac277ea443c7099df079e4ce0",
"score": "0.5486691",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n\n if @tweet.save\n render :show, status: :created, location: @tweet\n else\n render json: @tweet.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "839c996633b691c94e47dff487feefea",
"score": "0.54634607",
"text": "def create\n logger.info \"*** twitter#create\"\n @tweet = String.new(params[:tweet])\n logger.info \"*** Status is #{@tweet}\"\n respond_to do |format|\n if send_tweet(@tweet)\n format.html { redirect_to :action => \"new\", :notice => \"success\" }\n format.xml { render :xml => @tweet, :status => :created, :location => @tweet }\n else\n format.html { redirect_to :action => \"new\", :notice => \"failure\"}\n format.xml { render :xml => @tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c396cdcd4c79fa46f1c1e6068c2f9b6b",
"score": "0.5452042",
"text": "def create\n if @weather.present?\n data = Weather.structure @weather\n insert_weather data\n end\n\n render :show\n end",
"title": ""
},
{
"docid": "65daef16251d693b4b893d14d898fb2c",
"score": "0.5439001",
"text": "def weather_params\n params.require(:weather).permit(:place_id, :temperature, :min_temperature, :max_temperature, :pressure, :pressure_sea_level, :pressure_grnd_level, :wind_speed, :wind_angle, :clouds, :dt, :humidity)\n end",
"title": ""
},
{
"docid": "e17029f231c0638981d9255e0855ab7c",
"score": "0.5432131",
"text": "def create\n\n\t\t@status = Status.new(params[:status])\n\n\t\tcurrent_user.statuses << @status\n\t\t@status.user = current_user\n\n\t\tif params[:status][:reply_id]\n\t\t\treplied_to = Status.find(params[:status][:reply_id])\n\t\t\t@status.reply = replied_to\n\t\tend\n\n\t\tusernames = Twitter::Extractor.extract_mentioned_screen_names(@status.text)\n\t\tusernames.each do |user|\n\t\t\tbegin\n\t\t\t\tu = User.find_by(screen_name: user)\n\t\t\t\tu.mentioned_statuses << @status\n\t\t\t\t@status.mentions << u\n\t\t\trescue Exception => e\n\t\t\tend\n\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tif @status.save\n\t\t\t\tformat.html { redirect_to :back, :notice =>'Status was successfully created.' }\n\t\t\t\tformat.json { render json: @status, status: :created, location: @status }\n\t\t\telse\n\t\t\t\tif params[:status][:text].length > 256\n\t\t\t\t\tformat.html { redirect_to :back, :alert => 'The status needs to have 256 or less characters!' }\n\t\t\t\telse\n\t\t\t\t\tformat.html { redirect_to :back, :alert => 'You need some text for the status!' }\n\t\t\t\tend\n\t\t\t\tformat.json { render json: @status.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c1ab9f8a0a4a7658cda4ddd74fe5adf4",
"score": "0.54310465",
"text": "def jsonify_tweet status\n url = \"https://twitter.com/#{status.user.handle}/statuses/#{status.id}\"\n time = status.created_at.to_i\n Hash[text: status.text, name: status.user.name, handle: status.user.handle, url: url, time: time, image: status.user.profile_image_url]\n end",
"title": ""
},
{
"docid": "32e7641fffe167b21a8a9a0ad4b3ec16",
"score": "0.5427986",
"text": "def create\n @todo_status = TodoStatus.new(params[:todo_status])\n\n respond_to do |format|\n if @todo_status.save\n format.html { redirect_to todo_statuses_path, notice: 'Todo status was successfully created.' }\n format.json { render json: @todo_status, status: :created, location: @todo_status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @todo_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d026b3aeccef88bc3e598c1f628bdb2e",
"score": "0.5412142",
"text": "def tweet_status(status, media_ids)\n request_url = 'https://api.twitter.com/1.1/statuses/update.json'\n body_params = {\n 'status' => status,\n 'media_ids' => media_ids\n }\n header_params = build_header_params(request_url, body_params)\n\n twitter_uri = URI.parse(request_url)\n https = Net::HTTP.new(twitter_uri.host, twitter_uri.port)\n https.use_ssl = true\n https.verify_mode = OpenSSL::SSL::VERIFY_NONE\n https.set_debug_output $stderr\n\n req = Net::HTTP::Post.new(twitter_uri)\n req['Authorization'] = \"OAuth #{header_params}\"\n req.set_form_data(body_params)\n res = https.request(req)\n\n if res.code == '200'\n return true\n else\n logger.error('tweet_status failed:' + res.body)\n return false\n end\n end",
"title": ""
},
{
"docid": "08e09c32a0683df59bd20f4958f3c210",
"score": "0.5409444",
"text": "def weather_params\n params.require(:weather_datum).permit(:city_id, \\\n :city_name, category_ids: [])\n end",
"title": ""
},
{
"docid": "09ecc477cdfdf45025e7e737e24940ab",
"score": "0.54061633",
"text": "def create\n @qx_weather = Qx::Weather.new(qx_weather_params)\n\n respond_to do |format|\n if @qx_weather.save\n format.html { redirect_to @qx_weather, notice: 'Weather was successfully created.' }\n format.json { render :show, status: :created, location: @qx_weather }\n else\n format.html { render :new }\n format.json { render json: @qx_weather.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48d0390cc8c33e3dae6304aaa9aeb3ce",
"score": "0.5387974",
"text": "def create\n @city_status = CityStatus.new(city_status_params)\n\n respond_to do |format|\n if @city_status.save\n format.html { redirect_to @city_status, notice: 'City status was successfully created.' }\n format.json { render :show, status: :created, location: @city_status }\n else\n format.html { render :new }\n format.json { render json: @city_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04a7da6020d0fb8ce490fe8399aa5bc",
"score": "0.53877234",
"text": "def create\n @tweet = Tweet.new(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04a7da6020d0fb8ce490fe8399aa5bc",
"score": "0.53877234",
"text": "def create\n @tweet = Tweet.new(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04a7da6020d0fb8ce490fe8399aa5bc",
"score": "0.53877234",
"text": "def create\n @tweet = Tweet.new(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b04a7da6020d0fb8ce490fe8399aa5bc",
"score": "0.53877234",
"text": "def create\n @tweet = Tweet.new(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffe412f7581909ec6d7b91dc804ff529",
"score": "0.538708",
"text": "def create\n @tweet = current_user.tweets.build(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { redirect_to root_path, alert: ' Your tweet could not be created. Remember to write something in your tweet' }\n \n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5de88aee18b9bb0988da91177b47747b",
"score": "0.5378728",
"text": "def create\n @raw_tweet = RawTweet.new(raw_tweet_params)\n\n respond_to do |format|\n if @raw_tweet.save\n format.html { redirect_to @raw_tweet, notice: 'Raw tweet was successfully created.' }\n format.json { render :show, status: :created, location: @raw_tweet }\n else\n format.html { render :new }\n format.json { render json: @raw_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b0b878012a2142b27865762592db9d8",
"score": "0.5374871",
"text": "def create \n @user = User.create(params.require(:tweet).permit([:status, :name])) # creates user with status: amazing \n end",
"title": ""
},
{
"docid": "396229a4917b6a7c97e057b53bc56a9b",
"score": "0.53706396",
"text": "def fetch_weather\n response = RestClient.get(WEATHER_URL)\n body = JSON.parse(response.body)\n {\n text: body['query']['results']['channel']['item']['condition']['text'],\n temperature: body['query']['results']['channel']['item']['condition']['temp']\n }\nend",
"title": ""
},
{
"docid": "5b0579efa2f3171b7e82495670a098da",
"score": "0.5360864",
"text": "def raw_tweet_params\n params.require(:raw_tweet).permit(:status_date, :status_id, :status_text, :screen_name)\n end",
"title": ""
},
{
"docid": "afa021b103215df231e8c28c341c32de",
"score": "0.5352285",
"text": "def create\n @weather_hour = WeatherHour.new(weather_hour_params)\n\n respond_to do |format|\n if @weather_hour.save\n format.html { redirect_to @weather_hour, notice: 'Weather hour was successfully created.' }\n format.json { render :show, status: :created, location: @weather_hour }\n else\n format.html { render :new }\n format.json { render json: @weather_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cfc06b1c85f0c7aa6ed5c5e8c0d1d3a",
"score": "0.53484464",
"text": "def create\n @tweet = @zombie.tweets.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to [@zombie, @tweet], notice: 'Tweet was successfully created.' }\n format.json { render action: 'show', status: :created, location: [@zombie,@tweet] }\n else\n format.html { render action: 'new' }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d03c4d877dec82c82c2a424306d9bc33",
"score": "0.5344148",
"text": "def create\n @save_tweet = SaveTweet.new(save_tweet_params)\n @save_tweet.user_id = @user.id\n\n if @save_tweet.save\n render json: @save_tweet, status: :created, location: @save_tweet\n else\n render json: @save_tweet.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5f6ca24ae71600e133aed3a57e3fc47c",
"score": "0.53382015",
"text": "def create\n @tweetdatum = Tweetdatum.new(params[:tweetdatum])\n\n respond_to do |format|\n if @tweetdatum.save\n format.html { redirect_to @tweetdatum, :notice => 'Tweetdatum was successfully created.' }\n format.json { render :json => @tweetdatum, :status => :created, :location => @tweetdatum }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tweetdatum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "543689ccfd0e854e460292db66fd36db",
"score": "0.5338036",
"text": "def test_post_sync\n paint_data = [{ id: 1, status: 2 }]\n post_data = { paint: paint_data }\n post 'sync.json', post_data, { 'HTTP_AUTHORIZATION' => @auth }\n get 'paint_statuses/1.json'\n data = JSON.parse last_response.body\n assert_equal(2, data[0]['status'].to_i)\n end",
"title": ""
},
{
"docid": "857173b6142134285f27f16893918810",
"score": "0.53331167",
"text": "def submit_status_update(status_text)\n RAILS_DEFAULT_LOGGER.info \"NCTwitter(): Tweet with Source [#{@source}]\"\n retcode = 200\n begin\n url = URI.parse(\"http://twitter.com/statuses/update.json\")\n req = Net::HTTP::Post.new(url.path)\n req.basic_auth @username, @password\n req.set_form_data({\"status\" => status_text, \"source\" => @source})\n res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }\n return JSON.parse(res.body) if res.code.to_i == 200\n retcode = res.code.to_i\n rescue Exception => e\n throw_general_exception(\"NCTwitter.submit_status_update()\", e)\n else\n throw_nc_exception(\"NCTwitter.submit_status_update()\", retcode) end\n end",
"title": ""
},
{
"docid": "eb33e115bf9ec336c3bbb0b2de70736a",
"score": "0.5331965",
"text": "def sentiment(text)\n RestClient.post \"http://api.datumbox.com/1.0/SentimentAnalysis.json\", {api_key: '', text: text}, {content_type: :json, accept: :json}\nend",
"title": ""
},
{
"docid": "aa53adacc87f6c3a0eb8ce289696ff47",
"score": "0.53314304",
"text": "def index\n # Get the CityWeather model\n @city_weathers = CityWeather.all\n @days_of_week = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']\n\n # Get the JSON for each City\n @city_data = Array.new\n @city_weathers.each do |city_weather|\n # puts '-----------CITY WEATHER-------------'\n # puts city_weather.inspect\n # puts '------------------------------------'\n\n # Make sure the weather_id exists before we move on\n unless city_weather['weather_id'].nil?\n weather_data = JSON.parse(helpers.get_weather(city_weather['weather_id'],'id'))\n this_city = {\n 'record' => city_weather, \n 'weather_data' => weather_data\n }\n @city_data << this_city\n end\n end\n end",
"title": ""
},
{
"docid": "60cadd277819b4c0a54c199819516487",
"score": "0.5328024",
"text": "def tweet(status)\n\n tweet = Tweet.create!(:status => status)\n self.tweets << tweet\n puts \"IN USER TWEET method\"\n TweetWorker.perform_async(tweet.id)\n end",
"title": ""
},
{
"docid": "bf0b72778d5aab1d9a5c57143f2dab4c",
"score": "0.5322457",
"text": "def create\n @weatherbox = Weatherbox.new(weatherbox_params)\n\n respond_to do |format|\n if @weatherbox.save\n format.html { redirect_to @weatherbox, notice: 'Weatherbox was successfully created.' }\n format.json { render :show, status: :created, location: @weatherbox }\n else\n format.html { render :new }\n format.json { render json: @weatherbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b954eb6efb3ada294e04f2ad843d4583",
"score": "0.5322103",
"text": "def create\n\n client = Twitter::REST::Client.new do |config|\n config.consumer_key= ENV[\"TWITTER_KEY\"]\n config.consumer_secret= ENV[\"TWITTER_SECRET\"]\n config.access_token= ENV[\"TWITTER_TOKEN\"]\n config.access_token_secret = ENV[\"TWITTER_TOKEN_SECRET\"]\n end\n# web link adress to be inserted in tweet post aftet tip creation\n\nweb_url = Rails.application.routes.url_helpers.tips_url(:host => 'chronicillnesses.co.uk' )\n@tip = current_user.tips.new(tip_params)\n\n# posts a tweet to twitter uncomment on production server\n\n# client.update( \"#fibrotrust \" \"#{@tip.title} tip @ #{web_url}\")\n\n\n# ------------------------------------------------------------------------------------------\nrespond_to do |format|\n if @tip.save\n format.html { redirect_to @tip, notice: 'Tip was successfully created.' }\n format.json { render :show, status: :created, location: @tip }\n else\n format.html { render :new }\n format.json { render json: @tip.errors, status: :unprocessable_entity }\n end\nend\nend",
"title": ""
},
{
"docid": "700118c4b7d28b06ea069b12233df866",
"score": "0.53192466",
"text": "def weather_params\n params.require(:weather).permit(:location, :lat, :lon, :choose)\n end",
"title": ""
},
{
"docid": "9972ef5265812d3620198aa9947e97d6",
"score": "0.53147066",
"text": "def tweet(status)\n @client.update(status)\n end",
"title": ""
},
{
"docid": "caa9209d55deac68d960f9e21c5bc8cc",
"score": "0.53139293",
"text": "def sentimentAnalyze(term)\n url = \"http://data.tweetsentiments.com:8080/api/analyze.json?q=#{term}\"\n resp(url)\nend",
"title": ""
},
{
"docid": "ade6fe4ad47047782dad9f5951d031e2",
"score": "0.5312017",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e81a26cbfab7dfddcef836adb9cc4360",
"score": "0.53111887",
"text": "def weather_state_params\n params.require(:weather_state).permit(:weather_id, :main, :description, :icon, :weather_icon_id)\n end",
"title": ""
},
{
"docid": "78ae79f30374c2317419a7af7f0f1d3f",
"score": "0.5297678",
"text": "def create\n @status = current_user.statuses.new(params[:status])\n\n respond_to do |format|\n if @status.save\n format.html { redirect_to @status, notice: 'Ticket was successfully created.' }\n format.json { render json: @status, status: :created, location: @status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba922eb28efaf53da71f4f91a95ada1b",
"score": "0.5297377",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tweet }\n else\n format.html { render action: 'new' }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d69cebf66f4eae04def426df140906",
"score": "0.5296597",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d69cebf66f4eae04def426df140906",
"score": "0.5296597",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d69cebf66f4eae04def426df140906",
"score": "0.5296597",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d69cebf66f4eae04def426df140906",
"score": "0.5296597",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d69cebf66f4eae04def426df140906",
"score": "0.5296597",
"text": "def create\n @tweet = Tweet.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71bcb895557e390bf3f072f00b4fae11",
"score": "0.52948165",
"text": "def create\n @statu = Statu.new(status_params)\n\n if @statu.save\n render json: @statu, status: :created, location: @statu\n # 'statu was successfully created.'\n else\n render json: @statu.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "78697960aa7f4836b528460726624ec7",
"score": "0.5293613",
"text": "def weather_response\n url = URI(\"http://api.openweathermap.org/data/2.5/weather?q=Vi%C3%B1a%20del%20mar&appid=9484ee17fae08ece349011f24f3ccc6b\")\n # Crear un cliente http\n http = Net::HTTP.new(url.host, url.port)\n # Generar un solicitud\n request = Net::HTTP::Get.new(url)\n # Obtener la respuesta\n response = http.request(request)\n JSON.parse(response.read_body)\nend",
"title": ""
},
{
"docid": "4661b581f7e521583976251c73a5200b",
"score": "0.52919847",
"text": "def create\n @tweety = Tweety.new(tweety_params)\n\n respond_to do |format|\n if @tweety.save\n format.html { redirect_to @tweety, notice: 'Tweety was successfully created.' }\n format.json { render :show, status: :created, location: @tweety }\n else\n format.html { render :new }\n format.json { render json: @tweety.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbbf8e40354d51f1a32f778393e9018b",
"score": "0.52872086",
"text": "def create\n @activity_tweet = ActivityTweet.new(params[:activity_tweet])\n\n respond_to do |format|\n if @activity_tweet.save\n format.html { redirect_to @activity_tweet, notice: 'Activity tweet was successfully created.' }\n format.json { render json: @activity_tweet, status: :created, location: @activity_tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @activity_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62247b22e51e90aca6f6c4cb6abc7338",
"score": "0.5275735",
"text": "def create\n @status = current_user.statuses.new(status_params)\n\n respond_to do |format|\n if @status.save\n format.html { redirect_to @status, notice: 'Status was successfully created.' }\n format.json { render :show, status: :created, location: @status }\n else\n format.html { render :new }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b95c80dcb1ab24be3eb509def66a1a5",
"score": "0.5272652",
"text": "def create\n @gettweet = Gettweet.new(params[:gettweet])\n\n respond_to do |format|\n if @gettweet.save\n format.html { redirect_to @gettweet, notice: 'Gettweet was successfully created.' }\n format.json { render json: @gettweet, status: :created, location: @gettweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gettweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcdec2c3e7a1a128346d5146620b66a9",
"score": "0.5251734",
"text": "def create\n @custom_tweet = CustomTweet.new(params[:custom_tweet])\n\n respond_to do |format|\n if @custom_tweet.save\n format.html { redirect_to @custom_tweet, notice: 'Custom tweet was successfully created.' }\n format.json { render json: @custom_tweet, status: :created, location: @custom_tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @custom_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b8bcc25668b4bb8493a73dffa1d7fe5",
"score": "0.5240635",
"text": "def create_tweet\n client.send_tweet(params['Full Text'])\n head 200, content_type: \"text/html\"\n end",
"title": ""
},
{
"docid": "d200a1d2c89a1828cbb0b28ef2735e1c",
"score": "0.5235947",
"text": "def create\n @hashtags_tweet = HashtagsTweet.new(params[:hashtags_tweet])\n\n respond_to do |format|\n if @hashtags_tweet.save\n format.html { redirect_to @hashtags_tweet, notice: 'Hashtags tweet was successfully created.' }\n format.json { render json: @hashtags_tweet, status: :created, location: @hashtags_tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hashtags_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6257344bc492da6da4a3333c0d6c9f86",
"score": "0.52342093",
"text": "def tweet_params\n params.require(:tweet).permit(:status, :user_id)\n end",
"title": ""
},
{
"docid": "89c0622cb1542a59d666d2c382d9ec8f",
"score": "0.5232754",
"text": "def create\n @twat = Twat.new(twat_params)\n\n respond_to do |format|\n if @twat.save\n format.html { redirect_to @twat, notice: 'Twat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @twat }\n else\n format.html { render action: 'new' }\n format.json { render json: @twat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
a24093848dcafd5ab9d9f7b6eb76c7b4
|
Update an object with the given attributes. This is done by a special model method because changes of the 'active' flag have side effects for other associated objects. THE CALLER MUST USE A TRANSACTION around a call to this method. There is no need to call here unless the 'active' flag state is changing. Pass in 'true' to update associated projects, else 'false' and 'true' to update associated tasks via those projects (only if updating projects too), else 'false'. Booleans default to 'true' if omitted.
|
[
{
"docid": "ca9937460d9e5fba0232aa730fc8070c",
"score": "0.7524472",
"text": "def update_with_side_effects!( attrs, update_projects = true, update_tasks = true )\n active = self.active\n self.update_attributes!( attrs )\n\n # If the active flag has changed, deal with repercussions.\n\n if ( update_projects and attrs[ :active ] != active )\n self.projects.all.each do | project |\n project.update_with_side_effects!( { :active => attrs[ :active ] }, update_tasks )\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "453a06b707bf6afc9afd9c31b56b8b43",
"score": "0.68477607",
"text": "def update_with_side_effects!( attrs, update_tasks = true )\n active = self.active\n self.update_attributes!( attrs )\n\n # If the active flag has changed, deal with repercussions.\n\n if ( update_tasks and attrs[ :active ] != active )\n self.tasks.all.each do | task |\n task.update_with_side_effects!( { :active => attrs[ :active ] } )\n end\n end\n end",
"title": ""
},
{
"docid": "2445e724c02e2a994c12e55f3ec3fa5f",
"score": "0.651574",
"text": "def update(attributes = {}, *allowed)\n assert_kind_of 'attributes', attributes, Hash\n\n # filter out only allowed attributes\n self.attributes = allowed.any? ? attributes.only(*allowed) : attributes\n\n # retrieve the attributes that need to be persisted\n dirty_attributes = self.dirty_attributes\n\n if dirty_attributes.empty?\n true\n elsif dirty_attributes.only(*model.key).values.any? { |v| v.blank? }\n false\n else\n repository.update(dirty_attributes, to_query) == 1\n end\n end",
"title": ""
},
{
"docid": "b75b990d8fa21537aa618928268bbec2",
"score": "0.65046495",
"text": "def update_with_side_effects!( attrs )\n active = self.active\n self.update_attributes!( attrs )\n\n # If the active flag has changed and it *was* 'true', then the task\n # has just been made inactive.\n\n if ( attrs[ :active ] != active and active == true )\n\n # When tasks are made inactive, remove them from each of the Task lists\n # in User and ControlPanel objects. There are checks for this elsewhere,\n # but they're only to try and catch cases where this code has gone wrong.\n #\n # Although only restricted users make use of this list, other user types\n # may have a list set up either accidentally or because the user's type\n # is due to be changed to one with lower permissions. As a result, we\n # must update every user.\n\n User.all.each do | user |\n user.remove_inactive_tasks()\n user.save!\n end\n\n ControlPanel.all.each do | cp |\n cp.remove_inactive_tasks()\n cp.save!\n end\n end\n end",
"title": ""
},
{
"docid": "3092aa3651178421e81e2edcf515ef8c",
"score": "0.6397857",
"text": "def update\n params_hash = params['data']['attributes'].to_unsafe_h\n if params_hash.in?([{ 'active' => 'false' }, { 'active' => 'false' }]) &&\n !params['data'].key?('relationships')\n object = @objects.find(params[:id])\n active = params_hash['active']\n\n success = true\n if object.active? && active.to_s == 'false'\n success = object.deactivate!\n elsif object.inactive? && active.to_s == 'true'\n success = object.activate!\n end\n\n if success\n render_single_object_to_json(object)\n else\n render_errors(object.errors)\n end\n else\n # binding.pry\n super\n end\n end",
"title": ""
},
{
"docid": "5085c6dde41969f22382a14e2c2a6867",
"score": "0.6283292",
"text": "def update(params = {})\n params ||= {}\n params[:id] = @attributes[:id]\n raise MissingParameterError.new(\"Current object doesn't have a id\") unless @attributes[:id]\n raise InvalidParameterError.new(\"Bad parameter: id must be an Integer\") if params[:id] and !params[:id].is_a?(Integer)\n raise InvalidParameterError.new(\"Bad parameter: global_access must be an String\") if params[:global_access] and !params[:global_access].is_a?(String)\n raise MissingParameterError.new(\"Parameter missing: id\") unless params[:id]\n raise MissingParameterError.new(\"Parameter missing: global_access\") unless params[:global_access]\n\n Api.send_request(\"/projects/#{@attributes[:id]}\", :patch, params, @options)\n end",
"title": ""
},
{
"docid": "005b19bef1a92c51fefc385ceaa2ec60",
"score": "0.6173137",
"text": "def update(params = {})\n # set params (:status param makes it a little complicated)\n #\n updated_params = (params || self.attributes).symbolize_keys\n updated_status = updated_params.delete(:status)\n \n response = self.mutate(\n :operator => 'SET', \n :operand => {\n :ad_group_id => self.ad_group_id,\n :ad => updated_params.merge(:id => self.id),\n :status => updated_status\n }\n )\n\n (response and response[:value]) ? true : false\n end",
"title": ""
},
{
"docid": "e10062debf06af85eea291348e4aaa20",
"score": "0.6068061",
"text": "def update_status(require_save = false)\n if closed?\n self.project_status = 'closed'\n elsif timings.any?\n self.project_status = 'in_progress'\n elsif entries.any?\n self.project_status = 'scheduled'\n elsif quotes.where(quote_status: 2).any?\n self.project_status = 'approved'\n else\n self.project_status = 'opportunity'\n end\n\n self.save if require_save\n end",
"title": ""
},
{
"docid": "d906a617b69e572451fd6833f7ecd11e",
"score": "0.60368484",
"text": "def update!(attributes = {})\n dirty_attributes = model.new(attributes).dirty_attributes\n\n if dirty_attributes.empty?\n true\n elsif dirty_attributes.any? { |property, value| !property.nullable? && value.nil? }\n false\n else\n unless _update(dirty_attributes)\n return false\n end\n\n if loaded?\n each do |resource|\n dirty_attributes.each { |property, value| property.set!(resource, value) }\n repository.identity_map(model)[resource.key] = resource\n end\n end\n\n true\n end\n end",
"title": ""
},
{
"docid": "99e59ac21e3d4953b5c404790dae2315",
"score": "0.6022146",
"text": "def update(attrs, user = @@default_user)\n attrs = { id: @id }.merge(attrs)\n @attributes = send_request(\"projects/#{attrs[:id]}\", :put) do |req|\n req.body = {\n project: attrs.except(:id),\n auth_token: user.auth_token\n }\n end\n end",
"title": ""
},
{
"docid": "e3c8fe729a35bdd9dc02d5b474b01111",
"score": "0.60136336",
"text": "def update!(**args)\n @boolean_values = args[:boolean_values] if args.key?(:boolean_values)\n end",
"title": ""
},
{
"docid": "e3c8fe729a35bdd9dc02d5b474b01111",
"score": "0.60136336",
"text": "def update!(**args)\n @boolean_values = args[:boolean_values] if args.key?(:boolean_values)\n end",
"title": ""
},
{
"docid": "e3c8fe729a35bdd9dc02d5b474b01111",
"score": "0.60136336",
"text": "def update!(**args)\n @boolean_values = args[:boolean_values] if args.key?(:boolean_values)\n end",
"title": ""
},
{
"docid": "426822c9be7a3b2aa423993efcde5faf",
"score": "0.6010634",
"text": "def update_attributes!( attributes )\n # We prevent the changing of workflow here, because we want to explicitly control that in the helper methods.\n attributes = attributes.merge( { :workflow_id => self.workflow, :resource_id => self.resource_id } )\n self.class.transaction do\n case self.workflow\n # For a pending record, just save changes directly to this record.\n when Workflow.pending\n super( attributes.merge(:current => (attributes[:current] || false ) ) )\n return self\n # For a published record, create a new pending record and return it.\n when Workflow.published\n super( attributes )\n return self\n else\n super( attributes )\n return self\n end\n end\n end",
"title": ""
},
{
"docid": "cc0e82c52f7d3a3ea1ae749f542d30e2",
"score": "0.5989641",
"text": "def update\n @project = Project.find(params[:id])\n editUpdate = params[:project]\n hideUpdate = editUpdate.extract_keys!([:hidden])\n adminUpdate = editUpdate.extract_keys!([:featured, :is_template,:curated])\n success = false\n\n #EDIT REQUEST\n if can_edit?(@project) && !editUpdate.empty?\n success = @project.update_attributes(editUpdate)\n end\n\n #HIDE REQUEST\n if can_hide?(@project) && !hideUpdate.empty?\n success = @project.update_attributes(hideUpdate)\n end\n\n\n #ADMIN REQUEST\n if can_admin?(@project)\n\n if adminUpdate.has_key?(:featured)\n if adminUpdate['featured'] == \"1\"\n adminUpdate['featured_at'] = Time.now()\n else\n adminUpdate['featured_at'] = nil\n end\n end\n\n if adminUpdate.has_key?(:curated)\n if adminUpdate['curated'] == true\n adminUpdate['curated_at'] = Time.now()\n adminUpdate['lock'] = \"true\"\n else\n adminUpdate['curated_at'] = nil\n end\n end\n\n success = @project.update_attributes(adminUpdate)\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render json: {}, status: :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors.full_messages(), status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62d4d901ca4c8c1503a7d8b5ccdb3bf9",
"score": "0.59751385",
"text": "def update\n @project = Project.find(params[:id])\n editUpdate = params[:project].to_hash\n hideUpdate = editUpdate.extract_keys!([:hidden])\n adminUpdate = editUpdate.extract_keys!([:featured, :is_template])\n success = false\n\n #EDIT REQUEST\n if can_edit?(@project)\n success = @project.update_attributes(editUpdate)\n end\n\n #HIDE REQUEST\n if can_hide?(@project)\n success = @project.update_attributes(hideUpdate)\n end\n\n #ADMIN REQUEST\n if can_admin?(@project)\n\n if adminUpdate.has_key?(:featured)\n if adminUpdate['featured'] == \"1\"\n adminUpdate['featured_at'] = Time.now()\n else\n adminUpdate['featured_at'] = nil\n end\n end\n\n success = @project.update_attributes(adminUpdate)\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render json: {}, status: :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors.full_messages(), status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e117814a295ccf51fa9b78a5d0255b5",
"score": "0.5956056",
"text": "def update(attributes = {})\n dirty_attributes = model.new(attributes).dirty_attributes\n dirty_attributes.empty? || all? { |resource| resource.update(attributes) }\n end",
"title": ""
},
{
"docid": "5fd8dd951d06a61e4c826063a0824dd0",
"score": "0.59526044",
"text": "def update_attributes( attributes )\n # We prevent the changing of workflow here, because we want to explicitly control that in the helper methods.\n attributes = attributes.merge( { :workflow_id => self.workflow, :resource_id => self.resource_id } )\n self.class.transaction do\n case self.workflow\n # For a pending record, just save changes directly to this record.\n when Workflow.pending\n super( attributes.merge(:current => false) )\n return self\n # For a published record, create a new pending record and return it.\n when Workflow.published\n super( attributes )\n return self\n else\n super( attributes )\n return self\n end\n end\n end",
"title": ""
},
{
"docid": "a9b6a7f6054eb0990b09d10cc1f989ff",
"score": "0.5936396",
"text": "def update_attributes(attributes={})\n __update_attributes attributes\n save\n self\n end",
"title": ""
},
{
"docid": "d8b3bf9ec121e23dad3af2edca6e6094",
"score": "0.59187704",
"text": "def update(attributes); end",
"title": ""
},
{
"docid": "6c7ac52676f5e118ffd4b03bc21f173b",
"score": "0.59131134",
"text": "def update_attributes(attributes); end",
"title": ""
},
{
"docid": "7d01e3035620b2b96e7d3b93866210be",
"score": "0.5892752",
"text": "def update_attributes!(attributes, options={})\n self.assign_attributes(attributes, options)\n save!\n end",
"title": ""
},
{
"docid": "09f0335d4296afdcba4eaf30beba01f3",
"score": "0.5892206",
"text": "def update_attributes(attributes = {})\n update(attributes)\n end",
"title": ""
},
{
"docid": "8666e8773ca5da8f9314a02fc69355de",
"score": "0.58876514",
"text": "def update!(attributes = {})\n self.attributes = attributes\n\n if dirty_attributes.empty?\n true\n elsif dirty_attributes.any? { |property, value| !property.nullable? && value.nil? }\n false\n else\n # remove from the identity map\n identity_map.delete(key)\n\n unless repository.update(dirty_attributes, Collection.new(query, [ self ]))\n return false\n end\n\n # remove the cached key in case it is updated\n remove_instance_variable(:@key)\n\n original_attributes.clear\n\n identity_map[key] = self\n\n true\n end\n end",
"title": ""
},
{
"docid": "beae7e1c24afe668b7c693849588c78e",
"score": "0.5883903",
"text": "def update_attributes!( params={} )\n return false unless full_record? # TODO: raise some kind of specific error here\n\n params.each do |key,val|\n self.instance_variable_set(\"@#{key.to_s}\", val)\n end\n\n data = ConstantContact.put( \"/contacts/#{self.uid}\", :body => self.send(:to_xml) )\n if data.code == 204 # success\n return true\n else\n raise create_exception(data)\n end\n end",
"title": ""
},
{
"docid": "033eff1d0f4c59f9fc10557e7a1c428d",
"score": "0.5874505",
"text": "def update_attributes!(attributes, options = {})\n self.assign_attributes(attributes)\n save!\n end",
"title": ""
},
{
"docid": "38c7497edbbd8dbb4ae32df745a27cdc",
"score": "0.587402",
"text": "def update_attributes!(attributes, options = {})\n self.assign_attributes(attributes, options)\n save!\n end",
"title": ""
},
{
"docid": "0c488501a55902a8678a83306dee792e",
"score": "0.5868035",
"text": "def update_attributes!(attributes, _options = {})\n assign_attributes(attributes)\n save!\n end",
"title": ""
},
{
"docid": "71ff3859ff48d934576a73c5af2e78ea",
"score": "0.5854114",
"text": "def update_attributes(attributes = {}, options = {})\n assign_attributes(attributes, options); save\n end",
"title": ""
},
{
"docid": "277ee32e8b0fdedf61110460f7074793",
"score": "0.5853068",
"text": "def update\n @project = @account.projects.find(params[:id])\n authorize @project, :update?\n @project.project_status_overridden = true\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.json { render json: @project }\n else\n format.json { render json: { success: false } }\n end\n end\n end",
"title": ""
},
{
"docid": "f5eab0264ace0ae11eab2566339b53fe",
"score": "0.5849282",
"text": "def update\n standard_update(Project, params[:id], project_params)\n end",
"title": ""
},
{
"docid": "81ac1322c1360e27d7fe62bebc0b6dad",
"score": "0.584149",
"text": "def update_and_approve(new_params, user=nil)\n # Process the apporval if required\n unless new_params[:approvals_attributes].nil?\n accepted = Approval.process(new_params[:approvals_attributes][\"0\"], user)\n new_params[:active] = accepted\n end\n self.update_attributes(new_params)\n end",
"title": ""
},
{
"docid": "b9bc7d2853ddb22bc43d229df19f7fd1",
"score": "0.5811549",
"text": "def update_attributes(attributes, options={})\n self.assign_attributes(attributes, options)\n save\n end",
"title": ""
},
{
"docid": "026c158987ee828444adc742de6925bf",
"score": "0.58070165",
"text": "def update(attributes)\n with_options(\n request_method: :put,\n body_params: attributes\n ).response\n end",
"title": ""
},
{
"docid": "b2ed2aa0db3467d11b71c3f8fcbdda25",
"score": "0.5795723",
"text": "def update(config_obj)\n ret_val = false\n ret_val = true if update_attributes(config_obj)\n ret_val = true if update_entities(config_obj)\n ret_val = true if update_media(config_obj)\n ret_val = true if update_notification_rules(config_obj)\n return ret_val\n end",
"title": ""
},
{
"docid": "4824424691075bd8c34b0969d85718d6",
"score": "0.57935715",
"text": "def update!(**args)\n @active = args[:active] if args.key?(:active)\n @description = args[:description] if args.key?(:description)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n end",
"title": ""
},
{
"docid": "9d216632d3a9eb3bab98358e3878af99",
"score": "0.5792",
"text": "def update_attributes(attributes, options = {})\n self.assign_attributes(attributes, options)\n save\n end",
"title": ""
},
{
"docid": "f5879174ca14ea2d8dbde7fc9f34f671",
"score": "0.578461",
"text": "def update_attributes(attributes, _options = {})\n assign_attributes(attributes)\n save\n end",
"title": ""
},
{
"docid": "77d1e117cd373a130b0e2e373e6df15f",
"score": "0.5782971",
"text": "def update_attributes(attributes) \n load(attributes) && save \n end",
"title": ""
},
{
"docid": "2c00f5338a5babd6e3249a67f506a78f",
"score": "0.5768959",
"text": "def update_attributes(attributes, options = {})\n self.assign_attributes(attributes)\n save\n end",
"title": ""
},
{
"docid": "46b692092de328dda2cb518ad5237609",
"score": "0.5743156",
"text": "def update(attributes = {})\n self.execute_request(:update,attributes)\n end",
"title": ""
},
{
"docid": "d071ebe0479de79e3dad7875873b3466",
"score": "0.5733311",
"text": "def status_update\n @todo = Todo.find(params[:id])\n @todo.update(active: !@todo.active?)\n end",
"title": ""
},
{
"docid": "7e97f95f4444c92ff5fb562dd3c33c6d",
"score": "0.572428",
"text": "def update(params = {})\n valid? && assign_attributes(params) && save\n end",
"title": ""
},
{
"docid": "93e4f1a47bcc67e001d4f92ab7709dc0",
"score": "0.5718029",
"text": "def update\n @project = current_user.projects.find(params[:id])\n\n now = DateTime.now.utc\n case params[:commit]\n when \"Deny\"\n @project.denied_by_citizen_efect_at = now\n @project.project_status = ProjectStatus.denied\n when \"Send back to Partner\"\n @project.sent_back_to_partner_by_citizen_effect_at = now\n @project.project_status = ProjectStatus.needs_more_information\n when \"Approve Now\"\n @project.approved_by_citizen_effect_at = now\n @project.project_status = ProjectStatus.awaiting_cp\n end\n if params[:project][:project_status_id] == \"7\" and @project.project_status_id != 7\n @project.fundraising_start_date = now\n end\n respond_to do |format|\n if @project.update_attributes(params[:project])\n flash[:notice] = 'Project proposal was successfully updated.'\n format.html { redirect_to([:admin, @project]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bedafc5e456e1a3756c832780fecac0",
"score": "0.57152265",
"text": "def update\n @project = Project.find(params[:id])\n update = project_params\n # If the user hit the \"Reset Defaults\" button, set globals to nil.\n # nil can't be passed from the url, so do it here.\n update[:globals] = nil if update[:globals] == ''\n\n # ADMIN REQUEST\n if current_user.try(:admin)\n if update.key?(:featured)\n if update['featured'] == 'true'\n update['featured_at'] = Time.now\n else\n update['featured_at'] = nil\n end\n end\n\n if update.key?(:curated)\n if update['curated'] == 'true'\n update['curated_at'] = Time.now\n update['lock'] = true\n else\n update['curated_at'] = nil\n end\n end\n end\n\n respond_to do |format|\n if can_edit?(@project) && @project.update_attributes(update)\n format.html do\n redirect_to @project, notice: 'Project was successfully updated.'\n end\n format.json { render json: {}, status: :ok }\n else\n @project.errors[:base] << 'Permission denied' unless can_edit?(@project)\n format.html { render action: 'show' }\n format.json do\n render json: @project.errors.full_messages,\n status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "aa3042134ee482c4d3ae4529a21f8484",
"score": "0.5712488",
"text": "def update_attributes(attributes)\n load(attributes, false) && save\n end",
"title": ""
},
{
"docid": "fb4a411199ade8b6ae4647c9f8b4bd4d",
"score": "0.5711841",
"text": "def update\n @project = Project.find(params[:id])\n if params[:project][:phase] == 'Ongoing support' \n \tProject.ongoing_support = true\n else\n \tProject.ongoing_support = false\n end\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f4e4f824ba6e967a52208dfd73e313d",
"score": "0.5709113",
"text": "def update\n @project = Project.find(params[:id])\n params = project_params\n if (params.has_key?(\"development_plan_attributes\") && @project.development_plan.present?)\n params[\"development_plan_attributes\"][\"id\"] = @project.development_plan.id\n end\n if (params.has_key?(\"financial_attributes\") && @project.financial.present?)\n params[\"financial_attributes\"][\"id\"] = @project.financial.id\n end\n if @project.update(params)\n head :no_content\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a8029ec3026cc4762c12d0a65a137d9a",
"score": "0.56959766",
"text": "def update!(attributes = {}, reload = false)\n # TODO: delegate to Model.update\n return true if attributes.empty?\n\n dirty_attributes = {}\n\n model.properties(repository.name).slice(*attributes.keys).each do |property|\n dirty_attributes[property] = attributes[property.name] if property\n end\n\n # this should never be done on update! even if collection is loaded. or?\n # each { |resource| resource.attributes = attributes } if loaded?\n\n changes = repository.update(dirty_attributes, scoped_query)\n\n # need to decide if this should be done in update!\n query.update(attributes)\n\n if identity_map.any? && reload\n reload_query = @key_properties.zip(identity_map.keys.transpose).to_hash\n model.all(reload_query.merge(attributes)).reload(:fields => attributes.keys)\n end\n\n # this should return true if there are any changes at all. as it skips validations\n # the only way it could be fewer changes is if some resources already was updated.\n # that should not return false? true = 'now all objects have these new values'\n return loaded? ? changes == size : changes > 0\n end",
"title": ""
},
{
"docid": "20aa8f8650f4628b2d087f171b004989",
"score": "0.5690959",
"text": "def update(atts)\n run_callbacks(:before_save)\n run_callbacks(:before_update)\n attributes.merge!(atts)\n run_callbacks(:after_save)\n run_callbacks(:after_update)\n true\n end",
"title": ""
},
{
"docid": "b582b61323e107cb7d13b532c8d02d51",
"score": "0.568866",
"text": "def update(attributes = {})\n assign_attributes(attributes)\n save\n end",
"title": ""
},
{
"docid": "749afa4ff068e21c7d78bbad94c19d6c",
"score": "0.5678766",
"text": "def update!(attributes); end",
"title": ""
},
{
"docid": "1bc2455f47e7b94c2c4b5f7f5b4b8303",
"score": "0.56770265",
"text": "def update_attributes(params = {})\n assign_attributes(params)\n save\n end",
"title": ""
},
{
"docid": "cec89e79832cee42401b48fdb243ec42",
"score": "0.5669249",
"text": "def update\n @project_id = params[:id]\n @project = Project.find(params[:id])\n\n if @project.update_attributes(params[:project])\n render :json => {:success => true}\n else\n render :json => {:failure => true}\n end\n end",
"title": ""
},
{
"docid": "68d77eae7c63a52790da519afb4ba4d6",
"score": "0.56665415",
"text": "def update(attributes)\n\n end",
"title": ""
},
{
"docid": "ed57b64334dd337bd83371bfb7abdf8a",
"score": "0.56628615",
"text": "def update_attributes!( params={} )\n return false unless full_record?\n\n params.each do |key,val|\n self.instance_variable_set(\"@#{key.to_s}\", val)\n end\n\n data = ConstantContact.put( \"/lists/#{self.uid}\", :body => self.send(:to_xml) )\n\n if data.code == 204\n return true\n else\n raise create_exception(data)\n end\n end",
"title": ""
},
{
"docid": "b1be34900e75e492baf1529958b06eca",
"score": "0.56583965",
"text": "def update\n @project.create_activity :update, owner: current_user\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": "200e120d5b3dad5a5bb2f0704fb2e3f4",
"score": "0.56556827",
"text": "def update_attributes(attrs = {})\n set_attributes(attrs); save\n end",
"title": ""
},
{
"docid": "5e659c92acecb3e83badf2bacefed880",
"score": "0.56502444",
"text": "def update_attributes(attrs)\n self.attributes = attrs\n return save\n end",
"title": ""
},
{
"docid": "12090e104a0c33d4c8709b9db5937a55",
"score": "0.56495935",
"text": "def update_attributes!(attributes, options = {})\n # The following transaction covers any possible database side-effects of the\n # attributes assignment. For example, setting the IDs of a child collection.\n with_transaction_returning_status do\n self.assign_attributes(attributes, options)\n save!\n end\n end",
"title": ""
},
{
"docid": "d3c76f529b313ee69115e6a8cdc247be",
"score": "0.564558",
"text": "def update_active\n if self.active_until < Time.now\n self.update_attributes(\n active?: false\n )\n end\n end",
"title": ""
},
{
"docid": "e7f8ee5641911e33622dcbebcce61d0d",
"score": "0.5645328",
"text": "def update\n @project.update_attributes!(project_params)\n json_response(@project)\n end",
"title": ""
},
{
"docid": "5f0cff8f560da0443e8c74b0e27e635b",
"score": "0.5637498",
"text": "def update!(**args)\n @active = args[:active] if args.key?(:active)\n @kind = args[:kind] if args.key?(:kind)\n @value = args[:value] if args.key?(:value)\n end",
"title": ""
},
{
"docid": "98a6775a2d2f434b4a8c7b609de2a817",
"score": "0.563661",
"text": "def update_attributes(attrs)\n self.attributes = attrs and save\n end",
"title": ""
},
{
"docid": "b49c5ce4ee190ae0df554ee23d3b246b",
"score": "0.5629086",
"text": "def update_observation_object(observation, args)\n success = true\n if !observation.update_attributes(args)\n flash_object_errors(observation)\n success = false\n end\n return success\n end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.56276387",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.56276387",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "aff37452860563a26c1c334bfee6499c",
"score": "0.56266767",
"text": "def update_attributes(config_obj)\n @logger.debug(\"Updating attributes for contact #{id}\")\n if @obj_exists\n return _update(config_obj.contact_config(id)['details'])\n else\n _create(config_obj.contact_config(id)['details'])\n return true\n end\n end",
"title": ""
},
{
"docid": "ddc719d0a0db27f0cb29a2b983259e93",
"score": "0.5619723",
"text": "def update\n proj = set_publishing_status\n proj = parse_project_goals(proj)\n if @project.published && !current_user.is_admin\n proj[:published] = false\n end\n\n respond_to do |format|\n if @project.update(proj)\n format.html { redirect_to projects_path, notice: 'Se actualizó el proyecto' }\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": "bbd22b86f36e1ada793e5187118e205a",
"score": "0.5618058",
"text": "def update(attributes)\n attributes.each { |k, v| public_send(\"#{k}=\", v) }\n valid?\n end",
"title": ""
},
{
"docid": "bbd22b86f36e1ada793e5187118e205a",
"score": "0.5618058",
"text": "def update(attributes)\n attributes.each { |k, v| public_send(\"#{k}=\", v) }\n valid?\n end",
"title": ""
},
{
"docid": "fd1cae06b6384b02a33946c17aee341d",
"score": "0.5616516",
"text": "def update\n @project.update_attributes(project_params)\n\n end",
"title": ""
},
{
"docid": "8a9a290d3de1c6bf8473e6b3eb0eb2e1",
"score": "0.56154275",
"text": "def update!(attributes, options = {})\n # The following transaction covers any possible database side-effects of the\n # attributes assignment. For example, setting the IDs of a child collection.\n with_transaction_returning_status do\n assign_attributes(attributes, options)\n save!\n end\n end",
"title": ""
},
{
"docid": "f60e80306be4e3329c1c270cc8108080",
"score": "0.56129104",
"text": "def update_attributes(attributes)\n with_transaction_returning_status(:update_attributes_inside_transaction, attributes)\n end",
"title": ""
},
{
"docid": "191f2f660d24ebab5913fe665fababc6",
"score": "0.56128824",
"text": "def update_attributes!(attrs = {})\n set_attributes(attrs); save!\n end",
"title": ""
},
{
"docid": "f119ba02830537301a2195ee59aa60a2",
"score": "0.5610939",
"text": "def update(attributes)\n attributes.each { |k, v| send(\"#{k}=\", v) }\n true\n end",
"title": ""
},
{
"docid": "19721ad431e4fae1d37e8a32f8c3d8cd",
"score": "0.5606085",
"text": "def activate(project)\n if !project.active?\n request(:put, credentials, \"#{api_model.api_path}/#{project.to_i}/toggle\", :headers => {'Content-Length' => '0'})\n project.active = true\n end\n project\n end",
"title": ""
},
{
"docid": "877f210a19d8be23ebe19b1ef75a7468",
"score": "0.56046146",
"text": "def update\n @project.assign_attributes project_params_for_update.merge(validate_repo_connectivity: true)\n @project.uses_releases_override = true if @project.uses_releases_changed?\n @project.save\n\n respond_with @project\n end",
"title": ""
},
{
"docid": "4efe11d95ca7bd659fe23708f22e43e5",
"score": "0.56017244",
"text": "def update_attributes(params)\n set_attributes(params)\n save\n end",
"title": ""
},
{
"docid": "879f1214e030bb2d9e43a0aedb1bc3ea",
"score": "0.55963975",
"text": "def update_with(attributes)\n assign_attributes(attributes)\n end",
"title": ""
},
{
"docid": "66bef4675f73acfd9d2527ce19400094",
"score": "0.5593289",
"text": "def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n @id = args[:id] if args.key?(:id)\n end",
"title": ""
},
{
"docid": "0d459930a7ac34e259f6604df8d34587",
"score": "0.5590457",
"text": "def update(attributes, options = {})\n # The following transaction covers any possible database side-effects of the\n # attributes assignment. For example, setting the IDs of a child collection.\n with_transaction_returning_status do\n assign_attributes(attributes, options)\n save\n end\n end",
"title": ""
},
{
"docid": "da5b99214e1c4ec91dbe31e3f5b713b3",
"score": "0.5587572",
"text": "def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n end",
"title": ""
},
{
"docid": "439d6f973c93b8effcd2b6238a8ba763",
"score": "0.558569",
"text": "def update!(attributes)\n record.assign_attributes(attributes)\n return self unless record.changed?\n\n super attributes\n end",
"title": ""
},
{
"docid": "22fbacf46935d30d611af6867a691821",
"score": "0.5583973",
"text": "def update_attributes(attributes, options = {})\n # The following transaction covers any possible database side-effects of the\n # attributes assignment. For example, setting the IDs of a child collection.\n with_transaction_returning_status do\n self.assign_attributes(attributes, options)\n save\n end\n end",
"title": ""
},
{
"docid": "ae14c29ed26c12af424930c93d7c2656",
"score": "0.55813146",
"text": "def update_attributes(attributes = {})\n write_attributes(attributes); update\n end",
"title": ""
},
{
"docid": "eac6f41ac2b4ce1a68a3779603bd63a8",
"score": "0.5570452",
"text": "def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n end",
"title": ""
},
{
"docid": "eac6f41ac2b4ce1a68a3779603bd63a8",
"score": "0.5570452",
"text": "def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n end",
"title": ""
},
{
"docid": "eac6f41ac2b4ce1a68a3779603bd63a8",
"score": "0.5570452",
"text": "def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n end",
"title": ""
},
{
"docid": "ed54433a60e8fe7fdcb4da801b177b35",
"score": "0.55681944",
"text": "def update_resource(object, attributes)\n object.attributes = attributes[0]\n object.bump_state unless object.closed?\n object.save.tap do |success|\n object.state = object.state_was unless success\n end\n end",
"title": ""
},
{
"docid": "4d00f49550a93aa46fe09592d049fc41",
"score": "0.55620205",
"text": "def update\n @item = Item.find(params[:id])\n if params[:item][:active].nil?\n params[:item][:active] = false\n end\n \n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1afa4ab8708405b3908c40c1cbb7b03",
"score": "0.55569935",
"text": "def update_attributes(attributes={})\n if self.class.update(id, attributes)\n reload\n true\n end\n end",
"title": ""
},
{
"docid": "6992c0833b982296b329ec1d8c7289de",
"score": "0.5548587",
"text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end",
"title": ""
},
{
"docid": "a20230acb8ce113d65c3b5eb590abb0d",
"score": "0.554281",
"text": "def update(attrs)\n update_local(attrs)\n save\n end",
"title": ""
},
{
"docid": "e69988009fee35613942ccabba4875a1",
"score": "0.5540648",
"text": "def update_attributes!(attributes = {})\n write_attributes(attributes)\n result = update\n self.class.fail_validate!(self) unless result\n result\n end",
"title": ""
},
{
"docid": "512b85be46b8f3c216ef22e206b461a7",
"score": "0.5538654",
"text": "def update_attributes(attrs = {})\n self.attributes = attrs\n save\n end",
"title": ""
},
{
"docid": "e674963682fc1ff423906970426fcb0f",
"score": "0.55332434",
"text": "def update!(**args)\n @inclusion_mode = args[:inclusion_mode] if args.key?(:inclusion_mode)\n @project_ids = args[:project_ids] if args.key?(:project_ids)\n end",
"title": ""
},
{
"docid": "34d57f862a9d5b5ac28e4acc22855ac8",
"score": "0.55315655",
"text": "def update!(**args)\n @enabled = args[:enabled] unless args[:enabled].nil?\n end",
"title": ""
},
{
"docid": "ad68e6995db9fba61d2614ce95220026",
"score": "0.55237275",
"text": "def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n @model_version = args[:model_version] if args.key?(:model_version)\n end",
"title": ""
},
{
"docid": "c2dee145027096f202f7f4aa349817ac",
"score": "0.5523288",
"text": "def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n @toggle_time = args[:toggle_time] if args.key?(:toggle_time)\n end",
"title": ""
},
{
"docid": "a8d7beedda9b4f5246ecfe938e72cbc5",
"score": "0.5511133",
"text": "def update!(**args)\n @disable_global_access = args[:disable_global_access] if args.key?(:disable_global_access)\n @network = args[:network] if args.key?(:network)\n @project = args[:project] if args.key?(:project)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
}
] |
529c4d08ce2da340de2833d8baf485a6
|
POST /areas POST /areas.json
|
[
{
"docid": "74375e1927b7707419f946bb653c2a34",
"score": "0.71488166",
"text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to areas_path, notice: 'Area was successfully created.' }\n format.json { render json: @area, status: :created, location: @area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "43cadf6f56887e6a77acba635e923259",
"score": "0.7822764",
"text": "def areas\n @area = Area.new(geo_json: params.to_json)\n if @area.save\n json_response([id: @area.id], :created, :geo_json_recieved)\n else\n json_response(nil, :error, :db_error)\n end\n end",
"title": ""
},
{
"docid": "a1954cab5a253987afea30ce826d2fd9",
"score": "0.70543414",
"text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to @area, notice: 'Area was successfully created.' }\n format.json { render json: @area, status: :created, location: @area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1954cab5a253987afea30ce826d2fd9",
"score": "0.70543414",
"text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to @area, notice: 'Area was successfully created.' }\n format.json { render json: @area, status: :created, location: @area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c904cbd859b1d85301dec31dbe723a73",
"score": "0.67330635",
"text": "def create\r\n @area = Area.new(params[:area])\r\n\r\n respond_to do |format|\r\n if @area.save\r\n format.html { redirect_to areas_url(domain_id: @area.domain_id), notice: 'Area was successfully created.' }\r\n format.json { render json: @area, status: :created, location: @area }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @area.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "333e05dfa1abdb03ed2a8aeb8ead3848",
"score": "0.6700156",
"text": "def new\n @area = Area.new\n @other_areas = Area.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end",
"title": ""
},
{
"docid": "52f03f8e66ecd170b45c11b3d4196fc7",
"score": "0.6628294",
"text": "def create\n @breadcrumb = 'create'\n @area = Area.new(params[:area])\n @area.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to @area, notice: crud_notice('created', @area) }\n format.json { render json: @area, status: :created, location: @area }\n else\n @departments = departments_dropdown\n @workers = workers_dropdown\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84e3c37cbb63cdec5f8a6ad542c68ae0",
"score": "0.66078615",
"text": "def create\n #return render json: params[:recursos]\n @area = Area.new(area_params)\n @count = 0\n save_multiples_recursos if params[:recursos][:status] == '1'\n respond_to do |format|\n if @area.save\n format.html { redirect_to areas_path, notice: 'El Área fue creada éxitosamente.' }\n format.json { render :show, status: :created, location: @area }\n else\n format.html { render :new }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a89e8f67ab19a5723287dd9db3209ccb",
"score": "0.6589515",
"text": "def create\n @area = Area.new(area_params)\n @area.skus = params[:area][:skus]\n respond_to do |format|\n if @area.save\n format.html { redirect_to admin_areas_path, notice: 'Area was successfully created.' }\n format.json { render :show, status: :created, location: @area }\n else\n format.html { render :new }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a278ceb1d5e01eb81bbe4c19cc7eba5",
"score": "0.6525069",
"text": "def create\n @survey_area = SurveyArea.new(params[:survey_area])\n\n respond_to do |format|\n if @survey_area.save\n format.html { redirect_to @survey_area, notice: 'Survey area was successfully created.' }\n format.json { render json: @survey_area, status: :created, location: @survey_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e94582d89719cf5f88f46d0b19b075d",
"score": "0.6361951",
"text": "def create\n @area_type = AreaType.new(params[:area_type])\n\n respond_to do |format|\n if @area_type.save\n format.html { redirect_to @area_type, notice: 'Area type was successfully created.' }\n format.json { render json: @area_type, status: :created, location: @area_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aebfd0ad7379a39099ca0579f101a03c",
"score": "0.63133705",
"text": "def area_params\n params.require(:area).permit(:name)\n end",
"title": ""
},
{
"docid": "5068399e96cded4d3623a635730a9e24",
"score": "0.6311309",
"text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n flash[:notice] = 'Area was successfully created.'\n format.html { redirect_to(@area) }\n format.xml { render :xml => @area, :status => :created, :location => @area }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fd2f1c6948ab2770169b6e0ab5c6abb",
"score": "0.62578034",
"text": "def new\n @area = Area.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end",
"title": ""
},
{
"docid": "1fd2f1c6948ab2770169b6e0ab5c6abb",
"score": "0.62578034",
"text": "def new\n @area = Area.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end",
"title": ""
},
{
"docid": "0797813d15959aa40a6158274670e2ab",
"score": "0.624433",
"text": "def create\n @area = Area.new(area_params)\n if @area.save\n flash[:success] = 'Area was successfully created.'\n redirect_to :back\n else\n flash[:danger] = 'Area was not created.'\n redirect_to :back\n end\n end",
"title": ""
},
{
"docid": "feaa1be77f3d149ddbcfb833090bb29f",
"score": "0.6226551",
"text": "def area_params\n params.require(:area).permit(:code, :name, :reservable, :status, :area_id, :institute_id,\n resources_attributes: [:id, :code, :name, :description, :movil, :pedagogic, :resource_id, :area_id, :_destroy])\n end",
"title": ""
},
{
"docid": "cc0a10eeedd5588f62315428e44f234e",
"score": "0.621831",
"text": "def create\n @userarea = Userarea.new(userarea_params)\n\n respond_to do |format|\n if @userarea.save\n format.html { redirect_to @userarea, notice: 'Userarea was successfully created.' }\n format.json { render :show, status: :created, location: @userarea }\n else\n format.html { render :new }\n format.json { render json: @userarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95ff4d1e68e516258bd34e2c768dab2a",
"score": "0.6216068",
"text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to regions_path, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n @region_areas = region_areas(@region, false)\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c94f47e03cbf2f0ab976b84892551a79",
"score": "0.62087953",
"text": "def create\n @group_area = GroupArea.new(params[:group_area])\n\n respond_to do |format|\n if @group_area.save\n format.html { redirect_to @group_area, notice: 'Group area was successfully created.' }\n format.json { render json: @group_area, status: :created, location: @group_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c9928f3e5d33d75b93882f8d334a9cd",
"score": "0.6205518",
"text": "def create\n begin\n @area = Area.new(params[:area])\n\n @area.save!\n\n flash[:notice] = t(:success_created, :id => @area.id)\n redirect_to(areas_url)\n rescue => e\n# flash[:error] = t(:error_default, :message => e.message)\n render :action => :new\n end\n end",
"title": ""
},
{
"docid": "94c67a6d909d63cd9cdf1c926af7102e",
"score": "0.61778355",
"text": "def create\n @area_attribute = AreaAttribute.new(area_attribute_params)\n\n respond_to do |format|\n if @area_attribute.save\n format.html { redirect_to @area_attribute, notice: 'Area attribute was successfully created.' }\n format.json { render action: 'show', status: :created, location: @area_attribute }\n else\n format.html { render action: 'new' }\n format.json { render json: @area_attribute.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cf126264e43315d96337fda50ff6227",
"score": "0.6165081",
"text": "def create\n @sub_area = SubArea.new(sub_area_params)\n\n respond_to do |format|\n if @sub_area.save\n format.html { redirect_to @sub_area, notice: 'Sub area was successfully created.' }\n format.json { render :show, status: :created, location: @sub_area }\n else\n format.html { render :new }\n format.json { render json: @sub_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a47d8758f89978bd9dc400253bebe93e",
"score": "0.61594176",
"text": "def create\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'Tarea was successfully created.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2d18c8a4aeaf56055bc13bd67efd116",
"score": "0.61023384",
"text": "def create\n @issue_area = IssueArea.new(issue_area_params)\n\n respond_to do |format|\n if @issue_area.save\n format.html { redirect_to @issue_area, notice: 'Issue area was successfully created.' }\n format.json { render :show, status: :created, location: @issue_area }\n else\n format.html { render :new }\n format.json { render json: @issue_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "760e16e77e4e22e6758cee56d63f61c1",
"score": "0.6101947",
"text": "def create\n @areas_skill = AreasSkill.new(areas_skill_params)\n\n respond_to do |format|\n if @areas_skill.save\n format.html { redirect_to @areas_skill, notice: 'Areas skill was successfully created.' }\n format.json { render :show, status: :created, location: @areas_skill }\n else\n format.html { render :new }\n format.json { render json: @areas_skill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1321ce180b114afad969c23f512305ce",
"score": "0.6077823",
"text": "def index\n @areas = Area.all\n end",
"title": ""
},
{
"docid": "b4cb5e1952b53b4614fe9affe3abdc18",
"score": "0.60514724",
"text": "def create\n @country_area = CountryArea.new(params[:country_area])\n\n respond_to do |format|\n if @country_area.save\n format.html { redirect_to @country_area, notice: 'Country area was successfully created.' }\n format.json { render json: @country_area, status: :created, location: @country_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @country_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c65e5c846f819f9282b645e3d25165ca",
"score": "0.6033521",
"text": "def create\n @area = Area.new(area_params)\n @area.start_date = Date.today\n @area.active = true\n @area.status = \"in progress\"\n if @area.save\n redirect_to new_waste_info_path(area: @area), notice: \"#{@area.name} has been added to the system\"\n else\n flash[:error] = \"This area could not be created.\"\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "65fb157456ec65cf5363315e565aa8f6",
"score": "0.60243523",
"text": "def create\n @postulate_area_interest = PostulateAreaInterest.new(postulate_area_interest_params)\n\n respond_to do |format|\n if @postulate_area_interest.save\n format.html { redirect_to @postulate_area_interest }\n format.json { render :show, status: :created, location: @postulate_area_interest }\n else\n format.html { render :new }\n format.json { render json: @postulate_area_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f178f3bd6da6115da681ff3f33b57cfe",
"score": "0.6018769",
"text": "def create\n @interest_area = InterestArea.new(params[:interest_area])\n\n respond_to do |format|\n if @interest_area.save\n format.html { redirect_to @interest_area, notice: 'Interest area was successfully created.' }\n format.json { render json: @interest_area, status: :created, location: @interest_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interest_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed967c268094ab1b1da30714839d1320",
"score": "0.59861416",
"text": "def create\n @areas_profissional = AreasProfissional.new(areas_profissional_params)\n\n respond_to do |format|\n if @areas_profissional.save\n format.html { redirect_to @areas_profissional, notice: 'Área cadastrada com sucesso.' }\n format.json { render action: 'show', status: :created, location: @areas_profissional }\n else\n format.html { render :new }\n format.json { render json: @areas_profissional.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2877b3605ad51de53858ab3e77f6257",
"score": "0.59701246",
"text": "def area_params\n params.require(:area).permit(:name, :city_id)\n end",
"title": ""
},
{
"docid": "14eb1bce61f9576c3dc8a920f42156a4",
"score": "0.595645",
"text": "def new\n @area_type = AreaType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area_type }\n end\n end",
"title": ""
},
{
"docid": "d7c9bcf89285387c2618a87229df04c4",
"score": "0.59558964",
"text": "def set_area\n @area = Area.find_by_id(params[:id])\n if @area.blank?\n json_response(nil, :unprocessable_entity, :invalid_id)\n end\n end",
"title": ""
},
{
"docid": "dd38c86821f3ea96668bb0c1dbcd3e7f",
"score": "0.5947789",
"text": "def create\n @specialization_area = SpecializationArea.new(specialization_area_params)\n\n respond_to do |format|\n if @specialization_area.save\n format.html { redirect_to admin_specialization_area_path(@specialization_area), notice: 'Specialization area was successfully created.' }\n format.json { render :show, status: :created, location: @specialization_area }\n else\n format.html { render :new }\n format.json { render json: @specialization_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "224f961158944d5e0f5d14396647a4c7",
"score": "0.5944648",
"text": "def create\n @project_area = ProjectArea.new(project_area_params)\n\n respond_to do |format|\n if @project_area.save\n format.html { redirect_to @project_area, notice: 'Project area was successfully created.' }\n format.json { render :show, status: :created, location: @project_area }\n else\n format.html { render :new }\n format.json { render json: @project_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8018e3dab10f8a064fa922c52c0d6d91",
"score": "0.5902219",
"text": "def create\n\n has = params[\"area\"].to_json\n data_has = JSON.parse(has)\n @zone = Zone.new();\n @zone.nombre_zona = params[\"nombre_zona\"]\n @zone.color = params[\"color\"]\n\n respond_to do |format|\n if @zone.save\n \n data_has.each do |geo|\n @coordenada = CoordinateZone.new()\n geo.each do |data|\n @coordenada.zone_id = @zone.id\n @coordenada.latitud = data[\"lat\"].to_f\n @coordenada.longitud = data[\"lng\"].to_f \n end\n @coordenada.save\n end\n\n format.html { redirect_to @zone, notice: 'Zone was successfully created.' }\n format.js \n # format.js { render js: \"window.location.href=#{ directories_path }\" }\n format.json { render :show, status: :created, location: @zone }\n \n else\n format.html { render :new }\n format.json { render json: @zone.errors, status: :unprocessable_entity }\n end\n\n end\n end",
"title": ""
},
{
"docid": "fb13496352bb25916e3b908642126046",
"score": "0.5898757",
"text": "def index\n @areas = Area.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @areas }\n format.json {render :json => @areas}\n end\n end",
"title": ""
},
{
"docid": "9910c0ef24972101089b6ea5559e5766",
"score": "0.5885774",
"text": "def area_params\n params.require(:area).permit(:name, :pincode)\n end",
"title": ""
},
{
"docid": "529c31d46a8a1538933ad343f22bf4a0",
"score": "0.5867524",
"text": "def create\n #params[:area] == {\"parent_id\"=>\"21\",\"name\"=>\"test4\"} parent id from hidden field, name from field\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n #format.html { redirect_to(@area, :notice => 'Area was successfully created.') }\n format.html { redirect_to(locations_url, :notice => \"#{@area.to_s} was successfully created.\") }\n format.xml { render :xml => @area, :status => :created, :location => @area }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a572c6246953b5666d0c5c05185ceb3c",
"score": "0.58590674",
"text": "def index\n @survey_areas = SurveyArea.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @survey_areas }\n end\n end",
"title": ""
},
{
"docid": "f007eb92b1890523e33ae6a20079adc6",
"score": "0.58568287",
"text": "def create\n @city_area = current_user.cityAreas.build(city_area_params)\n\n respond_to do |format|\n if @city_area.save\n format.html { redirect_to @city_area, notice: \"City area was successfully created.\" }\n format.json { render :show, status: :created, location: @city_area }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @city_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae2916fc37b4378175e1a562030e3aba",
"score": "0.58355826",
"text": "def new\n @breadcrumb = 'create'\n @area = Area.new\n @departments = departments_dropdown\n @workers = workers_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end",
"title": ""
},
{
"docid": "9c772790a4bcd95ec5e5d3f4368ab26b",
"score": "0.58328557",
"text": "def create\n @tareas = Tarea.all\n @tareapositivas = Tarea.where(listo: true)\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'Tarea was successfully created.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06845b7ae42ce03385c1659d246df278",
"score": "0.5828567",
"text": "def area_params\n params.require(:area).permit(:name, :theme_id, :label, :position, :navigation, :footer, :comments, :ascending, :mode, :paid, :restricted, array: [:sku])\n end",
"title": ""
},
{
"docid": "29954b408b76146c6d5f5f1ab0339a26",
"score": "0.58274615",
"text": "def create\n @area = Area.new(params[:area])\n \n respond_to do |format|\n if @area.save\n flash[:notice] = 'Area creada correctamente.'\n format.html { params[:oper].nil? ? redirect_to(@area) : render(:text => \"Ok\")}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3af6ecee1048f974abadca2a63418302",
"score": "0.58224934",
"text": "def area_params\n params.require(:area).permit(:name, :active, :start_date, :end_date, :status, :audit_id)\n end",
"title": ""
},
{
"docid": "a0870a21c8dd8186b8285f0d220eb247",
"score": "0.58189845",
"text": "def create\n require_user()\n @area_of_expertise = AreaOfExpertise.new(area_of_expertise_params)\n\n respond_to do |format|\n if @area_of_expertise.save\n format.html { redirect_to @area_of_expertise, notice: 'Area of expertise was successfully created.' }\n format.json { render :show, status: :created, location: @area_of_expertise }\n else\n format.html { render :new }\n format.json { render json: @area_of_expertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ef3e7fde7251c8a6de040cbfb6ea7d3",
"score": "0.58003134",
"text": "def create\n @userarea = Userarea.new(userarea_params)\n\n respond_to do |format|\n if @userarea.save\n format.html { redirect_to @userarea, info: 'El área de usuario fue creada con éxito.' }\n format.json { render :show, status: :created, location: @userarea }\n else\n format.html { render :new }\n format.json { render json: @userarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4b882f0a45b9cac0d2b5bf201a5b437",
"score": "0.57696253",
"text": "def add_area(area)\n @areas[area.type] = {} unless @areas[area.type]\n @areas[area.type][area.key] = area\n end",
"title": ""
},
{
"docid": "96d7d619e738908cbb4051ccaedb1407",
"score": "0.5763266",
"text": "def create\n @area_code = AreaCode.new(area_code_params)\n\n respond_to do |format|\n if @area_code.save\n format.html { redirect_to @area_code, notice: 'Area code was successfully created.' }\n format.json { render :show, status: :created, location: @area_code }\n else\n format.html { render :new }\n format.json { render json: @area_code.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbb12bc6880a6990404e83896f529b19",
"score": "0.5746156",
"text": "def index\n @areas = Area.with_ordered_countries\n respond_with(@areas)\n end",
"title": ""
},
{
"docid": "9b54004e3656203aeac57d1b757f6cde",
"score": "0.5738833",
"text": "def create\n @core_area = Core::Area.new(core_area_params)\n\n respond_to do |format|\n if params[:btn_cancel].present?\n format.html { redirect_to(action: \"index\")}\n format.json { head :no_content}\n elsif @core_area.save\n format.html { redirect_to @core_area, notice: 'Area was successfully created.' }\n format.json { render action: 'show', status: :created, location: @core_area }\n else\n format.html { render action: 'new' }\n format.json { render json: @core_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b655eaf53c05cb281384c8827258c57",
"score": "0.5738656",
"text": "def create\n @district_area = DistrictArea.new(district_area_params)\n\n respond_to do |format|\n if @district_area.save\n format.html { redirect_to @district_area, notice: 'District area was successfully created.' }\n format.json { render :show, status: :created, location: @district_area }\n else\n format.html { render :new }\n format.json { render json: @district_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b655eaf53c05cb281384c8827258c57",
"score": "0.5738656",
"text": "def create\n @district_area = DistrictArea.new(district_area_params)\n\n respond_to do |format|\n if @district_area.save\n format.html { redirect_to @district_area, notice: 'District area was successfully created.' }\n format.json { render :show, status: :created, location: @district_area }\n else\n format.html { render :new }\n format.json { render json: @district_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "996e90b408ab1e88ea7912cfffc3fc36",
"score": "0.5736314",
"text": "def create\n @practice_area = PracticeArea.new(practice_area_params)\n\n respond_to do |format|\n if @practice_area.save\n format.html { redirect_to @practice_area, notice: 'Practice area was successfully created.' }\n format.json { render :show, status: :created, location: @practice_area }\n else\n format.html { render :new }\n format.json { render json: @practice_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfa526687baa2d6a5fd93faa094bda90",
"score": "0.5734968",
"text": "def create\n @contentarea = Contentarea.new(params[:contentarea])\n\n respond_to do |format|\n if @contentarea.save\n format.html { redirect_to @contentarea, notice: 'Contentarea was successfully created.' }\n format.json { render json: @contentarea, status: :created, location: @contentarea }\n else\n format.html { render action: \"new\" }\n format.json { render json: @contentarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd5bdac8eba19d8802ea7e9f707a74f3",
"score": "0.5734698",
"text": "def store_area_params\n params.require(:store_area).permit(:area_id, :area_name)\n end",
"title": ""
},
{
"docid": "403bb3192a7f486ba26ed2f3210f20d6",
"score": "0.57268673",
"text": "def index\n @group_areas = GroupArea.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @group_areas }\n end\n end",
"title": ""
},
{
"docid": "1e91046d7faeb03a546c06c1bb721383",
"score": "0.57144785",
"text": "def create\n @lab_area = LabArea.new(lab_area_params)\n\n respond_to do |format|\n if @lab_area.save\n format.html { redirect_to @lab_area, notice: 'Lab area was successfully created.' }\n format.json { render :show, status: :created, location: @lab_area }\n else\n format.html { render :new }\n format.json { render json: @lab_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3810bd5290276fccb175e80fe03efb86",
"score": "0.57142365",
"text": "def areas\n aux = WorkOrderArea.by_name\n render json: serialized_work_order_areas(aux)\n end",
"title": ""
},
{
"docid": "775b00d21181e830651deb226bc8c8c7",
"score": "0.5700181",
"text": "def new\n @area = Area.new(params[:area])\n end",
"title": ""
},
{
"docid": "74a727490d0c46eac2ea9218b8ee48f5",
"score": "0.56865406",
"text": "def new\n @survey_area = SurveyArea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey_area }\n end\n end",
"title": ""
},
{
"docid": "05958cf50707051d74acc5d46d2efef3",
"score": "0.5684062",
"text": "def create\n @parking_area = ParkingArea.new(parking_area_params)\n\n respond_to do |format|\n if @parking_area.save\n format.html { redirect_to @parking_area, notice: 'Parking area was successfully created.' }\n format.json { render :show, status: :created, location: @parking_area }\n else\n format.html { render :new }\n format.json { render json: @parking_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "163bcb99b7bdec5f0f73b70b689d4198",
"score": "0.56657875",
"text": "def list_service_areas\n @service_areas = smart_listing_create(:service_areas, @service_areas, partial: \"/service_areas/index\",\n default_sort: { created_at: \"desc\" }, page_sizes: [10, 50, 100])\n end",
"title": ""
},
{
"docid": "34d53841c1d7338c1974d9d12a802f82",
"score": "0.56638193",
"text": "def new\n @area_of_law = AreaOfLaw.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: admin_areas_of_law_path(@area_of_law) }\n end\n end",
"title": ""
},
{
"docid": "cc744a34462aee6ca8e649623522192a",
"score": "0.5660854",
"text": "def new\r\n @area = Area.new\r\n @area.domain_id = params[:domain_id]\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @area }\r\n end\r\n end",
"title": ""
},
{
"docid": "6cb92276cbd6ef08141d246bdcd037c4",
"score": "0.5658392",
"text": "def create\n @researcharea = Researcharea.new(params[:researcharea])\n\n respond_to do |format|\n if @researcharea.save\n format.html { redirect_to @researcharea, notice: 'Research area was successfully created.' }\n format.json { render json: @researcharea, status: :created, location: @researcharea }\n else\n format.html { render action: \"new\" }\n format.json { render json: @researcharea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "012b78ad1b5b593223987b526b9a212e",
"score": "0.56583905",
"text": "def create\n @area = Area.new(params[:area])\n @area.parent_id = params[:parent_id]\n respond_to do |format|\n if @area.save\n flash[:notice] = 'Area was successfully created.'\n format.html { redirect_to(@area) }\n format.xml { render :xml => @area, :status => :created, :location => @area }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "458b645f99504d8bd55bc8967853e200",
"score": "0.56566226",
"text": "def set_district_area\n \n\t r = open(\"http://localhost:3001/district_areas/\" + params[:id] + \".json\").read\n\t #r = open(\"http://floating-chamber-80486.herokuapp.com/district_areas/1.json\").read\n\t hash = JSON.parse(r)\n\t upzsJSON = hash[\"upzs\"]\n\t hash.delete(\"url\")\n\t hash.delete(\"upzs\")\n\t p hash\n\t p upzsJSON\n\t @district_area = DistrictArea.new(hash)\n\t p @district_area.inspect\n\t \n\t upzsJSON.each do |currentUPZ|\n\t\t@district_area.upzs << Upz.new(currentUPZ)\n\t\tend\n\trescue \n\t\t p \"EL RECURSOO NO EXISTEEEEEE\"\n\t\trender json: {}, status: :ok\n\tend",
"title": ""
},
{
"docid": "9784f0ea7d7fa65f1839e44b6c107ca2",
"score": "0.5620205",
"text": "def new\n @group_area = GroupArea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_area }\n end\n end",
"title": ""
},
{
"docid": "e0d673a5fd687fe82024cc89da688c1a",
"score": "0.559862",
"text": "def index\n @areas_skills = AreasSkill.all\n end",
"title": ""
},
{
"docid": "49e252561e15c9d9e655afaed6c3f95f",
"score": "0.55919945",
"text": "def area_params\n permitted = ProductionArea.globalize_attribute_names + [:edrpou_code, :site, :railway_track, :railway_distance,\n :trucks_road, :state_road_distance, :airport_distance,\n :total_area, :building_year, :free_floors_count,\n :free_floors, :production_area, :additional, :phone,\n :email, :rent_year, :sale, :date_info, :main_image,\n :gis_type_name, :status, :map_layer_id, :ownership_id,\n questionnaire_images_attributes: %i[id imgable_type\n imgable_id _destroy],\n questionnaire_file_attributes: %i[id fileable_type file\n fileable_id _destroy],\n geo_json_attributes: %i[id geo_type position],\n balancer_ids: [], infrastructure_type_ids: []]\n params.require(:production_area).permit(permitted)\n end",
"title": ""
},
{
"docid": "46f18d99726bf9bc7f5e341e59385872",
"score": "0.55892015",
"text": "def city_area_params\n params.require(:city_area).permit(:title, :slug, :user_id)\n end",
"title": ""
},
{
"docid": "2451eaa7e536aee152ea49baa7ab12d9",
"score": "0.5578566",
"text": "def create\n @research_area = ResearchArea.create(research_area_params)\n\n respond_to do |format|\n if @research_area.save\n format.html { redirect_to @research_area, notice: 'Research area was successfully created.' }\n format.json { render :show, status: :created, location: @research_area }\n else\n format.html { render :new }\n format.json { render json: @research_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04954a2770a57a9cb0f9a5b954cad1f5",
"score": "0.5574708",
"text": "def create\n @question_content_area = QuestionContentArea.new(params[:question_content_area])\n\n respond_to do |format|\n if @question_content_area.save\n format.html { redirect_to @question_content_area, notice: 'Question content area was successfully created.' }\n format.json { render json: @question_content_area, status: :created, location: @question_content_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_content_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9178c7f764e6ac4e49882bd66cd002d",
"score": "0.5567616",
"text": "def set_area\n @area = Area.find(params[:area_id])\n end",
"title": ""
},
{
"docid": "7053ea1dcc165e23481f458fa023ba3d",
"score": "0.5555515",
"text": "def json_entry_params\n params.require(:json_entry).permit(:area_id, :data, :name, :verb, :post_body)\n end",
"title": ""
},
{
"docid": "2cec28b228a6e46d7831170df17f3e92",
"score": "0.554065",
"text": "def new\n if params[:area_id]\n @parent_area = Area.find(params[:area_id]) \n @area = @parent_area.children.build \n else\n @area = Area.new \n end\n @area.project_leaders = []\n respond_with(@area)\n \n end",
"title": ""
},
{
"docid": "f09c403ad29f04e69e52112a8de2e60d",
"score": "0.55292475",
"text": "def create\n @area_of_law = AreaOfLaw.new(params[:area_of_law])\n\n respond_to do |format|\n if @area_of_law.save\n purge_all_pages\n format.html { redirect_to admin_areas_of_law_path, notice: 'Area of law was successfully created.' }\n format.json { render json: @area_of_law, status: :created, location: @area_of_law }\n else\n format.html { \n flash[:error] = 'Could not create the Area of Law'\n render action: \"new\" \n }\n format.json { render json: @area_of_law.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1b3dc2aea8c5b3e4d9686b11e7941f7",
"score": "0.5525709",
"text": "def create\n @area_usuario = AreaUsuario.new(params[:area_usuario])\n\n respond_to do |format|\n if @area_usuario.save\n format.html { redirect_to @area_usuario, notice: 'Area usuario was successfully created.' }\n format.json { render json: @area_usuario, status: :created, location: @area_usuario }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @area_usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83cca2618ac7f35487e54c13810af8c4",
"score": "0.5515097",
"text": "def create\n @shopping_area = ShoppingArea.new(params[:shopping_area])\n respond_to do |format|\n if @shopping_area.save\n format.html { redirect_to @shopping_area, notice: 'Shopping area was successfully created.' }\n format.json { render json: @shopping_area, status: :created, location: @shopping_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shopping_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cf0e778252a60c0930f8e6fafb39d15",
"score": "0.5514923",
"text": "def index\n @area_attributes = AreaAttribute.all\n end",
"title": ""
},
{
"docid": "d4f31e97f21a2e573b9b7497f8385f65",
"score": "0.5513915",
"text": "def setAreas\n return unless self.distance_changed? || self.height_gain_changed? || self.height_loss_changed?\n PlaceRouteInArea.delete place_routes_in_area_ids\n Place.areas.all.each do |area|\n waypoints.each do |waypoint|\n if(area.inArea(waypoint.latitude, waypoint.longitude))\n PlaceRouteInArea.create(:place_id => area.id, :route_id => id)\n\t break\n end\n end\n end\n end",
"title": ""
},
{
"docid": "cd6ea676b1661337f33a4d52cba11772",
"score": "0.5512874",
"text": "def new\n @area_usuario = AreaUsuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area_usuario }\n end\n end",
"title": ""
},
{
"docid": "b9f46b6e2dd13faef795ef6f055ec394",
"score": "0.5511949",
"text": "def create\n \n if params[:parent_id]\n @parent_area = Area.find(params[:parent_id]) \n @area = @parent_area.children.build(params[:area]) \n else\n @area = Area.new(params[:area]) \n end\n \n @errors = []\n \n #Me fijo que haya seleccionado al menos un coordinador válido para el área.\n @project_leaders = @area.project_leaders.split(%r{,\\s*})\n if !project_leaders_valid?(@project_leaders) \n @errors = @errors.concat([\"Debe seleccionar un coordinador válido para el área \" + @area.name])\n end\n \n if @errors.empty? && @area.valid?\n @area.save\n set_project_leaders(@project_leaders, @area)\n end\n respond_with(@area)\n end",
"title": ""
},
{
"docid": "90be3cf88ad63e7cafc318ee0d7ddc8c",
"score": "0.55064595",
"text": "def new\n @country_area = CountryArea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country_area }\n end\n end",
"title": ""
},
{
"docid": "19742a156a71bda0635d988b9ea02905",
"score": "0.55032784",
"text": "def create\n @business_area = BusinessArea.new(params[:business_area].permit(:name, :director))\n\n respond_to do |format|\n if @business_area.save\n format.html { redirect_to @business_area, notice: 'Business Area was successfully created.' }\n format.json { render :show, status: :created, location: @business_area }\n else\n format.html { render :new }\n format.json { render json: @business_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b913817c02eb11b3ffaec6cd16d292c2",
"score": "0.5502828",
"text": "def create\n apartment = Apartment.create(apartment_params)\n render json: apartment\n end",
"title": ""
},
{
"docid": "abb77cc295285b669dbdede12a17948f",
"score": "0.54886204",
"text": "def sub_area_params\n params.require(:sub_area).permit(:name, :area_id, :sub_area_id)\n end",
"title": ""
},
{
"docid": "5de89b8e146ac7f762e06b96e329e9da",
"score": "0.54871655",
"text": "def create\n @area_edition = @layout.area_editions.new(area_edition_params)\n\n respond_to do |format|\n if @area_edition.save\n format.html { redirect_to main_app.url_for([:edit, @product, @theme, @personalization, @layout, @area_edition]), notice: 'Area edition was successfully created.' }\n format.json { render :show, status: :created, location: @area_edition }\n else\n format.html { render :new }\n format.json { render json: @area_edition.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5aa7e369ae3ca658b50321a4897a84b",
"score": "0.5484213",
"text": "def create\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'La Tarea ha sido eliminada correctamente.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "822b0a1f92bbb9439fd7e6241911c05c",
"score": "0.5479956",
"text": "def create\n @runner = Runner.new(runner_params)\n @runner.status = true\n @area = Area.find_by(name: @runner.area)\n @runner.area_id = @area.id\n respond_to do |format|\n if @runner.save\n format.html { redirect_to @runner, notice: 'Runner was successfully created.' }\n format.json { render :show, status: :created, location: @runner }\n else\n format.html { render :new }\n format.json { render json: @runner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3d3ba5896aa5c5c5e6089a0ac7d5948",
"score": "0.54751253",
"text": "def new\n @proposal = Proposal.new\n @proposal.area_tags = [Area.find(params[:area_id]).area_tag.name_es] if params[:area_id]\n respond_to do |format|\n format.html\n format.floki { render :action => 'new.floki', :content_type => 'application/json', :layout => false}\n end\n end",
"title": ""
},
{
"docid": "0159590b827836614e9c686035dad339",
"score": "0.54738164",
"text": "def set_area\n @area = Area.find(params[:id])\n end",
"title": ""
},
{
"docid": "e150ccd604eb4ac63c1b7d2a25500a4e",
"score": "0.5466206",
"text": "def sub_area_params\n params.require(:sub_area).permit(:code_capes, :title, :description, :area_id)\n end",
"title": ""
},
{
"docid": "f408e9eb271b3ace451fbe98e76162ad",
"score": "0.54525876",
"text": "def new\n @area = Area.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @area }\n end\n end",
"title": ""
},
{
"docid": "958adb33b0844f53372625c8b87dac61",
"score": "0.5438852",
"text": "def create\n param = area_params\n user_balancer = current_user.balancer_id\n param[:balancer_ids] << user_balancer unless param[:balancer_ids].include?(user_balancer.to_s)\n\n @cabinet_production_area = current_user.production_areas.new(param)\n respond_to do |format|\n if status_valid?(area_params[:status]) && @cabinet_production_area.save\n QuestionnaireImages.build(params, @cabinet_production_area)\n public_send(params[:production_area][:status])\n format.html { redirect_to cabinet_production_areas_path, notice: 'Запис успішно створено.' }\n format.json { render :show, status: :created, location: @cabinet_production_area }\n else\n format.html { render :new }\n format.json { render json: @cabinet_production_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "359d39b65d6ed77b55c778f60d823484",
"score": "0.54377115",
"text": "def create\n @curriculum_area = CurriculumArea.new(curriculum_area_params)\n\n respond_to do |format|\n if @curriculum_area.save\n format.html { redirect_to [:admin, @curriculum_area], notice: 'Curriculum area was successfully created.' }\n format.json { render json: @curriculum_area, status: :created }\n else\n format.html { render action: \"new\" }\n format.json { render json: @curriculum_area.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1369aca1565ed9d9e2185757a493ba2e",
"score": "0.54309916",
"text": "def userarea_params\n params.require(:userarea).permit(:user_id, :area_id, :state)\n end",
"title": ""
}
] |
ef09221637dca62f0bdc84c9af737036
|
Create a new Staff object
|
[
{
"docid": "00426fc42530860bebd86c5cf8ab9416",
"score": "0.7397668",
"text": "def new\n \t@staff = Staff.new\n end",
"title": ""
}
] |
[
{
"docid": "069243a22d104e688cf175fa44bd0b55",
"score": "0.72570264",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n success_format(format, 'created', STAFF_CREATE_SUCCESS)\n else\n error_format(format, 'new')\n end\n end\n end",
"title": ""
},
{
"docid": "a72bde8941a104ed4e0d40a7d4d91a56",
"score": "0.72449744",
"text": "def create\n @staff = Staff.new(params[:staff])\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render json: @staff, status: :created, location: @staff }\n else\n format.html { render action: \"new\" }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a72bde8941a104ed4e0d40a7d4d91a56",
"score": "0.72449744",
"text": "def create\n @staff = Staff.new(params[:staff])\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render json: @staff, status: :created, location: @staff }\n else\n format.html { render action: \"new\" }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a72bde8941a104ed4e0d40a7d4d91a56",
"score": "0.72449744",
"text": "def create\n @staff = Staff.new(params[:staff])\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render json: @staff, status: :created, location: @staff }\n else\n format.html { render action: \"new\" }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03bdb7f874c85c0a8654c55c4b820e2a",
"score": "0.72211564",
"text": "def create\n if !Staff.is_manager_of_entity(current_user, params[:staff][:entity_type], params[:staff][:entity_id])\n head :forbidden\n return\n end\n\n if params[:staff][:email]\n user = User.where(email: params[:staff][:email]).first\n user = user || Staff.create(email: params[:staff][:email]).user\n params[:staff][:user_id] = user.id\n end\n\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render :show, status: :created, location: @staff }\n else\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b03ec3dc78d942d9c66fdc9772e225be",
"score": "0.71890736",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render :show, status: :created, location: @staff }\n else\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e53631b085ecfb277551479792dac63",
"score": "0.7147018",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to staffs_path, notice: 'Staff was successfully created.' }\n format.json { render :index, status: :created, location: @staff }\n else\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb6b6fffb0b966928c5596122fa39e9f",
"score": "0.71106315",
"text": "def create\n @staff = Staff.new(params[:staff])\n\n respond_to do |format|\n if @staff.save\n flash[:notice] = 'Staff was successfully created.'\n format.html { redirect_to(@staff) }\n format.xml { render :xml => @staff, :status => :created, :location => @staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb144ff6c8512e3941cff7568364ae77",
"score": "0.7063672",
"text": "def create\n @staff = Staff.new(params[:staff])\n @staff.add_role :advisor\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to partner_staff_url(@staff), notice: 'Staff was successfully created.' }\n format.json { render json: @staff, status: :created, location: @staff }\n else\n format.html { render action: \"new\" }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cb19f104407e754ce4ebb5297e3084b",
"score": "0.703822",
"text": "def create\n @staff = Staff.new(params[:staff])\n\n respond_to do |format|\n if @staff.save\n flash[:notice] = t('staff.title')+\" \"+t('created')\n format.html { redirect_to staffs_path }\n format.xml { render :xml => @staff, :status => :created, :location => @staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4992679e6f0b477ad9b2e26cdcb36b65",
"score": "0.69883883",
"text": "def create\n @skt_staff = SktStaff.new(params[:skt_staff])\n\n respond_to do |format|\n if @skt_staff.save\n flash[:notice] = 'SktStaff was successfully created.'\n format.html { redirect_to(@skt_staff) }\n format.xml { render :xml => @skt_staff, :status => :created, :location => @skt_staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @skt_staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbcbf013a07f987f428d935cfeed2aec",
"score": "0.69561714",
"text": "def create\n params.delete 'project'\n @staff = Staff.new(params[:staff])\n\n respond_to do |format|\n if @staff.save\n flash[:notice] = 'Staff was successfully created.'\n format.html { redirect_to(:action=>'show', :ids=>@staff) }\n format.xml { render :xml => @staff, :status => :created, :location => @staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7eba290d052d475f312dea8a50c9c898",
"score": "0.69402367",
"text": "def create\n params_cp = staff_params\n params_cp['isadmin'] = false\n params_cp['issuper'] = false\n params_cp['isactive'] = false\n thisstaff = Staff.find_by(user_id: current_user.id, isactive: true)\n if thisstaff.nil? || (not (thisstaff.isadmin || thisstaff.issuper))\n params_cp['user_id'] = current_user.id\n end\n\n @staff = Staff.new(params_cp)\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to edit_user_registration_path, notice: 'Staff was successfully created.' }\n format.json { render :show, status: :created, location: @staff }\n else\n format.html { redirect_to edit_user_registration_path, notice: 'Something goes wrong... Perhaps you have applied for teacher status before?' }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e180cf8b221982700721e72fb2801da",
"score": "0.6890099",
"text": "def create\n @real_staff = RealStaff.new(params[:real_staff])\n\n respond_to do |format|\n if @real_staff.save\n flash[:notice] = 'RealStaff was successfully created.'\n format.html { redirect_to(@real_staff) }\n format.xml { render :xml => @real_staff, :status => :created, :location => @real_staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @real_staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56b3081a109cbfb02eb10f5f5b55ef84",
"score": "0.6867922",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: (t 'staffs.title')+(t 'actions.created') }\n format.json { render action: 'show', status: :created, location: @staff }\n else\n format.html { render action: 'new' }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea288c869cf580a7ba10d74e45fd8e16",
"score": "0.6860106",
"text": "def newStaff\n end",
"title": ""
},
{
"docid": "bc73723a4159de3fc54095d5ec48e020",
"score": "0.6828495",
"text": "def create\n # @staff = Staff.new(params[:staff])\n\n # respond_to do |format|\n # if @staff.save\n # format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n # format.json { render json: @staff, status: :created, location: @staff }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @staff.errors, status: :unprocessable_entity }\n # end\n #end\n end",
"title": ""
},
{
"docid": "ad21c8c050dca7b8d3f57b0d8da7b579",
"score": "0.6824111",
"text": "def new\n authorize Staff\n @member = Staff.new\n end",
"title": ""
},
{
"docid": "8c8ed4e617a4181116ceee19ae29ad0b",
"score": "0.6823128",
"text": "def create\n @school_staff = SchoolStaff.new(params[:school_staff])\n\n respond_to do |format|\n if @school_staff.save\n flash[:notice] = 'School Staff was successfully created.'\n format.html { redirect_to(@school_staff) }\n format.xml { render :xml => @school_staff, :status => :created, :location => @school_staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @school_staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c55c97272fa797e34e20419ac26456b0",
"score": "0.67987996",
"text": "def create_single_staff_member\n print \"---------------------------------------------------------------\n \\nVery well. You will need to provide some information about the new staff member. \"\n staff_member = StaffMember.new(name: request_non_unique(\"staff member\", \"name\"),\n branch_id: request_branch_id_for(\"staff member\"))\n staff_member.email = request_unique(StaffMember, \"email\", validate_email(staff_member.name))\n staff_member.save\n print \"\\n\\nGreat! #{staff_member.name} is in the system! Would you like to create another staff member (yes/no)? \"\nend",
"title": ""
},
{
"docid": "553375043b0e3958c165266ff3a59bb6",
"score": "0.6785644",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @staff }\n else\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff9dcafcb2ee3563e4e303469875bea1",
"score": "0.67695904",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n # Los vendedores no pueden crear un empleado\n if session[:tipo_usuario] == 3\n format.html { redirect_to new_staff_path, notice: 'Sin permisos para crear' }\n elsif @staff.save\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render :show, status: :created, location: @staff }\n else\n obtener_sucursales\n obtener_tipos_empleado\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e60c6dd382b1749b455b47ea37c541a",
"score": "0.67505145",
"text": "def create\n @staffmember = Staffmember.new(params[:staffmember])\n\n respond_to do |format|\n if @staffmember.save\n format.html { redirect_to @staffmember, notice: 'Staffmember was successfully created.' }\n format.json { render json: @staffmember, status: :created, location: @staffmember }\n else\n format.html { render action: \"new\" }\n format.json { render json: @staffmember.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60e96f9c42902d10de3095dee3b5fec2",
"score": "0.67348",
"text": "def create\r\n @staff = Staff.new(params[:staff])\r\n @staff.society_id = current_user.society_id\r\n\r\n respond_to do |format|\r\n if @staff.save\r\n track_activity @staff\r\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\r\n format.json { render json: @staff, status: :created, location: @staff }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @staff.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "64d1cb073de2f08c636dfc860bbe9058",
"score": "0.67086804",
"text": "def create\n unless params[:email].blank? or params[:password].blank?\n @user = User.new\n @user.email = params[:email]\n @user.password = params[:password]\n @user.password_confirmation = params[:password]\n @user.save\n \n @business_staff = BusinessStaff.new\n @business_staff.user_id = @user.id\n @business_staff.name = params[:name]\n @business_staff.business_id = current_user.business.id\n end\n \n respond_to do |format|\n if !params[:email].blank? and !params[:password].blank? and @business_staff.save\n flash[:notice] = 'Staff member was successfully created.'\n format.html { redirect_to(business_business_staffs_path) }\n format.xml { render :xml => @business_staff, :status => :created, :location => @business_staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @business_staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5600698ef285bf25ebbc69679d1ef9e5",
"score": "0.66758454",
"text": "def create\n @sales_staff = SalesStaff.new(sales_staff_params)\n\n respond_to do |format|\n if @sales_staff.save\n format.html { redirect_to @sales_staff, notice: 'Sales staff was successfully created.' }\n format.json { render :show, status: :created, location: @sales_staff }\n else\n format.html { render :new }\n format.json { render json: @sales_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5952b8d49ae71de701a345e9314c42fb",
"score": "0.6623218",
"text": "def create\n @staff = Staff.new(staff_params)\n respond_to do |format|\n begin\n @staff.save!\n format.html { redirect_to @staff, notice: 'スタッフが登録されました。' }\n format.json { render :show, status: :created, location: @staff }\n rescue => exception\n flash[:alert] = 'スタッフを登録できませんでした。'\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e1e488712bd0c582e3d7bab5bfab117",
"score": "0.659033",
"text": "def create\n @service_staff = ServiceStaff.new(service_staff_params)\n\n respond_to do |format|\n if @service_staff.save\n format.html { redirect_to @service_staff, notice: \"Service staff was successfully created.\" }\n format.json { render :show, status: :created, location: @service_staff }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @service_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ade99470946c2c602e67ab0c2b8472ce",
"score": "0.6589653",
"text": "def create\n\n @dtc_staff = DtcStaff.new(params[:dtc_staff])\n\n respond_to do |format|\n if @dtc_staff.save\n\n format.html { redirect_to @dtc_staff, notice: 'Dtc staff was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dtc_staff }\n else\n format.html { render action: 'new' }\n format.json { render json: @dtc_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52d5b2e6fc2211523b16e1f9d2137ab0",
"score": "0.6559311",
"text": "def staff(staff_id = nil)\n data = get_data(\"api/v2/staff/#{staff_id}\")\n if staff_id.present?\n raise ArgumentError, \"Staff member with id #{staff_id} doesn't exist\" if data.blank?\n AeriesNetApi::Models::Staff.new(data.first) # This endpoint always returns an array.\n else\n models = []\n data.each do |member_data|\n models << AeriesNetApi::Models::Staff.new(member_data)\n end\n models\n end\n end",
"title": ""
},
{
"docid": "8eb68184c0dffc55276f1e96921baf40",
"score": "0.6548316",
"text": "def create\n @staffing = Staffing.new(staffing_params)\n\n respond_to do |format|\n if @staffing.save\n format.html { redirect_to @staffing, notice: 'Staffing was successfully created.' }\n format.json { render :show, status: :created, location: @staffing }\n else\n format.html { render :new }\n format.json { render json: @staffing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8ffcd8790b41510a0521634fbbf465d",
"score": "0.6546244",
"text": "def create\n @staff = @user.staffs.new(staff_params)\n respond_to do |format|\n if @staff.save\n format.html { redirect_to edit_staff_path(@staff), notice: 'Nouveau collaborateur créé avec succès !' }\n format.json { render :edit, status: :created, location: @staff }\n else\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c542a569bf71d03fbda0e0a2dcd191bd",
"score": "0.653801",
"text": "def create\n @work_staff = WorkStaff.new(work_staff_params)\n\n respond_to do |format|\n if @work_staff.save\n format.html { redirect_to @work_staff, notice: 'Staff adicionada com sucesso.' }\n format.json { render :show, status: :created, location: @work_staff }\n else\n format.html { render :new }\n format.json { render json: @work_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c77520d4856c204d61f9304b6921db3",
"score": "0.6524542",
"text": "def create\n @outlet_staff = OutletStaff.new(params[:outlet_staff])\n\n respond_to do |format|\n if @outlet_staff.save\n flash[:notice] = 'OutletStaff was successfully created.'\n format.html { redirect_to(@outlet_staff) }\n format.xml { render :xml => @outlet_staff, :status => :created, :location => @outlet_staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @outlet_staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31f467071e84098d455418bc72670114",
"score": "0.6506779",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: \"添加成功。\" }\n format.json { render :show, status: :created, location: @staff }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d41949200844ec0f4d2477944b3427eb",
"score": "0.6479423",
"text": "def create\n @appointment_staff = AppointmentStaff.new(appointment_staff_params)\n\n respond_to do |format|\n if @appointment_staff.save\n format.html { redirect_to @appointment_staff, notice: 'Appointment staff was successfully created.' }\n format.json { render :show, status: :created, location: @appointment_staff }\n else\n format.html { render :new }\n format.json { render json: @appointment_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60b0bb4e0f1386fa686b1294422226fc",
"score": "0.6465118",
"text": "def create\n @staff = Staff.new(staff_params)\n\n respond_to do |format|\n if @staff.save\n log_in @staff\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render :show, status: :created, location: @staff }\n else\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d52dee3117b4ca3f19079154ef38b48",
"score": "0.64297074",
"text": "def create\n @program_staff = ProgramStaff.new(program_staff_params)\n\n respond_to do |format|\n if @program_staff.save\n format.html { redirect_to @program_staff, notice: 'Program staff was successfully created.' }\n format.json { render :show, status: :created, location: @program_staff }\n else\n format.html { render :new }\n format.json { render json: @program_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58576f3afc5c614567083b9355d14eaf",
"score": "0.6422145",
"text": "def create\n @staff_info = StaffInfo.new(staff_info_params)\n\n respond_to do |format|\n if @staff_info.save\n format.html { redirect_to @staff_info, notice: 'Staff info was successfully created.' }\n format.json { render :show, status: :created, location: @staff_info }\n else\n format.html { render :new }\n format.json { render json: @staff_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e71fe005a9cc19630bdc6dbe36912eff",
"score": "0.6403758",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "e71fe005a9cc19630bdc6dbe36912eff",
"score": "0.6403758",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "ada505ac8e9acbd1b502f4fa4c7c6197",
"score": "0.6375769",
"text": "def create\n @movie_staff = MovieStaff.new(movie_staff_params)\n\n respond_to do |format|\n if @movie_staff.save\n format.html { redirect_to @movie_staff, notice: 'Movie staff was successfully created.' }\n format.json { render :show, status: :created, location: @movie_staff }\n else\n format.html { render :new }\n format.json { render json: @movie_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1387b181368b31b90e2e06a23f4bada8",
"score": "0.6371479",
"text": "def create\n @customer_staff = CustomerStaff.new(customer_staff_params)\n\n respond_to do |format|\n if @customer_staff.save\n format.html { redirect_to @customer_staff, notice: 'Customer staff was successfully created.' }\n format.json { render :show, status: :created, location: @customer_staff }\n else\n format.html { render :new }\n format.json { render json: @customer_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3051db1a6f1642e78fcd8d72cd38f13",
"score": "0.6362698",
"text": "def create\n @staff_account = StaffAccount.new(staff_account_params)\n\n respond_to do |format|\n if @staff_account.save\n format.html { redirect_to @staff_account, notice: 'Staff account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @staff_account }\n else\n format.html { render action: 'new' }\n format.json { render json: @staff_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.6361715",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "d837e045d321c618bb57a5dd14415c3d",
"score": "0.63609797",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "c5bed1f741ce5591e75a6d02cd91cc14",
"score": "0.63306856",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "c5bed1f741ce5591e75a6d02cd91cc14",
"score": "0.63306856",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "c5bed1f741ce5591e75a6d02cd91cc14",
"score": "0.63306856",
"text": "def set_staff\n @staff = Staff.find(params[:id])\n end",
"title": ""
},
{
"docid": "299d7c7b186c8c60b394e5a7d991c576",
"score": "0.6325569",
"text": "def create\n if permit?(Role::USER_ADMINISTRATOR)\n @user = Staff.new(params[:staff])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(users_path) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0a429d2161bc9b6f4db6f807a9a60222",
"score": "0.6318867",
"text": "def create\n @check_staff = CheckStaff.new(check_staff_params)\n\n respond_to do |format|\n if @check_staff.save\n format.html { redirect_to @check_staff, notice: 'Check staff was successfully created.' }\n format.json { render :show, status: :created, location: @check_staff }\n else\n format.html { render :new }\n format.json { render json: @check_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94b891557277bb938e3e0b4121f91a63",
"score": "0.6302827",
"text": "def create\n @bootcamp = Bootcamp.new(bootcamp_params)\n\n if @bootcamp.save\n Bootcamp.find(@bootcamp.id).staffs = params.require(:staff).map {|s| Staff.find(s.to_i) }\n redirect_to @bootcamp, notice: 'Bootcamp was successfully created.'\n else\n render action: 'new'\n end\n end",
"title": ""
},
{
"docid": "06b43205ebc4dfb634b68e83c6bb1f03",
"score": "0.6276323",
"text": "def set_staff\r\n @staff = Staff.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "e5ad7cca83862b9de1fad8f3c75325d1",
"score": "0.62526655",
"text": "def create\n @projects_staff = ProjectsStaff.new(params[:projects_staff])\n\n respond_to do |format|\n if @projects_staff.save\n format.html { redirect_to(@projects_staff, :notice => 'Projects staff was successfully created.') }\n format.xml { render :xml => @projects_staff, :status => :created, :location => @projects_staff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @projects_staff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc4856b1f1b8d5d4a0e9f65ee53384df",
"score": "0.62477374",
"text": "def create\n @staff_type = StaffType.new(staff_type_params)\n\n respond_to do |format|\n if @staff_type.save\n format.html { redirect_to @staff_type, notice: 'Staff type was successfully created.' }\n format.json { render :show, status: :created, location: @staff_type }\n else\n format.html { render :new }\n format.json { render json: @staff_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de2589a13d9fd33e908cb13b05ff4876",
"score": "0.6241502",
"text": "def new\n @staff = Staff.new\n\n @page_title = t(:create_new_staff)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @staff }\n end\n end",
"title": ""
},
{
"docid": "50ad30ba01cd79fa0bdae71be0d9fdc6",
"score": "0.62355536",
"text": "def create\n @temp_staff = TempStaff.new(temp_staff_params)\n\n respond_to do |format|\n if @temp_staff.save\n format.html { redirect_to thanks_temp_staffs_path, notice: 'Temp staff was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @temp_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "819d8afa705ca7e48a01bc2c9db6b4ed",
"score": "0.6195665",
"text": "def set_staff\n \t @staff = Staff.find(current_staff.id)\n end",
"title": ""
},
{
"docid": "55edd61b66f6ef1b128ab5dd48c7d9f7",
"score": "0.6186843",
"text": "def create\n @staff = Staff.new(staff_params)\n authorize! :create, @staff\n respond_to do |format|\n if @staff.save\n flash[:notice] = \"Record staff berhasil dibuat, #{undo_link(@staff)}\"\n format.js\n format.json { render action: 'show', status: :created, location: @staff }\n else\n format.js { render action: 'new' }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5bdef297a3079f7443d359d086e9f5b",
"score": "0.61861557",
"text": "def create\n @property_staff = PropertyStaff.new(property_staff_params)\n\n respond_to do |format|\n if @property_staff.save\n format.html { redirect_to @property_staff, notice: 'Property staff was successfully created.' }\n format.json { render :show, status: :created, location: @property_staff }\n else\n format.html { render :new }\n format.json { render json: @property_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a004c84d8a3ac0ae19947c2fffc02ec1",
"score": "0.61819607",
"text": "def create\n @technical_staff = TechnicalStaff.new(technical_staff_params)\n\n respond_to do |format|\n if @technical_staff.save\n format.html { redirect_to @technical_staff, notice: 'Technical staff was successfully created.' }\n format.json { render :show, status: :created, location: @technical_staff }\n else\n format.html { render :new }\n format.json { render json: @technical_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0931add5cfc97da4216686283882ec23",
"score": "0.6180855",
"text": "def create\n @medical_staff = MedicalStaff.new(medical_staff_params)\n\n respond_to do |format|\n if @medical_staff.save\n format.html { redirect_to @medical_staff, notice: 'Medical staff was successfully created.' }\n format.json { render :show, status: :created, location: @medical_staff }\n else\n format.html { render :new }\n format.json { render json: @medical_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e7a09d6970ad2f086ab4e81d278c42d",
"score": "0.61796796",
"text": "def create\n @staff_record_student = Staff::RecordStudent.new(staff_record_student_params)\n\n respond_to do |format|\n if @staff_record_student.save\n format.html { redirect_to @staff_record_student, notice: 'Record student was successfully created.' }\n format.json { render :show, status: :created, location: @staff_record_student }\n else\n format.html { render :new }\n format.json { render json: @staff_record_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4e404923f8b999d516b4ce77eacf19c",
"score": "0.6178981",
"text": "def create\n @staff_rec = StaffRec.new(params[:staff_rec])\n\n respond_to do |format|\n if @staff_rec.save\n flash[:notice] = 'StaffRec was successfully created.'\n format.html { redirect_to(@staff_rec) }\n format.xml { render :xml => @staff_rec, :status => :created, :location => @staff_rec }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @staff_rec.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b9bb65b5e933d8c351ee0e62f385335",
"score": "0.6132788",
"text": "def set_staff\n @staff = Staff.where(user_id: params[:id])\n end",
"title": ""
},
{
"docid": "fe8d5beb5447ac28ec5d3364e7dab0b7",
"score": "0.61250335",
"text": "def create\n @clark_staff = ClarkStaff.new(clark_staff_params)\n\n respond_to do |format|\n if @clark_staff.save\n format.html { redirect_to @clark_staff, notice: 'Clark staff was successfully created.' }\n format.json { render :show, status: :created, location: @clark_staff }\n else\n format.html { render :new }\n format.json { render json: @clark_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3dca0403408801dbf45c87413b8e4b4",
"score": "0.61051697",
"text": "def create\n @staff = User.new(staff_params)\n @staff.password = GlobalConfig::MASTER_PASSWORD\n @staff.password_confirmation = GlobalConfig::MASTER_PASSWORD\n if params[:roles].present?\n @staff.roles << Role.where(:id=> params[:roles])\n end\n respond_to do |format|\n if @staff.save\n format.json { render json: @staff}\n else\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "921b3f2aa0a7b00d3f8ae8a9252bc18c",
"score": "0.608287",
"text": "def create\n @con_staff = ConStaff.new(con_staff_params)\n\n respond_to do |format|\n if @con_staff.save\n format.html do\n redirect_to con_staffs_path,\n notice: 'Con staff was successfully created.'\n end\n format.json do\n render :show,\n status: :created,\n location: @con_staff\n end\n else\n puts @con_staff.errors.full_messages\n format.html { render :new }\n format.json do\n render json: @con_staff.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "90165d727ffa3fca9d4eb0b5696d0b1e",
"score": "0.60771763",
"text": "def create\n @stafftitle = Stafftitle.new(params[:stafftitle])\n\n respond_to do |format|\n if @stafftitle.save\n flash[:notice] = 'Stafftitle was successfully created.'\n format.html { redirect_to(@stafftitle) }\n format.xml { render :xml => @stafftitle, :status => :created, :location => @stafftitle }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @stafftitle.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "825090743133dd305fe32ff57f203ab5",
"score": "0.607639",
"text": "def create\r\n @user = User.new(user_params.except(:staff_attributes))\r\n staff = Staff.find(user_params[:staff_attributes][:id]) if user_params[:staff_attributes][:id] && !user_params[:staff_attributes][:id].empty?\r\n @user.staff = staff if staff\r\n\r\n respond_to do |format|\r\n if @user.save\r\n set_users_grid\r\n format.html { redirect_to users_path, notice: t('activerecord.success.messages.created', model: User.model_name.human) }\r\n format.js\r\n else\r\n format.html { render :new }\r\n format.js { render :new }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "1faa73aa73be4cabeb2765115201e1b8",
"score": "0.60734564",
"text": "def create\n @staff_job = StaffJob.new(staff_job_params)\n\n respond_to do |format|\n if @staff_job.save\n format.html { redirect_to @staff_job, notice: 'Staff job was successfully created.' }\n format.json { render :show, status: :created, location: @staff_job }\n else\n format.html { render :new }\n format.json { render json: @staff_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8241881d92cbb485e5b9152e768b0590",
"score": "0.6073057",
"text": "def set_staff\n @staff = Staff.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "3914aabd83d9137b155d20f54a20adf8",
"score": "0.606534",
"text": "def set_staff_info\n @staff_info = StaffInfo.find(params[:id])\n end",
"title": ""
},
{
"docid": "f2be64cc733b5831a8a9563be3722200",
"score": "0.60434264",
"text": "def create\n @community_staff = CommunityStaff.new(community_staff_params)\n\n respond_to do |format|\n if @community_staff.save\n format.html { redirect_to @community_staff, notice: 'Community staff was successfully created.' }\n format.json { render :show, status: :created, location: @community_staff }\n else\n format.html { render :new }\n format.json { render json: @community_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c834aea0136c9bcf8647aef38f2383b",
"score": "0.6032077",
"text": "def set_staff\n @staff = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "c8f8aa7cbc644c7fe55f6d4b06da6ff0",
"score": "0.6031583",
"text": "def create\n @reservable_by_staff = ReservableByStaff.new(reservable_by_staff_params)\n\n respond_to do |format|\n if @reservable_by_staff.save\n format.html { redirect_to @reservable_by_staff, notice: \"Reservable by staff was successfully created.\" }\n format.json { render :show, status: :created, location: @reservable_by_staff }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @reservable_by_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae9f5ad34f163e215577a2426b1ad926",
"score": "0.60221994",
"text": "def create\n @staff_subject = StaffSubject.new(staff_subject_params)\n\n respond_to do |format|\n if @staff_subject.save\n format.html { redirect_to @staff_subject, notice: 'Staff subject was successfully created.' }\n format.json { render json: @staff_subject, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @staff_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76ca4018f32181932fd5319af7ebf21a",
"score": "0.6017202",
"text": "def create\n @pstaff = current_user.pstaffs.build(pstaff_params)\n\n respond_to do |format|\n if @pstaff.save\n format.html { redirect_to @pstaff, notice: 'Pstaff was successfully created.' }\n format.json { render :user, status: :created, location: @pstaff }\n else\n format.html { render :new }\n format.json { render json: @pstaff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76ca4018f32181932fd5319af7ebf21a",
"score": "0.6017202",
"text": "def create\n @pstaff = current_user.pstaffs.build(pstaff_params)\n\n respond_to do |format|\n if @pstaff.save\n format.html { redirect_to @pstaff, notice: 'Pstaff was successfully created.' }\n format.json { render :user, status: :created, location: @pstaff }\n else\n format.html { render :new }\n format.json { render json: @pstaff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08378d33aa46aa74d37cf001b990ac54",
"score": "0.60125566",
"text": "def create\n @member = Staff.new user_params_with_password\n @member.skip_confirmation!\n\n # Non-admin can only add staff to their own college.\n unless current_staff.has_role? :site_admin\n @member.college = current_staff.college\n end\n\n authorize @member\n respond_to do |format|\n if @member.save\n format.html { redirect_to staff_member_permissions_path(@member), notice: 'User was successfully created.' }\n else\n set_colleges\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "e9e9b3565b945404bf66b07d2530204c",
"score": "0.59740996",
"text": "def set_service_staff\n @service_staff = ServiceStaff.find(params[:id])\n end",
"title": ""
},
{
"docid": "425adb345cb01244d5172a4ea1414ce7",
"score": "0.59646875",
"text": "def set_staff\n @staff = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "b9c3dc51c45d52e4621187f424bc5533",
"score": "0.596334",
"text": "def set_staff_member\n @staff_member = StaffMember.find(params[:id])\n end",
"title": ""
},
{
"docid": "0e357675de5d739306ef8533d79dc747",
"score": "0.59610546",
"text": "def create\n @staff_account = StaffAccount.new(staff_account_params)\n\n if @staff_account.save\n redirect_to(staff_account_path(@staff_account), notice: 'La cuenta personal fue creada.')\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "0ccf1543cb3be0eabe817cfba548de0b",
"score": "0.59536344",
"text": "def new\n @staff = Staff.new\n setStatus\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @staff }\n end\n end",
"title": ""
},
{
"docid": "55143068e1476b1d10364dd1f411c232",
"score": "0.59453636",
"text": "def create\n @stafflogin = Stafflogin.new(params[:stafflogin])\n\n respond_to do |format|\n if @stafflogin.save\n format.html { redirect_to(@stafflogin, :notice => 'Stafflogin was successfully created.') }\n format.xml { render :xml => @stafflogin, :status => :created, :location => @stafflogin }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @stafflogin.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "630b708da78ed56d5edd02696e897606",
"score": "0.59385085",
"text": "def create\n # inspect params\n @staff = Staff.new(staff_params)\n if params[:staff][:phone].present? \n @staff.phone = format_phone(@staff.phone)\n end\n if not params[:staff][:hire_date].present?\n @staff.hire_date = DateTime.now \n end\n respond_to do |format|\n if @staff.save\n format.html { redirect_to @staff, notice: 'Staff was successfully created.' }\n format.json { render :show, status: :created, location: @staff }\n else\n format.html { render :new }\n format.json { render json: @staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c6d27e0f7e6ab7e73838f9990525dbb",
"score": "0.59371233",
"text": "def set_staffing\n @staffing = Staffing.find(params[:id])\n end",
"title": ""
},
{
"docid": "f370bdc6b0193bdfc33e07eb06617690",
"score": "0.593238",
"text": "def create\n @school_staff_type = SchoolStaffType.new(params[:school_staff_type])\n\n respond_to do |format|\n if @school_staff_type.save\n flash[:notice] = 'School Staff Type was successfully created.'\n format.html { redirect_to(school_staff_types_url) }\n format.xml { render :xml => @school_staff_type, :status => :created, :location => @school_staff_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @school_staff_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "651c192da1aad2e5b969344fc72e8a6f",
"score": "0.5925261",
"text": "def create\n @medical_team_medical_staff = MedicalTeamMedicalStaff.new(medical_team_medical_staff_params)\n\n respond_to do |format|\n if @medical_team_medical_staff.save\n format.html { redirect_to @medical_team_medical_staff, notice: 'Medical team medical staff was successfully created.' }\n format.json { render :show, status: :created, location: @medical_team_medical_staff }\n else\n format.html { render :new }\n format.json { render json: @medical_team_medical_staff.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d88a8e047ed84e6e0ed395df9c51695d",
"score": "0.5920575",
"text": "def create\r\n @staff = Staff.new(staff_params.except(:department_attributes))\r\n @staff.department = Department.find_or_create_by(name: staff_params[:department_attributes][:name])\r\n\r\n respond_to do |format|\r\n if @staff.save\r\n set_staffs_grid\r\n format.html { redirect_to staffs_path, notice: t('activerecord.success.messages.created', model: Staff.model_name.human) }\r\n format.js\r\n else\r\n format.html { render :new }\r\n format.js { render :new }\r\n end\r\n end\r\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "50a166ddde57e8be8d446bea685d8b2f",
"score": "0.0",
"text": "def publication_params\n params.fetch(:publication, {})\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69225836",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.68929327",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67848456",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.674347",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682223",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6636527",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66291976",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66258276",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65625846",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491194",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64526874",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64001405",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63810205",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63634825",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.633783",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336759",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6325718",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.631947",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63146484",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63137317",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6306224",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6301168",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.63000035",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.629581",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6280713",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6271388",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6266194",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256044",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62550515",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62525266",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6234781",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62278074",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6226693",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226605",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6226114",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200643",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.61913997",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61835426",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179986",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61630195",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160931",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6155551",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61542404",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61356604",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61342114",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61188847",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61140966",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61107725",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60860336",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60855556",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608446",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076753",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60742563",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677326",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60666215",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065763",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60655254",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064794",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6062697",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562736",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491294",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6046521",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.6041768",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60346854",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030552",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6024842",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021606",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6019679",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017253",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60145336",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60074294",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006753",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60048765",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60009843",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000161",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.599852",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947807",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5993962",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5992739",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59911275",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59906775",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
b4db3c7187c8634cacfe7d0d498d95d8
|
HTML fragment containing the association links for the given object, or a link to lazily load them if configured. Also contains the inline mtm_edit forms when editing.
|
[
{
"docid": "15837b4dca1ac364c7692f4fad612660",
"score": "0.83644503",
"text": "def association_links(obj)\n if model.lazy_load_association_links?(type, request) && normalized_type != :association_links && request.params['associations'] != 'show'\n \"<div id='lazy_load_association_links' data-object='#{model.primary_key_value(obj)}' data-type='#{type}'><a href=\\\"#{url_for(\"#{type}/#{model.primary_key_value(obj)}?associations=show\")}\\\">Show Associations</a></div>\"\n elsif type == :show\n association_link_list(obj).to_s\n else\n \"#{inline_mtm_edit_forms(obj)}#{association_link_list(obj)}\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "721afa0527aca5f23e74cddc3a979792",
"score": "0.74266976",
"text": "def association_link(mc, assoc_obj)\n if mc\n t = h(mc.object_display_name(:association, request, assoc_obj))\n if mc.supported_action?(type, request)\n t = \"<a href=\\\"#{base_url_for(\"#{mc.link}/#{type}/#{mc.primary_key_value(assoc_obj)}\")}\\\">#{t}</a>\"\n end\n t\n else\n h(model.default_object_display_name(assoc_obj))\n end\n end",
"title": ""
},
{
"docid": "6a789797b5fed2614fc0abe951adac61",
"score": "0.7409907",
"text": "def association_link_list(obj)\n assocs = model.association_links_for(type, request) \n return if assocs.empty?\n read_only = type == :show\n t = String.new\n t << '<h3 class=\"associated_records_header\">Associated Records</h3>'\n t << \"<ul class='association_links'>\\n\"\n assocs.each do |assoc|\n mc = model.associated_model_class(assoc)\n t << \"<li>\"\n t << association_class_link(mc, assoc)\n t << \"\\n \"\n\n case model.association_type(assoc)\n when :one\n if assoc_obj = obj.send(assoc)\n t << \" - \"\n t << association_link(mc, assoc_obj)\n end\n assoc_objs = []\n when :edit\n if !read_only && model.supported_mtm_edit?(assoc.to_s, request)\n t << \"(<a href=\\\"#{url_for(\"mtm_edit/#{model.primary_key_value(obj)}?association=#{assoc}\")}\\\">associate</a>)\"\n end\n assoc_objs = obj.send(assoc)\n when :new\n if !read_only && mc && mc.supported_action?(:new, request)\n params = model.associated_new_column_values(obj, assoc).map do |col, value|\n \"#{mc.link}%5b#{col}%5d=#{value}\"\n end\n t << \"(<a href=\\\"#{base_url_for(\"#{mc.link}/new?#{params.join('&')}\")}\\\">create</a>)\"\n end\n assoc_objs = obj.send(assoc)\n else\n assoc_objs = []\n end\n\n unless assoc_objs.empty?\n t << \"<ul>\\n\"\n assoc_objs.each do |assoc_obj1|\n t << \"<li>\"\n t << association_link(mc, assoc_obj1)\n t << \"</li>\"\n end\n t << \"</ul>\"\n end\n\n t << \"</li>\"\n end\n t << \"</ul>\"\n end",
"title": ""
},
{
"docid": "9685f073a6d658fb28ed94d882b8e297",
"score": "0.67798436",
"text": "def association_links\n filename = (@scaffold_class.scaffold_associations_path || controller.scaffold_path(\"associations\"))\n controller.send(:render_to_string, {:file=>filename, :layout=>false}) if File.file?(filename)\n end",
"title": ""
},
{
"docid": "b734538ceb436648f2e35df16a2d12f8",
"score": "0.64895016",
"text": "def scaffold_association_links\n klass = @scaffold_class\n return '' if @scaffold_class.scaffold_associations.empty?\n read_only = @scaffold_associations_readonly\n show_edit = read_only ? :show : :edit\n so = @scaffold_object\n soid = so.scaffold_id\n singular_name = @scaffold_options[:singular_name]\n content = '<h3 class=\"scaffold_associated_records_header\">Associated Records</h3>'\n content << \"<ul id='scaffolded_associations_#{singular_name}_#{soid}' class='#{klass.scaffold_association_list_class}'>\\n\"\n klass.scaffold_associations.each do |association| \n next unless klass.scaffold_show_association_links?(association)\n class_name = klass.scaffold_associated_name(association)\n human_name = klass.scaffold_associated_human_name(association)\n content << \"<li>\"\n content << scaffold_check_link(human_name, read_only, \"manage_#{class_name}\") \n content << \"\\n \"\n case klass.scaffold_association_type(association)\n when :one\n associated_record = klass.scaffold_associated_objects(association, so, :session=>scaffold_session)\n content << \" - #{scaffold_check_link(associated_record.scaffold_name, false, \"#{show_edit}_#{class_name}\", :id=>associated_record.scaffold_id) if associated_record}</li>\\n\"\n next\n when :edit\n content << scaffold_check_link('(associate)', true, \"edit_#{singular_name}_#{association}\", :id=>soid) unless read_only\n when :new\n unless read_only\n associated_params = {}\n klass.scaffold_new_associated_object_values(association, so).each{|key, value| associated_params[\"#{class_name}[#{key}]\"] = value}\n content << scaffold_check_link('(create)', true, \"new_#{class_name}\", associated_params)\n end\n end\n if (records = klass.scaffold_associated_objects(association, so, :session=>scaffold_session)).length > 0\n content << \"<ul>\\n\"\n records.each do |associated|\n content << \"<li>#{scaffold_check_link(associated.scaffold_name, false, \"#{show_edit}_#{class_name}\", :id=>associated.scaffold_id)}</li>\\n\"\n end\n content << \"</ul>\\n\"\n end\n content << \"</li>\\n\"\n end\n content << \"</ul>\\n\"\n end",
"title": ""
},
{
"docid": "d701d7a8fb2368548da823227cb020b2",
"score": "0.63109314",
"text": "def inline_mtm_edit_forms(obj)\n assocs = model.inline_mtm_assocs(request)\n return if assocs.empty?\n\n t = String.new\n t << \"<div class='inline_mtm_add_associations'>\"\n assocs.each do |assoc|\n form_attr = form_attributes(:action=>url_for(\"mtm_update/#{model.primary_key_value(obj)}?association=#{assoc}&redir=edit\"), :class => 'mtm_add_associations', 'data-remove' => \"##{assoc}_remove_list\")\n t << Forme.form(obj, form_attr, form_opts(form_attr[:action])) do |f|\n opts = model.column_options_for(:mtm_edit, request, assoc)\n add_opts = opts[:add] ? opts.merge(opts.delete(:add)) : opts.dup\n add_opts = {:name=>'add[]', :id=>\"add_#{assoc}\"}.merge!(add_opts)\n if model.association_autocomplete?(assoc, request)\n f.input(assoc, {:type=>'text', :class=>'autoforme_autocomplete', :attr=>{'data-type'=>'association', 'data-column'=>assoc, 'data-exclude'=>model.primary_key_value(obj)}, :value=>''}.merge!(add_opts))\n else\n f.input(assoc, {:dataset=>model.unassociated_mtm_objects(request, assoc, obj), :multiple=>false, :add_blank=>true}.merge!(add_opts))\n end\n f.button(:value=>'Add', :class=>'btn btn-xs btn-primary')\n end\n end\n t << \"</div>\"\n t << \"<div class='inline_mtm_remove_associations'><ul>\"\n assocs.each do |assoc|\n mc = model.associated_model_class(assoc)\n t << \"<li>\"\n t << association_class_link(mc, assoc)\n t << \"<ul id='#{assoc}_remove_list'>\"\n obj.send(assoc).each do |assoc_obj|\n t << mtm_edit_remove(assoc, mc, obj, assoc_obj)\n end\n t << \"</ul></li>\"\n end\n t << \"</ul></div>\"\n end",
"title": ""
},
{
"docid": "8b5df166253c245715780ba0e9522e1b",
"score": "0.6232811",
"text": "def link(obj)\n return \"<a href='#{R(obj, self.id)}'>#{self.name}</a>\"\n end",
"title": ""
},
{
"docid": "988ac8ac70464e2c2ce1d2ecb00f30bc",
"score": "0.6206627",
"text": "def scaffold_show_association_links?(association)\n !(scaffold_habtm_with_ajax && scaffold_association_type(association) == :edit)\n end",
"title": ""
},
{
"docid": "5a851204fdda0cfe6c086e5cfe884da0",
"score": "0.60788155",
"text": "def link_actions_for(object)\n link_to_show(object) +\n link_to_edit(edit_polymorphic_path(object)) +\n link_to_destroy(object)\n end",
"title": ""
},
{
"docid": "f629f7e5e011dbdd0e0e29cd256d6ba2",
"score": "0.6063368",
"text": "def association_class_link(mc, assoc)\n assoc_name = humanize(assoc)\n if mc && mc.supported_action?(:browse, request)\n \"<a href=\\\"#{base_url_for(\"#{mc.link}/browse\")}\\\">#{assoc_name}</a>\"\n else\n assoc_name\n end\n end",
"title": ""
},
{
"docid": "113a83e9d7836a85345049079900e0f1",
"score": "0.5954567",
"text": "def sections_augmented_link( obj )\n title = \"\"\n title << obj.code unless obj.try( :code ).blank?\n title << \"\\n\" unless title.empty? or obj.try( :description ).blank?\n title << obj.description unless obj.try( :description ).blank?\n\n content_tag(\n :span,\n link_to( h( obj.title ), obj ),\n :title => title\n )\n end",
"title": ""
},
{
"docid": "930f765381de831f6df5d8fd749c7fc3",
"score": "0.59006375",
"text": "def edit_link(obj, options = {})\n if policy(obj).edit?\n url = polymorphic_url([:edit] + Array(obj))\n action_link('Edit', url, 'pencil', options)\n end\n end",
"title": ""
},
{
"docid": "27d947467e810959356ec6ebca7a320d",
"score": "0.5779999",
"text": "def resource_association_links_for(resource, options = {})\n output = Array.new\n resource_associations(:has_many).each do |association|\n text = resource_human_name_for(association, 2)\n if controller_path.include?('/')\n namespace = controller.class.parent.name.underscore\n path = [namespace, resource, association.to_s.tableize]\n else\n path = [resource, association.to_s.tableize]\n end\n options.merge!(class: collection_table_button_classes)\n output << link_to(text, path, options)\n end\n output.join(' ').html_safe\n end",
"title": ""
},
{
"docid": "848b0bfa53089d6b3966f01abbc99b8c",
"score": "0.57770956",
"text": "def link_to_add_association_fields(form, association_name, &block)\n # build a new associated object\n new_object = form.object.send(association_name).klass.new\n # Get objects unique ruby id to use in the construction of fields as index\n ruby_obj_id = new_object.object_id\n\n fields = form.fields_for(association_name, new_object, child_index: ruby_obj_id) do |builder|\n render(\"#{association_name.to_s.singularize}_fields\", record: new_object, form: builder)\n end\n\n link_to \"#\", data: { ruby_obj_id: ruby_obj_id, fields: fields.delete(\"\\n\") },\n class: \"btn btn-default add-#{association_name.to_s.singularize.tr('_', '-')}-fields\", &block\n end",
"title": ""
},
{
"docid": "df0ace808bc9739eb88b241e78006af0",
"score": "0.5694236",
"text": "def content_edit_action_link(text, object)\n content_edit_action_item(link_to_remote_facebox(text, member_url([@tier, object], :edit), {:rel => \"nofollow\"}))\n end",
"title": ""
},
{
"docid": "7eb223f64fade32f5fe9eed18338af3e",
"score": "0.5683047",
"text": "def link_to_add_association(name, f, association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n model_name = new_object.class.name.underscore\n hidden_div = content_tag('div', :id => \"#{model_name}_fields_template\", :style => \"display:none;\") do\n render_association(association, f, new_object)\n end\n hidden_div.html_safe + link_to(name, '#', :class => 'add_fields', :'data-association' => association.to_s.singularize)\n end",
"title": ""
},
{
"docid": "8f1399041299f9b77adcfd376db89518",
"score": "0.56683993",
"text": "def relationship_related_link(attribute_name); end",
"title": ""
},
{
"docid": "917482fc9f374cbe02453d8ae23e0a8d",
"score": "0.56442124",
"text": "def render_concept_association(hash, concept, association_class, further_options = {})\n html = if association_class.respond_to?(:hidden?) && association_class.hidden?(concept)\n ''\n else\n render(association_class.partial_name(concept), further_options.merge(concept: concept, klass: association_class))\n end\n # Convert the already safely buffered string back to a regular one\n # in order to be able to modify it with squish\n if String.new(html).squish.present?\n ((hash[association_class.view_section(concept)] ||= {})[association_class.view_section_sort_key(concept)] ||= '') << html.html_safe\n end\n end",
"title": ""
},
{
"docid": "5d4883f68900b66104c0442681ab566a",
"score": "0.55584574",
"text": "def action_links(object, options = {})\n class_name = object.class.to_s.tableize.downcase\n \n haml do\n open :td, :class => \"list-table-links\" do\n puts link_to(icon(options[:edit_icon]), \n {:action => \"edit\", \n :controller => class_name, \n :id => object.id}, \n :class => \"edit-link\")\n puts button_to_remote('', \n { :url => {:action => \"destroy\", :id => object}}, \n { :loading => transparent_message_show('ajax_info_message'), \n :complete => transparent_message_hide('ajax_info_message'), \n :method => :delete, \n :confirm => \"Are you sure you want to delete this #{class_name.humanize.downcase.singularize}?\", \n :class => options[:delete_class], \n :onmouseover => \"this.style.cursor = 'pointer';\", \n :onmouseout => \"this.style.cursor = 'auto';\",\n :value => \" \"})\n end # open\n end # haml\n end",
"title": ""
},
{
"docid": "3f00a11e45dbacc5cfb7b59253ed0994",
"score": "0.552986",
"text": "def link_to_add_associations(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize + \"_fields\", f: builder)\n end\n link_to(name, '#', class: \"add_fields\", data: {id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "93eb5232faae9913075e48e2c7eacce0",
"score": "0.5527916",
"text": "def new_association_link(name, f, model, additional_javascript = \"\")\n fields = new_child_fields(f, model.to_sym)\n link_to_function(name, raw(\"replace_content(this, \\\"#{model}\\\", \\\"#{escape_javascript(fields)}\\\");$(\\\"#add-#{model}-select-link\\\").show();$(\\\"#add-#{model}-entry-link\\\").hide();#{additional_javascript}\"), :id=> \"add-#{model}-entry-link\", :class=>\"add-child-form-link admin-link\")\n end",
"title": ""
},
{
"docid": "b32649f328b539099c03100150ee63a5",
"score": "0.548162",
"text": "def link_4edit #:nodoc:\n html = ''\n return html unless @opts[:edit_mode] > 1\n \n @opts[:editparams].merge!( { table: 'dc_big_menu', controller: 'cmsedit', action: 'edit' } )\n title = \"#{t('drgcms.edit')}: \"\n @opts[:editparams].merge!( { id: @menu.id, title: \"#{title}#{@menu.name}\" } ) if @menu\n title << t('helpers.label.dc_big_menu.tabletitle')\n @opts[:editparams].merge!( { action: 'index', title: title }) if @menu.nil?\n html << dc_link_for_edit( @opts[:editparams] )\nend",
"title": ""
},
{
"docid": "aaedbaecd6d0e101ce5b88c405defe47",
"score": "0.5475305",
"text": "def link(**opt)\n opt[:path] = show_path(id: object.identifier)\n super(**opt)\n end",
"title": ""
},
{
"docid": "76f777e56496842fb27e066a7f6f05e3",
"score": "0.5472593",
"text": "def magic_links(model, options = 'crudhib', opts = {} )\n separator = ' '\n verbose = opts.fetch(:verbose, false ) #!= false\n lnks = %( <span class=\"magic_links\" ><small>\\n )\n lnks += link_to( icon('icons/add') + (verbose ? \"Add new #{model.class}\" : ''), :action => \"new\" ) + separator if options.match( /[ac]/i )\n lnks += link_to( icon('icons/edit') + (verbose ? \"Edit #{model}\" : ''), edit_polymorphic_path(model) ) + separator rescue \"ML_Exc(Edit #{model})\" if options.match( /[ue]/i )\n lnks += link_to( icon('icons/delete')+ (verbose ? \"Delete #{model}\" : ''), model, :confirm => 'Are you sure?', :method => :delete ) + separator if options.match( /[xd]/i )\n lnks += link_to( icon('icons/schema')+ (verbose ? \"Index for #{model.class}\": ''), model, :action => \"index\" ) + separator if options.match( /i/i )\n lnks += link_to( icon('icons/back') + (verbose ? \"Back to previous page\" : ''), url_for( :back ) ) + separator if options.match( /b/i )\n lnks += link_to( icon('icons/home2') + (verbose ? \"Home for RicLife\" : ''), '/' ) + separator if options.match( /h/i )\n #lnks += \"ESPERIMENTO (((#{url_for(model.class.new)} , #{url_for(Gms)})))\"\n lnks += '</small></span>'\n return lnks\n end",
"title": ""
},
{
"docid": "15264eecf8050ea6a2a7126c63259338",
"score": "0.5452067",
"text": "def links(object=nil)\n options[:links] ||= []\n options[:links] << object if object\n options[:links]\n end",
"title": ""
},
{
"docid": "79f709444eb3c2280bee3e2db056e207",
"score": "0.54082066",
"text": "def nested_set_full_outline(item,options={})\r\n return '' if item.nil?\r\n options = {\r\n :action => options[:action] || :show,\r\n :controller => options[:controller] || item.class.to_s.underscore,\r\n :separator => options[:separator] || ' > '.html_safe }\r\n s = []\r\n for it in item.ancestors\r\n if block_given?\r\n s << yield(it) + options[:separator]\r\n else\r\n s << link_to(it.disp_name, { :controller => options[:controller], :action => options[:action], :id => it }) + options[:separator]\r\n end\r\n end\r\n if block_given?\r\n s << yield(item)\r\n else\r\n s << h(item.disp_name)\r\n end unless options[:parent_only]\r\n return s.join.html_safe\r\n end",
"title": ""
},
{
"docid": "185bf7944f6c3aa2bcbb6ce5e49ca3fb",
"score": "0.5402196",
"text": "def scaffold_habtm_ajax_associations\n klass = @scaffold_class\n return '' unless klass.scaffold_habtm_with_ajax\n sn = @scaffold_options[:singular_name]\n so = @scaffold_object\n soid = so.scaffold_id\n content = \"<div class='habtm_ajax_add_associations' id='#{sn}_habtm_ajax_add_associations'>\"\n klass.scaffold_habtm_associations.reject{|association| !scaffolded_method?(\"add_#{association}_to_#{sn}\")}.each do |association|\n content << \"#{scaffold_form_remote_tag(\"add_#{association}_to_#{sn}\", :id=>soid)}\\n#{scaffold_habtm_ajax_tag(\"#{sn}_#{association}_id\", so, sn, association)}\\n<input name='commit' type='submit' value='Add #{klass.scaffold_associated_human_name(association).singularize}' /></form>\\n\"\n end\n content << \"</div><div class='habtm_ajax_remove_associations' id='#{sn}_habtm_ajax_remove_associations'><ul id='#{sn}_associated_records_list'>\"\n klass.scaffold_habtm_associations.reject{|association| !scaffolded_method?(\"remove_#{association}_from_#{sn}\")}.each do |association|\n klass.scaffold_associated_objects(association, so, :session=>scaffold_session).each do |associated_record|\n content << scaffold_habtm_association_line_item(klass, association, @scaffold_object, associated_record)\n end\n end\n content << '</ul></div>'\n content\n end",
"title": ""
},
{
"docid": "05988c138be94e28cd81fe3d8e4b9352",
"score": "0.5396819",
"text": "def edit_page(obj)\n page do\n t = String.new\n form_attr = form_attributes(:action=>url_for(\"update/#{model.primary_key_value(obj)}\"))\n t << Forme.form(obj, form_attr, form_opts(form_attr[:action])) do |f|\n model.columns_for(:edit, request).each do |column|\n col_opts = column_options_for(:edit, request, obj, column)\n if html = model.edit_html_for(obj, column, :edit, request)\n col_opts = col_opts.merge(:html=>html)\n end\n f.input(column, col_opts)\n end\n f.button(:value=>'Update', :class=>'btn btn-primary')\n end\n if model.supported_action?(:delete, request)\n t << Forme.form(form_attributes(:action=>url_for(\"delete/#{model.primary_key_value(obj)}\")), form_opts) do |f|\n f.button(:value=>'Delete', :class=>'btn btn-danger')\n end\n end\n t << association_links(obj)\n end\n end",
"title": ""
},
{
"docid": "91abb58b33dcc6bf45ad64939068381e",
"score": "0.53913194",
"text": "def js_for_has_many(assoc, form_block, template, new_record, class_string)\n assoc_reflection = object.class.reflect_on_association assoc\n assoc_name = assoc_reflection.klass.model_name\n placeholder = \"NEW_#{assoc_name.to_s.underscore.upcase.gsub(%r{/}, '_')}_RECORD\"\n opts = {\n for: [assoc, nested_object(assoc)],\n class: class_string,\n for_options: { child_index: placeholder },\n }\n html = template.capture { inputs_for_nested_attributes opts, &form_block }\n text = new_record.is_a?(String) ? new_record : I18n.t('active_admin.has_many_new', model: assoc_name.human)\n\n template.link_to text, '#', class: 'button has_many_add', data: {\n html: CGI.escapeHTML(html).html_safe, placeholder: placeholder\n }\n end",
"title": ""
},
{
"docid": "8b812833f6ab02d0f5d09eba01dbf320",
"score": "0.53901744",
"text": "def link_include_object(obj); end",
"title": ""
},
{
"docid": "8b812833f6ab02d0f5d09eba01dbf320",
"score": "0.53901744",
"text": "def link_include_object(obj); end",
"title": ""
},
{
"docid": "bacdd687a7d4ee9ba6f92fce987193b5",
"score": "0.5363769",
"text": "def action_links(obj, options)\n route_key = obj.class.model_name.singular_route_key\n links = %w(edit destroy).collect do |action|\n options[:exclude] = [options[:exclude]] unless options[:exclude].is_a?(Array)\n next if options[:exclude] && options[:exclude].include?(action.to_sym)\n key = \"#{obj.class.table_name}##{action}\"\n case action\n when \"edit\"\n can?(:update, obj) ? action_link(action, send(\"edit_#{route_key}_path\", obj), :title => t(\"common.edit\")) : nil\n when \"destroy\"\n # build a delete warning\n obj_description = options[:obj_name] ? \"#{obj.class.model_name.human} '#{options[:obj_name]}'\" : options[:obj_description]\n warning = t(\"layout.delete_warning\", :obj_description => obj_description)\n \n can?(:destroy, obj) ? action_link(action, send(\"#{route_key}_path\", obj), :method => :delete, \n :confirm => warning, :title => t(\"common.delete\")) : nil\n end\n end.compact\n links.join(\"\").html_safe\n end",
"title": ""
},
{
"docid": "5024ec459d1d706aa5122ba0d30d2932",
"score": "0.53546244",
"text": "def handle_association_links\n @type = @normalized_type = @subtype\n obj = model.with_pk(@type, request, request.id)\n association_links(obj)\n end",
"title": ""
},
{
"docid": "97559295bfc170ab1816d5d64059d8fc",
"score": "0.5350342",
"text": "def scaffold_associated_objects(association, object, options)\n object.send(association)\n end",
"title": ""
},
{
"docid": "e51d555864c6aa79ace083df0e5d04c9",
"score": "0.534425",
"text": "def link_to(obj, base = nil)\n %|<a href=\"#{href_of(obj, base)}\">#{obj}</a>|\n end",
"title": ""
},
{
"docid": "7349cede021680808e78278174bc1e18",
"score": "0.53182125",
"text": "def model_link(item, **opt)\n html_opt = remainder_hash!(opt, *MODEL_LINK_OPTIONS)\n type = (model_type unless item)\n item ||= object\n label = opt[:label] || :label\n label = item.send(label) if label.is_a?(Symbol)\n if opt[:no_link]\n html_span(label, html_opt)\n else\n # noinspection RubyMismatchedArgumentType\n path = (yield(label) if block_given?) || opt[:path] || opt[:path_method]\n path = path.call(item, label) if path.is_a?(Proc)\n html_opt[:title] ||= opt[:tooltip]\n html_opt[:title] ||=\n if (type ||= opt[:scope] || opt[:controller] || Model.for(item))\n I18n.t(\"emma.#{type}.show.tooltip\", default: '')\n end\n # noinspection RubyMismatchedArgumentType\n make_link(label, path, **html_opt)\n end\n end",
"title": ""
},
{
"docid": "7aaffa080e14a3a9c8173a596110f11a",
"score": "0.5313291",
"text": "def edit\n resource.prepare_links\n\n super\n end",
"title": ""
},
{
"docid": "eacb1523733cbcdf1e0b02ee49fa84a4",
"score": "0.5313119",
"text": "def links\n construct_html(self.items)\n end",
"title": ""
},
{
"docid": "974506891a013606284ec6471b41a288",
"score": "0.5311301",
"text": "def make_object_html_wrapper( object )\n\n\t\t\t# If the object has been rendered already, just return a link to the previous\n\t\t\t# HTML fragment\n\t\t\tThread.current[ THREAD_DUMP_KEY ] ||= {}\n\t\t\tif Thread.current[ THREAD_DUMP_KEY ].key?( object.object_id )\n\t\t\t\treturn %Q{<a href=\"#object-%d\" class=\"cache-link\" title=\"jump to previous details\">%s</a>} % [\n\t\t\t\t\tobject.object_id,\n\t\t\t\t\t%{→ %s #%d} % [ object.class.name, object.object_id ]\n\t\t\t\t]\n\t\t\telse\n\t\t\t\tThread.current[ THREAD_DUMP_KEY ][ object.object_id ] = true\n\t\t\tend\n\n\t\t\t# Assemble the innards as an array of parts\n\t\t\tparts = [\n\t\t\t\t%{<div class=\"object-header\">},\n\t\t\t\t%{<span class=\"object-class\">#{object.class.name}</span>},\n\t\t\t\t%{<span class=\"object-id\">##{object.object_id}</span>},\n\t\t\t\t%{</div>},\n\t\t\t\t%{<div class=\"object-body\">},\n\t\t\t]\n\n\t\t\tobject.instance_variables.sort.each do |ivar|\n\t\t\t\tvalue = object.instance_variable_get( ivar )\n\t\t\t\thtml = make_html_for_object( value )\n\t\t\t\tclasses = %w[instance-variable]\n\t\t\t\tif value.instance_variables.empty? && !value.respond_to?( :values_at )\n\t\t\t\t\tclasses << 'simple'\n\t\t\t\telse\n\t\t\t\t\tclasses << 'complex'\n\t\t\t\tend\n\t\t\t\tparts << IVAR_HTML_FRAGMENT % [ classes.join(' '), ivar, html ]\n\t\t\tend\n\n\t\t\tparts << %{</div>}\n\n\t\t\t# Make HTML class names out of the object's namespaces\n\t\t\tnamespaces = object.class.name.downcase.split(/::/)\n\t\t\tclasses = []\n\t\t\tnamespaces.each_index do |i|\n\t\t\t\tclasses << namespaces[0..i].join('-') + '-object'\n\t\t\tend\n\n\t\t\t# Glue the whole thing together and return it\n\t\t\treturn OBJECT_HTML_CONTAINER % [\n\t\t\t\tobject.object_id,\n\t\t\t\tclasses.join(\" \"),\n\t\t\t\tparts.join(\"\\n\")\n\t\t\t]\n\t\tend",
"title": ""
},
{
"docid": "974506891a013606284ec6471b41a288",
"score": "0.5311301",
"text": "def make_object_html_wrapper( object )\n\n\t\t\t# If the object has been rendered already, just return a link to the previous\n\t\t\t# HTML fragment\n\t\t\tThread.current[ THREAD_DUMP_KEY ] ||= {}\n\t\t\tif Thread.current[ THREAD_DUMP_KEY ].key?( object.object_id )\n\t\t\t\treturn %Q{<a href=\"#object-%d\" class=\"cache-link\" title=\"jump to previous details\">%s</a>} % [\n\t\t\t\t\tobject.object_id,\n\t\t\t\t\t%{→ %s #%d} % [ object.class.name, object.object_id ]\n\t\t\t\t]\n\t\t\telse\n\t\t\t\tThread.current[ THREAD_DUMP_KEY ][ object.object_id ] = true\n\t\t\tend\n\n\t\t\t# Assemble the innards as an array of parts\n\t\t\tparts = [\n\t\t\t\t%{<div class=\"object-header\">},\n\t\t\t\t%{<span class=\"object-class\">#{object.class.name}</span>},\n\t\t\t\t%{<span class=\"object-id\">##{object.object_id}</span>},\n\t\t\t\t%{</div>},\n\t\t\t\t%{<div class=\"object-body\">},\n\t\t\t]\n\n\t\t\tobject.instance_variables.sort.each do |ivar|\n\t\t\t\tvalue = object.instance_variable_get( ivar )\n\t\t\t\thtml = make_html_for_object( value )\n\t\t\t\tclasses = %w[instance-variable]\n\t\t\t\tif value.instance_variables.empty? && !value.respond_to?( :values_at )\n\t\t\t\t\tclasses << 'simple'\n\t\t\t\telse\n\t\t\t\t\tclasses << 'complex'\n\t\t\t\tend\n\t\t\t\tparts << IVAR_HTML_FRAGMENT % [ classes.join(' '), ivar, html ]\n\t\t\tend\n\n\t\t\tparts << %{</div>}\n\n\t\t\t# Make HTML class names out of the object's namespaces\n\t\t\tnamespaces = object.class.name.downcase.split(/::/)\n\t\t\tclasses = []\n\t\t\tnamespaces.each_index do |i|\n\t\t\t\tclasses << namespaces[0..i].join('-') + '-object'\n\t\t\tend\n\n\t\t\t# Glue the whole thing together and return it\n\t\t\treturn OBJECT_HTML_CONTAINER % [\n\t\t\t\tobject.object_id,\n\t\t\t\tclasses.join(\" \"),\n\t\t\t\tparts.join(\"\\n\")\n\t\t\t]\n\t\tend",
"title": ""
},
{
"docid": "af286103a88ffb3d22294e3302069860",
"score": "0.5308767",
"text": "def browse_otu_link(object)\n return nil if object.nil?\n otu = object.metamorphosize\n content_tag(:div, '', 'data-taxon-name' => object_tag(otu), 'data-redirect' => 'true', 'data-id' => otu.id, 'data-klass' => object.class.base_class.name.to_s, 'data-otu-button' => 'true')\n end",
"title": ""
},
{
"docid": "604d3129f03b40629e5920381308f2a0",
"score": "0.5306765",
"text": "def entity_links entities, options={}\n safe_join entities.collect { |entity|\n decorator = entity.decorate\n if options[:external]\n title = content_tag :strong, decorator.title\n title << \" on #{decorator.site.name}\" unless (entity.is_a?(Site)) || (entity.is_a?(PageRef) && entity.site?)\n link_to title, decorator.url, target: :_blank\n else\n homelink decorator # link_to_submit title, linkpath(decorator), :mode => (options[:mode] || :partial)\n end\n }, (options[:joinstr] || ', ').html_safe\n end",
"title": ""
},
{
"docid": "7fe722cc1b1d5fd91075737a41b03af5",
"score": "0.5272424",
"text": "def mtm_edit_remove(assoc, mc, obj, assoc_obj)\n t = String.new\n t << \"<li>\"\n t << association_link(mc, assoc_obj)\n form_attr = form_attributes(:action=>url_for(\"mtm_update/#{model.primary_key_value(obj)}?association=#{assoc}&remove%5b%5d=#{model.primary_key_value(assoc_obj)}&redir=edit\"), :method=>'post', :class => 'mtm_remove_associations', 'data-add'=>\"#add_#{assoc}\")\n t << Forme.form(form_attr, form_opts(form_attr[:action])) do |f|\n f.button(:value=>'Remove', :class=>'btn btn-xs btn-danger')\n end\n t << \"</li>\"\n end",
"title": ""
},
{
"docid": "3f878be04207886509465e6e33a7013c",
"score": "0.52675563",
"text": "def habtm_ajax_associations\n filename = (@scaffold_class.scaffold_habtm_ajax_path || controller.scaffold_path(\"habtm_ajax\"))\n controller.send(:render_to_string, {:file=>filename, :layout=>false}) if File.file?(filename)\n end",
"title": ""
},
{
"docid": "463ce7c9cb9e13b4b694fbed2648a295",
"score": "0.52675337",
"text": "def eds_html_fulltext_link(options = nil)\n values, opt = extract_config_value(options)\n result = Array.wrap(values).reject(&:blank?)\n return unless result.present? && (doc = opt[:document])\n label = I18n.t('ebsco_eds.links.view', default: 'View')\n url =\n url_for(\n controller: Blacklight::Lens.key_for_doc(doc),\n action: :show,\n id: doc.id,\n anchor: FULL_TEXT_ANCHOR\n )\n make_eds_link(label: label, url: url)\n end",
"title": ""
},
{
"docid": "f39ab1604e69cdf4200b1c988d1c5740",
"score": "0.5237743",
"text": "def link_markup(descr = nil)\n descr = \"View resource.\" if descr == nil\n\n link = @reference_action_def.doi\n link = @reference_action_def.link if link.empty?\n return \"<a href=\\\"#{link}\\\" target=\\\"_blank\\\">#{descr}</a>\"\n end",
"title": ""
},
{
"docid": "79946220aef4056e4c53d6b06eab9b85",
"score": "0.5237068",
"text": "def authorized_only_link_to(obj, name, options = {}, html_options = nil)\n if obj.collaborable? || obj.user == current_user\n \" | \" + link_to(name, options, html_options)\n else\n \"\" #link_to_function name, '권한이 없습니다.'\n end\n end",
"title": ""
},
{
"docid": "2a6c05567653bd15d363abe9fd061bc7",
"score": "0.52241606",
"text": "def make_html_for_object( object )\n\t\t\treturn object.html_inspect if \n\t\t\t\tobject.respond_to?( :html_inspect ) && ! object.is_a?( HtmlInspectableObject )\n\t\t\tobject_html = []\n\n\t\t\tcase object\n\t\t\twhen Hash\n\t\t\t\tobject_html << \"\\n<!-- Hash -->\\n\"\n\t\t\t\tif object.empty?\n\t\t\t\t\tobject_html << '{}'\n\t\t\t\telse\n\t\t\t\t\tobject_html << HASH_HTML_CONTAINER % [\n\t\t\t\t\t\tobject.collect {|k,v|\n\t\t\t\t\t\t\tpairclass = v.instance_variables.empty? ? \n\t\t\t\t\t\t\t\t\"simple-hash-pair\" :\n\t\t\t\t\t\t\t\t\"complex-hash-pair\"\n\t\t\t\t\t\t\tHASH_PAIR_HTML % [\n\t\t\t\t\t\t\t\tpairclass,\n\t\t\t\t\t\t\t\tmake_html_for_object(k),\n\t\t\t\t\t\t\t\tmake_html_for_object(v),\n\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\tend\n\n\t\t\twhen Array\n\t\t\t\tobject_html << \"\\n<!-- Array -->\\n\"\n\t\t\t\tif object.empty?\n\t\t\t\t\tobject_html << '[]'\n\t\t\t\telse\n\t\t\t\t\tobject_html << ARRAY_HTML_CONTAINER % [\n\t\t\t\t\t\tobject.collect {|o| make_html_for_object(o) }.join('</li><li>')\n\t\t\t\t\t]\n\t\t\t\tend\n\n\t\t\telse\n\t\t\t\tif object.instance_variables.empty?\n\t\t\t\t\treturn IMMEDIATE_OBJECT_HTML_CONTAINER %\n\t\t\t\t\t\t[ HTMLUtilities.escape_html(object.inspect) ]\n\t\t\t\telse\n\t\t\t\t\tobject_html << make_object_html_wrapper( object )\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn object_html.join(\"\\n\")\n\t\tend",
"title": ""
},
{
"docid": "92d105a7e9b11fcc86af9a0dc1ed75e7",
"score": "0.5221882",
"text": "def make_html_for_object( object )\n\t\t\treturn object.html_inspect if \n\t\t\t\tobject.respond_to?( :html_inspect ) && ! object.is_a?( HtmlInspectableObject )\n\t\t\tobject_html = []\n\n\t\t\tcase object\n\t\t\twhen Hash\n\t\t\t\tobject_html << \"\\n<!-- Hash -->\\n\"\n\t\t\t\tif object.empty?\n\t\t\t\t\tobject_html << '{}'\n\t\t\t\telse\n\t\t\t\t\tobject_html << HASH_HTML_CONTAINER % [\n\t\t\t\t\t\tobject.collect {|k,v|\n\t\t\t\t\t\t\tpairclass = v.instance_variables.empty? ? \n\t\t\t\t\t\t\t\t\"simple-hash-pair\" :\n\t\t\t\t\t\t\t\t\"complex-hash-pair\"\n\t\t\t\t\t\t\tHASH_PAIR_HTML % [\n\t\t\t\t\t\t\t\tpairclass,\n\t\t\t\t\t\t\t\tmake_html_for_object(k),\n\t\t\t\t\t\t\t\tmake_html_for_object(v),\n\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\tend\n\n\t\t\twhen Array\n\t\t\t\tobject_html << \"\\n<!-- Array -->\\n\"\n\t\t\t\tif object.empty?\n\t\t\t\t\tobject_html << '[]'\n\t\t\t\telse\n\t\t\t\t\tobject_html << ARRAY_HTML_CONTAINER % [\n\t\t\t\t\t\tobject.collect {|o| make_html_for_object(o) }.join('</li><li>')\n\t\t\t\t\t]\n\t\t\t\tend\n\n\t\t\telse\n\t\t\t\tif object.instance_variables.empty?\n\t\t\t\t\treturn IMMEDIATE_OBJECT_HTML_CONTAINER % \n\t\t\t\t\t\t[ HTMLUtilities.escape_html(object.inspect) ]\n\t\t\t\telse\n\t\t\t\t\tobject_html << make_object_html_wrapper( object )\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn object_html.join(\"\\n\")\n\t\tend",
"title": ""
},
{
"docid": "0736d8bbf9188006a46c868a66e41dcc",
"score": "0.5214375",
"text": "def add_fields_link(name, f, association)\n if (name == nil or name == \"\" or f == nil or association == nil or association == \"\")\n return false\n end\n \n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n metarows = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize + \"_fields\", f: builder)\n end\n link_to(name, '#', class: \"add_fields btn btn-primary\", data: {id: id, metarows: metarows.gsub(\"\\n\", \"\")})\n \n #return true #gets displayed in view\n end",
"title": ""
},
{
"docid": "9c65cb402e922027bb5d2cfe17ed57a7",
"score": "0.52084625",
"text": "def link_to_add_fields(name, form, association, this = nil)\n new_object = form.object.send(association).klass.new\n id = new_object.object_id\n\n fields = form.fields_for(association, new_object, child_index: id) do |builder|\n render(\"admin/partials/\" + association.to_s.singularize + \"_fields\", f: builder, resource: this)\n end\n\n link_to(name, \"#\", class: \"add-fields\", data: { id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "dad8bd07f1cbdc10e5e2936ea676ce2a",
"score": "0.51961154",
"text": "def display_all_links_attributes\n # Interface method\n end",
"title": ""
},
{
"docid": "3e6ce0493940e6ad0cbbf8fbb1a3241f",
"score": "0.51933056",
"text": "def link(*args, &block)\r\n name, options = args.shift, args.extract_options!\r\n\r\n if association_name = args.shift\r\n association = model.reflect_on_association association_name\r\n\r\n if association.nil?\r\n raise Error, \"#{model} has no association `#{association_name}'\"\r\n end\r\n\r\n class_eval <<CODE, __FILE__, __LINE__ + 1\r\ndef #{name}\r\n unless attributes.has_key?(:#{name})\r\n raise Restful::Resource::Base::UnknownAttributeError,\r\n \"unknown attribute for version \\#{version}: #{name}\"\r\n end\r\n\r\n Restful::Resource::AssociationProxy.new self, :#{association_name}, :#{name}\r\nend\r\nCODE\r\n elsif association_name == false\r\n attribute name, false, options\r\n return\r\n else\r\n association = model.reflect_on_association(association_name = name)\r\n end\r\n\r\n if association\r\n versions[@version][:associations] ||= {}\r\n versions[@version][:associations][name] = association_name\r\n\r\n if query_template && query_template !~ /include/\r\n self.query_template = query_template.gsub /\\}/, \",include}\"\r\n end\r\n end\r\n\r\n case name\r\n when nil, self, :href\r\n if block_given?\r\n attribute :href, options, &block\r\n else\r\n instance_eval <<CODE, __FILE__, __LINE__ + 1\r\nattribute :href, options do\r\n resources_#{self.name.demodulize.underscore}_path(resource, format)\r\nend\r\nCODE\r\n end\r\n when false\r\n attribute :href, false, options\r\n else # when Symbol\r\n if block_given?\r\n attribute name, options, &block\r\n elsif association\r\n model = begin\r\n association.klass\r\n rescue NameError => e\r\n \"nil\"\r\n end\r\n\r\n if association.macro.to_s =~ /^(?:belongs_to|has_one)$/\r\n instance_eval <<CODE, __FILE__, __LINE__ + 1\r\nattribute name, options do\r\n if resource.#{association_name}\r\n klass = Restful::Resource.class_for_model(#{model})\r\n\r\n path = if klass\r\n send \"resources_\\#{klass.name.demodulize.underscore}_path\",\r\n resource.#{association_name}, format\r\n else\r\n polymorphic_path [:resources, resource.#{association_name}],\r\n :format => format\r\n end\r\n\r\n query_template = if options[:query_template]\r\n options[:query_template]\r\n elsif klass\r\n klass.query_template(version).to_s\r\n else\r\n DEFAULT_COLLECTION_QUERY_TEMPLATE\r\n end\r\n\r\n path + query_template\r\n end\r\nend\r\nCODE\r\n else # :has_many\r\n path = self.name.demodulize.underscore\r\n instance_eval <<CODE, __FILE__, __LINE__ + 1\r\nattribute name, options do\r\n query_template = if options[:query_template]\r\n options[:query_template]\r\n elsif klass = Restful::Resource.class_for_model(#{model})\r\n klass.query_template(version).to_s\r\n else\r\n DEFAULT_COLLECTION_QUERY_TEMPLATE\r\n end\r\n\r\n #{name}_resources_#{path}_path(resource, format) + query_template\r\nend\r\nCODE\r\n end\r\n else\r\n instance_eval <<CODE, __FILE__, __LINE__ + 1\r\nattribute name, options do\r\n polymorphic_path [:#{name}, :resources, resource], :format => format\r\nend\r\nCODE\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "fed4d691431807771df391f60dd0b151",
"score": "0.5192907",
"text": "def edit_link(resource, *args)\n link = ''.html_safe\n\n resource_name = normalized_resource_name(resource)\n object = determine_proper_resource(resource)\n options = args.first || {}\n\n # CSS classes for this crud link\n crud_link_css(options, 'edit')\n # text to be displayed\n link_text = crud_link_text(options, 'edit')\n\n # (optional) add a tooltip to the link\n if options.keys.include?(:tooltip)\n add_tooltip(options)\n end\n\n options[:id] = 'edit-' + link_id(object)\n options[:title] = 'Edit this ' + resource_name\n\n case true\n when defined? CanCan\n if resource.is_a?(Array)\n # check if we can access directly via a shallow route\n begin\n if url_for([:edit, object])\n link += link_to link_text, url_for([:edit, object]), options if can?(:edit, object)\n else\n link += link_to link_text, url_for(resource.unshift(:edit)), options if can?(:edit, object)\n end\n rescue Exception => e\n link += link_to link_text, url_for(resource.unshift(:edit)), options if can?(:edit, object)\n end\n else\n link += link_to link_text, url_for([:edit, resource]), options if can?(:edit, object)\n end\n else\n if resource.is_a?(Array)\n # check if we can access directly via a shallow route\n begin\n if url_for([:edit, object])\n link += link_to link_text, url_for([:edit, object]), options\n else\n link += link_to link_text, url_for(resource.unshift(:edit)), options\n end\n rescue Exception => e\n link += link_to link_text, url_for(resource.unshift(:edit)), options\n end\n else\n link += link_to link_text, url_for([:edit, resource]), options\n end\n end\n\n link\n end",
"title": ""
},
{
"docid": "081f69cfaddc81cda1239b234b8bb9e0",
"score": "0.51859564",
"text": "def get_linked_full_name\n h.link_to( get_full_name, meeting_show_full_path(id: object.id), { 'data-toggle'=>'tooltip', 'title'=>I18n.t('meeting.show_results_tooltip') } )\n end",
"title": ""
},
{
"docid": "840ff2430477d0c8d112106f80fde3d5",
"score": "0.51496595",
"text": "def link_to_add_fields(name, association, *args)\n options = args.extract_options!\n\n new_object = object.class.reflect_on_association(association).klass.new\n fields = fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n @template.render(association.to_s.singularize + \"_fields\", :f => builder)\n end\n\n options.merge!(:class => \"add_fields btn\", :data => { :association => association, :content => CGI::escapeHTML(fields.gsub(/\\t|\\n|\\r/, \"\")) })\n @template.link_to(name, \"#\", options)\n end",
"title": ""
},
{
"docid": "5a769bcbe3d4366b9cf9081ec223ba8b",
"score": "0.5149131",
"text": "def html(args = nil)\n if args and args[:edit]\n url = self.url_edit\n else\n url = self.url\n end\n\n return \"<a href=\\\"#{Knj::Web.ahref_parse(url)}\\\">#{self.name_html}</a>\"\n end",
"title": ""
},
{
"docid": "ff15b6ce0b93199c5fe0739c7d95c5e9",
"score": "0.5126454",
"text": "def call_for_detail(entity, text, options = {}, html_options = {})\n text ||= \"...\"\n opt = options.dup\n opt[:controller] = options[:force_controller] || entity.controller_name\n opt[:action] = options[:force_action] || \"show\"\n opt[:id] = options[:force_id] || entity.to_param\n opt[:background_params] = @background_params\n if html_options[:popup] || html_options[:target]\n # for the case of new window to render\n opt[:layout] ||= \"base_layout_for_non_collection\"\n end\n link_to text, opt, html_options\n end",
"title": ""
},
{
"docid": "d909c592318f202a57421d2854ef7179",
"score": "0.51127225",
"text": "def relationship_tag(rel_attr); end",
"title": ""
},
{
"docid": "6448786d9ba4dff221faca820083a3d3",
"score": "0.5109068",
"text": "def view_edit_link(user, attraction)\n if user.admin\n content_tag(:p, link_to(\"Edit Attraction\", edit_attraction_path(attraction)))\n end\n end",
"title": ""
},
{
"docid": "aa76c0ca1393dfcb58f0f060a9db21de",
"score": "0.5105384",
"text": "def generate_html\n \"<a href='../#{@parent.reference_location}'><img src='../#{@reference_location}' /></a>\"\n end",
"title": ""
},
{
"docid": "aee6e83f3daee0c6fcba3fba3ed109d9",
"score": "0.5103943",
"text": "def email_link_to(obj)\n link_to(\"#{obj.name? ? h(obj.name) : h(obj.email)}\", \"mailto:#{h(obj.email)}\")\n end",
"title": ""
},
{
"docid": "9d0c3ae31da3d2621eab89f81298d2aa",
"score": "0.5091861",
"text": "def mokio_preview_link_in_edit_page\n self.path\n end",
"title": ""
},
{
"docid": "ee00a581fbc30e48e26a5ba8708d18b8",
"score": "0.5085701",
"text": "def add_oauth_partial_links\n template \"views/users/shared/_link.html.slim\", \"app/views/users/shared/_link.html.slim\"\n puts 'Check your app/views/users/shared/_link.html.slim to custom the OAuth links'.colorize(:light_green)\n end",
"title": ""
},
{
"docid": "c0a50c03da27d669e70613f0d249b68b",
"score": "0.508539",
"text": "def edit_link(obj)\n \tcase obj.class.to_s\n \t when \"Tenant\"\n \t edit_tenant_path(obj)\n \t when \"Semester\"\n \t edit_semester_path(obj)\n \t when \"Department\"\n \t edit_department_path(obj)\n \t when \"Subject\"\n \t edit_subject_path(obj) \t \n \t when \"Faculty\"\n \t edit_faculty_path(obj)\n \t when \"Exam\"\n \t edit_exam_path(obj)\n \t when \"Batch\"\n \t edit_batch_path(obj) \t \t \t \n \t when \"SchoolType\"\n \t edit_school_type_path(obj) \t \n \t when \"Student\"\n \t edit_student_path(obj) \t \t\n \t when \"Section\"\n \t edit_section_path(obj)\n \t when \"BloodGroup\"\n \t edit_blood_group_path(obj)\n \t when \"Resource\"\n \t edit_resource_path(obj)\n \t when \"Role\"\n \t edit_role_path(obj) \t \t \t\n \t when \"UserProfile\"\n \t edit_user_profile_path(obj) \n \t when \"Grade\"\n \t edit_grade_path(obj) \t \t \t \t \t \t \n \t when nil\n \t nil\n end\n end",
"title": ""
},
{
"docid": "cce455b70911be904d6125b35950589d",
"score": "0.50776356",
"text": "def map_link(display, object)\n\t if object.class == String\n\t address = object\n\t else\n\t event = object\n \t\taddress = event.address\n end\n\n # replace whitepace with +\n\t tmp_addy = address.gsub(/[ \\t\\r\\n\\v\\f]/, '+')\n\t google_maps_href = \"http://maps.google.com/maps?q=\"+tmp_addy\n\t return \"<a href=\\\"\" + google_maps_href + \"\\\" target=\\\"_blank\\\">\" + display + \"</a>\"\n end",
"title": ""
},
{
"docid": "8e6c7a8e6263ff0e451da98920299303",
"score": "0.506951",
"text": "def render_link_rel_alternates(document = @document, options = {})\n \"\"\n end",
"title": ""
},
{
"docid": "7d44e714134fbb667d90647f1d563b1c",
"score": "0.5065449",
"text": "def root_link(hash = {})\n if self.type =~ /associated:/\n root_document.link(hash)\n else\n if root_document\n # hash[:view_mode] == 'compiled' ? '' : root_document.link(hash)\n root_document.link(hash)\n else\n self.link(hash)\n end\n end\n end",
"title": ""
},
{
"docid": "1ce7dabce6305b4ced2b0834e7982bd7",
"score": "0.5059026",
"text": "def apphelp_protected_show_link( obj, name = nil )\n return apphelp_unknown_quantity_warning() if ( obj.nil? )\n\n name = obj.name if ( name.nil? )\n link = apphelp_protected_link_to(\n :show,\n {\n :model => obj.class,\n :method => :url_for\n },\n obj\n ) { h( name ) }\n\n return ( link.empty? ) ? h( name ) : link\n end",
"title": ""
},
{
"docid": "c9961e3e5edcbca3602163138fa2bb79",
"score": "0.50578374",
"text": "def render_issue_relations(issue, relations)\n manage_relations = User.current.allowed_to?(:manage_issue_relations, issue.project)\n s = ''.html_safe\n relations.each do |relation|\n other_issue = relation.other_issue(issue)\n css = \"issue hascontextmenu #{other_issue.css_classes}\"\n buttons =\n if manage_relations\n link_to(\n l(:label_relation_delete),\n relation_path(relation),\n :remote => true,\n :method => :delete,\n :data => {:confirm => l(:text_are_you_sure)},\n :title => l(:label_relation_delete),\n :class => 'icon-only icon-link-break'\n )\n else\n \"\".html_safe\n end\n buttons << link_to_context_menu\n s <<\n content_tag(\n 'tr',\n content_tag('td',\n check_box_tag(\n \"ids[]\", other_issue.id,\n false, :id => nil),\n :class => 'checkbox') +\n content_tag('td',\n relation.to_s(@issue) {|other|\n link_to_issue(\n other,\n :project => Setting.cross_project_issue_relations?)\n }.html_safe,\n :class => 'subject',\n :style => 'width: 50%') +\n content_tag('td', other_issue.status, :class => 'status') +\n content_tag('td', format_date(other_issue.start_date), :class => 'start_date') +\n content_tag('td', format_date(other_issue.due_date), :class => 'due_date') +\n content_tag('td', link_to_user(other_issue.assigned_to), :class => 'assigned_to') +\n content_tag('td',\n (if other_issue.disabled_core_fields.include?('done_ratio')\n ''\n else\n progress_bar(other_issue.done_ratio)\n end),\n :class=> 'done_ratio') +\n content_tag('td', buttons, :class => 'buttons'),\n :id => \"relation-#{relation.id}\",\n :class => css)\n end\n content_tag('table', s, :class => 'list issues odd-even')\n end",
"title": ""
},
{
"docid": "b3488c8943e5f15e0480db4521773fde",
"score": "0.5054142",
"text": "def link_object(obj, title = T.unsafe(nil), anchor = T.unsafe(nil), relative = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0d5d69184052ee316cd6c4d6db29a3c3",
"score": "0.5044091",
"text": "def content_htm\n link_to @options[:url], link_html_options do\n concat glyph_and_content_html\n concat badge_html if @options[:badge]\n end\n end",
"title": ""
},
{
"docid": "da470c48e5f150bb511eb6c3582bcd20",
"score": "0.50413334",
"text": "def scaffold_habtm_association_line_item(klass, association, record, associated_record)\n name = klass.scaffold_name\n associated_suffix = klass.scaffold_associated_name(association)\n arid = associated_record.scaffold_id\n rid = record.scaffold_id\n content = \"<li id='#{name}_#{rid}_#{association}_#{arid}'>\\n\"\n content << scaffold_check_link(klass.scaffold_associated_human_name(association), false, \"manage_#{associated_suffix}\")\n content << \" - \\n\"\n content << scaffold_check_link(associated_record.scaffold_name, false, \"edit_#{associated_suffix}\", :id=>arid)\n content << \"\\n\"\n content << scaffold_button_to_remote('Remove', \"remove_#{association}_from_#{name}\", :id=>rid, \"#{name}_#{association}_id\"=>arid)\n content << \"\\n</li>\\n\"\n content\n end",
"title": ""
},
{
"docid": "44b688a421b95afa91c2fea17631e592",
"score": "0.50384605",
"text": "def display_edit_link(blog)\n# is_blog_admin? ? \"|<a href='/manage/blogs/#{blog.id}/edit'>编辑</a>\" : ''\n end",
"title": ""
},
{
"docid": "023556728054f4ca290c39a61cacbeab",
"score": "0.50326526",
"text": "def js_for_has_many(assoc, form_block, template, new_record, class_string)\n class_string << ' has_many_fields_new'\n assoc_reflection = object.class.reflect_on_association assoc\n assoc_name = assoc_reflection.klass.model_name\n placeholder = \"NEW_#{assoc_name.to_s.underscore.upcase.gsub(/\\//, '_')}_RECORD\"\n\n opts = {\n for: [assoc, assoc_reflection.klass.new],\n class: class_string,\n for_options: { child_index: placeholder }\n }\n\n html = template.capture{ inputs_for_nested_attributes opts, &form_block }\n text = new_record.is_a?(String) ? new_record : I18n.t('active_admin.has_many_new', model: assoc_name.human)\n\n template.link_to '#', class: 'button has_many_add', data: {html: CGI.escapeHTML(html).html_safe, placeholder: placeholder} do\n template.content_tag :span, text\n end \n end",
"title": ""
},
{
"docid": "935aa295161af91bec596d3c871b7a51",
"score": "0.50308436",
"text": "def text_and_link\n return [@id_value, @id_value] if http_url?\n\n [reference_form, \"#{@resolver_prefix}#{bare_id}\"]\n end",
"title": ""
},
{
"docid": "df74d10f6fc012c641c1308b63ed4ed7",
"score": "0.50292784",
"text": "def scaffold_associated_objects(association, object, options)\n object.send(association,:order => get_ordering_options(scaffold_select_order_association(association)))\n end",
"title": ""
},
{
"docid": "24b3a7616f8aefe5c12243618599d33d",
"score": "0.5026002",
"text": "def edit_post_link(obj)\n if logged_in? && (obj.creator == current_user || current_user.admin?)\n link_to edit_post_path(obj), title: 'Edit Post', :'data-toggle' => 'tooltip' do\n content_tag :small do\n content_tag :span, '', class: 'glyphicon glyphicon-pencil', :'aria-hidden' => true\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9456d5be4567efcacbf58ff206baba3f",
"score": "0.50175977",
"text": "def add_iform_link(name, id, obj, locals={})\n link_to_function name do |page|\n page.insert_html :bottom, id, :partial => 'iform', :object => obj, :locals => locals\n end\n end",
"title": ""
},
{
"docid": "8d30224f862cfaaa1662105264c36692",
"score": "0.5013081",
"text": "def render_object(o, collection_name, edit)\r\n underscored_name = underscore(demodulize(o.class.name))\r\n template = File.expand_path(File.dirname(__FILE__) + \"/../views/project/_#{underscored_name}.rhtml\")\r\n if(File.exist?(template))\r\n render_partial(underscored_name, o)\r\n else\r\n r = \"<table>\\n\"\r\n o.__attr_accessors.each do |attr_name|\r\n attr_anns = o.class.send(attr_name[1..-1])\r\n if(attr_anns && attr_anns[:description])\r\n # Only render attributes with :description annotations\r\n attr_value = o.instance_variable_get(attr_name)\r\n r << \" <tr>\\n\"\r\n r << \" <td width='25%'>#{attr_anns[:description]}</td>\\n\"\r\n html_value = text_or_input(edit, :name => \"#{collection_name}[#{o.class.name}][#{attr_name}]\", :value => attr_value)\r\n r << \" <td width='75%'>#{html_value}</td>\\n\"\r\n r << \" </tr>\\n\"\r\n end\r\n end\r\n # workaround for RoR bug. 'hash' form params must have at least one value.\r\n r << \"<tr><td></td><td><input type='hidden' name='#{collection_name}[#{o.class.name}][__dummy]' /></td></tr>\" if o.instance_variables.empty?\r\n\r\n r << \"</table>\"\r\n r\r\n end\r\n end",
"title": ""
},
{
"docid": "688ed42287aad9f8440008009913e5b1",
"score": "0.5008814",
"text": "def add_medium_link(opts)\n unless opts.keys.include?(:object) || \n opts.keys.include?(:context)\n raise \"Must give object and context\" \n end\n klass = opts[:object].class.to_s.underscore\n opts[:text]||= I18n.t('add_link', \n :medium_label => I18n.t(opts[:context], :scope => [:activerecord, :attributes, klass]),\n :scope => [:has_media, :form])\n link_to_function opts[:text] do |page| \n page.insert_html :bottom, generate_uid(\n :object => opts[:object], \n :context => opts[:context]\n ), \n :partial => 'has_media/medium_field', \n :locals => {\n :object => opts[:object], \n :context => opts[:context]\n }\n end \n end",
"title": ""
},
{
"docid": "6d89947fe843d13b9c73f2e728290524",
"score": "0.5005798",
"text": "def link_menu(resource, options={})\n html= ' '\n if permitted_to? :index, table_symbol_from(resource) then\n if resource.is_a? Symbol then\n model_plural = resource.to_s\n else\n model= singular_table_name_from( resource).pluralize \n end\n a = link_to(tmenu(model_plural), eval(model_plural + \"_path\"), options) \n html = wrap_in_html_container a, 'li', 'menuItem'\n end\n #ebugger\n return html.html_safe\n end",
"title": ""
},
{
"docid": "c6e18624ae24a2ed346d4eccb73fc3dc",
"score": "0.5005336",
"text": "def display_link_attributes(link)\n # Interface method\n end",
"title": ""
},
{
"docid": "fff1bb76d10a2183c7fcb4ae833919f5",
"score": "0.5004823",
"text": "def manage_link\n \"<br />#{link_to(\"Manage #{@scaffold_plural_name.humanize.downcase}\", :action => \"manage#{@scaffold_suffix}\")}\" if @scaffold_methods.include?(:manage)\n end",
"title": ""
},
{
"docid": "e6e21a0d358e2f145221517ec3145f5f",
"score": "0.50028867",
"text": "def render_link_rel_alternates(document=@document, options = {})\n return if document.nil?\n presenter(document).link_rel_alternates(options)\n end",
"title": ""
},
{
"docid": "c9d4920288b70e4a9b9d7cf6f677c671",
"score": "0.499875",
"text": "def link_to_add_fields(name=nil, ff=nil, association=nil, options=nil,\n html_options=nil, attributes={}, &block)\n # If a block is provided there is no name attribute and the arguments are\n # shifted with one position to the left. This re-assigns those values.\n f, association, options, html_options = name, ff, association, options if block_given?\n\n options ||= {}\n html_options ||= {}\n\n locals = options[:locals] || {}\n partial = options[:partial] || association.to_s.singularize + '_fields'\n\n # Render the form fields from a file with the association name provided\n new_object = ff.object.class.reflect_on_association(association).klass.new(attributes)\n fields = ff.fields_for(association, new_object, child_index: 'new_record') do |builder|\n render(partial, locals.merge!( ff: builder))\n end\n\n # The rendered fields are sent with the link within the data-form-prepend attr\n html_options['data-form-prepend'] = raw CGI::escapeHTML( fields )\n html_options['href'] = '#'\n\n content_tag(:a, name, html_options, &block)\n end",
"title": ""
},
{
"docid": "d1617df2518316086f10eed2b8d79cd7",
"score": "0.49949574",
"text": "def show\n @object = referenced_object\n @attribute = params[:attribute]\n @form_element = params[:form_element]\n close = params[:close] || false\n if @form_element == \"associated\"\n @sub_id = params[:sub_id]\n if @sub_id.to_i > 0\n @associated_record_id = @object.send(@attribute.to_s.singularize + \"_ids\").index(@sub_id.to_i)\n @associated_record = @object.send(@attribute)[@associated_record_id]\n end\n end\n if @form_element == \"has_one\"\n @associated_record = @object.send(@attribute)\n @associated_record_id = @associated_record.id\n end\n @update_span = params[:update]\n if @attribute.nil?\n respond_to do |format|\n @attributes = @object.inline_forms_attribute_list\n if close\n format.js { render :close }\n else\n format.js { }\n end\n end\n else\n respond_to do |format|\n format.html { } unless @Klass.not_accessible_through_html?\n format.js { render :show_element }\n end\n end\n end",
"title": ""
},
{
"docid": "61171345f2079ff0222740f059918529",
"score": "0.49947146",
"text": "def link_to_add_ingest_association(f, association)\n group = association.to_s.singularize\n label = I18n.t(\"ingest_form.#{group}.add\", :default => \"Add #{group}\")\n html = %Q|<span class=\"sr-only\">#{label}</span><i class=\"icon-plus icon-white\"></i>|\n return link_to_add_association(raw(html), f, association,\n :class => \"btn btn-success\",\n :title => label,\n :partial => \"ingest/ingest_fields\"\n )\n end",
"title": ""
},
{
"docid": "7658d9b2a5abbbf554dd11fd289b0700",
"score": "0.499114",
"text": "def link_to_related_project(object)\n url = \"/projects/\"\n rp = related_project(object)\n url << rp.id.to_s unless rp.nil?\n end",
"title": ""
},
{
"docid": "390b4a7e7071613910062e7116d21206",
"score": "0.49817324",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize + \"_partial\", f: builder)\n end\n link_to(name, '#', class: \"add_fields\", data: {id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "14ab3e05b4dd230fbd2916cdb09ef112",
"score": "0.4966101",
"text": "def crud_links_for_nested_resource(model, nested_model, model_instance_name, nested_model_instance_name, actions, args={})\n _html = \"\"\n if use_crud_icons\n if actions.include?(:show)\n _html << eval(\"link_to image_tag('/images/icons/view.png', :class => 'crud_icon'), #{model_instance_name}_#{nested_model_instance_name}_path(model, nested_model), :title => 'View'\")\n end\n \n if actions.include?(:edit)\n _html << eval(\"link_to image_tag('/images/icons/edit.png', :class => 'crud_icon'), edit_#{model_instance_name}_#{nested_model_instance_name}_path(model, nested_model), :title => 'Edit'\")\n end\n \n if actions.include?(:delete)\n _html << eval(\"link_to image_tag('/images/icons/delete.png', :class => 'crud_icon'), #{model_instance_name}_#{nested_model_instance_name}_path(model, nested_model), :method => :delete, :confirm => 'Are you sure? This action cannot be undone.', :title => 'Delete'\")\n end\n end\n _html\n end",
"title": ""
},
{
"docid": "792c5747253fc960fd04ff6efc18db5c",
"score": "0.4964575",
"text": "def link\n object[\"link\"]\n end",
"title": ""
},
{
"docid": "3bf6a175f913b5d4bf200b6d44a48292",
"score": "0.49549884",
"text": "def admin_display_value(object, attribute, value)\n config = object.class.admin_attributes[attribute]\n return value.to_s unless config&.has_key?(:model)\n\n model_name = config[:model_name]\n unless model_name\n association = object.class.reflect_on_association(attribute)\n return value.to_s unless association\n\n model_name = association.class_name.underscore\n end\n\n link_to(value.to_s,\n admin_item_path(model: model_name, id: value.to_param))\n end",
"title": ""
},
{
"docid": "750ba7284eb8b2676769931f9e8974c1",
"score": "0.49515858",
"text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end",
"title": ""
},
{
"docid": "750ba7284eb8b2676769931f9e8974c1",
"score": "0.49515858",
"text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end",
"title": ""
},
{
"docid": "2b1d139ce7618e23d6e9c5ba62fcc8aa",
"score": "0.49490127",
"text": "def render_belongs_to(profile)\n context = @context || params[:context] || \"network\"\n if profile.user_profile?\n return render_workgroup_link(profile.user.workgroup_user.workgroup, context) if profile.user and profile.user.workgroup_user and profile.user.workgroup_user.workgroup\n else\n return render_physician_links(profile.workgroup, context) if profile.workgroup\n end\n\n return \"\"\n end",
"title": ""
},
{
"docid": "645d92ad165fcbd2fb0a2f49ec86e82b",
"score": "0.49434045",
"text": "def links_for_render(options = {})\n out = links.dup\n\n # Handle autoroot\n if options[:autoroot] && out.map(&:key).exclude?(:root) && Gretel::Crumbs.crumb_defined?(:root)\n out.unshift *Gretel::Crumb.new(context, :root).links\n end\n\n # Set current link to actual path\n if options[:link_last_to_current_path] && out.any? && request\n out.last.url = request.fullpath\n end\n\n # Handle show root alone\n if out.size == 1 && !options[:display_single_fragment]\n out.shift\n end\n\n # Set last link to current\n out.last.try(:current!)\n\n out\n end",
"title": ""
},
{
"docid": "91f557860d389e8485837089efdcf2f8",
"score": "0.49342954",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render('shared/' + association.to_s.singularize + '_fields', f: builder)\n end\n link_to(name, '#', class: \"add_fields\", data: {id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "f94429a2300859c58913cbab50d55b5f",
"score": "0.49301562",
"text": "def get_linked_full_name_with_date\n h.link_to( \"#{get_full_name} (#{get_meeting_date})\", meeting_show_full_path(id: object.id), { 'data-toggle'=>'tooltip', 'title'=>I18n.t('meeting.show_results_tooltip') } )\n end",
"title": ""
},
{
"docid": "6eec077011249516f776270643b92a9f",
"score": "0.49287975",
"text": "def textilize(do_object_links=false)\n\n # This converts the \"_object blah_\" constructs into \"x{OBJECT id label}x\".\n # (The \"x\"s prevent Textile from interpreting the curlies as style info.)\n if do_object_links\n check_name_links!\n check_other_links!\n check_our_images!\n end\n\n # Let Textile munge the thing up now.\n replace(RedCloth.new(self).to_html)\n\n # Remove pre-existing links first, replacing with \"<XXXnn>\".\n hrefs = []\n gsub!(/(<a[^>]*>.*?<\\/a>|<img[^>]*>)/) do |href|\n if do_object_links\n href = href.gsub(/\n x\\{([A-Z]+) \\s+ ([^\\{\\}]+?) \\s+\\}\\{\\s+ ([^\\{\\}]+?) \\s+\\}x\n /x, '\\\\2')\n end\n hrefs.push(href)\n \"<XXX#{hrefs.length - 1}>\"\n end\n\n # Now turn bare urls into links.\n gsub!(/([a-z]+:\\/\\/([^\\s<>]|<span class=\"caps\">[A-Z]+<\\/span>)+)/) do |url|\n url1 = url.gsub(/<span class=\"caps\">([A-Z]+)<\\/span>/, '\\\\1')\n extra = url1.sub!(/([^\\w\\/]+$)/, '') ? $1 : ''\n url2 = ''\n if url1.length > URL_TRUNCATION_LENGTH and not url1.starts_with?(HTTP_DOMAIN)\n if url1.match(/^(\\w+:\\/\\/[^\\/]+)(.*?)$/)\n url2 = $1 + '/...'\n else\n url2 = url1[0..URL_TRUNCATION_LENGTH] + '...'\n end\n else\n url2 = url1\n end\n url1.gsub!(/([ \"%<>\\\\])/) {URI_ESCAPE[$1]}\n \"<a href=\\\"#{url1}\\\">#{url2}</a>\" + extra\n end\n\n # Convert _object_ tags into proper links.\n if do_object_links\n gsub!(/\n x\\{([A-Z]+) \\s+ ([^\\{\\}]+?) \\s+\\}\\{\\s+ ([^\\{\\}]+?) \\s+\\}x\n /x) do |orig|\n type, label, id = $1, $2, $3\n id.gsub!(/([ \"%?=&<>\\\\])/) {URI_ESCAPE[$1]}\n url = \"#{HTTP_DOMAIN}/observer/lookup_#{type.downcase}/#{id}\"\n \"<a href=\\\"#{url}\\\">#{label}</a>\"\n end\n end\n\n # Make sure all links are fully-qualified.\n gsub!(/href=\"\\//, \"href=\\\"#{HTTP_DOMAIN}/\")\n\n # Put pre-existing links back in (removing the _object_ tag wrappers).\n gsub!(/<XXX(\\d+)>/) do\n hrefs[$1.to_i].to_s.gsub(/ x\\{ ([^\\{\\}]*) \\}x /x, '\\\\1')\n end\n\n return self\n end",
"title": ""
},
{
"docid": "afcafc1b5f143794f295a7c16d9c9da8",
"score": "0.4919443",
"text": "def link(from, to)\n to.parent = from.parent unless to.parent # HACK: to.parent may be nil\n href = from.parent.aref_to(to.path)\n to_parent = to.parent.full_name.dup\n if @options.show_hash\n text = from.parent.full_name == to_parent ? '' : to_parent\n text << (to.singleton ? '::' : '#') << to.name\n elsif from.parent.full_name == to_parent\n text = to.name.dup\n else\n text = to_parent\n text << (to.singleton ? '::' : '#') << to.name\n end\n %Q(<a href=\"#{href}\">#{h(text)}</a>)\n end",
"title": ""
}
] |
b49e47457e4f2a1bb6b8b0f3a5e7c39e
|
Returns true if the record has been approved.
|
[
{
"docid": "3e23dba3e09e59b8fa338831d348036e",
"score": "0.76644397",
"text": "def approved?\n approval_state.present? ? approval_state == 'approved' : approval.try(:approved?)\n end",
"title": ""
}
] |
[
{
"docid": "76a93390f8ce5597a6d54a7ea4b77768",
"score": "0.8208751",
"text": "def approved?\n status == STATUS_APPROVED\n end",
"title": ""
},
{
"docid": "58e65e0eeffcdff5d3de749bf8d81770",
"score": "0.7928196",
"text": "def approved?\n (status == APPROVED)\n end",
"title": ""
},
{
"docid": "8db3c6c72a29ecb4710d6cd7c34da4cb",
"score": "0.7843535",
"text": "def approved?\n if order_status == 'approved'\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "61563b4523661f289d6e8fe3e016b297",
"score": "0.7822896",
"text": "def approved?\n !self.pending\n end",
"title": ""
},
{
"docid": "f1144b89747ebaf37cd3cee1a0386dcd",
"score": "0.76574624",
"text": "def approved?\n !approved_on.nil?\n end",
"title": ""
},
{
"docid": "28eeb6b9f200b83c91f98d4512fad2ab",
"score": "0.76433164",
"text": "def approved?\n [ 'AUTHORISED' ].include? status\n end",
"title": ""
},
{
"docid": "c1bac55ba72171e155d5d4e4e405335d",
"score": "0.751655",
"text": "def is_approved?\n self.approved == 'approved'\n end",
"title": ""
},
{
"docid": "f73a4e76c6398afbde5b57fe8d853586",
"score": "0.7511379",
"text": "def approved?\n state == 'approved'\n end",
"title": ""
},
{
"docid": "0663cc97874e92bcbe150fe1e0be67a1",
"score": "0.74469596",
"text": "def approved?\n self.is_approved == true \n end",
"title": ""
},
{
"docid": "6958e3530f94d21a5d6a19fde8ed441b",
"score": "0.7404804",
"text": "def approved?\n (status == ConfigCenter::User::APPROVED)\n end",
"title": ""
},
{
"docid": "3301c1f14e41b0955328e4f55d2be1cb",
"score": "0.73798716",
"text": "def successful\n\t\t\t\tself.refunded == \"Approved\"\n\t\t\tend",
"title": ""
},
{
"docid": "e3e0a9bf59777dd5d85b0d78eebd10a5",
"score": "0.73184437",
"text": "def can_be_approved?\n self.applied?\n end",
"title": ""
},
{
"docid": "57e5bc40ff5be8cea434ed35eccce442",
"score": "0.71009",
"text": "def success?\n @status == \"APPROVED\"\n end",
"title": ""
},
{
"docid": "017dddb085578cc0d2b9fe2665b80a34",
"score": "0.7099026",
"text": "def approved?\n !pending\n end",
"title": ""
},
{
"docid": "755219dbfcae059323caa9a7858b21a9",
"score": "0.7062466",
"text": "def approved?\n return @approved unless @approved.nil?\n\n approving_users = self.approvals.map { |a| a.approved_by }\n\n unsatisfied = owners_contents.select do |owners|\n (owners & approving_users).empty?\n end\n\n @approved = unsatisfied.empty?\n @approved\n end",
"title": ""
},
{
"docid": "c8e0bf7915523c1e0ef9c099830a5c01",
"score": "0.70146066",
"text": "def approving_change?(approving)\n saved_instance = DesignChange.find(self.id) if self.id\n approving && (!saved_instance || !saved_instance.approved?)\n end",
"title": ""
},
{
"docid": "5d18cd119b88d005f05b90d281d6898d",
"score": "0.6849543",
"text": "def approved?\n !([STATE_UNKNOWN, STATE_BLOCK_REQUESTED, STATE_BLOCKED, STATE_APPROVAL_REQUESTED, STATE_UNAVAILABLE, STATE_CANCELLED, STATE_EXPIRED, STATE_AVAILABLE_EXPIRED].include?(self.state))\n end",
"title": ""
},
{
"docid": "d9ebca32f81664ef5b4048f4e9862ce0",
"score": "0.6835084",
"text": "def is_approved?\n level > Membership::LEVELS[:pending]\n end",
"title": ""
},
{
"docid": "952562cdbccb4192e3fa9e11e7862ba7",
"score": "0.6826868",
"text": "def has_an_approved_account_set?\n all_monetary_processor_accounts.was_verified.any?\n end",
"title": ""
},
{
"docid": "1fc0f0f8523531aef6bccb6e6328843a",
"score": "0.682673",
"text": "def approved?\n self.status == Task::Status::FINISHED\n end",
"title": ""
},
{
"docid": "1730ea92be1f67e845865e802c62fd4a",
"score": "0.6776805",
"text": "def approve(revision, options = {})\n result = post_path(path_to_approve(revision), options)\n (result['approved'] == true)\n rescue Tinybucket::Error::Conflict => e\n logger.debug 'Already approved: ' + e.inspect\n true\n end",
"title": ""
},
{
"docid": "7f3632e9370c17bd61bd11f76ad49262",
"score": "0.6742563",
"text": "def approve(revision, options = {})\n result = post_path(path_to_approve(revision), options)\n (result['approved'] == true)\n rescue Tinybucket::Error::Conflict => e\n logger.debug \"Already approved: #{e.inspect}\"\n true\n end",
"title": ""
},
{
"docid": "58fd746dde7e84e53e7ca5219acada47",
"score": "0.67301613",
"text": "def is_approval_required_for_add\n return @is_approval_required_for_add\n end",
"title": ""
},
{
"docid": "f2b04b69945815f3e733caf2ccaa299d",
"score": "0.6726276",
"text": "def approve?\n return false if user.blank?\n\n role = user.dominant_role\n\n return false unless record.in?(role.donations)\n\n latest_approval = record.approvals.order(:created_at).last\n\n if latest_approval.present?\n case latest_approval.approver\n when NationalFinanceHead then\n false\n when Fellow then\n role.is_a?(NationalFinanceHead)\n when Coach then\n role.class.in?([NationalFinanceHead, Fellow])\n else\n role.class.in?([NationalFinanceHead, Fellow, Coach])\n end\n else\n role.class.in?([NationalFinanceHead, Fellow, Coach])\n end\n end",
"title": ""
},
{
"docid": "05cd75968712d5a47585dea5794d39e0",
"score": "0.6724402",
"text": "def approved?\n activated_at || activation_code\n end",
"title": ""
},
{
"docid": "fabf226b316a321339de1b693efdc00b",
"score": "0.67180204",
"text": "def auto_approve?\n return user.auto_approve_comment?\n end",
"title": ""
},
{
"docid": "f2a8d13ba827f98e21729dd198ac05b2",
"score": "0.6717418",
"text": "def approve\n if @ad.mark_as_approved!\n render_success_message 'AD successfully approved!'\n else\n render_error_model @ad\n end\n end",
"title": ""
},
{
"docid": "e584dc781f7656429777c30e73544b96",
"score": "0.6705184",
"text": "def financial_aid_approved?\n !financial_aid_approved_at.blank?\n end",
"title": ""
},
{
"docid": "31b9ca82c630a19bca26414d5ec3831b",
"score": "0.66814023",
"text": "def approved?\n status_map = employee_vacation_responses.map(&:status).uniq\n status_map.size == 1 && status_map.include?(\"approved\")\n end",
"title": ""
},
{
"docid": "00ff5b453f42023ae0ea2284b69abef8",
"score": "0.66587895",
"text": "def is_approval_required_for_update\n return @is_approval_required_for_update\n end",
"title": ""
},
{
"docid": "45495a8225c6242985735dabf73c15a3",
"score": "0.66373974",
"text": "def isAdmissionApproved\n ad = Admission.where(student_id: student_id).first\n #ad = Admission.where(\"student_id = #{student_id}\").order(\"created_on DESC\").find(1)\n unless ad.step == \"Approved\" then\n errors.add(:student_id, \"- You must be approved in order to create a billing record.\")\n end\n end",
"title": ""
},
{
"docid": "b4c267d6d3d1e923fb6a5e110ccf2241",
"score": "0.6614049",
"text": "def is_approved?\n moderation_flag ? true : false\n end",
"title": ""
},
{
"docid": "b4c267d6d3d1e923fb6a5e110ccf2241",
"score": "0.6614049",
"text": "def is_approved?\n moderation_flag ? true : false\n end",
"title": ""
},
{
"docid": "a621bbcc70788bd8658f5048d1c0999a",
"score": "0.65876436",
"text": "def tracks_approved_version?\n column_names.include? 'approved_version_id'\n end",
"title": ""
},
{
"docid": "a621bbcc70788bd8658f5048d1c0999a",
"score": "0.65876436",
"text": "def tracks_approved_version?\n column_names.include? 'approved_version_id'\n end",
"title": ""
},
{
"docid": "8eb19b9be40bf381e880df60f7c13f0e",
"score": "0.6580513",
"text": "def reviewed?\n @status == :reviewed\n end",
"title": ""
},
{
"docid": "54fc5fe5010acac28f3103b2d4f28775",
"score": "0.6553826",
"text": "def approve?\n user && user.able_to?(:moderate_any_forum, record.forum)\n end",
"title": ""
},
{
"docid": "8cd023cfea671d1222f4c2c6a4c4a375",
"score": "0.6545248",
"text": "def can_update?\n if [\"approved\"].include? state\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "39088f0f64dfafb4977a67c6ab54260e",
"score": "0.65449697",
"text": "def isApproved?\n if self.approved\n flash[:warning] = \"Solution cannot be changed because it has final approval. You can Copy it and edit that one.\"\n redirect_to admin_project_quote_solution_path(solution.quote.project.id,solution.quote.id, solution.id)\n end\n end",
"title": ""
},
{
"docid": "984fdde32a833255153e99a2fe5c83fd",
"score": "0.65374607",
"text": "def approve!\n self.approved = true\n self.save\n end",
"title": ""
},
{
"docid": "54d16feb617f07f3c6b275d4dc88c4dc",
"score": "0.6488784",
"text": "def approvable?(obj)\n \tif is_pending?(obj.release_status)\n \t\tif is_section_head?\n \t\t\tif obj.uploader_role == 'Normal' && uploader_from_same_section(obj.uploaded_by_section)\n \t\t\t\ttrue\n \t\t\tend\n \t\telsif is_department_head?\n \t\t\tif obj.uploader_role == 'Sectionhead'\n \t\t\t\ttrue\n \t\t\tend\n \t\tend\n \tend\n end",
"title": ""
},
{
"docid": "2916570ae22802791b311bc310a43314",
"score": "0.64441276",
"text": "def can_approve?(target)\n is_staff? && target && target.active? && !target.approved?\n end",
"title": ""
},
{
"docid": "4ec5f85e5bfc57bb3c5ac33b1ad1b615",
"score": "0.6441125",
"text": "def is_approval_request\n return @is_approval_request\n end",
"title": ""
},
{
"docid": "850a3cd7e7d304277048bdc31fa0f14d",
"score": "0.640809",
"text": "def is_approved?\n (self.approved_feeds.count > 0) && ((self.pending_feeds.count + self.denied_feeds.count) == 0)\n end",
"title": ""
},
{
"docid": "18208db25b710f39b3270bc680ba9e92",
"score": "0.6405919",
"text": "def is_complete?\n return ApprovalState::COMPLETED_STATES.include? self.status.to_i\n end",
"title": ""
},
{
"docid": "c29733d9f7f94dd32a940bee09b0fb81",
"score": "0.638603",
"text": "def revokable?\n\t\tstatus == \"pending\" && created_at >= Donation.revoke_time.ago\n\tend",
"title": ""
},
{
"docid": "88ae75ef16d3329e99c8f284019f5b42",
"score": "0.63669294",
"text": "def is_submitted?\n begin\n data = @p4.fetch_change(\"-o\", @id)\n rescue\n end\n \n return false if data.nil? # Q: is it safe to remove this clause?\n return true if data[\"Status\"] == \"submitted\"\n return false\n end",
"title": ""
},
{
"docid": "e4734b741af338af4e2ae66b423807ad",
"score": "0.63633245",
"text": "def ready_to_submit?\n return self.new_record? == false && \\\n self.approvable.new_record? == false && \\\n self.mail_sent == false\n end",
"title": ""
},
{
"docid": "48659955ffca91c7873cb06bd60d053c",
"score": "0.6356007",
"text": "def auditor_verified?\n AUDITOR_COMPLETE_RESULTS.include?(self.auditor_result)\n end",
"title": ""
},
{
"docid": "fe028db3b57e819c94a33b2adc19aa45",
"score": "0.6353783",
"text": "def awaiting_financial_aid_approval?\n dean_approved? && !financial_aid_approved?\n end",
"title": ""
},
{
"docid": "0144c3ad17fc1f245fce383d98119660",
"score": "0.63508534",
"text": "def approved?\n closed? && has_met_requirement?\n end",
"title": ""
},
{
"docid": "33f7ec0a1f14cd779ea65ab954d6fbff",
"score": "0.6342921",
"text": "def approve\n if self.status == \"pending_presenter\" || self.status == \"pending_admin\"\n \n #move edit columns to permanent columns\n self.bio = self.bio_edit\n if self.picture_edit_stored?\n self.picture = self.picture_edit\n end\n\n #clear edit columns\n self.bio_edit = ''\n self.picture_edit = nil\n \n #update status to approved\n self.status = :approved\n return self.save\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "3259d413acae254af612e79c75967b71",
"score": "0.63352567",
"text": "def review_complete?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='Review Completed'\").id\n end",
"title": ""
},
{
"docid": "c77557ad433077a09dedaa4dc5a717ec",
"score": "0.63074064",
"text": "def money_approved?\n true\n end",
"title": ""
},
{
"docid": "894c78870d5f7ccc6c19f71b8bc0a735",
"score": "0.6293926",
"text": "def approvable?\n (!current_stage.nil? &&\n current_stage.stage.eql?('verify') &&\n current_stage.status.eql?('passed') &&\n !AutomateSoup.url.nil? &&\n !AutomateSoup.credentials.nil? &&\n !links.nil? &&\n !links['approve'].nil? &&\n !links['approve']['href'].nil?)\n end",
"title": ""
},
{
"docid": "2306f12fffe5e41cdf3e8b6c71167cc3",
"score": "0.62887126",
"text": "def approved\n @req = Request.last\n RequestMailer.approved(@req)\n end",
"title": ""
},
{
"docid": "efddc077113d3fa3da5a851a9072eb3a",
"score": "0.6285018",
"text": "def status_changed_to_approved_and_not_deleted?\n self.status_changed_to_approved? && !self.deleted?\n end",
"title": ""
},
{
"docid": "9cbe6dc5a24d458aa3445178c4308b0b",
"score": "0.6273216",
"text": "def active_for_authentication?\n # User is approved when harp_id is assigned.\n # Approved flag is set programmatically when harp_id is set by an admin.\n super && is_approved?\n end",
"title": ""
},
{
"docid": "bc12351d954529a93947e0750265ff42",
"score": "0.62606937",
"text": "def approved?(app)\n ApplicationPet.find_by(application_id: app.id, pet_id: id).status\n end",
"title": ""
},
{
"docid": "bb714ece3251c25076fe20818e992a6c",
"score": "0.6235089",
"text": "def editable?\n (status == STATUS_NOT_SUBMITTED || status == STATUS_DELETED)\n end",
"title": ""
},
{
"docid": "c2343a425fb974d8bb6257a09599c788",
"score": "0.6224474",
"text": "def payment_success?\n @fields['decision'] == 'ACCEPT'\n end",
"title": ""
},
{
"docid": "0e6b1f2f3e468e015d5fb27040085847",
"score": "0.61989737",
"text": "def approve()\n if update_attributes({:level => Membership::LEVELS[:regular]})\n true\n else\n reload\n false\n end\n end",
"title": ""
},
{
"docid": "6cd6dd8359760dc27818808a97b264aa",
"score": "0.61946386",
"text": "def is_complete?\n self.audit_state == AUDIT_COMPLETE\n end",
"title": ""
},
{
"docid": "35a7d0cae1868046ff25b0c62fbb26fc",
"score": "0.61941475",
"text": "def accepted?\n return listing.accepted_proposal_id == id\n end",
"title": ""
},
{
"docid": "876b7f2a627916191497812ce4971153",
"score": "0.61863697",
"text": "def ready_to_approve?\n status = self.units.map(&:unit_status) & ['condition', 'copyright', 'unapproved']\n return status.empty?\n end",
"title": ""
},
{
"docid": "d72f587e0880cf45bf1140e700ee55c0",
"score": "0.6184722",
"text": "def accepted?\n return (self.status == STATUS_ACCEPTED)\n end",
"title": ""
},
{
"docid": "74149643dda0f6a7c6e518de4c6a56df",
"score": "0.6169035",
"text": "def dean_approved?\n !approved_at.blank?\n end",
"title": ""
},
{
"docid": "fb9c54e1c100d8e40e6fcc846366d2fa",
"score": "0.6167708",
"text": "def active?\n name = self.review_status.name\n name == 'In Review' || name == 'Pending Repost' || name == 'Review On-Hold'\n end",
"title": ""
},
{
"docid": "16a97b52118b9275dc9b3017175e909b",
"score": "0.6158776",
"text": "def any_approved_loans?\n Applicant.where(email: @email, recommendation: Applicant::recommendations[:approve]).exists?\n end",
"title": ""
},
{
"docid": "6e560ca7fbdaf9103229ab371d4bfbe0",
"score": "0.61450624",
"text": "def to_be_performed?\n self.research_billing_qty > 0\n end",
"title": ""
},
{
"docid": "1b4e234f02d303ef7f7f1bcf00766c77",
"score": "0.61450446",
"text": "def is_approve\n order = current_user.customer.orders.find(params[:id])\n if order.status == \"Approved\"\n render json: {is_approve: true}\n elsif order.status == \"Declined\"\n render json: {is_approve: false}\n else\n render json: {is_approve: nil}\n end\n end",
"title": ""
},
{
"docid": "a80d46d3909e41922772c15f874d1951",
"score": "0.61307776",
"text": "def pending?\n !approved? && !not_approved?\n end",
"title": ""
},
{
"docid": "1a6d76d884e3091562a50abf714988c0",
"score": "0.612312",
"text": "def pending_manager_approval?\n @is_pending_manager_approval\n end",
"title": ""
},
{
"docid": "06ede001246c014b1d626821cf1141c4",
"score": "0.6120112",
"text": "def editable?\n (self.entry_ts.to_date == Date.today && self.billing_ref.blank?) || ![BILLED,PAID,CANCELLED].include?(self.status)\n end",
"title": ""
},
{
"docid": "3dd56accb34406d58033d45142874f82",
"score": "0.6109614",
"text": "def approval_status\n self.approved? ? 'Approved ' : 'Pending '\n end",
"title": ""
},
{
"docid": "2119442859390f5dfbd42e99b32b6a3a",
"score": "0.61086166",
"text": "def tracks_approved_version_history?\n column_names.include?('current_approved_version_id')\n end",
"title": ""
},
{
"docid": "36d4a21c9efe2d5ec50404d23d98eed8",
"score": "0.6085208",
"text": "def save\n self.approved = true\n super\n end",
"title": ""
},
{
"docid": "44074bab85d6f571c8a0d5b63912faf4",
"score": "0.607432",
"text": "def complete?\n status == \"verified\"\n end",
"title": ""
},
{
"docid": "a6c4406b83520a78809f390271a1a084",
"score": "0.60740364",
"text": "def editable_by_user?\n %w(new paid).include?(self.state)\n end",
"title": ""
},
{
"docid": "b051fd714dca9b1a010fc0c16c6fe499",
"score": "0.6052667",
"text": "def approve!\n update_attribute(:active, true)\n end",
"title": ""
},
{
"docid": "d988adcf5a8e1b6f34052490dc55aa2c",
"score": "0.60462326",
"text": "def verified?\n status.include?(success)\n end",
"title": ""
},
{
"docid": "f19d6d007a1a139913970a2442e01368",
"score": "0.6031058",
"text": "def submitted?\n self.status.to_i > status_enum['unsubmitted']\n end",
"title": ""
},
{
"docid": "181b2841ccca8f991ec561dcb7a478ff",
"score": "0.6029613",
"text": "def approval_requested?\n !([STATE_UNKNOWN, STATE_BLOCK_REQUESTED, STATE_BLOCKED, STATE_UNAVAILABLE, STATE_CANCELLED, STATE_EXPIRED, STATE_AVAILABLE_EXPIRED].include?(self.state))\n end",
"title": ""
},
{
"docid": "9b2834aac09b5cdf3ae26881ddb05725",
"score": "0.60117203",
"text": "def on_hold?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='Review On-Hold'\").id\n end",
"title": ""
},
{
"docid": "8b526e8db6fecb950654cc9bcdbb7864",
"score": "0.6007985",
"text": "def stale_approval?\n ActsAsApprovable.stale_check? and update? and stale?\n end",
"title": ""
},
{
"docid": "eb13c35eea8ea828e1157cc9037a3aa1",
"score": "0.5984322",
"text": "def is_approval_required_for_add=(value)\n @is_approval_required_for_add = value\n end",
"title": ""
},
{
"docid": "ce1083e467faf2e34b386be0ff97e9b7",
"score": "0.5980423",
"text": "def approve \n\t\t@complaint = Complaint.find(params[:id])\n\t\t@complaint.approved = 1\n\t\t#@birth.approved_on = Time.now.strftime\n\t\n\t\tif @complaint.update_attributes(params[:complaint])\n\t\t\tflash[:notice] = 'complaint Record successfully approved.'\n\t\t\tredirect_to :action => 'list'\n\t\telse\n\t\t\trender :action => 'show'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5f153d2d36f24cb2d89a7bd7c801d901",
"score": "0.5959526",
"text": "def verified?\n\t\t\t@verified\n\t\tend",
"title": ""
},
{
"docid": "efd86cef0cc1d226dbeffe856f4c4b10",
"score": "0.5959429",
"text": "def approve_user\n # set the enabled flag to true for the user\n # send out approval notification\n end",
"title": ""
},
{
"docid": "2d3093f0ddb9328f46112c3cfd7e07e5",
"score": "0.5958884",
"text": "def approve\n respond_to do |format|\n if @ad.update_as_approved_by(authed_user)\n format.html { redirect_to ops_ads_path, notice: 'Ad was successfully approved.' }\n format.json { render :show, status: :ok, location: ops_ads_path }\n else\n format.html { redirect_to edit_org_ad_path(@ad.org, @ad) }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d64c2df3169b11bb349fb6dd06ac6088",
"score": "0.5945685",
"text": "def release_on_approval\n super == 'true'\n end",
"title": ""
},
{
"docid": "3e6db848cebbefff4a7ed227220e02ca",
"score": "0.59361005",
"text": "def payable?\n %w(confirmed bookkept).include?(workflow_state)\n end",
"title": ""
},
{
"docid": "5808675f8f0f75378515ff9df0eb32bd",
"score": "0.5918418",
"text": "def advised?\n advisor_company_affiliations.with_access.present?\n end",
"title": ""
},
{
"docid": "9b1138a49a0e6d026cd18312719a9ad6",
"score": "0.59177023",
"text": "def claimed_records? \n @claimed_records || false\n end",
"title": ""
},
{
"docid": "271ee6bc53a49ac89b2e38016da86604",
"score": "0.5916707",
"text": "def active_for_authentication?\n super && self.approved?\n end",
"title": ""
},
{
"docid": "9f5c8e46d7812d7042f4dcd0da5aa17d",
"score": "0.5914997",
"text": "def approved\n\t\t@approves = Marriage.find(:all, :conditions => \"approved = 1\")\n \trespond_to do |format|\t\t\n \t\t format.html \n \t format.xml { render :xml => @approves }\t\t#Render to XML File\n format.pdf { send_data render_to_pdf({ :action => '', :layout => 'standard' }) }\n \tend\n\t\t\n\tend",
"title": ""
},
{
"docid": "0113f5c75ef7516190b2f06e7095a93d",
"score": "0.5913947",
"text": "def verified?\n @verified\n end",
"title": ""
},
{
"docid": "40797b42dddc82583160519b3397a7a7",
"score": "0.59110874",
"text": "def approve_writer(flag)\n if flag=='true' || flag==1\n self.wflag=true\n if self.save\n return true\n end\n else\n self.wflag=false\n self.save\n end\n end",
"title": ""
},
{
"docid": "4b3320945ef1c84055690dec22a490fc",
"score": "0.59105384",
"text": "def show?\n return true if user.admin? || is_in_company?(record)\n\n record.information_complete? ? true : false\n end",
"title": ""
},
{
"docid": "a36d7e00cdaaa70e0e7ae0122be83ef7",
"score": "0.59080964",
"text": "def just_reviewed?\n reviewed? and reviewed_changed?\n end",
"title": ""
}
] |
13d35d8fdeb8d57ce717aac59cb80b27
|
Instantiate the given middleware by name, on the spot, and call() it immediately
|
[
{
"docid": "876ef095f1b9343ae88ee2df57c74a58",
"score": "0.58218956",
"text": "def call(env)\n middleware_module = lookup_middleware_module\n app_wrapped_with_middleware = middleware_module.new(@app, *@args_for_middleware_new, &@block_for_middleware_new)\n app_wrapped_with_middleware.call(env) \n end",
"title": ""
}
] |
[
{
"docid": "d41c80410fc8662ca8cd4c59dc1f4665",
"score": "0.6822307",
"text": "def middleware(&block); end",
"title": ""
},
{
"docid": "3f35059e1fa6a00c17e6ed37a5946aaa",
"score": "0.6617553",
"text": "def middleware; end",
"title": ""
},
{
"docid": "e1f79978fd167cd9be81df7b4a38cf6d",
"score": "0.6511183",
"text": "def middleware=(_arg0); end",
"title": ""
},
{
"docid": "93ab989155f6647d4e59773b83e82815",
"score": "0.6511094",
"text": "def middleware(value = nil, &block)\n __define__(:middleware, value, block)\n end",
"title": ""
},
{
"docid": "cda226ff5ea7d8d5adb6e413e5ddacbd",
"score": "0.64876354",
"text": "def middleware(&block)\n @@middleware << block\n end",
"title": ""
},
{
"docid": "deb72269deca9ad6adc3c41c75db5472",
"score": "0.6484217",
"text": "def use ware, *args, &proc\n @middleware << {ware: ware, args: args, block: proc}\n self\n end",
"title": ""
},
{
"docid": "427e5e541215f78074874c78aff5c1db",
"score": "0.6408329",
"text": "def use ware, *args, &proc\n @middleware << {ware: ware, args: args, block: proc} if configurable?\n end",
"title": ""
},
{
"docid": "dac5c28ba80a7052dd6f2781662d176e",
"score": "0.6324538",
"text": "def use(middleware)\n @middlewares << middleware\n end",
"title": ""
},
{
"docid": "440780e0edd44e4eb8c33a4bb07977e5",
"score": "0.6323329",
"text": "def use(mware, *_args, &block)\n @middleware, @args, @block = mware, _args, block\n @name = @middleware if name.nil?\n if options[:before]\n raise \"#{options[:before].inspect} middleware is not defined for this stack\" unless self.class._mwares.keys.include?(options[:before])\n self.class._before[options[:before]] ||= []\n self.class._before[options[:before]] << name\n elsif options[:after]\n raise \"#{options[:after].inspect} middleware is not defined for this stack\" unless self.class._mwares.keys.include?(options[:after])\n self.class._after[options[:after]] ||= []\n self.class._after[options[:after]] << name\n else\n self.class._central_mwares << name unless self.class._central_mwares.include?(name)\n end\n self.class._mwares[name] = self\n self\n end",
"title": ""
},
{
"docid": "36e1599a3cbd843ee9f67061d87cb116",
"score": "0.6316994",
"text": "def new(*args)\n Middleware.new(*args)\n end",
"title": ""
},
{
"docid": "b595c93fdd92eedec19f980c47acd354",
"score": "0.6271224",
"text": "def use(middleware, *args, &block)\n @rack_middleware << [middleware, args, block]\n end",
"title": ""
},
{
"docid": "d686d1f82007769e2c2ed10ee166fa20",
"score": "0.6224108",
"text": "def use(middleware, *args)\n @app = middleware.new(@app, *args)\n end",
"title": ""
},
{
"docid": "23e4406c2f6f45b422297587475d81ea",
"score": "0.6209555",
"text": "def use(middleware, *args, &blk)\n @middleware.push([middleware, args, blk])\n end",
"title": ""
},
{
"docid": "40f5bb02002f4d33bc8f4d072fac3242",
"score": "0.620895",
"text": "def method_missing(method, *args, &block)\n @middlewares.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "1f9e18dc07efd7d81402d8bb76125915",
"score": "0.61825675",
"text": "def use(mw, *args, &block)\n middleware << [mw, args, block]\n end",
"title": ""
},
{
"docid": "1014a38394ccba8795d731c65d96cc3f",
"score": "0.617047",
"text": "def use(middleware, *args, &block)\n @middlewares ||= []\n @middlewares << [middleware, args.compact, block]\n end",
"title": ""
},
{
"docid": "81f7c288f13cafef3475b08e7f83caa7",
"score": "0.6091536",
"text": "def use(middleware, options = nil)\n self.middleware << [middleware, options].compact\n end",
"title": ""
},
{
"docid": "8f8dbefa8dca0f0c151c00a9e9870dd3",
"score": "0.6055033",
"text": "def use(middleware, *args, &block)\n path = caller_files[1] || File.expand_path($0)\n watch_element(path, :middleware, [middleware, args, block])\n super\n end",
"title": ""
},
{
"docid": "df563a0859a5afbd4e37ad186733a6af",
"score": "0.6044927",
"text": "def use(*args, &block)\n @middleware << [args, block].freeze\n @app = nil\n end",
"title": ""
},
{
"docid": "d1fe02c347f4c93d4a8e65880bee27d4",
"score": "0.6011681",
"text": "def use(*args, &block)\n @middleware.insert(@position, [args, block])\n @app.send(:build_rack_app)\n @position += 1\n nil\n end",
"title": ""
},
{
"docid": "ea78278c8cadbb98cbd44e18fcf65295",
"score": "0.5993886",
"text": "def middleware(&block)\n if block_given?\n self._middleware = block\n end\n end",
"title": ""
},
{
"docid": "63e6fcf2a34d536960f67e1e151598b0",
"score": "0.5963832",
"text": "def app_middleware; end",
"title": ""
},
{
"docid": "d2d47e3c19a7fc18b8a0085eaaa73d23",
"score": "0.5955111",
"text": "def call(env)\n @middleware.call(env)\n end",
"title": ""
},
{
"docid": "d67ee27359940aa735e83da7eb85f278",
"score": "0.5932733",
"text": "def middlewares=(_arg0); end",
"title": ""
},
{
"docid": "15a708e115b1ebdac29fbdc384ffdb29",
"score": "0.5917312",
"text": "def use(*args, &block)\n @middleware << [args, block].freeze\n build_rack_app\n end",
"title": ""
},
{
"docid": "a24d7683c11f1b7ccb0fe6d1276691ec",
"score": "0.59171134",
"text": "def add(name, middleware)\n @stack << Item.new(name, middleware)\n middleware\n end",
"title": ""
},
{
"docid": "68483eca29d466293e0a756b94f4ac2e",
"score": "0.59048134",
"text": "def use(middleware, *middleware_params, &block)\n configure_proc = block_given? ? Proc.new(&block) : nil\n self.middleware << [middleware, middleware_params, configure_proc]\n end",
"title": ""
},
{
"docid": "a0b32d461570b5101b4849140e263475",
"score": "0.5902103",
"text": "def middleware\n return @middleware unless block_given?\n\n @middleware = ::Middleware::Builder.new do |b|\n b.use @middleware if @middleware\n yield b\n end\n end",
"title": ""
},
{
"docid": "80331f8646e061091165ef80f291244b",
"score": "0.5878516",
"text": "def middlewares; end",
"title": ""
},
{
"docid": "dec4cbbb509656ff7ba26b14c159efae",
"score": "0.586178",
"text": "def middleware(&block)\n return @middleware ||= [] unless block_given?\n middleware << block\n end",
"title": ""
},
{
"docid": "c0a43c614335074b84ab2e5cd74ee50b",
"score": "0.5842278",
"text": "def setup_middleware middleware_stack\n where = OpenCensus::Trace.configure.middleware_placement\n case where\n when Class\n middleware_stack.insert_before where, RackMiddleware\n when :begin\n middleware_stack.unshift RackMiddleware\n else\n middleware_stack.use RackMiddleware\n end\n end",
"title": ""
},
{
"docid": "e02cc3946b536693852260bf5003a52e",
"score": "0.58068615",
"text": "def middleware\n Yeah.application.server.middleware\n end",
"title": ""
},
{
"docid": "5ac1de3dad769648181118c0d04b6972",
"score": "0.57744396",
"text": "def middleware\n @middleware ||= proc do |builder|\n builder.request(:desk_encode_dates)\n builder.request(:desk_encode_json)\n builder.request(*authorize_request)\n builder.request(:desk_retry)\n\n builder.response(:desk_parse_dates)\n builder.response(:desk_follow_redirects)\n builder.response(:desk_raise_error, DeskApi::Error::ClientError)\n builder.response(:desk_raise_error, DeskApi::Error::ServerError)\n builder.response(:desk_parse_json)\n\n builder.adapter(Faraday.default_adapter)\n end\n end",
"title": ""
},
{
"docid": "6e46ad041f5cd014f866b7b24fb1301f",
"score": "0.5726282",
"text": "def use(middleware, *args, &block)\n @build.use(middleware, *args, &block)\n end",
"title": ""
},
{
"docid": "297f133f9bc25c41076ccf7252a12a6d",
"score": "0.56845146",
"text": "def middleware\n @middleware ||= []\n end",
"title": ""
},
{
"docid": "270056768bec3a33337f5114d1ae6d89",
"score": "0.5632134",
"text": "def register_middleware(type, sym, cls)\n cls = DeskApi.const_get(type.capitalize).const_get(cls)\n if Faraday.respond_to?(:register_middleware)\n Faraday.register_middleware type, sym => cls\n else\n Faraday.const_get(type.capitalize).register_middleware sym => cls\n end\n end",
"title": ""
},
{
"docid": "1c1057a929573aeb3bb08e8116cc1946",
"score": "0.56073976",
"text": "def strategy(name, *args, &block)\n ware = OmniAuth::Strategies.const_get(OmniAuth::Utils.camelize(name.to_s))\n Scrapple.middleware_stack.insert_before(App, ware, *args, &block)\n end",
"title": ""
},
{
"docid": "68c7eb95559c28e00d1c19b390edb38f",
"score": "0.55831754",
"text": "def middleware\n @middleware ||= []\n end",
"title": ""
},
{
"docid": "eed3d411c4912f92df03f6423cb89689",
"score": "0.55419075",
"text": "def use(middleware_class, *middleware_args)\n @stack.use(middleware_class, *middleware_args)\n end",
"title": ""
},
{
"docid": "0e2c98824f0ce59690c3320651c31e26",
"score": "0.5520468",
"text": "def middleware\n @middleware ||= self.class.default_middleware.dup\n end",
"title": ""
},
{
"docid": "934e4cc2b9ed57fb860cee06cee98a38",
"score": "0.5490912",
"text": "def use(middleware_class, *middleware_args)\n @handler.use(middleware_class, *middleware_args)\n end",
"title": ""
},
{
"docid": "9c4f847ad0a5b4523afd1cc743a684c9",
"score": "0.54705733",
"text": "def lookup_middleware(key)\n unless defined? @registered_middleware and found = @registered_middleware[key]\n raise \"#{key.inspect} is not registered on #{self}\"\n end\n found = @registered_middleware[key] = found.call if found.is_a? Proc\n found.is_a?(Module) ? found : const_get(found)\n end",
"title": ""
},
{
"docid": "9c4f847ad0a5b4523afd1cc743a684c9",
"score": "0.54705733",
"text": "def lookup_middleware(key)\n unless defined? @registered_middleware and found = @registered_middleware[key]\n raise \"#{key.inspect} is not registered on #{self}\"\n end\n found = @registered_middleware[key] = found.call if found.is_a? Proc\n found.is_a?(Module) ? found : const_get(found)\n end",
"title": ""
},
{
"docid": "e33a68b8d0b9409eadd00df1f98c5529",
"score": "0.54639596",
"text": "def middleware\n @middleware ||= Middleware.new(\n \"ActiveSupport::Cache::Strategy::LocalCache\",\n local_cache_key)\n end",
"title": ""
},
{
"docid": "18a4c9b5870ded5cfc10857dc7dd0900",
"score": "0.5393665",
"text": "def use(middleware, *args, &block)\n return if faraday.builder.locked?\n faraday.builder.insert_before(Middleware::ParseJson, middleware, *args, &block)\n end",
"title": ""
},
{
"docid": "a573af2811c9d2579f1f591f975d8177",
"score": "0.53856593",
"text": "def middleware( *middlewares )\n self.middleware = middlewares.map { |mw| Testify::Middleware.find(mw) } unless middlewares.empty?\n self.send(:class_variable_get, :@@middleware)\n end",
"title": ""
},
{
"docid": "092fae51b6658ff12cd4e602ad1479bc",
"score": "0.5356516",
"text": "def request(name, method, path, &blk)\n req = LieDetector::Request.new self\n req.method method\n req.path path\n req.instance_exec &blk\n register(req, name)\n end",
"title": ""
},
{
"docid": "244f569d0ea2dbdcfe06b78c38121b8e",
"score": "0.5332128",
"text": "def prepend(name, middleware)\n @stack.unshift Item.new(name, middleware)\n end",
"title": ""
},
{
"docid": "177abfc08bd89c531548283231b3d72c",
"score": "0.5331147",
"text": "def stack(middleware, *args, &block)\n middleware.pre_use(self, *args, &block) if(middleware.respond_to?(:pre_use))\n @build.use(middleware, @core, *args, &block)\n middleware.post_use(self, *args, &block) if(middleware.respond_to?(:post_use))\n end",
"title": ""
},
{
"docid": "f2064c5a6957109dedfa00ad4979379a",
"score": "0.5314569",
"text": "def call(env)\n # We just call the kickoff middleware, which is responsible\n # for properly calling the next middleware, and so on and so\n # forth.\n @kickoff.call(env)\n end",
"title": ""
},
{
"docid": "e34c35433a0b54d8f8a754070dd2a319",
"score": "0.52799046",
"text": "def add(middleware, after: nil, before: nil)\n if !middleware.is_a?(Class) || !middleware.method_defined?(:call)\n raise BadMiddlewareError, 'Middleware \"' + middleware.to_s + '\" does ' \\\n 'not respond to call method! Please ' \\\n 'provide a class which responds to call '\\\n 'method with four parameters ' \\\n '\"request_metadata\", \"params\", ' \\\n '\"options\", \"data\" and returns a ' \\\n 'response object!'\n end\n\n if after\n index = @middlewares.index(after)\n if index.nil? || (index + 1) == @middlewares.length\n @middlewares << middleware\n else\n @middlewares.insert(index + 1, middleware)\n end\n elsif before\n index = @middlewares.index(before)\n if index.nil?\n @middlewares << middleware\n else\n @middlewares.insert(index, middleware)\n end\n else\n @middlewares << middleware\n end\n middleware\n end",
"title": ""
},
{
"docid": "54b16c85c3fabf3bc8d62fe7598b69a9",
"score": "0.52506006",
"text": "def server_middleware\n @server_middleware ||= Middleware::Chain.new\n yield @server_middleware if block_given?\n @server_middleware\n end",
"title": ""
},
{
"docid": "72a3ac17472c3e7cc51e02fe006d50d2",
"score": "0.52421916",
"text": "def stack(name = nil, opts = {})\n if self::StackMiddleware._mwares[name] && mw = self::StackMiddleware._mwares[name]\n unless mw.stack == self\n mw = self::StackMiddleware._mwares[name] = self::StackMiddleware._mwares[name].dup\n end\n mw\n else\n self::StackMiddleware.new(name, self, opts)\n end\n end",
"title": ""
},
{
"docid": "f41e656e0be0fb53949207e93a85cef4",
"score": "0.5240477",
"text": "def middleware_name\n self.class::OVTO_MIDDLEWARE_NAME\n end",
"title": ""
},
{
"docid": "f41e656e0be0fb53949207e93a85cef4",
"score": "0.5240477",
"text": "def middleware_name\n self.class::OVTO_MIDDLEWARE_NAME\n end",
"title": ""
},
{
"docid": "0ccfbc3c0782beb66107d9d4735534fe",
"score": "0.52289003",
"text": "def use(new_middleware)\n @mutex.synchronize do\n return if @disabled_middleware.include?(new_middleware)\n return if @middlewares.include?(new_middleware)\n\n @middlewares << new_middleware\n end\n end",
"title": ""
},
{
"docid": "905cf112f7bb733fcbc2452c2f3a4468",
"score": "0.5224331",
"text": "def middleware\n namespace_stackable(:middleware) || []\n end",
"title": ""
},
{
"docid": "2c28c258be078c2f738b98c6c0c6c814",
"score": "0.5223609",
"text": "def middleware\n @middleware ||= Rails::Configuration::MiddlewareStackProxy.new\n end",
"title": ""
},
{
"docid": "9fe120298315fae333e1cb777b404bc2",
"score": "0.5223161",
"text": "def configure_middleware(rack_builder)\n @rack_middleware.each {|item| rack_builder.use(item[0], *item[1], &item[2]) }\n end",
"title": ""
},
{
"docid": "1cb280e9e6d74387a0127ec9fb5efe33",
"score": "0.5189504",
"text": "def default_middleware(options = {})\n Middleware.default(options)\n end",
"title": ""
},
{
"docid": "5b9b59f0d75e3a3ac89326998bc3e59b",
"score": "0.51765716",
"text": "def call(request)\n handler.call(request)\n end",
"title": ""
},
{
"docid": "2d9eb4ce3c9facb12b253ae4e0f4f827",
"score": "0.51745874",
"text": "def use(middleware, &block)\n template = middleware\n objects.push(template)\n end",
"title": ""
},
{
"docid": "5667d09d2733b4598c9eb5d7c9a95f2d",
"score": "0.5172934",
"text": "def run!\n Sword._\n Rack::Handler.default.run(Sword.new, @settings)\n end",
"title": ""
},
{
"docid": "4ef98cd58cc7be4845e6e8d51cc5ce40",
"score": "0.514653",
"text": "def enable(middleware, args={})\n m = middleware.new(args)\n self.middlewares.push({\n :condition => Proc.new { true }, \n :middleware => m\n })\n end",
"title": ""
},
{
"docid": "b5b2ea29d4dc0ee26878f7fc21a56677",
"score": "0.5140808",
"text": "def add_middleware(router)\n builder = Rack::Builder.new\n middleware.each { |mw, args, block| builder.use(mw, *args, &block) }\n builder.run(router)\n builder.to_app\n end",
"title": ""
},
{
"docid": "f66df386df6c2d160d2d9fe752172168",
"score": "0.51320577",
"text": "def default_middleware\n Proc.new do |builder|\n builder.use Faraday::Request::Multipart\n builder.use Faraday::Request::UrlEncoded\n builder.use Yandex::Webmaster::Request::OAuth2, config.oauth_token\n\n builder.use Faraday::Response::Logger if ENV['DEBUG']\n builder.use Yandex::Webmaster::Response::Hashify\n # builder.use Yandex::Webmaster::Response::RaiseError\n \n builder.adapter config.adapter\n end\n end",
"title": ""
},
{
"docid": "d1236881902baf77191d278a7624ba70",
"score": "0.5125166",
"text": "def new_aroundware(env)\n @aroundware_klass.new(env, *@aroundware_args)\n end",
"title": ""
},
{
"docid": "417420d863d3e807345c794338dfb6f1",
"score": "0.50966424",
"text": "def use_api_auth middleware\n @make_it_later_api_auth.make_it_later(middleware)\n end",
"title": ""
},
{
"docid": "c6dbc2651999cc2755990828c1c0a31e",
"score": "0.50875384",
"text": "def middleware\n mw = Hash.new { |h,k| h[k] = [] }\n orig_middleware.each do |env, wares|\n mw[ env ] = cream( wares )\n end\n mw\n end",
"title": ""
},
{
"docid": "8ee4b68cd01d3f3fab753c8cf044bd57",
"score": "0.50603086",
"text": "def call(request)\r\n self\r\n end",
"title": ""
},
{
"docid": "2e0d5cff400e7b0b99ae32c0eefb843d",
"score": "0.50564355",
"text": "def middleware\n connection.builder\n end",
"title": ""
},
{
"docid": "8a13bf4ce3e81dee3d22c7e361fb3a2c",
"score": "0.50376195",
"text": "def dispatch(name, req, res); end",
"title": ""
},
{
"docid": "2c8c0354afefe2eb7107c4923dd55118",
"score": "0.5029118",
"text": "def call event\n # Instantiate and execute a handler for the event based on its namespace.\n # Handlers are executed with the middleware instance as the receiver.\n namespace, topic = event.topic.split('.')\n self.instance_exec(event, &handler_for(namespace, event.type))\n\n # Pass through the event (with potentially modified arguments) to the next\n # middleware\n fire(event)\n end",
"title": ""
},
{
"docid": "b2c54a85f288e58b55d5a7b8c9fa78df",
"score": "0.5022045",
"text": "def default_middleware_lookup\n ModuleLookup.new.add_path(\"toys/standard_middleware\")\n end",
"title": ""
},
{
"docid": "18241308f963f327b327a0875d2adea8",
"score": "0.50119555",
"text": "def unregister_middleware(key); end",
"title": ""
},
{
"docid": "aa411856fd8b55425b0020329711b43b",
"score": "0.50089115",
"text": "def middleware\n @middleware ||= ExceptionalMiddleware::MiddlewareStack.new\n end",
"title": ""
},
{
"docid": "687530ee5dbf76bf81c9296677599725",
"score": "0.49943414",
"text": "def middleware=( middleware )\n @middleware = middleware.map { |mw| Testify::Middleware.find(mw) }\n end",
"title": ""
},
{
"docid": "d70945e6c4b032b6c6db77fd2abb4dad",
"score": "0.49926612",
"text": "def middlewares(&)\n time_freeze_middleware { insecure_middleware(&) }\n end",
"title": ""
},
{
"docid": "ed9cf61dfc202c30f8c8dbf7dd387bf7",
"score": "0.49765387",
"text": "def call(request, _next)\n @block ? @block.call(request, _next) : _next.call\n end",
"title": ""
},
{
"docid": "d8ff2b71d44940bb56220e0ecfff73ef",
"score": "0.49748856",
"text": "def instrument\n proc do\n ActiveSupport::Notifications.publish(\"start_middleware.coach\", middleware_event)\n\n ActiveSupport::Notifications.\n instrument(\"finish_middleware.coach\", middleware_event) { call }\n end\n end",
"title": ""
},
{
"docid": "c207c143451f6ccda47a843f4f59dfec",
"score": "0.49668327",
"text": "def call(env)\n @domain = Rack::Request.new(env).host\n app = domain_matches? ? app_or_dsl_block : @next_app\n app.call(env)\n end",
"title": ""
},
{
"docid": "374a6c71febd670f9543d53d80e401dc",
"score": "0.4965441",
"text": "def call(request); end",
"title": ""
},
{
"docid": "43981f11766f62a56ece4371891b8e3e",
"score": "0.4939426",
"text": "def rewrite &proc\n\n return unless proc\n\n @rewriter = Class.new do\n\n attr_reader :http, :matched_rule\n\n define_method :initialize do |env|\n @http = ::Rack::Request.new env\n self.instance_exec &proc\n end\n\n def rule status = 301, &proc\n return if @matched_rule\n location = self.instance_exec &proc\n @matched_rule = [status, location] if location.is_a?(String)\n end\n end\n end",
"title": ""
},
{
"docid": "3ae0e5901437168e38bc8e2c4d95864f",
"score": "0.49321404",
"text": "def build_middleware_stack\n Jets.application.build_stack\n end",
"title": ""
},
{
"docid": "b6bfa94dc3c0e81b97d907be87f3a9b9",
"score": "0.49248868",
"text": "def middlewares_stack; end",
"title": ""
},
{
"docid": "ff9571bffb38c7cc725672101460e56b",
"score": "0.48942524",
"text": "def build(app, &block)\n app ||= block\n raise \"MiddlewareStack#build requires an app\" unless app\n Skylight::Core::Probes::Middleware::Probe.add_instrumentation(app, default_name: \"Rack App\", category: \"rack.app\")\n build_without_sk(app)\n end",
"title": ""
},
{
"docid": "41de3dcd10f27a72ff926786b19855b2",
"score": "0.4874545",
"text": "def perform(context, app = Pakyow.app, &after_match)\n fns = match(context.request)\n after_match.call if block_given?\n\n trampoline(fns, app)\n end",
"title": ""
},
{
"docid": "bcd8d046b0d469914cd89486a1f9c30b",
"score": "0.4872801",
"text": "def build_middleware(builder)\n builder.request :json\n builder.response :json\n end",
"title": ""
},
{
"docid": "d64dcd022d16068f19808f7a1791a58d",
"score": "0.48723218",
"text": "def use ware, *args, &proc\n return if locked?\n use? << {:ware => ware, :args => args, :proc => proc}\n end",
"title": ""
},
{
"docid": "527cb082d64d9186d9affccbc65ee64f",
"score": "0.4857817",
"text": "def request_setup(method, path, params)\n Proc.new do |request|\n end\n end",
"title": ""
},
{
"docid": "a61f27cd74d1e353d91df72a23275c84",
"score": "0.485262",
"text": "def _install_middleware_if_needed\n return if @__middleware_installed\n @__middleware_installed = true\n\n if defined?(Rails) && Rails.respond_to?(:application) && Rails.application\n Rails.configuration.middleware.use(Client::Middleware::RequestHandler)\n end\n end",
"title": ""
},
{
"docid": "a0b56ad090c9f12f0fbb2e358cd3f3ee",
"score": "0.48452494",
"text": "def middleware\n connection.builder\n end",
"title": ""
},
{
"docid": "aefffb188cff60d355f1bea458d4b2c3",
"score": "0.48436528",
"text": "def replace(middleware, *middleware_params, &block)\n idx = self.middleware.find_index { |m| m[0] == middleware }\n raise ArgumentError, \"Middleware #{middleware} not present\" if idx.nil?\n\n configure_proc = block_given? ? Proc.new(&block) : nil\n self.middleware[idx] = [middleware, middleware_params, configure_proc]\n end",
"title": ""
},
{
"docid": "baa6a2c786c088c76c41ee3fd23244a6",
"score": "0.48320156",
"text": "def route(&block)\n @router ||= Router.new\n @router.instance_eval(&block)\n end",
"title": ""
},
{
"docid": "a91c68cd69c2d0c072b29bfb26eb619f",
"score": "0.48304507",
"text": "def initialize app, *args\n # If this is the top middleware (i.e., there are no middlewares stacked\n # above this one), `@app` will be a blank Proc since it responds to\n # `.call` and doesn't error with the wrong number of arguments.\n @app = app || Proc.new{}\n # Provide instance-level access to the storage adapter being used by\n # the main app.\n @storage = Storage.adapter\n end",
"title": ""
},
{
"docid": "c65a685fa3b5332864417867946e0f80",
"score": "0.48144537",
"text": "def be_applied_middleware\n Spec::Support::Matchers::BeAppliedMiddlewareMatcher.new\n end",
"title": ""
},
{
"docid": "57d9160b0fec6c8b6342805dffc0f554",
"score": "0.4799023",
"text": "def register_handler(name, opts = {}, &block)\n klass = opts.delete(:class_name) || \"::#{name.to_s.camelize}\"\n create_handler_predicate_method name\n handlers[name] = Runner.new(name, klass.to_s.constantize, self, opts, &block)\n end",
"title": ""
},
{
"docid": "1b1bcbe51eb446d5b1f6fd29ceec24cb",
"score": "0.479667",
"text": "def set_request_handler(&blk) @req_handler = blk; nil end",
"title": ""
},
{
"docid": "2fc5464f3f459f8fd93dcbe22c33b94a",
"score": "0.47937706",
"text": "def call_by_request(request)\n rotation do |offset|\n pattern = decode_pattern(request.path_info)\n if route = match?(offset, pattern)\n params = route.params_for(pattern, request.params)\n yield(route, params) if route.verb == request.request_method\n route\n end\n end\n end",
"title": ""
},
{
"docid": "b67b11eb8aea533158723b88d653a2c4",
"score": "0.47897053",
"text": "def dispatch env\n raise Gin::NotFound,\n \"No route exists for: #{env[REQ_METHOD]} #{env[PATH_INFO]}\" unless\n env[GIN_TARGET]\n\n env[GIN_APP] = self\n env[GIN_TARGET][0].call(env)\n\n rescue ::Exception => err\n handle_error(err, env)\n end",
"title": ""
}
] |
227039afb0278483e948f898efcebdd5
|
The naughty privates of this class. MacRuby callback functions.
|
[
{
"docid": "3097068443e74cf29278b027999a93b9",
"score": "0.0",
"text": "def applicationDidFinishLaunching notification\n start_output\n start_input\n end",
"title": ""
}
] |
[
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.7146666",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.7146666",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "bce3e1d1089bf6d6722900bd3cac0f36",
"score": "0.6884734",
"text": "def callback\n end",
"title": ""
},
{
"docid": "11f830af7a28e3a91fcf2311c1d4f679",
"score": "0.6883011",
"text": "def callback\n\n end",
"title": ""
},
{
"docid": "4913fde4bcea70a66a1bc392bba05a43",
"score": "0.6875292",
"text": "def callback=(_arg0); end",
"title": ""
},
{
"docid": "a60ba27ead23e31d07276274c717cd42",
"score": "0.667553",
"text": "def callback\n\tend",
"title": ""
},
{
"docid": "ca5ab8b45126be7c140dc5343e0788d2",
"score": "0.6431219",
"text": "def listener; end",
"title": ""
},
{
"docid": "b9f0e97297847474184e31989868ebd0",
"score": "0.61938184",
"text": "def callback_type; end",
"title": ""
},
{
"docid": "3e85f3e1dcb4035be79481f59a426123",
"score": "0.6184084",
"text": "def notifier=(_arg0); end",
"title": ""
},
{
"docid": "3e85f3e1dcb4035be79481f59a426123",
"score": "0.6184084",
"text": "def notifier=(_arg0); end",
"title": ""
},
{
"docid": "e7370251310c86a48503d9a0ea767c37",
"score": "0.61690396",
"text": "def listener=(_arg0); end",
"title": ""
},
{
"docid": "d870dec09849951cdac7204368073d85",
"score": "0.6165021",
"text": "def notifier; end",
"title": ""
},
{
"docid": "d870dec09849951cdac7204368073d85",
"score": "0.6165021",
"text": "def notifier; end",
"title": ""
},
{
"docid": "d954914ff0b1d294f210c89bf2b87e72",
"score": "0.5967509",
"text": "def receiver; end",
"title": ""
},
{
"docid": "d954914ff0b1d294f210c89bf2b87e72",
"score": "0.5967509",
"text": "def receiver; end",
"title": ""
},
{
"docid": "d954914ff0b1d294f210c89bf2b87e72",
"score": "0.5967509",
"text": "def receiver; end",
"title": ""
},
{
"docid": "d954914ff0b1d294f210c89bf2b87e72",
"score": "0.5967509",
"text": "def receiver; end",
"title": ""
},
{
"docid": "d954914ff0b1d294f210c89bf2b87e72",
"score": "0.5967509",
"text": "def receiver; end",
"title": ""
},
{
"docid": "d954914ff0b1d294f210c89bf2b87e72",
"score": "0.5967509",
"text": "def receiver; end",
"title": ""
},
{
"docid": "77d7b9b4766cb6a1b2902ee4f0b3fa6d",
"score": "0.5951504",
"text": "def onmessage(&blk); super; end",
"title": ""
},
{
"docid": "7123e69c7c474d66b72fbd9b661309c6",
"score": "0.5915661",
"text": "def signal_received=(_arg0); end",
"title": ""
},
{
"docid": "24c5464438dbc039e05b411c195d2172",
"score": "0.5899655",
"text": "def isolate_signals=(_arg0); end",
"title": ""
},
{
"docid": "75d6be419dcd09d334174c86a59d46ac",
"score": "0.58726376",
"text": "def listening?; end",
"title": ""
},
{
"docid": "775924c2d13e229fd1f91c17851e907d",
"score": "0.5861948",
"text": "def signal; end",
"title": ""
},
{
"docid": "775924c2d13e229fd1f91c17851e907d",
"score": "0.5861948",
"text": "def signal; end",
"title": ""
},
{
"docid": "9a22484cf7fd490fd608afa97937688c",
"score": "0.5854656",
"text": "def nuixWorkerItemCallbackInit\nend",
"title": ""
},
{
"docid": "b0e35cea1dbbbe3bf02a802a2fbf1c32",
"score": "0.5843914",
"text": "def events=(_); end",
"title": ""
},
{
"docid": "ba8337b444ee989993825eba6c53efc6",
"score": "0.58387005",
"text": "def callback_method\n run(\"on\", \"string\", \"callback\")\n end",
"title": ""
},
{
"docid": "9fbec9b2bcd97ad59997b3cbc61b2258",
"score": "0.58339894",
"text": "def handle; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.58186793",
"text": "def events; end",
"title": ""
},
{
"docid": "5ec0a794d6413112191ce2266cd19857",
"score": "0.58086395",
"text": "def signal_received; end",
"title": ""
},
{
"docid": "adc143d9921490a32ce81e2ec1b81602",
"score": "0.57909703",
"text": "def invoke; end",
"title": ""
},
{
"docid": "eabf57cbd5374e1473b82ca441d629aa",
"score": "0.57341987",
"text": "def callback\n def_deferr = ::EventMachine::DefaultDeferrable.new\n proc_callback = Proc.new { |response| ::OnesnooperServer::Log.debug(\n \"[#{self.class.name}] Handled as: #{response}\"\n ) }\n\n def_deferr.callback &proc_callback\n def_deferr.errback &proc_callback\n\n def_deferr\n end",
"title": ""
},
{
"docid": "b5194492c867f4218239a653703480a4",
"score": "0.57139015",
"text": "def ios; end",
"title": ""
},
{
"docid": "9400739520fe7d23bec82367f3d960c0",
"score": "0.56797755",
"text": "def listeners; end",
"title": ""
},
{
"docid": "18139399fa05832c4403b4a5512fa536",
"score": "0.5649734",
"text": "def callback(&blk)\n @blk=blk\n end",
"title": ""
},
{
"docid": "39aed30cfab586ade9ba65aa741a2214",
"score": "0.563921",
"text": "def method_missing(code, *args, &blk); end",
"title": ""
},
{
"docid": "39aed30cfab586ade9ba65aa741a2214",
"score": "0.563921",
"text": "def method_missing(code, *args, &blk); end",
"title": ""
},
{
"docid": "09ba49c4c2fa7a5c6f11fb71d7b8a0a0",
"score": "0.5631444",
"text": "def signal\n end",
"title": ""
},
{
"docid": "ccfe4044a5371ef1ee52c0eaecd344fc",
"score": "0.5631035",
"text": "def called_from; end",
"title": ""
},
{
"docid": "ccfe4044a5371ef1ee52c0eaecd344fc",
"score": "0.5631035",
"text": "def called_from; end",
"title": ""
},
{
"docid": "93055638b961b3762e3a3353b8b9cfc6",
"score": "0.5615964",
"text": "def proceed!; end",
"title": ""
},
{
"docid": "93055638b961b3762e3a3353b8b9cfc6",
"score": "0.5615964",
"text": "def proceed!; end",
"title": ""
},
{
"docid": "9817c8b53b00110a90b12a6e13b2af3f",
"score": "0.5615888",
"text": "def send_events=(_arg0); end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.5609096",
"text": "def internal; end",
"title": ""
},
{
"docid": "79227468599965242ab38af94023518b",
"score": "0.559875",
"text": "def received\n end",
"title": ""
},
{
"docid": "464e0c01f57f55c345f36d5eb40afdb9",
"score": "0.5598146",
"text": "def on_data_ok; on_data_cancel; end",
"title": ""
},
{
"docid": "b4d6ba8a60f9457bf96ffc7e3e1d9ea1",
"score": "0.55978113",
"text": "def handler; end",
"title": ""
},
{
"docid": "b4d6ba8a60f9457bf96ffc7e3e1d9ea1",
"score": "0.55978113",
"text": "def handler; end",
"title": ""
},
{
"docid": "f4ad13bf5fa71b1e7bc47220336ffdbf",
"score": "0.55936384",
"text": "def methods() end",
"title": ""
},
{
"docid": "df65ab9f7b2860613e46e7bb62980181",
"score": "0.55904794",
"text": "def callback\n false\n end",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.55691797",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "8b665f2299c613a9b4cb83683f6c86ef",
"score": "0.55631506",
"text": "def run(_); end",
"title": ""
},
{
"docid": "8b665f2299c613a9b4cb83683f6c86ef",
"score": "0.55631506",
"text": "def run(_); end",
"title": ""
},
{
"docid": "0fc17705d870e61934986ca1f5161e96",
"score": "0.5550685",
"text": "def handlers=(_arg0); end",
"title": ""
},
{
"docid": "58e258a325540734b9ab22d5156c610f",
"score": "0.5541924",
"text": "def run_callbacks(index = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ee506b47d8d9af4673ee69838e828f48",
"score": "0.5529331",
"text": "def note_cb(type)\n __debug_line(\"*** SHRINE CALLBACK #{type} *** | #{file_data.inspect}\")\n end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.55221546",
"text": "def event; end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.55221546",
"text": "def event; end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.55221546",
"text": "def event; end",
"title": ""
},
{
"docid": "fecf59d5d23250edbaec8d6451073a41",
"score": "0.5515949",
"text": "def invoking\n end",
"title": ""
},
{
"docid": "6bab742ecf47900b74a25496b4caa524",
"score": "0.5514532",
"text": "def handlers; end",
"title": ""
},
{
"docid": "6bab742ecf47900b74a25496b4caa524",
"score": "0.5514532",
"text": "def handlers; end",
"title": ""
},
{
"docid": "6bab742ecf47900b74a25496b4caa524",
"score": "0.5514532",
"text": "def handlers; end",
"title": ""
},
{
"docid": "23181de9292f1e538da8b3812c7d036e",
"score": "0.55116826",
"text": "def watcher=(_arg0); end",
"title": ""
},
{
"docid": "87abdb5f352ac4b80396b51183c013f6",
"score": "0.5467118",
"text": "def scheme_handlers=(_arg0); end",
"title": ""
},
{
"docid": "73c74e6dd2dc52a56f5258bfdeea60b7",
"score": "0.5451703",
"text": "def invoke\r\n # TODO: rename to more appropriate one 2007/05/10 by shino\r\n raise 'must be implemented in subclasses'\r\n end",
"title": ""
},
{
"docid": "efc3050194d41a7e7d0577c5e4f2f1de",
"score": "0.5449804",
"text": "def verify_callback; end",
"title": ""
},
{
"docid": "efc3050194d41a7e7d0577c5e4f2f1de",
"score": "0.5449804",
"text": "def verify_callback; end",
"title": ""
},
{
"docid": "a230804f52c9fedeb18a10b7ec6a4693",
"score": "0.54485506",
"text": "def tk_callback(name, *args)\n $ctrl.public_send(name, *args)\nend",
"title": ""
},
{
"docid": "dfde4e2da3f1b7a5d9336bb089d11685",
"score": "0.5448432",
"text": "def ruby_broken_function(event, context:)\n\nend",
"title": ""
},
{
"docid": "7bb78bdb2a4bb9d56d4af36908fb439f",
"score": "0.5446991",
"text": "def listen\r\n end",
"title": ""
},
{
"docid": "93826110c0480af1dea6315e1764220c",
"score": "0.54457074",
"text": "def handle\n end",
"title": ""
},
{
"docid": "b3f6bcf9d54b4bcb66185d3012f582a9",
"score": "0.5442389",
"text": "def call(*) end",
"title": ""
},
{
"docid": "b3f6bcf9d54b4bcb66185d3012f582a9",
"score": "0.5442389",
"text": "def call(*) end",
"title": ""
},
{
"docid": "014e4ddbc6a4957749be5612fe1daa84",
"score": "0.5424367",
"text": "def callback &block\n super\n end",
"title": ""
},
{
"docid": "014e4ddbc6a4957749be5612fe1daa84",
"score": "0.5424367",
"text": "def callback &block\n super\n end",
"title": ""
},
{
"docid": "4fc848bc851b85c0155842e2c413fc41",
"score": "0.542131",
"text": "def call() end",
"title": ""
},
{
"docid": "1af70df78ab5186fb6570c4cf90fd704",
"score": "0.5413816",
"text": "def run_callbacks(options = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.5413595",
"text": "def call; end",
"title": ""
},
{
"docid": "64875541f8c42bdd60f0a7e3f539b0ba",
"score": "0.5410221",
"text": "def delegating_method; end",
"title": ""
},
{
"docid": "d4b5a840920e50c5aa10dc5b6cbc99c5",
"score": "0.5399089",
"text": "def on_quit\n end",
"title": ""
},
{
"docid": "385100ba2cb8ff736a6a67f402891124",
"score": "0.5397447",
"text": "def listen(p0) end",
"title": ""
},
{
"docid": "385100ba2cb8ff736a6a67f402891124",
"score": "0.5397447",
"text": "def listen(p0) end",
"title": ""
},
{
"docid": "385100ba2cb8ff736a6a67f402891124",
"score": "0.5397447",
"text": "def listen(p0) end",
"title": ""
},
{
"docid": "4d9ad0f7f575c8a44fdbe33021565b86",
"score": "0.5396634",
"text": "def tcl_callback(_client_data, interp, objc, objv)\n cmd, id, *args = tcl_cmd_args(interp, objc, objv)\n id = id.first if id.is_a?(Array)\n\n catch :callback_break do\n catch :callback_continue do\n result = handle_callback(id, *args)\n FFI::Tcl::Interp.new(interp).obj_result = result\n\n return OK\n end\n\n return CONTINUE\n end\n\n return BREAK\n rescue => ex\n FFI::Tcl::Interp.new(interp).obj_result = ex\n return ERROR\n end",
"title": ""
},
{
"docid": "d2df7ee9f7ec7d5df8d415285abdcf3c",
"score": "0.5396458",
"text": "def callback\n self.class.callback\n end",
"title": ""
}
] |
4f2a59c6fd208aba8335ad2c6ba3b3e7
|
Set multiple nodes in one operation. Find or create a node matching SUB by interpreting SUB as a path expression relative to each node matching BASE. If SUB is '.', the nodes matching BASE will be modified. +base+ the base node +sub+ the subtree relative to the base +value+ the value for the nodes
|
[
{
"docid": "ab8775dc64056143e65b869ebcf8bb19",
"score": "0.5494582",
"text": "def setm(base, sub, value)\n run_command :augeas_setm, base, sub, value\n end",
"title": ""
}
] |
[
{
"docid": "493a0ece92e1b3c7ba2ec6afb76351b6",
"score": "0.5773038",
"text": "def []=(*args)\n value = args.pop\n args = args.first.to_s.split('/') if args.size == 1\n tree = args[0..-2].to_a.inject(self) { |tree, name| tree.tree(name) }\n tree.put(args.last, value)\n end",
"title": ""
},
{
"docid": "d77b4e15e0f164756070b9f3e4bf8207",
"score": "0.5602495",
"text": "def []=(parts, value)\n last_node, * = traverse(@root, parts, true)\n last_node[STOP] = value\n end",
"title": ""
},
{
"docid": "24e88e07fdc278feb8842e3306d74d77",
"score": "0.54024947",
"text": "def set(full_key, node)\n fail 'value should be a I18n::Tasks::Data::Tree::Node' unless node.is_a?(Node)\n\n key_part, rest = split_key(full_key, 2)\n child = key_to_node[key_part]\n\n if rest\n unless child\n child = Node.new(\n key: key_part,\n parent: parent,\n children: [],\n warn_about_add_children_to_leaf: @warn_about_add_children_to_leaf\n )\n append! child\n end\n unless child.children\n conditionally_warn_add_children_to_leaf(child, [])\n child.children = []\n end\n child.children.set rest, node\n else\n remove! child if child\n append! node\n end\n dirty!\n node\n end",
"title": ""
},
{
"docid": "d44217d05690a26d4e828465cbe2a5cb",
"score": "0.5399086",
"text": "def fill!(subexpr, value)\n value = value.value if Value === value and @values and\n not (Syntax === @values.car)\n \n epair, vpair = @expression, @values\n while Cons === epair and not epair.null?\n if epair.car.equal?(subexpr)\n vpair.car = value\n @current = epair.cdr\n end\n epair, vpair = epair.cdr, vpair.cdr\n end\n end",
"title": ""
},
{
"docid": "d44217d05690a26d4e828465cbe2a5cb",
"score": "0.5399086",
"text": "def fill!(subexpr, value)\n value = value.value if Value === value and @values and\n not (Syntax === @values.car)\n \n epair, vpair = @expression, @values\n while Cons === epair and not epair.null?\n if epair.car.equal?(subexpr)\n vpair.car = value\n @current = epair.cdr\n end\n epair, vpair = epair.cdr, vpair.cdr\n end\n end",
"title": ""
},
{
"docid": "2de84ddf0b416d678269b446b6ded5dc",
"score": "0.53540593",
"text": "def initialize(obj, newLeaf = nil, value = nil, block = nil)\n if obj.kind_of? NodeSetPath\n @nodeSet = obj.nodeSet\n @path = obj.path.clone\n elsif obj.kind_of? NodeSet\n @nodeSet = obj\n @path = Array.new\n else\n raise \"Argument needs to be either a NodeSet, or a NodeSetPath, \"+\n \"but is #{obj.class.to_s}\"\n end\n\n if value != nil\n if newLeaf == nil \n path = \"\"\n @path.each {|p| path = path + '/' +p.to_s}\n raise \"Missing assignment operator or argument for path \"+\n \"'#{path}/#{newLeaf}'.\"\n # NOTE: cannot call 'pathString' here cause @pathSubString has not \n\t# been set yet!\n end\n if newLeaf[-1] != ?=\n newLeaf = newLeaf[0 .. -1]\n else\n newLeaf = newLeaf[0 .. -2]\n end\n @value = value\n end\n if newLeaf != nil\n @path += [newLeaf]\n end\n\n @pathSubString = @path.join('/')\n super(@pathSubString == \"\" ? \"nodeSetPath\" : \"nodeSetPath::#{@pathSubString}\")\n\n if block != nil\n call &block\n end\n # What kind of path this is?\n if value != nil\n # A path with a \"= value\" defined\n if (@path.last.to_s == \"enforce_link\")\n @nodeSet.set_link_characteristics(@path, @value)\n else \n @nodeSet.configure(@path, @value)\n end\n # A path without a defined value\n elsif VALID_PATHS_WITHOUT_VALUES.has_key?(@path.last.to_s)\n # the path is a setter that does not require a value (e.g. ip.down)\n # then we send a configure command to the nodes\n @nodeSet.configure(@path, @value)\n else \n # the path is a getter\n # TODO IMPLEMENT THIS!\n end\n end",
"title": ""
},
{
"docid": "786fac9bf7cc6c27512baf6b183908c9",
"score": "0.5241212",
"text": "def initialize(obj, newLeaf = nil, value = nil, block = nil)\n if obj.kind_of? NodeSetPath\n @nodeSet = obj.nodeSet\n @path = obj.path.clone\n elsif obj.kind_of? NodeSet\n @nodeSet = obj\n @path = Array.new\n else\n raise \"Argument needs to be either a NodeSet, or a NodeSetPath, but is #{obj.class.to_s}\"\n end\n\n if value != nil\n #if newLeaf == nil || newLeaf[-1] != ?= \n if newLeaf == nil \n path = \"\"\n @path.each {|p| path = path + '/' +p.to_s}\n raise \"Missing assignment operator or argument for path '#{path}/#{newLeaf}'.\"\n # NOTE: cannot call 'pathString' here cause @pathSubString has not been set yet!\n end\n if newLeaf[-1] != ?=\n newLeaf = newLeaf[0 .. -1]\n else\n newLeaf = newLeaf[0 .. -2]\n end\n @value = value\n end\n if newLeaf != nil\n @path += [newLeaf]\n end\n\n @pathSubString = @path.join('/')\n super(@pathSubString == \"\" ? \"nodeSetPath\" : \"nodeSetPath::#{@pathSubString}\")\n #debug(\"Create nodeSetPath '\", pathString, \"' obj: #{obj.class}\")\n\n if block != nil\n call &block\n end\n if value != nil\n if (@path.last.to_s == \"enforce_link\")\n @nodeSet.setMACFilteringTable(@path, @value)\n # If this EC is invoked with support for temporary disconnected node/resource, then \n # do not execute any node/resource configuration commands (this will be done by the\n # slave EC running on the node/resource).\n elsif (NodeHandler.disconnectionMode? == false) \n @nodeSet.configure(@path, @value)\n end\n # If the path is one that does not require a value (e.g. ip.down or ip.up)\n # then we send a configure command to the nodes\n elsif VALID_PATHS_WITHOUT_VALUES.has_key?(@path.last.to_s)\n @nodeSet.configure(@path, @value)\n end\n end",
"title": ""
},
{
"docid": "cf695dbfc5fd596ed7ba92bfb0f177a3",
"score": "0.51999176",
"text": "def set(full_key, node); end",
"title": ""
},
{
"docid": "aaf6f7a9a0c73188d6500410c19ff4d0",
"score": "0.51947886",
"text": "def set(ctx_list, value)\n node = @root\n ctx_list.each do |ctx_item|\n node = node.add_child(ctx_item)\n end\n node.value = value\n end",
"title": ""
},
{
"docid": "65534794c4167888228d9815630aece2",
"score": "0.5111722",
"text": "def []=(*args)\n value = args.pop\n root[*args] = value\n end",
"title": ""
},
{
"docid": "fcc0bb24e0fcccd162294d6751b2a42b",
"score": "0.5107494",
"text": "def []=(*properties, values)\n # Flattent the values to 1 level. This creates an arrray of values in the case only a single value is provided.\n values = [values].flatten(1)\n properties = properties.map(&:to_s)\n run_in_transaction(:[]=, *properties, values) do\n node_properties = props\n Hash[properties.zip(values)].each { |k, v| node_properties[k] = v unless k.nil? }\n self.props = node_properties # Reset all the properties - write simple inefficient code until it proves inefficient\n end\n rescue NoMethodError => e\n _raise_doesnt_exist_anymore_error(e)\n end",
"title": ""
},
{
"docid": "81e227a8e370542a42091d820381d650",
"score": "0.50842625",
"text": "def []= key, val\n\t\tbefore_list = Array.new(@level_max + 1)\n\t\tafter_list = Array.new(@level_max + 1)\n\t\tloop {\n\t\t\tif p = find(key, before_list, after_list) then\n\t\t\t\tp.val = val\n\t\t\t\tbreak\n\t\t\tend\n\t\t\ttoplevel = rand2exp @level_max\n\t\t\tnode = Node.new toplevel, key, val\n\t\t\t(0).upto(toplevel){|level|\n\t\t\t\tnode[level] = MLink.new after_list[level]\n\t\t\t}\n\t\t\tunless before_list[0][0].compare_and_set after_list[0], node, false, false then\n\t\t\t\tnext\n\t\t\tend\n\t\t\t@size_lock.synchronize {\n\t\t\t\t@size += 1\n\t\t\t}\n\t\t\t(1).upto(toplevel){|level|\n\t\t\t\tloop {\n\t\t\t\t\tif before_list[level][level].compare_and_set after_list[level], node, false, false then\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\t\tfind key, before_list, after_list\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tval\n\tend",
"title": ""
},
{
"docid": "2f1ad462e6c489fdc299c5f761a1aede",
"score": "0.5071776",
"text": "def method_missing(name, *args, &block)\n if args.length > 1\n raise \"Assignment to '\" + pathString + \"/\" + name.to_s + \"' can only be \"+\n \"a single parameter.\"\n end\n name_s = name.to_s\n re = VALID_PATHS[name_s]\n debug(\"Testing '#{name}' => '#{@pathSubString}' : #{re}\")\n if (re != nil)\n debug(\"Checking against '#{re}'\")\n if (@pathSubString =~ re) != 0\n warn(\"Unrecognized path '#{@pathSubString}/#{name}'\")\n end\n else\n found = false\n VALID_PATHS_RE.each { |nameRe, pattern|\n if (name_s =~ nameRe) == 0\n found = true\n if (@pathSubString =~ pattern) != 0\n warn(\"Unrecognized path '#{@pathSubString}/#{name}'\")\n end\n end\n }\n if !found\n warn(\"Unrecognized path '#{@pathSubString}/#{name}'\")\n end\n end\n #debug(\"Creating new nodeSetPath '#{name}'\")\n return NodeSetPath.new(self, name_s, args[0], block)\n end",
"title": ""
},
{
"docid": "8abf2681ec998877046634f0ff31f3ec",
"score": "0.50327724",
"text": "def []=(path, value)\n list = normalize_path(path)\n tree = list[0..-2].to_a.inject(self) { |tree, name| tree.tree(name) }\n tree.put(list.last, value)\n end",
"title": ""
},
{
"docid": "bbe36e525c21b3dae187fe6e2398398d",
"score": "0.5028879",
"text": "def recursive_assign(key, value)\n\t\treturn nil if key.blank?\n\t\tkeys = key.split('.')\n\t\tif keys.size > 1\n\t\t\tkey = keys.shift.to_sym\n\n\t\t\tif !@attributes[key]\n\t\t\t\tassign_value(key, DottedHash.new({}, @depth+1))\n\t\t\tend\n\t\t\tsub = @attributes[key]\n\t\t\tsub.send(:recursive_assign, keys.join('.'), value)\n\t\telsif keys.size == 1\n\t\t\tassign_value(keys.shift, value)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "df2df2e10e7480a77596241d6e88e790",
"score": "0.50236154",
"text": "def generic_set(key, value, tree = data)\n modify(key, value, tree) || uncomment(key, value, tree) ||\n add_new(key, value, tree)\n end",
"title": ""
},
{
"docid": "9707782e295223504eef8543f9cd3000",
"score": "0.49941954",
"text": "def set(oid,value)\n roid=self.oid2roid(oid)\n validate_roid(roid)\n roid_first=roid.first\n if roid.size>1\n @nodes[roid_first]=self.class.new(self.oid + [roid_first]) if not @nodes[roid_first]\n node=@nodes[roid_first]\n return node.set(oid,value)\n end\n return @nodes[roid_first]=value\n end",
"title": ""
},
{
"docid": "31a77ae172fe9ed8946906bbb1607454",
"score": "0.49933338",
"text": "def executeSetRelativeBase(opCode, opParams)\n\n\t\tvalue1 = opParams[:value1];\n\n\t\tresult = @reg_rel + value1;\n\t\ttraceOp(opCode, opParams, \"#{value1}, @reg_rel = #{result}\");\n\n\t\t@reg_rel = result;\n\n\tend",
"title": ""
},
{
"docid": "31a77ae172fe9ed8946906bbb1607454",
"score": "0.49933338",
"text": "def executeSetRelativeBase(opCode, opParams)\n\n\t\tvalue1 = opParams[:value1];\n\n\t\tresult = @reg_rel + value1;\n\t\ttraceOp(opCode, opParams, \"#{value1}, @reg_rel = #{result}\");\n\n\t\t@reg_rel = result;\n\n\tend",
"title": ""
},
{
"docid": "31a77ae172fe9ed8946906bbb1607454",
"score": "0.49933338",
"text": "def executeSetRelativeBase(opCode, opParams)\n\n\t\tvalue1 = opParams[:value1];\n\n\t\tresult = @reg_rel + value1;\n\t\ttraceOp(opCode, opParams, \"#{value1}, @reg_rel = #{result}\");\n\n\t\t@reg_rel = result;\n\n\tend",
"title": ""
},
{
"docid": "31a77ae172fe9ed8946906bbb1607454",
"score": "0.49933338",
"text": "def executeSetRelativeBase(opCode, opParams)\n\n\t\tvalue1 = opParams[:value1];\n\n\t\tresult = @reg_rel + value1;\n\t\ttraceOp(opCode, opParams, \"#{value1}, @reg_rel = #{result}\");\n\n\t\t@reg_rel = result;\n\n\tend",
"title": ""
},
{
"docid": "31a77ae172fe9ed8946906bbb1607454",
"score": "0.49933338",
"text": "def executeSetRelativeBase(opCode, opParams)\n\n\t\tvalue1 = opParams[:value1];\n\n\t\tresult = @reg_rel + value1;\n\t\ttraceOp(opCode, opParams, \"#{value1}, @reg_rel = #{result}\");\n\n\t\t@reg_rel = result;\n\n\tend",
"title": ""
},
{
"docid": "cb4f5f6397ef965f187cec68818118ea",
"score": "0.4974166",
"text": "def method_missing(name, *args, &block)\n # puts \"path(\" + pathString + \") \" + name.to_s + \" @ \" + args.to_s + \" @ \" + (block != nil ? block : nil).to_s\n if args.length > 1\n raise \"Assignment to '\" + pathString + \"/\" + name.to_s + \"' can only be a single parameter.\"\n end\n name_s = name.to_s\n re = VALID_PATHS[name_s]\n debug(\"Testing '#{name}' => '#{@pathSubString}' : #{re}\")\n if (re != nil)\n debug(\"Checking against '#{re}'\")\n if (@pathSubString =~ re) != 0\n warn(\"Unrecognized path '#{@pathSubString}/#{name}'\")\n end\n else\n found = false\n VALID_PATHS_RE.each { |nameRe, pattern|\n if (name_s =~ nameRe) == 0\n found = true\n if (@pathSubString =~ pattern) != 0\n warn(\"Unrecognized path '#{@pathSubString}/#{name}'\")\n end\n end\n }\n if ! found\n warn(\"Unrecognized path '#{@pathSubString}/#{name}'\")\n end\n end\n #debug(\"Creating new nodeSetPath '#{name}'\")\n return NodeSetPath.new(self, name_s, args[0], block)\n end",
"title": ""
},
{
"docid": "4e105b12e917cf929db78094cc6c5b6f",
"score": "0.49714378",
"text": "def insert_value(value, node = nil, left = nil, right = nil)\n find_result = if node.nil? then find_value(value) else {:find => false} end #find node\n unless find_result[:find]\n node ||= @nodes[find_result[:node]]\n node.add(value)\n\n if left || right #add subtrees\n node.add_sub_tree(left)\n node.add_sub_tree(right)\n end\n\n if node.size>@max\n middle = node.keys[node.size/2] #find middle value\n left_node = Node.new\n right_node = Node.new\n add(left_node)\n add(right_node)\n\n node.keys.each do |item| #make new subtrees(copy value and value's subtrees)\n if item<middle\n left_node.add(item)\n left_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(item)]]) unless node.sub_trees[node.keys.index(item)].nil?\n end\n if item>middle\n right_node.add(item)\n right_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(item)+1]]) unless node.sub_trees[node.keys.index(item)+1].nil?\n end\n end\n\n # add middle_value's subtrees to left and right subtrees\n left_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(middle)]]) unless node.sub_trees[node.keys.index(middle)].nil?\n right_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(middle)+1]]) unless node.sub_trees[node.keys.index(middle)+1].nil?\n\n # add value to parent node or split if parent is root\n unless node.id==@root\n insert_value(middle, @nodes[node.parent], left_node, right_node)\n else\n new_root_node = Node.new\n add(new_root_node)\n new_root_node.add(middle)\n new_root_node.add_sub_tree(left_node)\n new_root_node.add_sub_tree(right_node)\n @root = new_root_node.id\n end\n node.id = -1 #delete old node\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "96c1d000467168b71287d9ca1296c6b8",
"score": "0.49675688",
"text": "def set(index, value)\n node = self\n\n # Traverse the tree to find the right node to add or replace the value.\n idx = index\n while node\n # Once we have reached a leaf node we can insert or replace the value.\n if node.is_leaf?\n if idx >= node.values.size\n node.fatal \"Set index (#{index}) larger than values array \" \\\n \"(#{idx} >= #{node.values.size}).\"\n end\n node.values[idx] = value\n return\n else\n # Descend into the right child node to add the value to.\n cidx = node.search_child_index(idx)\n if (idx -= node.offsets[cidx]).negative?\n node.fatal \"Idx (#{idx}) became negative while looking for \" \\\n \"index #{index}.\"\n end\n node = node.children[cidx]\n end\n end\n\n node.fatal 'Could not find proper node to set the value while ' \\\n \"looking for index #{index}.\"\n end",
"title": ""
},
{
"docid": "9ed6411c51e641f78502d49f86d9601b",
"score": "0.49517655",
"text": "def set_attr_value(xml, value)\n parent = @path.first(xml, ensure_created: true)\n value.each do |child|\n parent.elements.add(child)\n end\n end",
"title": ""
},
{
"docid": "7e0a420195106ce5ec1409608b204c4c",
"score": "0.49477947",
"text": "def set_node_value(x, v)\n x.value = v\n end",
"title": ""
},
{
"docid": "172a4d2cd1be0a3355ee4043282209a8",
"score": "0.49341795",
"text": "def multi_write path, content = {}\n path = join *path if path.is_a? Array\n mkdir path\n links = []\n p content\n parser = Proc.new do |scope, hash|\n hash.each do |key, value|\n\n # run it recursive\n if value.is_a? Hash\n mkdir join(scope, key.to_s)\n parser.call join(scope, key.to_s), value\n next\n end\n\n # if key starts with '_' - write value, else make links\n if key.to_s[0, 1] == '_' || value.kind_of?(Fixnum)\n write scope, key, 'set', value\n else\n # store links, becouse distanation node may not exists yet\n first = value.to_s[0, 1] == '/' ? value.to_s : join(scope, value.to_s)\n links << [first, join(scope, key.to_s)]\n end\n end\n end\n\n # run recursive runner\n #transaction_start\n parser.call path, content\n # make links\n links.each {|p| slink p[0], p[1] }\n #transaction_end\n end",
"title": ""
},
{
"docid": "40106225785b24e5d7975cd542facb3f",
"score": "0.48734647",
"text": "def set(index, value)\n if tree = @children[index]\n tree.tap { |t| t.value = value }\n else\n @children[index] = Tree.new(self, value)\n end\n end",
"title": ""
},
{
"docid": "77bd545ec2253dcd064d1b41fdff726d",
"score": "0.4863752",
"text": "def rebuild_tree_from_set\n all.each do |node|\n node.parent = node.ancestor\n node.save\n end\n end",
"title": ""
},
{
"docid": "c205312431ac9f41bee2156618582c0b",
"score": "0.48478088",
"text": "def set(path, value)\n path = path.split(/\\./) if path.is_a?(String)\n target = self\n while path.size > 1\n key = path.shift\n if !(target.key?(key) && target[key].is_a?(::Hash))\n target[key] = Sycl::Hash.new\n else\n target[key] = Sycl::Hash.from_hash(target[key])\n end\n target = target[key]\n end\n target[path.first] = value\n end",
"title": ""
},
{
"docid": "f7f386f4fbc0f6b3dd55ab120679a230",
"score": "0.48458084",
"text": "def setUtil( segStart, segEnd, ind, val, index)\n # set index lies outside the range of current segment.\n # So diff to its parent node will be zero.\n if (ind < segStart || ind > segEnd)\n return 0\n end\n # If the input index is in range of this node, then set the\n # value of the node and its children\n if (segStart == segEnd)\n if (segStart == ind)\n # Index that need to be set.\n diff = val - self.segArr[index]\n self.segArr[index] = val\n return diff\n else\n return 0\n end\n end\n mid = (segStart + segEnd) / 2\n diff = self.setUtil(segStart, mid, ind, val, 2 * index + 1) + self.setUtil(mid + 1, segEnd, ind, val, 2 * index + 2)\n # Current node value is set with diff. \n self.segArr[index] = self.segArr[index] + diff\n # Value of diff is propagated to the parent node.\n return diff\n end",
"title": ""
},
{
"docid": "c423f33797dccd3b0c10d1a81df4a185",
"score": "0.4837117",
"text": "def update!(**args)\n @children = args[:children] if args.key?(:children)\n @root = args[:root] if args.key?(:root)\n end",
"title": ""
},
{
"docid": "4f3d41e45742bf3182a70b2dd0fac78e",
"score": "0.48148632",
"text": "def test_deep_set\n\n h = { 'foo' => { 'bar' => { 'baz' => { 'fruit' => 'pineapple' } } } }\n\n Ruote.set(h, 'foo.bar.baz.fruit', 'orange')\n\n assert_equal(\n { \"foo\" => { \"bar\" => { \"baz\" => { \"fruit\" => \"orange\" } } } },\n h)\n end",
"title": ""
},
{
"docid": "0c7b47ef6cd1051001b7dea33f13c24e",
"score": "0.48119384",
"text": "def subst u, e\n u.each do |sub|\n if e.terms\n indx = e.terms.index(sub[0])\n if indx\n e.terms[indx] = sub[1]\n end\n end\n end\n e\n end",
"title": ""
},
{
"docid": "22ccebdd048573f042fcd33f4ff37096",
"score": "0.48079962",
"text": "def connect_variables_by_path (var1, var2, hierarchy, levels)\n path = build_property_path(hierarchy, levels)\n node_to_target = \"#{var1} #{path} #{var2} .\"\n extension = hierarchy['extension']\n\n unless extension.nil?\n other_path = \"\"\n if levels > 1\n one_hop_less = build_property_path(hierarchy, levels-1)\n other_path += \"#{one_hop_less} / \"\n end\n other_path += extension\n\n # no point in doing an union with the same predicate\n unless node_to_target.include? \"#{other_path}\"\n node_to_target = \"{ { #{node_to_target} } UNION { #{var1} #{other_path} #{var2} . } }\"\n end\n end\n\n node_to_target\n end",
"title": ""
},
{
"docid": "6c0e6e3c876d0bca999b5dd1d1a800ca",
"score": "0.4775161",
"text": "def recursive_set(actual, updates)\n updates.each_pair do |k, v|\n if v.respond_to?(:each_pair) && actual[k].respond_to?(:each_pair)\n recursive_set(actual[k], v)\n else\n actual[k] = v\n end\n end\n end",
"title": ""
},
{
"docid": "cd5f72b814e99105f5edd43aac0fc6c4",
"score": "0.4757653",
"text": "def set(vals)\n if vals.is_a? Hash\n vals = vals.map{|key, val| \"#{Qx.quote_ident(key)} = #{Qx.quote(val)}\"}.join(\", \")\n end\n @tree[:SET] = vals.to_s\n self\n end",
"title": ""
},
{
"docid": "8bb930740b50316e1fc857afb7f9d489",
"score": "0.4749878",
"text": "def register(key, subkey, value = nil)\n if value.nil?\n value = subkey\n subkey = key\n key = :root\n end\n resources(key)[subkey] = value\n end",
"title": ""
},
{
"docid": "323c59c03d946866d63a468412a2d2cd",
"score": "0.4747334",
"text": "def add_elements set, root\n set << root.name\n root.children.each do |child|\n add_elements set, child\n end\nend",
"title": ""
},
{
"docid": "5541c99188db6ab2083963773e36bde8",
"score": "0.47327444",
"text": "def set_children\n x = coord[0]\n y = coord[1]\n\n sgn, i, j = 1, 1, 2\n 2.times do\n 2.times do\n \tchildren << Coord.new([x+i*sgn, y+j*sgn]) if valid_coord?(x+i*sgn, y+j*sgn)\n \tchildren << Coord.new([x-i*sgn, y+j*sgn]) if valid_coord?(x-i*sgn, y+j*sgn)\n \ti,j = j,i\n end\n sgn = -1\n end\n\n set_parent\n end",
"title": ""
},
{
"docid": "bc76c21717afef1d797d9f0f8adde446",
"score": "0.47301432",
"text": "def []=(*p)\n if p.length == 2\n @nodes[p[0]] = p[1]\n elsif p.length == 3\n @nodes[p[0], p[1]] = p[2]\n end\n end",
"title": ""
},
{
"docid": "bc76c21717afef1d797d9f0f8adde446",
"score": "0.47301432",
"text": "def []=(*p)\n if p.length == 2\n @nodes[p[0]] = p[1]\n elsif p.length == 3\n @nodes[p[0], p[1]] = p[2]\n end\n end",
"title": ""
},
{
"docid": "12fed78890ff9e1e28c3583be2063350",
"score": "0.47284332",
"text": "def set(key, value)\n subkeys = key.split('.').reverse\n return false if subkeys.length == 0\n hash = {subkeys.shift.to_s => value}\n subkeys.each{|v|\n hash = {v.to_s => hash}\n }\n @config = @config.recursive_merge(hash)\n return true\n end",
"title": ""
},
{
"docid": "f6096ccf2c24af497d767a53377522da",
"score": "0.4724293",
"text": "def []=( *args )\n args[-1].parent = self\n @children[*args[0..-2]] = args[-1]\n end",
"title": ""
},
{
"docid": "290b3ad4f582043581507e88744357fe",
"score": "0.47237778",
"text": "def add_val(val)\n super\n self.last_node.next_node = self.first_node\n end",
"title": ""
},
{
"docid": "ebf6b3f90be122f703a0788ee749be29",
"score": "0.47100967",
"text": "def set_node_by_path(path, token)\n parent = self.node_for_path(path.butlast)\n parent[path.last] = [token]\n end",
"title": ""
},
{
"docid": "29d021c57096012095c383273325af4b",
"score": "0.46937668",
"text": "def set_tree_roots(items)\n @tree.set_roots(items)\n end",
"title": ""
},
{
"docid": "3033bb4d756e9ad19718480cfbc89395",
"score": "0.46857706",
"text": "def set_child_value(child, value)\n @child_keys[get_child_key(child)][:value] = value\n end",
"title": ""
},
{
"docid": "4f132ef4eb9ae5b919d0ae248f635201",
"score": "0.46850163",
"text": "def update_leaf_value(update_path, new_value)\n update_path.each { |path_entry| check_entry path_entry } \n check_update_path update_path\n \n @node_hashes[update_path.first] = new_value\n visit_update_path update_path do |hot_entry, cold_entry, parent_entry|\n hot_node = @node_ids[hot_entry]\n cold_node = @node_ids[cold_entry]\n parent_node = @node_ids[parent_entry]\n @node_hashes[parent_entry] = if HashTree.left_child?(hot_node)\n HashTree.node_hash parent_node, @node_hashes[hot_entry],\n @node_hashes[cold_entry]\n else\n HashTree.node_hash parent_node, @node_hashes[cold_entry],\n @node_hashes[hot_entry] \n end\n if HashTree.left_child?(hot_node)\n verify_children parent_entry, hot_entry, cold_entry\n else\n verify_children parent_entry, cold_entry, hot_entry\n end\n end\n self\n end",
"title": ""
},
{
"docid": "d3ef11434b833b7b5c071b386c70491c",
"score": "0.46804875",
"text": "def set(from, to, value)\n fi = nodes.index(from)\n ti = nodes.index(to)\n matrix[fi][ti] = value\n end",
"title": ""
},
{
"docid": "512d9a539582babc3b66b39c0f7b3616",
"score": "0.46734232",
"text": "def subnodes\n Array(from) + Array(to)\n end",
"title": ""
},
{
"docid": "549c6bd2b1c6429aa763e973e0f9edff",
"score": "0.4667022",
"text": "def set_value(*args)\n # Add support for legacy 3-parameter syntax\n if args.length > 3 || args.length < 2\n raise ArgumentError(\"wrong number of arguments (#{args.length} for 2-3)\")\n end\n values = args.pop\n get_term(args).set(values)\n end",
"title": ""
},
{
"docid": "6a466007dc920ab8ded3a18fb72056aa",
"score": "0.46641594",
"text": "def set_value(*args)\n # Add support for legacy 3-parameter syntax\n if args.length > 3 || args.length < 2\n raise ArgumentError, \"wrong number of arguments (#{args.length} for 2-3)\"\n end\n values = args.pop\n get_term(args).set(values)\n end",
"title": ""
},
{
"docid": "20e1651bd4b40cc4aabd382b98b8868f",
"score": "0.46637467",
"text": "def multiple_nodes(paths)\n # Finding common parents\n parents = {}\n paths.each do |path|\n (parent, node) = Tilia::Http::UrlUtil.split_path(path)\n unless parents.key? parent\n parents[parent] = [node]\n else\n parents[parent] << node\n end\n end\n\n result = {}\n\n parents.each do |parent, children|\n parent_node = node_for_path(parent)\n if parent_node.is_a?(IMultiGet)\n parent_node.multiple_children(children).each do |child_node|\n full_path = parent + '/' + child_node.name\n result[full_path] = child_node\n cache[full_path] = child_node\n end\n else\n children.each do |child|\n full_path = parent + '/' + child\n result[full_path] = node_for_path(full_path)\n end\n end\n end\n\n result\n end",
"title": ""
},
{
"docid": "bb9571fc8214f07711b8947ab9dc4a04",
"score": "0.46554232",
"text": "def deep_set(*keys, value)\n Gitlab::ConfigMash.auto_vivify do\n if keys.length == 1\n self[keys.first] = value\n else\n *keys, last = *keys\n keys.inject(self, :[])[last] = value\n end\n end\n end",
"title": ""
},
{
"docid": "12dbae8192c80f457b1954eb7a44fca4",
"score": "0.46526417",
"text": "def set_node_b(node, value)\n set_node node, encode(value)\n end",
"title": ""
},
{
"docid": "35c65fd63d827a4c4ee04d72d569ea56",
"score": "0.46384004",
"text": "def hiera_set(key, value)\n hiera_load.tap do |hiera|\n hiera[key] = value\n hiera_save(hiera)\n end\n end",
"title": ""
},
{
"docid": "35c65fd63d827a4c4ee04d72d569ea56",
"score": "0.46384004",
"text": "def hiera_set(key, value)\n hiera_load.tap do |hiera|\n hiera[key] = value\n hiera_save(hiera)\n end\n end",
"title": ""
},
{
"docid": "0c4325dc5f2e41b9557b1d80bfbf97fe",
"score": "0.46370587",
"text": "def set_attribute_on_node(node, key, value)\n key_parts = key.split('.')\n output_entry = key_parts[0...-1].inject(node.override) { |element, k| element[k] }\n output_entry[key_parts.last] = value\n end",
"title": ""
},
{
"docid": "fea28ffc5663f35fe358b194dd4f5c3b",
"score": "0.4633913",
"text": "def []=(index, value)\n node = find(index)\n node.value = value\n end",
"title": ""
},
{
"docid": "65175dc96e89c7a2eb3f8d6725ade97f",
"score": "0.46302345",
"text": "def store(path, value)\n splits = path.to_s.split('.')\n\n # Now, traverse down the given path. `node` acts as our reference.\n node = hash\n splits.each_with_index do |key, index|\n # Traverse further 'down' (or to the right, however you like it),\n # until we've found the place where to assign value to.\n\n if index < splits.size - 1\n node = node[key]\n else\n node[key] = value\n end\n end\n\n # Finally, deep merge the new hash into our state.\n state.deep_merge!(hash)\n end",
"title": ""
},
{
"docid": "525d05e4204bac97d9fa3bfd87513b19",
"score": "0.46262732",
"text": "def set_sub_path\n @sub_path = SubPath.find(params[:id])\n end",
"title": ""
},
{
"docid": "ab36d8c276d51555bb0b78593c7317c8",
"score": "0.46244544",
"text": "def initialize( value = nil ) #construcor and default value is nil \n @value = value #setting each values and child \n @left = nil\n @right = nil\n end",
"title": ""
},
{
"docid": "e6f14375814b10e628603b4c23efecc9",
"score": "0.46238288",
"text": "def base=(b)\n @base = RDF::URI.intern(b)\n @base.fragment = nil\n end",
"title": ""
},
{
"docid": "f7a50e789e314620f106b24850b303b9",
"score": "0.46185496",
"text": "def set(key, value)\n\t\t\t\t\tpath = \"#{@base_path}/#{key}\"\n\t\t\t\t\tstring = Marshal.dump value\n\t\t\t\t\n\t\t\t\t\tzk.set path, string\n\t\t\t\trescue ZK::Exceptions::NoNode\n\t\t\t\t\tzk.create path, string\n\t\t\t\tend",
"title": ""
},
{
"docid": "b3f30d3c8ab46171c40f65029f3b9682",
"score": "0.46184608",
"text": "def set_by_tag(base_tag)\n return self if base_tag.nil?\n @prefix = base_tag.prefix\n @suffix = base_tag.suffix\n @spaces = base_tag.spaces\n self\n end",
"title": ""
},
{
"docid": "c95aefd1db20cd6bd141eb87452035e9",
"score": "0.46065673",
"text": "def update_paths!\r\n paths = roots.collect do |root|\r\n root.full_set.collect {|node| [node.id, {'path' => node.send(:build_path)}] }\r\n end \r\n paths = Hash[*paths.flatten]\r\n update paths.keys, paths.values\r\n end",
"title": ""
},
{
"docid": "2a01ef24f1babdfa7739362a141a8976",
"score": "0.46032152",
"text": "def replace(*args)\n Node.replace_multiple self, self, *args\n end",
"title": ""
},
{
"docid": "19c4264894b8df2c2b106dd1d642150d",
"score": "0.46020967",
"text": "def recursive=(_arg0); end",
"title": ""
},
{
"docid": "d9cce32410c04965fa16ceefb2300527",
"score": "0.46002385",
"text": "def addInNode(value,node, level)\n temp_compare = @compare.call(value, node)\n \n #Verificamos que el arbol no cuente con elementos repetidos.\n if temp_compare == 0\n return\n end\n level += 1\n if temp_compare > 0 ##Ejecuta la lambda de comparacion\n if node.getRight() == nil\n temp = Node.new(value)\n temp.setLevel(level)\n node.setRight(temp)\n else \n addInNode(value, node.getRight(), level)\n end\n else\n if node.getLeft() == nil\n temp = Node.new(value)\n temp.setLevel(level)\n node.setLeft(temp)\n else \n addInNode(value, node.getLeft(), level)\n end\n end \n end",
"title": ""
},
{
"docid": "d7a5abffdad2aba7b847b5e017214b4e",
"score": "0.45923537",
"text": "def store key, val, node = root\n\n head = key[0..0] # divide and conquer\n tail = key[1..-1]\n\n found = node.children.select { |n| n.letter == head }.first # look for our letter in the children..\n found ||= node.add_child head # create a node for it if need be.\n\n if tail.empty? # we're done; save value\n found.value = val\n else # otherwise, keep dividing, keep conquering.\n store tail, val, found\n end\n end",
"title": ""
},
{
"docid": "795d19766e7399ee9c64bbdbc1fbcf72",
"score": "0.4581271",
"text": "def set_nodes\n #set nodes if node-fro or node-to is nul\n if node_from ='nul' || node_to ='nul'\n tmp = self.instance\n tmpAry = tmp.split(/\\p{Punct}/)\n self.node_from = tmpAry[0]\n self.node_to = tmpAry[1]\n self.section = [:node_from => tmpAry[0], :node_to => tmpAry[1]]\n end\n end",
"title": ""
},
{
"docid": "8f539cda101bbf5476a2d0d39f1c06fb",
"score": "0.45798093",
"text": "def multi_level_option_nodeset_ref(qing, cur_subq)\n \"instance('option_set_#{qing.option_set_id}')/options/\".tap do |ref|\n qing.subquestions.each do |subq|\n ref << 'opt'\n if subq == cur_subq\n break\n else\n ref << \"[value=/data/#{subq.odk_code}]/\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ccdd73ce389f0e2c602ea2d11e005b4a",
"score": "0.4576381",
"text": "def []=(pathset, value)\n set(pathset, value)\n end",
"title": ""
},
{
"docid": "4bdd4d960b8b566d1e6666b7f8f3c767",
"score": "0.45699644",
"text": "def set(key_path, value)\n keys = key_path.split('.')\n nested_hash = keys[0..-2].inject(@hash) { |hash, key| hash[key] }\n nested_hash[keys[-1]] = value\n rescue NoMethodError\n raise Arcanus::Errors::InvalidKeyPathError,\n \"Key path '#{key_path}' does not correspond to an actual key\"\n end",
"title": ""
},
{
"docid": "117156854274095d427119b82f1e3403",
"score": "0.45691532",
"text": "def base=(b)\n @base = RDF::URI.intern(b.to_s.split('#').first)\n end",
"title": ""
},
{
"docid": "6df3cd529ed089fd94e7c5b773ba493e",
"score": "0.45622438",
"text": "def []= (key, value)\n unless key =~ /.\\../\n super(key.to_sym, value)\n else\n k, *r = *split_key(key)\n sub = get_or_create_value(k)\n sub[join_keys(r)] = value\n end\n end",
"title": ""
},
{
"docid": "d9ce50a77773aa70f7a5a5ad8fa3c2f8",
"score": "0.456047",
"text": "def set(arg,value,overwrite=true)\n *key_path, last = arg.is_a?(String) ? arg.split(\".\") : arg\n if overwrite\n key_path.inject(self) { |h,key| h.has_key?(key) ? h[key] : h[key]={}} [last] = value\n else\n key_path.inject(self) { |h,key| h.has_key?(key) ? h[key] : h[key]={}} [last] ||= value\n end\n end",
"title": ""
},
{
"docid": "52992002ce7202ecc527587b0817294b",
"score": "0.4554765",
"text": "def []=(key, val)\n self.root = val if key?(key)\n end",
"title": ""
},
{
"docid": "0a6a900408456947f0f8318c9113bc06",
"score": "0.45502424",
"text": "def set_node_value_into_hash(path, hash, node_value)\n # build up hash structure incrementally to avoid forcing the caller to\n # explicitly insert all of the hashes described by the path.\n raise InvalidPathException, \"Cannot set the root node\" if (path.empty? || path[0].empty?)\n parent_path = []\n path[0..-2].each do |element|\n raise InvalidPathException, \"At least one path element was empty\" if element.empty?\n parent_path << element\n parent_node = get_node_value_from_hash(parent_path, hash)\n if parent_node.nil? || false == parent_node.respond_to?(:has_key?)\n node_by_path = set_node_by_path_statement(parent_path)\n instance_eval \"#{node_by_path} = {}\"\n end\n end\n\n # insert node value.\n node_by_path = hash.respond_to?(:normal) ? set_node_by_path_statement(path) : get_node_by_path_statement(path)\n instance_eval \"#{node_by_path} = node_value\"\n\n true\n end",
"title": ""
},
{
"docid": "4170fe56f3437c143ab7bad33e53b37c",
"score": "0.4544806",
"text": "def store(key, val, node = root)\n\n head = key[0..0] # divide and conquer\n tail = key[1..-1]\n\n found = node.children.find { |n| n.letter == head } # look for our letter in the children..\n found ||= node.add_child head # create a node for it if need be.\n\n if tail.empty? # we're done; save value\n found.value = val\n else # otherwise, keep dividing, keep conquering.\n store tail, val, found\n end\n end",
"title": ""
},
{
"docid": "34e7bfc99db7a1fd1b2a937772aacb7d",
"score": "0.45420754",
"text": "def set_nodes nodes\n @nodes = nodes\n end",
"title": ""
},
{
"docid": "360379ebcd8a69b013f982d55520e257",
"score": "0.45375705",
"text": "def visit_node(path, x, y)\n @setOfNodes << path + [[x, y]]\n end",
"title": ""
},
{
"docid": "386108d5fa9f076af341cbe9c5735f3d",
"score": "0.45298088",
"text": "def set(arg, value, overwrite = true)\n *key_path, last = arg.is_a?(String) ? arg.split(\".\") : arg\n if overwrite\n key_path.inject(self) { |h, key| h.key?(key) ? h[key] : h[key] = {} } [last] = value\n else\n key_path.inject(self) { |h, key| h.key?(key) ? h[key] : h[key] = {} } [last] ||= value\n end\n end",
"title": ""
},
{
"docid": "8a5f7285d141a8003df73f8ed38f99dd",
"score": "0.4527377",
"text": "def set_path_node(x, y)\n set_node(x, y, :path)\n end",
"title": ""
},
{
"docid": "8efb08a00e0e71702a58a9f3d206a7c6",
"score": "0.45176172",
"text": "def bridge(paths)\n paths = paths.map { |a| [a, nil] }.to_h if paths.is_a?(Array)\n paths.each do |path, value|\n parts = path.to_s.split(/(?<=[^\\\\])\\./)\n node = self\n next_part = false\n until next_part.nil?\n part = next_part || process_bridge_part(parts.shift)\n next_part = process_bridge_part(parts.shift)\n if node.child_exists?(part)\n if next_part.is_a?(Integer)\n next_next = process_bridge_part(parts.first)\n if next_next.is_a?(Integer)\n node[part][next_part] = [] unless node[part][next_part] && node[part][next_part].node_class == Array\n else\n node[part][next_part] = {} unless node[part][next_part] && node[part][next_part].node_class == Hash\n end\n end\n next_part.nil? ? node[part] = value : node = node.child(part)\n else\n if next_part.nil?\n node[part] = value\n else\n node[part] = next_part.is_a?(Integer) ? Array.new(next_part) : {}\n end\n node[part][next_part] = process_bridge_part(parts.first).is_a?(Integer) ? [] : {} if next_part.is_a?(Integer)\n node = node[part]\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "f803bd10eea645f6c21d72f0827f8782",
"score": "0.4516421",
"text": "def do_set (opts)\n\tsubscripts = evaluate_subscripts true\n\tif subscripts.empty?\n\t # Treat expression[] as expression\n\t rubyversed(@base).evaluate opts\n\telsif opts[:method] != '?=' ||\n\t rubyversed(@base).evaluate.in_rubyverse(@template)[*subscripts,\n\t {}].nil?\n\t # Assign if unconditional or unset\n\t params = opts[:parameters]\n\t params = params[0] if params.is_a? LtdTemplate::Univalue\n\t rubyversed(@base).evaluate.in_rubyverse(@template)[*subscripts,\n\t {}] = params\n\tend\n\tnil\n end",
"title": ""
},
{
"docid": "88f13c732345eedea7a6153155f66bec",
"score": "0.45137754",
"text": "def set_reference(path, value)\n Util.type_check(\"path\", path, String)\n value = value.is_a?(Array) ? value : [value]\n\n self[path] = value\n .map { |val|\n case val.class\n when String\n val\n when Built::Object\n val.is_new? ? val : val.uid\n else\n nil\n end\n }\n .compact\n\n self\n end",
"title": ""
},
{
"docid": "80acf51247d64b7d769423b2c5420bd6",
"score": "0.45129055",
"text": "def []= *keys, value\n nested_aset keys.map(&:to_s), value\n end",
"title": ""
},
{
"docid": "634721ef8431a1c61f897bf54082c922",
"score": "0.45077124",
"text": "def []=(full_key, node); end",
"title": ""
},
{
"docid": "e82b1045c1cff00e9dbc96f9d550ffeb",
"score": "0.45031464",
"text": "def []= index, value\n\t\t@children[index] = value\n\tend",
"title": ""
},
{
"docid": "2d2494fa4120b47e70b933d2065d0ced",
"score": "0.4502228",
"text": "def merge_across_nodes=(value)\n @merge_across_nodes = value\n end",
"title": ""
},
{
"docid": "24c6f6993b3a402ae7ad567d03b68075",
"score": "0.44968033",
"text": "def rutaAux(level,subtree,isTerminal,subArboles,rutaSubArbolesAux,\n levelToCroosover)\n # Selecciona al subarbol para cruzarlo\n childNodes = subtree.out_degree\n newChild = rand(childNodes)\n # Checo los casos para escoger por donde irme.\n \n #Si es terminal y hoja, entonces escogo ese nodo.\n if (isTerminal && subtree.children[newChild].is_leaf?) then \n subArboles.push(subtree.children[newChild].clone)\n rutaSubArbolesAux << newChild\n return\n else\n # Si es terminal, pero no hoja entonces simplemente\n # sigo bajando por el arbol hasta encontrar una hoja\n if (isTerminal) then\n rutaAux(level+1,subtree.children[newChild],isTerminal,subArboles,\n (rutaSubArbolesAux.push(newChild)),levelToCroosover)\n return\n else\n # Si estoy en el nivel a cruzar, escogo ese nodo como\n # punto de cruza.\n if (levelToCroosover == level + 1) then\n subArboles.push(subtree.children[newChild].clone)\n rutaSubArbolesAux << newChild\n return\n else\n # Si no llegue a una funcion antes de intentar llegar\n # al nivel donde se va a mutar, escogo\n # en nodo padre de la hoja\n if (subtree.children[newChild].is_leaf?) then \n subArboles.push(subtree.clone)\n return\n else\n if (!isTerminal && (levelToCroosover != level + 1)) then\n # Si no paso a ningun caso anterior sigo bajando\n rutaAux(level+1, subtree.children[newChild],isTerminal,subArboles,\n rutaSubArbolesAux << newChild,levelToCroosover)\n return\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9dd39931d0c0bfd558ed64c3a91d8c67",
"score": "0.44930887",
"text": "def split_subpath(path, subpath); end",
"title": ""
},
{
"docid": "9dd39931d0c0bfd558ed64c3a91d8c67",
"score": "0.44930887",
"text": "def split_subpath(path, subpath); end",
"title": ""
},
{
"docid": "178385c103e7e5d1640d39a518c676af",
"score": "0.44927818",
"text": "def create_or_update_node(value, id)\n if nodes[value]\n @nodes[value].add id\n else\n @nodes[value] = Set.new [id]\n end\n end",
"title": ""
},
{
"docid": "e32c5a05d2aba97363da1c35a16028c2",
"score": "0.44918454",
"text": "def set_specific(target_node, doc)\n doc.each do |key, value|\n options = target_node.xpath(key)\n options.each do |option|\n if value.class == Hash\n value.each do |subnode|\n add_specific(option, subnode)\n end\n elsif value.class == String\n option.content = value\n break\n elsif value.class == Array\n option.content = \"\"\n value.each do |line|\n option.content += \";#{line}\"\n end\n break\n else\n puts \"not support by set_specific #{value}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96aaf7a249e5635e7aece29551760bdf",
"score": "0.44888955",
"text": "def setter_to_getter(node); end",
"title": ""
},
{
"docid": "c88bfdbbac12e2ba88641658d48c0ac9",
"score": "0.44845346",
"text": "def set(value)\n within @root_element do\n choose(value)\n end\n end",
"title": ""
}
] |
4eb303c9cdd8a70f4c3a4d251284db34
|
Return a class object. If a class is given, return it directly. Treat strings and symbols as class names. If nil is given or an invalid class name string or symbol is used, return self. Raise an error for other types.
|
[
{
"docid": "cd54fbecfea017853e834ec03c82c1e5",
"score": "0.6539884",
"text": "def sti_class(v)\n case v\n when String, Symbol\n constantize(v) rescue self\n when nil\n self\n when Class\n v\n else\n raise(Error, \"Invalid class type used: #{v.inspect}\")\n end\n end",
"title": ""
}
] |
[
{
"docid": "555695ebb588eb074ce2d114058d8a6d",
"score": "0.65949273",
"text": "def class_for(cls)\n return nil unless cls # superclass will return nil when none\n fqn = cls.qualified_type_name\n return classes[fqn] if classes[fqn]\n classes[fqn] = JClass.parse(self, cls)\n end",
"title": ""
},
{
"docid": "14475dd855687e470e3555a472a30ec4",
"score": "0.6382051",
"text": "def get_class(class_name)\n klass = Module.const_get(class_name)\n return nil unless klass.is_a?(Class)\n return klass\n rescue NameError\n return nil\n end",
"title": ""
},
{
"docid": "23feb8759fc27ed58dae19bad68479bf",
"score": "0.62158936",
"text": "def get_class(name)\n # 'self' -- the class from which get_class is called.\n self.const_get(name)\n end",
"title": ""
},
{
"docid": "a513acb6a0efc14a2329d3cdfa24d674",
"score": "0.6117075",
"text": "def to_class\n\t\tObject.const_get(self)\n\t\t#ret = eval(self)\n\t\t#deb \"this is a class? cls=#{ret.class}\"\n\t\t#raise \"Exception its not a class!\" if ret.class.to_s != 'Class'\n\t\t#return ret\n\tend",
"title": ""
},
{
"docid": "2506738989aea7dfdd5f5525524a3f6c",
"score": "0.6080051",
"text": "def class_from_string(class_name)\n parts = class_name.split('::')\n constant = Object\n parts.each do |part|\n constant = constant.const_get(part)\n end\n constant\nend",
"title": ""
},
{
"docid": "9bd88f79fb04643af32132097ad548b7",
"score": "0.603735",
"text": "def find_class(class_name)\n begin\n klass = Module.const_get(class_name)\n return (klass.is_a?(Class) ? klass : nil)\n rescue NameError\n return nil\n end\n end",
"title": ""
},
{
"docid": "153e2d27b23e11988c89c10600d42886",
"score": "0.60168916",
"text": "def get_class_by_name( name )\n raise \"get_class_by_name #{name}.#{name.class}\" unless name.is_a?(Symbol)\n c = classes[name]\n #puts \"MISS, no class #{name} #{name.class}\" unless c # \" #{classes}\"\n #puts \"CLAZZ, #{name} #{c.get_type.get_length}\" if c\n c\n end",
"title": ""
},
{
"docid": "54d300310e7d13b930c219b7eb980845",
"score": "0.6005243",
"text": "def to_class(name)\n return name unless name.is_a? String\n\n # NOTE: DO NOT try to use const_defined? and const_get EVER.\n # This is Rails, use constantize\n name.constantize\n rescue NameError\n Logger.error \"`#{name}` is not a valid Class name.\"\n end",
"title": ""
},
{
"docid": "4bfb78b065a124cd4f2f07e66035502b",
"score": "0.5994274",
"text": "def get_class(cname, mdl = Processor)\n mdl.const_get(cname.split(/[\\,\\_]/).map { |p| p.capitalize }.join)\n rescue NameError\n return nil\n end",
"title": ""
},
{
"docid": "ede8afa95fbe8f1a170ca47aa2b492ad",
"score": "0.59548664",
"text": "def resolve_class object\n ::Class === object ? object : (::String === object ? (class_for_name object) : nil)\n end",
"title": ""
},
{
"docid": "1f416b0090fe03ff6a8dd4874c1578b9",
"score": "0.5907587",
"text": "def object_class(opts)\n return unless opts[:class]\n opts[:class].is_a?(String) ? opts[:class].constantize : opts[:class]\n end",
"title": ""
},
{
"docid": "24e56e69eb3764359561b1cc77ef5160",
"score": "0.58821005",
"text": "def get_class_ref(class_name)\n klass = Kernel\n class_name.split(\"::\").each do |name|\n if klass.const_defined? name\n klass = klass.const_get(name)\n else\n return nil\n end\n end\n klass\n end",
"title": ""
},
{
"docid": "0fe1564a1d02888d9878923ba970c5a3",
"score": "0.586447",
"text": "def get_class(class_name)\n Module.const_get(class_name)\n rescue\n nil\n end",
"title": ""
},
{
"docid": "69debdb59596c0c0a00de8c7ede8333a",
"score": "0.58600473",
"text": "def class_via(*args, &blk)\n klass = Class.new(*args)\n klass.class_eval(&blk) unless blk.blank?\n return klass\n end",
"title": ""
},
{
"docid": "f9fce75ff0c9ebfd9b0039039ee5c06b",
"score": "0.58564246",
"text": "def get_or_create_class name\n raise \"uups #{name}.#{name.class}\" unless name.is_a? Symbol\n c = @classes[name]\n unless c\n c = BootClass.new(name)\n @classes[name] = c\n end\n c\n end",
"title": ""
},
{
"docid": "2b85a62091c3099e4a8044e0091b1138",
"score": "0.5838483",
"text": "def get_classobj(classname, lang, pi)\n classname ||= \"E#{lang}\"\n base_module = pi ? Erubis::PI : Erubis\n begin\n klass = base_module.const_get(classname)\n rescue NameError\n klass = nil\n end\n unless klass\n if lang\n msg = \"-l #{lang}: invalid language name (class #{base_module.name}::#{classname} not found).\"\n else\n msg = \"-c #{classname}: invalid class name.\"\n end\n raise CommandOptionError.new(msg)\n end\n return klass\n end",
"title": ""
},
{
"docid": "79ec5fd93663ba559d73f4a33b507f2d",
"score": "0.5836436",
"text": "def get_class(name)\n name.split(/::/).inject(Object) { |p, n| p.const_get(n) } \n end",
"title": ""
},
{
"docid": "45ba49a9257539948421bb050da2fc5c",
"score": "0.5764832",
"text": "def klass\n @klass ||= compute_class(class_name)\n end",
"title": ""
},
{
"docid": "45ba49a9257539948421bb050da2fc5c",
"score": "0.5764832",
"text": "def klass\n @klass ||= compute_class(class_name)\n end",
"title": ""
},
{
"docid": "45ba49a9257539948421bb050da2fc5c",
"score": "0.5764832",
"text": "def klass\n @klass ||= compute_class(class_name)\n end",
"title": ""
},
{
"docid": "b70fab9498049e67533f61a80cfc1250",
"score": "0.57395667",
"text": "def get_class_by_name!(name , super_class = :Object)\n c = get_class_by_name(name)\n return c if c\n create_class( name ,super_class)\n end",
"title": ""
},
{
"docid": "0555794e365dbb5dd514da6c1ee224d1",
"score": "0.5737905",
"text": "def search_class\n klass = if args[1]\n target.eval(args[1])\n else\n target_self\n end\n\n klass.is_a?(Module) ? klass : klass.class\n end",
"title": ""
},
{
"docid": "d1c70600352bc8ecb5080ed07ac7fe99",
"score": "0.57339233",
"text": "def class_name_from_options_object_or_class_name(class_name, options={})\n if options.has_key?(:object)\n options[:object].class\n else\n klass = class_name.to_s.classify.constantize\n end \n end",
"title": ""
},
{
"docid": "d7b9db0663025469e56e861f83c3e3e1",
"score": "0.5726972",
"text": "def find_class_named name\n return self if full_name == name\n return self if @name == name\n\n @classes.values.find do |klass|\n next if klass == self\n klass.find_class_named name\n end\n end",
"title": ""
},
{
"docid": "5f75a36444fb322a996826f4cedf5628",
"score": "0.57152474",
"text": "def class_for_name qualified_name\n raise unless ::Class === (resolved = ::Object.const_get qualified_name, false)\n resolved\n rescue\n raise ::NameError, %(Could not resolve class for name: #{qualified_name})\n end",
"title": ""
},
{
"docid": "43d8443837f7cde1efa3a722fce73156",
"score": "0.56737673",
"text": "def determine_class_for names\n klass = names.first\n if AX.const_defined? klass, false\n AX.const_get klass\n else\n create_class *names\n end\n end",
"title": ""
},
{
"docid": "b39255c2dc644f4a3a1b26c05407c4d0",
"score": "0.5644969",
"text": "def class_declaration\n name = consume(:identifier, 'Expect class name.')\n\n superclass = nil\n if match?(:less)\n consume(:identifier, \"Expect superclass name.\")\n superclass = Ringo::Variable.new(previous)\n end\n\n consume(:lbrace, \"Expect '{' before class body.\")\n methods = []\n while !check?(:rbrace) && !at_end?\n methods << function_declaration('method')\n end\n\n consume(:rbrace, \"Expect '}' after class body.\")\n return Ringo::Class.new(name, superclass, methods)\n end",
"title": ""
},
{
"docid": "2e4b09f9cf5062df2674212c3d3eb039",
"score": "0.5637769",
"text": "def klass\n @klass ||= begin\n @klass_name.split('::').inject(Object){|n,i| n.const_get(i)}\n rescue NameError => e\n end\n end",
"title": ""
},
{
"docid": "a169f2ee7751c96a28c6f28292132d9f",
"score": "0.5582169",
"text": "def create_class( name , superclass = nil )\n raise \"create_class #{name.class}\" unless name.is_a? Symbol\n superclass = :Object unless superclass\n raise \"create_class #{superclass.class}\" unless superclass.is_a? Symbol\n type = get_type_by_class_name(superclass)\n c = Class.new(name , superclass , type )\n classes[name] = c\n end",
"title": ""
},
{
"docid": "2d3a687c3f3d2c9c66ddbd5dccb3615c",
"score": "0.5537252",
"text": "def klass\n @klass ||=\n if klass_name\n klass_name.constantize\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "ed53cdb46006cec6e6ced60e996d53bd",
"score": "0.5499885",
"text": "def get_class type\n case type\n when Class\n type\n when BaseModel\n type.my_class\n when String, Symbol\n return get_class send(\"#{type}_model\") if [:subject, :object, :join].include?(type.to_sym)\n type.to_s.constantize\n else\n raise \"Can't determine a class from: #{type}\"\n end \n end",
"title": ""
},
{
"docid": "a3905004d8b87979b863d637e59de247",
"score": "0.5432205",
"text": "def class_name\n @class_name ||= (@options[:class_name] || @name).to_s.camelize\n end",
"title": ""
},
{
"docid": "e421dafaefecb6fca03b157573c6c223",
"score": "0.54161364",
"text": "def required_class\n return @required_class if defined?(@required_class)\n @required_class = @required_class_name.split(\"::\").inject(Object, :const_get)\n end",
"title": ""
},
{
"docid": "714c9791a7901f25edada372b3a40488",
"score": "0.5411687",
"text": "def build_class(*args, &block)\n if @class_builder\n @class_builder.call(*args, &block)\n else\n self\n end\n end",
"title": ""
},
{
"docid": "e007f3596740e2d1eaf4475678026b3c",
"score": "0.54081434",
"text": "def class_by_name name\n # http://stackoverflow.com/questions/14070369/how-to-instantiate-class-from-name-string-in-rails\n Object.const_get name.to_s\n\n end",
"title": ""
},
{
"docid": "d399989a24ef448e48f3adca830b6a71",
"score": "0.5403746",
"text": "def string_to_class string\n chain = string.split \"::\"\n i=0\n res = chain.inject(Module) do |ans,obj|\n break if ans.nil?\n i+=1\n klass = ans.const_get(obj)\n # Make sure the current obj is a valid class\n # Or it's a module but not the last element,\n # as the last element should be a class\n klass.is_a?(Class) || (klass.is_a?(Module) and i != chain.length) ? klass : nil\n end\nrescue NameError\n nil\nend",
"title": ""
},
{
"docid": "4ac577da77386312760cc1ad9f9baf4b",
"score": "0.5403483",
"text": "def clazz( name )\n\t\t\t\tKesh::ArgTest::type( \"name\", name, String )\n\t\t\t\tKesh::ArgTest::stringLength( \"name\", name, 1 )\t\t\t\n\t\t\t\treturn Kesh::Loader::ClassInfo.new( self, name )\n\t\t\tend",
"title": ""
},
{
"docid": "4850737747a50523479cc0996f7d0c0b",
"score": "0.53909594",
"text": "def klass\n @klass ||= class_name.constantize\n end",
"title": ""
},
{
"docid": "4850737747a50523479cc0996f7d0c0b",
"score": "0.53909594",
"text": "def klass\n @klass ||= class_name.constantize\n end",
"title": ""
},
{
"docid": "b03554870f5c484e10780c2a03282494",
"score": "0.5368254",
"text": "def get_as_class_name ruby_class_name\n mapping = @ruby_mappings[ruby_class_name]\n return mapping.nil? ? nil : mapping.as\n end",
"title": ""
},
{
"docid": "972cc442d169d0bdd19cf97018025810",
"score": "0.53675157",
"text": "def convert_to_class(klass)\n @class_cache[klass] ||= Object.const_get(camelize(klass))\n rescue NameError\n raise Traitor::Error.new(\"Tried to create a #{camelize(klass)}, but it does not exist!\")\n end",
"title": ""
},
{
"docid": "d5c61701dc7532ee4bb41f8fa194e2a5",
"score": "0.5352468",
"text": "def find_class_named name\n @classes_hash[name]\n end",
"title": ""
},
{
"docid": "1d93ac9b35052b12085219051104348d",
"score": "0.5349414",
"text": "def to_class(item)\n return item if item.nil? || item.is_a?(Class)\n name = item.is_a?(Symbol) ? item.to_s : item\n name = name.class.to_s unless name.is_a?(String)\n name.underscore.delete_suffix('_controller').classify.safe_constantize or\n Log.warn { \"#{__method__}: invalid: #{item.inspect}\" }\n end",
"title": ""
},
{
"docid": "1e152f72c74af2dd168ac801d0d57b59",
"score": "0.53445506",
"text": "def klass\r\n unless @klass\r\n require class_file\r\n @klass = lookup_class\r\n @klass.spec = self\r\n end\r\n @klass\r\n end",
"title": ""
},
{
"docid": "cf81eb4cdfea69e8dcd38c492f5b1096",
"score": "0.5319191",
"text": "def get_class_for(symb, default)\n (read_attribute(symb).presence || default).constantize\n end",
"title": ""
},
{
"docid": "71f84eb35d77b661ee46a8d6f740787f",
"score": "0.5293482",
"text": "def get_as_class_name obj\n # Get class name\n if obj.is_a?(String)\n ruby_class_name = obj\n elsif obj.is_a?(RocketAMF::Values::TypedHash)\n ruby_class_name = obj.type\n elsif obj.is_a?(Hash)\n return nil\n elsif obj.is_a?(RubyAMF::IntermediateObject)\n ruby_class_name = obj.object.class.name\n else\n ruby_class_name = obj.class.name\n end\n\n # Get AS class name\n as_class_name = @mappings.get_as_class_name ruby_class_name\n\n # Auto-map if necessary, removing namespacing to create mapped class name\n if RubyAMF.configuration.auto_class_mapping && ruby_class_name && as_class_name.nil?\n as_class_name = ruby_class_name.split('::').pop\n @mappings.map :as => as_class_name, :ruby => ruby_class_name\n end\n\n as_class_name\n end",
"title": ""
},
{
"docid": "8ea1f0a56f0d5cb9e4c683ececf67a05",
"score": "0.5279381",
"text": "def model_from_options #nodoc\n @options[:class_name].nil? ? nil : @options[:class_name].constantize\n end",
"title": ""
},
{
"docid": "43745a29d47b07051c92cf3800d6e9f0",
"score": "0.5274312",
"text": "def defclass\n rule(Stone::AST::Statement::Class).sep('class').identifier(reserved)\n .option(rule.sep('extends').identifier(reserved))\n .ast(class_body)\n end",
"title": ""
},
{
"docid": "92a7ad3bb4484acf9e50e28b0f596994",
"score": "0.5270996",
"text": "def get_type_by_class_name(name)\n clazz = get_class_by_name(name)\n return nil unless clazz\n clazz.instance_type\n end",
"title": ""
},
{
"docid": "d6e3867104f4507a2b6a9e2b8026504a",
"score": "0.5216475",
"text": "def klass\n @klass ||= @options[:klass] || __get_class_value(:klass)\n end",
"title": ""
},
{
"docid": "3c6c3ef4eb4cbf4a0045e6a102473ffa",
"score": "0.52124393",
"text": "def namespaced_class(symbol_name)\n\t\tpath = self\n\t\t_internal_namespaced_class(path, symbol_name)\n\tend",
"title": ""
},
{
"docid": "251d7b926517331697dfb10801687504",
"score": "0.51883036",
"text": "def resource_class\n case @options[:class]\n when false\n name.to_sym\n when nil\n namespaced_name.to_s.camelize.constantize\n when String\n @options[:class].constantize\n else\n @options[:class]\n end\n end",
"title": ""
},
{
"docid": "edeed2e8c52afe674c0a0b8fd5e0f21b",
"score": "0.51881063",
"text": "def typecast_to_class(value)\n value.to_s.constantize\n rescue NameError\n nil\n end",
"title": ""
},
{
"docid": "070db32534a2b4f0ea802004d2e0c8b5",
"score": "0.5161219",
"text": "def klass\n class_name = self[\"_type\"]\n class_name ? class_name.constantize : nil\n end",
"title": ""
},
{
"docid": "1f80754d3254fba430ea28d40ebd8779",
"score": "0.51457953",
"text": "def lookup_class\r\n ObjectSpace.each_object(Class) do |obj|\r\n return obj if obj.ancestors.include?(Rails::Generator::Base) and\r\n obj.name.split('::').last == class_name\r\n end\r\n raise NameError, \"Missing #{class_name} class in #{class_file}\"\r\n end",
"title": ""
},
{
"docid": "c0256c7c86a1711e704c9ec930795362",
"score": "0.5136119",
"text": "def class_from_name\n if model_name.to_s.include? \"_\"\n ns, *klass = model_name.to_s.split(\"_\").collect(&:camelize)\n begin\n \"#{ns}::#{klass.join(\"\")}\".constantize\n rescue NameError\n \"#{ns}#{klass.join(\"\")}\".constantize\n end\n else\n model_name.to_s.camelize.constantize\n end\n end",
"title": ""
},
{
"docid": "7618d1c2f4be675933534db10bc1e1c3",
"score": "0.5125784",
"text": "def klass(a_kind=nil)\n ordered_subclasses.each do |sc|\n return sc if !a_kind.blank? && sc.kind == a_kind.to_sym\n end\n Kase\n end",
"title": ""
},
{
"docid": "7618d1c2f4be675933534db10bc1e1c3",
"score": "0.5125784",
"text": "def klass(a_kind=nil)\n ordered_subclasses.each do |sc|\n return sc if !a_kind.blank? && sc.kind == a_kind.to_sym\n end\n Kase\n end",
"title": ""
},
{
"docid": "7618d1c2f4be675933534db10bc1e1c3",
"score": "0.5125784",
"text": "def klass(a_kind=nil)\n ordered_subclasses.each do |sc|\n return sc if !a_kind.blank? && sc.kind == a_kind.to_sym\n end\n Kase\n end",
"title": ""
},
{
"docid": "db83ffda3e752a45bb57226d8c2cfa4d",
"score": "0.5121805",
"text": "def BaseClass(name)\n name == \"string\" ? String : Object\nend",
"title": ""
},
{
"docid": "db83ffda3e752a45bb57226d8c2cfa4d",
"score": "0.5121805",
"text": "def BaseClass(name)\n name == \"string\" ? String : Object\nend",
"title": ""
},
{
"docid": "e6361be61f57fa9bfb7ba015e4b61ef5",
"score": "0.51215255",
"text": "def path_to_class(path, base_class=nil)\n class_name = path.classify\n klass = class_name.safe_constantize\n return klass if klass.present? && klass.kind_of?(Class)\n raise \"Class #{class_name.inspect} constant already exists as a #{klass.name} and is not a class.\" if klass.present?\n path_mod = class_module(path)\n class_mod_name = class_name.demodulize\n if base_class.present?\n klass = path_mod.const_set(class_mod_name, Class.new(base_class))\n else\n klass = path_mod.const_set(class_mod_name, Class.new)\n end\n raise \"Could not create class #{class_name.inspect} in module #{path_mod.inspect}.\" if klass.blank?\n klass\nend",
"title": ""
},
{
"docid": "a6ae158c6e8ef24aa43eec79deb834a9",
"score": "0.5095597",
"text": "def class_from_type(type)\n send(\"#{type}_class\") if respond_to?(\"#{type}_class\")\n end",
"title": ""
},
{
"docid": "095f564d6949643e86b8205aaf29286d",
"score": "0.50933844",
"text": "def to_const\n [Module, Class].any? { |base| self.class == base } ? self : self.class\n end",
"title": ""
},
{
"docid": "8d60da2d53b550597d5151956de5abd1",
"score": "0.5078242",
"text": "def find_class_or_module name\n name = $' if name =~ /^::/\n @classes_hash[name] || @modules_hash[name]\n end",
"title": ""
},
{
"docid": "34ee3176df7480bd0f36985ff83abd7a",
"score": "0.50599587",
"text": "def class_name\n @class_name ||= (options[:class_name] || derive_class_name).to_s\n end",
"title": ""
},
{
"docid": "34ee3176df7480bd0f36985ff83abd7a",
"score": "0.50599587",
"text": "def class_name\n @class_name ||= (options[:class_name] || derive_class_name).to_s\n end",
"title": ""
},
{
"docid": "cc2062bdb3d780aba31ea77701fa09c2",
"score": "0.5058811",
"text": "def classByName(className)\r\n\t\t# we keep a blacklist of classes. For instance\r\n\t\t# if you are using say QT, you'll have constant references\r\n\t\t# to QObject, that is not in your tag files.\r\n\t\t# to avoid checking all the tags looking for this class\r\n\t\t# each time that I'm asked for it, I just blacklist it once for all.\r\n\t\t# this happened with KoRect in kword, and the time went from\r\n\t\t# 12 seconds to instantaneous...\r\n\t\t#return nil if @blacklist.include?(className)\r\n\t\t@classTags.each { |tag|\r\n\t\t\t\t#puts \"classByName: found \" + tag.name\r\n\t\t\tif (tag.name == className)\r\n\t\t\t\treturn tag\r\n\t\t\tend\r\n\t\t}\r\n\t\t\r\n\t\treturn nil\r\n\tend",
"title": ""
},
{
"docid": "baf7d474b104dbe112ff00a1a7085141",
"score": "0.5055085",
"text": "def has_class?(name)\n @class_syms ||= classes.map(&:to_sym)\n @class_syms.include?(name.to_sym)\n end",
"title": ""
},
{
"docid": "c18fddfcb9b86b84a0851a10a5c81787",
"score": "0.50544685",
"text": "def namespaced_class(symbol_name)\n\t\tpath = self.class\n\t\tself.class._internal_namespaced_class(path, symbol_name)\n\tend",
"title": ""
},
{
"docid": "06f5ed938d54b10ae292e3a130691abf",
"score": "0.50382775",
"text": "def class_for(type)\n klass = type.to_s.classify.constantize rescue nil\n return klass if self.subclasses.include? klass\n end",
"title": ""
},
{
"docid": "59962bdf6f9455231c300b9b93211df7",
"score": "0.5034781",
"text": "def class_constant(superclass=nil, opts={}, &block)\n symc = ((opts && opts[:preserve]) ? (\"#{self.camelcase}Class\") : \"PoolParty#{self.camelcase}Class\").classify\n\n kla=<<-EOE\n class #{symc} #{\"< #{superclass}\" if superclass}\n end\n EOE\n \n Kernel.module_eval kla\n klass = symc.constantize\n klass.module_eval &block if block\n \n klass\n end",
"title": ""
},
{
"docid": "ca337b60394763a59f5628b8da4b476f",
"score": "0.50299084",
"text": "def clazz\n Module.const_get(name)\n rescue NameError\n nil\n end",
"title": ""
},
{
"docid": "58188174c40f07fe5fe7d10f0e8e4900",
"score": "0.50269043",
"text": "def class_const(sym)\n self.class.const_get(sym)\n end",
"title": ""
},
{
"docid": "79d18b1fae2a14b2f9a1c488901fef4a",
"score": "0.5022178",
"text": "def resource_class\n case class_name\n when false then\n name.to_sym\n when String then\n class_name.constantize\n else\n raise ArgumentError, \"unexpected class_name: #{class_name}\"\n end\n end",
"title": ""
},
{
"docid": "7d8e3ac642ef947d72130b8ce2ac83e9",
"score": "0.5013675",
"text": "def class_for(code_object)\n class_name = code_object.class.to_s.split('::').last\n const_get(class_name)\n end",
"title": ""
},
{
"docid": "d0b54967682d0390abbc79dfdc3d92fd",
"score": "0.50124854",
"text": "def get_class_by_type_and_object(type, object)\n if @configuration['types'][type] && klass = @configuration['types'][type][object]\n return get_const_by_name(klass)\n else\n Log.logger_for(:configuration).error(\"No class configuration defined for #{object} and type #{type}\")\n end\n return nil\n end",
"title": ""
},
{
"docid": "4e5d94887ce595e61ee47f0fcb19d6d4",
"score": "0.49788642",
"text": "def target_class_name\n options[:class_name] || name.to_s.classify\n end",
"title": ""
},
{
"docid": "cdbc57f33b0c30d5fc1423f82e2a72c7",
"score": "0.49653548",
"text": "def class_for(fragment, *args)\n item_class = class_from(fragment, *args) or raise DeserializeError.new(\":class did not return class constant.\")\n item_class.new\n end",
"title": ""
},
{
"docid": "8d0602fdb9f552a08fca018db893e1f1",
"score": "0.4953508",
"text": "def get_ruby_class_name as_class_name\n mapping = @as_mappings[as_class_name]\n return mapping.nil? ? nil : mapping.ruby\n end",
"title": ""
},
{
"docid": "0cf7b12e8bffecb7744c0525f8f6f8ca",
"score": "0.4943437",
"text": "def get_type(proc_or_class, options={})\n case proc_or_class\n when Proc\n proc_or_class.call(options)\n when Class\n proc_or_class.new(options)\n end\n end",
"title": ""
},
{
"docid": "8cb380f79b7b975dc42b49d148c7dda3",
"score": "0.49369627",
"text": "def target_class\n options[:class] || target_class_name.constantize\n end",
"title": ""
},
{
"docid": "b3fcdb2e3eda55054c0d85b7b5c7fc8e",
"score": "0.49320686",
"text": "def class=(str)\n `this.__native__.className=str.__value__`\n return str\n end",
"title": ""
},
{
"docid": "ea3513a45bb0301854dee77046027d0e",
"score": "0.49260136",
"text": "def parse_class_regular container, declaration_context, single, # :nodoc:\n name_t, given_name, comment\n superclass = '::Object'\n\n if given_name =~ /^::/ then\n declaration_context = @top_level\n given_name = $'\n end\n\n tk = peek_tk\n if tk[:kind] == :on_op && tk[:text] == '<' then\n get_tk\n skip_tkspace\n superclass = get_class_specification\n superclass = '(unknown)' if superclass.empty?\n end\n\n cls_type = single == SINGLE ? RDoc::SingleClass : RDoc::NormalClass\n cls = declaration_context.add_class cls_type, given_name, superclass\n cls.ignore unless container.document_children\n\n read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS\n record_location cls\n\n cls.add_comment comment, @top_level\n\n @top_level.add_to_classes_or_modules cls\n @stats.add_class cls\n\n suppress_parents container, declaration_context unless cls.document_self\n\n parse_statements cls\n\n cls\n end",
"title": ""
},
{
"docid": "0185eb04822524fa9208089ac4941fd6",
"score": "0.49177113",
"text": "def klass\n if @klass.is_a?(Class)\n @klass\n else\n unless /\\A(?:::)?([A-Z]\\w*(?:::[A-Z]\\w*)*)\\z/ =~ @klass.to_s\n raise NameError, \"#{@klass.inspect} is not a valid constant name!\"\n end\n \n Object.module_eval(\"::#{$1}\", __FILE__, __LINE__)\n end\n end",
"title": ""
},
{
"docid": "adff7f8b77b2265dfa079f7c69169b44",
"score": "0.491768",
"text": "def get_class(dns_query, parsed_dns)\n RECORD_CLASS[get_rdata_value(dns_query, parsed_dns, SHORT_LENGTH).to_i]\n end",
"title": ""
},
{
"docid": "98576b4185feecafe19913549e63cf9b",
"score": "0.4917327",
"text": "def user_class\n if @@user_class.is_a?(Class)\n raise \"You can no longer set Cadenero.user_class to be a class. Please use a string instead.\"\n elsif @@user_class.is_a?(String)\n begin\n Object.const_get(@@user_class)\n rescue NameError\n @@user_class.constantize\n end\n end\n end",
"title": ""
},
{
"docid": "1b105c22f7fc71a53998e9c1db302b3b",
"score": "0.49060464",
"text": "def BaseClass name\n name == \"string\" ? String : Object\nend",
"title": ""
},
{
"docid": "0405354c1230c4d1ff9ec6d6c104edb2",
"score": "0.48919842",
"text": "def get_ruby_obj as_class_name\n # Get ruby class name\n ruby_class_name = @mappings.get_ruby_class_name as_class_name\n\n # Auto-map if necessary, removing namespacing to create mapped class name\n if RubyAMF.configuration.auto_class_mapping && as_class_name && ruby_class_name.nil?\n ruby_class_name = as_class_name.split('.').pop\n @mappings.map :as => as_class_name, :ruby => ruby_class_name\n end\n\n # Create ruby object\n if ruby_class_name.nil?\n return RocketAMF::Values::TypedHash.new(as_class_name)\n else\n ruby_class = ruby_class_name.constantize\n obj = ruby_class.allocate\n obj.send(:initialize) unless obj.respond_to?(:rubyamf_init) # warhammerkid: Should we check if it has initialize?\n return obj\n end\n end",
"title": ""
},
{
"docid": "3a3b2b6c5867d402b5428ca8e45caa58",
"score": "0.48860437",
"text": "def cls\n unless @cls or (not target.cls?)\n\n # it is a method?\n if target.cls.respond_to? :defs\n method = target.cls.defs.find do\n |method|\n method.name == message_name\n end\n if method\n return nil\n # @cls = method.cls #TODO\n end\n end\n\n # it is an instance attribute?\n if @cls.nil? and target.cls.respond_to? :attributes\n attr = target.cls.attributes.find do\n |attr|\n attr.name == message_name\n end\n if attr\n @cls = attr.cls\n end\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "1c6dd467505c950215e25e330638559e",
"score": "0.4882455",
"text": "def symbol_to_constant_class(symbol, parent_class)\n name = symbol.to_s\n # If the classified version of the symbol is defined, then it has a model and can be made into a constant\n if Object.const_defined?(name.singularize.classify)\n name.singularize.classify.constantize\n else\n # If it isn't defined, this means that the attribute is a renamed version of a class\n find_association(symbol, parent_class).class_name.classify.constantize\n end\n end",
"title": ""
},
{
"docid": "1404bbc375057f574e1b349ff6604226",
"score": "0.48774558",
"text": "def class_type\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n return_value = ClassTypeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n begin\n # at line 113:15: ( KIND | MIXIN | ACTION )\n if @input.peek( 1 ).between?( KIND, ACTION )\n @input.consume\n @state.error_recovery = false\n else\n mse = MismatchedSet( nil )\n raise mse\n end\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 23 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "6f2b6cf714de30974bd18cd336bfca4c",
"score": "0.48733652",
"text": "def worker_class_constantize(worker_class)\n if worker_class.is_a?(String)\n worker_class.constantize rescue worker_class\n else\n worker_class\n end\n end",
"title": ""
},
{
"docid": "6f2b6cf714de30974bd18cd336bfca4c",
"score": "0.48733652",
"text": "def worker_class_constantize(worker_class)\n if worker_class.is_a?(String)\n worker_class.constantize rescue worker_class\n else\n worker_class\n end\n end",
"title": ""
},
{
"docid": "e7cde0bf39ea656e23e81bf9b9f666ae",
"score": "0.48583713",
"text": "def class_exists? string\n\tc = Object.const_get string\n\treturn c.is_a? Class\nrescue NameError\n\treturn false\nend",
"title": ""
},
{
"docid": "8daed15ce7c1c5bbc413a5996d58c083",
"score": "0.48514947",
"text": "def create_class(name, parent: Object, &block)\n klass = Class.new(parent, &block)\n @managed.const_set(name, klass)\n klass\n end",
"title": ""
},
{
"docid": "09ac1a04eb5ba278fef9b481b71800c7",
"score": "0.48506087",
"text": "def toggle_class(sym)\n self.has_class?(sym) ? self.remove_class(sym) : self.add_class(sym);\n return self\n end",
"title": ""
},
{
"docid": "27f7eb6281776409674d0a3880f1714e",
"score": "0.48499545",
"text": "def ast_class=(value)\n if value.is_a? Class\n @ast_class = value\n return\n else\n value = value.to_s\n end\n # camel case the word and get class, similar logic to\n # ActiveSupport::Inflector.constantize but refactored to be specific\n # to the HTMLConverter class\n value.gsub!(/(?:^|_)([a-z])/) { Regexp.last_match[1].capitalize }\n @ast_class = Sablon::HTMLConverter.const_get(value)\n end",
"title": ""
},
{
"docid": "4161b044c7e4cdd885da8db85011b0d5",
"score": "0.4845367",
"text": "def _namespace_class(ns)\n return unless ns\n Ing::Util.decode_class(ns.gsub(/:$/,\": \"))\n end",
"title": ""
},
{
"docid": "72c34b0900140ad3f8bf029cbc664385",
"score": "0.48238268",
"text": "def sfa_class(name = nil, opts = {})\n if name\n name = _sfa_add_ns(name, opts)\n @@sfa_classes[self] = name\n @@sfa_class_props[self] = opts\n @@sfa_name2class[name] = self\n else\n @@sfa_classes[self]\n end\n end",
"title": ""
}
] |
e7c5a9d71efe1c27efbbd97e7603aa03
|
DELETE /uuids/1 DELETE /uuids/1.json
|
[
{
"docid": "db58e03ed2d51bee25755e1e98f52fd2",
"score": "0.6532175",
"text": "def destroy\n if current_user.admin?\n @uuid.destroy\n respond_to do |format|\n format.html { redirect_to uuids_url, notice: 'Uuid was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n render_404\n end\n end",
"title": ""
}
] |
[
{
"docid": "d2f2b7e27bbbe134661361074c399275",
"score": "0.73650277",
"text": "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.7257885",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.6963235",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "3e3885785e18377a74ae65abba49245a",
"score": "0.6815925",
"text": "def destroy\n @uniqueid = Uniqueid.find(params[:id])\n @uniqueid.destroy\n\n respond_to do |format|\n format.html { redirect_to uniqueids_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6812781",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "9a5699273b0f2ed4328b5fbb29e97e88",
"score": "0.68088806",
"text": "def batch_delete(uuids)\n body = uuids.to_json\n request_delete(uri: '/files/storage/', content: body)\n end",
"title": ""
},
{
"docid": "c6798424d46577fa4ffac5eda4ecc0c6",
"score": "0.66886723",
"text": "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"title": ""
},
{
"docid": "8f7a50028aff31d8e388d0ec4b5fb6f2",
"score": "0.6635876",
"text": "def destroy(params = {})\n client.delete(\"#{endpoint(params)}/#{attributes[:id]}\")\n end",
"title": ""
},
{
"docid": "33b888c8f2b033bb54789de80c57d692",
"score": "0.6602636",
"text": "def delete\n client.delete(url)\n @deleted = true\nend",
"title": ""
},
{
"docid": "25d8644124a8a1b42dda410340e0fa90",
"score": "0.6595729",
"text": "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9089c0b05b260a898baad823dd7a5c5c",
"score": "0.6555047",
"text": "def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"title": ""
},
{
"docid": "f648a03d4d8133335811d5c8476e78b8",
"score": "0.654001",
"text": "def destroy\n @unique.destroy\n respond_to do |format|\n format.html { redirect_to uniques_url, notice: 'Unique was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a9cdf07abd2f7a88bb3bcc4c652167b8",
"score": "0.652333",
"text": "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8c0afa574c9b2a4651bc5b4faa56b225",
"score": "0.64972156",
"text": "def delete_by_uuid uuid\n deliberately_unscoped(Webhook).where(uuid: uuid).destroy\n end",
"title": ""
},
{
"docid": "8412d693fd475cb8f222f90b6a98bbae",
"score": "0.6400388",
"text": "def delete\n render json: Users.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "fb622696b3cadaef2a0d459cf3572785",
"score": "0.63973445",
"text": "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"title": ""
},
{
"docid": "d42d524667fe775a6fd2f8ed58ac62b5",
"score": "0.63869154",
"text": "def delete(*rest) end",
"title": ""
},
{
"docid": "6f74a32c6fdb67babd4a903e37b5baa4",
"score": "0.6383503",
"text": "def delete\n render json: User.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "c8bb556443f3d8c9f90b1f4eeb81847c",
"score": "0.6380515",
"text": "def destroy\n @user = User.find(params[:user_uuid])\n @user.destroy\n head :ok\n end",
"title": ""
},
{
"docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d",
"score": "0.63779384",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d",
"score": "0.63779384",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "854ac71d7ed167a7b7c4f2724bbb534b",
"score": "0.63711053",
"text": "def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "e1d6f603cb5ea1e475ea71422432aeae",
"score": "0.6363375",
"text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"title": ""
},
{
"docid": "a6660f8f62027412929d7b78d182281c",
"score": "0.63630724",
"text": "def delete endpoint\n do_request :delete, endpoint\n end",
"title": ""
},
{
"docid": "135718e3cf89a07a28a752665ff35556",
"score": "0.63611203",
"text": "def destroy\n Generator.where(id: params[:id] ).first.destroy\n respond_to do |format|\n format.html { redirect_to generators_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "35d189d6efe89346d7b97cecee10397f",
"score": "0.63468564",
"text": "def delete(unique_id)\n rsp = post(\"<delete><id>#{unique_id}</id></delete>\")\n success?(rsp.body) or log_error(rsp.body)\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.63342696",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "09fc2820d9479cac0697e20c559268bf",
"score": "0.6319113",
"text": "def delete\n render json: Alien.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "12649d62912dc561d03cb528b51fe007",
"score": "0.63046914",
"text": "def delete\n api_client.delete(url)\n end",
"title": ""
},
{
"docid": "ce1e7cf90aa82857889c1b10e9f7d91a",
"score": "0.6299795",
"text": "def destroy\n @client.delete( name )\n end",
"title": ""
},
{
"docid": "defe3d75c543e424d52471cb07efa99c",
"score": "0.6289355",
"text": "def delete(id)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\"\n return HTTParty.delete(url, :timeout => 4)\n end\n end",
"title": ""
},
{
"docid": "63b995ee539d37a0219171db7ef60dcd",
"score": "0.62863237",
"text": "def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "522e787502895f0a05c9b2c6ca4e5ced",
"score": "0.6261565",
"text": "def delete\n request(:delete)\n end",
"title": ""
},
{
"docid": "f40a13fd3988b827af65201da99d98db",
"score": "0.62612134",
"text": "def delete_files(uuids)\n Uploadcare::FileList.batch_delete(uuids)\n end",
"title": ""
},
{
"docid": "a1113d3797921a46c1cb730f4416d6ae",
"score": "0.6259188",
"text": "def delete(uuid, key)\n request(method: 'DELETE', uri: \"/files/#{uuid}/metadata/#{key}/\")\n end",
"title": ""
},
{
"docid": "7a5eea7c7a07ce3e7f95fa50802d596e",
"score": "0.6214448",
"text": "def delete path\n make_request(path, \"delete\", {})\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.62119716",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.62119716",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.62119716",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.62119716",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "65882609f98cadcb165eded2e2ddc17c",
"score": "0.6210221",
"text": "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "86faa8c555419d7144a0c7003f760dff",
"score": "0.62067825",
"text": "def delete\n render json: Item.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "b3d5cc7be98c38ed2845836ab57352e3",
"score": "0.6205221",
"text": "def destroy\n @client.delete(@name)\n end",
"title": ""
},
{
"docid": "3633e737644dae5f5d8d49f3248f7a12",
"score": "0.61988914",
"text": "def delete\n api(\"Delete\")\n end",
"title": ""
},
{
"docid": "6c6d62721d99e31b720ed699d9cbf1c9",
"score": "0.6194117",
"text": "def destroy_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n @instrument_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_versions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8e69eb3ff3374e0db6fa9eb17958df65",
"score": "0.6192166",
"text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "95f7909f2d660a9b4f3be6031cc3886e",
"score": "0.6191382",
"text": "def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"title": ""
},
{
"docid": "df01d62c3332c433623f4e862fee4363",
"score": "0.61902463",
"text": "def delete\n super \"/templates/#{template_id}.json\", {}\n end",
"title": ""
},
{
"docid": "f16cf4887fd8e037fb45378038fbe3b5",
"score": "0.6165324",
"text": "def delete(*uris); end",
"title": ""
},
{
"docid": "6c1182b0da27e60016a06c244e458475",
"score": "0.61556095",
"text": "def destroy\n @id.destroy\n respond_to do |format|\n format.html { redirect_to ids_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "39a089a0f491d328f3c82afdcec1c719",
"score": "0.61547154",
"text": "def destroy\n @api_version = ApiVersion.find(params[:id])\n @api_version.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_api_versions_url, flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d4f3f17f19a6b39faa5c339ae30e9e0",
"score": "0.6154215",
"text": "def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend",
"title": ""
},
{
"docid": "82638edd700f30d04414a7c8abd45ee1",
"score": "0.61531353",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "82638edd700f30d04414a7c8abd45ee1",
"score": "0.61531353",
"text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"title": ""
},
{
"docid": "2eebbfb6e79d4936f12a3e155ee62c96",
"score": "0.61496437",
"text": "def destroy\n @virus = Virus.find(params[:id])\n @virus.destroy\n\n respond_to do |format|\n format.html { redirect_to viri_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c77c20147b142d0eb3583c2c2b4e1695",
"score": "0.61401534",
"text": "def destroy\n resource.destroy\n render json: {success: true}, status: :ok\n end",
"title": ""
},
{
"docid": "c77c20147b142d0eb3583c2c2b4e1695",
"score": "0.61401534",
"text": "def destroy\n resource.destroy\n render json: {success: true}, status: :ok\n end",
"title": ""
},
{
"docid": "8f06e8310f316354874315f66071a977",
"score": "0.61302716",
"text": "def delete()\n @client.make_request(:delete, @client.concat_user_path(\"#{DOMAIN_PATH}/#{domain_id}/endpoints/#{id}\"))[0]\n end",
"title": ""
},
{
"docid": "15019f65fcb2dc09a625318cab419063",
"score": "0.612703",
"text": "def delete\n client.delete(url)\n @deleted = true\n end",
"title": ""
},
{
"docid": "ca47d5e938df99eb744c55c8a8b7a3df",
"score": "0.61171",
"text": "def delete(*args)\n request(:delete, *args)\n end",
"title": ""
},
{
"docid": "164f9d8997567d73a9f017dd138f2128",
"score": "0.6115236",
"text": "def destroy(id)\n\nend",
"title": ""
},
{
"docid": "d2938d0d96fc4adb30b185ea6e647cdf",
"score": "0.61144924",
"text": "def delete\n render json: Post.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "40bf1f2987e62deb3d87435d29e1a69e",
"score": "0.6110834",
"text": "def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"title": ""
},
{
"docid": "30ad7b54343b38bdcfa4a21d2bba602e",
"score": "0.611027",
"text": "def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end",
"title": ""
},
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.6101856",
"text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"title": ""
},
{
"docid": "240d1666f8572b7b02d242b521aa1135",
"score": "0.60980654",
"text": "def delete\n start { |connection| connection.request http :Delete }\n end",
"title": ""
},
{
"docid": "a1f3c7d499f21a82d9c4a4b92e299a60",
"score": "0.6093512",
"text": "def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end",
"title": ""
},
{
"docid": "0c730600a14135ad6ba6aae8ff35b209",
"score": "0.6091336",
"text": "def call(id)\n client.delete(\"/api/rest/v1/users/#{id}.json\")\n true\n end",
"title": ""
},
{
"docid": "5cea72fb9f412448e1f6fee3d4979444",
"score": "0.6091043",
"text": "def deletef\n url = prefix + \"deletef\" + id_param\n return response(url)\n end",
"title": ""
},
{
"docid": "e0ead9f0484eaa6fd84a42ac69163d86",
"score": "0.60774606",
"text": "def destroy\n @small_generator = SmallGenerator.find(params[:id])\n @small_generator.destroy\n\n respond_to do |format|\n format.html { redirect_to small_generators_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "376afb7872ca26558919139da66b44df",
"score": "0.6071978",
"text": "def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"title": ""
},
{
"docid": "ad8efec075b663c85160257277f50d0f",
"score": "0.60687995",
"text": "def destroy\n @id = Id.find(params[:id])\n @id.destroy\n\n respond_to do |format|\n format.html { redirect_to ids_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "34264605c47edda6ffe32df87c7a7266",
"score": "0.606309",
"text": "def delete\n delete_from_server single_url\n end",
"title": ""
},
{
"docid": "3b682af09608571d54811f14b070821e",
"score": "0.60604095",
"text": "def delete!(id:)\n client.delete_list(id: id)\n end",
"title": ""
},
{
"docid": "4630371d54092d9aaa6f62c4a1e7f2dc",
"score": "0.6056106",
"text": "def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dc7978b571fa1af94fbce826dcf38dc1",
"score": "0.60394055",
"text": "def destroy; delete end",
"title": ""
},
{
"docid": "846ebc9811354ce2063d78756174954a",
"score": "0.60368973",
"text": "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end",
"title": ""
},
{
"docid": "db76cfe347ffa12eae9298b9314b9d4d",
"score": "0.6032834",
"text": "def call(id)\n client.delete(\"/api/rest/v1/api_keys/#{id}.json\")\n true\n end",
"title": ""
},
{
"docid": "556a16495e6b6c3836b03e068a58bffa",
"score": "0.602999",
"text": "def delete(params = {})\n Client.current.delete(resource_url, params)\n end",
"title": ""
},
{
"docid": "8fe0632b9109a617c0b81a88f1b7279b",
"score": "0.6026617",
"text": "def destroy\n \n respond_to do |format|\n RestClient.delete 'localhost:3001/colores/'+@color.id.to_s, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'}\n format.html { redirect_to colors_url, notice: \"Color was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa3c20a90ea1419af2232f845e460f8c",
"score": "0.60254955",
"text": "def delete!\n request! :delete\n end",
"title": ""
},
{
"docid": "1836d3d519921981a7fd783e026cbb2a",
"score": "0.602033",
"text": "def delete(type, id)\n http_delete @target, \"#{type_info(type, :path)}/#{Addressable::URI.encode(id)}\", @auth_header, @zone\n end",
"title": ""
},
{
"docid": "b563eb7b85198a622e6e21b9ef6ebfaf",
"score": "0.6018521",
"text": "def destroy\n @sampled_url = SampledUrl.find(params[:id])\n @sampled_url.destroy\n\n respond_to do |format|\n format.html { redirect_to sampled_urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "053c507bc03b7e21b6534bae57be699b",
"score": "0.6011728",
"text": "def delete(object)\n full_name = extract_full_name object\n post 'api/del', :id => full_name\n end",
"title": ""
},
{
"docid": "89518d0c88741365e86a3f50260bbc9f",
"score": "0.6011667",
"text": "def delete\n execute_prlctl('delete', @uuid)\n end",
"title": ""
},
{
"docid": "a5a978cd4f3674014409c5f201b376de",
"score": "0.60093516",
"text": "def destroy\n\t\tarray_of_short_urls = params[:id].split(\",\")\n\t\t@urls = UrlGenerator.where(encoded_url:array_of_short_urls)\n\t\tif @urls.empty?\n\t\t\trender json:{error:\"not found\"}\n\t\telse\n\t\t\t@urls.destroy_all\n\t\t\trender json:{notice:\"successfully destroyed\"}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f13776bb2a81adaf6867696b0a12f00a",
"score": "0.60058516",
"text": "def delete_item(item_id)\n response = Unirest.delete CONNECT_HOST + '/v1/' + LOCATION_ID + '/items/' + item_id,\n headers: REQUEST_HEADERS\n\n if response.code == 200\n puts 'Successfully deleted item'\n return response.body\n else\n puts 'Item deletion failed'\n puts response.body\n return nil\n end\nend",
"title": ""
},
{
"docid": "95900eeb6730c084ae9c9e5a80d9d8ce",
"score": "0.60033",
"text": "def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"title": ""
},
{
"docid": "f9912a7566edbd02b60f8b5b1ed2f1bf",
"score": "0.6000015",
"text": "def destroy\n @one = One.find(params[:id])\n @one.destroy\n\n respond_to do |format|\n format.html { redirect_to ones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7d3c63b7953786567365eebd7e48340",
"score": "0.59985864",
"text": "def delete(options={})\n connection.delete(\"/\", @name)\n end",
"title": ""
},
{
"docid": "a0a290b4bf746f7087a5d6cb03210ec9",
"score": "0.5992798",
"text": "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end",
"title": ""
},
{
"docid": "48b8118f8505eb450c011be64bf322cf",
"score": "0.59907943",
"text": "def destroy\n @api_v1_resource.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_resources_url, notice: 'Resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "acb8a955f17442ce1943df31af7a73f7",
"score": "0.5989276",
"text": "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end",
"title": ""
},
{
"docid": "fbc33eae34e7ab3eb159279c484299f2",
"score": "0.59835464",
"text": "def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "753db1d7fb543a6cdae6aa94c34db8ab",
"score": "0.5972011",
"text": "def orchio_delete\n response = client.send_request :delete, inst_args\n orchio_status response, 204\n end",
"title": ""
},
{
"docid": "c7eb46a5c444e24fb5fa731ae6f4ae76",
"score": "0.5970919",
"text": "def destroy\n record = Asset.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "10e6200d5af6e5382eb323b2de5051d6",
"score": "0.5970392",
"text": "def delete_slip(id:)\n empty_param_error('id') if id.to_s.eql? ''\n resource :delete, \"api/v1/users/me/slips/#{id}\"\n end",
"title": ""
},
{
"docid": "cd08ded122e4747842cfbc97e5cc2feb",
"score": "0.59700316",
"text": "def destroy\n @wait = Wait.find(params[:id])\n @wait.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ad0c36135de0490ca71e281a94cd49f9",
"score": "0.5968373",
"text": "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"title": ""
},
{
"docid": "69bf58f3d400f22ae5799db2bc1a4229",
"score": "0.5966038",
"text": "def destroy\n @identity.destroy\n respond_to do |format|\n format.html { redirect_to identities_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
3b4712254b3b382d1240f8e80e05084d
|
Returns parametrized subject. detect_id :robots => :robots detect_id sluggable_ar_resource => 'Sluggableresourceslug' detect_id some_resource_with_id => '4' detect_id generic_object => ""
|
[
{
"docid": "38e7c53502a21ba109d87989a02e2eb3",
"score": "0.67471004",
"text": "def detect_id(subject)\n case\n when Symbol === subject\n subject\n when subject.respond_to?(:to_param)\n subject.to_param\n when subject.respond_to?(:id)\n subject.id.to_s\n else\n \"#{subject}\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "789b4add9c707aff1eeeaee6a27fa8e1",
"score": "0.5680492",
"text": "def identify(id, *args); ''; end",
"title": ""
},
{
"docid": "5ed7a5307069cc8e30799ce8aa264643",
"score": "0.56021607",
"text": "def subject_id_from_token(token)\n token.params['patient'] || token.params['patient_id'] || token.params['user_id'] || subject_id_from_id_token(token.params['id_token'])\n end",
"title": ""
},
{
"docid": "9cb8c0658dbd018cf915b750c1a93304",
"score": "0.5582915",
"text": "def find_identifier\n @identifier = DCLPMetaIdentifier.find(params[:id].to_s)\n end",
"title": ""
},
{
"docid": "7109e762c7606c765036371113eed574",
"score": "0.54090077",
"text": "def id\n id_property.present? ? Valkyrie::ID.new(id_property) : adapter.uri_to_id(object.subject_uri)\n end",
"title": ""
},
{
"docid": "7081422ee34ce71446355983744b6b9d",
"score": "0.5322221",
"text": "def subject_id_from_id_token(token)\n return nil unless token\n\n jwt = JWT.decode(token, nil, false)\n payload = jwt[0]\n payload['profile'].gsub('^Patient/', '')\n end",
"title": ""
},
{
"docid": "88552f0a3e1bf01ad59a1304bf67e54d",
"score": "0.5302347",
"text": "def parameterize_id id\n id.gsub(' Play', '').gsub(/[^\\w\\s]/, '').gsub(/\\s+/, ' ').gsub(' ', '_').downcase\n end",
"title": ""
},
{
"docid": "f60a2d91fc38289388d7f4ec884b25f9",
"score": "0.52736163",
"text": "def identify_string\n receiveable_type.constantize.find(receiveable_id).identify_string\n end",
"title": ""
},
{
"docid": "58175a0b11cebbcb354defc4e743bded",
"score": "0.5258048",
"text": "def get_identifier\n # if we're using a param for an identifier then get this param\n if self.retailer.param_based\n param_hash = Rack::Utils.parse_query URI(self.link).query\n return param_hash[self.retailer.param_name]\n else\n return self.link.split('?')[0]\n end\n end",
"title": ""
},
{
"docid": "63eaaee44cc15f950cdf5158e2f78db3",
"score": "0.5244616",
"text": "def find_id val\n parse_terms_id_response(SolrQuery.new.solr_query(q='inScheme_ssim:\"' + terms_id + '\" AND preflabel_si:\"' + val + '\"', fl='id'))\n end",
"title": ""
},
{
"docid": "c5053d68ab8acee5e62c254dfe84aabe",
"score": "0.52103066",
"text": "def identify(obj, param_key = nil)\n identifier = identifier_for(obj)\n if identifier.is_a?(Array)\n # First check if the param_key exists as an identifier\n return obj.send(param_key) if identifier.include?(param_key)\n # If the param_key ends in _id, just return the object id\n return obj.id if \"#{param_key}\" =~ /_id$/\n # Otherwise, raise an error\n raise GenerationError, \"The object #{obj.inspect} cannot be identified with #{identifier.inspect} for #{param_key}\"\n else\n identifier ? obj.send(identifier) : obj\n end\n end",
"title": ""
},
{
"docid": "a980da54bacd922b887746bf1d6d7b3c",
"score": "0.519387",
"text": "def identify\n @params\n end",
"title": ""
},
{
"docid": "1ffad3c3555fe6e3b9b70bc5489c3b0e",
"score": "0.51887256",
"text": "def classify_subject_by_id(subject_id, workflow_name, task_key, data)\n params = {\n workflow: {\n name: workflow_name\n },\n classifications: {\n annotation: data,\n task_key: task_key,\n subject_id: subject_id\n }\n }\n\n submit_classification params\n end",
"title": ""
},
{
"docid": "4b26402658d7143a0175cad3703f91f0",
"score": "0.5176451",
"text": "def determineMatchID\n @matchid = @value.get_attribute('id').split('_')[2]\n end",
"title": ""
},
{
"docid": "f35fd1aeae2f71e6ed3efbad9c3dc82a",
"score": "0.5174856",
"text": "def id_params_identifier\n raise NotImplementedError, \"Classes including the Searchable module should implement this class method\"\n end",
"title": ""
},
{
"docid": "787c6abef0b2d83a8ff9ed4996b472d2",
"score": "0.51533973",
"text": "def convert_recognition_slug\n if self.recognition_slug.present?\n self.recognition_id = Recognition.find(self.recognition_slug).id\n end\n end",
"title": ""
},
{
"docid": "a40b5267bbd15e03f30b88e61142f9eb",
"score": "0.51085573",
"text": "def find_id_with_alts val\n parse_terms_id_response(SolrQuery.new.solr_query(q='inScheme_ssim:\"' + terms_id + '\" AND (preflabel_si:\"' + val + '\" OR altlabel_tesim:\"' + val + '\")', fl='id'))\n end",
"title": ""
},
{
"docid": "5fd8c6d26df376e91d20822f20492ccc",
"score": "0.51017517",
"text": "def humanoid_params\n params[:humanoid]\n end",
"title": ""
},
{
"docid": "5cca69bd74b91413973fd85d5abeab44",
"score": "0.5092935",
"text": "def obtain_occurrence_identifier(stripped_id, stripped_lvn, stripped_sdc, is_variable)\n if is_variable || (stripped_sdc.include? 'qdm_var')\n occurrence_lvn_regex = 'occ[A-Z]of_qdm_var'\n occurrence_id_regex = 'occ[A-Z]of_qdm_var'\n occ_index = 3\n return handle_occurrence_var(stripped_id, stripped_lvn, stripped_sdc, occurrence_id_regex, occurrence_lvn_regex, occ_index)\n else\n occurrence_lvn_regex = 'Occurrence[A-Z]of'\n occurrence_id_regex = 'Occurrence[A-Z]_'\n occ_index = 10\n\n occurrence_identifier = handle_occurrence_var(\n stripped_id, stripped_lvn, stripped_sdc,\n \"#{occurrence_id_regex}#{stripped_sdc}\", \"#{occurrence_lvn_regex}#{stripped_sdc}\",\n occ_index)\n return occurrence_identifier if occurrence_identifier.present?\n\n stripped_sdc[occ_index] if stripped_sdc.match(\n /(^#{occurrence_id_regex}| ^#{occurrence_id_regex}qdm_var_| ^#{occurrence_lvn_regex})| ^#{occurrence_lvn_regex}qdm_var_/)\n end\n end",
"title": ""
},
{
"docid": "70b92d506a91d2c5fd06ac98c107ea4b",
"score": "0.508843",
"text": "def id\n headline.underscore.gsub(/ /, '_')\n end",
"title": ""
},
{
"docid": "fdb8d287ff100324b1ecca34b6f53693",
"score": "0.5085434",
"text": "def id\n node? ? nil : rdf_subject.to_s\n end",
"title": ""
},
{
"docid": "69d2066cdea40e67671605ffc9e06ab5",
"score": "0.50828904",
"text": "def extract_pid\n find_pid = params[:id]\n find_pid ||= /oregondigital:[0-9a-z]{9}/.match params[:url]\n raise BadRequest if find_pid.nil?\n find_pid.to_s\n end",
"title": ""
},
{
"docid": "a540a00b8ec3697875257f43a5f4d3d4",
"score": "0.5082365",
"text": "def find_trackable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n return $1.classify.constantize.find(value)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "0395a42c9a31c6ffa62fb0433d1fa662",
"score": "0.508166",
"text": "def subject\n return \"<http://bio2rdf.org/rgd:#{@primary_id}>\"\n end",
"title": ""
},
{
"docid": "269b1da791a3d3a8d8c8a9773aca82c2",
"score": "0.5064589",
"text": "def get_identifier(arr,param)\n\t\tarr.each do |object|\n\t\t\treturn object[:expected_result].select { |obj| obj[:output_param].key? param}[0]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "090845d20901267ae564eccac061efcc",
"score": "0.50596577",
"text": "def to_param\n id.to_s + '-' + title.parameterize\n end",
"title": ""
},
{
"docid": "b0e6059b9a600971c00db34d63ec2a01",
"score": "0.50539887",
"text": "def id\n case\n when chrome? then :chrome\n when iphone? then :iphone\n when ipad? then :ipad\n when ipod? then :ipod\n when ie? then :ie\n when opera? then :opera\n when firefox? then :firefox\n when android? then :android\n when blackberry? then :blackberry\n when safari? then :safari\n when psp? then :psp\n when quicktime? then :quicktime\n when core_media? then :core_media\n else\n :other\n end\n end",
"title": ""
},
{
"docid": "72ed13fc93ae1a0ff172eefb8d71432b",
"score": "0.503336",
"text": "def set_detection\n @detection = Detection.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ee20e412f40aaec1db46dab7dd68b6f",
"score": "0.497462",
"text": "def parse_parameter_as_resource_id!(type, options, params, param_name=nil, lookup_ids=false)\n # type = type.to_s.singularize\n if options.key?(type)\n val = options[type].to_s\n param_name ||= \"#{type.to_s.camelcase}Id\"\n if val\n if val.to_s !~ /\\A\\d{1,}\\Z/ || lookup_ids\n record = find_by_name(type, val)\n if record.nil?\n # avoid double error render by exiting here, ew\n exit 1\n raise_command_error \"#{type.titleize} not found for '#{val}'\"\n end\n params[param_name] = record['id']\n else\n params[param_name] = val\n end\n return params[param_name]\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "3b53cea561fe8699dc4525cd8c599339",
"score": "0.49729878",
"text": "def id\n self.subject\n end",
"title": ""
},
{
"docid": "6a93d4ef7a56798b058662d568ea09ae",
"score": "0.4966995",
"text": "def vodspot_video_id\n 99\n end",
"title": ""
},
{
"docid": "71c59867ab4f72b597891da18ad138ad",
"score": "0.49636087",
"text": "def set_subject\n @subject = type_class.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "22dd64cefe977ee17b87b8ccbb404aa1",
"score": "0.49625602",
"text": "def to_param\n \"#{id} #{link}\".parameterize\n end",
"title": ""
},
{
"docid": "051be32b16755e5996e9dacba8cb4bb1",
"score": "0.49600145",
"text": "def id_for_body\n id = request[:controller].to_s\n \" id=\\\"#{id}\\\"\"\n end",
"title": ""
},
{
"docid": "578ddf2a08e0bd1ce9a720ccb37ff2e2",
"score": "0.49487367",
"text": "def param_value(subject, type, title, param)\n subject.resource(type, title).send(:parameters)[param.to_sym]\nend",
"title": ""
},
{
"docid": "bd1cf1afd7bc58f68df0daf3a9f07975",
"score": "0.49484703",
"text": "def set_detection\n @detection = Detection.find(params[:id])\n end",
"title": ""
},
{
"docid": "c9f85ab097605e70aa006991cd100058",
"score": "0.4945173",
"text": "def id\n params_id_key_candidates.each do |key|\n value = params[key]\n return value if value.present?\n end\n\n nil\n end",
"title": ""
},
{
"docid": "366983fcb367974178092dfc01be9240",
"score": "0.49395064",
"text": "def parameter_string\n\t\t\t\" driver_script.rb #@id\"\n\t\tend",
"title": ""
},
{
"docid": "c7fb7f3f38c53994d237bfe153925116",
"score": "0.49352595",
"text": "def id\n return resource[:id].to_s if resource[:id].present? && resource[:id]&.is_a?(::Valkyrie::ID)\n return \"\" unless resource.respond_to?(:alternate_ids)\n\n resource.alternate_ids.first.to_s\n end",
"title": ""
},
{
"docid": "3a9a38c4f45ac9863968986a07e630d2",
"score": "0.4932813",
"text": "def get_visitor_identifier\n self.class.post(\"/#{@dcsid}/ids.svc\", :body=>extra_params)['id']\n end",
"title": ""
},
{
"docid": "9f9cfba5f05e4eedfe669e43d379d4f5",
"score": "0.49150205",
"text": "def get_resource_id(authority_type, preflabel)\r\nid=\"unfound\"\r\npreflabel = preflabel.to_s\r\n\tif authority_type == \"department\"\r\n\t\tservice = Dlibhydra::Terms::DepartmentTerms.new\t\t \r\n\telsif authority_type == \"qualification_name\"\r\n\t service = Dlibhydra::Terms::QualificationNameTerms.new\r\n\telsif authority_type == \"institution\" #not sure about this since we only have two? york and oxford brookes?\r\n\t\tservice = Dlibhydra::Terms::CurrentOrganisationTerms.new\r\n\telsif authority_type == \"subject\" \r\n\t service = Dlibhydra::Terms::SubjectTerms.new \r\n\telsif authority_type == \"person_name\" #no pcurrent_person objects yet created\r\n\t service = Dlibhydra::Terms::CurrentPersonTerms.new\r\n\tend\r\n\tid = service.find_id(preflabel)\r\nend",
"title": ""
},
{
"docid": "1a2c2872421d32912016b195626a265a",
"score": "0.49142906",
"text": "def get_id\n params[:id]\n end",
"title": ""
},
{
"docid": "1a2c2872421d32912016b195626a265a",
"score": "0.49142906",
"text": "def get_id\n params[:id]\n end",
"title": ""
},
{
"docid": "1a2c2872421d32912016b195626a265a",
"score": "0.49142906",
"text": "def get_id\n params[:id]\n end",
"title": ""
},
{
"docid": "76c95f571ef014cc19f243dce11b2b24",
"score": "0.49095637",
"text": "def to_param\n\t \"#{id} #{title}\".parameterize\n\tend",
"title": ""
},
{
"docid": "c920aea33659a0505833f68abb716a2c",
"score": "0.4899393",
"text": "def search_identifier_key\n :id\n end",
"title": ""
},
{
"docid": "4ac3256bae75487b08fd10742a267f92",
"score": "0.48967326",
"text": "def find_videoable\n params.each do |name, value|\n if name =~ /(.+)_id$/\n klass = $1.classify.constantize\n return klass.find(value)\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "6b1a00193e62af5309d9438c96586fa0",
"score": "0.48845604",
"text": "def id\n self.subject\n end",
"title": ""
},
{
"docid": "6b1a00193e62af5309d9438c96586fa0",
"score": "0.48845604",
"text": "def id\n self.subject\n end",
"title": ""
},
{
"docid": "6b1a00193e62af5309d9438c96586fa0",
"score": "0.48845604",
"text": "def id\n self.subject\n end",
"title": ""
},
{
"docid": "6b1a00193e62af5309d9438c96586fa0",
"score": "0.48845604",
"text": "def id\n self.subject\n end",
"title": ""
},
{
"docid": "6b1a00193e62af5309d9438c96586fa0",
"score": "0.48845604",
"text": "def id\n self.subject\n end",
"title": ""
},
{
"docid": "bb37e0837b68ce2aa96000115d5cfdb6",
"score": "0.48747495",
"text": "def unique_id\n video_id.match(/videos\\/([^<]+)/).captures.first\n end",
"title": ""
},
{
"docid": "3974e7a8108e32135a5d101168d14ac4",
"score": "0.48686525",
"text": "def id(action)\n id_param = action[/id=\\d+/]\n id_param[/\\d+/]\nend",
"title": ""
},
{
"docid": "9172c5adabb1ff5a9f45c81f1ad6d589",
"score": "0.48645067",
"text": "def annotation_identifier\n case annotation_scope\n when 'study'\n annotation_object.annotation_select_value\n when 'cluster'\n cluster_group.annotation_select_value(annotation_object)\n end\n end",
"title": ""
},
{
"docid": "b8a50b1c014ed019373a0952da6c4bbd",
"score": "0.4862612",
"text": "def discover_id\n params = Rack::Utils.parse_query URI(@url).query\n params['t'].to_i\n end",
"title": ""
},
{
"docid": "b9bedd95d1f2ecae68cde1b0e9fbaa4f",
"score": "0.4860307",
"text": "def search_term( search_id )\n param( search_id.sym )\n end",
"title": ""
},
{
"docid": "2fdbf1eadb19b94a311f3647f0b71cd7",
"score": "0.48553348",
"text": "def get_id(data)\n result = get_full_data(data)\n mediatypeid = nil\n result.each { |mt| mediatypeid = mt['mediatypeid'].to_i if mt['description'] == data[:description] }\n mediatypeid\n end",
"title": ""
},
{
"docid": "6a2e38db7512990e3904fde7d2b39756",
"score": "0.4851442",
"text": "def id # :doc:\n params[:id]\n end",
"title": ""
},
{
"docid": "fe889c6ef7daa6ca8525d4877e379d85",
"score": "0.48458123",
"text": "def to_param\n \"#{id} #{title}\".parameterize\n end",
"title": ""
},
{
"docid": "fe889c6ef7daa6ca8525d4877e379d85",
"score": "0.48458123",
"text": "def to_param\n \"#{id} #{title}\".parameterize\n end",
"title": ""
},
{
"docid": "fe889c6ef7daa6ca8525d4877e379d85",
"score": "0.48458123",
"text": "def to_param\n \"#{id} #{title}\".parameterize\n end",
"title": ""
},
{
"docid": "fe889c6ef7daa6ca8525d4877e379d85",
"score": "0.48458123",
"text": "def to_param\n \"#{id} #{title}\".parameterize\n end",
"title": ""
},
{
"docid": "fe889c6ef7daa6ca8525d4877e379d85",
"score": "0.48458123",
"text": "def to_param\n \"#{id} #{title}\".parameterize\n end",
"title": ""
},
{
"docid": "8126b24a6d6909fe89ac2557f3d33a59",
"score": "0.484368",
"text": "def to_param\n return \"#{id}-#{title}\".parameterize\n end",
"title": ""
},
{
"docid": "65e301ff6b135d80051d766a62397945",
"score": "0.48424634",
"text": "def find_subject\n @subject = Subject.find(params[:id])\n end",
"title": ""
},
{
"docid": "6be3bb68928ea905e519a3a8bd3ae61a",
"score": "0.48387232",
"text": "def to_param \n id.to_s + \"_\" + title.gsub(/\\s/, '_').gsub(/[^-\\w]/,'').downcase \n end",
"title": ""
},
{
"docid": "be1d7a861f1d37cbed931fa3e062c66d",
"score": "0.48345464",
"text": "def case_subject\n\t\treturn nil if matchingid.blank?\n\t\tStudySubject.cases.with_matchingid(matchingid).first\n#\t\tStudySubject.cases.with_matchingid(matchingid)\n#\t\t\t.includes(:subject_type).first\n\tend",
"title": ""
},
{
"docid": "88242c660fbb92f92f34e520cdb29191",
"score": "0.4829747",
"text": "def param # :doc:\n params[:id]\n end",
"title": ""
},
{
"docid": "35f7f954b14ed3c307db7f072da8c58d",
"score": "0.48246753",
"text": "def qualification_path_params(qualification)\n id = qualification.id\n @entity.instance_of?(Candidate) ? {candidate_id: params[:candidate_id],id: id} : {company_id: params[:company_id],job_id: params[:job_id],id: id}\n end",
"title": ""
},
{
"docid": "16d1e4180b0fc2cb39a75493069590dc",
"score": "0.4823935",
"text": "def get_movie_id(searchterm)\r\n\t@search \t= Tmdb::Search.new\r\n\t@search.resource('movie') # determines type of resource\r\n\t@search.query(searchterm) # the query to search against\r\n\tresult \t\t= @search.fetch # makes request\r\n\tmovie_id \t= result.first['id']\r\n\tputs movie_id\r\n\tmovie_id\r\nend",
"title": ""
},
{
"docid": "e0183fe8c1ceba4da242b1c6ed6b51fc",
"score": "0.48237613",
"text": "def id\n id_attr = resource[:id]\n return id_attr.to_s if id_attr.present? && id_attr.is_a?(::Valkyrie::ID) && !id_attr.blank?\n return \"\" unless resource.respond_to?(:alternate_ids)\n resource.alternate_ids.first.to_s\n end",
"title": ""
},
{
"docid": "ed45e3144211e9ca5bdf9820fd097152",
"score": "0.48216838",
"text": "def annotation_id; end",
"title": ""
},
{
"docid": "ed45e3144211e9ca5bdf9820fd097152",
"score": "0.48216838",
"text": "def annotation_id; end",
"title": ""
},
{
"docid": "ed45e3144211e9ca5bdf9820fd097152",
"score": "0.48216838",
"text": "def annotation_id; end",
"title": ""
},
{
"docid": "ed45e3144211e9ca5bdf9820fd097152",
"score": "0.48216838",
"text": "def annotation_id; end",
"title": ""
},
{
"docid": "a76106663a97fc94fc10572107290b2e",
"score": "0.4819899",
"text": "def to_param\n \"#{id} #{air_name}\".parameterize\n end",
"title": ""
},
{
"docid": "52f02f0931585e65c22163b6875edf01",
"score": "0.48136553",
"text": "def id_from_response(response); end",
"title": ""
},
{
"docid": "08ddad06b8eab5f88c40fa5600d6229a",
"score": "0.4811309",
"text": "def find_polymorphic\n #array for nested routes / classes\n polyarry = []\n params.each do |name, value|\n if name =~ /(.+)_id$/\n n = name.dup\n n.slice!(\"_id\")\n # push the global variable matching, the value and the name capitilized\n polyarry.push [$1, value, n.capitalize]\n end\n end\n if polyarry.blank?\n # if blank, then something is wrong with the call\n return nil\n else\n # grab the last element to return\n value = polyarry.last\n # classify the matching global variable and pull the value from the database. Also return the name of the class.\n return value[0].classify.constantize.find(value[1]), value[2]\n end\n end",
"title": ""
},
{
"docid": "a0f2aa46c7e822c75e3077e57ecbfc4e",
"score": "0.48085395",
"text": "def to_param\n \"#{id} #{full_name}\".parameterize\n end",
"title": ""
},
{
"docid": "a22e1f6121aabc7e2b35c99314c8e565",
"score": "0.480348",
"text": "def to_param\n\t\t\"#{id}-#{title.parameterize}\"\n\t\t# the \"#{}\" - is saying that in the string replace it with something\n\t\t# in this case it is the id\n\t\t\n\tend",
"title": ""
},
{
"docid": "e26db968a5f6aab360512ae18172f46a",
"score": "0.48000267",
"text": "def id\n properties[\"criterionId\"]\n end",
"title": ""
},
{
"docid": "8c066da80f23f609a35fefab9d8c6acb",
"score": "0.47958753",
"text": "def param\n params[:id]\n end",
"title": ""
},
{
"docid": "8c066da80f23f609a35fefab9d8c6acb",
"score": "0.47958753",
"text": "def param\n params[:id]\n end",
"title": ""
},
{
"docid": "a10e23efbeec2aadfcdce2e4182188bd",
"score": "0.4793944",
"text": "def parse_id(fhir_formulary)\n\t\treturn fhir_formulary.id\n\tend",
"title": ""
},
{
"docid": "c95de84db85b046bf027093966de31a3",
"score": "0.47908953",
"text": "def to_param\n id.to_s + '-' + verb_form.parameterize\n end",
"title": ""
},
{
"docid": "b6e4430b0b42da6a95730bbf5ddb183b",
"score": "0.47892392",
"text": "def parse_id; end",
"title": ""
},
{
"docid": "76b5e2e80689ffd49bcc91370d24413d",
"score": "0.47860953",
"text": "def gene_id\n description.andand[/ GN=(\\w+) ?/, 1]\n end",
"title": ""
},
{
"docid": "0bc4877c27b0efdc7a2598aaa0c2b767",
"score": "0.47857594",
"text": "def extract_id\n selector.extract_id\n end",
"title": ""
},
{
"docid": "0fff55c0fbae5eb53026af272cd3b0f4",
"score": "0.4777778",
"text": "def id_from_param(object)\n id = object.is_a?(Hash) ? object[@id_field] : object\n id ? id : raise(MissingIdError.new(\"Missing required id field #{@id_field}}\"))\n end",
"title": ""
},
{
"docid": "75c312383b345eefa4a525aed9e8260e",
"score": "0.4771167",
"text": "def get_id(input)\n\t\t# Trying to account for two situations. 1) Where double-quotes OR single-quotes \n\t\t# are used. 2) Where there is a space after the ID (i.e. id =\"foo\"). Should build\n\t\t# up other contingincies such as id = \"foo\" and id= \"foo\" but these add up quickly.\n\t\tmatches = input.match(/id=\"(.*?)\"|id\\s=\"(.*?)\"|id='(.*?)'|id\\s='(.*?)'/)\n\t\t# Since I have contingency plans some of these matches will return nil. I only want the \n\t\t# one that has a value.\n\t\treturn nil if matches.nil?\n\t\tmatches.captures.each do |match|\n\t\t\treturn match if !match.nil?\n\t\tend\n\tend",
"title": ""
},
{
"docid": "79be0e376bd229af987cadb6e6721521",
"score": "0.47647664",
"text": "def find_id(options={})\n id = nil\n found_movies = self.movies.select do |m|\n result = true\n unless options[:years].nil?\n result = options[:years].include?(m.release_year.to_i)\n end\n result\n end\n# p found_movies.collect{|m| [m.id, m.title, m.year]}\n ids = found_movies.collect{|m| m.id}.uniq.compact\n if ids.length == 1\n id = \"tt#{ids[0]}\"\n end\n id\n end",
"title": ""
},
{
"docid": "7c83b54e0b296e48c412aa052410505f",
"score": "0.47595423",
"text": "def to_param\n \"#{id}-#{subject.downcase.gsub(/[^a-zA-Z0-9]+/, '-').gsub(/-{2,}/, '-').gsub(/^-|-$/, '')}\"\n end",
"title": ""
},
{
"docid": "16374267b1470d79b4cd89d0d727b356",
"score": "0.4756919",
"text": "def getID(word)\n return Keyword.where(name: word).first.id\n end",
"title": ""
},
{
"docid": "e611f8d719e0efadd2ec48add75d5284",
"score": "0.47558007",
"text": "def initialize arg\n @subject =\n case arg\n when Hash\n arg[:subject_dom_id] =~ /(.*)_(\\d*)$/\n\n subject_type = $1.classify.constantize\n subject_id = $2.to_i\n\n subject_type.find subject_id\n else\n arg\n end\n end",
"title": ""
},
{
"docid": "90dd965f795f8df0ea3476b3e0a6a4cf",
"score": "0.4751604",
"text": "def unique_id\n video_id[/videos\\/([^<]+)/, 1]\n end",
"title": ""
},
{
"docid": "514cb5f1431b19972a9690c3150fa511",
"score": "0.47509867",
"text": "def id\n object.to_param\n end",
"title": ""
},
{
"docid": "514cb5f1431b19972a9690c3150fa511",
"score": "0.47509867",
"text": "def id\n object.to_param\n end",
"title": ""
},
{
"docid": "ae88af4378d8b0cede4fe378e5d50762",
"score": "0.47449005",
"text": "def to_param\n \"#{id} #{full_name}\".parameterize\n end",
"title": ""
},
{
"docid": "01dc1d423dfbc97e8699003d143d0296",
"score": "0.47372392",
"text": "def to_param\n \"#{id}-#{title}\".parameterize\n end",
"title": ""
},
{
"docid": "00b085454c1ac7a2fe204bd385d2b599",
"score": "0.47350037",
"text": "def parameterize(obj)\n if obj.respond_to? :to_param\n obj.to_param\n elsif obj.respond_to? :id\n obj.id.to_s\n else\n ''\n end\n end",
"title": ""
}
] |
0afa2129e7258cac02856ef2629be0a3
|
GET /trips/1 GET /trips/1.json
|
[
{
"docid": "830986b49532ace0558a275da3e4d28b",
"score": "0.7495081",
"text": "def show\n respond_to do |format|\n format.any(:trips_json, :json) do\n render json: @trip\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "9786bf4b45c1fa79d5dc5c66e89f139f",
"score": "0.7781902",
"text": "def index\n @trips = Trip.all\n\n render json: @trips\n end",
"title": ""
},
{
"docid": "05d09302be982f21a67335593750f388",
"score": "0.7664061",
"text": "def all_trips\n @trips = Trip.all\n render json: @trips\n end",
"title": ""
},
{
"docid": "9013c1e407a67304baa5e19dcd557b9f",
"score": "0.76578283",
"text": "def trips\n @trip_requests = TripRequest.trips.paginate(page:params[:page], per_page:20)\n json_response(@trip_requests)\n end",
"title": ""
},
{
"docid": "bb0bed949e3cae50c4c1a915972b25f7",
"score": "0.75750923",
"text": "def index\n @trips = Trip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @trips }\n end\n end",
"title": ""
},
{
"docid": "ca5e5bb3d7e6713eb91a611a6748bf69",
"score": "0.7565173",
"text": "def index\n user = current_user ? current_user : User.find(params['user'].to_i)\n @trips = user.trips\n #@trips = current_user.trips\n @trips.to_json\n end",
"title": ""
},
{
"docid": "1680d72eb609c091819f3c2e511692cf",
"score": "0.745689",
"text": "def index\n \n @trips = @logged_user.trips\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "d90012325826901a107be210c28db3e1",
"score": "0.73864114",
"text": "def index\n @trips = current_user.trips.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "d68d5e3bb9a40467092d4fa140e0bc82",
"score": "0.7320423",
"text": "def index\n @trips = Trip.all\n @river = River.find(params[:river_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "d68d5e3bb9a40467092d4fa140e0bc82",
"score": "0.7320008",
"text": "def index\n @trips = Trip.all\n @river = River.find(params[:river_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "1111b07216ebe00bdee1dfaf46e11172",
"score": "0.72671187",
"text": "def index\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "3b4da255a12026302d7fe63bbe4ae710",
"score": "0.7214892",
"text": "def show\n puts \"User \" << params['user']\n user = current_user ? current_user : User.find(params['user'].to_i)\n @trip = user.trips.find(params[:id])\n puts \"Trip \" << @trip.id\n @trip.as_json\n end",
"title": ""
},
{
"docid": "5b1d1e0d612c48970594d32a77eb2987",
"score": "0.71945894",
"text": "def index\n @trips = Trip.get_all_trips(@current_user)\n end",
"title": ""
},
{
"docid": "b93b40d9e679a3c36af4f5c136b4a507",
"score": "0.718359",
"text": "def test \n @trips = current_user.trips.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "612289a51d273d76388594ffaeed59ca",
"score": "0.7174395",
"text": "def index\n @trips = Trip.all \n end",
"title": ""
},
{
"docid": "365e228f7d2b12a71e57a2ee045a9ff7",
"score": "0.7135989",
"text": "def show\n @intended_trip = IntendedTrip.get(params[:id])\n @intended_trips = @intended_trip.trips_within(2000)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @intended_trip }\n end\n end",
"title": ""
},
{
"docid": "43d13083556133e74565cb5f39721e7c",
"score": "0.7135012",
"text": "def get_trips\n trips = []\n url = \"#{base_url}#{config['uri']['trips']}\"\n page = 0\n\n begin\n puts(page)\n\n json_string = Downloader.get(url, authentication_token: config['api_key'], page: page)\n\n json = JSON.load(json_string) || {}\n page_trips = json['trips'] || []\n trips += page_trips\n\n page = page + 1\n end while page_trips.count > 0\n\n trips = trips.select {|t| t['reference'] =~ /^#{config['filter']}.*$/} if config['filter']\n trips\n end",
"title": ""
},
{
"docid": "b964cf7f29fcce59937188a9a38f91a6",
"score": "0.71334857",
"text": "def index \n unless(params[:id==nil])\n @trips = Trip.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "f2b251b2a089390202075cf471e28306",
"score": "0.7097726",
"text": "def index\n trips = current_user.trips.as_json(:include => [:destination_address])\n api_response(true, :trips => trips)\n end",
"title": ""
},
{
"docid": "ae555b08d5ae780cf62f01fcbf4e50d6",
"score": "0.7082572",
"text": "def index\n\t\t@trips = Trip.all\n\tend",
"title": ""
},
{
"docid": "ed0a53e561b90611413ac461037f980a",
"score": "0.7082211",
"text": "def trip(trip_id)\n connection.get(\"/trips/#{trip_id}\").body\n end",
"title": ""
},
{
"docid": "d113b6ad917927184414e32bf96b917a",
"score": "0.7030222",
"text": "def show\n @trips = Trip.all\n end",
"title": ""
},
{
"docid": "5bcd37b4c466214eb6a98819db8e1552",
"score": "0.69831544",
"text": "def index\n @trips = Trip.all\n # @trips = Trip.where(user_id: current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {\n render json: @trips.to_json(include: :markers)\n }\n end\n end",
"title": ""
},
{
"docid": "a29b6109900f93bd9c22e6de20dfb659",
"score": "0.69562936",
"text": "def url\n \"/api/triples/#{self.id}\"\n end",
"title": ""
},
{
"docid": "10bb35da76ac79259ce077fe485af1e7",
"score": "0.68995523",
"text": "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "10bb35da76ac79259ce077fe485af1e7",
"score": "0.68995523",
"text": "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "10bb35da76ac79259ce077fe485af1e7",
"score": "0.68995523",
"text": "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "f2a4c045c7ee87e9845153b51b00c877",
"score": "0.68798965",
"text": "def index\n @trips = current_user.trips\n end",
"title": ""
},
{
"docid": "f2a4c045c7ee87e9845153b51b00c877",
"score": "0.68798965",
"text": "def index\n @trips = current_user.trips\n end",
"title": ""
},
{
"docid": "3cf23e8c51f1dac46a256a077ce1f0ad",
"score": "0.68683535",
"text": "def show\n @trips = @user.trips\n end",
"title": ""
},
{
"docid": "648e114e7060f5a970b06cc7482bab28",
"score": "0.686489",
"text": "def index\n #@trips = Trip.all\n @trips = Trip.search(params[:search], params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "8b04c186b1af40edc03dd6377dd502a2",
"score": "0.68354565",
"text": "def show\n @trip = Trip.find_by_webstring(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "9fa5a23338508e30894fbca9200207ed",
"score": "0.6831387",
"text": "def index\n @trips = @company.trips.search(params)\n render json: @trips, status: 201\n end",
"title": ""
},
{
"docid": "82986c889282c0387cb800de30b1ec0b",
"score": "0.67992586",
"text": "def index\n @trips = @paginate = Trip.order('id DESC').paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "482d535c63fd066b703d111e168af921",
"score": "0.67847437",
"text": "def index\n @trips = Trip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trips }\n end\n end",
"title": ""
},
{
"docid": "482d535c63fd066b703d111e168af921",
"score": "0.67847437",
"text": "def index\n @trips = Trip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trips }\n end\n end",
"title": ""
},
{
"docid": "11afb88cac52f03637e8cf5b46f05944",
"score": "0.6782967",
"text": "def show\n trips = Trip.where(client_id: params[:id])\n render json: trips.to_json(:include => {\n :attraction => {:only => [:name, :image]}\n })\n end",
"title": ""
},
{
"docid": "ba8973bf44497de6ef395d1104b98067",
"score": "0.67749393",
"text": "def index\r\n @trips = current_user.trips\r\n end",
"title": ""
},
{
"docid": "ddf48e687f1261b115a2c07b343b1cff",
"score": "0.6772873",
"text": "def index\n @trips = current_user.trips.all\n if params[:tag]\n @trips = current_user.trips.tagged_with(params[:tag])\n else\n @trips = current_user.trips.all\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "a29e1e494a787c82a5ebf9dbe503fe81",
"score": "0.6755392",
"text": "def show\n @user = User.find(params[:user_id])\n @tour = @user.tours.find(params[:tour_id])\n @trip = @tour.trips.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "1cbf9d3896700bf24e9ed72873862264",
"score": "0.6735914",
"text": "def retrieve_trips\n rider = RideShare::Trip.by_rider(id)\n return rider\n end",
"title": ""
},
{
"docid": "1a04470605c163fb455981abb97f56f9",
"score": "0.6735587",
"text": "def index\n @trips = Trip.all\n @title = \"Trips\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trips }\n end\n end",
"title": ""
},
{
"docid": "ef343a52bd487e953658b10634e4b153",
"score": "0.67315954",
"text": "def get_trip\n\t\t@trip = Trip.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "7453f0df0fc1b02dffa575b569c30f0f",
"score": "0.6723513",
"text": "def index\n @search = Trip.search(params[:q])\n @trips = @search.result\n end",
"title": ""
},
{
"docid": "fe8583764482987c11aa94cb3fba1c92",
"score": "0.6674565",
"text": "def show\n @search_trip = SearchTrip.find(params[:id])\n @commissions = @search_trip.trips\n respond_to do |format|\n format.html\n format.json { render json: @commissions }\n end\n end",
"title": ""
},
{
"docid": "e100db363230b6bdbd193a702d1c7d1e",
"score": "0.66719645",
"text": "def trips\n #Returns set of trips in order based on parameters\n @trips = Trip.search(params[:search], params[:column]).order(sort_column(Trip, 'truck_id') + ' ' + sort_direction)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "9d04f8d56c9afde370ecaa65ad2d6ba0",
"score": "0.66669035",
"text": "def index\n @trips = Trip.includes(:category).all\n end",
"title": ""
},
{
"docid": "9d963293e4cdc90f8e1280f793c0b5bd",
"score": "0.6663911",
"text": "def index\n\n @q = Trip.search(params[:q])\n @trips = @q.result\n\n end",
"title": ""
},
{
"docid": "f0a486b2e041ec7897f2b6016fba2c5c",
"score": "0.66538113",
"text": "def index\n where_str = \"user_id = :user_id\"\n where_hash = { user_id: current_user.id }\n paginate Trip.where(where_str, where_hash).count, 50 do |limit, offset|\n @trips = Trip.where(where_str, where_hash)\n .order(:start_date)\n .limit(limit)\n .offset(offset)\n respond_to do |format|\n format.any(:trips_json, :json) do\n render json: @trips\n end\n end\n end\n end",
"title": ""
},
{
"docid": "67b7a19851399b700dd482b8c5533c2e",
"score": "0.66443807",
"text": "def index\n @trips = Trip.all.paginate(:page => params[:page], :per_page => 5, :order => { updated_at: :desc })\n end",
"title": ""
},
{
"docid": "c3bfedaa40e8eab2db80399577ca6ba0",
"score": "0.6607224",
"text": "def show\n @trip = Trip.find(params[:id])\n end",
"title": ""
},
{
"docid": "b225e609fd0a97a482c986b9fe3fab90",
"score": "0.6594526",
"text": "def get_trip\n\t\t@trip = @user.trips.find(params[:trip_id]) if params[:trip_id]\n\tend",
"title": ""
},
{
"docid": "20b23ddfe2610faf10a4dbced2c56fd8",
"score": "0.6569572",
"text": "def load_trips_json\n self.trips = get_trips\n load_guides_json\n trips.reject! {|t| t['type'] == 'content'}\n trips.to_json\n end",
"title": ""
},
{
"docid": "45d4a021077a0108d2d8479c44056261",
"score": "0.6542845",
"text": "def index\n @tripitems = Tripitem.all\n end",
"title": ""
},
{
"docid": "5f1d9c963df86600e394f8af1c6801bc",
"score": "0.65412396",
"text": "def index\n @trips = current_user.trips\n render :layout => \"trip_index\"\n end",
"title": ""
},
{
"docid": "ae2a0604e67bd57b364ee6b16dd9ad32",
"score": "0.653507",
"text": "def gettrips\n @employee = Employee.find(params[:employee_id])\n #@lovedone = Lovedone.find(params[:lovedone_id]) \n #filter only trips with state as active or \n #@trips = Trip.where(employee_id: @employee, lovedone_id: @lovedone)\n @trips = Trip.where(employee_id: @employee, state: \"active\")\n respond_to do |format|\n if @trips\n #format.json { render json: @trips}\n format.json { render :json => @trips.to_json(:include => [:lovedone, :employee])}\n else\n #format.html\n format.json { render json: @trips.errors, status: :unprocessable_entity }\n end \n end \n end",
"title": ""
},
{
"docid": "e7c864afa711f2758718c1d0bc2969cf",
"score": "0.6526164",
"text": "def getAllTripsForUser(user_id)\n @trips = Trip.where(:user_id =>user_id)\n return @trips\n end",
"title": ""
},
{
"docid": "e7c864afa711f2758718c1d0bc2969cf",
"score": "0.6526164",
"text": "def getAllTripsForUser(user_id)\n @trips = Trip.where(:user_id =>user_id)\n return @trips\n end",
"title": ""
},
{
"docid": "b477341b11c8e179a8a5d311fa33e815",
"score": "0.6498395",
"text": "def show\n @trip = Trip.find(params[:id])\n @river = River.find(params[:river_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "b477341b11c8e179a8a5d311fa33e815",
"score": "0.6498395",
"text": "def show\n @trip = Trip.find(params[:id])\n @river = River.find(params[:river_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "b352f98475d50d0996ddaf725a7ec230",
"score": "0.649584",
"text": "def show\n @trip_request = TripRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_request }\n end\n end",
"title": ""
},
{
"docid": "348f0e281c00f18f6b73d379fafdbc84",
"score": "0.6481203",
"text": "def future_trips\n future_trips_hash = @traveler.future_trips(params[:max_results] || 10)\n .outbound\n .map {|t| my_trips_hash(t)}\n render status: 200, json: {trips: future_trips_hash}\n end",
"title": ""
},
{
"docid": "63a476f9716079e5102aa9424e001515",
"score": "0.64714736",
"text": "def show\n @user = User.find(params[:id])\n # @trips = Trip.find(params[:creator_id])\n # puts \"ALLO\", @trips\n end",
"title": ""
},
{
"docid": "e9158f2d0bb65f99c89982dc466d641d",
"score": "0.6459041",
"text": "def show\n @request = Request.find(params[:id])\n @sorted_trips = @request.get_sorted_trips\n end",
"title": ""
},
{
"docid": "bb3bedf3c2c9eff785b0e5f886221fc3",
"score": "0.6444662",
"text": "def index\n @fieldtrips = Fieldtrip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fieldtrips }\n end\n end",
"title": ""
},
{
"docid": "ddf6427f605b3ca732640b08606f6b6f",
"score": "0.6440235",
"text": "def trips\n RideShare::Trip.find_by_rider(id)\n end",
"title": ""
},
{
"docid": "2f7a14d8a7ce21213bc0398b845b7040",
"score": "0.6439589",
"text": "def find_trip\n @trip = Trip.find(params[:id])\n end",
"title": ""
},
{
"docid": "6f272190a1386366ae297a53bf75667d",
"score": "0.6435808",
"text": "def show\n @trip_type = TripType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_type }\n end\n end",
"title": ""
},
{
"docid": "4dfa2ec3b7f845f6e44c462cfe25d432",
"score": "0.64330626",
"text": "def index\n @user = User.find_by_id(params[:user_id])\n @trip = nil\n if !@user.nil?\n if params[:attr] == \"my_sr_tab\"\n @trips = @user.trips.page(params[:all_page]).per(2)\n else\n @trips = Trip.public_trip.page(params[:all_page]).per(2)\n end\n# puts @trips.count\n else\n flash[:notice] = \"User not found\"\n return redirect_back_or_default(home_index_path)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n format.js\n end\n end",
"title": ""
},
{
"docid": "279d287c598779052dce7a3202311748",
"score": "0.64253354",
"text": "def index\n @vehicle_trips = VehicleTrip.paginate(:page => params[:page], :per_page => 15)\n \n respond_to do |format|\n format.html { render :index }\n format.json {\n render :json => {\n :current_page => @vehicle_trips.current_page,\n :per_page => @vehicle_trips.per_page,\n :total_entries => @vehicle_trips.total_entries,\n :entries => @vehicle_trips\n }\n }\n end\n end",
"title": ""
},
{
"docid": "abf72936a24c7ae3ae2eff5c85e655ec",
"score": "0.64222974",
"text": "def index\n #Dummy. Wird entfernt\n temp = current_user\n @trips = temp.driven\n #Alle Fahrten, die ich als Fahrer noch absolvieren muss\n @future_trips = temp.to_drive\n #Alle Fahrten, die ich als Fahrer absolviert habe\n @completed_trips = temp.driven\n #Alle Fahrten, die ich als Mitfahrer absolviert habe\n @ridden_trips = temp.driven_with\n #Alle Fahrten, in denen ich Mitfahrer noch teilnehmen\n @future_ridden_trips = temp.to_drive_with\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"title": ""
},
{
"docid": "97fe7309aeda465fa0067b4235de5f45",
"score": "0.64183456",
"text": "def index\n @trips = Trip.all \n respond_to do |format|\n format.html {}\n format.json { render json: {trips: @trips}, status: :ok}\n end \n gon.trips = @trips\n\n #json_response(trips: @trips) THIS WILL WORK COMBINED WITH APPCONTROLLER AND CONCERN\n end",
"title": ""
},
{
"docid": "a13d1cd3bc3328244c1f9f8a016c6f78",
"score": "0.6408779",
"text": "def get_trips #from trip object\n trips = RideShare::Trip.by_driver(@id)\n return trips\n end",
"title": ""
},
{
"docid": "82f88f57e476f2c9750894c16749e6e1",
"score": "0.6404958",
"text": "def index\n @data = @trips = Trip.all\n @show_timemap = true\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trips }\n end\n end",
"title": ""
},
{
"docid": "d344b3d9ce67413e4a2c8ad3029c2159",
"score": "0.6402772",
"text": "def get_all_trips_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TripApi.get_all_trips ...\"\n end\n # resource path\n local_var_path = \"/trip/all\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n 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<Trip>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TripApi#get_all_trips\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "43b87d3941d636e89ac65fdb2fbcbee2",
"score": "0.6388273",
"text": "def index\n @user_trips = UserTrip.all\n end",
"title": ""
},
{
"docid": "ed8510857232fe3e4a73d95736a2415b",
"score": "0.6385668",
"text": "def new\n @trip = current_user.trips.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "cffeae120bef99f1df2a4bf5de97f552",
"score": "0.6374015",
"text": "def show\n @otto_view_raw_trip = OttoViewRawTrip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @otto_view_raw_trip }\n end\n end",
"title": ""
},
{
"docid": "e14f33e9aaaa6f34564b179379fc15ec",
"score": "0.6370169",
"text": "def index\n @trips = Trip.all\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "74772815f121df357e7681ab3d01a4ae",
"score": "0.6352173",
"text": "def trips_stats \n @all = TripRequest.trips.count\n @completed = TripRequest.trips.completed.count\n @cancelled = TripRequest.trips.cancelled.count\n @pending = TripRequest.trips.pending.count\n @on_going = TripRequest.trips.on_going.count\n @active = TripRequest.trips.active.count\n @response = { all: @all, completed: @completed, cancelled: @cancelled, active: @active, pending: @pending, on_going: @on_going}\n json_response(@response)\n end",
"title": ""
},
{
"docid": "5b13636910571ea251b94d4d4dd3101d",
"score": "0.633744",
"text": "def trips\n Trip.where(id: @trip_ids)\n end",
"title": ""
},
{
"docid": "53f88b3acf18cde68518e944c0f3d70f",
"score": "0.6329124",
"text": "def trips\n Trip.find_for_rider(@rider_id)\n end",
"title": ""
},
{
"docid": "275be9b62a4c9ff89d66a5e4f2908297",
"score": "0.6300497",
"text": "def trips(options = {})\n raise ArgumentError, 'You must provide a :cid option' if options[:cid].blank?\n raise ArgumentError, 'You must provide a :year option' if options[:year].blank?\n options.merge!({:method => 'memTravelTrips'})\n self.class.get(\"/\", :query => options)\n end",
"title": ""
},
{
"docid": "04f28ffd8b426413532a36bc54d99791",
"score": "0.6271297",
"text": "def show\n @waterbody = Waterbody.find_by_name(params[:name])\n raise ActionController::RoutingError, 'Not Found' if @waterbody.nil?\n @trips = @waterbody.trips.order('start_date asc')\n end",
"title": ""
},
{
"docid": "d98bea7f28fd596e4cdd1b81af9e0f9f",
"score": "0.6269689",
"text": "def create\n @trip = Trip.new(trip_params.merge(user_id: current_user.id))\n\n respond_to do |format|\n format.any(:trips_json, :json) do\n if @trip.save\n render json: @trip, status: :created, location: @trip\n else\n render json: @trip.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b43975f5abd9d557ac021e8db85133c2",
"score": "0.6235961",
"text": "def show\n @user = User.find_by_id(params[:user_id])\n if !@user.nil?\n @trip = @user.trips.find_by_id(params[:id])\n if !@trip.nil?\n @globalArray = read_all_data_with_distance(@trip.datalog.path,200)\n @globalArray.to_json\n else\n flash[:notice] = \"Trip not found\"\n return redirect_back_or_default(user_trips_path(@user))\n end\n\n else\n flash[:notice] = \"User not found\"\n return redirect_back_or_default(home_index_path)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "f8624985a64d0ed5fb686f754acd06bc",
"score": "0.62342656",
"text": "def show\n authorize Trip\n @trip = Trip.find_by(uuid: params[:id])\n end",
"title": ""
},
{
"docid": "42a52fc692f8e7154ca3c8cc18a72764",
"score": "0.62300867",
"text": "def show\n \trespond_to do |format|\n \tformat.html # show.html.erb\n \tformat.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "29324b17d6d674fd8250d621ec8f68b9",
"score": "0.6228925",
"text": "def index\n @trip_requests = TripRequest.all\n end",
"title": ""
},
{
"docid": "b754b1a6557a8ec773ca0286e1ed608d",
"score": "0.6228646",
"text": "def index\n @trip = Trip.find_by_name(params[:trip_id])\n render :layout => \"trip\"\n end",
"title": ""
},
{
"docid": "813533dd30d462619f94aa76bf508fd1",
"score": "0.62240577",
"text": "def show\n @shopping_trip = ShoppingTrip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shopping_trip }\n end\n end",
"title": ""
}
] |
bce8d4d05c1d2419fc5f3d9f00dcad12
|
nil ! mutate the argument string given a string 'connor' swap pairs of characters swap pairs beginning with the outside chracters, moving inwards the number of times to swap is half the length of the string, if it's odd that character doesn't need to be swapped swap logic first, last begin at 0 and 1 respectively str[first], str[last] = str[last], str[first] increment first, decremement last
|
[
{
"docid": "789333db052b8d3a9f46295a3d7a4d5e",
"score": "0.6199924",
"text": "def reverse_str(str)\n left_index, right_index = 0, (str.length - 1)\n\n while left_index < right_index\n\n str[left_index], str[right_index] = str[right_index], str[left_index]\n\n left_index += 1\n right_index -= 1\n\n end\n\nend",
"title": ""
}
] |
[
{
"docid": "4ddabf597a920e426f34222dd9fa1c4b",
"score": "0.7163099",
"text": "def swap(string)\n\tswapper = string.split\n\tstring = swapper.reverse.join(\" \")\n\tstring.downcase!\n\tvowels = \"aeioua\"\n\tcon = \"bcdfghjklmnpqrstvwxyzb\"\n\tindex = 0\n\tfinal_string = \"\"\n\tstring.length.times do |index|\n\t\tif !con.include?(string[index]) && !vowels.include?(string[index])\n\t\t\tfinal_string.concat(\" \")\n\t\t\telsif vowels.include?(string[index])\n\t\t\tnext_vowel = vowels[vowels.index(string[index]) +1]\n\t\t\tfinal_string << next_vowel\n\t\t\telsif con.include?(string[index])\n\t\t\tnext_con = con[con.index(string[index]) +1]\n\t\t\tfinal_string << next_con\n\t\tend\n\t\tindex += 1\n\tend\n\tfinal_string = final_string.split.map! { |x| x.capitalize }.join(' ')\n\tfinal_string\nend",
"title": ""
},
{
"docid": "d9fa523dfeccd9a8c76d0adf6002d0db",
"score": "0.69614637",
"text": "def swap(string)\n arr = string.split\n arr.map do |word|\n first = word[0]\n second = word[word.size - 1]\n word[0] = second\n word[word.size - 1] = first\n end\n arr.join(\" \")\nend",
"title": ""
},
{
"docid": "9cee38cf23011597c6ced37b0dfbc706",
"score": "0.690343",
"text": "def swap(string)\n if string.split.size > 1\n array = string.split.each do |word|\n word[0], word[-1] = word[-1], word[0]\n end\n array.join(' ')\n elsif string.length <= 1\n string\n else\n first = string[0]\n last = string[-1]\n string[0] = last\n string[-1] = first\n string\n end\nend",
"title": ""
},
{
"docid": "dad06ccd4adccce7515a27fdab511539",
"score": "0.68968517",
"text": "def swap(string)\n array = string.split\n swapped_array = array.map do |element|\n element[0], element[-1] = element[-1], element[0]\n element\n end\n swapped_array.join(' ')\nend",
"title": ""
},
{
"docid": "a74e6a1ee7f9e80c7798383ab1befec2",
"score": "0.688276",
"text": "def switchPairs(strings)\n highest_index = strings.length - 1\n i = 0\n until i == highest_index\n strings[i], strings[i + 1] = strings[i + 1], strings[i] if i % 2 == 0\n i += 1\n end\n return strings\nend",
"title": ""
},
{
"docid": "2f00988b4e8778145d0c4f58ff3a883b",
"score": "0.68677807",
"text": "def reverse_in_place(str)\n idx = 0\n while idx < str.length / 2\n # swapped = str[str.length-1-idx]\n # str[str.length-1-idx] = str[idx]\n # str[idx] = swapped\n str[idx], str[str.length-1-idx] = str[str.length-1-idx], str[idx]\n idx += 1\n end\n str\nend",
"title": ""
},
{
"docid": "5054b2d7281d9e1d9f2fd4517e631718",
"score": "0.6862448",
"text": "def swap(str)\n arr = str.split\n arr.map do |word| \n word[0], word[word.size - 1] = word[word.size - 1], word[0]\n end \n arr.join(' ')\nend",
"title": ""
},
{
"docid": "407dfddda39318eb7298b52d19b93d8b",
"score": "0.6859267",
"text": "def swap(str)\n arr = str.split(' ')\n arr.each { |word| word[0], word[-1] = word[-1], word[0] }\n arr.join(' ')\nend",
"title": ""
},
{
"docid": "bd87cb20278cb979b89dd41c23bc75a7",
"score": "0.685501",
"text": "def swap(string)\n arr = string.split(' ')\n\n arr.map! do |word|\n first = word[0]\n word[0] = word[-1]\n word[-1] = first\n word\n end\n\n arr.join(' ')\nend",
"title": ""
},
{
"docid": "ed127aa9c0e2ff58fd00c46f2eee010d",
"score": "0.68354434",
"text": "def swap(string)\n string.split.each{|e| e[0], e[-1] = e[-1], e[0]}.join(' ')\nend",
"title": ""
},
{
"docid": "2a14d92f48beb186c8f991e7ed4553a6",
"score": "0.68183506",
"text": "def swap(string)\n string.split.map do |word| \n word[0], word[-1] = word[-1], word[0]\n word\n end.join(\" \")\nend",
"title": ""
},
{
"docid": "6b0afee8394b9d1a8bc4bb6d555a109d",
"score": "0.6794974",
"text": "def swap(str)\n new_arr = str.split\n swapped_arr = new_arr.map do |word|\n word[0], word[-1] = word[-1], word[0]\n word\n end\n swapped_arr.join(' ')\nend",
"title": ""
},
{
"docid": "e6e6b0fb14c39d211bd87510550e9eef",
"score": "0.6792811",
"text": "def swap(string)\r\nresult = []\r\n\r\nstring.split.map do |word|\r\nfirst = word[0] \r\nlast = word[-1] \r\nword[0] = last\r\nword[-1] = first\r\nresult << word\r\n end\r\n p result.join(' ')\r\nend",
"title": ""
},
{
"docid": "7d75394a5eab1c21f3257656c3f42605",
"score": "0.6782782",
"text": "def swap(str)\n swapped_str = str.split(' ').map {|word|\n tmp = word[-1]\n word[-1] = word[0]\n word[0] = tmp\n \n word\n }\n \n swapped_str.join(' ')\nend",
"title": ""
},
{
"docid": "68a112f5c758a57b438d31d0de5ddf65",
"score": "0.676128",
"text": "def swap(str)\n words = str.split(' ')\n words.each do |w|\n first = w[0]\n last = w[-1]\n w[0] = last\n w[-1] = first\n end\n words.join(' ')\nend",
"title": ""
},
{
"docid": "4ed5cbe62972fe2d6525b0a39ab7b3c6",
"score": "0.6739746",
"text": "def reverse(str)\n half = str.length / 2\n half.times do |i|\n swap = str[i]\n str[i] = str[str.length - (i + 1)]\n str[str.length - (i + 1)] = swap\n end\n str\nend",
"title": ""
},
{
"docid": "1ded53faa9e7a9bd03eddefbec59cc49",
"score": "0.6699227",
"text": "def swap(string)\n swapped = string.split(' ').map do |word|\n first_character = word[0]\n last_character = word[-1]\n word[0] = last_character\n word[-1] = first_character\n word\n end\n swapped.join(' ')\nend",
"title": ""
},
{
"docid": "63891b38ce1bf1bb0398fcfa767c5cde",
"score": "0.6697141",
"text": "def swap(string)\n string = string.split\n new_string = []\n\n\n string.map do |word|\n word = word.chars\n c1 = word[0]\n c2 = word[-1]\n\n word[0] = c2\n word[-1] = c1\n\n new_string << word.join\n\n end\n\n new_string.join(' ')\nend",
"title": ""
},
{
"docid": "51f01842387f04de7b44ffe35bae2d72",
"score": "0.6658423",
"text": "def string_reverse(my_string)\r\n return my_string if my_string.length < 2\r\n\r\n i = 0\r\n\r\n while i < my_string.length/2\r\n swap_in_place(my_string, i, my_string.length-i-1)\r\n i +=1\r\n end\r\n\r\n return my_string\r\nend",
"title": ""
},
{
"docid": "8d4249ea3e6b35b37d2c8a5bdf65e0a9",
"score": "0.66383755",
"text": "def swap(str)\n words = str.split\n words.each do |word|\n temp = word[-1]\n word[-1] = word[0]\n word[0] = temp\n end\n \n words.join(' ')\nend",
"title": ""
},
{
"docid": "79a9d4d4c7c92bea0f750dbc31911eb1",
"score": "0.66321427",
"text": "def swap(input)\n swapped = input.split(' ').map do |word|\n char1 = word[0]\n char2 = word[-1]\n word[0] = char2\n word[-1] = char1\n word\n end\n swapped.join(' ')\nend",
"title": ""
},
{
"docid": "7af7bd7836326c1e976ac2e3095ecb3f",
"score": "0.6631338",
"text": "def swap_chars string # my version\n new_string = string.split.map do |word|\n first = word[0]\n word[0] = word[-1]\n word[-1] = first\n word\n end\n new_string.join(' ')\nend",
"title": ""
},
{
"docid": "b4185082062ba461be1dbceb493e3fcd",
"score": "0.6628308",
"text": "def reverse(str)\n puts \"Your string: #{str}\"\n length = str.length\n current_char_index = 0\n mirror_char_index = str.length - 1\n\n until (current_char_index == mirror_char_index) || (mirror_char_index - current_char_index == 1)\n # set current and mirror chars\n current_char = str[current_char_index]\n mirror_char = str[mirror_char_index]\n\n # switch\n str[current_char_index] = mirror_char\n str[mirror_char_index] = current_char\n\n # increment and set next indices\n current_char_index += 1\n mirror_char_index = length - (current_char_index + 1)\n end\n\n puts \"Reversed string: #{str}\"\n str\nend",
"title": ""
},
{
"docid": "82d8a4c4b5ff48f6491262427ffe07a9",
"score": "0.66107386",
"text": "def swap(string)\n arr = []\n string.split(\" \").each do |element|\n arr << element.split(\"\")\n end\n \n swap_arr = []\n arr.each do |e|\n first_char = e.shift\n last_char = e.pop\n swap_arr << e.unshift(last_char).push(first_char)\n end\n \n swap_arr.map! do |el|\n el.join(\"\")\n end\n \n swap_str = swap_arr.join(\" \")\n \n swap_str\nend",
"title": ""
},
{
"docid": "cfc79e22372ff721178d4ed8d4140b98",
"score": "0.6609573",
"text": "def reverse_inplace(s, i = 0, j = -1)\n n = s.length \n if i == n / 2 \n return s \n else \n letter = s[i]\n s[i] = s[j]\n s[j] = letter \n reverse_inplace(s, i + 1, j - 1)\n end \nend",
"title": ""
},
{
"docid": "5524107412e41ee213ddc2483e53b19d",
"score": "0.6599571",
"text": "def swap(str)\n word_list = str.split\n word_list.each do |word|\n word[0], word[-1] = word[-1], word[0]\n end\n word_list.join(' ')\nend",
"title": ""
},
{
"docid": "b45f792fd7e942ad1a6b7f2f0c241634",
"score": "0.6568461",
"text": "def reverse_string(string)\n first_index = 0\n last_index = string.length - 1\n\n while first_index < last_index\n #swapping!\n string[first_index], string[last_index] =\n string[last_index], string[first_index]\n #move towards the middle\n first_index += 1\n last_index -= 1\n end\n\n return string\n\nend",
"title": ""
},
{
"docid": "9c1804a4b1327d1cf0674b1789164334",
"score": "0.65434295",
"text": "def swap(string)\n result = string.split(' ').map do |substring|\n str = substring.split('')\n first = str[0]\n str[0] = str[substring.length - 1]\n str[substring.length - 1] = first\n str.join\n end\n result.join(' ')\nend",
"title": ""
},
{
"docid": "20d2d613c3ab83489b376826f9b28946",
"score": "0.65422535",
"text": "def reverse_helper(string, s, e)\n pairs = (e + 1 - s)/2\n pairs.times do\n temp = string[s]\n string[s] = string[e]\n string[e] = temp\n s += 1\n e -= 1\n end\nend",
"title": ""
},
{
"docid": "22a9eb285f71a7f5a206581e749d2063",
"score": "0.65351444",
"text": "def swap_first_last_character(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "a0f6a4980d515f41548aa4ad52eab5bb",
"score": "0.6530566",
"text": "def str_reverse(str)\n middle = str.length/2\n (0...middle).each do |index|\n str[index], str[-index - 1] = str[-index - 1], str[index]\n end\n str\nend",
"title": ""
},
{
"docid": "cd1b952205982e031179e69fe3870f47",
"score": "0.65146536",
"text": "def consenant_swap(name)\r\n name = name.downcase\r\n consenants = \"bcdfghjklmnpqrstvwxyz\"\r\n name_index = 0\r\n cons_index = 0\r\n while name_index < name.length\r\n if name[name_index] == \"a\" || name[name_index] == \"e\" ||name[name_index] == \"i\"|| name[name_index] == \"o\" || name[name_index] == \"u\" || name[name_index] == \" \"\r\n name_index += 1\r\n elsif name[name_index] == \"z\"\r\n name[name_index] = \"b\"\r\n name_index += 1\r\n else\r\n until name[name_index] == consenants[cons_index]\r\n cons_index += 1\r\n end\r\n name[name_index] = consenants[cons_index + 1]\r\n name_index += 1\r\n end\r\n cons_index = 0\r\n end\r\n name\r\nend",
"title": ""
},
{
"docid": "ce1118d06bda6cc130d483d030233df4",
"score": "0.6503884",
"text": "def reverse_string_2(s)\n swap(0,s.size-1, s)\nend",
"title": ""
},
{
"docid": "c5b52c5a3c5371c307fc628e060e2810",
"score": "0.6501593",
"text": "def reverse_inplace(str)\n (0..(str.length/2)-1).each do |i|\n str[i], str[-i-1] = str[-i-1], str[i]\n end\n return str\nend",
"title": ""
},
{
"docid": "3332f3d8647c3bf15fa10d8afa8e6bba",
"score": "0.64864284",
"text": "def swap_first_last_characters(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "3332f3d8647c3bf15fa10d8afa8e6bba",
"score": "0.64864284",
"text": "def swap_first_last_characters(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "3332f3d8647c3bf15fa10d8afa8e6bba",
"score": "0.64864284",
"text": "def swap_first_last_characters(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "3332f3d8647c3bf15fa10d8afa8e6bba",
"score": "0.64864284",
"text": "def swap_first_last_characters(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "2435d19a7b61bc3b87cd66a88152c57a",
"score": "0.6486151",
"text": "def swap(input)\n array = input.split(' ')\n array.map! { |word| word.chars }\n array.map! do |word|\n word[0], word[-1] = word[-1], word[0]\n word.join('')\n end\n array.join(' ')\nend",
"title": ""
},
{
"docid": "9ddffa16ee8b0bd6b3fa1f8ab45e73d1",
"score": "0.64794606",
"text": "def swap(string)\n results = []\n\n string.split.each do |word|\n results << word.chars\n end\n\n results.each do |word|\n word[0], word[-1] = word[-1], word[0]\n end\n\n results.map(&:join).join(\" \")\nend",
"title": ""
},
{
"docid": "bee672f92bf9488577ec441aaac94a9c",
"score": "0.64653194",
"text": "def reverse_string_in_place(str)\n last_index = str.length # start off as one more than last index\n\n (0...str.length).each do |i|\n last_index = last_index - 1 # keep track of corresponding later char\n current_char = str[i]\n later_char = str[last_index]\n\n next if i == last_index || i < last_index\n\n # swap them in str\n str[i] = later_char\n str[last_index] = current_char\n end\n\n p str\nend",
"title": ""
},
{
"docid": "5c540005a71927edf70d1e94f6b8428c",
"score": "0.6453686",
"text": "def switchPairs(a)\n if a.length % 2 == 0\n (0..a.length-1).each do |i|\n if i % 2 == 0\n a[i], a[i+1] = a[i+1], a[i]\n end\n end\n else\n (0..a.length-2).each do |i|\n if i % 2 == 0\n a[i], a[i+1] = a[i+1], a[i]\n end\n end\n end\n return a\nend",
"title": ""
},
{
"docid": "380446e2146ee4be1253b59999465c90",
"score": "0.6452292",
"text": "def swap_nums(string)\n words = string.split(\" \")\n words.each do |word| \n word[0], word[word.length - 1] = word[word.length - 1], word[0]\n end\n\n return words.join(\" \")\nend",
"title": ""
},
{
"docid": "8eff1bd2d2b3ab9d7e5b72ebe8744442",
"score": "0.6426814",
"text": "def swap(string)\n words = string.split\n words.each do |word|\n first_char = word[0]\n word[0] = word[-1]\n word[-1] = first_char\n end\n words.join(' ')\nend",
"title": ""
},
{
"docid": "8d9ad80595762915cf7ff6396ff40883",
"score": "0.6420195",
"text": "def swap(string)\n words = string.split\n swapped_words = words.map do |word|\n swapped = word.dup\n swapped[0] = word[-1]\n swapped[-1] = word[0]\n swapped\n end\n\n swapped_words.join(' ')\nend",
"title": ""
},
{
"docid": "f7d3f6eb4c00f7e2f6fac20c5e713fb5",
"score": "0.6388562",
"text": "def first_last_swap (full_name_string)\n swapped_full_name_array = full_name_string.split(' ').rotate(1)\n swapped_full_name_string = swapped_full_name_array.join(' ')\nend",
"title": ""
},
{
"docid": "94c34d82d34ce1b840feda61440b39b5",
"score": "0.63868415",
"text": "def swap_word(word)\n temp = word[0]\n word[0] = word[-1]\n word[-1] = temp \n word\nend",
"title": ""
},
{
"docid": "e988d6be793168c88d5d6be3ba8e5a9c",
"score": "0.6375406",
"text": "def reverse_string_in_place(str)\n beginning_index = 0\n last_index = str.length - 1\n\n\n while beginning_index < last_index\n current_char = str[beginning_index]\n later_char = str[last_index]\n\n # swap them in str\n str[beginning_index] = later_char\n str[last_index] = current_char\n\n last_index = last_index - 1\n beginning_index = beginning_index + 1\n end\n\n p str\nend",
"title": ""
},
{
"docid": "4b394d6a6dc56e968d5cae0868613255",
"score": "0.6372194",
"text": "def word_swap wrd\n return wrd if wrd.length < 2\n wrd[-1] + wrd[1..-2] + wrd[0]\nend",
"title": ""
},
{
"docid": "f87a594a1b83c43050a126dae05aaeae",
"score": "0.63538355",
"text": "def change_consonant(consonant)\n consonants = 'bcdfghjklmnpqrstvwxyzb'\n new_consonants = consonants.index(consonant)\n next_consonant = new_consonants + 1\n swapped_consonant = consonants[next_consonant]\nend",
"title": ""
},
{
"docid": "a1f3caea266a435a20aa96ec3726632c",
"score": "0.6350333",
"text": "def swap(string)\n # swapped_words = []\n string.split.each do |word|\n word[0], word[-1] = word[-1], word[0]\n # swapped_words << word\n end.join(' ')\n\n # swapped_words\nend",
"title": ""
},
{
"docid": "80a0304ae88c891fcfb9d302d45ddd18",
"score": "0.63469267",
"text": "def middle_permutation(string)\n string = string.split(\"\").sort.join\n string.length.even? ? string[(string.length/2) - 1] + string.delete!(string[(string.length/2) - 1]).reverse : string[string.length/2] + string[(string.length/2) - 1] + string.delete!(string[string.length/2]).delete!(string[(string.length/2) - 1]).reverse\nend",
"title": ""
},
{
"docid": "2abe7f712efdd01be0b2adcfa103da03",
"score": "0.6340814",
"text": "def swap (str)\n words = str.split\n new_words = []\n\n words.each do |word|\n if word.length > 3\n new_words << word[-1] + word[1..-1] + word[0]\n else \n \n end \n\n new_words.join(' ')\nend \n\n\np swap('Oh what a wonderful day it is') #== 'hO thaw a londerfuw yad ti si'\np swap('Abcde') #== 'ebcdA'\np swap('a') #== 'a'",
"title": ""
},
{
"docid": "5df35a3765b6ed29ac90994abdec8507",
"score": "0.632571",
"text": "def switch(string)\n forward = string.split('')\n reverse = []\n counter = -1\n until reverse.length == forward.length\n reverse << forward[counter]\n counter -= 1\n end\n reverse.join\nend",
"title": ""
},
{
"docid": "c65bb53a01d1f15698e93e9faa9b6ed1",
"score": "0.6322026",
"text": "def swap(string, count)\n result = if (count % 2).zero?\n string.upcase\n else\n string.downcase\n end\n result\nend",
"title": ""
},
{
"docid": "470bf15be9c98135dad12dfcbae3da49",
"score": "0.63135487",
"text": "def swap(str)\n array_of_words = str.split\n\n array_of_words.each do |word|\n first_char = word[0]\n last_char = word[-1]\n\n word[0] = last_char\n word[-1] = first_char\n end\n\n array_of_words.join(' ')\n\nend",
"title": ""
},
{
"docid": "cb2459f408e7d186afc7bfea87346bcf",
"score": "0.6308334",
"text": "def string_reverse(orig_string)\n puts \"#{orig_string}\"\n start = 0\n ending = orig_string.length - 1\n\n # while conditions ok\n while start < ending\n puts \"start: #{start}\"\n puts \"ending #{ending}\"\n\n #swap letters in place\n orig_string[start], orig_string[ending] = orig_string[ending], orig_string[start]\n\n #iterate\n start += 1\n ending -= 1\n end\n\n # return string\n puts \"#{orig_string}\"\n return orig_string\nend",
"title": ""
},
{
"docid": "081a5b1aa2c107db14f308b1d372697c",
"score": "0.63075364",
"text": "def swap(index)\n $coins = $coins.split(\"\")\n # finding dash indexes\n dash1 = $coins.index(\"-\")\n dash2 = $coins.rindex(\"-\")\n\n # swapping\n $coins[index], $coins[dash1] = $coins[dash1], $coins[index]\n $coins[index+1], $coins[dash2] = $coins[dash2], $coins[index+1]\n $coins = $coins.join\nend",
"title": ""
},
{
"docid": "59a00653152024537b8092998c376831",
"score": "0.63049066",
"text": "def middle_permutation(string)\n sorted_string = string.chars.sort.join\n midpoint = (string.length / 2) - (1)\n\n if sorted_string.length.even?\n sorted_string[midpoint] + (sorted_string.slice(0, midpoint) + sorted_string.slice(midpoint+1, sorted_string.length)).reverse\n else\n sorted_string.slice(midpoint, 2).reverse + (sorted_string.slice(0, midpoint) + sorted_string.slice(midpoint+2, sorted_string.length)).reverse\n end\nend",
"title": ""
},
{
"docid": "03b50ae9cb47f5ce6c1f42bcea63e484",
"score": "0.6298298",
"text": "def reverse!(string)\n length = string.length - 1\n (length / 2).times do |idx|\n string[idx], string[length - idx] = string[length - idx], string[idx]\n end\n string\nend",
"title": ""
},
{
"docid": "888a415acf9785e320e703757e462bcf",
"score": "0.62935007",
"text": "def swap_word(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "f858948e0fc6bbdd6890dc87424ceece",
"score": "0.6289394",
"text": "def swap_first_last_characters(a, b)\n a, b = b, a\nend",
"title": ""
},
{
"docid": "8a2c8242a99991a28fd4f3b416ea82f3",
"score": "0.62848026",
"text": "def string_reverse(my_string)\r\n if my_string == nil \r\n return nil\r\n elsif my_string != \"\"\r\n k = my_string.length / 2\r\n i = 0\r\n j = -1\r\n temp = \"\"\r\n k.times do\r\n temp = my_string[i]\r\n my_string[i] = my_string[j]\r\n my_string[j] = temp\r\n i += 1\r\n j -= 1\r\n end\r\n end\r\n return my_string \r\nend",
"title": ""
},
{
"docid": "56bdd79e1dfb8d84c349a28fbcf12018",
"score": "0.62588704",
"text": "def swapping_consonents(consonant_char)\n consonents = { 'b' => 'c', 'c' => 'd', 'd' => 'f', 'f' => 'g', 'g' => 'h', 'h' => 'j', 'j' => 'k', 'k' => 'l', 'l' => 'm', 'm' => 'n', 'n' => 'p', 'p' => 'q', 'q' => 's', 's' => 't', 't' => 'v', 'v' => 'w', 'w' => 'x', 'x' => 'y', 'y' => 'z', 'z' => 'b' }\n\n consonant_char.map! do |letter|\n if consonents.include?(letter)\n consonents[letter]\n elsif consonents.include?(letter.downcase)\n consonents[letter.downcase].upcase\n else\n letter\n end\n end\nend",
"title": ""
},
{
"docid": "ed1a08c8576fd39fb6792ce469c2c87f",
"score": "0.62523633",
"text": "def reverse_inplace(s)\n return s if s.length == 1 || s.empty? || s[0] == s[-1]\n while s.length > 0\n x = s[0]\n y = s[-1]\n s[-1] = x\n s[0] = y\n return reverse_inplace(s[1..-2])\n end\nend",
"title": ""
},
{
"docid": "e0110b1ff2d9f93255182a9641492c53",
"score": "0.62523067",
"text": "def swap_word(word)\n first_letter = word[0]\n word[0] = word[-1]\n word[-1] = first_letter\n word\nend",
"title": ""
},
{
"docid": "b2fbbe4a4c39326f2343604fe1885e9b",
"score": "0.62443364",
"text": "def reverse_inplace(s, first = 0, last = s.length-1)\n if first < last\n s[first], s[last] = s[last], s[first]\n return reverse_inplace(s, first + 1, last -1)\n end\n return s\nend",
"title": ""
},
{
"docid": "71e56a65a43333b574d949d8b41a6741",
"score": "0.6231939",
"text": "def reverse_inplace(s)\n if s.size < 2\n return s\n end\n return reverse_inplace(s[1..-1]) + s[0]\nend",
"title": ""
},
{
"docid": "54a3a66653abd8fcfa39823d38d1f2e2",
"score": "0.6224547",
"text": "def string_reverse(my_string)\r\n if my_string == nil\r\n return nil\r\n elsif my_string.length == 1\r\n return my_string\r\n else\r\n origin = my_string.length - 1\r\n target = 0\r\n temp = nil\r\n (my_string.length / 2).times do\r\n temp = my_string[target]\r\n my_string[target] = my_string[origin]\r\n my_string[origin] = temp\r\n origin -= 1\r\n target += 1\r\n end\r\n end\r\n return my_string\r\nend",
"title": ""
},
{
"docid": "e77782fbfba58cc4c7dd7af8ee2e15db",
"score": "0.62162733",
"text": "def swap_first_last_letters(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "25216a932735cf7d9c8c595ba5e69898",
"score": "0.621592",
"text": "def reverse_inplace(s, pointer = 0)\n \n return s if pointer == s.length / 2\n s[pointer], s[- 1 - pointer] = s[- 1 - pointer ], s[pointer]\n\n reverse_inplace(s, pointer + 1)\n \nend",
"title": ""
},
{
"docid": "6b17715fd3d67de699d61b7a83b50278",
"score": "0.6207557",
"text": "def swap_ii(str)\n str.swapcase!\n regex = /\\d[a-zA-Z]+\\d/\n idx = 0\n while idx < str.size - 1\n start_idx = str[idx..-1] =~ (regex)\n if start_idx\n end_idx = start_idx + str[start_idx..-1].match(regex).to_s.size - 1\n str[start_idx], str[end_idx] = str[end_idx], str[start_idx]\n idx = end_idx\n end\n idx += 1\n end\n str\nend",
"title": ""
},
{
"docid": "fe06fa5168b6c488dce1f78800c3774e",
"score": "0.6207486",
"text": "def reverse_string(s)\n left = 0\n right = s.length - 1\n while left < right\n s[left], s[right] = s[right], s[left]\n left += 1\n right -= 1\n end\n s\nend",
"title": ""
},
{
"docid": "16728e0c905d2361bbbeaa57ee564ffc",
"score": "0.61846703",
"text": "def reverse_string(s)\n left = 0\n right = s.length - 1\n\n while left < right\n s[left], s[right] = s[right], s[left]\n left += 1\n right -= 1\n end\n\n s\nend",
"title": ""
},
{
"docid": "b9ee1f127168e5a21f33faa24e4291d1",
"score": "0.61836505",
"text": "def string_reverse(my_string)\r\n return if my_string == nil || my_string.length < 1\r\n i = 0 #first ele\r\n j = my_string.length - 1 #last ele\r\n while i < j # until position of first ele meets last, so there is the center element in between\r\n temp = my_string[i] #stores frist ele in temp\r\n my_string[i] = my_string[j] #sets first ele to the last ele's position\r\n my_string[j] = temp #sets last element to first ele's position\r\n i += 1 #increment\r\n j -= 1\r\n end\r\n return my_string\r\nend",
"title": ""
},
{
"docid": "1e0f08da7fb3c669237b8bf4eb35623b",
"score": "0.61821526",
"text": "def reverse_string text\n for i in 0...text.length/2\n if i == (text.length-1)/2 && text.length%2 == 0 \n next\n else\n temp = text[i]\n text[i] = text[text.length-1-i]\n text[text.length-1-i] = temp\n end\n end\n text\nend",
"title": ""
},
{
"docid": "611ab49e531a8d4a4511fa8ae8b4544d",
"score": "0.61724854",
"text": "def swap_letters(word)\n\n\tword[0], word[-1] = word[-1], word[0]\n\tword\n\t\nend",
"title": ""
},
{
"docid": "c33c3a14e1adc204ceabba77f252d8d6",
"score": "0.6170725",
"text": "def switchPairs(input)\n # This should work for both even and odd length arrays. In an odd length array, the last index is even, so I've restricted the if statement to only those indicies who are less than one minus the index length. For instance, if input is an array of length 5, the last index is 4, and there's nothing after it to switch it with, so I don't want to transform it. But for an input whose length is 6, the last index is 5. So the last n that is even is 4, and there is something at index 5 to switch with.\n input.length.times do |n|\n if n % 2 == 0 && n < input.length - 1\n placeholder = input[n]\n input[n] = input[n + 1]\n input[n + 1] = placeholder\n end\n end\n return input\nend",
"title": ""
},
{
"docid": "de43a0dd8d8285d491f8836fd03b1abf",
"score": "0.6167028",
"text": "def swap_letters(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "8b42a7e1daf3ba30a55725b8a094a0a5",
"score": "0.6161554",
"text": "def string_reverse(my_string)\r\n if my_string != nil\r\n a = 0\r\n b = my_string.length - 1\r\n temp = nil\r\n while a < b\r\n temp = my_string[a]\r\n my_string[a] = my_string[b]\r\n my_string[b] = temp\r\n a += 1\r\n b -= 1\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "3988cb754044c052904c32f2d017877e",
"score": "0.6160934",
"text": "def string_reverse(my_string)\n if my_string == \"\"\n return my_string\n elsif my_string.nil?\n return nil\n else\n\n length = my_string.length\n count = length / 2\n count.times do |i|\n temp = my_string[i]\n my_string[i] = my_string[length - i - 1]\n my_string[length - i - 1] = temp\n end\n end\n return my_string\nend",
"title": ""
},
{
"docid": "e8e5ab4b5e20c7abd45006522aab6c83",
"score": "0.6157637",
"text": "def reverse!(str)\n left_index, right_index = 0, (str.length - 1)\n\n while left_index < right_index\n\n str[left_index], str[right_index] = str[right_index], str[left_index]\n\n left_index += 1\n right_index -= 1\n\n end\n\nend",
"title": ""
},
{
"docid": "7a684637d59f18701f1236c18ec49016",
"score": "0.6139838",
"text": "def reverse!(string, i, j) # \" I can do this! \" \n while i < j \n string[i], string[j] = string[j], string[i]\n\n # # same as above\n # temp = string[i]\n # string[i] = string[j] \n # string[j] = temp\n \n i += 1 \n j -= 1\n end \n\n return string # \" !siht od nac I \"\nend",
"title": ""
},
{
"docid": "701dbfffbc84b7ebe09fb1ad0c8dd20a",
"score": "0.6124023",
"text": "def swap(words_string)\n words_array = words_string.split\n words_array.each { |word| word[0], word[-1] = word[-1], word[0] }\n words_array.join(' ')\nend",
"title": ""
},
{
"docid": "787a9f6ca26292e8c08b2352a8c6dba5",
"score": "0.61227876",
"text": "def compress_str(str)\n comp_str = \"\"\n (0..str.length - 1).each do |i|\n if str[i + 1] != nil\n if str[i] == str[i+1]\n if comp_str[-1] == str[i]\n # add one on the existing\n val = comp_str[-2].to_i + 1\n comp_str[-2] = val.to_s\n else\n comp_str += \"2\"+str[i]\n end\n else\n if comp_str[-1] != str[i]\n comp_str += str[i]\n end\n end\n else\n if comp_str[-1] != str[i]\n comp_str += str[i]\n end\n end\n end\n return comp_str\nend",
"title": ""
},
{
"docid": "bc416b10d8a0a6a391692906cc921de9",
"score": "0.61085504",
"text": "def swap(words)\n swapped = []\n words.split.each do |word|\n word[0], word[-1] = word[-1], word[0]\n swapped << word\n end\n swapped.join(' ')\nend",
"title": ""
},
{
"docid": "e6a5dc068ce1913c507ae11e81bf51d8",
"score": "0.6101071",
"text": "def reverse_inplace(s, left = 0, right = s.length - 1)\n return '' if s.empty?\n return s if s.length == 1\n if left < right\n s[left], s[right] =\n s[right], s[left]\n reverse_inplace(s, left + 1, right - 1)\n end\n return s\nend",
"title": ""
},
{
"docid": "b7f558b7493c70c085d8489acb951444",
"score": "0.6093271",
"text": "def reverse_inplace(s)\n # Input validation\n return nil if s == nil\n return '' if s.length == 0 \n i = 0\n j = s.length-1\n reverse_helper(s, i, j)\n return s \nend",
"title": ""
},
{
"docid": "368a9698245ee0fdca726e499a2bc0ff",
"score": "0.6092043",
"text": "def string_reverse(my_string)\r\n return my_string if my_string.nil? || my_string == \"\"\r\n\r\n middle = my_string.length / 2\r\n i = 0\r\n j = my_string.length - 1\r\n\r\n while i < middle\r\n placeholder = my_string[i]\r\n my_string[i] = my_string[j]\r\n my_string[j] = placeholder\r\n i += 1\r\n j -= 1\r\n end\r\n return my_string\r\nend",
"title": ""
},
{
"docid": "219cc0eebf0ec7d3db2c87d15829bede",
"score": "0.60918486",
"text": "def reverse_inplace(s, first = 0, last = s.length - 1)\n return s if first >= last\n temp = s[first]\n s[first] = s[last]\n s[last] = temp\n \n return reverse_inplace(s, first + 1, last - 1)\nend",
"title": ""
},
{
"docid": "00c9d547558d6110381d8b092ba72be8",
"score": "0.6088998",
"text": "def string_reverse (my_string, s_index, e_index)\n i = s_index\n j = e_index\n\n while i < j\n temp = my_string[i]\n my_string[i] = my_string[j]\n my_string[j] = temp\n\n i += 1\n j -= 1\n end\n return\nend",
"title": ""
},
{
"docid": "3988bf31f43f6ffe83588cdcd1215b2f",
"score": "0.60855114",
"text": "def reverse_inplace(s, first = 0, last = s.length - 1)\n # raise NotImplementedError, \"Method not implemented\"\n if first < last\n s[first], s[last] = s[last], s[first]\n reverse_inplace(s, first + 1, last - 1)\n end\n s\nend",
"title": ""
},
{
"docid": "281c57f815a38e9e759cb8106bf8c9b6",
"score": "0.60794544",
"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": "25340dc3ec07431bf5493fdb5be32e3f",
"score": "0.6075904",
"text": "def swap(string)\n string_arr = string.split.map do |word|\n first_letter = word[0]\n word = word.gsub(word[0], word[-1])\n word[-1] = first_letter\n word\n end\n string_arr.join(' ')\nend",
"title": ""
},
{
"docid": "6457b5e1aebdf1b2bbefaad9244d784c",
"score": "0.6065277",
"text": "def swap_first_last(name)\n name = name.downcase\n swap_name = name.split(' ')\n swap_name[1] << ' '\n swap_name_reverse = swap_name.reverse\n swap_name_reverse_joined = swap_name_reverse.join\nend",
"title": ""
},
{
"docid": "fd1dbeb145cd03d13ffd9f76e9dbce65",
"score": "0.6056668",
"text": "def string_reverse(my_string, start_index, end_index)\n i = start_index\n j = end_index\n while i < j\n #flipflop characters using holding variable as a place to put one character while the other goes in its place.\n holding = my_string[i]\n my_string[i] = my_string[j]\n my_string[j] = holding\n\n #move up and move down the string.\n i += 1\n j -= 1\n end\n return my_string\nend",
"title": ""
},
{
"docid": "e1a73d53479d92e9d8d63bac840696cb",
"score": "0.6054924",
"text": "def reverse(string, start ,last)\n i = start\n j = last\n\n while i < j\n string[j], string[i] = string[i], string[j]\n i += 1\n j -= 1\n end\n return string\nend",
"title": ""
},
{
"docid": "ce3c0f4bd309c499faae7bd358addb27",
"score": "0.6049188",
"text": "def swap_first_last_characters(a, b)\n temp = a.clone\n a.replace(b)\n b.replace(temp)\nend",
"title": ""
},
{
"docid": "4a5e4f849ba7fed9b0630cbf28890f1f",
"score": "0.604695",
"text": "def reverse_inplace(s, i = 0, j = s.length - 1)\n return s if i >= j\n\n s[i], s[j] = s[j], s[i]\n\n return reverse_inplace(s, i + 1, j - 1)\nend",
"title": ""
},
{
"docid": "a8186c16bf51f2d019f66ff97f113c88",
"score": "0.6042193",
"text": "def string_reverse(my_string)\r\n return my_string if my_string == nil\r\n\r\n i = 0\r\n j = my_string.length - 1\r\n\r\n while i < j\r\n b = my_string[i]\r\n my_string[i] = my_string[j]\r\n my_string[j] = b\r\n\r\n i += 1\r\n j -= 1\r\n end\r\n\r\n return my_string\r\nend",
"title": ""
}
] |
648c62d2f6ff3bc83fb4722aa9d66682
|
GET /tipo_medicamentos GET /tipo_medicamentos.json
|
[
{
"docid": "b21e46814837c2af74b3e1ff640a1996",
"score": "0.7103278",
"text": "def index\n @tipo_medicamentos = TipoMedicamento.all\n end",
"title": ""
}
] |
[
{
"docid": "8be9e327f45f8e9f26a33bead07684ab",
"score": "0.7140836",
"text": "def index\n @tipo_medicos = TipoMedico.all\n end",
"title": ""
},
{
"docid": "bc4f2dd28a35d9a1b7f2f814d3a33e52",
"score": "0.7073067",
"text": "def show\n @medico = Medico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medico }\n end\n end",
"title": ""
},
{
"docid": "c90662d24d25e408025fdabf93c1c5ca",
"score": "0.7042219",
"text": "def get_medidores \n medidores = Medidor.select(\n \"medidors.id as id,\n medidors.numero as numero,\n medidors.marca as marca,\n medidors.modelo as modelo,\n tipo_medidors.nombre as nombre_tipo_medidor\"\n ).joins(:usuario_medidors, :tipo_medidor).where(usuario_medidors: {usuario_id: params[:usuario_id]})\n render json: medidores \n end",
"title": ""
},
{
"docid": "20ff34c546a169006b2dee2ee74b0baf",
"score": "0.7011633",
"text": "def show\n @medico = Medico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @medico }\n end\n end",
"title": ""
},
{
"docid": "20ff34c546a169006b2dee2ee74b0baf",
"score": "0.7010958",
"text": "def show\n @medico = Medico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @medico }\n end\n end",
"title": ""
},
{
"docid": "4a2a29d84695a03a11718ddc21baa35b",
"score": "0.68888986",
"text": "def index\n @title = \"Препараты\"\n @medicaments = Medicament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medicaments }\n end\n end",
"title": ""
},
{
"docid": "39b23917e420c128b14def5633b07e5d",
"score": "0.68041575",
"text": "def new\n @medico = Medico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @medico }\n end\n end",
"title": ""
},
{
"docid": "39b23917e420c128b14def5633b07e5d",
"score": "0.68041575",
"text": "def new\n @medico = Medico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @medico }\n end\n end",
"title": ""
},
{
"docid": "677ce9e9ac8fda918f5315fe774ad2c5",
"score": "0.67948425",
"text": "def show\n render json: @medicament\n end",
"title": ""
},
{
"docid": "cb90613a94bbcca76d7fe3ce39b4f73e",
"score": "0.6722457",
"text": "def index\n @medicamentos = Medicamento.all\n end",
"title": ""
},
{
"docid": "6a8d51a9169a92f5f81157502c4e3b1b",
"score": "0.6705354",
"text": "def show\n @title = \"Препарат\"\n @medicament = Medicament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicament }\n end\n end",
"title": ""
},
{
"docid": "4b2a68d0f45cf8b6ebfcdda0e1f463b8",
"score": "0.669606",
"text": "def show\n @materia_tipo_pensum = MateriaTipoPensum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @materia_tipo_pensum }\n end\n end",
"title": ""
},
{
"docid": "130d6e842507783f88676afdfa4bd58a",
"score": "0.6664972",
"text": "def set_tipo_medico\n @tipo_medico = TipoMedico.find(params[:id])\n end",
"title": ""
},
{
"docid": "383c34271dd1afbe17d322bebcd45ba6",
"score": "0.6633712",
"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": "e23c310132b772cce27d193038e974d0",
"score": "0.6621468",
"text": "def show\n @tipo_mesa = TipoMesa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_mesa }\n end\n end",
"title": ""
},
{
"docid": "a95a8fb75b9893b7ba7ce8a294f80c9a",
"score": "0.6610189",
"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": "240df9744d4e20f0b9441a882ff1b942",
"score": "0.6604188",
"text": "def show\n @malformacion = Malformacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @malformacion }\n end\n end",
"title": ""
},
{
"docid": "a69c13315ef9f6a52fe4a7d444326e47",
"score": "0.6604089",
"text": "def index\n @medicaments = Medicament.all\n\n render json: @medicaments\n end",
"title": ""
},
{
"docid": "80bae7efb383b027954cfa4e903b1bef",
"score": "0.66006935",
"text": "def new\n @medico = Medico.new\n @medico.pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medico }\n end\n end",
"title": ""
},
{
"docid": "995f2a95825fc875da30b4184465b8e8",
"score": "0.6595143",
"text": "def show\n @medicament = Medicament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicament }\n end\n end",
"title": ""
},
{
"docid": "1fe48e9f7934e105c2c626b7c991a394",
"score": "0.65914285",
"text": "def show\n @medicament = Medicament.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicament }\n end\n end",
"title": ""
},
{
"docid": "8661b2578dd85891ddb9e743bcd463f1",
"score": "0.65907335",
"text": "def index\n @medicaments = Medicament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medicaments }\n end\n end",
"title": ""
},
{
"docid": "7de05f88221a955e14a7ee97799c05e9",
"score": "0.6579048",
"text": "def set_tipo_medicamento\n @tipo_medicamento = TipoMedicamento.find(params[:id])\n end",
"title": ""
},
{
"docid": "eb2c4480d7b2819e52f769eb654c9a9d",
"score": "0.6577771",
"text": "def index\n @medicaos = Medicao.all\n end",
"title": ""
},
{
"docid": "4286aa3921f1261f9ba77933ee269888",
"score": "0.655242",
"text": "def show\n @tipo_medio = TipoMedio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_medio }\n end\n end",
"title": ""
},
{
"docid": "3ae85848340fa5da14e1bc5967a682c9",
"score": "0.653565",
"text": "def show\n @tipo = Tipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo }\n end\n end",
"title": ""
},
{
"docid": "71be772236007c7e57a0d5772e4049f2",
"score": "0.6522039",
"text": "def index\n @pregunta = Pregunta.all\n\n # buscamos parametro de tipo para filtrar la consulta\n if tipo = params[:tipo]\n @pregunta = @pregunta.where(tipo: tipo)\n end\n\n respond_to do |format|\n if @pregunta.count > 0\n #render json:@pregunta, :only =>[:id, :descripcion, :obligatoria], status: :ok \n format.json\n else\n format.json { render json:Pregunta.none, status: :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "98472984dc01f40c707f7c85f572bf57",
"score": "0.6500328",
"text": "def index\n #@user = User.new\n @medallas = Medalla.all\n #@cliente = obtener_cliente\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medallas }\n end\n end",
"title": ""
},
{
"docid": "11bcd3132a987e7e74e3baae868a639a",
"score": "0.6463676",
"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": "8616d49483e42c4e6d44efe347de6bab",
"score": "0.64625883",
"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": "04e4eb7144933d44873126093a51f869",
"score": "0.64580685",
"text": "def index\n @dm_medicos = DmMedico.all\n end",
"title": ""
},
{
"docid": "de30e14cd1e548eed5021749aec7d99e",
"score": "0.64579356",
"text": "def index\n @mediciones = Medicion.all\n end",
"title": ""
},
{
"docid": "6596618f61fa2d04d6cc4edf3ace704e",
"score": "0.6447686",
"text": "def index\n @tipo_medios = TipoMedio.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_medios }\n end\n end",
"title": ""
},
{
"docid": "cc7371db4d4b45db03fd79b06bafc90f",
"score": "0.6408207",
"text": "def show\n @miembro = Miembro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @miembro }\n end\n end",
"title": ""
},
{
"docid": "5c9482432e8e438da3cbc4795009eff8",
"score": "0.63912034",
"text": "def show\n @tipo_requerimiento = TipoRequerimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_requerimiento }\n end\n end",
"title": ""
},
{
"docid": "63930a751e5b0e5548c7f8605144fc1c",
"score": "0.6384958",
"text": "def show\n @tipo_apuestum = TipoApuestum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_apuestum }\n end\n end",
"title": ""
},
{
"docid": "3f36624d7af800e1f314e1e2b0a90bc6",
"score": "0.6378975",
"text": "def index\n params[:max] = 2\n params[:offset] = params[:offset] ? params[:offset].to_i : 0\n @medicos = Medico.all(:offset => params[:offset], :limit => params[:max])\n @totalMedicos = Medico.count\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @medicos }\n end\n end",
"title": ""
},
{
"docid": "3e519de56bede7aff56fb714826fc8c6",
"score": "0.6370674",
"text": "def show\n @tipo_demanda = TipoDemanda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tipo_demanda }\n end\n end",
"title": ""
},
{
"docid": "715bedf42b5b75bd1df03faa2bd7839c",
"score": "0.63691175",
"text": "def index\n @materias = Materia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @materias }\n end\n end",
"title": ""
},
{
"docid": "52884c3aa4b9e847e28f0a02aea9567d",
"score": "0.63672715",
"text": "def show\n @tipo_perfil = TipoPerfil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_perfil }\n end\n end",
"title": ""
},
{
"docid": "74c74eb0eeccaf86be14242389b400ca",
"score": "0.636153",
"text": "def index\n @metros = Metro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @metros }\n end\n end",
"title": ""
},
{
"docid": "7fdfc4ca9185e66b54fed0c628a151b9",
"score": "0.6347663",
"text": "def show\n @type_de_mouvement = TypeDeMouvement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type_de_mouvement }\n end\n end",
"title": ""
},
{
"docid": "f017754016d4fa3a172fc36ff58ebeee",
"score": "0.63429725",
"text": "def show\n @entrevista_medica = EntrevistaMedica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @entrevista_medica }\n end\n end",
"title": ""
},
{
"docid": "346ba0fdb97a86791da2490a4e2ee4b1",
"score": "0.6329495",
"text": "def new\n @medicament = Medicament.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medicament }\n end\n end",
"title": ""
},
{
"docid": "346ba0fdb97a86791da2490a4e2ee4b1",
"score": "0.6329495",
"text": "def new\n @medicament = Medicament.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medicament }\n end\n end",
"title": ""
},
{
"docid": "e27b165ac882c6477d8c42f3c6f80c71",
"score": "0.6317973",
"text": "def show\n @medalla = Medalla.find(params[:id])\n\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medalla }\n end\n end",
"title": ""
},
{
"docid": "a5d4128f9a065abbe74de73e8253f1aa",
"score": "0.63049155",
"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": "be602c3566981c3089083a14f1060b52",
"score": "0.6300727",
"text": "def show\n @medio = Medio.find(params[:id])\n\n \n end",
"title": ""
},
{
"docid": "2140d254625c5e4cb4ed9801b93e31e5",
"score": "0.6297256",
"text": "def show\n @municipio = Municipio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @municipio }\n end\n end",
"title": ""
},
{
"docid": "0f0421d1b31c4ea4df7cd4d9cc76c473",
"score": "0.62862074",
"text": "def index\n @unidade_medidas = UnidadeMedida.all\n end",
"title": ""
},
{
"docid": "e23f211a0fbcb6b608902457a206a83d",
"score": "0.6280591",
"text": "def new\n @materia_tipo_pensum = MateriaTipoPensum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @materia_tipo_pensum }\n end\n end",
"title": ""
},
{
"docid": "275fef2d25f9a58e1023cc330fa23cfa",
"score": "0.6271181",
"text": "def index\n @medico_pacientes = MedicoPaciente.all\n end",
"title": ""
},
{
"docid": "36414e1969788d32420ecdd8ab4a18b4",
"score": "0.6263755",
"text": "def show\n @pagoacredito = Pagoacredito.find(params[:id])\n\n respond_to do |format|\n format.html { render :layout => 'special_form'}# new.html.erb\n format.json { render json: @pagoacredito , :include => :moneda }\n end\n end",
"title": ""
},
{
"docid": "42dd9e80258ae1fcca21b62ce97b36ea",
"score": "0.6261083",
"text": "def show\n @tipolog = Tipolog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipolog }\n end\n end",
"title": ""
},
{
"docid": "afcf725d7dd2e4956fb43e2708828a29",
"score": "0.6257581",
"text": "def new\n @title = \"Добавление препарата\"\n @medicament = Medicament.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medicament }\n end\n end",
"title": ""
},
{
"docid": "ee228744c5abb1d539214071cc5e6549",
"score": "0.6250831",
"text": "def index\n @medio_pagos = MedioPago.all\n end",
"title": ""
},
{
"docid": "9e8b999b99f7272f59a35d35c4dceafe",
"score": "0.6248728",
"text": "def show\n @moeda = Moeda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @moeda }\n end\n end",
"title": ""
},
{
"docid": "ef94e7ce6408380039831796011553f1",
"score": "0.6241143",
"text": "def show\n @pagocontado = Pagocontado.find(params[:id])\n\n respond_to do |format|\n format.html { render :layout => 'special_form'}# new.html.erb\n format.json { render json: @pagocontado, :include => :moneda }\n end\n end",
"title": ""
},
{
"docid": "6207d8ec70513db18c095a7196825910",
"score": "0.6232064",
"text": "def index\n @unidades_medida = UnidadeMedida.all\n end",
"title": ""
},
{
"docid": "4138bd02428db998a6e09b3a8ac3f458",
"score": "0.62283725",
"text": "def show\n @termo_uso = TermoUso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @termo_uso }\n end\n end",
"title": ""
},
{
"docid": "70229e33933dd863a2363ac6f178d9db",
"score": "0.6225534",
"text": "def set_tipo_med\n @tipo_med = TipoMed.find(params[:id])\n end",
"title": ""
},
{
"docid": "71f1ce26080a254006e1939d37040c5d",
"score": "0.6211769",
"text": "def set_mediciontipo\n @mediciontipo = Mediciontipo.find(params[:id])\n end",
"title": ""
},
{
"docid": "f48ef8d72edf59e38afc25c9c3354397",
"score": "0.6208471",
"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": "a7f0bb7956b509638f174c5ca2594f9e",
"score": "0.6199109",
"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": "240e8033e89e1c8512d06cbe9b7f10a0",
"score": "0.61931264",
"text": "def show\n @core_tipo_detalhe = Core::TipoDetalhe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_tipo_detalhe }\n end\n end",
"title": ""
},
{
"docid": "09cd52c35fb4baf68d2037338897bcd8",
"score": "0.61912745",
"text": "def new\n @entrevista_medica = EntrevistaMedica.new\n @atendimento = Atendimento.find(params[:atendimento_id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @entrevista_medica }\n end\n end",
"title": ""
},
{
"docid": "430b989d3ba8ecb2469fae789a0a40ea",
"score": "0.61881196",
"text": "def show\n @medicina = Medicina.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicina }\n end\n end",
"title": ""
},
{
"docid": "e0650a6983b25df108f40e12e8974d83",
"score": "0.6187707",
"text": "def index\n @medidores = Medidor.all\n @persona = Persona.new\n @servicio = Servicio.new\n @medidor = Medidor.new\n\n end",
"title": ""
},
{
"docid": "a3fea2ae022486f1d6e21798e2d7db0e",
"score": "0.6168853",
"text": "def show\n begin\n @doacao = Doacao.find(params[:id])\n if @doacao.user.id == current_user.id || @user.admin? \n @medicamentos = @doacao.medicamentos\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :show, status: :created, location: @endereco }\n end\n else\n respond_to do |format|\n format.html { redirect_to home_index_path}\n format.json { render :show, status: :created, location: home_index_path }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "fa3c31cb8f4c83f83e8c70b8149cc89b",
"score": "0.6168775",
"text": "def index\n @unidademedidas = Unidademedida.all\n end",
"title": ""
},
{
"docid": "2a185ca3a247390ff711637070683fbe",
"score": "0.61649317",
"text": "def show\n @medicine_type = MedicineType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicine_type }\n end\n end",
"title": ""
},
{
"docid": "997f98c9a516eb102f01c3b0e8df2941",
"score": "0.61629623",
"text": "def new\n @tipologium = Tipologium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipologium }\n end\n end",
"title": ""
},
{
"docid": "fb3bd19180d28a399d926d68b494d319",
"score": "0.6155661",
"text": "def show\n @movimento = Movimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movimento }\n end\n end",
"title": ""
},
{
"docid": "eb9d223fdc3a5aa6ed3c43536296cf04",
"score": "0.6153724",
"text": "def index\n @tipo_mezcales = TipoMezcal.all\n end",
"title": ""
},
{
"docid": "dbab4d09d15e36316ca246eb1253f396",
"score": "0.61429113",
"text": "def new\n @medalla = Medalla.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medalla }\n end\n end",
"title": ""
},
{
"docid": "dbab4d09d15e36316ca246eb1253f396",
"score": "0.61429113",
"text": "def new\n @medalla = Medalla.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medalla }\n end\n end",
"title": ""
},
{
"docid": "8ae9596e2b433d7c9fb1ccaf32d6676c",
"score": "0.6140202",
"text": "def new\n @vocero = Vocero.new\n @organizacion = Organizacion.all#Organizacion.where(:tipo_id => 1)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vocero }\n end\n end",
"title": ""
},
{
"docid": "9d90d87eb5458c60f26f3a06079bae42",
"score": "0.6135019",
"text": "def show\n @user = User.new\n @cliente = obtener_cliente\n @medalla = Medalla.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medalla }\n end\n end",
"title": ""
},
{
"docid": "251689c639f4c96b81408b4613162118",
"score": "0.6134545",
"text": "def index\n @murais = Mural.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @murais }\n end\n end",
"title": ""
},
{
"docid": "a4ed506684b0246b8b016ab132a8ec31",
"score": "0.61262864",
"text": "def show\n @medic = Medic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medic }\n end\n end",
"title": ""
},
{
"docid": "293560d25dd736d2f814449098a5f7e1",
"score": "0.612279",
"text": "def new\n @servico = Servico.new\n @categorias = Category.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "9f311a9ca7b800fe6dcd7a304ae3e41f",
"score": "0.6121587",
"text": "def new\n @tipo_medio = TipoMedio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_medio }\n end\n end",
"title": ""
},
{
"docid": "496023d798741e79cd72fe4c001398fe",
"score": "0.61208874",
"text": "def index\n @formadepagos = Formadepago.all(:include => :moneda)\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @formadepagos }\n end\n end",
"title": ""
},
{
"docid": "5a4d14bd4bff4e4a1ff23a4765f7e36c",
"score": "0.61146104",
"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": "d40cc25e17d242228d520d7e000d8a72",
"score": "0.6108641",
"text": "def show\n @materia = Materia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @materia }\n end\n end",
"title": ""
},
{
"docid": "021428551ff138cc69d2cbe0c5a655ad",
"score": "0.61084276",
"text": "def show\n @filme = Filme.joins(:formato).select(\"formatos.descricao\").select(:titulo, :duracao, :ano, :foto_data, :id).find(params[:id]) \n response = @filme.as_json\n response[:foto_url] = @filme.foto_url\n render json: response\n end",
"title": ""
},
{
"docid": "b50b12e08d83cf70fe8cceccaadff712",
"score": "0.6103658",
"text": "def show\n @permiso = Permiso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @permiso }\n end\n end",
"title": ""
},
{
"docid": "68a1ea8517b0cb82948da7762262290c",
"score": "0.61002344",
"text": "def show\n render json: @domicile_type\n end",
"title": ""
},
{
"docid": "d7055b0d4c73a89f4e1b51ed8e3667a0",
"score": "0.6099988",
"text": "def show\n @tipo_entidad = TipoEntidad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_entidad }\n end\n end",
"title": ""
},
{
"docid": "ec53440cb6ba22588be0b6f0d47d40ed",
"score": "0.6099453",
"text": "def getMarcas\n\t\tmarcas=Marca.select(\"nombre,id\")\n\t\tmsg = { :status => \"success\", :marcas => marcas }\n\t\trender :json => msg\n\t\treturn \n\tend",
"title": ""
},
{
"docid": "0c33947f5c45b6b94cbde2e0a7f4d623",
"score": "0.60968447",
"text": "def show\n render json:@pregunta, :only =>[:id, :descripcion, :obligatoria], status: :ok\n end",
"title": ""
},
{
"docid": "267ddf76c7d281e0ad2dc596f2be0376",
"score": "0.6095916",
"text": "def show\n @mouvement = Mouvement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mouvement }\n end\n end",
"title": ""
},
{
"docid": "46e481ea35803c1e284af12a57bef404",
"score": "0.60895556",
"text": "def new\n @tipo_demanda = TipoDemanda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tipo_demanda }\n end\n end",
"title": ""
},
{
"docid": "a2f432d4cedd61aaa877ff23182bf9f6",
"score": "0.60873526",
"text": "def show\n @seguridad_modulo = Seguridad::Modulo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seguridad_modulo }\n end\n end",
"title": ""
},
{
"docid": "c44161446fdcc7a52fb40a12330572eb",
"score": "0.6086517",
"text": "def show\n @motivo_consulta = MotivoConsulta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @motivo_consulta }\n end\n end",
"title": ""
},
{
"docid": "c45be1c972abbe12364763dbc5c4b2f5",
"score": "0.60809076",
"text": "def new\n @tipo_imovel = TipoImovel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_imovel }\n end\n end",
"title": ""
},
{
"docid": "53073a3b1113f9ed1748cd3fc0177284",
"score": "0.6080528",
"text": "def create\n @tipo_medico = TipoMedico.new(tipo_medico_params)\n\n respond_to do |format|\n if @tipo_medico.save\n format.html { redirect_to @tipo_medico, notice: 'Tipo medico was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_medico }\n else\n format.html { render :new }\n format.json { render json: @tipo_medico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3268eb7050184771be9a89f67e36702",
"score": "0.6080271",
"text": "def show\n @formadepago = Formadepago.find(params[:id],:include => :moneda)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @formadepago }\n end\n end",
"title": ""
},
{
"docid": "d20cd5870519d0cafd2383d2b74583e5",
"score": "0.60799944",
"text": "def new\n @tipo_mesa = TipoMesa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_mesa }\n end\n end",
"title": ""
},
{
"docid": "45e2f3402418b5a77093c8ef9dbe94e6",
"score": "0.6078997",
"text": "def lista\n @entidades = Entidade.select(\"entidade, slug, latitude, longitude, telecentro, id\").where(\"#{params[:tipo]} = true\")\n\n respond_to do |format|\n format.json { render json: @entidades }\n end\n end",
"title": ""
}
] |
cac2cf238c2683364f18221269465918
|
TODO: make this more performant and/or not as weird
|
[
{
"docid": "2a132355e87a96182f63e7bcad450428",
"score": "0.0",
"text": "def reify_page_slots!\n self.page_slots = self.page_slot_cache.collect do |data|\n if data[:blockable_id]\n block = data[:blockable_type].constantize.find(data[:blockable_id])\n block.update_attributes JSON.parse(data[:block_as_json])\n PageSlot.create page_id: self.id, blockable_id: data[:blockable_id], blockable_type: data[:blockable_type], position: data[:page_slot_position].to_i\n end\n end.reject(&:blank?)\n end",
"title": ""
}
] |
[
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.57864875",
"text": "def private; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.57016623",
"text": "def anchored; end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.5650111",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "d996063a1bda83fd8644c8cbac831e61",
"score": "0.5592881",
"text": "def rassoc(p0) end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.5585866",
"text": "def probers; end",
"title": ""
},
{
"docid": "5971f871580b6a6e5171c35946a30c95",
"score": "0.53930414",
"text": "def stderrs; end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.5325899",
"text": "def schubert; end",
"title": ""
},
{
"docid": "991b6f12a63ef51664b84eb729f67eed",
"score": "0.52781457",
"text": "def formation; end",
"title": ""
},
{
"docid": "4f0a4656cc8371322fe53a0792e78206",
"score": "0.52026635",
"text": "def offences_by=(_arg0); end",
"title": ""
},
{
"docid": "2c8e599b8829e8b044b3679f00d49206",
"score": "0.51724297",
"text": "def transform; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5159069",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5159069",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5159069",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5159069",
"text": "def specie; end",
"title": ""
},
{
"docid": "0225a9f23a0fa436bcdab339adc872dd",
"score": "0.5122933",
"text": "def same; end",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c766",
"score": "0.5105889",
"text": "def terpene; end",
"title": ""
},
{
"docid": "3b4df29992323899033bb22a35a64989",
"score": "0.50937605",
"text": "def malts; end",
"title": ""
},
{
"docid": "456acb6fbbfa8d19490feed3f145af4e",
"score": "0.5069567",
"text": "def deco_pos; end",
"title": ""
},
{
"docid": "1f60ec3e87d82a4252630cec8fdc8950",
"score": "0.50657606",
"text": "def berlioz; end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.5043853",
"text": "def transformations; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.50256246",
"text": "def first; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.50256246",
"text": "def first; end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.5004232",
"text": "def suivre; end",
"title": ""
},
{
"docid": "67e1e5bcf13dadff381ca08b8b2f3258",
"score": "0.49914774",
"text": "def ismn; end",
"title": ""
},
{
"docid": "51cbc664905c5759f5e6775045d2aad7",
"score": "0.4989263",
"text": "def next() end",
"title": ""
},
{
"docid": "51cbc664905c5759f5e6775045d2aad7",
"score": "0.4989263",
"text": "def next() end",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.49813735",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.49813735",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.49803922",
"text": "def pos() end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.49803922",
"text": "def pos() end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.49803922",
"text": "def pos() end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.49803922",
"text": "def pos() end",
"title": ""
},
{
"docid": "5cf20d5aba71d434e3118cf082e5b244",
"score": "0.49614176",
"text": "def schumann; end",
"title": ""
},
{
"docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba",
"score": "0.4934619",
"text": "def trd; end",
"title": ""
},
{
"docid": "e8e36363139f3a3ee344cf722d6fc60b",
"score": "0.49215248",
"text": "def lcts(array)\nend",
"title": ""
},
{
"docid": "28012efb188002843ef6e540786c5732",
"score": "0.49160784",
"text": "def rest_positionals; end",
"title": ""
},
{
"docid": "6a6a101703f71d6c32ae84958412335b",
"score": "0.49155235",
"text": "def extract_singles(obs)\n obs\nend",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.49104327",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.49104327",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.49104327",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.49104327",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.49104327",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.49104327",
"text": "def pos; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.49047676",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.49047676",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.49047676",
"text": "def parts; end",
"title": ""
},
{
"docid": "f53478c78bfb65847a5452ef55a4e8ef",
"score": "0.48865837",
"text": "def transforms; end",
"title": ""
},
{
"docid": "854ea5492fc848ebf904cdf30a301a92",
"score": "0.4882592",
"text": "def first_offset; end",
"title": ""
},
{
"docid": "854ea5492fc848ebf904cdf30a301a92",
"score": "0.4882592",
"text": "def first_offset; end",
"title": ""
},
{
"docid": "c4a5d4929633bb54caee5f831b8ca2e2",
"score": "0.48754808",
"text": "def caar; first.first end",
"title": ""
},
{
"docid": "9b579032ccde337cb5d5fca3b735da77",
"score": "0.4871418",
"text": "def match(p0) end",
"title": ""
},
{
"docid": "9b579032ccde337cb5d5fca3b735da77",
"score": "0.4871418",
"text": "def match(p0) end",
"title": ""
},
{
"docid": "ecf4c75c47701d64fddd6c286d489be3",
"score": "0.48682344",
"text": "def diff1; end",
"title": ""
},
{
"docid": "cf2231631bc862eb0c98d89194d62a88",
"score": "0.48549107",
"text": "def identify; end",
"title": ""
},
{
"docid": "9c91d2c9618cee228f4dee079db0818d",
"score": "0.48505288",
"text": "def diff2; end",
"title": ""
},
{
"docid": "5754818696aa95ccf32f553fe5fad6d4",
"score": "0.48446465",
"text": "def normalized; end",
"title": ""
},
{
"docid": "78d49e9762872207647d14e1b20e09df",
"score": "0.4822259",
"text": "def tr(p0, p1) end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.48080817",
"text": "def original_result; end",
"title": ""
},
{
"docid": "b729a5dc668467ccab00e9113e162ab7",
"score": "0.48047322",
"text": "def _reduce_569(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend",
"title": ""
},
{
"docid": "07388179527877105fd7246db2b49188",
"score": "0.48027748",
"text": "def villian; end",
"title": ""
},
{
"docid": "13289d4d24c54cff8b70fcaefc85384e",
"score": "0.48017251",
"text": "def verdi; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.48002654",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.48002654",
"text": "def operations; end",
"title": ""
},
{
"docid": "b14829d2f65d2660b51171944c233567",
"score": "0.4799967",
"text": "def required_positionals; end",
"title": ""
},
{
"docid": "556bb57c1cb686d26403353f75a5fe15",
"score": "0.47972718",
"text": "def split; end",
"title": ""
},
{
"docid": "908a5867eb1b956ed424325ba0edd734",
"score": "0.47889605",
"text": "def succ() end",
"title": ""
},
{
"docid": "908a5867eb1b956ed424325ba0edd734",
"score": "0.47889605",
"text": "def succ() end",
"title": ""
},
{
"docid": "908a5867eb1b956ed424325ba0edd734",
"score": "0.47889605",
"text": "def succ() end",
"title": ""
},
{
"docid": "b56e46812fab384ad564df12a4ddc532",
"score": "0.4787817",
"text": "def _reduce_537(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"title": ""
},
{
"docid": "d8216257f367748eea163fc1aa556306",
"score": "0.4783435",
"text": "def bs; end",
"title": ""
},
{
"docid": "8a6e77ebc7cf15c8e24e289434dbaac1",
"score": "0.47731575",
"text": "def _reduce_424(val, _values, result)\n result = new_str val[0]\n \n result\nend",
"title": ""
},
{
"docid": "06b6203baf3c9311f502228839c5ab4e",
"score": "0.47679496",
"text": "def intensifier; end",
"title": ""
},
{
"docid": "d80eecf1df40a6f0c3d6fbf6beb55543",
"score": "0.47651863",
"text": "def _reduce_573(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend",
"title": ""
},
{
"docid": "5f2294a5e06e35655654a23ba361a125",
"score": "0.4762716",
"text": "def nonstriker_perimartium(pronunciation_crotched)\n end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.4761964",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.4761964",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.4761964",
"text": "def cops; end",
"title": ""
},
{
"docid": "0c80a461dae55d25d61ad3f0ec8de637",
"score": "0.47617394",
"text": "def genome(liszt)\n=begin\n[samopen] SAM header is present: 2 sequences\n7621912 reads; of these:\n 4009241 (52.60%) were paired; of these:\n 1983557 (49.47%) aligned concordantly 0 times\n 1818685 (45.36%) aligned concordantly exactly 1 time\n 206999 (5.16%) aligned concordantly >1 times\n ----\n 1983557 pairs aligned concordantly 0 times; of these:\n 409503 (20.64%) aligned discordantly 1 time\n ----\n 1574054 pairs aligned 0 times concordantly or discordantly; of these:\n 3148108 mates make up the pairs; of these:\n 1009275 (32.06%) aligned 0 times\n 35392 (1.12%) aligned exactly 1 time\n 2103441 (66.82%) aligned >1 times\n 3612671 (47.40%) were unpaired; of these:\n 498719 (13.80%) aligned 0 times\n 2246121 (62.17%) aligned exactly 1 time\n 867831 (24.02%) aligned >1 times\n=end\n #puts(liszt);exit\n dict={}; liszt.shift\n dict[\"total\"]=liszt.shift.split[0]; #liszt.shift\n dict[\"paired\"]=liszt.shift.split[0]; liszt.shift #conc 0\n dict[\"conc_once\"]=liszt.shift.split[0]\n dict[\"conc_mult\"]=liszt.shift.split[0]\n liszt.shift(2); dict[\"disc_once\"]=\"\"; dict[\"disc_mult\"]=\"\"\n line=liszt.shift\n line.include?(\">1 times\") ? dict[\"disc_mult\"]=line.split[0] : dict[\"disc_once\"]=line.split[0]\n liszt.shift\n dict[\"unaligned_pairs\"]=liszt.shift.split[0]\n liszt.shift\n dict[\"unmates\"]=liszt.shift.split[0] #unaligned mates\n dict[\"mate_once\"]=liszt.shift.split[0]\n dict[\"mate_mult\"]=liszt.shift.split[0]\n dict[\"unpaired\"]=liszt.shift.split[0]\n dict[\"unpair_unaligned\"]=liszt.shift.split[0]\n dict[\"unpair_once\"]=liszt.shift.split[0]\n dict[\"unpair_mult\"]=liszt.shift.split[0]\n dict\nend",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.47576612",
"text": "def getc() end",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.47576612",
"text": "def getc() end",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.47576612",
"text": "def getc() end",
"title": ""
},
{
"docid": "9ffaa90635b01e55e5b97ed854afb9ef",
"score": "0.4756204",
"text": "def collection_order(items) #nicer collection method - the unnecessary loops and arrays. (task 6)\n\n item_indexes = []\n collection_order = []\n\n for item in items\n item_indexes << find_index_at_value(item)\n end\n\n sorted_indexes = item_indexes.sort\n\n for index in sorted_indexes\n collection_order = collection_order << WAREHOUSE[index].keys[0].to_s\n end\n\nreturn collection_order\n\nend",
"title": ""
},
{
"docid": "6de47d8809779ea7d056f5d88601870c",
"score": "0.47472423",
"text": "def normalize; end",
"title": ""
},
{
"docid": "66627177646d1ceb9f70d9440a719501",
"score": "0.47438705",
"text": "def order; end",
"title": ""
},
{
"docid": "66627177646d1ceb9f70d9440a719501",
"score": "0.47438705",
"text": "def order; end",
"title": ""
},
{
"docid": "e190295ddf15b4ec2877663edbb2f9c9",
"score": "0.47348666",
"text": "def _reduce_473(val, _values, result)\n result = s(:lasgn, val[0])\n \n result\nend",
"title": ""
},
{
"docid": "ee0b38c8fc75b7e28222069acf59dc95",
"score": "0.4733081",
"text": "def _reduce_118(val, _values, result)\n result = @builder.symbol_internal(val[0])\n \n result\nend",
"title": ""
},
{
"docid": "ee0b38c8fc75b7e28222069acf59dc95",
"score": "0.4733081",
"text": "def _reduce_118(val, _values, result)\n result = @builder.symbol_internal(val[0])\n \n result\nend",
"title": ""
},
{
"docid": "d1f83d159b425bfc5239dc520da21ea7",
"score": "0.47303253",
"text": "def next!() end",
"title": ""
},
{
"docid": "306f8984142cb13ccc76fc347899924d",
"score": "0.47293392",
"text": "def _reduce_594(val, _values, result)\n result = val[1]\n \n result\nend",
"title": ""
},
{
"docid": "3d2d28b05ef32c9b2db41d85a855afd2",
"score": "0.4726702",
"text": "def _reduce_391(val, _values, result)\n result = new_str val[0]\n \n result\nend",
"title": ""
},
{
"docid": "4328d9ea11d5d6f1b61d919d03bd3917",
"score": "0.47239077",
"text": "def NL43_locator(seq=\"\",temp_dir=File.dirname($0))\n hxb2_ref = \"TGGAAGGGCTAATTTGGTCCCAAAAAAGACAAGAGATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGATCAGATATCCACTGACCTTTGGATGGTGCTTCAAGTTAGTACCAGTTGAACCAGAGCAAGTAGAAGAGGCCAAATAAGGAGAGAAGAACAGCTTGTTACACCCTATGAGCCAGCATGGGATGGAGGACCCGGAGGGAGAAGTATTAGTGTGGAAGTTTGACAGCCTCCTAGCATTTCGTCACATGGCCCGAGAGCTGCATCCGGAGTACTACAAAGACTGCTGACATCGAGCTTTCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGTGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTACATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTCAAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCAGTGGCGCCCGAACAGGGACTTGAAAGCGAAAGTAAAGCCAGAGGAGATCTCTCGACGCAGGACTCGGCTTGCTGAAGCGCGCACGGCAAGAGGCGAGGGGCGGCGACTGGTGAGTACGCCAAAAATTTTGACTAGCGGAGGCTAGAAGGAGAGAGATGGGTGCGAGAGCGTCGGTATTAAGCGGGGGAGAATTAGATAAATGGGAAAAAATTCGGTTAAGGCCAGGGGGAAAGAAACAATATAAACTAAAACATATAGTATGGGCAAGCAGGGAGCTAGAACGATTCGCAGTTAATCCTGGCCTTTTAGAGACATCAGAAGGCTGTAGACAAATACTGGGACAGCTACAACCATCCCTTCAGACAGGATCAGAAGAACTTAGATCATTATATAATACAATAGCAGTCCTCTATTGTGTGCATCAAAGGATAGATGTAAAAGACACCAAGGAAGCCTTAGATAAGATAGAGGAAGAGCAAAACAAAAGTAAGAAAAAGGCACAGCAAGCAGCAGCTGACACAGGAAACAACAGCCAGGTCAGCCAAAATTACCCTATAGTGCAGAACCTCCAGGGGCAAATGGTACATCAGGCCATATCACCTAGAACTTTAAATGCATGGGTAAAAGTAGTAGAAGAGAAGGCTTTCAGCCCAGAAGTAATACCCATGTTTTCAGCATTATCAGAAGGAGCCACCCCACAAGATTTAAATACCATGCTAAACACAGTGGGGGGACATCAAGCAGCCATGCAAATGTTAAAAGAGACCATCAATGAGGAAGCTGCAGAATGGGATAGATTGCATCCAGTGCATGCAGGGCCTATTGCACCAGGCCAGATGAGAGAACCAAGGGGAAGTGACATAGCAGGAACTACTAGTACCCTTCAGGAACAAATAGGATGGATGACACATAATCCACCTATCCCAGTAGGAGAAATCTATAAAAGATGGATAATCCTGGGATTAAATAAAATAGTAAGAATGTATAGCCCTACCAGCATTCTGGACATAAGACAAGGACCAAAGGAACCCTTTAGAGACTATGTAGACCGATTCTATAAAACTCTAAGAGCCGAGCAAGCTTCACAAGAGGTAAAAAATTGGATGACAGAAACCTTGTTGGTCCAAAATGCGAACCCAGATTGTAAGACTATTTTAAAAGCATTGGGACCAGGAGCGACACTAGAAGAAATGATGACAGCATGTCAGGGAGTGGGGGGACCCGGCCATAAAGCAAGAGTTTTGGCTGAAGCAATGAGCCAAGTAACAAATCCAGCTACCATAATGATACAGAAAGGCAATTTTAGGAACCAAAGAAAGACTGTTAAGTGTTTCAATTGTGGCAAAGAAGGGCACATAGCCAAAAATTGCAGGGCCCCTAGGAAAAAGGGCTGTTGGAAATGTGGAAAGGAAGGACACCAAATGAAAGATTGTACTGAGAGACAGGCTAATTTTTTAGGGAAGATCTGGCCTTCCCACAAGGGAAGGCCAGGGAATTTTCTTCAGAGCAGACCAGAGCCAACAGCCCCACCAGAAGAGAGCTTCAGGTTTGGGGAAGAGACAACAACTCCCTCTCAGAAGCAGGAGCCGATAGACAAGGAACTGTATCCTTTAGCTTCCCTCAGATCACTCTTTGGCAGCGACCCCTCGTCACAATAAAGATAGGGGGGCAATTAAAGGAAGCTCTATTAGATACAGGAGCAGATGATACAGTATTAGAAGAAATGAATTTGCCAGGAAGATGGAAACCAAAAATGATAGGGGGAATTGGAGGTTTTATCAAAGTAAGACAGTATGATCAGATACTCATAGAAATCTGCGGACATAAAGCTATAGGTACAGTATTAGTAGGACCTACACCTGTCAACATAATTGGAAGAAATCTGTTGACTCAGATTGGCTGCACTTTAAATTTTCCCATTAGTCCTATTGAGACTGTACCAGTAAAATTAAAGCCAGGAATGGATGGCCCAAAAGTTAAACAATGGCCATTGACAGAAGAAAAAATAAAAGCATTAGTAGAAATTTGTACAGAAATGGAAAAGGAAGGAAAAATTTCAAAAATTGGGCCTGAAAATCCATACAATACTCCAGTATTTGCCATAAAGAAAAAAGACAGTACTAAATGGAGAAAATTAGTAGATTTCAGAGAACTTAATAAGAGAACTCAAGATTTCTGGGAAGTTCAATTAGGAATACCACATCCTGCAGGGTTAAAACAGAAAAAATCAGTAACAGTACTGGATGTGGGCGATGCATATTTTTCAGTTCCCTTAGATAAAGACTTCAGGAAGTATACTGCATTTACCATACCTAGTATAAACAATGAGACACCAGGGATTAGATATCAGTACAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAGTGTAGCATGACAAAAATCTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTCATCTATCAATACATGGATGATTTGTATGTAGGATCTGACTTAGAAATAGGGCAGCATAGAACAAAAATAGAGGAACTGAGACAACATCTGTTGAGGTGGGGATTTACCACACCAGACAAAAAACATCAGAAAGAACCTCCATTCCTTTGGATGGGTTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGTGCTGCCAGAAAAGGACAGCTGGACTGTCAATGACATACAGAAATTAGTGGGAAAATTGAATTGGGCAAGTCAGATTTATGCAGGGATTAAAGTAAGGCAATTATGTAAACTTCTTAGGGGAACCAAAGCACTAACAGAAGTAGTACCACTAACAGAAGAAGCAGAGCTAGAACTGGCAGAAAACAGGGAGATTCTAAAAGAACCGGTACATGGAGTGTATTATGACCCATCAAAAGACTTAATAGCAGAAATACAGAAGCAGGGGCAAGGCCAATGGACATATCAAATTTATCAAGAGCCATTTAAAAATCTGAAAACAGGAAAATATGCAAGAATGAAGGGTGCCCACACTAATGATGTGAAACAATTAACAGAGGCAGTACAAAAAATAGCCACAGAAAGCATAGTAATATGGGGAAAGACTCCTAAATTTAAATTACCCATACAAAAGGAAACATGGGAAGCATGGTGGACAGAGTATTGGCAAGCCACCTGGATTCCTGAGTGGGAGTTTGTCAATACCCCTCCCTTAGTGAAGTTATGGTACCAGTTAGAGAAAGAACCCATAATAGGAGCAGAAACTTTCTATGTAGATGGGGCAGCCAATAGGGAAACTAAATTAGGAAAAGCAGGATATGTAACTGACAGAGGAAGACAAAAAGTTGTCCCCCTAACGGACACAACAAATCAGAAGACTGAGTTACAAGCAATTCATCTAGCTTTGCAGGATTCGGGATTAGAAGTAAACATAGTGACAGACTCACAATATGCATTGGGAATCATTCAAGCACAACCAGATAAGAGTGAATCAGAGTTAGTCAGTCAAATAATAGAGCAGTTAATAAAAAAGGAAAAAGTCTACCTGGCATGGGTACCAGCACACAAAGGAATTGGAGGAAATGAACAAGTAGATGGGTTGGTCAGTGCTGGAATCAGGAAAGTACTATTTTTAGATGGAATAGATAAGGCCCAAGAAGAACATGAGAAATATCACAGTAATTGGAGAGCAATGGCTAGTGATTTTAACCTACCACCTGTAGTAGCAAAAGAAATAGTAGCCAGCTGTGATAAATGTCAGCTAAAAGGGGAAGCCATGCATGGACAAGTAGACTGTAGCCCAGGAATATGGCAGCTAGATTGTACACATTTAGAAGGAAAAGTTATCTTGGTAGCAGTTCATGTAGCCAGTGGATATATAGAAGCAGAAGTAATTCCAGCAGAGACAGGGCAAGAAACAGCATACTTCCTCTTAAAATTAGCAGGAAGATGGCCAGTAAAAACAGTACATACAGACAATGGCAGCAATTTCACCAGTACTACAGTTAAGGCCGCCTGTTGGTGGGCGGGGATCAAGCAGGAATTTGGCATTCCCTACAATCCCCAAAGTCAAGGAGTAATAGAATCTATGAATAAAGAATTAAAGAAAATTATAGGACAGGTAAGAGATCAGGCTGAACATCTTAAGACAGCAGTACAAATGGCAGTATTCATCCACAATTTTAAAAGAAAAGGGGGGATTGGGGGGTACAGTGCAGGGGAAAGAATAGTAGACATAATAGCAACAGACATACAAACTAAAGAATTACAAAAACAAATTACAAAAATTCAAAATTTTCGGGTTTATTACAGGGACAGCAGAGATCCAGTTTGGAAAGGACCAGCAAAGCTCCTCTGGAAAGGTGAAGGGGCAGTAGTAATACAAGATAATAGTGACATAAAAGTAGTGCCAAGAAGAAAAGCAAAGATCATCAGGGATTATGGAAAACAGATGGCAGGTGATGATTGTGTGGCAAGTAGACAGGATGAGGATTAACACATGGAAAAGATTAGTAAAACACCATATGTATATTTCAAGGAAAGCTAAGGACTGGTTTTATAGACATCACTATGAAAGTACTAATCCAAAAATAAGTTCAGAAGTACACATCCCACTAGGGGATGCTAAATTAGTAATAACAACATATTGGGGTCTGCATACAGGAGAAAGAGACTGGCATTTGGGTCAGGGAGTCTCCATAGAATGGAGGAAAAAGAGATATAGCACACAAGTAGACCCTGACCTAGCAGACCAACTAATTCATCTGCACTATTTTGATTGTTTTTCAGAATCTGCTATAAGAAATACCATATTAGGACGTATAGTTAGTCCTAGGTGTGAATATCAAGCAGGACATAACAAGGTAGGATCTCTACAGTACTTGGCACTAGCAGCATTAATAAAACCAAAACAGATAAAGCCACCTTTGCCTAGTGTTAGGAAACTGACAGAGGACAGATGGAACAAGCCCCAGAAGACCAAGGGCCACAGAGGGAGCCATACAATGAATGGACACTAGAGCTTTTAGAGGAACTTAAGAGTGAAGCTGTTAGACATTTTCCTAGGATATGGCTCCATAACTTAGGACAACATATCTATGAAACTTACGGGGATACTTGGGCAGGAGTGGAAGCCATAATAAGAATTCTGCAACAACTGCTGTTTATCCATTTCAGAATTGGGTGTCGACATAGCAGAATAGGCGTTACTCGACAGAGGAGAGCAAGAAATGGAGCCAGTAGATCCTAGACTAGAGCCCTGGAAGCATCCAGGAAGTCAGCCTAAAACTGCTTGTACCAATTGCTATTGTAAAAAGTGTTGCTTTCATTGCCAAGTTTGTTTCATGACAAAAGCCTTAGGCATCTCCTATGGCAGGAAGAAGCGGAGACAGCGACGAAGAGCTCATCAGAACAGTCAGACTCATCAAGCTTCTCTATCAAAGCAGTAAGTAGTACATGTAATGCAACCTATAATAGTAGCAATAGTAGCATTAGTAGTAGCAATAATAATAGCAATAGTTGTGTGGTCCATAGTAATCATAGAATATAGGAAAATATTAAGACAAAGAAAAATAGACAGGTTAATTGATAGACTAATAGAAAGAGCAGAAGACAGTGGCAATGAGAGTGAAGGAGAAGTATCAGCACTTGTGGAGATGGGGGTGGAAATGGGGCACCATGCTCCTTGGGATATTGATGATCTGTAGTGCTACAGAAAAATTGTGGGTCACAGTCTATTATGGGGTACCTGTGTGGAAGGAAGCAACCACCACTCTATTTTGTGCATCAGATGCTAAAGCATATGATACAGAGGTACATAATGTTTGGGCCACACATGCCTGTGTACCCACAGACCCCAACCCACAAGAAGTAGTATTGGTAAATGTGACAGAAAATTTTAACATGTGGAAAAATGACATGGTAGAACAGATGCATGAGGATATAATCAGTTTATGGGATCAAAGCCTAAAGCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTTGAAGAATGATACTAATACCAATAGTAGTAGCGGGAGAATGATAATGGAGAAAGGAGAGATAAAAAACTGCTCTTTCAATATCAGCACAAGCATAAGAGATAAGGTGCAGAAAGAATATGCATTCTTTTATAAACTTGATATAGTACCAATAGATAATACCAGCTATAGGTTGATAAGTTGTAACACCTCAGTCATTACACAGGCCTGTCCAAAGGTATCCTTTGAGCCAATTCCCATACATTATTGTGCCCCGGCTGGTTTTGCGATTCTAAAATGTAATAATAAGACGTTCAATGGAACAGGACCATGTACAAATGTCAGCACAGTACAATGTACACATGGAATCAGGCCAGTAGTATCAACTCAACTGCTGTTAAATGGCAGTCTAGCAGAAGAAGATGTAGTAATTAGATCTGCCAATTTCACAGACAATGCTAAAACCATAATAGTACAGCTGAACACATCTGTAGAAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATCCGTATCCAGAGGGGACCAGGGAGAGCATTTGTTACAATAGGAAAAATAGGAAATATGAGACAAGCACATTGTAACATTAGTAGAGCAAAATGGAATGCCACTTTAAAACAGATAGCTAGCAAATTAAGAGAACAATTTGGAAATAATAAAACAATAATCTTTAAGCAATCCTCAGGAGGGGACCCAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATTCAACACAACTGTTTAATAGTACTTGGTTTAATAGTACTTGGAGTACTGAAGGGTCAAATAACACTGAAGGAAGTGACACAATCACACTCCCATGCAGAATAAAACAATTTATAAACATGTGGCAGGAAGTAGGAAAAGCAATGTATGCCCCTCCCATCAGTGGACAAATTAGATGTTCATCAAATATTACTGGGCTGCTATTAACAAGAGATGGTGGTAATAACAACAATGGGTCCGAGATCTTCAGACCTGGAGGAGGCGATATGAGGGACAATTGGAGAAGTGAATTATATAAATATAAAGTAGTAAAAATTGAACCATTAGGAGTAGCACCCACCAAGGCAAAGAGAAGAGTGGTGCAGAGAGAAAAAAGAGCAGTGGGAATAGGAGCTTTGTTCCTTGGGTTCTTGGGAGCAGCAGGAAGCACTATGGGCTGCACGTCAATGACGCTGACGGTACAGGCCAGACAATTATTGTCTGATATAGTGCAGCAGCAGAACAATTTGCTGAGGGCTATTGAGGCGCAACAGCATCTGTTGCAACTCACAGTCTGGGGCATCAAACAGCTCCAGGCAAGAATCCTGGCTGTGGAAAGATACCTAAAGGATCAACAGCTCCTGGGGATTTGGGGTTGCTCTGGAAAACTCATTTGCACCACTGCTGTGCCTTGGAATGCTAGTTGGAGTAATAAATCTCTGGAACAGATTTGGAATAACATGACCTGGATGGAGTGGGACAGAGAAATTAACAATTACACAAGCTTAATACACTCCTTAATTGAAGAATCGCAAAACCAGCAAGAAAAGAATGAACAAGAATTATTGGAATTAGATAAATGGGCAAGTTTGTGGAATTGGTTTAACATAACAAATTGGCTGTGGTATATAAAATTATTCATAATGATAGTAGGAGGCTTGGTAGGTTTAAGAATAGTTTTTGCTGTACTTTCTATAGTGAATAGAGTTAGGCAGGGATATTCACCATTATCGTTTCAGACCCACCTCCCAATCCCGAGGGGACCCGACAGGCCCGAAGGAATAGAAGAAGAAGGTGGAGAGAGAGACAGAGACAGATCCATTCGATTAGTGAACGGATCCTTAGCACTTATCTGGGACGATCTGCGGAGCCTGTGCCTCTTCAGCTACCACCGCTTGAGAGACTTACTCTTGATTGTAACGAGGATTGTGGAACTTCTGGGACGCAGGGGGTGGGAAGCCCTCAAATATTGGTGGAATCTCCTACAGTATTGGAGTCAGGAACTAAAGAATAGTGCTGTTAACTTGCTCAATGCCACAGCCATAGCAGTAGCTGAGGGGACAGATAGGGTTATAGAAGTATTACAAGCAGCTTATAGAGCTATTCGCCACATACCTAGAAGAATAAGACAGGGCTTGGAAAGGATTTTGCTATAAGATGGGTGGCAAGTGGTCAAAAAGTAGTGTGATTGGATGGCCTGCTGTAAGGGAAAGAATGAGACGAGCTGAGCCAGCAGCAGATGGGGTGGGAGCAGTATCTCGAGACCTAGAAAAACATGGAGCAATCACAAGTAGCAATACAGCAGCTAACAATGCTGCTTGTGCCTGGCTAGAAGCACAAGAGGAGGAAGAGGTGGGTTTTCCAGTCACACCTCAGGTACCTTTAAGACCAATGACTTACAAGGCAGCTGTAGATCTTAGCCACTTTTTAAAAGAAAAGGGGGGACTGGAAGGGCTAATTCACTCCCAAAGAAGACAAGATATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGGTCAGATATCCACTGACCTTTGGATGGTGCTACAAGCTAGTACCAGTTGAGCCAGATAAGGTAGAAGAGGCCAATAAAGGAGAGAACACCAGCTTGTTACACCCTGTGAGCCTGCATGGAATGGATGACCCTGAGAGAGAAGTGTTAGAGTGGAGGTTTGACAGCCGCCTAGCATTTCATCACGTGGCCCGAGAGCTGCATCCGGAGTACTTCAAGAACTGCTGACATCGAGCTTGCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGCGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTGCATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTTCAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCACCCAGGAGGTAGAGGTTGCAGTGAGCCAAGATCGCGCCACTGCATTCCAGCCTGGGCAAGAAAACAAGACTGTCTAAAATAATAATAATAAGTTAAGGGTATTAAATATATTTATACATGGAGGTCATAAAAATATATATATTTGGGCTGGGCGCAGTGGCTCACACCTGCGCCCGGCCCTTTGGGAGGCCGAGGCAGGTGGATCACCTGAGTTTGGGAGTTCCAGACCAGCCTGACCAACATGGAGAAACCCCTTCTCTGTGTATTTTTAGTAGATTTTATTTTATGTGTATTTTATTCACAGGTATTTCTGGAAAACTGAAACTGTTTTTCCTCTACTCTGATACCACAAGAATCATCAGCACAGAGGAAGACTTCTGTGATCAAATGTGGTGGGAGAGGGAGGTTTTCACCAGCACATGAGCAGTCAGTTCTGCCGCAGACTCGGCGGGTGTCCTTCGGTTCAGTTCCAACACCGCCTGCCTGGAGAGAGGTCAGACCACAGGGTGAGGGCTCAGTCCCCAAGACATAAACACCCAAGACATAAACACCCAACAGGTCCACCCCGCCTGCTGCCCAGGCAGAGCCGATTCACCAAGACGGGAATTAGGATAGAGAAAGAGTAAGTCACACAGAGCCGGCTGTGCGGGAGAACGGAGTTCTATTATGACTCAAATCAGTCTCCCCAAGCATTCGGGGATCAGAGTTTTTAAGGATAACTTAGTGTGTAGGGGGCCAGTGAGTTGGAGATGAAAGCGTAGGGAGTCGAAGGTGTCCTTTTGCGCCGAGTCAGTTCCTGGGTGGGGGCCACAAGATCGGATGAGCCAGTTTATCAATCCGGGGGTGCCAGCTGATCCATGGAGTGCAGGGTCTGCAAAATATCTCAAGCACTGATTGATCTTAGGTTTTACAATAGTGATGTTACCCCAGGAACAATTTGGGGAAGGTCAGAATCTTGTAGCCTGTAGCTGCATGACTCCTAAACCATAATTTCTTTTTTGTTTTTTTTTTTTTATTTTTGAGACAGGGTCTCACTCTGTCACCTAGGCTGGAGTGCAGTGGTGCAATCACAGCTCACTGCAGCCTCAACGTCGTAAGCTCAAGCGATCCTCCCACCTCAGCCTGCCTGGTAGCTGAGACTACAAGCGACGCCCCAGTTAATTTTTGTATTTTTGGTAGAGGCAGCGTTTTGCCGTGTGGCCCTGGCTGGTCTCGAACTCCTGGGCTCAAGTGATCCAGCCTCAGCCTCCCAAAGTGCTGGGACAACCGGGCCCAGTCACTGCACCTGGCCCTAAACCATAATTTCTAATCTTTTGGCTAATTTGTTAGTCCTACAAAGGCAGTCTAGTCCCCAGCAAAAAGGGGGTTTGTTTCGGGAAAGGGCTGTTACTGTCTTTGTTTCAAACTATAAACTAAGTTCCTCCTAAACTTAGTTCGGCCTACACCCAGGAATGAACAAGGAGAGCTTGGAGGTTAGAAGCACGATGGAATTGGTTAGGTCAGATCTCTTTCACTGTCTGAGTTATAATTTTGCAATGGTGGTTCAAAGACTGCCCGCTTCTGACACCAGTCGCTGCATTAATGAATCGGCCAACGCGCGGGGAGAGGCGGTTTGCGTATTGGGCGCTCTTCCGCTTCCTCGCTCACTGACTCGCTGCGCTCGGTCGTTCGGCTGCGGCGAGCGGTATCAGCTCACTCAAAGGCGGTAATACGGTTATCCACAGAATCAGGGGATAACGCAGGAAAGAACATGTGAGCAAAAGGCCAGCAAAAGGCCAGGAACCGTAAAAAGGCCGCGTTGCTGGCGTTTTTCCATAGGCTCCGCCCCCCTGACGAGCATCACAAAAATCGACGCTCAAGTCAGAGGTGGCGAAACCCGACAGGACTATAAAGATACCAGGCGTTTCCCCCTGGAAGCTCCCTCGTGCGCTCTCCTGTTCCGACCCTGCCGCTTACCGGATACCTGTCCGCCTTTCTCCCTTCGGGAAGCGTGGCGCTTTCTCATAGCTCACGCTGTAGGTATCTCAGTTCGGTGTAGGTCGTTCGCTCCAAGCTGGGCTGTGTGCACGAACCCCCCGTTCAGCCCGACCGCTGCGCCTTATCCGGTAACTATCGTCTTGAGTCCAACCCGGTAAGACACGACTTATCGCCACTGGCAGCAGCCACTGGTAACAGGATTAGCAGAGCGAGGTATGTAGGCGGTGCTACAGAGTTCTTGAAGTGGTGGCCTAACTACGGCTACACTAGAAGGACAGTATTTGGTATCTGCGCTCTGCTGAAGCCAGTTACCTTCGGAAAAAGAGTTGGTAGCTCTTGATCCGGCAAACAAACCACCGCTGGTAGCGGTGGTTTTTTTGTTTGCAAGCAGCAGATTACGCGCAGAAAAAAAGGATCTCAAGAAGATCCTTTGATCTTTTCTACGGGGTCTGACGCTCAGTGGAACGAAAACTCACGTTAAGGGATTTTGGTCATGAGATTATCAAAAAGGATCTTCACCTAGATCCTTTTAAATTAAAAATGAAGTTTTAAATCAATCTAAAGTATATATGAGTAAACTTGGTCTGACAGTTACCAATGCTTAATCAGTGAGGCACCTATCTCAGCGATCTGTCTATTTCGTTCATCCATAGTTGCCTGACTCCCCGTCGTGTAGATAACTACGATACGGGAGGGCTTACCATCTGGCCCCAGTGCTGCAATGATACCGCGAGACCCACGCTCACCGGCTCCAGATTTATCAGCAATAAACCAGCCAGCCGGAAGGGCCGAGCGCAGAAGTGGTCCTGCAACTTTATCCGCCTCCATCCAGTCTATTAATTGTTGCCGGGAAGCTAGAGTAAGTAGTTCGCCAGTTAATAGTTTGCGCAACGTTGTTGCCATTGCTACAGGCATCGTGGTGTCACGCTCGTCGTTTGGTATGGCTTCATTCAGCTCCGGTTCCCAACGATCAAGGCGAGTTACATGATCCCCCATGTTGTGCAAAAAAGCGGTTAGCTCCTTCGGTCCTCCGATCGTTGTCAGAAGTAAGTTGGCCGCAGTGTTATCACTCATGGTTATGGCAGCACTGCATAATTCTCTTACTGTCATGCCATCCGTAAGATGCTTTTCTGTGACTGGTGAGTACTCAACCAAGTCATTCTGAGAATAGTGTATGCGGCGACCGAGTTGCTCTTGCCCGGCGTCAATACGGGATAATACCGCGCCACATAGCAGAACTTTAAAAGTGCTCATCATTGGAAAACGTTCTTCGGGGCGAAAACTCTCAAGGATCTTACCGCTGTTGAGATCCAGTTCGATGTAACCCACTCGTGCACCCAACTGATCTTCAGCATCTTTTACTTTCACCAGCGTTTCTGGGTGAGCAAAAACAGGAAGGCAAAATGCCGCAAAAAAGGGAATAAGGGCGACACGGAAATGTTGAATACTCATACTCTTCCTTTTTCAATATTATTGAAGCATTTATCAGGGTTATTGTCTCATGAGCGGATACATATTTGAATGTATTTAGAAAAATAAACAAATAGGGGTTCCGCGCACATTTCCCCGAAAAGTGCCACCTGACGTCTAAGAAACCATTATTATCATGACATTAACCTATAAAAATAGGCGTATCACGAGGCCCTTTCGTCTCGCGCGTTTCGGTGATGACGGTGAAAACCTCTGACACATGCAGCTCCCGGAGACGGTCACAGCTTGTCTGTAAGCGGATGCCGGGAGCAGACAAGCCCGTCAGGGCGCGTCAGCGGGTGTTGGCGGGTGTCGGGGCTGGCTTAACTATGCGGCATCAGAGCAGATTGTACTGAGAGTGCACCATATGCGGTGTGAAATACCGCACAGATGCGTAAGGAGAAAATACCGCATCAGGCGCCATTCGCCATTCAGGCTGCGCAACTGTTGGGAAGGGCGATCGGTGCGGGCCTCTTCGCTATTACGCCAGGGGAGGCAGAGATTGCAGTAAGCTGAGATCGCAGCACTGCACTCCAGCCTGGGCGACAGAGTAAGACTCTGTCTCAAAAATAAAATAAATAAATCAATCAGATATTCCAATCTTTTCCTTTATTTATTTATTTATTTTCTATTTTGGAAACACAGTCCTTCCTTATTCCAGAATTACACATATATTCTATTTTTCTTTATATGCTCCAGTTTTTTTTAGACCTTCACCTGAAATGTGTGTATACAAAATCTAGGCCAGTCCAGCAGAGCCTAAAGGTAAAAAATAAAATAATAAAAAATAAATAAAATCTAGCTCACTCCTTCACATCAAAATGGAGATACAGCTGTTAGCATTAAATACCAAATAACCCATCTTGTCCTCAATAATTTTAAGCGCCTCTCTCCACCACATCTAACTCCTGTCAAAGGCATGTGCCCCTTCCGGGCGCTCTGCTGTGCTGCCAACCAACTGGCATGTGGACTCTGCAGGGTCCCTAACTGCCAAGCCCCACAGTGTGCCCTGAGGCTGCCCCTTCCTTCTAGCGGCTGCCCCCACTCGGCTTTGCTTTCCCTAGTTTCAGTTACTTGCGTTCAGCCAAGGTCTGAAACTAGGTGCGCACAGAGCGGTAAGACTGCGAGAGAAAGAGACCAGCTTTACAGGGGGTTTATCACAGTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACATTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACAGTGCACCCTTACAATCATTCCATTTGATTCACAATTTTTTTAGTCTCTACTGTGCCTAACTTGTAAGTTAAATTTGATCAGAGGTGTGTTCCCAGAGGGGAAAACAGTATATACAGGGTTCAGTACTATCGCATTTCAGGCCTCCACCTGGGTCTTGGAATGTGTCCCCCGAGGGGTGATGACTACCTCAGTTGGATCTCCACAGGTCACAGTGACACAAGATAACCAAGACACCTCCCAAGGCTACCACAATGGGCCGCCCTCCACGTGCACATGGCCGGAGGAACTGCCATGTCGGAGGTGCAAGCACACCTGCGCATCAGAGTCCTTGGTGTGGAGGGAGGGACCAGCGCAGCTTCCAGCCATCCACCTGATGAACAGAACCTAGGGAAAGCCCCAGTTCTACTTACACCAGGAAAGGC\"\n hxb2_l = hxb2_ref.size\n head = \"\"\n 8.times {head << (65 + rand(25)).chr}\n temp_file = temp_dir + \"/temp\"\n temp_aln = temp_dir + \"/temp_aln\"\n\n l1 = 0\n l2 = 0\n name = \">test\"\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts hxb2_ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n if ref_size > 1.3*(seq.size)\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n max_seq = aln_test2.scan(/[ACGT]+/).max_by(&:length)\n aln_test2 =~ /#{max_seq}/\n before_aln_seq = $`\n before_aln = $`.size\n post_aln_seq = $'\n post_aln = $'.size\n before_aln_seq_size = before_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b1 = (1.3 * before_aln_seq_size).to_i\n post_aln_seq_size = post_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b2 = (1.3 * post_aln_seq_size).to_i\n if (before_aln > seq.size) and (post_aln <= seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1)]\n l1 = l1 + (before_aln - b1)\n elsif (post_aln > seq.size) and (before_aln <= seq.size)\n ref = ref[before_aln..(ref_size - post_aln - 1 + b2)]\n l2 = l2 + post_aln - b2\n elsif (post_aln > seq.size) and (before_aln > seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1 + b2)]\n l1 = l1 + (before_aln - b1)\n l2 = l2 + (post_aln - b2)\n end\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n end\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n\n if g1 == g2 and (s1 + g1 + s2) == ref.size\n if s1 > s2 and g2 > 2*s2\n ref = ref[0..(-g2-1)]\n repeat = 1\n l2 = l2 + g2\n elsif s1 < s2 and g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n else\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n\n while repeat == 1\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n #refine alignment\n\n if ref =~ /^(\\-+)/\n l1 = l1 - $1.size\n elsif ref =~ /(\\-+)$/\n l2 = l2 + $1.size\n end\n l1 = 0 if l1 < 0\n if (hxb2_l - l2 - 1) >= l1\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n ref_size = ref.size\n sim_count = 0\n (0..(ref_size-1)).each do |n|\n ref_base = ref[n]\n test_base = aln_test[n]\n sim_count += 1 if ref_base == test_base\n end\n similarity = (sim_count/ref_size.to_f*100).round(1)\n print `rm -f #{temp_file}`\n print `rm -f #{temp_aln}`\n loc_p1 = l1 + 1\n loc_p2 = hxb2_l - l2\n if seq.size != (loc_p2 - loc_p1 + 1)\n indel = true\n elsif aln_test.include?(\"-\")\n indel = true\n end\n return [loc_p1,loc_p2,similarity,indel,aln_test,ref]\n else\n return [0,0,0,0,0,0,0]\n end\nrescue\n return [0,0,0,0,\"N\",\"N\"]\nend",
"title": ""
},
{
"docid": "678c70dea1eca01d57d72ae379e7e058",
"score": "0.4721082",
"text": "def _reduce_116(val, _values, result)\n result = @builder.symbol_internal(val[0])\n \n result\nend",
"title": ""
},
{
"docid": "678c70dea1eca01d57d72ae379e7e058",
"score": "0.4721082",
"text": "def _reduce_116(val, _values, result)\n result = @builder.symbol_internal(val[0])\n \n result\nend",
"title": ""
},
{
"docid": "31738a5d45287f19440ca1293ccda98c",
"score": "0.47191453",
"text": "def trumps h1, h2, t \n c = []\n c << h1 if h1.slice(-1) == t \n c << h2 if h2.slice(-1) == t \n c\nend",
"title": ""
},
{
"docid": "3df866da9f010a18c01c8093bfe7259a",
"score": "0.4718909",
"text": "def _reduce_568(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend",
"title": ""
},
{
"docid": "3df866da9f010a18c01c8093bfe7259a",
"score": "0.4718909",
"text": "def _reduce_568(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend",
"title": ""
},
{
"docid": "3df866da9f010a18c01c8093bfe7259a",
"score": "0.4718909",
"text": "def _reduce_568(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend",
"title": ""
},
{
"docid": "b744cb133e8c945345897386faf74216",
"score": "0.47181323",
"text": "def each_identity; end",
"title": ""
},
{
"docid": "069416d8789d261b8e742946431f106d",
"score": "0.4717202",
"text": "def all_by_magic(io); end",
"title": ""
},
{
"docid": "48412710c08492591f41ec0553b303ce",
"score": "0.4709805",
"text": "def starting_position; end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "e1d41f6c40b6dbdf9a4310b1ed2cf364",
"score": "0.0",
"text": "def set_opportunity_stage\n @opportunity_stage = OpportunityStage.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": ""
}
] |
f50ea8114fa261fb86ac5b87e121502a
|
Change the in game lang (reload the texts)
|
[
{
"docid": "52bd0689725d0c90c0d5a249b1c29c6d",
"score": "0.68028796",
"text": "def language=(value)\n return unless GameData::Text::Available_Langs.include?(value)\n @language = value\n GameData::Text.load\n end",
"title": ""
}
] |
[
{
"docid": "906c96d70c67e8ca5c39f8e91d6a0468",
"score": "0.6896599",
"text": "def do_change_lang\n language = $document.at_css('#tryruby-lang-select').value\n $document.root['lang'] = language\n set_cookie('tryruby_nl_language', language)\n get_content_from_server(language)\n end",
"title": ""
},
{
"docid": "33f8d6d7c5a3c7b6cbcb7c000fadf806",
"score": "0.6881349",
"text": "def set_language(language)\n lines = File.read(\"Game.ini\")\n lines.gsub!(/Language=(\\w+)/) { \"Language=#{language}\" }\n lines << \"Language=#{language}\\n\" if !lines.include?(\"Language=#{language}\")\n File.open(\"Game.ini\", \"w\") { |f| f.write(lines) }\n $game_text = load_data(\"Data/#{language}.rvdata2\")\n end",
"title": ""
},
{
"docid": "0c88658b0a72cf0da1189d4defeef136",
"score": "0.66132134",
"text": "def set_lang(lang)\n\t\t\tlang = 'en' unless languages.include? lang\n\t\t\t@lang = lang.to_sym\n\t\tend",
"title": ""
},
{
"docid": "635713df3e19ce51669e17fd1bf1e21f",
"score": "0.6612363",
"text": "def set_language\n params[:lang] ||= 'en'\n Localization.use params[:lang]\n end",
"title": ""
},
{
"docid": "d9f38965414dbac0a766ac0c446e50bb",
"score": "0.6604821",
"text": "def reload\n @@languages.each do |lang_code, lang_file|\n lang_file.reload\n end\n end",
"title": ""
},
{
"docid": "dfe611be4665d6ee800d7b1db1e2b7e1",
"score": "0.6510061",
"text": "def set_language\n @lecture.update(locale: I18n.default_locale.to_s)\n end",
"title": ""
},
{
"docid": "ec226fe097d8551b722c8da0bd4afc69",
"score": "0.6502891",
"text": "def load\n reload_rh_texts unless PSDK_CONFIG.release?\n lang = ($pokemon_party ? $pokemon_party.options.language : default_lang)\n unless lang && Available_Langs.include?(lang)\n log_error \"Unsupported language code (#{lang}).\\nSupported language code are : #{Available_Langs.join(', ')}\"\n lang = Available_Langs.first\n log_info \"Fallback language code : #{lang}\"\n end\n @lang = lang\n @dialogs.clear\n end",
"title": ""
},
{
"docid": "666c3e7dd87d6385a6e22aa668515139",
"score": "0.64900094",
"text": "def set_current_language(lang)\n GetText.locale, prev_value = sanitize_lang(lang), GetText.locale\n prev_value\n end",
"title": ""
},
{
"docid": "84d33176e62dd05b83af21103bb55be2",
"score": "0.6465835",
"text": "def set_language\r\n session[:language] = 'english'\r\n end",
"title": ""
},
{
"docid": "7c98e69ade776e9e415b468d7b773ada",
"score": "0.6451208",
"text": "def on_load_language; load_language('lang/login'); end",
"title": ""
},
{
"docid": "c393c3e9f50a1219dbce37acdb2794d0",
"score": "0.6422275",
"text": "def lang(orig); end",
"title": ""
},
{
"docid": "ecadcb5245dac9471553be31002558c9",
"score": "0.63782537",
"text": "def language=(lang)\n case\n when lang==\"ENG\" then self.ENU=true; self.ENG=true; self.SPM=false; self.SPE=false; self.FRC=false; self.FRF=false; self.ITI=false; self.DUN=false; self.GED=false\n when lang==\"SPE\" then self.ENU=false; self.ENG=false; self.SPM=true; self.SPE=true; self.FRC=false; self.FRF=false; self.ITI=false; self.DUN=false; self.GED=false\n when lang==\"FRF\" then self.ENU=false; self.ENG=false; self.SPM=false; self.SPE=false; self.FRC=true; self.FRF=true; self.ITI=false; self.DUN=false; self.GED=false\n when lang==\"ITI\" then self.ENU=false; self.ENG=false; self.SPM=false; self.SPE=false; self.FRC=false; self.FRF=false; self.ITI=true; self.DUN=false; self.GED=false\n when lang==\"DUN\" then self.ENU=false; self.ENG=false; self.SPM=false; self.SPE=false; self.FRC=false; self.FRF=false; self.ITI=false; self.DUN=true; self.GED=false\n when lang==\"GED\" then self.ENU=false; self.ENG=false; self.SPM=false; self.SPE=false; self.FRC=false; self.FRF=false; self.ITI=false; self.DUN=false; self.GED=true\n end\n end",
"title": ""
},
{
"docid": "3b4200bd37cc0c05df7a417059ef7958",
"score": "0.6377847",
"text": "def set_langue\n @langue = Langue.find(params[:id])\n end",
"title": ""
},
{
"docid": "55888b7bb185492f4697a0ebd9041c62",
"score": "0.63608956",
"text": "def switch_language\n language = locale('Español', 'English')\n go_to language\n end",
"title": ""
},
{
"docid": "83750cc6c438a27c3e60251f453f1614",
"score": "0.6349853",
"text": "def set_languagename\n @languagename = Languagename.find(params[:id])\n end",
"title": ""
},
{
"docid": "502b98324c4a457d8114a793aed6f568",
"score": "0.63481",
"text": "def current_language=(new_lang)\n if loaded_languages.include? new_lang.to_sym\n @@current_language = new_lang.to_sym\n else\n raise LangFileNotLoaded.new(new_lang, loaded_languages)\n end\n end",
"title": ""
},
{
"docid": "502b98324c4a457d8114a793aed6f568",
"score": "0.63481",
"text": "def current_language=(new_lang)\n if loaded_languages.include? new_lang.to_sym\n @@current_language = new_lang.to_sym\n else\n raise LangFileNotLoaded.new(new_lang, loaded_languages)\n end\n end",
"title": ""
},
{
"docid": "335961c358398912a0fb0cb91e9b31b1",
"score": "0.63212425",
"text": "def translations; end",
"title": ""
},
{
"docid": "42f5bd13a55843aba41af69407cb77b2",
"score": "0.63041115",
"text": "def change_lang\n eng = :en\n jap = :ja\n if I18n.locale == eng\n params[:locale] = :ja\n I18n.locale = :ja\n elsif I18n.locale == jap\n params[:locale] = :en\n I18n.locale = :en\n end\n end",
"title": ""
},
{
"docid": "bf84bc8baf37f4dfc2d36686234b57fa",
"score": "0.62629706",
"text": "def reload_rh_texts\n langs = Dir[\"Data/Text/Dialogs/#{CSV_BASE}.*.dat\"].collect { |i| i.match(/[0-9]+\\.([a-z]+)\\.dat$/).captures[0] }\n if langs.empty? ||\n File.mtime(\"Data/Text/Dialogs/#{CSV_BASE}.#{langs.first}.dat\") < File.mtime(\"Data/Text/#{langs.first}.dat\")\n langs << GamePlay::Load::DEFAULT_GAME_LANGUAGE if langs.empty?\n log_debug('Updating Text files')\n filename = 'plugins/text2csv' # Just to avoid the warning\n require filename\n Available_Langs.clear\n Available_Langs.concat(langs)\n log_debug('Compiling Text files')\n compile\n end\n end",
"title": ""
},
{
"docid": "873a3a9c726817b08f08747c9ecdb072",
"score": "0.6239086",
"text": "def set_language\n I18n.locale = params[:locale] || I18n.default_locale\n @lang = Wzs::Multilang::get_language(I18n.locale)\n end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.620816",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.620816",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.620816",
"text": "def lang; end",
"title": ""
},
{
"docid": "733f290f73e2f4c472823e33ff841354",
"score": "0.620816",
"text": "def lang; end",
"title": ""
},
{
"docid": "23d96a5380536140ba0339b8bbc155ee",
"score": "0.62046397",
"text": "def set_lang()\n lang = nil\n loop do\n puts \"Sprichst du Deutsch (DE)? Or do you speak English (EN)?\"\n lang = gets.chomp.downcase\n if lang.start_with?('e')\n lang = 'eng'\n break\n end\n if lang.start_with?('d')\n lang = 'de'\n break\n end\n puts \"\\nBad Input.\\n\"\n end\n\n messages = MESSAGES[lang].values\n LOCMESS.each_key { |key| LOCMESS[key] = messages.shift } \nend",
"title": ""
},
{
"docid": "da11bc5e1986ce67debe65d3c12fa2e9",
"score": "0.6148966",
"text": "def set_lang\n return true unless lang = params[:lang]\n cookies[:lang] = {:value => lang, :expires => Time.now+1.day, :path => '/'}\n end",
"title": ""
},
{
"docid": "aca637bbe240f119e466d7267c8e1eb1",
"score": "0.6123913",
"text": "def language(lang)\n I18n.locale = \"#{YAML.load_file(Rails.root.to_s + '/config/express_translate.yml')['package']['id']}#{lang}\"\n end",
"title": ""
},
{
"docid": "6fbc29b103a1ab7818e4b3c8f1f8290f",
"score": "0.6118638",
"text": "def use_i18n=(value); end",
"title": ""
},
{
"docid": "aeea1006fc58678d8576127ad7db7088",
"score": "0.6117868",
"text": "def default_lang\n GamePlay::Load::DEFAULT_GAME_LANGUAGE\n end",
"title": ""
},
{
"docid": "5200d12952a852f85fc842797b7297d6",
"score": "0.6110658",
"text": "def set_language\n self.language = I18n.locale.to_s unless self.language.present?\n end",
"title": ""
},
{
"docid": "c3d64c93d1643b7b8c266a6bbe2f6904",
"score": "0.6096988",
"text": "def save_en\n @disert_theme = DisertTheme.find(params[:disert_theme][:id])\n @disert_theme.update_attribute(:title_en, params[:disert_theme][:title_en])\n end",
"title": ""
},
{
"docid": "59b9d1bb0fa067f72a717606b72dbaf3",
"score": "0.60963327",
"text": "def set_language_from\n session[:lang_from] = params[:lang].to_sym\n I18n.locale = session[:lang_from]\n render nothing: true\n end",
"title": ""
},
{
"docid": "666df6fbf20f6110829cd2b1bb2a4baa",
"score": "0.6094621",
"text": "def lang\n # get current page url hash\n back_hash = Rails.application.routes.recognize_path request.referer\n Rails.logger.debug(\"original back_hash: #{back_hash.inspect}\")\n # change the locale code in the current page url hash\n back_hash[:locale] = @locale_code\n Rails.logger.debug(\"redirect to: #{back_hash.inspect}\")\n # see current page in new locale!\n redirect_to back_hash\n end",
"title": ""
},
{
"docid": "2b50c8b8bdb3c4b1fb19d6e147d3c82e",
"score": "0.60578555",
"text": "def switch_language\n I18n.locale = params[:lang]\n session[:lang] = params[:lang]\n respond_to do |f|\n f.js \n f.html\n end\n end",
"title": ""
},
{
"docid": "f38ab80354751c8696ea1abc7d3b985d",
"score": "0.6038622",
"text": "def update\n files = Dir[Rails.root.join(\"config\", \"locales\", \"*.yml\").to_s]\n\n @languages = {}\n files.each do |f|\n ar = YAML.load_file f\n lang = ar.keys.first\n if @languages.has_key?(lang.to_s)\n @languages[lang.to_s] = @languages[lang.to_s].deep_merge(ar.first[1])\n else\n @languages[lang.to_s] = ar.first[1]\n end\n end\n\n sync(@languages[I18n.default_locale.to_s])\n end",
"title": ""
},
{
"docid": "35827f6b29aea1a214f364a8669cb22e",
"score": "0.60287976",
"text": "def set_locale\n end",
"title": ""
},
{
"docid": "c66eae2612af87662e33a60558367de5",
"score": "0.6011547",
"text": "def operate_switch_language(code)\n #callback(:before_switch_language)\n @translation_cache = {} if @translation_cache.nil?\n facet_names = self.class.globalize_facets\n @translation_cache[language_code] = @attributes.dup.delete_if {|key, value| !facet_names.include? key.to_sym}\n Locale.switch(code) do\n set_original_language\n if @translation_cache.include? code\n @attributes.update @translation_cache[code]\n elsif @original_language == Locale.base_language and !@new_record\n reload\n elsif !@new_record\n trs = ModelTranslation.find(:all, \n :conditions => [ \"table_name = ? AND item_id = ? AND language_id = ? AND \" +\n \"facet IN (#{[ '?' ] * facet_names.size * ', '})\", self.class.table_name,\n self.id, @original_language.id ] + facet_names.map {|facet| facet.to_s} )\n trs ||= []\n trs.each do |tr|\n attr = tr.text || base[tr.facet.to_s]\n write_attribute( tr.facet, attr )\n end\n end\n \n operate_switch_language_on_associations(code)\n \n #callback(:after_switch_language)\n end\n end",
"title": ""
},
{
"docid": "1b08f76ac9e557b86c30aa28464d3d0a",
"score": "0.5988914",
"text": "def set_language\n @language = Language.find(params[:id])\n end",
"title": ""
},
{
"docid": "1b08f76ac9e557b86c30aa28464d3d0a",
"score": "0.5988914",
"text": "def set_language\n @language = Language.find(params[:id])\n end",
"title": ""
},
{
"docid": "8b347977d61e17553e7c1c46aaa4ebe3",
"score": "0.5971177",
"text": "def set_language\n @o_single = Language.find(params[:id])\n end",
"title": ""
},
{
"docid": "411580d8ffafac952e28c99e44fc9269",
"score": "0.595108",
"text": "def set_original_text(text, lang_code)\n text_record.set_original_text(text, lang_code)\n end",
"title": ""
},
{
"docid": "80fd8607258eb9e5dea2d90458ea6b6e",
"score": "0.59446245",
"text": "def lang=(_arg0); end",
"title": ""
},
{
"docid": "80fd8607258eb9e5dea2d90458ea6b6e",
"score": "0.59446245",
"text": "def lang=(_arg0); end",
"title": ""
},
{
"docid": "83d889e6d2e521d9764698206b6b185c",
"score": "0.591273",
"text": "def set_language\n @language = Language.find(params[:id])\n end",
"title": ""
},
{
"docid": "83d889e6d2e521d9764698206b6b185c",
"score": "0.591273",
"text": "def set_language\n @language = Language.find(params[:id])\n end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.5903105",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.5903105",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.5903105",
"text": "def language; end",
"title": ""
},
{
"docid": "c3877eba16879e3ed8ded00d06fa62a9",
"score": "0.5903105",
"text": "def language; end",
"title": ""
},
{
"docid": "676652eed9212bb37435a4880b7668ef",
"score": "0.5884661",
"text": "def change_to_english\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n @user.prefered_language=\"english\"\n @user.save\n redirect_to '/home'\n #redirect_to(:back)\nelse\n session[:language]=\"english\"\n redirect_to '/home'\nend\nend",
"title": ""
},
{
"docid": "dc620e5705850a2773abedd0c3cd4726",
"score": "0.5879404",
"text": "def set_user_language\n I18n.locale = 'es-VE'\n end",
"title": ""
},
{
"docid": "c08249beae98412f17f78e682ecb535c",
"score": "0.58760494",
"text": "def translate(settings); end",
"title": ""
},
{
"docid": "843b58f2cf6d19978666539bf212c268",
"score": "0.58748424",
"text": "def set_locale\n session[:locale] = params[:locale] if params[:locale]\n I18n.locale = session[:locale] || I18n.default_locale\n locale_path = \"#{LOCALES_DIRECTORY}#{I18n.locale}.yml\"\n unless I18n.load_path.include? locale_path\n I18n.load_path << locale_path\n I18n.backend.send(:init_translations)\n end\n rescue Exception => err\n logger.error err\n flash.now[:notice] = \"#{I18n.locale} translation not available\"\n I18n.load_path -= [locale_path]\n I18n.locale = session[:locale] = I18n.default_locale\n end",
"title": ""
},
{
"docid": "19638e22eff1915ab787e41520621b3d",
"score": "0.5867208",
"text": "def lang\n # get current page url hash\n back_hash = Rails.application.routes.recognize_path request.referer\n Rails.logger.debug(\"original back_hash: #{back_hash.inspect}\")\n # change the locale code in the current page url hash\n back_hash[:locale] = @locale_code\n back_hash[:dim_type] = params[:dim_type] if params[:dim_type]\n Rails.logger.debug(\"redirect to: #{back_hash.inspect}\")\n # see current page in new locale!\n redirect_to back_hash\n end",
"title": ""
},
{
"docid": "78e1a6e29e174593bbefba8466237fa8",
"score": "0.58619404",
"text": "def set_user_language\n cookies[:language] ||= '0'\n I18n.locale = LOCALES_AVAILABLE[cookies[:language].to_i]\n end",
"title": ""
},
{
"docid": "00a0b393e5a471c10219fc8f15d0b42e",
"score": "0.5861692",
"text": "def set_locale\n I18n.locale = Rails.configuration.oyambre.languages.first\n end",
"title": ""
},
{
"docid": "d7b9d1c4a79af239918c7a467a7d4526",
"score": "0.58613485",
"text": "def translit_non_latin_lang(lang)\n case lang\n when \"ar\",\"ru\",\"el\"\n self.translit\n else\n self\n end\n end",
"title": ""
},
{
"docid": "848220ccb05f17ebc6ade299bfa9c6e6",
"score": "0.58517957",
"text": "def lang_switcher\n I18n.available_locales.each do |loc|\n locale_param = request.path == root_path ? root_path(locale: loc) : params.merge(locale: loc)\n if I18n.locale != loc\n concat content_tag(:li, (link_to I18n.t(\"l#{loc}\"), locale_param), class: nil)\n end\n end\n end",
"title": ""
},
{
"docid": "f4fa37e7e92afdc07c5490a660a57dd7",
"score": "0.58446443",
"text": "def update!(**args)\n @languages = args[:languages] if args.key?(:languages)\n end",
"title": ""
},
{
"docid": "f4fa37e7e92afdc07c5490a660a57dd7",
"score": "0.58446443",
"text": "def update!(**args)\n @languages = args[:languages] if args.key?(:languages)\n end",
"title": ""
},
{
"docid": "9e4f9323eb1290e10d9bc176161bca0c",
"score": "0.5832593",
"text": "def set_locale\n #I18n.locale = params[:lang] ? params[:lang] : I18n.default_locale\n end",
"title": ""
},
{
"docid": "39d663393de98f814da4cd6be9e968a8",
"score": "0.5830656",
"text": "def reset_locale language\n if language.nil? or language.empty?\n return\n end\n create_base_yml_file_without_missions(language) unless File.exists?(yml_path(language))\n\n I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]\n I18n.locale = language\nend",
"title": ""
},
{
"docid": "650510282133042b9d8e90af5e2e8e56",
"score": "0.582576",
"text": "def vobsub_lang \n send_cmd(\"vobsub_lang\")\n end",
"title": ""
},
{
"docid": "a5f3a75dcd3e82987f36b0cf96356ba3",
"score": "0.58255947",
"text": "def language=(lang_id)\n @lang_id = lang_id\n end",
"title": ""
},
{
"docid": "3433e2ee1facd1b006c0b1bf362cb42e",
"score": "0.5813275",
"text": "def set_i18n\n if params[:locale]\n if I18n.available_locales.include?(params[:locale].to_sym)\n I18n.locale = params[:locale]\n else\n flash.now[:notice] = \"#{params[:locale]} not available\"\n logger.error flash.now[:notice]\n end\n end\n end",
"title": ""
},
{
"docid": "5e11496f4f7755c277d4050116b30d30",
"score": "0.5803902",
"text": "def init_linguistics\n Linguistics::use(:en)\nend",
"title": ""
},
{
"docid": "59a652fe0fa87676ba645b533f8c63ae",
"score": "0.5792578",
"text": "def load_language(lang)\n puts \"Loading current translations for language #{lang}\"\n system(\n 'curl -X GET ' \\\n \"'https://translation.io/api/v1/segments.json?target_language=#{lang}' \" \\\n \"-H 'x-api-key: #{$API_KEY}' > ,full-list\"\n )\n current_translations_file_contents = File.read(',full-list')\n current_translations_json = JSON.parse(current_translations_file_contents)\n\n if current_translations_json.key?('errors')\n puts 'Error:'\n puts current_translations_json['errors']\n exit 1\n end\n\n # Initialize hash in CURRENT_TRANSLATIONS for this new language\n $CURRENT_TRANSLATIONS[lang] = {}\n\n # Reorganize so that $CURRENT_TRANSLATIONS[lang][key] contains segment\n # information that translations.io provides:\n # id, key, target_language, target, etc.\n current_translations_json['segments'].each do |segment|\n # Work around bug in Rubocop\n if segment['target_language'] != lang\n STDERR.puts \"Error: Expected language #{lang} in segment #{segment}\"\n exit 1\n end\n $CURRENT_TRANSLATIONS[lang][segment['key']] = segment\n end\nend",
"title": ""
},
{
"docid": "c2fbf2b65d4aa8a6a6d1d7d16918061c",
"score": "0.5790126",
"text": "def verificar_locale\n \n end",
"title": ""
},
{
"docid": "001cd0119ca6aea0c91bbc9ee0aaaead",
"score": "0.578939",
"text": "def use_i18n; end",
"title": ""
},
{
"docid": "45071f41246d8869b721b97cde61b010",
"score": "0.57706046",
"text": "def translate_input_text\n if self.language\n self.output_text = self.language.translate(self.input_text)\n else\n self.output_text = self.input_text\n end\n end",
"title": ""
},
{
"docid": "e2648fff78c6d89da1e7dcb10d7f1eaa",
"score": "0.57704794",
"text": "def set_Language(value)\n set_input(\"Language\", value)\n end",
"title": ""
},
{
"docid": "e2648fff78c6d89da1e7dcb10d7f1eaa",
"score": "0.5770172",
"text": "def set_Language(value)\n set_input(\"Language\", value)\n end",
"title": ""
},
{
"docid": "e2648fff78c6d89da1e7dcb10d7f1eaa",
"score": "0.5770172",
"text": "def set_Language(value)\n set_input(\"Language\", value)\n end",
"title": ""
},
{
"docid": "e2648fff78c6d89da1e7dcb10d7f1eaa",
"score": "0.57692504",
"text": "def set_Language(value)\n set_input(\"Language\", value)\n end",
"title": ""
},
{
"docid": "e2648fff78c6d89da1e7dcb10d7f1eaa",
"score": "0.57692504",
"text": "def set_Language(value)\n set_input(\"Language\", value)\n end",
"title": ""
},
{
"docid": "e57597f1240a2f73bd282ea02eb75eb4",
"score": "0.57666576",
"text": "def set_locale\n return unless Language.current\n\n ::I18n.locale = Language.current&.locale\n end",
"title": ""
},
{
"docid": "3389603c1dc365af136e101eff77ec9a",
"score": "0.5759605",
"text": "def set_locale\n set_I18n_locale(params[:locale]) # Merken in Client_Info_Cache\n\n respond_to do |format|\n format.js {render :js => \"window.location.reload();\" } # Reload der Sganzen Seite\n end\n end",
"title": ""
},
{
"docid": "5bd913def2ebf77792d5739fe0d68622",
"score": "0.5759273",
"text": "def set_website_locale\n app_locales = %w(es ca)\n I18n.locale = params[:lang] if app_locales.include?(params[:lang])\n end",
"title": ""
},
{
"docid": "fe27e1ac8685520a6e55a0bd1d044b7e",
"score": "0.57562673",
"text": "def do_show_lang\n $document.at_css('#tryruby-lang-hider').toggle_class('hidden')\n end",
"title": ""
},
{
"docid": "007cb6db914c52565901be15d0789eea",
"score": "0.5755876",
"text": "def set_language_to\n session[:lang_to] = params[:lang].to_sym\n \n respond_to do |format|\n format.html { redirect_to root_url } \n format.js { render nothing: true }\n end\n end",
"title": ""
},
{
"docid": "5fc4fb8ff13ee1c3474d204a8b5351ee",
"score": "0.5753826",
"text": "def language \n \"language\" \n end",
"title": ""
},
{
"docid": "3c4dafb7cb671c2172ce16ada4b42b0f",
"score": "0.57488567",
"text": "def update!(**args)\n @language_constant = args[:language_constant] if args.key?(:language_constant)\n end",
"title": ""
},
{
"docid": "e13738de59e9ea796eb10bddbf6c63e9",
"score": "0.5748142",
"text": "def set_natlang\n @natlang = Natlang.find(params[:id])\n end",
"title": ""
},
{
"docid": "fb9accad010355df912ba9c37d3d7906",
"score": "0.57441753",
"text": "def auto_translate\n return unless MuckContents.configuration.enable_auto_translations\n begin\n translate(false)\n rescue => ex\n #TODO figure out a way to bubble up the error\n puts ex\n debugger\n # Translations failed, but update the default language\n translation = translation_for(self.locale)\n translation.update_attributes!(:title => self.title, :body => self.body) unless translation.blank?\n end\n end",
"title": ""
},
{
"docid": "de1357ebe55afd226771267977b87890",
"score": "0.57406074",
"text": "def set_language\r\n @language = Language.find(params[:id]) rescue Language.find(params[:language_id])\r\n end",
"title": ""
},
{
"docid": "37d2f979bf3de64abcb07fbb8509e4ca",
"score": "0.57354456",
"text": "def set_language!(lang = 'en')\n @options[:lang] = lang\n end",
"title": ""
},
{
"docid": "dfb2c3abf01677d5fab597f0953a5d2b",
"score": "0.5730185",
"text": "def language_server; end",
"title": ""
},
{
"docid": "098b2609900d6a9679d2731675429c47",
"score": "0.5722707",
"text": "def language=(value)\n self.dim_language=DimLanguage.find_by_name(value)\n end",
"title": ""
},
{
"docid": "3ac2a453d5dd98f6fd748063644977ca",
"score": "0.5721044",
"text": "def set_help_text\n @text_window.set_text(SES::ExternalText.get_text(\"Language Select\") ||\n \"Select a language from the list.\")\n end",
"title": ""
},
{
"docid": "06f899e1ad8ad9bf03f19160d1342682",
"score": "0.57135165",
"text": "def init_translations; end",
"title": ""
},
{
"docid": "7619cd97dd57ca4fc0ef69603d5c19a4",
"score": "0.5699635",
"text": "def hello_world lang\n if lang == 'de'\n p ' Hallo Welt'\n elsif lang == 'es'\n p 'Hola Mundo' \n elsif lang == 'ru'\n p 'Привет, мир'\n elsif lang == 'ja'\n p 'こんにちは世界'\n else\n p 'Hello World'\n end\nend",
"title": ""
},
{
"docid": "1efc87016669bbeeb21642cd6fd454e6",
"score": "0.5690632",
"text": "def set_locale#Esta accion o metodo indica el idioma que esta en config/locales/es.yml\n I18n.locale = 'es'\n end",
"title": ""
},
{
"docid": "befb968fbd5dd538d12e685e2a0ff6ed",
"score": "0.56875795",
"text": "def change_user_lang\n session[:language] = params[:lang]\n render :json => {:controller => params[:controller_name]}\n end",
"title": ""
},
{
"docid": "ebf2bbce44d329fd9c208ed426cda3b8",
"score": "0.568381",
"text": "def set_translation(locale, translation, value)\n SimpleTranslationEngine.set_translation(locale, \"alert_#{self.id}_#{translation}\", value)\n end",
"title": ""
},
{
"docid": "2681fbc9457095d23b85b03cc0e467fe",
"score": "0.5680311",
"text": "def update\n @lang = Lang.find(params[:id])\n\n respond_to do |format|\n if @lang.update_attributes(params[:lang])\n format.html { redirect_to @lang, notice: 'Lang was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lang.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d22f925b7cc019bc5cced8610e58e2d",
"score": "0.5674352",
"text": "def show\n @translate\n @uploaded_text = ''\n translation_map = []\n end",
"title": ""
},
{
"docid": "b9dab7c1a6fd35e390953779ef8bed53",
"score": "0.5670774",
"text": "def article_title_lang_display(text)\n\t\tarticle_lang_display(text)\n\tend",
"title": ""
},
{
"docid": "db6b036d6ec503a2a87854ad421519ab",
"score": "0.56557345",
"text": "def set_language\n return if request.fullpath.match(/^\\/(\\S+)preview/)\n unless current_user.nil?\n I18n.locale = current_user.language\n end\n I18n.locale = session[:lang] if session[:lang]\n end",
"title": ""
},
{
"docid": "bdf34c6d4ceaf669c1b55ae873aa2d2a",
"score": "0.56514",
"text": "def set_r_language\n @r_language = RLanguage.find(params[:id])\n end",
"title": ""
}
] |
f8f2d39a992178ddc78c797176fd0e23
|
GET /problems GET /problems.xml
|
[
{
"docid": "107a1ec6bcdd3d77cda10a8db45dd9e8",
"score": "0.6221989",
"text": "def index\n @problems = @problems.distinct.score_by_user(current_user.id)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @problems }\n end\n end",
"title": ""
}
] |
[
{
"docid": "e62c7ada668cb62f0de2cd37322ca862",
"score": "0.74268717",
"text": "def index\n @problems = Problem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @problems }\n end\n end",
"title": ""
},
{
"docid": "5ba2a51459880cafb7fc7f62ffd77b05",
"score": "0.72074103",
"text": "def index\n @problems = Problem.find(:all)\n\n respond_to do |format|\n format.html # index.haml\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "ab06b08a8983b269477a7f9a95c92d2b",
"score": "0.67723376",
"text": "def getProblems\n\t\tid = params[:id]\n\t\ttrack = Track.find(id)\n\t\tproblems = track.problems\n\t\trender json: problems\n\tend",
"title": ""
},
{
"docid": "b525c3bfb9068945d0c1bf06e5e2d9f4",
"score": "0.6748727",
"text": "def index\n @problems = Problem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "b525c3bfb9068945d0c1bf06e5e2d9f4",
"score": "0.6748727",
"text": "def index\n @problems = Problem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "b525c3bfb9068945d0c1bf06e5e2d9f4",
"score": "0.6748727",
"text": "def index\n @problems = Problem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "b525c3bfb9068945d0c1bf06e5e2d9f4",
"score": "0.6748727",
"text": "def index\n @problems = Problem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "dadf14d389ebdc0ba40d0474d2c1d194",
"score": "0.66877943",
"text": "def index\n @problems = Problem.all\n end",
"title": ""
},
{
"docid": "dadf14d389ebdc0ba40d0474d2c1d194",
"score": "0.66877943",
"text": "def index\n @problems = Problem.all\n end",
"title": ""
},
{
"docid": "dadf14d389ebdc0ba40d0474d2c1d194",
"score": "0.66877943",
"text": "def index\n @problems = Problem.all\n end",
"title": ""
},
{
"docid": "103a0bde70c941401d45512a11f47278",
"score": "0.6618084",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "103a0bde70c941401d45512a11f47278",
"score": "0.6618084",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "103a0bde70c941401d45512a11f47278",
"score": "0.6618084",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "82e8274df474b114fdb8835d16d382da",
"score": "0.66084576",
"text": "def index\n @problems = Problem.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "4de305eec6924bc2544bc7545edca6ed",
"score": "0.656241",
"text": "def index\n @problems = @idea.problems.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "c1c17618c7d27e695e0ab0a7984d5947",
"score": "0.6515138",
"text": "def fetch_all_problems\n url = 'http://www.spoj.com/problems/classical/'\n OnlineJudges::EnglishSpoj::ProblemsPage.problems_starting_from(url)\n end",
"title": ""
},
{
"docid": "142884e2beb67f902599fc775c4054ac",
"score": "0.6514946",
"text": "def index\n @problems = ::Problem.all.order(:id).paginate(page: params[:page], per_page: 10)\n end",
"title": ""
},
{
"docid": "142884e2beb67f902599fc775c4054ac",
"score": "0.6514946",
"text": "def index\n @problems = ::Problem.all.order(:id).paginate(page: params[:page], per_page: 10)\n end",
"title": ""
},
{
"docid": "b2fa83d758e540edb64e6481c416c11d",
"score": "0.65101945",
"text": "def index\n @problem_types = ProblemType.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @problem_types }\n end\n end",
"title": ""
},
{
"docid": "a255e14e302903414f9304285239e86d",
"score": "0.6504154",
"text": "def index\n @problems = Problem.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "005093f6b39ca5d099b9de2973fe75c3",
"score": "0.64734304",
"text": "def index\r\n @problems = Problem.paginate(page: params[:page])\r\n end",
"title": ""
},
{
"docid": "3b339e85a9be4d1368184bc143d5b9f8",
"score": "0.6434155",
"text": "def index\n @problem_sets = ProblemSet.find(:all)\n\n respond_to do |format|\n format.html # index.haml\n format.xml { render :xml => @problem_sets }\n end\n end",
"title": ""
},
{
"docid": "fde08ac215e395e0d3b1607986d567b1",
"score": "0.6411413",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.haml\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "782545526b0cc366111b67c51f751df2",
"score": "0.6354965",
"text": "def index\n @my_problems = MyProblem.all\n end",
"title": ""
},
{
"docid": "963a295c9b67c4ed4647ac611cf9326c",
"score": "0.6340152",
"text": "def index\n @problems = Problem.active.order(\"title\").page(params[:page]).per(10)\n respond_with(@problems)\n\n\n end",
"title": ""
},
{
"docid": "debce8be3427598e6e0de19ffd73c4f3",
"score": "0.6291904",
"text": "def show\n @problem = @idea.problems.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "a0614b20b33172dab8ad4f83dedd83cd",
"score": "0.6248011",
"text": "def show\n @problem_set = ProblemSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.haml\n format.xml { render :xml => @problem_set }\n end\n end",
"title": ""
},
{
"docid": "7d124972020796227fb22618b37a8a13",
"score": "0.62345827",
"text": "def index\n @specific_problems = SpecificProblem.all\n end",
"title": ""
},
{
"docid": "4235bf36e882864516645da9bac1156e",
"score": "0.61663246",
"text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "4235bf36e882864516645da9bac1156e",
"score": "0.61663246",
"text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "399c2100c1cd9218d9d84e037a16292a",
"score": "0.61448556",
"text": "def index\r\n @problems = current_user.problems\r\n\r\n @code_problems = current_user.code_problems\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @problems }\r\n end\r\n end",
"title": ""
},
{
"docid": "261c00b98620503e85f25008ad304747",
"score": "0.61355287",
"text": "def index\n problems = @assessment.problems\n\n respond_with problems, only: [:name, :description, :max_score, :optional]\n end",
"title": ""
},
{
"docid": "916394e6801ca8ed2d5d45419e9b0375",
"score": "0.61242384",
"text": "def index\n render json: ProblemSerializer.new(Problem.all)\n end",
"title": ""
},
{
"docid": "5b61eaf688e54d00cc837a76c1cdeaa5",
"score": "0.60942566",
"text": "def index\n @problems = Problem.all\n @current_problems = Problem.find(:all, :conditions => [\"current_problem = ?\", true])\n @old_problems = Problem.find(:all, :conditions => [\"current_problem = ?\", false])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @problems }\n end\n end",
"title": ""
},
{
"docid": "96eb9245d7aff162e9ed8be9b57dfd50",
"score": "0.6080952",
"text": "def index\n @problems = @contest.problems\n @users = User.contestants_of(@contest)\n @current_user.attend(@contest) unless @current_user.attended? @contest\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "644abfe49513e4298bef9244187d0c2d",
"score": "0.60769486",
"text": "def fetch_all_problems\n urls = ['http://pl.spoj.com/problems/latwe/',\n 'http://pl.spoj.com/problems/srednie/',\n 'http://pl.spoj.com/problems/trudne/']\n\n urls.map do |url|\n OnlineJudges::Spoj::ProblemsPage.problems_starting_from(url)\n end.flatten\n end",
"title": ""
},
{
"docid": "644abfe49513e4298bef9244187d0c2d",
"score": "0.60769486",
"text": "def fetch_all_problems\n urls = ['http://pl.spoj.com/problems/latwe/',\n 'http://pl.spoj.com/problems/srednie/',\n 'http://pl.spoj.com/problems/trudne/']\n\n urls.map do |url|\n OnlineJudges::Spoj::ProblemsPage.problems_starting_from(url)\n end.flatten\n end",
"title": ""
},
{
"docid": "0d23302ec78ab959ecd2b9e4799ecd14",
"score": "0.6040136",
"text": "def show\n @problem_severity = ProblemSeverity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem_severity }\n end\n end",
"title": ""
},
{
"docid": "f4b07d6c12c829d7fc1a02fb9eb25774",
"score": "0.6039743",
"text": "def index\n @device_problems = DeviceProblem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @device_problems }\n end\n end",
"title": ""
},
{
"docid": "0c742531b2c7b688839afdec27b58009",
"score": "0.60275054",
"text": "def show\n @problem_link = ProblemLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem_link }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "1ae8178955db543e4a06112a1d6d19d0",
"score": "0.60195136",
"text": "def show\n @problem = Problem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "c516d6ac87ba5f68f9b67687d148d153",
"score": "0.60185367",
"text": "def show\n @problem = Problem.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end",
"title": ""
},
{
"docid": "7e60d9578b1857c0493e865114359cc5",
"score": "0.60058516",
"text": "def show\n @pacient_problem = PacientProblem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pacient_problem }\n end\n end",
"title": ""
},
{
"docid": "2167af4cd5a22a0ca9d1e548bf61d8ba",
"score": "0.6004214",
"text": "def index\n @feed_items = current_user.asked_problems_feed.paginate(page: params[:page])\n @problems = current_user.problems.all\n end",
"title": ""
},
{
"docid": "1549a9303bc55404e2a61fb7b7437c1a",
"score": "0.5984108",
"text": "def index\n @known_issues = KnownIssue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @known_issues }\n end\n end",
"title": ""
},
{
"docid": "1f9bf07e2e2edc594e249e8506d80d3e",
"score": "0.59695685",
"text": "def new\n @problem_set = ProblemSet.new\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @problem_set }\n end\n end",
"title": ""
},
{
"docid": "635a1111be4f7736a41c6a77707f1571",
"score": "0.595804",
"text": "def index\n @device_problems = DeviceProblem.all\n end",
"title": ""
},
{
"docid": "40efd2327794f2aa9b0464389d4320ec",
"score": "0.5940748",
"text": "def show\n\t\t@contest = Contest.find(params[:id])\n\t\t@problems = @contest.problems.all\n\tend",
"title": ""
},
{
"docid": "8546f12a846fc81de0a43b9a906f3e1a",
"score": "0.5937952",
"text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @problem }\n end\n end",
"title": ""
},
{
"docid": "d5db91923a245f64c42eeded5a478637",
"score": "0.58939135",
"text": "def index\n @bugs = Bug.order(\"resolved desc\").order(\"error_type_id\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bugs }\n end\n end",
"title": ""
},
{
"docid": "9f46f99893eddaae815ad1a0d4373292",
"score": "0.5889543",
"text": "def index\n @problems = @competition.header_problems\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "2c4c70c270d8cf740398d0650e6868db",
"score": "0.5871625",
"text": "def show\n @problem_type = ProblemType.find(params[:id])\n @problem_fields = @problem_type.problem_fields\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem_fields }\n format.json { render :json => @problem_type }\n end\n end",
"title": ""
},
{
"docid": "3111570d198f642fde6e4fe56ad88991",
"score": "0.5870825",
"text": "def index\n if fixer_signed_in?\n @problems = Problem.all\n else user_signed_in?\n @problems = current_user.problems\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @problems }\n end\n end",
"title": ""
},
{
"docid": "463c5d569cfebe8961f590613cb4b3a9",
"score": "0.58582145",
"text": "def show\n @problem = Problem.find(params[:id])\n respond_with(@problem)\n\n end",
"title": ""
},
{
"docid": "a35f6304fbc22fee0e33d74c7fc99186",
"score": "0.58378404",
"text": "def index\n @vm_problems = VmProblem.all\n end",
"title": ""
},
{
"docid": "2b43253f67a8fec373918be4f2cc3ae2",
"score": "0.58286035",
"text": "def show\n @problem_type = ProblemType.find(params[:id])\n @problems = Problem.\n find(:all,\n :from => \"problems p\",\n :select => \"p.*, u.login as login, count(s.id) as solution_count, \"+\n \"sum(s.correct) as correct_count\",\n :joins => \"join contests c on c.id = p.contest_id \" +\n \"left join users u on p.user_id = u.id \" +\n \"left join solutions s on p.id = s.problem_id \",\n :order => \"contest_id, created_at\",\n :conditions => ['c.start < NOW() and p.problem_type_id = ? ', @problem_type.id],\n :group => \"p.id\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem_type }\n end\n end",
"title": ""
},
{
"docid": "83b9fff2a68cf373952a3a37ae18cb52",
"score": "0.58267105",
"text": "def index\n @difficulties = Difficulty.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @difficulties }\n end\n end",
"title": ""
},
{
"docid": "c8f5e6f9139118a6d0dc6f51f6a6198e",
"score": "0.5816258",
"text": "def index\n @problems = Problem.all.order(:title)\n end",
"title": ""
},
{
"docid": "41b5a54360422f3d391644aedfb620b6",
"score": "0.5798318",
"text": "def index\n if params[:problem_id]\n @server_problems = ServerProblem.paginate(page: params[:page], per_page: 5).order('updated_at DESC').find_all_by_problem_id(params[:problem_id])\n elsif params[:server_id]\n @server_problems = ServerProblem.paginate(page: params[:page], per_page: 5).order('updated_at DESC').find_all_by_server_id(params[:server_id])\n else\n @server_problems = ServerProblem.accessible_by(current_ability).paginate(page: params[:page], per_page: 5).order('updated_at DESC')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "3373ab5b274257502ae253082db4d6ec",
"score": "0.5782192",
"text": "def show\n @problem_state = ProblemState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @problem_state }\n end\n end",
"title": ""
},
{
"docid": "f139cc8ecee7339cbc98670c1cc1291c",
"score": "0.5772729",
"text": "def new\n @problem = @idea.problems.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": "7fa1a33a2e4b600db6641e4fc5c6e6cf",
"score": "0.5754005",
"text": "def index\n @problem_tags = ProblemTag.all\n end",
"title": ""
},
{
"docid": "bfd1c69f9404299ed4ddc0980a30ab4a",
"score": "0.57502997",
"text": "def index\n @problems = Problem.all\n\t \n\t search_setup\n\t gmaps_setup\n\t \n end",
"title": ""
},
{
"docid": "674d18b2415d115ac4cee5ff6274f37e",
"score": "0.57489765",
"text": "def new\n @problem_type = ProblemType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @problem_type }\n end\n end",
"title": ""
},
{
"docid": "4696738e2e83112f3b34367bb699507c",
"score": "0.57297343",
"text": "def index\n @healthproblems = Healthproblem.all\n end",
"title": ""
},
{
"docid": "79b1cb86f8a1d113fafec60aee785051",
"score": "0.5720355",
"text": "def index\n @code_problems = current_user.code_problems\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @code_problems }\n end\n end",
"title": ""
},
{
"docid": "b541bda525401e02908d3d55381a0db0",
"score": "0.5713322",
"text": "def problem\n @problem = Problem.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "6429361d6eee80c4fe8d67df9e2c6bd1",
"score": "0.5696857",
"text": "def index\n @problems = Problem.all\n if params[:search]\n @search_term = params[:search]\n @problems = @problems.search_by(@search_term)\n end\n end",
"title": ""
},
{
"docid": "e6ea88aba497f4870bfacd0b67b5f1dd",
"score": "0.56838894",
"text": "def problems\n @problems ||= []\n end",
"title": ""
},
{
"docid": "1bd53c2bab5be786008b250b3cb6d1fa",
"score": "0.5674277",
"text": "def index\n @problems = Problem.where(:opened => true)\n end",
"title": ""
},
{
"docid": "6b56b2c8263eba94ae744da4fe02c1d2",
"score": "0.567363",
"text": "def new\n @pacient_problem = PacientProblem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pacient_problem }\n end\n end",
"title": ""
},
{
"docid": "c4d021ff9dfe0db590a546654693052e",
"score": "0.5669243",
"text": "def index\n @teaching_problems = TeachingProblem.where(:sloved => false).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teaching_problems }\n end\n end",
"title": ""
},
{
"docid": "7ddaf7afa481683d6f80a73cb0cb745c",
"score": "0.5666898",
"text": "def index\n @solutions = Solution.all\n id = :problem_id\n @problem = Problem.find(params[id])\n end",
"title": ""
},
{
"docid": "ffe262576a33030ecddf8508a913a6df",
"score": "0.5666893",
"text": "def index\n @problem_sets = ProblemSet.all\n end",
"title": ""
},
{
"docid": "3cfe94579c033928c6a984718273bb31",
"score": "0.5656949",
"text": "def show\n @problem_type = ProblemType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @problem_type }\n end\n end",
"title": ""
},
{
"docid": "73ce1dc725c8c27fef7914dee4825fe2",
"score": "0.56549126",
"text": "def show\n @teaching_problem = TeachingProblem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @teaching_problem }\n end\n end",
"title": ""
},
{
"docid": "7d58ba2c153d5511c98470a1babc4b91",
"score": "0.56527334",
"text": "def index\n @search_problems = SearchProblem.all\n end",
"title": ""
},
{
"docid": "45e41b4f2453800d1ad25c40c4a06f43",
"score": "0.56367123",
"text": "def new\n @problem_severity = ProblemSeverity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @problem_severity }\n end\n end",
"title": ""
},
{
"docid": "98986cac1a4f64cead8f09ae21019ed8",
"score": "0.56332153",
"text": "def index\n @problem = Problem.find(params[:problem_id])\n @solutions = @problem.solutions.order('id DESC')\n end",
"title": ""
},
{
"docid": "764d4088791a22b1c30b03415edf589d",
"score": "0.5619785",
"text": "def index\n @bugs = Bug.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bugs }\n end\n end",
"title": ""
},
{
"docid": "2929b98dad9fe54b506d7347fbae5319",
"score": "0.55956537",
"text": "def index\n @user = @current_user\n @problems = @user.available_problems\n\n if params[:problem_id]==nil\n @problem = nil\n @submissions = nil\n else\n @problem = Problem.find_by_id(params[:problem_id])\n if (@problem == nil) or (not @problem.available)\n redirect_to list_main_path\n flash[:error] = 'Authorization error: You have no right to view submissions for this problem'\n return\n end\n @submissions = Submission.find_all_by_user_problem(@user.id, @problem.id).order(id: :desc)\n end\n end",
"title": ""
},
{
"docid": "57cd1198af18fef255f8042ecac28cb7",
"score": "0.55885863",
"text": "def new\n @problem_link = ProblemLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @problem_link }\n end\n end",
"title": ""
},
{
"docid": "f2386fc99d9218f61de421fb219f6731",
"score": "0.55753493",
"text": "def fetch_problems\n @problems << Ca::H1Problem.new unless @text.one_h1?\n @problems << Ca::MetaDescriptionProblem.new if @text.empty_meta_description?\n @problems << Ca::MetaKeywordsProblem.new if @text.empty_meta_keywords?\n @problems << Ca::TitleProblem.new if @text.empty_title?\n end",
"title": ""
},
{
"docid": "1011372560ebdddb911c3e8ed56cf518",
"score": "0.55511355",
"text": "def show\n @problem = Problem.find_by_id(params[:id])\n if @problem.nil? \n redirect_to :problems, \n :flash => { :error => \"No such problem.\" }\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problem }\n end\n end\n end",
"title": ""
},
{
"docid": "9da1b4c9c88b5fc81cfc2e8484599db1",
"score": "0.5544521",
"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.5544521",
"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.5544521",
"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.5544521",
"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.5544521",
"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": "ad8f84074887564966f941305aad3339",
"score": "0.55316037",
"text": "def index\n @help_requests = HelpRequest.unresolved.includes(:user)\n end",
"title": ""
},
{
"docid": "a52668335df3d87c1f31712fe7b58c17",
"score": "0.5531099",
"text": "def index\n params[:tag_id] ?\n @problems = Problem.problems_by_tag(Tag.find(params[:tag_id])).paginate(page: params[:page], per_page: 5).order('updated_at DESC') :\n params[:solution_id] ?\n @problems = Problem.problems_by_solution(Solution.find(params[:solution_id])).paginate(page: params[:page], per_page: 5).order('updated_at DESC') :\n @problems = Problem.accessible_by(current_ability).paginate(page: params[:page], per_page: 5).order('updated_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.js\n end\n end",
"title": ""
},
{
"docid": "2299c877960aba54218ed24eb2e12761",
"score": "0.55234605",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @issue }\n end\n end",
"title": ""
},
{
"docid": "482f3c440e89ab0d1ae45dd41b1073e4",
"score": "0.5512285",
"text": "def index\n @exam = Exam.find(params[:exam_id])\n @questions = @exam.question\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end",
"title": ""
}
] |
5a841c0ec852d9b5e334a3cba2e22b7d
|
POST /disposisi POST /disposisi.json
|
[
{
"docid": "661c62e95a2528d1af685e0b81c909cf",
"score": "0.73116666",
"text": "def create\n @disposisi = Disposisi.new(disposisi_params)\n\n respond_to do |format|\n if @disposisi.save\n format.html { redirect_to @disposisi, notice: 'Disposisi was successfully created.' }\n format.json { render :show, status: :created, location: @disposisi }\n else\n format.html { render :new }\n format.json { render json: @disposisi.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "5066927db750bc24f76a86052903d6d3",
"score": "0.65699816",
"text": "def disposisi_params\n params.fetch(:disposisi, {})\n end",
"title": ""
},
{
"docid": "f35496e155268830450d9c3b241ad839",
"score": "0.634217",
"text": "def create\n response = ApiPago.crear_factura(params[:id_oc])\n render json: response\n end",
"title": ""
},
{
"docid": "823cab2fe6d78dee669340d76416f0f5",
"score": "0.6311398",
"text": "def create\n @displasium = Displasium.new(params[:displasium])\n\n respond_to do |format|\n if @displasium.save\n format.html { redirect_to @displasium, notice: 'Displasium was successfully created.' }\n format.json { render json: @displasium, status: :created, location: @displasium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @displasium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d4c75fb6ee4e7ddf60d2cdc4baf2dc2",
"score": "0.6292299",
"text": "def new\n @displasium = Displasium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @displasium }\n end\n end",
"title": ""
},
{
"docid": "8cd2e8979301b66537489a97c9dd8b15",
"score": "0.62070084",
"text": "def create\n @disponibilidade = Disponibilidade.new(disponibilidade_params)\n @medico = Medico.find(disponibilidade_params[:medico_id])\n\n respond_to do |format|\n if @disponibilidade.save\n format.html { redirect_to @medico, notice: 'Disponibilidade was successfully created.' }\n format.json { render :show, status: :created, location: @disponibilidade }\n else\n format.html { redirect_to @medico, notice: 'Disponibilidade incompleta' }\n format.json { render json: @disponibilidade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7546bc71c58c65458fd9a34d2d7cf2b5",
"score": "0.61710364",
"text": "def new\n @datos_significativo = DatosSignificativo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datos_significativo }\n end\n end",
"title": ""
},
{
"docid": "1832026be872be10f379d37422764b15",
"score": "0.61506516",
"text": "def set_disposisi\n @disposisi = Disposisi.find(params[:id])\n end",
"title": ""
},
{
"docid": "c9cca96f86795863356ece586c086bef",
"score": "0.61279446",
"text": "def create\n @registro_dispositivo = Registro::Dispositivo.new(registro_dispositivo_params)\n\n respond_to do |format|\n if @registro_dispositivo.save\n format.html { redirect_to @registro_dispositivo, notice: 'Dispositivo was successfully created.' }\n format.json { render :show, status: :created, location: @registro_dispositivo }\n else\n format.html { render :new }\n format.json { render json: @registro_dispositivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e065d35309d14b607f9e883d2eeea982",
"score": "0.6118178",
"text": "def dame_institucion\n i = Metamares::Institucion.new\n i.nombre_institucion = params[:nombre_institucion]\n\n respond_to do |format|\n format.json { render json: i.busca_institucion.map{ |i| { id: i.id, value: i.nombre_institucion } } }\n format.html { @institucion = i }\n end\n end",
"title": ""
},
{
"docid": "8fd6e7cff9fff1000bf7510d28093b1f",
"score": "0.60811913",
"text": "def create\n @dispositon = Dispositon.new(dispositon_params)\n\n respond_to do |format|\n if @dispositon.save\n format.html { redirect_to @dispositon, notice: 'Dispositon was successfully created.' }\n format.json { render :show, status: :created, location: @dispositon }\n else\n format.html { render :new }\n format.json { render json: @dispositon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "449622db410c3982567590087d581ab5",
"score": "0.60647124",
"text": "def create\n @repuesto_servicio = RepuestoServicio.new(repuesto_servicio_params)\n\n respond_to do |format|\n if @repuesto_servicio.save\n format.html { redirect_to repuesto_servicios_path, notice: 'Repuesto o Servicio fue creado con éxito.' }\n format.json { render :index, status: :created, location: @repuesto_servicio }\n else\n format.html { render :new }\n format.json { render json: @repuesto_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d3c121898063588cc63aa38ca3ba0ca",
"score": "0.5988956",
"text": "def index\n @disposisi = Disposisi.all\n end",
"title": ""
},
{
"docid": "ed83b682ae295803f6c9c8b6038dc08b",
"score": "0.59755826",
"text": "def create\n @disponibilite = Disponibilite.new(disponibilite_params)\n\n respond_to do |format|\n if @disponibilite.save\n format.html { redirect_to @disponibilite, notice: 'Disponibilité créée avec succés.' }\n format.json { render :show, status: :created, location: @disponibilite }\n else\n format.html { render :new }\n format.json { render json: @disponibilite.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2209a753fd5123e91e3035d7833e86a2",
"score": "0.5972488",
"text": "def create\n @produtos = get_produtos\n \n @compra = Compra.new(compra_params)\n @compra.data = Date.today\n @compra.hora = Time.now.strftime(\"%H:%M:%S\")\n @compra.valor_total = params[:compra][:valor_total].to_f\n @compra.status = \"Solicitado\"\n\n respond_to do |format|\n if @compra.save\n @produtos.each do |produto|\n ItensCompra.create(compra_id: @compra.id, produto_id: produto[:produto][:id], valor: produto[:produto][:preco],quantidade: produto[:qtde])\n end\n format.html { redirect_to @compra, notice: 'Compra efetuada com sucesso.' }\n format.json { render :show, status: :created, location: @compra }\n else\n format.html { render :new }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51a9dd9d8006c48e9862d2f402dbb871",
"score": "0.59695315",
"text": "def create\n @detalle_curso = DetalleCurso.new(detalle_curso_params)\n\n respond_to do |format|\n if @detalle_curso.save\n format.html { redirect_to @detalle_curso, notice: 'Detalle curso was successfully created.' }\n format.json { render :show, status: :created, location: @detalle_curso }\n else\n format.html { render :new }\n format.json { render json: @detalle_curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64d00fa94f8a679d7dc1810153a3d149",
"score": "0.59563416",
"text": "def nuevo\n if params[:caso_id].nil?\n respond_to do |format|\n format.html { render inline: 'Falta identificacion del caso' }\n end\n elsif Sip::Ubicacion.where(id_caso: params[:caso_id].to_i).count < 2\n respond_to do |format|\n format.html { render inline: 'Debe tener al menos 2 ubicaciones' }\n end\n else\n @desplazamiento = Sivel2Sjr::Desplazamiento.new\n cid = params[:caso_id].to_i\n @desplazamiento.id_caso = cid\n fex = Sivel2Gen::Caso.find(cid).fecha\n while (Sivel2Sjr::Desplazamiento.where(id_caso: cid, \n fechaexpulsion: fex.to_s).count > 0) do\n fex += 1\n end\n @desplazamiento.fechaexpulsion = fex\n @desplazamiento.id_expulsion = Sip::Ubicacion.where(id_caso: cid).last.id\n @desplazamiento.fechallegada = fex+1\n @desplazamiento.id_llegada = Sip::Ubicacion.where(\n id_caso: cid).first.id\n @desplazamiento.descripcion = ''\n if @desplazamiento.save\n h=@desplazamiento.as_json\n h['desplazamiento'] = @desplazamiento.id\n respond_to do |format|\n format.js { render text: h }\n format.json { render json: h, status: :created }\n format.html { render inline: h.to_s }\n end\n else\n respond_to do |format|\n format.html { render action: \"error\" }\n format.json { \n render json: @desplazamiento.errors, \n status: :unprocessable_entity\n }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f73ccb254910b2837edfc037bae393d9",
"score": "0.5946414",
"text": "def new\n @resposta = Resposta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resposta }\n end\n end",
"title": ""
},
{
"docid": "0598d6bbfb7294530de9866f895fb7da",
"score": "0.59182775",
"text": "def create\n @extra_disponible = ExtraDisponible.new(params[:extra_disponible])\n\n respond_to do |format|\n if @extra_disponible.save\n format.html { redirect_to @extra_disponible, notice: 'Extra disponible was successfully created.' }\n format.json { render json: @extra_disponible, status: :created, location: @extra_disponible }\n else\n format.html { render action: \"new\" }\n format.json { render json: @extra_disponible.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "830ab9cffd4e61aaa328b639e23d9a1b",
"score": "0.5917012",
"text": "def new\n @servico = Servico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "830ab9cffd4e61aaa328b639e23d9a1b",
"score": "0.591674",
"text": "def new\n @servico = Servico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "5f88ff5a8442ab2941483e7ad5a48d51",
"score": "0.59067976",
"text": "def create\n #@product_s = Product.order(\"stocka asc\")\n @dispenser = Dispenser.new(params[:dispenser])\n\n respond_to do |format|\n if @dispenser.save\n format.html { redirect_to @dispenser, notice: 'Dispenser was successfully created.' }\n format.json { render json: @dispenser, status: :created, location: @dispenser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dispenser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "702745b9ba1d922dae4782ec20eaa292",
"score": "0.5905735",
"text": "def create\n @respostaaluno = Respostaaluno.new(respostaaluno_params)\n\n respond_to do |format|\n if @respostaaluno.save\n format.html { redirect_to @respostaaluno, notice: 'Respostaaluno was successfully created.' }\n format.json { render :show, status: :created, location: @respostaaluno }\n else\n format.html { render :new }\n format.json { render json: @respostaaluno.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "812d911af36fe6f3f621f91cf63041b5",
"score": "0.59044206",
"text": "def new\n @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @precio }\n end\n end",
"title": ""
},
{
"docid": "e2d81a09c12fee9514dc8ed128151761",
"score": "0.59040827",
"text": "def create\n @preco_servico = PrecoServico.new(preco_servico_params) \n session[:preco_params] = preco_servico_params\n session[:preco_params][:produto] = \"\"\n\n respond_to do |format|\n if @preco_servico.save \n get_parametros_preco\n format.html { redirect_to preco_servicos_path, :id => \"\" } \n format.json { render action: 'index', status: :created, location: @preco_servico }\n else\n format.html { render action: 'new' }\n format.json { render json: @preco_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dbab898c9e6038b92d53fd1c965a2872",
"score": "0.5901723",
"text": "def update\n respond_to do |format|\n if @disposisi.update(disposisi_params)\n format.html { redirect_to @disposisi, notice: 'Disposisi was successfully updated.' }\n format.json { render :show, status: :ok, location: @disposisi }\n else\n format.html { render :edit }\n format.json { render json: @disposisi.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70a0b1c44b3ecec5d71efdca36e97da4",
"score": "0.5899373",
"text": "def create\n @climatizador = Climatizador.new(climatizador_params)\n\n respond_to do |format|\n if @climatizador.save\n\n @data = Time.at(@climatizador[:created_at]).to_datetime\n @data_str = \"\\\"data\\\":\" << \"\\\"\" << @data.utc.strftime('%m/%d/%Y %H:%M %p') << \"\\\"\"\n @temperatura_str = \"\\\"temperatura\\\":\" << @climatizador[:temperatura].to_s\n @novo_registro = \"{\" << @data_str << \",\" << @temperatura_str << \"}\"\n \n @climatizador[:historico] << @novo_registro\n @climatizador.save\n\n format.html { redirect_to @climatizador, notice: 'Climatizador was successfully created.' }\n format.json { render :show, status: :created, location: @climatizador }\n else\n format.html { render :new }\n format.json { render json: @climatizador.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bb7e07d64e5f3bb85cb43615eb4718b",
"score": "0.58986247",
"text": "def new\n @disponibilite = Disponibilite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @disponibilite }\n end\n end",
"title": ""
},
{
"docid": "2183c477d97a30488e0ead6954af44ba",
"score": "0.589751",
"text": "def create\n @disponibilidad = Disponibilidad.new(disponibilidad_params)\n\n respond_to do |format|\n if @disponibilidad.save\n format.html { redirect_to \"/disponibilidads/new\", notice: 'Disponibilidad creada con éxito.' }\n else\n format.html { render :new }\n format.json { render json: @disponibilidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aac300e19d5f49a396968785712be5b0",
"score": "0.5881425",
"text": "def nuevo\n if params[:caso_id].nil?\n respond_to do |format|\n format.html { render inline: 'Falta identificacion del caso' }\n end\n else\n @respuesta = Respuesta.new\n cid = params[:caso_id].to_i\n @respuesta.id_caso = cid\n @caso = @respuesta.caso\n @caso.current_usuario = current_usuario\n @respuesta.detallear = ''\n if @respuesta.respond_to? :montoar\n @respuesta.montoar = 0\n end\n # Los siguientes están en sjrven pero no en sjrcol\n if @respuesta.respond_to? :detalleal\n @respuesta.detalleal = ''\n end\n if @respuesta.respond_to? :detalleap\n @respuesta.detalleap = ''\n end\n if @respuesta.respond_to? :detalleem\n @respuesta.detalleem = ''\n end\n # Los siguientes en sjrcol pero no en sjrven\n @respuesta.institucionayes = ''\n if @respuesta.respond_to? :cantidadayes\n @respuesta.cantidadayes = 0\n end\n @respuesta.accionesder = ''\n @respuesta.detallemotivo = ''\n @respuesta.difobsprog = ''\n fex = Sivel2Sjr::Casosjr.find(cid).fecharec\n if (Respuesta.where(id_caso: cid).count > 0) \n fex = Date.today\n end\n # \n while (Respuesta.where(id_caso: cid, fechaatencion: fex.to_s).count > 0) do\n fex += 1\n end\n @respuesta.fechaatencion = fex\n if @respuesta.save\n h=@respuesta.as_json\n h['respuesta'] = @respuesta.id\n respond_to do |format|\n format.js { render text: h }\n format.json { render json: h, status: :created }\n format.html { render inline: h.to_s }\n end\n else\n respond_to do |format|\n format.html { render action: \"error\" }\n format.json { \n render json: @respuesta.errors, \n status: :unprocessable_entity\n }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "26b4d001b412eec16b2392e9fb46d48c",
"score": "0.5881262",
"text": "def new\n @dispatch_io = DispatchIo.new\n @charging_orders = ChargingOrder.all.map { |co| [co.id, co.id] }\n @total_despachos = DispatchIo.count(:id)+1\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dispatch_io }\n end\n end",
"title": ""
},
{
"docid": "f22dd473f434187333a7095d9bd933a1",
"score": "0.58727086",
"text": "def create\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.new(params[:contato])\n\n respond_to do |format|\n if @contato.save\n format.html { redirect_to @contato, notice: 'Contato enviado com sucesso' }\n format.json { render json: @contato, status: :created, location: @contato }\n else\n format.html { render action: \"new\" }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1774b4ca81ddb0bd0a1d46fed3953790",
"score": "0.58498716",
"text": "def create\n @factura = Factura.new(factura_params)\n @factura.domiciliada = params[:domiciliada]\n\n\n respond_to do |format|\n if @factura.save\n format.html { redirect_to facturas_path }\n format.json { render action: 'show', status: :created, location: @factura }\n else\n format.html { render action: 'new' }\n format.json { render json: @factura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7e007f1b30ae9af1c24a0492f4124db",
"score": "0.5848549",
"text": "def new_ingresos\n @factura = Factura.new\n @factura.concepto.build\n \n @nombreEmpresa = Empresa.find :all, :conditions => [\"id = ?\",current_usuario.empresa_id] \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @factura }\n end\n end",
"title": ""
},
{
"docid": "bfd55901122c4af1ce6a3a00916ba1cc",
"score": "0.5844464",
"text": "def create\n @resposta = Resposta.new(params[:resposta])\n\n respond_to do |format|\n if @resposta.save\n format.html { redirect_to @resposta, notice: 'Resposta was successfully created.' }\n format.json { render json: @resposta, status: :created, location: @resposta }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resposta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea4f3bc82cbe22ab46451ffce5bfea29",
"score": "0.58254194",
"text": "def new\n @oficio = Oficio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @oficio }\n end\n end",
"title": ""
},
{
"docid": "e5e45ddc563af64cd863b97d903d7824",
"score": "0.58149695",
"text": "def my_requests\n name = params[:name].downcase!\n detail = []\n (Ufvaluerequest.where(client: name)).each do |consult|\n hash1 = {}\n hash1[:requestedDate] = consult.requestedDate\n hash1[:ufvalue] = consult.ufvalue\n hash1[:created_at] = consult.created_at\n detail.push(hash1)\n end\n hash = {\"Cantidad de consultas\": \"#{Ufvaluerequest.where(client: name).count}\", \"Detalle de consultas\": \"#{detail}\"}\n render json: hash\n end",
"title": ""
},
{
"docid": "3c8e3507c6f375605ca0110e0b1f9e9c",
"score": "0.5798091",
"text": "def new\n @compra = Compra.new(:fecha => Date.today)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compra }\n end\n end",
"title": ""
},
{
"docid": "10a3043071d9fb761b0844c7b4506a34",
"score": "0.579743",
"text": "def new\n @dispenser = Dispenser.new\n @product_s = Product.order(\"stocka asc\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dispenser }\n end\n end",
"title": ""
},
{
"docid": "4c7e45ea18f64ede7d86d3c30b072c9b",
"score": "0.57902455",
"text": "def create\n @objeto = Observacion.new(observacion_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Observacion was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e14b1587aee92d86529fd702db3f96c",
"score": "0.57901704",
"text": "def new\n @receitum = Receitum.new\n @contum = Contum.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @receitum }\n end\n end",
"title": ""
},
{
"docid": "c85e32cb25ada89f2f11b7a51769ca69",
"score": "0.5784209",
"text": "def create\n @dispositivo = Dispositivo.new(dispositivo_params)\n @dispositivo.user_id = current_user.id\n\n respond_to do |format|\n if @dispositivo.save\n format.html { redirect_to @dispositivo, notice: 'Dispositivo was successfully created.' }\n format.json { render :show, status: :created, location: @dispositivo }\n else\n format.html { render :new }\n format.json { render json: @dispositivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a7e921f75f4b1bb8d08fb32cb5ebfe3",
"score": "0.5782045",
"text": "def create\n @icfes_registro = IcfesRegistro.new(icfes_registro_params)\n\n respond_to do |format|\n if @icfes_registro.save\n format.html { redirect_to @icfes_registro, notice: 'Icfes registro fue creado con éxito.' }\n format.json { render :show, status: :created, location: @icfes_registro }\n else\n format.html { render :new }\n format.json { render json: @icfes_registro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6bd54783685b5c7c2370dab1f3f06b2",
"score": "0.57755315",
"text": "def new\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contato }\n end\n end",
"title": ""
},
{
"docid": "83223d2f6509f148fdee0a0637d0aabc",
"score": "0.5770435",
"text": "def form\n @tokoid = params[:tokoid]\n @agen = []\n @agen << Toko.find(@tokoid).agen1\n @agen << Toko.find(@tokoid).agen2\n @agen << Toko.find(@tokoid).agen3\n @agen << Toko.find(@tokoid).agen4\n @agen << Toko.find(@tokoid).agen5\n @agen << Toko.find(@tokoid).agen6\n @agen << Toko.find(@tokoid).agen7\n if params[:asal]\n @tujuan = Alamat.find(params[:tujuan]).kabupaten\n ongkir = RestClient.post 'http://pro.rajaongkir.com/api/cost', :originType => 'city', :destinationType => 'city', :origin => params[:asal], :destination => @tujuan, :weight => 1000, :courier => 'jne:tiki:pos', :key => '45c5c245f49664fcd38a86f3c24f7763'\n @ongkir = JSON.parse ongkir\n @all = @ongkir['rajaongkir']['results']\n @count = @ongkir['rajaongkir']['results'][0]['costs'].count\n end\n @produk = Produk.find(params[:produk])\n respond_to do |format|\n format.js { render :file => \"/produks/show.js.erb\" }\n end\n end",
"title": ""
},
{
"docid": "e2cadca831187a789dbdc505d8b2e840",
"score": "0.5769789",
"text": "def new #DESC: Agregar un nuevo registro de contratos.\n @historico_interno = HistoricoInterno.new\n @historico_interno.usuario_id = params[:usuario_id]\n @historico_interno.cargo_id = params[:cargo_id]\n \n respond_to do |format|\n format.js { render :layout => false}\n format.xml { render :xml => @historico_interno }\n end\n end",
"title": ""
},
{
"docid": "1e5fb7a6d76378a05179676b7c410614",
"score": "0.5764268",
"text": "def new\n @ubicacion_detail = UbicacionDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ubicacion_detail }\n end\n end",
"title": ""
},
{
"docid": "9db8ef5ab7e14d5ad013fa38969869fe",
"score": "0.5763604",
"text": "def create\n params.permit(:intituleChoix, :question_id)\n ajout = ChoixService.instance.creerNouveauChoix(params[:intituleChoix], params[:question_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end",
"title": ""
},
{
"docid": "e9e16996ab7e318ade4320453f63da66",
"score": "0.5761695",
"text": "def new\n @esclerosi = Esclerosi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @esclerosi }\n end\n end",
"title": ""
},
{
"docid": "3f772c5053b8941b86282e3c81f0a6e7",
"score": "0.5759179",
"text": "def create\n @safra_impureza = SafraImpureza.new(params[:safra_impureza])\n\n respond_to do |format|\n if @safra_impureza.save\n format.html { redirect_to \"/safra_produtos/#{@safra_impureza.safra_produto_id}/descontos\"}\n format.json { render json: @safra_impureza, status: :created, location: @safra_impureza }\n else\n format.html { render action: \"new\" }\n format.json { render json: @safra_impureza.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bb6cb060e22944c718636c5afd8dcc5",
"score": "0.5756674",
"text": "def create\n @datos_significativo = DatosSignificativo.new(params[:datos_significativo])\n\n respond_to do |format|\n if @datos_significativo.save\n format.html { redirect_to @datos_significativo, notice: 'Datos significativo was successfully created.' }\n format.json { render json: @datos_significativo, status: :created, location: @datos_significativo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @datos_significativo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "203cd97f86f48fdb7e57e5a8f971f57e",
"score": "0.57499474",
"text": "def new\n @detalle_movimiento_stock = DetalleMovimientoStock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @detalle_movimiento_stock }\n end\n end",
"title": ""
},
{
"docid": "50f58b11441da50e4f6a46264dfe1344",
"score": "0.57371634",
"text": "def citascentro\n @citascetro = Citas.where(centros_medicos_id: params[:centros_medicos_id]).where(fecha: Date.today)\n render json: @citascetro.as_json(include: [:pacientes ,:centros_medicos, :doctores])\n end",
"title": ""
},
{
"docid": "d9edb0014b4e8573465db1d296477fbb",
"score": "0.5733925",
"text": "def create\n item_exists = false\n item_id = params[:detalle_compra][:repuesto_servicio_id].to_i\n @compra.detalle_compras.each do |detail|\n if detail.repuesto_servicio_id == item_id\n # Ya existe el item en la factura, agregar cantidad\n item_exists = true\n @detalle_compra = detail\n @saved_sale_detail = detail.id\n break\n end\n end\n if item_exists\n @detalle_compra.cantidad += params[:detalle_compra][:cantidad].to_i\n @detalle_compra.precio_unitario= params[:detalle_compra][:precio_unitario].to_f\n @detalle_compra.save!\n else\n detalle_compra = DetalleCompra.new(detalle_compra_params)\n @compra.detalle_compras << detalle_compra\n end\n\n respond_to do |format|\n \n if @compra.save\n format.html {redirect_to @compra, notice: 'El detalle se agregó correctamente.'}\n format.json {render :show, status: :created, location: @detalle_compra}\n else\n format.html {render :new}\n format.json {render json: @detalle_compra.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "293560d25dd736d2f814449098a5f7e1",
"score": "0.57323575",
"text": "def new\n @servico = Servico.new\n @categorias = Category.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "c8f13a9a2563077947584689d5960175",
"score": "0.57307345",
"text": "def new\n @requerim = Requerim.new\n @solicitud_id = params[:ns]\n @requerim.solicitud_id = params[:ns]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requerim }\n end\n end",
"title": ""
},
{
"docid": "5e8dd34cc3a8b93744fe976defc98995",
"score": "0.5727736",
"text": "def new\n @status_del_examinado_psico = StatusDelExaminadoPsico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_del_examinado_psico }\n end\n end",
"title": ""
},
{
"docid": "f9a8a6ca241d9f9ab8f4b2e1c3bfbcb1",
"score": "0.57248724",
"text": "def create\n @opcion = Opcion.new(params[:opcion])\n\n if @opcion.save\n render json: @opcion, status: :created, location: @opcion\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "281edec7035e02be6a1abf2d5cf6152f",
"score": "0.57242996",
"text": "def new\n @orden_servicio = OrdenServicio.new\n @activos = Activo.all\n @activo = Activo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orden_servicio }\n end\n end",
"title": ""
},
{
"docid": "52842e81d2fd2f6c64bd053cca46f714",
"score": "0.57171375",
"text": "def new\n @ativo_circulante_financeiro = AtivoCirculanteFinanceiro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ativo_circulante_financeiro }\n end\n end",
"title": ""
},
{
"docid": "825110ae01794b7c4fedb8bf3960d3f0",
"score": "0.5716507",
"text": "def new\n\n # Borra Todas las notas antiguas e inservibles\n # SELETE FROM `notas` WHERE (resumen_id IS NULL AND created_at <= 'Hoy')\n # Nota.delete_all ([\"resumen_id IS ? AND created_at <= ?\", nil, Date.today])\n \n @resumenes = Resumen.creados_hoy.order(\"vocero_id DESC\")\n temas = Tema.joins(:resumenes).where('resumenes.created_at >= ?', Date.today)\n # @websites = Website.all\n @asuntos = Asunto.joins(:temas).where('temas.id' => temas).group(:id)\n \n @informe = Informe.new\n @informe.save\n if @resumenes\n @resumenes.each do |resumen|\n resumen.informe_id = @informe.id\n resumen.save\n end\n end\n # @informe.resumen = encabezado\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @informe }\n end\n end",
"title": ""
},
{
"docid": "77b763bb7fa99a0c828e9f104b767333",
"score": "0.5714092",
"text": "def create\n @citum = Citum.new(citum_params)\n\n respond_to do |format|\n if @citum.save\n format.html { redirect_to @citum, notice: 'Cita fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @citum }\n else\n format.html { render :new }\n format.json { render json: @citum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f46a44fd595d48878fa617302f343f7f",
"score": "0.5702814",
"text": "def conv\n cni = params[:cni]\n phone = params[:phone]\n immatriculation = params[:immatriculation]\n motif = params[:motif]\n pieceretenue = params[:pieceretenue]\n agent = params[:agent]\n status = \"impaye\"\n code = SecureRandom.hex(3)\n\n\n #il faudra verifier si l'utilisateur et son téléphone sont authorisé et sont programmés\n\n #a = Convocation.new(cni: params[:cni], phone: params[:phone], infraction_id: params[:motif], pieceretenu_id: params[:pieceretenue], agent_id: params[:agent], immatriculation: params[:immatriculation], status: \"impayé\")\n a = Convocation.new(infraction_params)\n if a.save\n #message = \"Le numero de telephone #{a.phone} ou le code #{a.code} est verbalise pour le(s) motif(s) ci-apres : #{a.infraction.motif}. Le montant de l amende est de : #{a.infraction.montant} F CFA.\"\n #HTTParty.get(\"https://www.agis-as.com/epolice/index.php?telephone=#{a.phone}&message=#{message}\")\n #c'est ok, on envoi le SMS\n render json: {\n status: :save,\n message: :created,\n is_paiement_set?: Modepaiement.where(status: 1).count,\n modepaiement: Modepaiement.where(status: 1).map do |d|\n {\n data: d.name\n }\n end\n }\n else\n render json: {\n status: :unprocessable_entity,\n data: a.errors.messages\n }.to_json \n end\n end",
"title": ""
},
{
"docid": "00c29d1a4679443b7d9aa13ae9a5aa84",
"score": "0.5695703",
"text": "def create\n #byebug\n @recip = Recip.new(recip_params)\n\n if @recip.save\n render json: @recip, status: :created, location: @recip\n else\n render json: @recip.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d5b118c3da47e7e87a906f71b69ecb84",
"score": "0.56955457",
"text": "def create\n\n h = {fecha: Date.today, \n cuerpo: params[:body], \n bajada: params[:subtitle], \n titular: params[:title]\n }\n\n @noticium = Noticium.new(h)\n\n \n if @noticium.save\n res = {id: @noticium.id,\n title: @noticium.titular,\n subtitle: @noticium.bajada, \n body: @noticium.cuerpo,\n created_at: @noticium.fecha\n }\n render json: res, status: :created\n end\n end",
"title": ""
},
{
"docid": "d941b855d1abaca3e3ac71e0f9599893",
"score": "0.56953925",
"text": "def new\n @punto_servicio = PuntoServicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punto_servicio }\n end\n end",
"title": ""
},
{
"docid": "fa6d74725e8a77b49873067225c8e11d",
"score": "0.5695147",
"text": "def create\n @condominios = Condominio.new(params[:condominio])\n\n respond_to do |format|\n if @condominios.save\n format.html { redirect_to @condominios, notice: 'Condominio was successfully created.' }\n format.json { render json: @condominios, status: :created, location: @condominios }\n else\n format.html { render action: \"new\" }\n format.json { render json: @condominios.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5414ad7823a17e603ddb2c04529b8f2c",
"score": "0.569499",
"text": "def create\n @impuesto_unico = ImpuestoUnico.new(impuesto_unico_params)\n\n respond_to do |format|\n if @impuesto_unico.save\n format.html { redirect_to @impuesto_unico, notice: 'Impuesto unico creado exitosamente.' }\n format.json { render :show, status: :created, location: @impuesto_unico }\n else\n format.html { render :new }\n format.json { render json: @impuesto_unico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5e633c977e1c95857c27b889515f3e6",
"score": "0.56916535",
"text": "def create\n # @resumenes = Resumen.creados_hoy.order(\"vocero_id DESC\")\n resumenes_ids = params[:resumenes_ids]\n \n # puts \"RESUMEN: #{resumenes_ids}\"\n @informe = Informe.new(params[:informe])\n\n respond_to do |format|\n if @informe.save\n resumenes_ids.each do |id|\n resumen = Resumen.find id\n if resumen\n resumen.informe_id = @informe.id\n resumen.save\n end\n end\n Website.limpiar_todos_usuarios\n session[:website_selecionada] = nil\n flash[:success] = 'Informe creado Satisfactoriamente.'\n format.html { redirect_to @informe }\n format.json { render json: @informe, status: :created, location: @informe }\n else\n format.html { render action: \"paso5\" }\n format.json { render json: @informe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "367c58190cae547c8b5002ac828c57a9",
"score": "0.56872237",
"text": "def create\n params.permit(:intitule, :estObligatoire, :estUnique, :ordre, :sondage_id)\n ajout = QuestionChoixService.instance.creerQuestionChoix(params[:intitule], params[:estObligatoire], params[:estUnique], params[:ordre], params[:sondage_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end",
"title": ""
},
{
"docid": "f62442a0146570b6d7963054b2f3df45",
"score": "0.56788844",
"text": "def new\n @dispo = Dispo.new\n if params[:day]\n @dispo.jour = params[:day]\n else\n @dispo.jour = Time.current().in_time_zone('Paris')\n end\n\n #@dispos = Array.new(3) { @current_user.dispo.build }\n\n @statuts = Statut.all\n \n @date = params[:day] ? Date.parse(params[:day]) : Time.current().in_time_zone('Paris')\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dispo }\n end\n end",
"title": ""
},
{
"docid": "f62442a0146570b6d7963054b2f3df45",
"score": "0.56788844",
"text": "def new\n @dispo = Dispo.new\n if params[:day]\n @dispo.jour = params[:day]\n else\n @dispo.jour = Time.current().in_time_zone('Paris')\n end\n\n #@dispos = Array.new(3) { @current_user.dispo.build }\n\n @statuts = Statut.all\n \n @date = params[:day] ? Date.parse(params[:day]) : Time.current().in_time_zone('Paris')\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dispo }\n end\n end",
"title": ""
},
{
"docid": "3c50e36e6110aca4860d80d8cdb9e20c",
"score": "0.5678362",
"text": "def new\n @ocupacion = Ocupacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ocupacion }\n end\n end",
"title": ""
},
{
"docid": "2ebc5b87010be65f181d8a0366bd7306",
"score": "0.5677992",
"text": "def create\n @ventum = Ventum.new(ventum_params)\n\n respond_to do |format|\n if @ventum.save\n @carrito.each do |c|\n @articulo = Articulo.create({:venta_id => @ventum.id, :producto_id => c.producto.id, :cantidad => c.cantidad})\n end\n format.html { redirect_to @ventum, notice: 'La venta ha sido guardada con exito' }\n format.json { render action: 'show', status: :created, location: @ventum }\n else\n format.html { render action: 'new' }\n format.json { render json: @ventum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ebef478b7625cfb44fbf4e729954875",
"score": "0.56716985",
"text": "def create\n @onscrit = Onscrit.new(onscrit_params)\n\n respond_to do |format|\n if @onscrit.save\n format.html { redirect_to onscrits_url, notice: {status: 'success', message: 'Création du .onscrit réussie.' }}\n format.json { render action: 'show', status: :created, location: @onscrit }\n else\n format.html { render action: 'new' }\n format.json { render json: @onscrit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc525423cb456b6419bd77dd7663743c",
"score": "0.567069",
"text": "def view_risoluzione\n begin\n id_risoluzione = risoluzioni_corrente_params[:id]\n risoluzione = Soluzione.find(id_risoluzione)\n unless risoluzione.blank?\n @esito = {\n stato: 'ok',\n problematica: risoluzione.problematica,\n testo_soluzione: risoluzione.testo_soluzione,\n tags: (risoluzione.tags.count > 0 ? risoluzione.tags.map{|tag| tag.nome}.join(\", \") : []),\n applicazione: (risoluzione.auth_hub_clienti_applicazione.blank? ? '' : risoluzione.auth_hub_clienti_applicazione.DESCRIZIONE )\n }\n else\n @esito = {\n stato: 'ko',\n errore: \"Risoluzione non presente con id #{id_risoluzione}\"\n }\n end\n rescue => exception\n logger.error exception.message\n logger.error exception.backtrace.join(\"\\n\")\n @esito = {\n stato: 'ko',\n errore: exception.message\n }\n end\n \n respond_to do |format|\n format.json { render json: @esito }\n end\n end",
"title": ""
},
{
"docid": "a8849dfd17d3390e84eacd811c1fa2a9",
"score": "0.56701875",
"text": "def create\n @servico = Servico.new(params[:servico])\n\n respond_to do |format|\n if @servico.save\n format.html { redirect_to @servico, notice: 'Servico was successfully created.' }\n format.json { render json: @servico, status: :created, location: @servico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8849dfd17d3390e84eacd811c1fa2a9",
"score": "0.56701875",
"text": "def create\n @servico = Servico.new(params[:servico])\n\n respond_to do |format|\n if @servico.save\n format.html { redirect_to @servico, notice: 'Servico was successfully created.' }\n format.json { render json: @servico, status: :created, location: @servico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0fde5b6c66ea848ed13350450a62cf0",
"score": "0.5663049",
"text": "def new\n @movimentacao = Movimentacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movimentacao }\n end\n end",
"title": ""
},
{
"docid": "1e45504bcbab2e2eb0a8e6b8acddab71",
"score": "0.5659536",
"text": "def create\n @parceiros = Parceiro.all\n @novidades = Novidade.order('created_at').last(6) \n \n @recado = Recado.new(params[:recado].merge(:usuario_id => current_usuario.id))\n\n respond_to do |format|\n if @recado.save\n format.html { redirect_to @recado, notice: 'Recado cadastrado com sucesso' }\n format.json { render json: @recado, status: :created, location: @recado }\n else\n format.html { render action: \"new\" }\n format.json { render json: @recado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd672daa8108931964e71953a11444c7",
"score": "0.5659282",
"text": "def new\n @valor_ficha = ValorFicha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @valor_ficha }\n end\n end",
"title": ""
},
{
"docid": "715cd8de9f976eba14854cc015273c4a",
"score": "0.56561553",
"text": "def preguntas\n # Buscar por \"seccion='5'\" en la tabla de secciones\n\n categorias = SeccionesListCat.order(\"orden ASC\").where(:seccion => 5, :activo => true)\n\n @result = []\n categorias.each do |categoria|\n @result << {\n \"idCategoria\" => categoria.idcategoria,\n \"nombre\" => categoria.categoriaes,\n \"listadoPreguntas\" => categoria.getListadoPreguntas\n }\n end\n\n respond_to do |format|\n format.json { render json: @result }\n format.xml { render '/app/views/api_mesafijas/preguntas.xml.builder' }\n end\n end",
"title": ""
},
{
"docid": "7f010c455149efc822e42ddfaca08c86",
"score": "0.56541413",
"text": "def new\n @curriculo = Curriculo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @curriculo }\n end\n end",
"title": ""
},
{
"docid": "6da9f3ef74adbf6c457c820c79423361",
"score": "0.56524366",
"text": "def new\n @identificacion = Identificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @identificacion }\n end\n end",
"title": ""
},
{
"docid": "6eb27b762ee5275fb114a5d1d716db53",
"score": "0.5650856",
"text": "def new\n @requisito = Requisito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requisito }\n end\n end",
"title": ""
},
{
"docid": "9d6114e192518d9937f9170b7d6a8fa8",
"score": "0.5648963",
"text": "def notifyFactura\n response = ApiPago.recibir_notificacion_factura(params[:id_factura], params[:bank_account])\n render json: response\n end",
"title": ""
},
{
"docid": "db04f3560203104da21d0d4c298b0dbb",
"score": "0.5648665",
"text": "def dispositon_params\n params.require(:dispositon).permit(:dispocode, :inmail_id, :to, :comment, :status, :user_id)\n end",
"title": ""
},
{
"docid": "3a139146cb3d4f2302e9ac0815525069",
"score": "0.56484514",
"text": "def new\n @definicion = Definicion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @definicion }\n end\n end",
"title": ""
},
{
"docid": "946f6e2e0e2b1fc8b3489f85e7469648",
"score": "0.56458944",
"text": "def create\n @detalle_factura_venta_aux = DetalleFacturaVentaAux.new(:id_producto=>params[:id_producto],:cantidad=>params[:cantidad],:descuento=>params[:descuento])\n respond_to do |format|\n if @detalle_factura_venta_aux.save\n CustomLogger.info(\"Se ha creado un Nuevo Detalle de Factura: Producto: #{@detalle_factura_venta_aux.producto.descripcion.inspect}, Cantidad: #{@detalle_factura_venta_aux.cantidad.inspect}, Descuento: #{@detalle_factura_venta_aux.descuento.inspect}. Usuario Responsable:#{current_user.funcionario.full_name.inspect}. Fecha y Hora: #{Time.now}\")\n @detalles_factura_ventas = DetalleFacturaVentaAux.listas_productos\n format.js {render 'guardar'}\n else\n format.html { render action: \"new\" }\n # CustomLogger.error(\"Error al intentar Crear un Nuevo Detalle de Factura. Usuario Responsable:#{current_user.funcionario.full_name.inspect}. Fecha y Hora: #{Time.now}\")\n format.json { render json: @detalle_factura_venta_aux.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8d781de1967534e2eab401abd033d02",
"score": "0.56458473",
"text": "def new\n @parceiros = Parceiro.all\n @novidades = Novidade.order('created_at').last(6) \n \n @recado = Recado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recado }\n end\n end",
"title": ""
},
{
"docid": "f71a124f7053011d4ecb3792169ee8f8",
"score": "0.56453806",
"text": "def new\n @indicador = Indicador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicador }\n end\n end",
"title": ""
},
{
"docid": "0d2f1cac88c3735f450bdb01261673b0",
"score": "0.5644288",
"text": "def saisirInformationsLivreur\n livreur = Livreur.new(utilisateur_params)\n #Utilisattion des fonctions prédéfinis de rails\n #Pas de nécessité de créer Restaurateur.setInfo comme dans le RDCU1 \n respond_to do |format|\n if livreur.save\n format.json { render :json => { :response => \"1\", :livreur => livreur } }\n else\n format.json { render :json => { :response => \"0\", :errors => livreur.errors } }\n end\n end \n end",
"title": ""
},
{
"docid": "c32490189a54e925ac08ab0c13ef085a",
"score": "0.56439626",
"text": "def new\n @fibre_commection = FibreCommection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fibre_commection }\n end\n end",
"title": ""
},
{
"docid": "bdbd6378bd862560333f6b2544633511",
"score": "0.56436545",
"text": "def accept\n response = ApiPago.aceptar_factura(params[:id_factura])\n render json: response\n end",
"title": ""
},
{
"docid": "7d98fc2781ec8da21f23b47a1fba6522",
"score": "0.5642142",
"text": "def new\n @cancelamento = Cancelamento.new\n @usuario_id=current_usuario.id\n @periodo=Periodo.find(:last)\n$disciplinas_aux = Matricula.find(:all,:conditions=>{:periodo_id=>@periodo.id,:aluno_id=>current_usuario.id,:cancelou=> nil})\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cancelamento }\n end\n \n end",
"title": ""
},
{
"docid": "59cf6b039713ed23927c84d9d6718c68",
"score": "0.5640202",
"text": "def create\n @nota_por_curso = NotaPorCurso.new(nota_por_curso_params)\n respond_to do |format|\n if @nota_por_curso.save\n format.html { redirect_to @nota_por_curso, notice: 'Notas inseridas com sucesso!' }\n format.json { render :show, status: :created, location: @nota_por_curso }\n else\n format.html { render :new }\n format.json { render json: @nota_por_curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bcb95f50f274811f86b45215ae14497",
"score": "0.5640102",
"text": "def create\n @observacion = Observacion.new(observacion_params)\n\n respond_to do |format|\n if @observacion.save\n format.html { redirect_to @observacion, notice: 'Observacion was successfully created.' }\n format.json { render :show, status: :created, location: @observacion }\n else\n format.html { render :new }\n format.json { render json: @observacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53a2d0830646373874bca9d3ad7f4609",
"score": "0.5640023",
"text": "def saisirInformations\n restaurateur = Restaurateur.new(utilisateur_params)\n #Utilisattion des fonctions prédéfinis de rails\n #Pas de nécessité de créer Restaurateur.setInfo comme dans le RDCU1 \n respond_to do |format|\n if restaurateur.save\n if params[:restaurant] != \"-1\" #un restaurant a ete selectionne\n restaurant = Restaurant.find(params[:restaurant])\n restaurant.update(restaurateur_id: restaurateur.id)\n \n format.json { render :json => { :response => \"1\", :restaurateur => restaurateur, :restaurant_nom => restaurant.nom, :restaurant_adresse => restaurant.adresse } }\n else\n format.json { render :json => { :response => \"2\", :restaurateur => restaurateur} } #restaurateur créé sans restaurant\n end \n else\n format.json { render :json => { :response => \"0\", :errors => restaurateur.errors } }\n end \n end\n \n end",
"title": ""
},
{
"docid": "5ea6777e2e5f88f2ec27715a3f5161d6",
"score": "0.5636939",
"text": "def new\n @ubicacion = Ubicacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ubicacion }\n end\n end",
"title": ""
},
{
"docid": "51c9f1162dd616358ffd163adf5e6045",
"score": "0.56365436",
"text": "def create\n @isapre = Isapre.new(isapre_params)\n\n respond_to do |format|\n if @isapre.save\n format.html { redirect_to @isapre, notice: 'Isapre fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @isapre }\n else\n format.html { render :new }\n format.json { render json: @isapre.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ee02e7b4796e2309f956e69b0cc9db5",
"score": "0.5636469",
"text": "def create\n @stock=Stock.find(:first,:conditions=>['id_producto = ? ',params[:id_producto]])\n @detalle_movimiento_stock_aux = DetalleMovimientoStockAux.new(:id_stock=>@stock.id,:cantidad=>params[:cantidad])\n \n respond_to do |format|\n if @detalle_movimiento_stock_aux.save\n\n CustomLogger.info(\"Se ha creado un Nuevo Detalle Movimiento Stock: Producto: #{@detalle_movimiento_stock_aux.stock.producto.descripcion.inspect}, Cantidad: #{@detalle_movimiento_stock_aux.cantidad.inspect}. Usuario Responsable:#{current_user.funcionario.full_name.inspect}. Fecha y Hora: #{Time.now}\")\n format.html { redirect_to @detalle_movimiento_stock_aux, notice: 'Detalle movimiento stock aux was successfully created.' }\n format.json { render json: @detalle_movimiento_stock_aux, status: :created, location: @detalle_movimiento_stock_aux }\n @detalles_movimientos_stocks_auxs = DetalleMovimientoStockAux.listas_productos\n format.js {render 'create'}\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @detalle_movimiento_stock_aux.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
629c6bd67c734ebc217ea3284391ffad
|
Complete the sockMerchant function below.
|
[
{
"docid": "818f6d7e01c4e915a18852abca3bb9bf",
"score": "0.0",
"text": "def sockMerchant(n, ar)\n # return total of matching pairs\n count = Hash.new(0)\n ar.each { |e| count[e] += 1 }\n count.values.map {|x| x/2 }.inject(:+)\nend",
"title": ""
}
] |
[
{
"docid": "18b8b1e754bee8505560539b3861fd6d",
"score": "0.7434196",
"text": "def sockMerchant(n, ar)\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "2111d85aff790c9a2ccc48a4f66305fb",
"score": "0.6094659",
"text": "def checkoutl\n \n \n begin \n setup_response = gateway.setup_purchase(50,\n :items => [{:name => \"Quick Book Migration\", :description => \"All Modules\",:amount=> 50}], \n :ip => request.remote_ip,\n :return_url => url_for(:action => 'confirm', :only_path => false),\n :cancel_return_url => url_for(:action => 'index',:id=>current_user.user_payment_choice , :only_path => false),\n :allow_guest_checkout=> true\n )\n \n \n redirect_to gateway.redirect_url_for(setup_response.token)\n rescue=>e\n logger.info \"some errors in active merchant\"\n logger.info e.inspect\n redirect_to :back ,:notice=>\"There Are Some Errors In Connection Please Try Again\"\n end\n end",
"title": ""
},
{
"docid": "1e8abd2b6267130869aad5bf6e1ef575",
"score": "0.5800104",
"text": "def merchant_processing!\n raise 'Merchant processing needs to be implenmenting'\n end",
"title": ""
},
{
"docid": "e7ece4729b02547c400b230c84db6560",
"score": "0.5692316",
"text": "def PerformTransaction(request, response)\n\n#\n#\tIf the request specifies a server name, use it.\n#\tOtherwise, use the default.\n#\n serverName = request.Get(\"gatewayServer\") # Get server name\n if (serverName != nil) # Override?\n serverName = [serverName] # Use this name\n else\n serverName = @rocketGateHost # Use default list\n end\n\n#\n#\tClear any error tracking that may be leftover.\n#\n request.Clear(GatewayRequest::FAILED_SERVER);\n request.Clear(GatewayRequest::FAILED_RESPONSE_CODE);\n request.Clear(GatewayRequest::FAILED_REASON_CODE);\n request.Clear(GatewayRequest::FAILED_GUID);\n\n#\n#\tRandomly pick an endpoint.\n#\n if (serverName.length > 1) # Have multiples?\n index = rand(serverName.length) # Pick random server\n if (index > 0) # Want to change?\n swapper = serverName[0] # Save the first one\n serverName[0] = serverName[index] # Move to first\n serverName[index] = swapper # And swap\n end\n end\n\n#\n#\tLoop over the hosts and try to send the transaction\n#\tto each host in the list until it succeeds or fails\n#\tdue to an unrecoverable error.\n#\n index = 0 # Start at first position\n while index < serverName.length do # Loop over list\n results = self.SendTransaction(serverName[index], request, response)\n\n#\n#\tIf the transaction was successful, we are done\n#\n if results == \"0\" # Success?\n return true # All done\n end\n\n#\n#\tIf the transaction is not recoverable, quit.\n#\n if results != \"3\" # Unrecoverable?\n return false # All done\n end\n\n#\n#\tSave any errors in the response so they can be\n# \ttransmitted along with the next request.\n#\n request.Set(GatewayRequest::FAILED_SERVER, serverName[index]);\n request.Set(GatewayRequest::FAILED_RESPONSE_CODE,\n response.Get(GatewayResponse::RESPONSE_CODE));\n request.Set(GatewayRequest::FAILED_REASON_CODE,\n response.Get(GatewayResponse::REASON_CODE));\n request.Set(GatewayRequest::FAILED_GUID,\n response.Get(GatewayResponse::TRANSACT_ID));\n index = index + 1 # Next index\n end\n end",
"title": ""
},
{
"docid": "3eb0c283051d324de14f4ebb7d4e1ea3",
"score": "0.56239974",
"text": "def checkout_visa(transaction_id,merchant_id,amount,card_email,desc)\n url = 'https://prod.theteller.net'\n url_endpoint = '/checkout/initiate'\n conn = Faraday.new(url: url, headers: REQHDR, :ssl => {:verify => false}) do |f|\n f.response :logger\n f.adapter Faraday.default_adapter\n end\n \n logger.info \"######## visa and master card payment##############\"\n logger.info \"######## visa and master card payment##############\"\n logger.info \"######## visa and master card payment##############\"\n \n payload={\n \"merchant_id\" => merchant_id,\n \"transaction_id\" => transaction_id,\n \"desc\" => desc,\n \"amount\" => amount,\n \"redirect_url\"=>\"https://votedigital.net/visa_callback\",\n \"email\" => card_email\n }\n \n \n logger.info \"---Json Payload----\"\n logger.info \"---Json Payload----\"\n \n json_payload=JSON.generate(payload)\n msg_endpoint=\"#{json_payload}\"\n \n logger.info \"JSON payload: #{json_payload.inspect}\"\n \n \n begin\n resp = conn.post do |req|\n logger.info \"----request--------\"\n req.url url_endpoint\n logger.info url_endpoint\n req.options.timeout = 60 # open/read timeout in seconds\n req.options.open_timeout = 60 # connection open timeout in seconds\n req.headers[\"Authorization\"] = \"Basic cmFkNWQ0YTgxZDZhMzQ1MzpNVFF3T0RCaU1qVTNZemcxT0RoaFltSXdNMlE1Wm1GbVlXVmxOakprT1dRPQ==\"\n \n \n req.body = json_payload\n end\n \n puts resp\n \n bidy = resp.body\n puts \"---Request Body----\"\n puts \"---Request Body----\"\n puts bidy\n #puts bidy.code\n #puts resp.body\n puts \"---Request Body----\"\n puts \"---Request Body----\"\n puts \"---Request Body----\"\n puts \"---Request Body----\"\n puts \"---Request Body----\"\n #puts \"Result from theteller : #{resp.body}\"\n #puts \"Status from theteller : #{resp.status}\"\n \n \n \n #if resp.status.to_s == \"200\"\n puts\n puts \"Beta\"\n puts\n \n \n \n #puts result = JSON.parse resp.body\n #puts resp.body\n \n #puts result = JSON.parse bidy\n \n puts result = JSON.parse(bidy)\n puts url = result[\"checkout_url\"]\n puts code = result[\"code\"]\n puts reason = result[\"reason\"]\n \n \n puts \"------Respones hash values-------\"\n puts \"------Respones hash values-------\"\n puts \"------Respones hash values-------\"\n puts \"------Respones hash values-------\"\n \n if code.to_s == \"200\"\n respond_to do |format|\n format.html { redirect_to url, notice: \"#{reason}\" }\n format.json { head :no_content }\n \n end\n \n else\n \n respond_to do |format|\n \n format.html { redirect_to root_path, notice: \"#{reason}\" }\n format.json { head :no_content }\n \n end\n \n \n end\n \n #puts status = result.status\n #puts url = result.checkout_url\n #puts code = result[\"code\"]\n #puts reason = result[\"reason\"]\n #puts transaction_id = result[\"checkout_url\"]\n \n \n \n #if code.to_s == \"200\"\n \n# update_status(transaction_id,\"success\",status,code,reason)\n#\n# respond_to do |format|\n#\n# format.html { redirect_to root_path, notice: \"Your VoteDigital payment for #{nominee_user} #{reason}\" }\n# format.json { head :no_content }\n#\n# end\n\n#elsif code.to_s == \"100\"\n \n \n# update_status(transaction_id,\"failure\",status,code,reason)\n#\n# respond_to do |format|\n#\n# format.html { redirect_to root_path, notice: \"Your VoteDigital payment for #{nominee_user} #{reason}\" }\n# format.json { head :no_content }\n#\n# end\n#\n# else\n \n# respond_to do |format|\n#\n# format.html { redirect_to root_path, notice: \"#{reason}\" }\n# format.json { head :no_content }\n#\n# end\n\n \n #end\n \n #end\n \n \n \n \n \n \n #resp.body\n rescue Faraday::SSLError\n puts \"SSL ERRor error\"\n puts \"SSL ERRor error\"\n puts \"SSL ERRor error\"\n puts \"SSL ERRor error\"\n \n rescue Faraday::TimeoutError\n puts \"Connection timeout error\"\n puts \"Connection timeout error\"\n puts \"Connection timeout error\"\n \n# respond_to do |format|\n#\n# format.html { redirect_to root_path, notice: \"Your VoteDigital payment for #{nominee_user} Session Expired, Kindly authorize payment on time\" }\n# format.json { head :no_content }\n#\n# end\n\n \n end\n \n \n \n \n \nend",
"title": ""
},
{
"docid": "5fde4bc2cd09fa14e0df71892f226d55",
"score": "0.5578799",
"text": "def finish_request; end",
"title": ""
},
{
"docid": "90dd00de68562926836eff8b483f7f79",
"score": "0.55498207",
"text": "def handle_merchant_processing!\n skip_merchant_processing? || begin\n run_callbacks :merchant_processing do\n merchant_processing!\n end\n end\n end",
"title": ""
},
{
"docid": "39aae11e9b8d137e8ccbdbe9f5694344",
"score": "0.5543643",
"text": "def complete!\n transaction.response = ActiveMerchant::Billing::Response.new(\n true,\n I18n.t(\n 'workarea.sezzle.authorize',\n amount: transaction.amount\n ),\n pre_authorized_response_message\n )\n end",
"title": ""
},
{
"docid": "288226094589465b4f9a7b29fd045450",
"score": "0.55314505",
"text": "def process_purchase\n if express_token.blank?\n #STANDARD_GATEWAY.wiredump_device = STDOUT\n Rails.logger.debug \"contacting credit card gateway...\"\n Rails.logger.debug \"price in cents: #{price_in_cents}, options:\\n #{standard_purchase_options.to_yaml}\"\n STANDARD_GATEWAY.purchase(price_in_cents, credit_card, standard_purchase_options)\n else\n Rails.logger.debug \"contacting paypal express gateway...\"\n Rails.logger.debug \"price in cents: #{price_in_cents}, options:\\n #{express_purchase_options.to_yaml}\"\n EXPRESS_GATEWAY.purchase(price_in_cents, express_purchase_options)\n end\n end",
"title": ""
},
{
"docid": "066af0ae310b9249dfa5add9dd7147e8",
"score": "0.5507611",
"text": "def send_product\n\t \n\tend",
"title": ""
},
{
"docid": "71911153d11068dd5cc5a1d65db64cd9",
"score": "0.54789454",
"text": "def payment_stuff\n ActiveMerchant::Billing::Base.mode = :test\n creditcard = ActiveMerchant::Billing::CreditCard.new({\n :first_name => params[:credit_cardholder].to_s.split.first,\n :last_name => (params[:credit_cardholder].to_s.split[1..-1]).to_a.join(' '),\n :number => params[:credit_number].to_s,\n :month => params[:credit_month].to_s,\n :year => params[:credit_year].to_s,\n :verification_value => params[:credit_civ].to_s,\n :type =>params[:credit_type].to_s\n })\n gateway = ActiveMerchant::Billing::PayflowGateway.new(\n :user => 'nomaddesign',\n :login => 'nomaddesign',\n :password => 'webadmin77',\n :partner => 'verisign'\n )\n @response = gateway.authorize(1000, creditcard)\n \n end",
"title": ""
},
{
"docid": "3dcad0640b948d0403d090fce2141b55",
"score": "0.54782385",
"text": "def processPayment\n ActiveMerchant::Billing::Base.mode = :test\n\n # ActiveMerchant accepts all amounts as Integer values in cents\n # $10.00\n amount = 1000\n\n # The card verification value is also known as CVV2, CVC2, or CID\n credit_card = ActiveMerchant::Billing::CreditCard.new(\n :first_name => 'Bob',\n :last_name => 'Bobsen',\n :number => '4242424242424242',\n :month => '8',\n :year => '2012',\n :verification_value => '123'\n )\n\n # Validating the card automatically detects the card type\n if credit_card.valid?\n\n # Create a gateway object for the TrustCommerce service\n gateway = ActiveMerchant::Billing::TrustCommerceGateway.new(\n :login => 'TestMerchant',\n :password => 'password'\n )\n\n # Authorize for the amount\n response = gateway.purchase(amount, credit_card)\n\n if response.success?\n puts \"Successfully charged $#{sprintf(\"%.2f\", amount / 100)} to the credit card #{credit_card.display_number}\"\n puts \"Status\" \n \"{status}\"\n else\n raise StandardError, response.message\n #please verify your payment information or \n end\n else\n #please verify your payment information \n end\nend",
"title": ""
},
{
"docid": "496fe3b6ba740b54bbd879473d7762e2",
"score": "0.54773843",
"text": "def finish_transaction(confirmed = false)\n unless @data.mem.mem_passport\n @data.mem.mem_passport = @data.owner.affiliate.free_passport_number\n if !@data.mem.mem_passport\n error \"Couldn't find a free passport number\"\n @session.pop\n return\n end\n end\n\n products = get_products_bought\n\n aff = Affiliate.with_id(@data.mem.mem_affiliate)\n order = Order.create(aff)\n order.set_payment_option(@data.payment_option)\n order.set_user_id(@data.owner.user_id)\n\n products.each do |qty, prd|\n order.add(prd, qty)\n end\n\n if confirmed\n $store.transaction do \n save_membership\n order.set_mem_id(@data.mem.mem_id)\n order.record_sales\n end\n end\n\n values = { \n \"aff_short_name\" => aff.aff_short_name,\n \"register_another_target\" => url(:handle_display, @data.owner),\n }\n\n order.add_to_hash(values)\n\n pme = PaymentMethod.from_type(@data.payment_option.pay_method)\n\n unless confirmed\n if pme.pme_is_credit_card\n cc = CreditCardTransaction.new\n cc.new_transaction(order, \n \"Destination Imagination: #{@data.mem.full_passport}\",\n @data.mem.admin.contact)\n cc.hash_for_authorize(values, \n @context.context_id, \n @context.entry_index(Register, :cc_response))\n cc.save\n @data.cc_id = cc.cc_id\n else\n values['confirm_url'] = url(:finish_transaction, true)\n end\n end\n\n if confirmed && pme.pme_is_credit_card && @data.cc_id\n cc = CreditCardTransaction.with_id(@data.cc_id)\n cc.apply_to_order(@session.user, order, @session)\n cc.save\n end\n\n unless pme.pme_is_credit_card\n pay_detail = pme.pme_desc\n pay_ref = @data.payment_option.pay_ref\n if pay_ref && !pay_ref.empty?\n pay_detail += \" (number #{pay_ref})\"\n end\n values[\"pay_detail\"] = pay_detail\n end\n\n @data.mem.add_to_hash(values)\n\n\n # if this is a confirmation and the order is being entered by HQ\n # staff, don't print the confirmation screen\n\n # We do the strange stuff with \"no going back\" because\n # sometimes PostGres breaks and that particular statement can take\n # 10's of seconds. By moving it after the response, we allow\n # authorize.net to get their response back within the timeout period\n\n if confirmed && \n @data.owner.user_id != @session.user.user_id && \n @session.hq_session\n\n note \"TeamPak #{@data.mem.full_passport} created\"\n @session.pop\n @context.no_going_back \n return\n end\n\n standard_page(\"TeamPak Summary\",\n values,\n MEMBERSHIP_SUMMARY,\n MEMBERSHIP_DETAILS, \n CONTACT,\n CONTACT)\n\n if confirmed\n @context.no_going_back \n end\n end",
"title": ""
},
{
"docid": "93c30999d32050b21951bfaa43d6b0aa",
"score": "0.54693204",
"text": "def process(txn, merchant_id, merchant_key)\n # Rails treats any blank field (x=\"\") as false (x=false), so any parameter that we wish to treat as optional\n # needs to be given a default value of \"\" here.\n optional = [:shipping]\n optional.each { |key| txn[key] ||= \"\" } # if it has a nil or false value, give it \"\" instead.\n\n @t_device_id = txn[:itid]\n\n\n # Kalopsia expects dates to be Date objects, but they might be Strings.\n dates = [:card_expiry_date, :start_date, :end_date]\n dates.each do |date_key|\n if txn[date_key].kind_of?(String)\n txn[date_key] = DateTime.parse(txn[date_key])\n end\n end\n\n actions = %w(sale sale_return pre_auth post_pre_auth force_sale void void_by_ton settlement batch_inquiry view_detail view_open view_settled)\n case txn[:action]\n when 'sale'\n case txn[:card_mode]\n when 'debit' then do_debit_sale(txn, merchant_id, merchant_key )\n when 'credit' then do_credit_sale(txn, merchant_id, merchant_key)\n else raise \"invalid card mode: #{txn[:card_mode]} (expected one of 'debit', 'credit')\"\n end\n when 'sale_return' then do_sale_return(txn, merchant_id, merchant_key)\n when 'pre_auth' then do_pre_auth(txn, merchant_id, merchant_key)\n when 'post_pre_auth' then do_post_pre_auth_http(txn, merchant_id, merchant_key)\n when \"force_sale\" then do_force_sale(txn, merchant_id, merchant_key)\n when \"void\" then do_void_by_ton(txn, merchant_id, merchant_key)\n when \"void_by_ton\" then do_void_by_ton(txn, merchant_id, merchant_key)\n when \"settlement\" then do_settlement(txn, merchant_id, merchant_key)\n when \"batch_inquiry\" then do_batch_inquiry(txn, merchant_id, merchant_key)\n when \"view_detail\" then view_bankcard_settled_batch_detail(txn, merchant_id, merchant_key)\n when \"view_open\" then view_current_open_batch_listing(txn,merchant_id, merchant_key)\n when \"view_settled\" then view_settled_batch_summary(txn,merchant_id, merchant_key)\n else raise \"action not found: #{txn[:action]} (expected one of #{actions.inspect})\"\n end\n end",
"title": ""
},
{
"docid": "ce095e1cd58787295f3c3c8479d32a39",
"score": "0.54611665",
"text": "def SavantRequest(hostname,cmd,req)\r\n #puts \"Hostname:\\n#{hostname}\\n\\nCommand:\\n#{cmd}\\n\\nRequest:\\n#{req}\" unless cmd == \"Status\"\r\n h = Hash[req.select { |e| e.to_s.include?(\":\") }.map {|e| e.split(\":\",2) if e && e.to_s.include?(\":\")}]\r\n \r\n \r\n #puts \"Sending Command: #{cmd}\"\r\n r = {}\r\n if h && hostname[\"name\"]\r\n h[\"id\"] = Base64.decode64(h[\"id\"]) if h[\"id\"] && h[\"id\"].match(/^([A-Za-z0-9+\\/]{4})*([A-Za-z0-9+\\/]{4}|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{2}==)$/)\r\n r = send(cmd,hostname[\"name\"].downcase,h[\"id\"],h)\r\n end\r\n #puts \"Returning: #{r}\" unless cmd == \"Status\"\r\n return r\r\nrescue\r\n puts $!, $@\r\n puts \"Hostname:\\n#{hostname}\\n\\nCommand:\\n#{cmd}\\n\\nRequest:\\n#{req}\" unless cmd == \"Status\"\r\n puts \"PlayerDB: #{@@playerDB.inspect}\"\r\n return nil\r\nend",
"title": ""
},
{
"docid": "811f5a01d10eaf55406fdf9c26ea4097",
"score": "0.5459816",
"text": "def complete\n provider.complete(order, session, ip_address)\n end",
"title": ""
},
{
"docid": "68742f0fb65ad6c69cdf5ab3a37d00e8",
"score": "0.5451509",
"text": "def transfer; end",
"title": ""
},
{
"docid": "68742f0fb65ad6c69cdf5ab3a37d00e8",
"score": "0.5451509",
"text": "def transfer; end",
"title": ""
},
{
"docid": "2b065002b92c34836a6fc0e8afe9e02c",
"score": "0.5437976",
"text": "def callback\n get_access_token\n get_bc_response_body\n get_store_info\n @store = create_store\n set_bc_session_during_install(@store)\n get_shipping_zones(@store)\n set_carrier\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "9445fedee205ef01156ca2b920fd4eb3",
"score": "0.542168",
"text": "def SendTransaction(serverName, request, response)\n\n#\n#\tGather overrides for transaction.\n#\n urlServlet = request.Get(\"gatewayServlet\")\n urlProtocol = request.Get(\"gatewayProtocol\")\n urlPortNo = request.Get(\"portNo\")\n\n#\n#\tDetermine the final servlet name.\n#\n if urlServlet == nil\n urlServlet = @rocketGateServlet\n end\n\n#\n#\tDetermine the final protocol.\n#\n if urlProtocol == nil\n urlProtocol = @rocketGateProtocol\n end\n\n#\n#\tDetermine the final port number.\n#\n if urlPortNo == nil\n urlPortNo = @rocketGatePortNo\n end\n\n#\n#\tGet the connection timeout.\n#\n connectTimeout = request.Get(\"gatewayConnectTimeout\")\n if ((connectTimeout == nil) || (connectTimeout.to_i <= 0))\n connectTimeout = @rocketGateConnectTimeout\n end\n\n#\n#\tGet the read timeout.\n#\n readTimeout = request.Get(\"gatewayReadTimeout\")\n if ((readTimeout == nil) || (readTimeout.to_i <= 0))\n readTimeout = @rocketGateReadTimeout\n end\n\n#\n#\tPrepare the values that will go into post\n#\n begin\n response.Reset # Clear any response data\n requestXML = request.ToXML # Get message string\n headers = {'Content-Type' => 'text/xml', 'User-Agent' => ROCKETGATE_USER_AGENT}\n\n#\n#\tCreate the HTTP handler for the post.\n#\n http = Net::HTTP.new(serverName, urlPortNo)\n http.open_timeout = connectTimeout # Setup connection timeout\n http.read_timeout = readTimeout # Setup operation timeout\n\n#\n#\tIf we are doing HTTPS, we need to setup SSL.\n#\n urlProtocol = urlProtocol.upcase # Change to caps\n if (urlProtocol == \"HTTPS\") # Need HTTPS?\n http.use_ssl = true # Required SSL\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n#\n#\tPerform the posting.\n#\n results = http.request_post(urlServlet, requestXML, headers)\n body = results.body # Get the response data\n\n#\n#\tCheck if we were unable to connect.\n#\n rescue Errno::ECONNREFUSED => ex\n response.Set(GatewayResponse::EXCEPTION, ex.message)\n response.Set(GatewayResponse::RESPONSE_CODE, \"3\")\n response.Set(GatewayResponse::REASON_CODE, \"301\")\n return \"3\" # System error\n\n#\n#\tCheck if there was some type of timeout.\n#\n rescue Timeout::Error => ex\n response.Set(GatewayResponse::EXCEPTION, ex.message)\n response.Set(GatewayResponse::RESPONSE_CODE, \"3\")\n response.Set(GatewayResponse::REASON_CODE, \"303\")\n return \"3\" # System error\n\n#\n#\tCatch all other errors.\n#\n rescue => ex # Default handler\n response.Set(GatewayResponse::EXCEPTION, ex.message)\n response.Set(GatewayResponse::RESPONSE_CODE, \"3\")\n response.Set(GatewayResponse::REASON_CODE, \"304\")\n return \"3\" # System error\n end\n\n#\n#\tParse the response XML and return the response code.\n#\n response.SetFromXML(body) # Set from response body\n responseCode = response.Get(GatewayResponse::RESPONSE_CODE)\n if (responseCode == nil) # Don't have one?\n responseCode = \"3\" # System error\n response.Set(GatewayResponse::EXCEPTION, body)\n response.Set(GatewayResponse::RESPONSE_CODE, \"3\")\n response.Set(GatewayResponse::REASON_CODE, \"400\")\n end\n return responseCode # Give back results\n end",
"title": ""
},
{
"docid": "77c33d04002f11511951d115be406f87",
"score": "0.5413165",
"text": "def complete(*args)\n ActiveMerchant::Billing::Response.new(true, \"\", {}, {})\n end",
"title": ""
},
{
"docid": "ad7dec51ed4f826084f7ee42add9e578",
"score": "0.54027706",
"text": "def perform\n build_request_body\n @response = self.class.post('', body: @request_body)\n verify_response\n process_response\n rescue Timeout::Error, Errno::ETIMEDOUT, Errno::ENETUNREACH, SocketError => e\n {\n 'gateway_response' => {\n 'error' => {\n 'code' => '-1',\n 'description' => 'Отсутствует подключение к интернету. Повторите попытку позже'\n }\n }\n }\n end",
"title": ""
},
{
"docid": "cedd8a6916f8b963ff431002411f2d75",
"score": "0.53907704",
"text": "def callback\n# Find the transaction from the db using the checkout id returned by safaricom that we saved earlier\n @transaction = Transaction.find_by_checkout_request_id(params['Body']['stkCallback']['CheckoutRequestID'])\n# Get the descrption of the transaction status\n description = params['Body']['stkCallback']['ResultDesc']\n# If the transaction was successfull do whatever you want to do in your application\n if description==\"The service request is processed successfully.\"\n meta = params['Body']['stkCallback']['CallbackMetadata']['Item']\n @transaction.update(transaction_code:meta[1][\"Value\"],done:true)\n mes = 'Your donation of '.concat(meta[0][\"Value\"].to_s) + ' Reciept No. '.concat(meta[1][\"Value\"].to_s) +' has been recieved by Harambee on '+ meta[3]['Value'].to_s.to_time.to_s + '. Thank You for participating in Harambee.'\n Nexmo.message(mes,@transaction.contributor_phone_no)\n amount = meta[0][\"Value\"].to_i\n harambee = @transaction.user_harambee\n harambee.raised_amount ||= 0\n rs = harambee.raised_amount\n new_raised = rs.to_i + amount\n harambee.update(raised_amount:new_raised)\n harambee.save()\n if harambee.target_amount<=raised_amount\n transactions = harambee.transactions\n mes = 'Thank you for participating in the '+harambee.name+' contribution. We have reached our target amount.'\n transactions.each do |trans|\n Nexmo.message(mes,trans.contributor_phone_no)\n end\n harambee.update(running:false)\n end\n# Else if it was not do something else like sending an email or a text to the user.\n else\n mes = 'Transaction was not able to complete.'\n Nexmo.message(mes,@transaction.contributor_phone_no)\n end\n # number_to_currency(@harambee.target_amount, options = { unit: \"Ksh.\"})\n end",
"title": ""
},
{
"docid": "05ff96f585be86b8d68b2d70770bc42c",
"score": "0.5365362",
"text": "def send(opt)\n # Checking the type of the input parameter\n if opt.is_a?(String)\n @req_payload_string = Java_String.new(opt)\n end\n\n if opt.is_a?(WSMessage)\n @req_payload_string = opt.str_payload\n rexml_message = opt.rexml_payload\n tempOptions = opt.options\n\n if(tempOptions.has_key?('to'))\n @options.setTo(EndpointReference.new(tempOptions['to']))\n end\n\n if(tempOptions.has_key?('action'))\n @options.setAction(tempOptions['action'])\n end\n\n end\n \n # Setting options to the serviceClient\n @client.setOptions(@options)\n req_stream = StringBufferInputStream.new(@req_payload_string)\n omBuilder = StAXOMBuilder.new(req_stream)\n omElement = OMElement.new\n omElement = omBuilder.getDocumentElement\n\n begin\n #invoking the sendRobust method\n res = @client.sendRobust(omElement);\n res_message = WSMessage.new(res.to_string, nil, nil)\n res_message\n\n rescue Exception => wsfault\n WSFault.new(wsfault.to_s)\n end\n\n\nend",
"title": ""
},
{
"docid": "631cbfcf47902eafa6b7fefebbb0cbda",
"score": "0.53617674",
"text": "def callback\n @transaction = Spree::Ccavenue::Transaction.find(params[:id])\n raise \"Transaction with id: #{params[:id]} not found!\" unless @transaction\n\n params = decrypt_ccavenue_response_params # Need to decrypt params first\n logger.info \"Decrypted params from CCAvenue #{params.inspect}\"\n @transaction.auth_desc = params['order_status']\n @transaction.card_category = params['card_name']\n @transaction.ccavenue_order_number = params['order_id']\n @transaction.ccavenue_amount = params['amount']\n failure_message = params['failure_message']\n status_message = params['status_message ']\n\n session[:access_token] = @transaction.order.guest_token if @transaction.order.respond_to?(:guest_token)\n session[:order_id] = @transaction.order.id\n\n if @transaction.next\n # Handling of possible transaction states, check CCAvenue documentation for details\n if @transaction.authorized? # Successful\n session[:order_id] = nil\n flash.notice = I18n.t(:order_processed_successfully)\n flash[:commerce_tracking] = 'nothing special'\n # We are setting token here so that even if the URL is copied and reused later on he completed order page still gets displayed\n if session[:access_token].nil?\n redirect_to order_path(@transaction.order, {:checkout_complete => true})\n else\n redirect_to order_path(@transaction.order, {:checkout_complete => true, :token => session[:access_token]})\n end\n elsif @transaction.rejected?\n redirect_to edit_order_path(@transaction.order), :error => I18n.t(\"payment_rejected\")\n elsif @transaction.canceled?\n redirect_to edit_order_path(@transaction.order), :notice => I18n.t(\"payment_canceled\")\n elsif @transaction.initiated?\n redirect_to edit_order_path(@transaction.order), :notice => I18n.t(\"payment_initiated\")\n elsif @transaction.batch?\n # Don't allow the order to be reused.\n session[:order_id] = nil\n render 'batch'\n end\n else\n render 'error'\n end\n end",
"title": ""
},
{
"docid": "a5ecc5dfebafb5a92a2dbb7768cbe437",
"score": "0.53524137",
"text": "def act_on_ok\n case transfer_status\n when 'COMPLETE'\n output(\n event: 'success',\n message: message_text,\n uuid: body['sip_uuid'],\n accession: payloads.first[:output][:accession]\n )\n when 'PROCESSING'\n output(event: 'retry', message: message_text)\n fail!\n when 'USER_INPUT'\n # @todo send email\n output(event: 'retry', message: message_text)\n fail!\n else\n output(event: 'failed', message: message_text)\n fail!\n end\n end",
"title": ""
},
{
"docid": "b885006a9c7a22dd1ad9e24fff5e967a",
"score": "0.5326458",
"text": "def receive_transaction; end",
"title": ""
},
{
"docid": "6d1fd03252505b73484a60fe28f80bb1",
"score": "0.5297486",
"text": "def collect_customer_signature(destination)\n sleep(3)\n destination.delivered = true\n end",
"title": ""
},
{
"docid": "1d637184df60b05f3cf6deb27d5606c1",
"score": "0.5278711",
"text": "def buy_goods(userID, name, pcAmount, quantity, format='iframe', externalRefID=nil, option_name_0=nil, option_value_0=nil, option_name_1=nil, option_value_1=nil, appParams=nil, sku=nil, sku_category=nil)\n @logger.debug(\"buy_goods : user_id=#{userID} pcAmount=#{pcAmount} quantity=#{quantity} format=#{format} option_name_0=#{option_name_0} option_value_0=#{option_value_0} option_name_1=#{option_name_1} option_value_1=#{option_value_1} externalRefID=#{externalRefID} appParams=#{appParams} sku=#{sku} sku_category=#{sku_category}\")\n\n base_params = {:user_id => userID, :action => 'buy_goods', :format => format, :offer_id => @offer_id}\n required_params = {:name => name, :amount => pcAmount, :quantity => quantity}\n optional_params = Hash.new\n optional_params[:app_params] = appParams if !(appParams.nil?)\n optional_params[:external_ref_id] = externalRefID if !(externalRefID.nil?)\n optional_params[:option_name_0] = option_name_0 if !(option_name_0.nil?)\n optional_params[:option_value_0] = option_value_0 if !(option_value_0.nil?)\n optional_params[:option_value_1] = option_value_1 if !(option_value_1.nil?)\n optional_params[:option_name_1] = option_name_1 if !(option_name_1.nil?)\n optional_params[:sku] = sku if !(sku.nil?)\n optional_params[:sku_category] = sku_category if !(sku_category.nil?)\n\n cmd_uri = _generate_uri(base_params, required_params, optional_params)\n if format.eql?(\"json\") || format.eql?(\"xml\")\n response = _get_response(cmd_uri)\n return response\n else\n port = (@server_port == :defaults) ? \"\" : \":#{@server_port}\"\n url = \"https://#{@server_name}#{port}#{cmd_uri}\"\n @logger.debug(\"buy_goods: url = #{url}\")\n return url\n end\n\n end",
"title": ""
},
{
"docid": "01609db21cc9e396038dfd06d6e392af",
"score": "0.526639",
"text": "def transfer \n end",
"title": ""
},
{
"docid": "b2fec66242e093d1d44e5acbb3ccd228",
"score": "0.526331",
"text": "def on_send_success(server, session, res_packet)\n end",
"title": ""
},
{
"docid": "e37e0ae825ce53b534adef3e4c707cf9",
"score": "0.52573556",
"text": "def confirmed_pay\n @persona = Persona.where( :screen_name => params[:persona_id]).first\n\n if params[:error] then\n flash[:error] = params[:error]\n else\n @order = @persona.orders.find(params[:order_id])\n \n @payment_ok = false\n\n #check if the payment goes through or not...\n\t\t\ttoken=params[:token]\n\n\t\t\t#valid the payment here, if ok, go next step where the order has been done\n\t\t\t#otherwise, if got some other error, check and go back to cofirm_pay action\n\t\t\t#payment_method = SpreedlyCore::PaymentMethod.find(token)\n env = Spreedly::Environment.new(ENV['SPREEDLYCORE_ENVIRONMENT_KEY'],ENV['SPREEDLYCORE_ACCESS_SECRET'])\n payment_method = env.find_payment_method(token)\n\n\t\t\tif payment_method.valid? then\n @amount_charge = Cart.where( \n :order_id => params[:order_id] \n ).map{ \n |x| Sku.where(:code => x.item_sku).first.base_price * x.quantity * 100\n }.sum\n purchase_transaction = env.authorize_on_gateway(ENV['SPREEDLYCORE_GATEWAY_TOKEN'], token, @amount_charge ) \n respond_to do |format|\n if purchase_transaction.succeeded? then \n @payment_ok = true\n\t\n\t\t\t\t\t\t#process the order\n #if sku is membership or online stuff, create the broucher and ask if wants to active it\n\t\t\t\t\t\tCart.where(:order_id => params[:order_id]).each do |cart_item|\n\t\t\t\t\t\t\t#so far this store only do online stuff for now\n\t\t\t\t\t\t\tsku = Sku.where(:code => cart_item.item_sku).first\n\t\t\t\t\t\t\tcoupon = Coupon.generate_coupon( @persona.id, sku.id)\n\t\t\t\t\t\t\t#need to account for multiple items\n\t\t\t\t\t\t\tcart_item.update_attribute( :item_id, coupon.id)\n\t\t\t\t\t\tend \n\t\t\t\t\t\t@order.update_attributes({ :status => 2, :spreedly_token_id => params[:token] })\n format.html \n else\n redirect_to store_confirm_pay_path(@persona.screen_name, \n :order_id => params[:order_id]), :error => 'Unable to charge you CC' \n end\n end #respond_to ...\n\t\t\telse\n\t\t\t\t#redirect to confirm_pay with errors\n\t\t\t\tredirect_to store_confirm_pay_path(@persona.screen_name, \n :order_id => params[:order_id]), :error => payment_method.errors.join('\\n')\n\t\t\tend\n end\n end",
"title": ""
},
{
"docid": "c567f9862ce85cc5b7a908a49b557d14",
"score": "0.5254008",
"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": "eaf81fba33a9cfa4c3fa19066f41265d",
"score": "0.524889",
"text": "def PerformTargetedTransaction(request, response)\n\n#\n#\tClear any error tracking that may be leftover.\n#\n request.Clear(GatewayRequest::FAILED_SERVER);\n request.Clear(GatewayRequest::FAILED_RESPONSE_CODE);\n request.Clear(GatewayRequest::FAILED_REASON_CODE);\n request.Clear(GatewayRequest::FAILED_GUID);\n\n#\n#\tThis transaction must go to the host that processed a\n#\tprevious referenced transaction. Get the GUID of the\n#\treference transaction.\n#\n referenceGUID = request.Get(GatewayRequest::REFERENCE_GUID)\n if (referenceGUID == nil) # Don't have reference?\n response.Set(GatewayResponse::RESPONSE_CODE, \"4\")\n response.Set(GatewayResponse::REASON_CODE, \"410\")\n return false # And quit\n end\n\n#\n#\tStrip off the bits that indicate which server should\n#\tbe used.\n#\n siteString = \"0x\" # Value is hex\n if (referenceGUID.length > 15) # Server 16 and above?\n siteString.concat(referenceGUID[0, 2]) # Get first two digits\n else\n siteString.concat(referenceGUID[0, 1]) # Get first digit only\n end\n\n#\n#\tTry to turn the site string into a number.\n#\n begin\n siteNo = Integer(siteString) # Convert to site number\n rescue\n response.Set(GatewayResponse::RESPONSE_CODE, \"4\")\n response.Set(GatewayResponse::REASON_CODE, \"410\")\n return false # And quit\n end\n\n#\n#\tBuild the hostname to which the transaction should\n#\tbe directed.\n#\n serverName = request.Get(\"gatewayServer\") # Get server name\n if (serverName == nil) # Don't have one?\n serverName = @rocketGateDNS # Start with default\n separator = serverName.index(\".\") # Find first .\n if ((separator != nil) && (separator > 0))\n prefix = serverName[0, separator] # Get the prefix\n prefix.concat(\"-\") # Add separator\n prefix.concat(siteNo.to_s) # Add site number\n prefix.concat(serverName[separator, serverName.length])\n serverName = prefix # Full server name\n end\n end\n\n#\n#\tSend the transaction to the specified host.\n#\n results = self.SendTransaction(serverName, request, response)\n if results == \"0\" # Success?\n return true # All done\n end\n return false # Failed\n end",
"title": ""
},
{
"docid": "6118053a7031653260b41d857ea9e571",
"score": "0.5247654",
"text": "def connect!\n TCPsocket.open 'localhost', Ecommerce::Merchants::SecureTrading::Settings.port\n rescue Errno::ECONNREFUSED\n raise Ecommerce::MerchantConnectionError\n end",
"title": ""
},
{
"docid": "905f23335ddafb14b7f822607f97d192",
"score": "0.52340806",
"text": "def perform\n @return_code = Curl.easy_perform(handle)\n if Ethon.logger.debug?\n Ethon.logger.debug { \"ETHON: performed #{log_inspect}\" }\n end\n complete\n @return_code\n end",
"title": ""
},
{
"docid": "ea48f7454bd5843066fb6e360c6303bf",
"score": "0.5228947",
"text": "def judo_final_payment(options = {method: \"payments\"})\n patient = self.patient\n payment_card = self.paymentable\n appointment_id = self.id\n appointment_fee = self.appointment_fee\n # Get receipt_id of PreAuth apppointment fee\n receipt_id = JudoTransaction.find_by(appointment_id: appointment_id, payment_type: JudoTransaction.payment_types[\"PreAuth\"], amount: appointment_fee).try(:receipt_id)\n remain_fee = options[:amount] - appointment_fee\n\n puts \"=================options==#{options.inspect}\"\n card_number = payment_card.send :decode, payment_card.cc_num\n expiry_date = payment_card.expiry\n cvc = payment_card.send :decode, payment_card.cvc\n puts \"consumer_#{patient.phone_number}\"\n\n headers = {\"API-Version\" => 4.1, \"Content-Type\" => \"application/json\"}\n params = { :yourConsumerReference => \"consumer_#{patient.phone_number}\", \n :yourPaymentReference => \"payment_#{patient.phone_number}\", \n :yourPaymentMetaData => {}, \n :judoId => JUDOPAY[:id], \n :cardNumber => card_number, \n :expiryDate => expiry_date, \n :cv2 => cvc, \n :cardAddress => {\n :line1 => patient.address, \n :town => \"London\", \n :postCode => patient.zone.try(:name) }, \n :consumerLocation => { :latitude => patient.latitude, \n :longitude => patient.longitude },\n :mobileNumber => patient.phone_number, \n :emailAddress => patient.email\n }\n success = false\n params = params.merge(:amount => remain_fee)\n puts \"params = #{params.inspect}\"\n puts \"========\"\n puts \"========\"\n\n # Using Faraday\n conn = Faraday.new(:url => \"https://#{JUDOPAY[:token]}:#{JUDOPAY[:secret]}@#{JUDOPAY[:host]}/transactions\") do |faraday|\n faraday.request :url_encoded\n faraday.response :logger\n faraday.adapter Faraday.default_adapter\n end\n\n # Collect appointment fee preauth\n params_collect = {receiptId: receipt_id, amount: appointment_fee, yourPaymentReference: \"payment_#{patient.phone_number}\"}\n response_collect = conn.post do |req|\n req.url \"collections\"\n req.headers['Content-Type'] = 'application/json'\n req.headers['API-Version'] = '4.1'\n req.body = params_collect.to_json\n end\n response_collect = JSON.parse(response_collect.body)\n JudoTransaction.create_tran(response_collect.symbolize_keys, appointment_id)\n success_collect = (response_collect['result'] == 'Success')\n puts \"response_collect = #{response_collect.inspect}\"\n puts \"result_collect = #{response_collect['result']}\"\n\n # Charge remaining fee(total_invoice - apppointment_fee)\n if remain_fee > 0\n response = conn.post do |req|\n req.url \"#{options[:method]}\"\n req.headers['Content-Type'] = 'application/json'\n req.headers['API-Version'] = '4.1'\n req.body = params.to_json\n end\n response = JSON.parse(response.body)\n puts \"response = #{response.inspect}\"\n puts \"result = #{response['result']}\"\n success = (response['result'] == 'Success')\n JudoTransaction.create_tran(response.symbolize_keys, appointment_id)\n puts \"------success = #{success.inspect}-------\"\n else\n puts \"=================\"\n puts \"remaining_fee <= 0\"\n puts \"=================\"\n success = true\n end\n success\n end",
"title": ""
},
{
"docid": "841e6fc739057ac2e358b71894f6733d",
"score": "0.5227802",
"text": "def express\n response = EXPRESS_GATEWAY.setup_purchase(Order.new(cart_id: current_cart.id).price_in_cents,\n :ip => request.remote_ip,\n :return_url => new_order_url,\n :cancel_return_url => tools_url\n )\n redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)\n end",
"title": ""
},
{
"docid": "9b1365927014c493320064bcb656b7cf",
"score": "0.52128935",
"text": "def addClientSubmit\n @url = \"https://209.200.231.9/vsr3/reseller.api\"\n @login = \"#{session[:current_reseller1_login]}\"\n @password = \"#{session[:password]}\"\n\n @client_login = params[:login]\n @client_password = params[:password]\n @client_pin = params[:pin]\n @client_calls_limit = params[:calls_limit]\n temp_hash = params[:client]\n @tariff = temp_hash[\"tariff\"] rescue nil\n\n session[:client_login] = @client_login\n session[:client_pin] = @client_pin\n session[:client_calls_limit] = @client_calls_limit\n\n if isValidLogin(@client_login)\n if isValidPassword(@client_password)\n\n ####### PREFIX SD\n @data_sd = {\n \"jsonrpc\" => \"2.0\",\n \"id\" => 1,\n \"method\" => \"arrayOfPrefixesSD\",\n \"params\" => {}\n }.to_json\n\n @response_sd = RestClient::Request.new(\n :method => :post,\n :payload => @data_sd,\n :url => @url,\n :user => @login,\n :password => @password,\n :headers => { :accept => :json, :content_type => :json}).execute\n\n @result_sd = ActiveSupport::JSON.decode(@response_sd)\n\n ###### PREFIX ST\n\n @data_st = {\n \"jsonrpc\" => \"2.0\",\n \"id\" => 1,\n \"method\" => \"arrayOfPrefixesST\",\n \"params\" => {}\n }.to_json\n\n @response_st = RestClient::Request.new(\n :method => :post,\n :payload => @data_st,\n :url => @url,\n :user => @login,\n :password => @password,\n :headers => { :accept => :json, :content_type => :json}).execute\n\n @result_st = ActiveSupport::JSON.decode(@response_st)\n\n ####### PREFIX DP\n\n @data_dp = {\n \"jsonrpc\" => \"2.0\",\n \"id\" => 1,\n \"method\" => \"arrayOfPrefixesDP\",\n \"params\" => {}\n }.to_json\n\n @response_dp = RestClient::Request.new(\n :method => :post,\n :payload => @data_dp,\n :url => @url,\n :user => @login,\n :password => @password,\n :headers => { :accept => :json, :content_type => :json}).execute\n\n @result_dp = ActiveSupport::JSON.decode(@response_dp)\n\n ####### PREFIX TP\n\n @data_tp = {\n \"jsonrpc\" => \"2.0\",\n \"id\" => 1,\n \"method\" => \"arrayOfPrefixesTP\",\n \"params\" => {}\n }.to_json\n\n @result_tp = API_request(@login, @password, @url, @data_tp)\n\n ###### ADD RETAIL\n\n @data = {\n \"jsonrpc\" => \"2.0\",\n \"id\" => 1,\n \"method\" => \"addRetail\",\n \"params\" => {\n \"client\" => {\n \"login\" => \"#{@client_login}\",\n \"password\" => \"#{@client_password}\",\n \"pin\" => \"#{@client_pin}\" ,\n \"active\" => true,\n \"tariffName\" => @tariff,\n \"callLimit\" => @client_calls_limit,\n \"recognizeByANI\" => false,\n \"generateRingBack\" => false,\n \"connectImmediately\" => false,\n \"waitForBlindTransferResult\" => false,\n \"recordCalls\" => false,\n \"tariffToANI\" => false,\n \"tariffToDNIs\" => false,\n \"useInterIntraTariffs\" => false,\n \"getRateFromDesctination\" => false,\n \"prefixes\" => {\n \"SD\" => @result_sd[\"result\"][0],\n \"ST\" => @result_st[\"result\"][0],\n \"DP\" => @result_dp[\"result\"][0],\n \"TP\" => @result_tp[\"result\"][0],\n },\n }\n }\n }.to_json\n\n @result = API_request(@login, @password, @url, @data) \n\n if @result[\"error\"] \n flash[:error_adding] = \"Oops! Try again!\"\n else \n flash[:notice_added] = \"Hurray! Added!\"\n end\n else\n flash[:error_adding] = \"Password must be atleast 4 characters.\"\n redirect_to \"/reseller1s/addClient\"\n end\n else\n flash[:error_adding] = \"Login must be atleast 4 characters.\"\n redirect_to \"/reseller1s/addClient\"\n end\n\n end",
"title": ""
},
{
"docid": "630ea4c75d5beedf02d8630a87fe5797",
"score": "0.5212115",
"text": "def process_deliver_sm_response(pdu)\n accept_deliver_sm_response(pdu) # acknowledge its sending\n end",
"title": ""
},
{
"docid": "8e3c8e6d77b943f44b1a5e23ff8bc8f3",
"score": "0.52027553",
"text": "def judo_payment(options = {method: \"preauths\"})#(amount, card_number, expiry_date, cvc, options = {method: \"preauths\", amount: 0.0})\n patient = self.patient\n payment_card = self.paymentable\n appointment_id = self.id\n puts \"=================options==#{options.inspect}\"\n card_number = payment_card.send :decode, payment_card.cc_num\n expiry_date = payment_card.expiry\n cvc = payment_card.send :decode, payment_card.cvc\n puts \"consumer_#{patient.phone_number}\"\n headers = {\"API-Version\" => 4.1, \"Content-Type\" => \"application/json\"}\n params = { :yourConsumerReference => \"consumer_#{patient.phone_number}\", \n :yourPaymentReference => \"payment_#{patient.phone_number}\", \n :yourPaymentMetaData => {}, \n :judoId => JUDOPAY[:id], \n :cardNumber => card_number, \n :expiryDate => expiry_date, \n :cv2 => cvc, \n :cardAddress => {\n :line1 => patient.address, \n :town => \"London\", \n :postCode => patient.zone.try(:name) }, \n :consumerLocation => { :latitude => patient.latitude, \n :longitude => patient.longitude },\n :mobileNumber => patient.phone_number, \n :emailAddress => patient.email\n }\n success = false\n params = params.merge(:amount => (options[:amount] || self.appointment_fee))\n puts \"params = #{params.inspect}\"\n puts \"========\"\n puts \"========\"\n\n # Using Faraday\n conn = Faraday.new(:url => \"https://#{JUDOPAY[:token]}:#{JUDOPAY[:secret]}@#{JUDOPAY[:host]}/transactions\") do |faraday|\n faraday.request :url_encoded\n faraday.response :logger\n faraday.adapter Faraday.default_adapter\n end\n response = conn.post do |req|\n req.url \"#{options[:method]}\"\n req.headers['Content-Type'] = 'application/json'\n req.headers['API-Version'] = '4.1'\n req.body = params.to_json\n end\n response = JSON.parse(response.body)\n puts \"response = #{response.inspect}\"\n puts \"result = #{response['result']}\"\n success = (response['result'] == 'Success')\n if appointment_id.nil? && !success\n puts \"CASE 1\"\n success\n elsif appointment_id.present? && !success\n puts \"CASE 2\"\n # JudoTransaction.get_and_create_transaction(\"consumer_#{patient.phone_number}\", appointment_id)\n JudoTransaction.create_tran(response.symbolize_keys, appointment_id)\n \n else\n puts \"CASE 3\"\n # JudoTransaction.get_and_create_transaction(\"consumer_#{patient.phone_number}\", appointment_id)\n JudoTransaction.create_tran(response.symbolize_keys, appointment_id)\n success\n end\n\n puts \"------success = #{success.inspect}-------\"\n success\n end",
"title": ""
},
{
"docid": "c418ab3b3904d532226bebaf66ae8ce2",
"score": "0.5201357",
"text": "def wirecard_finish\n @order.update_attributes({:state => \"complete\", :completed_at => Time.now}, :without_protection => true)\n @order.finalize!\n redirect_to completion_route\n end",
"title": ""
},
{
"docid": "36f9f7238c3f115511b1ef89df0a59bc",
"score": "0.5199468",
"text": "def delivery_handler; end",
"title": ""
},
{
"docid": "47778bb2ede69e5ff705bdb8a10c1354",
"score": "0.5199055",
"text": "def checkout\n setup_response = gateway.setup_purchase(300,\n :ip => request.remote_ip,\n :return_url => url_for(:action => 'confirm', :only_path => false),\n :cancel_return_url => url_for(:action => 'index', :only_path => false)\n )\n redirect_to gateway.redirect_url_for(setup_response.token)\n end",
"title": ""
},
{
"docid": "b09c9c635b15f5d8a61099b9fc73476e",
"score": "0.51953197",
"text": "def callback\n @transaction.status = params[\"Status\"]\n @transaction.ipay88_payment_id = params[\"PaymentId\"].to_s\n @transaction.ref_no = params[\"RefNo\"] # Spree's order.number \n @transaction.ipay88_amount = params[\"Amount\"] # Stored seperately, in case\n @transaction.remark = params[\"Remark\"]\n @transaction.trans_id = params[\"TransId\"].to_s\n @transaction.auth_code = params[\"AuthCode\"]\n @transaction.error_description = params[\"ErrDesc\"] \n @transaction.signature = params[\"Signature\"]\n\n session[:access_token] = @transaction.order.guest_token if @transaction.order.respond_to?(:guest_token)\n session[:order_id] = @transaction.order.id\n\n if @transaction.next\n # Handles transaction states\n if @transaction.authorized? # Success\n session[:order_id] = nil\n flash[:success] = I18n.t(:success)\n # Google analytics part\n # flash[:commerce_tracking] = 'nothing special'\n if session[:access_token].nil?\n redirect_to order_path(@transaction.order, {:order_complete => true})\n else # Enables the url to be reused and copied else where a.k.a the page will still be displayed\n redirect_to order_path(@transaction.order, {:order_complete => true, :token => session[:access_token]})\n end\n else # Failure\n redirect_to edit_order_path(@transaction.order), :error => @transaction.error_description\n end\n else\n render 'error'\n end\n end",
"title": ""
},
{
"docid": "f97fd718daef7a7e8ccc88c62670edf7",
"score": "0.51951885",
"text": "def perform_purchase_with_generated_credit_card(session_id, owner_id, client_channel, locale, params, version, login, common_functions, total, cc, cc_enum, token)\n $tracer.trace(\"GameStopPurchaseOrderServiceDSL: #{__method__}, Line: #{__LINE__}\")\n $tracer.report(\"Should #{__method__}.\")\n ctype = cc[:ctype].to_s\n $tracer.report(\"Paid with Generated Credit Card: #{cc.inspect}\")\n card_type = ctype.slice(0, 1).capitalize + ctype.slice(1..-1)\n\n\n purchase_req = self.get_request_from_template_using_global_defaults(:purchase, PurchaseOrderServiceRequestTemplates.const_get(\"PURCHASE_WITH_CREDIT_CARD#{version}\"))\n purchase_req.find_tag(\"session_id\").at(0).content = session_id\n purchase_req.find_tag(\"purchase_order_owner_id\").at(0).content = owner_id\n purchase_req.find_tag(\"client_channel\").at(0).content = client_channel\n purchase_req.find_tag(\"locale\").at(0).content = locale\n\n purchase_req.find_tag(\"device_fingerprint\").remove_self\n purchase_req.find_tag(\"shipping_address_has_changed\").content = false\n purchase_req.find_tag(\"electronic_account\").remove_self\n purchase_req.find_tag(\"stored_value_payment_methods\").remove_self\n purchase_req.find_tag(\"targeting_context\").items.name_value_property.remove_self\n #purchase_req.find_tag(\"targeting_context\").items.name_value_property.name.content = \"Locale\"\n #purchase_req.find_tag(\"targeting_context\").items.name_value_property.value.content = \"en-US\"\n\n purchase_data = purchase_req.find_tag(\"purchase_request\").at(0)\n credit_card = purchase_data.credit_card.at(0)\n credit_card.billing_address.first_name.content = params['BillFirstName']\n credit_card.billing_address.last_name.content = params['BillLastName']\n credit_card.billing_address.address_id.content = generate_guid\n credit_card.billing_address.city.content = params['BillCity']\n credit_card.billing_address.country_code.content = params['BillCountryCode']\n credit_card.billing_address.format_validated.content = true\n credit_card.billing_address.line1.content = params['BillLine1']\n credit_card.billing_address.line2.content = params['BillLine2']\n credit_card.billing_address.postal_code.content = params['BillPostalCode']\n credit_card.billing_address.state.content = params['BillState']\n purchase_data.credit_card.is_tokenized.content = true\n purchase_data.credit_card.is_wallet_payment_method.content = false\n\n #purchase_data.credit_card.payment_account_number.content = cc[:cnum]\n purchase_data.credit_card.payment_account_number.content = token\n purchase_data.credit_card.expiration_month.content = cc[:expmnth]\n purchase_data.credit_card.expiration_year.content = cc[:expyr]\n purchase_data.credit_card.at(0).type.content = card_type #cc[:ctype]\n purchase_data.credit_card.csc.content = cc[:cvv]\n\n $tracer.trace(purchase_req.formatted_xml)\n purchase_rsp = self.purchase(purchase_req.xml)\n purchase_rsp.code.should == 200\n $tracer.trace(purchase_rsp.http_body.formatted_xml)\n\n dump_to_csv = \"false\"\n #dump to csv? -------------------------TODO ---------------------------- PUT THIS INTO THE DATASET CSV\n if dump_to_csv == \"true\"\n header = []\n test_info = []\n header << \"username, password, cc_number, cc_exp_month, cc_exp_year, cctype, cvv\"\n test_info << \"'#{username}','#{password}','#{cc[:cnum]}','#{cc[:expmnth]}','#{cc[:expyr]}','#{cc[:ctype]}','#{cc[:cvv]}'\"\n path = \"#{ENV['QAAUTOMATION_SCRIPTS']}/users_cards/\"\n Dir.mkdir(path) unless File.exists?(path)\n\n test_info.each do |i|\n csv_builder(test_info)\n CSV.open(\"#{path}\\\\users_and_cards.csv\", \"a\") do |csv|\n csv << @data\n end\n end\n end\n\n return purchase_rsp\n end",
"title": ""
},
{
"docid": "5f7fd4e3b18f127b6994d50d46b385d7",
"score": "0.51950854",
"text": "def successful_purchase_response\n end",
"title": ""
},
{
"docid": "5efe0918b0a59f3fed7130a257bcfa58",
"score": "0.5191293",
"text": "def paypoint_finish\n load_object\n\n opts = { :token => params[:token], :payer_id => params[:PayerID] }.merge all_opts(@order, params[:payment_method_id], 'payment' )\n gateway = paypal_gateway\n\n if Spree::Config[:auto_capture]\n ppx_auth_response = gateway.purchase((@order.total*100).to_i, opts)\n else\n ppx_auth_response = gateway.authorize((@order.total*100).to_i, opts)\n end\n\n if ppx_auth_response.success?\n #confirm status\n case ppx_auth_response.params[\"payment_status\"]\n when \"Completed\"\n txn_type = PaypalTxn::TxnType::CAPTURE\n when \"Pending\"\n txn_type = PaypalTxn::TxnType::AUTHORIZE\n else\n txn_type = PaypalTxn::TxnType::UNKNOWN\n Rails.logger.error \"Unexpected response from PayPal Express\"\n Rails.logger.error ppx_auth_response.to_yaml\n end\n\n paypal_account = PaypalAccount.find_by_payer_id(params[:PayerID])\n\n payment = @order.checkout.payments.create(:amount => ppx_auth_response.params[\"gross_amount\"].to_f,\n :source => paypal_account,\n :payment_method_id => params[:payment_method_id])\n\n PaypalTxn.create(:payment => payment,\n :txn_type => txn_type,\n :amount => ppx_auth_response.params[\"gross_amount\"].to_f,\n :message => ppx_auth_response.params[\"message\"],\n :payment_status => ppx_auth_response.params[\"payment_status\"],\n :pending_reason => ppx_auth_response.params[\"pending_reason\"],\n :transaction_id => ppx_auth_response.params[\"transaction_id\"],\n :transaction_type => ppx_auth_response.params[\"transaction_type\"],\n :payment_type => ppx_auth_response.params[\"payment_type\"],\n :response_code => ppx_auth_response.params[\"ack\"],\n :token => ppx_auth_response.params[\"token\"],\n :avs_response => ppx_auth_response.avs_result[\"code\"],\n :cvv_response => ppx_auth_response.cvv_result[\"code\"])\n\n\n @order.save!\n @checkout.reload\n #need to force checkout to complete state\n until @checkout.state == \"complete\"\n @checkout.next!\n end\n complete_checkout\n\n # even with auto_capture , an Auth might be returned / forced by PPX\n if Spree::Config[:auto_capture] && txn_type == PaypalTxn::TxnType::CAPTURE\n payment.finalize!\n end\n\n else\n order_params = {}\n gateway_error(ppx_auth_response)\n\n #Failed trying to complete pending payment!\n redirect_to edit_order_checkout_url(@order, :step => \"payment\")\n end\n rescue ActiveMerchant::ConnectionError => e\n gateway_error I18n.t(:unable_to_connect_to_gateway)\n redirect_to edit_order_url(@order)\n end",
"title": ""
},
{
"docid": "709c711ea820d2d441919f4607658362",
"score": "0.5187781",
"text": "def finish\n $NEO_LOGGER.info{\"tried to finish chained transaction #{@tx}\"}\n end",
"title": ""
},
{
"docid": "1bba677a1a3b47c0ce9ba87bdd5771b8",
"score": "0.51877743",
"text": "def send_success\n end",
"title": ""
},
{
"docid": "41d4dce71bc752081b8527f4498d7b33",
"score": "0.518777",
"text": "def do_success_response(response)\n response.create_ack.send\n # notify the Media Server of the SDP from the other party so that the media session can be setup and media starts\n sdp = response.get_content \n connection = response.get_session.getAttribute(\"NETWORK_CONNECTION\")\n sdp_manager = connection.get_sdp_port_manager\n sdp_manager.process_sdp_offer(sdp);\n end",
"title": ""
},
{
"docid": "ec33730c3359479818cf862ef09f0bde",
"score": "0.51864654",
"text": "def checkout\n PayPal::SDK.configure({\n :mode => \"sandbox\",\n :username => \"simon.king65-facilitator_api1.gmail.com\",\n :password => \"MLP7C4HCMZTT6A7Y\",\n :signature => \"AcbkD2jLSn.hCPB3rhfsE5wX8zSMAvxbibNzxPzROTihhXQOhWvagcfE\"\n })\n @api = PayPal::SDK::Merchant::API.new\n @set_express_checkout = @api.build_set_express_checkout({\n :Version => \"104.0\",\n :SetExpressCheckoutRequestDetails => {\n :ReturnURL => \"https://devtools-paypal.com/guide/expresscheckout/ruby?success=true\",\n :CancelURL => \"https://devtools-paypal.com/guide/expresscheckout/ruby?cancel=true\",\n :PaymentDetails => [{\n :OrderTotal =>{\n :currencyID => \"GBP\",\n :value => \"1.00\"},\n :PaymentAction => \"Sale\"}]\n }\n })\n debugger\n @set_express_checkout_response = @api.set_express_checkout(@set_express_checkout)\n debugger\n # total_as_cents, setup_purchase_params = get_setup_purchase_params @cart, request\n # setup_response = @gateway.setup_purchase(total_as_cents, setup_purchase_params)\n # debugger\n # redirect_to @gateway.redirect_url_for(setup_response.token)\n #response = EXPRESS_GATEWAY.setup_purchase(20, \n # ip: request.remote_ip,\n #return_url: \"www.kingclothing.com\",\n # cancel_return_url: \"cancel.kingclothing.com\",\n # currency: \"GBP\". \n # allow_guest_checkout: true,\n # items: [{name: \"Order\", description: \"Order description\", quantity: \"1\", amount: 1900}]\n # )\n # redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)\n end",
"title": ""
},
{
"docid": "18b307efe1d39840213a9fbbca838fc8",
"score": "0.51819855",
"text": "def process(txn, merchant_id, merchant_key)\n # Rails treats any blank field (x=\"\") as false (x=false), so any parameter that we wish to treat as optional\n # needs to be given a default value of \"\" here.\n optional = [:shipping]\n optional.each { |key| txn[key] ||= \"\" } # if it has a nil or false value, give it \"\" instead.\n\n @t_device_id = txn[:itid]\n\n\n # Kalopsia expects dates to be Date objects, but they might be Strings.\n dates = [:card_expiry_date, :start_date, :end_date]\n dates.each do |date_key|\n if txn[date_key].kind_of?(String)\n txn[date_key] = DateTime.parse(txn[date_key])\n end\n end\n\n actions = %w(sale sale_return pre_auth post_pre_auth force_sale void void_by_ton settlement batch_inquiry view_detail view_open view_settled)\n case txn[:action]\n when 'sale'\n case txn[:card_mode]\n # when 'debit' then do_debit_sale(txn)\n when 'credit' then do_credit_sale(txn)\n else raise \"invalid card mode: #{txn[:card_mode]} (expected one of 'debit', 'credit')\"\n end\n when \"void\" then do_void(txn)\n when \"settlement\" then do_settlement(txn)\n else raise \"action not found: #{txn[:action]} (expected one of #{actions.inspect})\"\n end\n end",
"title": ""
},
{
"docid": "18b307efe1d39840213a9fbbca838fc8",
"score": "0.51819855",
"text": "def process(txn, merchant_id, merchant_key)\n # Rails treats any blank field (x=\"\") as false (x=false), so any parameter that we wish to treat as optional\n # needs to be given a default value of \"\" here.\n optional = [:shipping]\n optional.each { |key| txn[key] ||= \"\" } # if it has a nil or false value, give it \"\" instead.\n\n @t_device_id = txn[:itid]\n\n\n # Kalopsia expects dates to be Date objects, but they might be Strings.\n dates = [:card_expiry_date, :start_date, :end_date]\n dates.each do |date_key|\n if txn[date_key].kind_of?(String)\n txn[date_key] = DateTime.parse(txn[date_key])\n end\n end\n\n actions = %w(sale sale_return pre_auth post_pre_auth force_sale void void_by_ton settlement batch_inquiry view_detail view_open view_settled)\n case txn[:action]\n when 'sale'\n case txn[:card_mode]\n # when 'debit' then do_debit_sale(txn)\n when 'credit' then do_credit_sale(txn)\n else raise \"invalid card mode: #{txn[:card_mode]} (expected one of 'debit', 'credit')\"\n end\n when \"void\" then do_void(txn)\n when \"settlement\" then do_settlement(txn)\n else raise \"action not found: #{txn[:action]} (expected one of #{actions.inspect})\"\n end\n end",
"title": ""
},
{
"docid": "1c714615b75fb949ef232794b537c111",
"score": "0.51807296",
"text": "def purchase_response\n if params[:accept]\n type = \"accepted\"\n status = \"confirmed\"\n alert = \"Consumer Accepted\"\n elsif params[:hold]\n type = \"on-hold\"\n status = \"hold\"\n alert = \"Consumer Paused Job\"\n elsif params[:end]\n type = \"rejected\"\n status = \"ended\"\n alert = \"Consumer ended Job\"\n end\n \n product = PurchasePart.find(params[:pro_id]) \n product.status = status\n product.user_id = params[:consumer_id]\n product.save\n pusher = Grocer.pusher(\n certificate: \"#{Rails.root}/public/expert.pem\", \n passphrase: \"Sybrant123\", \n gateway: \"gateway.sandbox.push.apple.com\", \n port: 2195, \n retries: 3 \n )\n # Environment variables are automatically read, or can be overridden by any specified options. You can also\n notification = Grocer::Notification.new(\n device_token: product.expert.user.device_token.device_token,\n alert: alert,\n sound: \"siren.aiff\",\n badge: 0,\n custom: {\"type\" => type, \"job\" => product.job_id, \"consumer\" => product.user.username}\n )\n\n pusher.push(notification)\n end",
"title": ""
},
{
"docid": "8bf3423feeaace06f39b51956f071878",
"score": "0.51799524",
"text": "def send_transaction\n body = build_xml_request\n\n headers = { }\n headers['Content-Length'] = body.size.to_s\n headers['User-Agent'] = \"Active Merchant -- http://activemerchant.org\"\n headers['Content-Type'] = 'application/x-www-form-urlencoded'\n\n # Return the raw response data\n ssl_post(Redsys.operations_url, \"entrada=\"+CGI.escape(body), headers)\n end",
"title": ""
},
{
"docid": "d2f53bdf8afcf52277897ca86b909a71",
"score": "0.51767635",
"text": "def connect\n begin\n connection = CreditCardServer.connect(...)\n yield connection # <--- this is when the block argument runs; in this case, `connection.send(amount, credit_card_number)`\n rescue IOError => e\n Logger.log \"Could not submit order #{@order_number} to the server: #{e}\"\n return nil\n ensure\n connection.close\n end\nend",
"title": ""
},
{
"docid": "f4fae9c4ca4bc23a348d16fead28ae49",
"score": "0.5174803",
"text": "def execute_buy\n \n # Product ID validity would have been verified during the execution of the method process_buy\n # product should not be nil \n if self.user && self.user.active\n @listing = Listing.new(:product_id => @response[\"product_id\"], :user_id => self.user.id, :quantity => @response[\"quantity\"], :listing_type_id => LISTING_TYPE_ID_BUY )\n @saved = @listing.save\n if @saved\n @response = \"Listed #{@listing.quantity} #{@listing.product.name.pluralize} for buying. Listing ID #{@listing.id}.\"\n else\n @response = \"Buy listing failed.\"\n end\n else\n @response = \"Your have not registered or your account has not yet been activated.\"\n end\n end",
"title": ""
},
{
"docid": "6f5d9002e3cdfad5a216d721131b90cc",
"score": "0.5172646",
"text": "def perform_remote_transaction\n begin\n Rails.logger.info(\"SWAPI #{Time.now.to_s} Starting transaction from #{self.from_wallet.address}\")\n client = SocialWallet::Client.new(\n api_endpoint: self.from_wallet.endpoint,\n api_key: self.from_wallet.api_key\n )\n # binding.pry\n resp = client.transactions.new(from_id: self.from_wallet.address,\n to_id: self.to_wallet.address,\n amount: self.amount.to_f,\n tags: [])\n rescue => e\n Rails.logger.info(\"SWAPI #{Time.now.to_s} Failed transaction from #{self.from_wallet.address}\")\n Rails.logger.info(\"ERROR: #{e}\")\n throw(:abort)\n else\n Rails.logger.info(\"SWAPI #{Time.now.to_s} Finished transaction from #{self.from_wallet.address}. TXID: #{resp['transaction-id']}\")\n self.txid = resp['transaction-id']\n end\n end",
"title": ""
},
{
"docid": "bc723a7c6dde22efe5e061b809251395",
"score": "0.5171999",
"text": "def send_to_client\n \n end",
"title": ""
},
{
"docid": "02800cebf273343ff78a82fd8a6ee78d",
"score": "0.51710856",
"text": "def acknowledge\n verify_response(params, @options[:secret])\n end",
"title": ""
},
{
"docid": "19646cb6377820cb7b773d291042f78d",
"score": "0.5168296",
"text": "def test\n ip = params[:nr] == '9' ? '192.168.1.2' : request.remote_ip\n # REQUEST\n case params[:nr]\n when /^(1|2|5|6|7|8|10)$/\n session[:payment_data] = {}\n session[:payment_data][:test] = params[:nr]\n rs = gateway.purchase(100,428,client_ip_addr: ip)\n if rs.success?\n session[:payment_data][:trans_id] = rs.params['TRANSACTION_ID']\n return redirect_to(gateway.go_out)\n else\n return render(:text => \"<pre>#{rs.message}</pre>\", :satus => 400)\n end\n when /^(3|4|9|11)$/\n session[:payment_data] = {}\n session[:payment_data][:test] = params[:nr]\n rs = gateway.authorize(100,428,ip,'tests')\n if rs.success?\n session[:payment_data][:trans_id] = rs.params['TRANSACTION_ID']\n return redirect_to(gateway.go_out)\n else\n return render(:text => \"<pre>#{rs.message}</pre>\", :satus => 400)\n end\n when /^(12)$/\n session[:payment_data] = {}\n session[:payment_data][:test] = params[:nr]\n rs = gateway.close_day\n return render(:text => \"<pre>#{rs.message}</pre>\")\n end\n\n # RESPONSE\n case session[:payment_data][:test]\n when /^(1|2|5|6|7|8)$/\n rs = gateway.get_trans_result(ip,session[:payment_data][:trans_id])\n msg = %^\n trans_id: #{session[:payment_data][:trans_id]} <br />\n <pre>#{rs.message}</pre>\n ^\n return render(:text => msg)\n when /^3|4|9$/\n rs = gateway.complete(session[:payment_data][:trans_id],100,428,ip,'tests')\n msg = %^\n trans_id: #{session[:payment_data][:trans_id]} <br />\n <pre>#{rs.message}</pre>\n ^\n return render(:text => msg)\n when /^(10|11)$/\n if session[:payment_data][:test] == '11'\n gateway.complete(session[:payment_data][:trans_id],100,428,ip,'tests')\n gateway.close_day\n end\n rs = gateway.reverse(session[:payment_data][:trans_id],100)\n msg = %^\n trans_id: #{session[:payment_data][:trans_id]} <br />\n <pre>#{rs.message}</pre>\n ^\n return render(:text => msg)\n end if session[:payment_data]\n render :text => \"USAGE: http://localhost:3000/first_data/test?nr=1\", :status => 400\n end",
"title": ""
},
{
"docid": "07fec4941a2e512563c743b0cdc7bf3c",
"score": "0.5160871",
"text": "def after_redeem() end",
"title": ""
},
{
"docid": "07fec4941a2e512563c743b0cdc7bf3c",
"score": "0.5160871",
"text": "def after_redeem() end",
"title": ""
},
{
"docid": "f993b9040636027240210ab9a0e8cd12",
"score": "0.5158985",
"text": "def proceed!\n info { \"negotiating algorithms\" }\n negotiate_algorithms\n exchange_keys\n @pending = false\n end",
"title": ""
},
{
"docid": "f11a890fc1e88b2702bbfa698bb3e077",
"score": "0.5153341",
"text": "def complete \n \n # TOTAL must be in cents \n @total = params[:order_total]\n @total_in_cents = (@total * 100).to_i\n \n # Confirm purchase\n purchase = gateway.purchase(@total_in_cents,\n :ip => request.remote_ip,\n :payer_id => params[:payer_id],\n :token => params[:token]\n )\n\n # FAIL?\n if !purchase.success?\n @message = purchase.message\n render :action => 'error'\n return\n else \n \n # Fetch items\n items = session[:purchase_ids]\n \n puts '-----------------------'\n puts 'Array size' + items.size.to_s\n puts '-----------------------'\n \n # Loop through each\n items.each do |i| \n \n puts 'CREATE PRODUCT'\n \n @product = Product.find(i)\n \n # Create purchase\n @purchase = Purchase.new\n @purchase.user = current_user\n @purchase.product = @product\n @purchase.confirmed = true\n @purchase.amount = @total\n @purchase.save\n \n puts '--------- LOL'\n puts @purchase.errors\n end\n \n redirect_to '/purchases'\n \n end\n end",
"title": ""
},
{
"docid": "ef648aef60f8c4a9f532b876d918c1af",
"score": "0.515077",
"text": "def receipt\n\n sim_response = AuthorizeNet::SIM::Response.new(params)\n if sim_response.valid_md5?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])\n @transaction_id = sim_response.transaction_id\n \n else\n render :text => 'Sorry, we failed to validate your response. Please check that your \"Merchant Hash Value\" is set correctly in the config/authorize_net.yml file.'\n end\n\n \n \n\n\n # @auth_code = params[:x_auth_code]\n # @orderid = params[:x_invoice_num]\n # @amount = params[:x_amount]\n # @number = params[:x_account_number]\n # @cardtype = params[:x_card_type]\n # @reason = params[:x_response_reason_text]\n # @code = params[:x_response_code]\n \n # if @code == '1'\n\n # @custledger = Customerledger.new()\n # @custledger.update_attributes(:InsertTime => Time.now, :PaymentType => 'CreditCard', :CCType => @cardtype, :CCNumber => @number, :Deposit => @amount, :Active => 1, :PropertyId => @orderid, :UpdateUserId => 1, :EntryDate => Time.now, :UpdateTime => Time.now, :UpdateReason => \"CC Entry From Road App\", :CCAuthNumber => @auth_code)\n # @custledgerorder = Customerledgerorder.new(:LedgerId => @custledger.LedgerId)\n # @custledgerorder.update_attributes(:OrderId => @orderid, :Deposit => @amount, :InsertTime => Time.now, :InsertUserId => 1, :UpdateTime => Time.now, :UpdateUserId => 1, :UpdateReason => \"CC Entry From Road App\")\n \n # else\n # flash[:notice] = \"Error\"\n # end\n end",
"title": ""
},
{
"docid": "1a0bfedc1b0f8dfa81ccbbdc48b34b46",
"score": "0.51472676",
"text": "def send_transaction\n body = build_cgi_request\n\n headers = { }\n headers['Content-Length'] = body.size.to_s\n headers['User-Agent'] = \"Active Merchant -- http://activemerchant.org\"\n headers['Content-Type'] = 'application/x-www-form-urlencoded'\n \n # Return the raw response data\n ssl_post(Ceca.operations_url, body, headers)\n end",
"title": ""
},
{
"docid": "dd4e0863a366f43eb711c4fc136d1285",
"score": "0.51451254",
"text": "def finish_setup\n @broker.failed.each do |id|\n p = {:agent_identity => @identity}\n p[:host], p[:port], p[:id], p[:priority] = @broker.identity_parts(id)\n @sender.send_push(\"/registrar/connect\", p)\n end\n true\n end",
"title": ""
},
{
"docid": "3c6d02af1e3c126eb055071f6945a7db",
"score": "0.514253",
"text": "def connect_reply(sock)\n # read the request\n start_time = Time.now\n request = read_request(sock)\n read_time = Time.now-start_time\n read_bytes = request.bytesize\n Protocol.log {|logger| logger.info(self.class) {\"Receive request:\\n#{request.to_s}\"}}\n\n # test the request\n accept = block_given? ? (yield request) : true\n\n # send back response\n response = Response.new\n response.version = SuperGossip::VERSION\n if accept\n response.code = OK\n response.message = 'OK'\n else\n response.code = ERROR\n response.message = 'ERROR'\n end\n @headers.each do |key,val|\n response.add_header(key,val)\n end\n\n start_time = Time.now\n response.bytesize = sock.write(response.to_s)\n upload_time = Time.now-start_time\n Protocol.log {|logger| logger.info(self.class) { \"Send response:\\n#{response.to_s}\"}}\n\n if accept # wait for response if accepted\n # read response\n start_time = Time.now\n response_received = read_response(sock)\n read_time += Time.now-start_time\n read_bytes += response_received.bytesize\n Protocol.log {|logger| logger.info(self.class) {\"Received response\\n:#{response_received.to_s}\"}}\n\n if response_received.code == OK\n return [true,[response.bytesize,upload_time,read_bytes,read_time]]\n end\n end\n [false,[response.bytesize,upload_time,read_bytes,read_time]]\n end",
"title": ""
},
{
"docid": "49ae7e6267da957f2568dab64961ec6c",
"score": "0.5130072",
"text": "def on_succeed; end",
"title": ""
},
{
"docid": "f95fa9163f49f1073d4bde913edfff2a",
"score": "0.5121681",
"text": "def send_transaction\n body = build_xml_request\n\n headers = { }\n headers['Content-Length'] = body.size.to_s\n headers['User-Agent'] = \"Active Merchant -- http://activemerchant.org\"\n headers['Content-Type'] = 'application/x-www-form-urlencoded'\n\n # Return the raw response data\n ssl_post(Sermepa.operations_url, \"entrada=\"+CGI.escape(body), headers)\n end",
"title": ""
},
{
"docid": "82228c83b56349ed61f0404af1316fd2",
"score": "0.5121099",
"text": "def relay_response\n sim_response = AuthorizeNet::SIM::Response.new(params)\n if sim_response.approved?\n currentTime = Time.new\n time = currentTime.strftime(\"%Y-%m-%d %H:%M:%S\")\n \n @invoiceNumber = sim_response.invoice_num\n @paramValues = @invoiceNumber.to_s + '-' \n @transaction_id = sim_response.transaction_id\n @response = sim_response.to_json\n hash = JSON.parse(@response)\n @response = '{\"raw_response\":{\"x_response_code\":\"' + hash['raw_response']['x_response_code'] + \n ' \",\" x_response_reason_code\":\"' + hash['raw_response']['x_response_reason_code'] + \n ' \",\" x_response_reason_text\":\"' + hash['raw_response']['x_response_reason_text'] +\n ' \",\" x_avs_code\":\"' + hash['raw_response']['x_avs_code'] +\n ' \",\" x_auth_code\":\"' + hash['raw_response']['x_auth_code'] +\n ' \",\" x_trans_id\":\"' + hash['raw_response']['x_trans_id'] +\n ' \",\" x_method\":\"' + hash['raw_response']['x_method'] +\n ' \",\" x_card_type\":\"' + hash['raw_response']['x_card_type'] +\n ' \",\" x_account_number\":\"' + hash['raw_response']['x_account_number'] +\n '\"}}'\n @userPaymentDetails = UserPaymentDetail.find_by(BLTransactionID: @invoiceNumber)\n if(!@userPaymentDetails.blank?)\n @userPaymentDetails.PayTransactionID = @transaction_id\n @userPaymentDetails.ResponseString = @response\n @userPaymentDetails.PaymentStatus = 1 \n @userPaymentDetails.ResponseDateTime = time \n @userPaymentDetails.DateUpdated = time\n @userPaymentDetails.save\n \n @userID = @userPaymentDetails.UserID\n \n @subscribedUser = SubscribedUser.find_by(id: @userID)\n @subscribedUser.IsSubscribed = 1\n @subscribedUser.DateUpdated = time\n @subscribedUser.save\n \n \n @userfirstName = @subscribedUser.FirstName\n @userlastName = @subscribedUser.LastName\n @useremail = @subscribedUser.EmailID\n @amount = @userPaymentDetails.TransactionAmount\n @authCode = \"\"\n if(!@subscribedUser.AuthCodeUsed)\n @key = Key.find_by(UserID: @subscribedUser.id)\n if(!@key.blank?)\n @authCode = @key.Key\n end\n end\n \n mail_to_admin = UserMailer.NewUserNotification(@userfirstName, @userlastName, @useremail, @invoiceNumber, @amount)\n mail_to_admin.deliver \n \n mail_to_user = UserMailer.WelcomeUser(@userfirstName, @userlastName, @useremail, @invoiceNumber, @amount, @authCode)\n mail_to_user.deliver \n @paramValues = @paramValues + @userID.to_s \n end\n @paramValues = @invoiceNumber.to_s + '-' + @userID.to_s \n render :text => sim_response.direct_post_reply(AUTHORIZE_NET_CONFIG['receipt_url'] + '?in=' + @paramValues)\n else\n @reason = sim_response.response_reason_text \n @userPaymentDetails = UserPaymentDetail.find_by(BLTransactionID: @invoiceNumber)\n if(!@userPaymentDetails.blank?)\n @userPaymentDetails.PayTransactionID = @transaction_id\n @userPaymentDetails.ResponseString = @response\n @userPaymentDetails.PaymentStatus = 0 \n @userPaymentDetails.ResponseDateTime = time \n @userPaymentDetails.DateUpdated = time\n @userPaymentDetails.save\n end\n render :text => sim_response.direct_post_reply(AUTHORIZE_NET_CONFIG['error_url'] + '?msg=' + @reason)\n end\n end",
"title": ""
},
{
"docid": "13f7666f057a667bf1875fad54652b11",
"score": "0.51173943",
"text": "def buy_card_from_callingroup\n doc = Builder::XmlMarkup.new(:target => out_string = \"\", :indent => 2)\n doc.instruct! :xml, :version => \"1.0\", :encoding => \"UTF-8\"\n doc.page {\n cg = Cardgroup.includes([:tariff, :lcr, :location, :tax]).where(:id => @values[:id], :owner_id => @current_user.get_correct_owner_id).first\n cards_size = @values[:quantity].to_i < 1 ? 1 : @values[:quantity].to_i\n if cg\n cards = cg.cards.where(:sold => 0).limit(cards_size).order(\"rand()\")\n unless cards.blank?\n doc.cards {\n for card in cards\n if card.sell\n if params[:email]\n order = Ccorder.new()\n order.amount = card.balance\n order.currency = Currency.get_default.name\n order.ordertype = 'unspecified'\n order.date_added = Time.now\n order.completed = 1\n order.email = params[:email]\n order.tax_percent = 0\n order.save\n\n line_item = Cclineitem.new()\n line_item.cardgroup_id = card.cardgroup_id\n line_item.quantity = 1\n line_item.ccorder_id = order.id\n line_item.price = card.balance\n line_item.card_id = card.id\n line_item.save\n\n thread = Thread.new(order) { |order|\n EmailsController::send_to_users_paypal_email(order)\n }\n end\n\n Action.add_action_hash(@current_user, {:action => 'card_sell_over_api', :target_id => card.id, :target_type => 'Card'})\n doc.card {\n doc.pin(card.pin)\n doc.number(card.number)\n doc.balance_without_vat(card.balance)\n doc.currency(Currency.get_default.name)\n }\n else\n doc.error('Card error') #= MorApi.return_error(\"Card error\", doc)\n end\n end\n }\n else\n doc.error('Free cards was not found') #= MorApi.return_error(\"Free cards was not found\", doc)\n end\n else\n doc.error('Cardgroup was not found') #= MorApi.return_error(\"Cardgroup was not found\", doc)\n end\n }\n send_xml_data(out_string, params[:test].to_i)\n end",
"title": ""
},
{
"docid": "3a5fe0a317996cc4ce34e47066d42805",
"score": "0.5106857",
"text": "def finish\n super\n response\n end",
"title": ""
},
{
"docid": "2571f5b9280df8593503206114d4f4cd",
"score": "0.51056594",
"text": "def complete\n logger.info( \"params: #{params.inspect}\" )\n \n @cart = current_user.carts.find( params[:invoice] || params[:id] )\n record_not_found and return if @cart.nil?\n \n # if cart still ON_SESSION for paypal that is because there was no\n # a paypal notification or this is a transfer \n if @cart.status == Cart::STATUS[:ON_SESSION]\n # @cart.update_attribute( :status, Cart::STATUS[:NOT_NOTIFIED] )\n if @cart.payment_type == 'transfer'\n @cart.update_attribute(:status, Cart::STATUS[:WAIT_TRANSFER])\n else\n @cart.update_attribute( :status, Cart::STATUS[:NOT_NOTIFIED] )\n end\n end\n \n # @cart.update_attribute( :paypal_complete_params, params )\n @cart.update_attribute( :paypal_complete_params, params ) if @cart.payment_type == 'paypal'\n \n if @cart.status == Cart::STATUS[:WAIT_TRANSFER]\n flash.now[:notice] = \"Done! Please transfer the funds as soon as possible!\"\n elsif @cart.status == Cart::STATUS[:COMPLETED]\n flash.now[:notice] = 'Payment was successful!'\n else\n # still here? something has gone wrong\n flash.now[:error] = 'Something went wrong during the payment process, please contact us!'\n end\n end",
"title": ""
},
{
"docid": "f1f339fc66c58f36c84c564b5d2dfcfa",
"score": "0.50984323",
"text": "def call_remote(expanded)\r\n # Fill in the blanks of the SOAP envelope with our\r\n # session ID and the expanded XML of our request.\r\n request = (Envelope % [@session_id, expanded])\r\n \r\n # gzip request\r\n request = encode(request)\r\n\r\n headers = {\r\n 'Connection' => 'Keep-Alive',\r\n 'Content-Type' => 'text/xml',\r\n 'SOAPAction' => '\"\"',\r\n 'User-Agent' => 'activesalesforce rforce/1.0'\r\n }\r\n\r\n headers['Accept-Encoding'] = 'gzip'\r\n headers['Content-Encoding'] = 'gzip'\r\n\r\n # Send the request to the server and read the response.\r\n response = @server.post2(@url.path, request.lstrip, headers)\r\n\r\n # decode if we have encoding\r\n content = decode(response)\r\n\r\n SoapResponse.new(content).parse\r\n end",
"title": ""
},
{
"docid": "64609cb84b9680d01881f3fc5d05da1d",
"score": "0.5097463",
"text": "def processCall\n prefix, number = getInput { checkValidNumber Cfg.get.prefixes }\n iNo = internationalize Cfg.get.country_code, number\n product = chooseProduct Cfg.get.prefixes[prefix], Cfg.get.providers[prefix]\n \n hangup :thankYou unless product\n \n accountNo, pin = getInput { checkAccount }\n voucher = @bizmodel.consume(accountNo, pin, product)\n \n @bizmodel.notifyViaSMS(iNo, \"Your recharge code for #{number} is #{voucher}. Have a nice day!\", \n Cfg.get.sms_api_id, Cfg.get.sms_user, Cfg.get.sms_password) if voucher \n \n hangup :thankYou\n \n # handle exceptions by letting the user know what went wrong, then hanging up\n # is there a cleaner way?\n rescue Exceptions::InsufficientBalance\n hangup :insufficientBalance\n rescue Exceptions::OutOfStock\n hangup :outOfStock\n rescue Exceptions::BadCredentials \n hangup :badCredentials\n rescue Exceptions::VoucherAlreadyUsed\n hangup :voucherAlreadyUsed\n rescue Exceptions::BruteForce\n hangup :bruteForce\n rescue Exceptions::TransactionFailed\n hangup :transactionFailed\n rescue Exceptions::InvalidInput\n hangup :invalidInput\n rescue Exception => e\n info \"Exception: #{e.message}\\n#{e.backtrace}\"\n hangup :systemError\n end",
"title": ""
},
{
"docid": "e6df7989dd82aa5186dcf0a2f6e3a1f4",
"score": "0.509553",
"text": "def callback\n\n\t\tif not params[:is_success] == 'T'\n\t\t\tredirect_to \"/\" and return\n\t\tend\n\n\t\tparams.delete \"action\"\n\t\tparams.delete \"controller\"\n\t\tparams.delete \"format\"\n\t\tparams.delete \"sign_type\"\n\t\tsign = params.delete \"sign\"\n\n\t\tcleartxt = params.map { |k, v| \"#{k}=#{v}\" }.sort().join ('&')\n\t\tcipher = Digest::MD5.hexdigest(cleartxt + Refinerycms::Application.config.alipay_key)\n\n\t\tif not sign == cipher\n\t\t\tredirect_to \"/\" and return\n\t\tend\n\n\t\tserver_verification = {\n\t\t\t:service => \"notify_verify\",\n\t\t\t:partner => Refinerycms::Application.config.alipay_pid,\n\t\t\t:notify_id => params[:notify_id]\n\t\t}\n\t\tif not open(Refinerycms::Application.config.alipay_gateway + \"?\" + server_verification.to_param).read == \"true\"\n\t\t\tredirect_to \"/\" and return\n\t\tend\n\n\t\t@order = Order.find :first, :conditions => { :order_id => params[:out_trade_no] }\n\t\t@order.alipay_cb_buyer_email = params[:buyer_email]\n\t\t@order.alipay_cb_buyer_id = params[:buyer_id]\n\t\t@order.alipay_cb_notify_time = params[:notify_time] && params[:notify_time].to_datetime\n\t\t@order.alipay_cb_total_fee = params[:total_fee].to_f\n\t\t@order.alipay_cb_trade_no = params[:trade_no]\n\t\t@order.alipay_cb_trade_status = params[:trade_status]\n\n\t\tif params[:trade_status] == \"TRADE_FINISHED\" or params[:trade_status] == \"TRADE_SUCCESS\"\n\t\t\tif params[:total_fee].to_f >= @order.expected_total_fee\n\t\t\t\t@order.order_status = 1\n\t\t\t\t@order.pay_status = 1\n\t\t\t\t@order.pay_date = Date.today()\n\t\t\telsif not @order.order_status == 1\n\t\t\t\t@order.order_status = 11\n\t\t\t\t@order.pay_status = 11\n\t\t\t\t@order.pay_date = Date.today()\n\t\t\tend\n\n\t\telsif not @order.order_status == 1\n\t\t\t@order.order_status = 12\n\t\t\t@order.pay_status = 12\n\t\tend\n\n\t\t@order.got_order = 0\n\t\t@order.save\n\n\t\tsession[:cart] = nil\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to \"/pages/50\" }\n\t\t\tformat.json { render :json => { :status => 1 } }\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "b0ac12c9958e1cbbdac31a1b23c2f6d2",
"score": "0.50927895",
"text": "def call_remote(expanded)\n # Fill in the blanks of the SOAP envelope with our\n # session ID and the expanded XML of our request.\n request = (Envelope % [@session_id, expanded])\n \n puts expanded.inspect\n # gzip request\n request = encode(request)\n\n headers = {\n 'Connection' => 'Keep-Alive',\n 'Content-Type' => 'text/xml',\n 'SOAPAction' => '\"\"',\n 'User-Agent' => 'activesalesforce rforce/1.0'\n }\n\n headers['Accept-Encoding'] = 'gzip'\n headers['Content-Encoding'] = 'gzip'\n\n # Send the request to the server and read the response.\n response = @server.post2(@url.path, request.lstrip, headers)\n\n # decode if we have encoding\n content = decode(response)\n\n SoapResponse.new(content).parse\n end",
"title": ""
},
{
"docid": "61f02dcceb67fe63dda17083c7cab34e",
"score": "0.50811535",
"text": "def complete_purchase(params)\n @payment.confirmed!\n @payment.clear_payment!\n response = gateway.purchase(@payment.amount_as_cents, \n :token => params[\"token\"], \n :payer_id => params[\"PayerID\"])\n dawdle\n test_checkpoint_notify_and_wait(:called_purchase)\n if response.success?\n @payment.cleared!\n test_checkpoint_notify_and_wait(:finished_complete_purchase_with_success)\n response.params\n else\n @payment.update_attribute('error_details', response.inspect)\n @payment.fail!\n false\n end\n end",
"title": ""
},
{
"docid": "137cad2100387a8f723ea79a39219714",
"score": "0.5069488",
"text": "def execute_payment(payKey)\n p \"******************** EXECUTE PAYMENT ****************\"\n # THIS METHOD WILL TRANSFER THE MONEY FROM THE MARKETPLACE ACCOUNT TO THE SELLER ACCOUNT\n PayPal::SDK::REST.set_config(\n :mode => \"sandbox\", # \"sandbox\" or \"live\"\n :client_id => \"Af0EUFLYeORF4IQUN80nmTsxLgpYrHTTGfR8q7rqmVxG89muFsQMYd40dTzEL3_8-uY4TjEIrBUjmu9e\",\n :client_secret => \"EJ-U97HKBhSVonBEutXxkNjDNfZ7HygUSG4am7f2RjpxJPaDpXsz82YLYB4TY0Vh2W3R55G_ExxwiocU\")\n\n transaction = Transaction.where(\"paypal_paykey = ?\", payKey).last\n \n unless transaction.deposit_cents.nil?\n amount = transaction.amount - transaction.deposit_cents\n else\n amount = transaction.amount\n end\n\n @payout = PayPal::SDK::REST::Payout.new(\n {\n :sender_batch_header => {\n :sender_batch_id => SecureRandom.hex(8),\n :email_subject => 'You have a Payout!',\n },\n :items => [\n {\n :recipient_type => 'EMAIL',\n :amount => {\n :value => (amount).to_i - ((amount) * 0.1).to_i,\n :currency => 'AUD'\n },\n :note => 'Thanks!',\n :receiver => transaction.seller.paypal_account\n }\n ]\n }\n )\n\n p \"*************** PAYOUT ************* #{@payout} *****************\"\n begin\n @payout_batch = @payout.create\n Rails.logger.info \"Created Payout with [#{@payout_batch.batch_header.payout_batch_id}]\"\n rescue ResourceNotFound => err\n Rails.logger.error @payout.error.inspect\n end\n\n end",
"title": ""
},
{
"docid": "3bb53d0732388d0a1060226c2aa534cc",
"score": "0.50644964",
"text": "def new_merchant(merchant)\n @merchant = merchant\n greeting(\"Admin\")\n mail from: SENDER_EMAIL\n end",
"title": ""
},
{
"docid": "5ee66ccb68c36475e766874bf6399050",
"score": "0.5062504",
"text": "def followup\n body = body_retrieve\n response = self.class.get('/connect', :query => body)\n\n handle(response) { PlaidResponse.new(response, \"Successfully retrieved Transactions\") }\n end",
"title": ""
},
{
"docid": "aca330278aa223def93e14f83b3fb516",
"score": "0.50609726",
"text": "def acknowledge\n verify_response(params, @options[:secret])\n end",
"title": ""
},
{
"docid": "b1acd018432761711edf300b6d0a7b26",
"score": "0.50597537",
"text": "def make_saas_api_call\n\n r = SaasApi::OnBoarding::GrantEth.new.perform(\n client_id: @client_id,\n ethereum_address: @eth_address, amount: @amount\n )\n\n unless r.success?\n @chain_interaction.status = GlobalConstant::CriticalChainInteractions.failed_status\n @chain_interaction.response_data = r.to_hash\n @chain_interaction.save!\n return r\n end\n\n @chain_interaction.transaction_uuid = r.data[:transaction_uuid]\n @chain_interaction.transaction_hash = r.data[:transaction_hash]\n @chain_interaction.status = GlobalConstant::CriticalChainInteractions.processed_status\n @chain_interaction.save!\n\n r\n\n end",
"title": ""
},
{
"docid": "2a99eadaec3e61b6a1685dc21dfd62ba",
"score": "0.5055283",
"text": "def offer_contract\n\n end",
"title": ""
},
{
"docid": "56e5f5707be77b15bf4aa61d6a0e1803",
"score": "0.50549215",
"text": "def authorize\n ActiveRecord::Base.logger.debug 'authorize:'\n int = Integration.first\n body = {\n \"merchid\" => int.cc_merchant_id,\n \"account\" => self.account,\n \"expiry\" => self.expiry,\n \"amount\" => (self.amount*100).to_i.to_s,\n \"currency\" => int.cc_currency_code,\n \"capture\" => 'Y',\n \"receipt\" => 'Y',\n \"orderid\" => self.reservation_id\n } \n body[\"cvv2\"] = self.cvv2 if int.cc_use_cvv?\n dest = int.cc_endpoint + '/cardconnect/rest/auth'\n # ActiveRecord::Base.logger.debug \"authorize: dest is #{dest}\"\n resp = put(dest, body, true)\n # ActiveRecord::Base.logger.debug \"authorize: #{resp.status}\"\n if resp.success?\n body = JSON.parse resp.body\n # ActiveRecord::Base.logger.info \"authorize response: #{body.inspect}\"\n # do not log account\n ActiveRecord::Base.logger.info \"authorize response: #{body.slice( \"signature\", \"name\", \"expiry\", \"batchid\", \"resptext\", \"amount\", \"cvvresp\", \"token\",\n\t\t\t\t \"respcode\", \"authcode\", \"avsresp\", \"respstat\", \"retref\", \"respproc\",\n\t\t\t\t \"orderid\", \"bintype\", \"entrymode\", \"commcard\", \"emv\", \"emvTagData\", \"receiptData\").inspect}\"\n update_attributes body.slice( \"signature\", \"name\", \"expiry\", \"batchid\", \"resptext\", \"amount\", \"cvvresp\", \"token\",\n\t\t\t\t \"respcode\", \"account\", \"authcode\", \"avsresp\", \"respstat\", \"retref\", \"respproc\",\n\t\t\t\t \"orderid\", \"bintype\", \"entrymode\", \"commcard\", \"emv\", \"emvTagData\", \"receipt\")\n case body[\"respstat\"]\n when 'A' # Approved\n\tActiveRecord::Base.logger.info \"authorize: Approved\"\n # create payment\n when 'B' # retry\n\tActiveRecord::Base.logger.info \"authorize: Retry\"\n when 'C' # declined\n\tActiveRecord::Base.logger.info \"authorize: Declined\"\n else\n\tActiveRecord::Base.logger.info \"authorize: unrecognized respstat #{body['respstat']}\"\n end\n else\n errors.add :base, \"communication failure: #{resp.status}\"\n # do not log account\n ActiveRecord::Base.logger.info \"authorize response: #{body.slice( \"signature\", \"name\", \"expiry\", \"batchid\", \"resptext\", \"amount\", \"cvvresp\", \"token\",\n\t\t\t\t \"respcode\", \"authcode\", \"avsresp\", \"respstat\", \"retref\", \"respproc\",\n\t\t\t\t \"orderid\", \"bintype\", \"entrymode\", \"commcard\", \"emv\", \"emvTagData\", \"receiptData\").inspect}\"\n end\n return resp\n rescue => err\n errors.add :base, \"processing error: #{err.to_s}\"\n return false\n end",
"title": ""
},
{
"docid": "66016570187dea878570486de1c9228d",
"score": "0.50540966",
"text": "def purchase_request\n 'entrada=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3CREQUEST%3E%3CDATOSENTRADA%3E%3CDS_Version%3E0.1%3C%2FDS_Version%3E%3CDS_MERCHANT_CURRENCY%3E978%3C%2FDS_MERCHANT_CURRENCY%3E%3CDS_MERCHANT_AMOUNT%3E100%3C%2FDS_MERCHANT_AMOUNT%3E%3CDS_MERCHANT_ORDER%3E144742736014%3C%2FDS_MERCHANT_ORDER%3E%3CDS_MERCHANT_TRANSACTIONTYPE%3E0%3C%2FDS_MERCHANT_TRANSACTIONTYPE%3E%3CDS_MERCHANT_PRODUCTDESCRIPTION%2F%3E%3CDS_MERCHANT_TERMINAL%3E1%3C%2FDS_MERCHANT_TERMINAL%3E%3CDS_MERCHANT_MERCHANTCODE%3E091952713%3C%2FDS_MERCHANT_MERCHANTCODE%3E%3CDS_MERCHANT_TITULAR%3ELongbob+Longsen%3C%2FDS_MERCHANT_TITULAR%3E%3CDS_MERCHANT_PAN%3E4548812049400004%3C%2FDS_MERCHANT_PAN%3E%3CDS_MERCHANT_EXPIRYDATE%3E1709%3C%2FDS_MERCHANT_EXPIRYDATE%3E%3CDS_MERCHANT_CVV2%3E123%3C%2FDS_MERCHANT_CVV2%3E%3C%2FDATOSENTRADA%3E%3CDS_SIGNATUREVERSION%3EHMAC_SHA256_V1%3C%2FDS_SIGNATUREVERSION%3E%3CDS_SIGNATURE%3Ef46TQxKLJJ6SjcETDp%2Bul92Qsb5kVve2QzGnZMj8JkI%3D%3C%2FDS_SIGNATURE%3E%3C%2FREQUEST%3E'\n end",
"title": ""
},
{
"docid": "25c680406c5fb72b128645451d99b843",
"score": "0.5053566",
"text": "def process\n\t\t\thttp = Net::HTTP.new @gateway_server, 443\n\t\t\thttp.use_ssl = true\n\t\t\tresp, body = http.post(@gateway_page, url_data)\n\t\t\t@gateway_response = body\t\t\n\t\t\ttrue\n\t\tend",
"title": ""
},
{
"docid": "fbc70259dd7c4adf48877468258a9f4a",
"score": "0.504753",
"text": "def execute_send_authorize_request(parameters, connector)\n payload = self.fill_dictionary(parameters, [\n MERCHANT,\n OPERATIONID,\n CURRENCYCODE,\n AMOUNT,\n CSBTCITY,\n CSSTCITY,\n CSBTCOUNTRY,\n CSSTCOUNTRY,\n CSBTEMAIL,\n CSSTEMAIL,\n CSBTFIRSTNAME,\n CSSTFIRSTNAME,\n CSBTLASTNAME,\n CSSTLASTNAME,\n CSBTPHONENUMBER,\n CSSTPHONENUMBER,\n CSBTPOSTALCODE,\n CSSTPOSTALCODE,\n CSBTSTATE,\n CSSTSTATE,\n CSBTSTREET1,\n CSSTSTREET1,\n CSBTCUSTOMERID,\n CSBTIPADDRESS,\n CSPTCURRENCY,\n CSPTGRANDTOTALAMOUNT,\n CSMDD7,\n CSMDD8,\n CSMDD9,\n CSMDD10,\n CSMDD11,\n CSMDD12,\n CSMDD13,\n CSMDD14,\n CSMDD15,\n CSMDD16,\n CSITPRODUCTCODE,\n CSITPRODUCTDESCRIPTION,\n CSITPRODUCTNAME,\n CSITPRODUCTSKU,\n CSITTOTALAMOUNT,\n CSITQUANTITY,\n CSITUNITPRICE])\n\n #default values\n payload[:AVAILABLEPAYMENTMETHODSIDS]= '1#194#43#45'\n payload[:PUSHNOTIFYMETHOD]= ''\n payload[:PUSHNOTIFYENDPOINT]= ''\n payload[:PUSHNOTIFYSTATES]= ''\n\n request = self.fill_dictionary(parameters, [SECURITY,\n MERCHANT,\n ENCODING_METHOD,\n URL_OK,\n URL_ERROR,\n EMAIL_CLIENTE,\n SESSION])\n\n response = connector.sendAuthorizeRequest(request, payload)\n\n parameters = self.fill_post_send_authorize_request(parameters, response)\n\n return response\n end",
"title": ""
},
{
"docid": "15682e15e20f660f05dfbea381e1824d",
"score": "0.5039518",
"text": "def relay_response\n # sim_response = AuthorizeNet::SIM::Response.new(params)\n # if sim_response.success?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])\n # render :text => sim_response.direct_post_reply(payments_receipt_url(:only_path => false), :include => true)\n # else\n # render\n # end\n \n # payments_receipt_url(:only_path => false) \n \n redirect_to :action => \"receipt\"\n \n end",
"title": ""
},
{
"docid": "96c8bfc5163b8c250b1fd950b530ece7",
"score": "0.50386935",
"text": "def test_successful_store\n response = @gateway.store(credit_card('4111111111111111'), @profile_options)\n assert_success response\n end",
"title": ""
},
{
"docid": "1421df35cbd457723222e61d3dff9d95",
"score": "0.5036827",
"text": "def exit_verifying_payment; end",
"title": ""
},
{
"docid": "0a793ef86f31abcf5eec5b904a9c2ed4",
"score": "0.5032166",
"text": "def test_purchase_and_void\n purchase = @gateway.purchase(@amount, @credit_card, @options)\n assert_success purchase\n\n void = @gateway.void(purchase.authorization)\n assert_success void\n assert_equal 'The transaction was successful', void.message\n assert_equal 'accepted', void.params['status']\n assert void.params['transid']\n end",
"title": ""
},
{
"docid": "998d3fa4897211ad6e254b1045387dad",
"score": "0.5030397",
"text": "def create_transfer_from_trade_to_vessel\n # Let's authenticate on CXL before sending any XML\n auth_response = ApplicationHelper.authenticate\n\n if auth_response['success'] == true\n\n else\n render :json => { :success => false }\n end\n end",
"title": ""
},
{
"docid": "216e4f2ddaa0681fb991fe223f7e4c81",
"score": "0.50293887",
"text": "def post_connect\n end",
"title": ""
},
{
"docid": "092524904259f048ae84efc19dace6ba",
"score": "0.5027986",
"text": "def deliver; end",
"title": ""
},
{
"docid": "4d86d9af1f53c047a8e33e648d08b10d",
"score": "0.5027514",
"text": "def b_test_for_get_contacts_after_pay \n root_path = MeConstant.find_by_title('root_path').content\n \n \n #pay+me_liqpay = MeLiqpay.find_by_me_number(1)\n #pay+public_key = me_liqpay.public_key\n #pay+private_key = ENV['lp_private_key']\n \n #pay+data = params[:data] \n #pay+data_json = Base64.decode64(data) \n #pay+data_hash = JSON.parse(data_json)\n \n \n #pay+liqpay = Liqpay::Liqpay.new(\n #pay+ :public_key => public_key,\n #pay+ :private_key => private_key\n #pay+) \n \n #pay+sign = liqpay.str_to_sign(\n #pay+private_key +\n #pay+data +\n #pay+private_key\n #pay+) \n#_______________________________________________________________________________\n \n \n \n #pay+if sign == params[:signature]\n #pay+if data_hash[\"status\"].in? ['success', 'sandbox'] \n \n \n \n \n details = params[:details] \n \n details_encoded = details\n details_encoded[details_encoded.length-1] = ''\n details = Base64.decode64(details_encoded) \n \n \n \n order_id_length = '' \n for i in 0..details.length-1\n unless details[i].in? ('a'..'z')\n order_id_length += details[i]\n else\n break\n end\n end\n order_id_length = order_id_length.to_i\n \n order_id = ''\n for i in (details.length-order_id_length)..(details.length-1)\n order_id += details[i]\n end \n \n order_akey = ''\n for i in (order_id_length-1)..(details.length-1 - order_id_length)\n order_akey += details[i]\n end \n#______________________________________\n \n \n test_url_hash = {\n :t => '2',\n :q => '1',\n :oi => @order.id,\n :oa => @order.akey,\n :ps => '0',\n :po => '0',\n :ne => '0'\n \n #:test_number => '2',\n #:qw_number => '1',\n #:order_id => @order.id,\n #:order_akey => @order.akey,\n #:psihot => '0',\n #:pogranich => '0',\n #:nevrot => '0' \n } \n \n test_url_json = JSON.generate(test_url_hash)\n test_url_encoded_64 = (Base64.encode64 test_url_json).chomp.delete(\"\\n\")\n test_url_encoded = test_url_encoded_64 + '=' \n test_url = root_path + 'test/' + test_url_encoded \n \n#______________________________________ \n \n \n order = Order.find(order_id) \n order.payed = true\n order.pay_link = ''\n order.when_payed = Time.now.utc\n \n unless order.sent_email_with_test\n #OrderMailer.b_test_to_client_for_get_contacts_after_cool_pay(order, test_url).deliver \n order.sent_email_with_test = true\n end \n \n order.save \n#_______________________________________________________________________________\n \n \n \n #else\n # redirect_to '/'\n #pay+end \n #else\n # redirect_to '/' \n #pay+end \n \n \n #pay-\n redirect_to test_url\n end",
"title": ""
},
{
"docid": "1e5161175984f439f649bcd06a1fc799",
"score": "0.50233954",
"text": "def receive_stanza(stanza)\n begin\n case @state\n when :connected\n super # Can be dispatched\n\n when :wait_for_stream\n if stanza.name == \"stream:stream\" && stanza.attributes['id']\n @state = :wait_for_auth_mechanisms unless @success\n @state = :wait_for_bind if @success\n end\n\n when :wait_for_auth_mechanisms\n if stanza.name == \"stream:features\"\n if stanza.at(\"starttls\") # we shall start tls\n starttls = Nokogiri::XML::Node.new(\"starttls\", @outstream)\n starttls[\"xmlns\"] = \"urn:ietf:params:xml:ns:xmpp-tls\"\n send(starttls)\n @state = :wait_for_proceed\n elsif stanza.at(\"mechanisms\") # tls is ok\n if stanza.at(\"mechanisms/[contains(mechanism,'PLAIN')]\")\n # auth_text = \"#{jid.strip}\\x00#{jid.node}\\x00#{password}\"\n auth = Nokogiri::XML::Node.new(\"auth\", @outstream)\n auth['mechanism'] = \"PLAIN\"\n auth['xmlns'] = \"urn:ietf:params:xml:ns:xmpp-sasl\"\n auth.content = Base64::encode64([jid, jid.split(\"@\").first, @password].join(\"\\000\")).gsub(/\\s/, '')\n send(auth)\n @state = :wait_for_success\n end\n end\n end\n\n when :wait_for_success\n if stanza.name == \"success\" # Yay! Success\n @success = true\n @state = :wait_for_stream\n @parser.reset\n send @outstream.root.to_xml.split('<paste_content_here/>').first\n elsif stanza.name == \"failure\"\n if stanza.at(\"bad-auth\") || stanza.at(\"not-authorized\")\n raise AuthenticationError\n else\n end\n else\n # Hum Failure...\n end\n\n when :wait_for_bind\n if stanza.name == \"stream:features\"\n if stanza.at(\"bind\")\n # Let's build the binding_iq\n @binding_iq_id = Integer(rand(10000))\n builder = Nokogiri::XML::Builder.new do\n iq(:type => \"set\", :id => @context.binding_iq_id) do\n bind(:xmlns => \"urn:ietf:params:xml:ns:xmpp-bind\") do \n if @context.jid.split(\"/\").size == 2 \n resource(@context.jid.split(\"/\").last)\n else\n resource(\"babylon_client_#{@context.binding_iq_id}\")\n end\n end\n end\n end\n iq = @outstream.add_child(builder.doc.root)\n send(iq)\n @state = :wait_for_confirmed_binding\n end\n end\n\n when :wait_for_confirmed_binding\n if stanza.name == \"iq\" && stanza[\"type\"] == \"result\" && Integer(stanza[\"id\"]) == @binding_iq_id\n if stanza.at(\"jid\") \n jid= stanza.at(\"jid\").text\n end\n end\n # And now, we must initiate the session\n @session_iq_id = Integer(rand(10000))\n builder = Nokogiri::XML::Builder.new do\n iq(:type => \"set\", :id => @context.session_iq_id) do\n session(:xmlns => \"urn:ietf:params:xml:ns:xmpp-session\")\n end\n end\n iq = @outstream.add_child(builder.doc.root)\n send(iq)\n @state = :wait_for_confirmed_session\n\n when :wait_for_confirmed_session\n if stanza.name == \"iq\" && stanza[\"type\"] == \"result\" && Integer(stanza[\"id\"]) == @session_iq_id && stanza.at(\"session\")\n # And now, send a presence!\n presence = Nokogiri::XML::Node.new(\"presence\", @outstream)\n send(presence)\n begin\n @handler.on_connected(self) if @handler and @handler.respond_to?(\"on_connected\")\n rescue\n Babylon.logger.error(\"on_connected failed : #{$!}\\n#{$!.backtrace.join(\"\\n\")}\")\n end\n @state = :connected\n end\n\n when :wait_for_proceed\n start_tls() # starting TLS\n @state = :wait_for_stream\n @parser.reset\n send @outstream.root.to_xml.split('<paste_content_here/>').first\n end\n rescue\n Babylon.logger.error(\"#{$!}:\\n#{$!.backtrace.join(\"\\n\")}\")\n end\n end",
"title": ""
},
{
"docid": "25c3a642e1909a29466311b5b3403118",
"score": "0.5021174",
"text": "def successful_purchase_response\n response =<<EOF\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<WIRECARD_BXML xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\"\n xsi:noNamespaceSchemaLocation=\"wirecard.xsd\">\n <W_RESPONSE>\n <W_JOB>\n <JobID>job 1</JobID>\n <FNC_CC_PURCHASE>\n <FunctionID>function 1</FunctionID>\n <CC_TRANSACTION mode=\"demo\">\n <TransactionID>9457892347623478</TransactionID>\n <PROCESSING_STATUS>\n <GuWID>C242720181323966504820</GuWID>\n <FunctionResult>ACK</FunctionResult>\n <TimeStamp>2001-01-31 20:39:24</TimeStamp>\n </PROCESSING_STATUS>\n </CC_TRANSACTION>\n </FNC_CC_PURCHASE>\n </W_JOB>\n </W_RESPONSE>\n</WIRECARD_BXML>\nEOF\n response\n end",
"title": ""
}
] |
c1f50116d5c458e2b612ccdb509a87ce
|
Returns true if this line was skipped, false otherwise. Lines are skipped if they are wrapped with :nocov: comment lines.
|
[
{
"docid": "06e87a061c52dff6fea5a514183a2a45",
"score": "0.6783452",
"text": "def skipped?\n !!skipped\n end",
"title": ""
}
] |
[
{
"docid": "ce4c13756967d7aa766bc3886aa7f8f8",
"score": "0.73569125",
"text": "def is_covered?\n for i in 0..@line.length\n return false if @line[i] == false\n end\n\n return true\n end",
"title": ""
},
{
"docid": "32efbbd1da056499f0254a632ddfb8e1",
"score": "0.73501855",
"text": "def process_skipped_lines(lines)\n skipping = false\n lines.each do |line|\n if SimpleCov::LinesClassifier.no_cov_line?(line.src)\n skipping = !skipping\n line.skipped!\n elsif skipping\n line.skipped!\n end\n end\n end",
"title": ""
},
{
"docid": "4e44ee41dfb98ccc0860666210619754",
"score": "0.70377696",
"text": "def irrelevant_line?(source_line)\n source_line.blank? || !count_comments? && comment_line?(source_line)\n end",
"title": ""
},
{
"docid": "9f54a751a2134b2768fa7dabea95d063",
"score": "0.7022371",
"text": "def skip_header_lines?\n \"t\" == @options[\"skip\"]\n end",
"title": ""
},
{
"docid": "2cd247fb6f663a3c00798648e36fd859",
"score": "0.68987435",
"text": "def skip?(line)\n line[0] == '#' || !line.include?(@delimeter) || line.split(@delimeter).size < 2\n end",
"title": ""
},
{
"docid": "c1c3b13c79dfb485d127f15829d3d193",
"score": "0.6883267",
"text": "def irrelevant_line?(source_line); end",
"title": ""
},
{
"docid": "c9eca3eac61525a227cb66685b4151ee",
"score": "0.68008304",
"text": "def skip(a_line)\n @line_cnt ||= 0\n @line_cnt += 1\n 1 == @line_cnt ||\n a_line.empty? ||\n a_line.strip.start_with?('#')\n end",
"title": ""
},
{
"docid": "a9bd168e252c439c738df0f14ea1f025",
"score": "0.67682076",
"text": "def skipped?\n !!@skipped\n end",
"title": ""
},
{
"docid": "752171205636b59ee9180308c48e5651",
"score": "0.66871476",
"text": "def comment_line?(line_source); end",
"title": ""
},
{
"docid": "752171205636b59ee9180308c48e5651",
"score": "0.66871476",
"text": "def comment_line?(line_source); end",
"title": ""
},
{
"docid": "860725edc3de47b1acaeaa7f34bd71d8",
"score": "0.6666862",
"text": "def skipped?\n @skipped\n end",
"title": ""
},
{
"docid": "4ece6e53dfa2078daf37ae2b0d50cae0",
"score": "0.6664503",
"text": "def skipped?\n @skipped\n end",
"title": ""
},
{
"docid": "bfe9143d679e9b995f00eb3992f3eca1",
"score": "0.6638312",
"text": "def never?\n !skipped? && coverage.nil?\n end",
"title": ""
},
{
"docid": "c8cba600b8176679eac01aa50303e1fa",
"score": "0.6624841",
"text": "def skipped_lines; end",
"title": ""
},
{
"docid": "c8cba600b8176679eac01aa50303e1fa",
"score": "0.6624841",
"text": "def skipped_lines; end",
"title": ""
},
{
"docid": "5295e256398bb1a6bb951009aafa8b6e",
"score": "0.6622511",
"text": "def skipped_lines\n @skipped_lines ||= lines.select(&:skipped?)\n end",
"title": ""
},
{
"docid": "3e7bcc3e0431af4fdf490ad478ca609b",
"score": "0.6596631",
"text": "def skip_comments?\n @skip_comments\n end",
"title": ""
},
{
"docid": "8deab95b84fef25aa61bdecbfd2b7c51",
"score": "0.6582959",
"text": "def comment_line?(line_source)\n /^\\s*#/.match?(line_source)\n end",
"title": ""
},
{
"docid": "9ca2990db6900e1b8a2c27d1d825cb45",
"score": "0.6523404",
"text": "def missed?\n !never? && !skipped? && coverage.zero?\n end",
"title": ""
},
{
"docid": "82e9194bf31e5318e785c67d2416e79e",
"score": "0.6520231",
"text": "def skip?\n !!@skip\n end",
"title": ""
},
{
"docid": "e82dad6ddbbaba8a831a453bf900b14e",
"score": "0.64818996",
"text": "def skip?\n @skip\n end",
"title": ""
},
{
"docid": "e82dad6ddbbaba8a831a453bf900b14e",
"score": "0.64818996",
"text": "def skip?\n @skip\n end",
"title": ""
},
{
"docid": "e82dad6ddbbaba8a831a453bf900b14e",
"score": "0.64818996",
"text": "def skip?\n @skip\n end",
"title": ""
},
{
"docid": "127bac2b6bea142974dd849d5748fdb2",
"score": "0.6454729",
"text": "def skipped?\n\t\t@skipped\n\tend",
"title": ""
},
{
"docid": "e8474c19d909053592d5f02e7d72629f",
"score": "0.64246434",
"text": "def skipped?\n status == :skipped\n end",
"title": ""
},
{
"docid": "e8474c19d909053592d5f02e7d72629f",
"score": "0.64246434",
"text": "def skipped?\n status == :skipped\n end",
"title": ""
},
{
"docid": "7c4c3342e450fef880f3e4a73f70c738",
"score": "0.6416009",
"text": "def skip?\n @result.equal?(:skip)\n end",
"title": ""
},
{
"docid": "804aa49306e8787808d813333a17c648",
"score": "0.6340699",
"text": "def skip_newlines?\n @skip_newlines\n end",
"title": ""
},
{
"docid": "a5d883b47d93e43abc1afb562f9cb311",
"score": "0.63392043",
"text": "def has_comment?(line)\n line =~ /#[^{]/\n end",
"title": ""
},
{
"docid": "cb5c4d3fb03e7b3ee4f80fe14c67340e",
"score": "0.6339195",
"text": "def missed_lines\n coverage_statistics[:line]&.missed\n end",
"title": ""
},
{
"docid": "565f641549594b7490411a48ec4b240a",
"score": "0.63185894",
"text": "def skip?\n @skip\n end",
"title": ""
},
{
"docid": "ada5e59d8f3acf0894453da7bf9c194a",
"score": "0.62863576",
"text": "def is_continuing_line?(line)\n line.expunge =~ /^[^#]*\\\\\\s*(#.*)?$/\n #first use expunge to eliminate inline closures\n #that may contain comment char '#'\n end",
"title": ""
},
{
"docid": "db03b8bc7b9dcf03cc672666e2192ff0",
"score": "0.62703407",
"text": "def is_comment?(line)\n true if line =~ /^\\#.*$/\n end",
"title": ""
},
{
"docid": "84c848c7ef343704f23a67e6c6d064a5",
"score": "0.62384",
"text": "def skipped_test?(event)\n return false unless event['event'] == 'test' && event['status'] == 'error'\n\n !!event['message'].match(/Skipped|Incomplete/i)\n end",
"title": ""
},
{
"docid": "42bdaf8516b4bbe18de6c27af2ee36ac",
"score": "0.62316465",
"text": "def missed?\n coverage.zero?\n end",
"title": ""
},
{
"docid": "df2f7fd0efb7aedcac1341765c14ef58",
"score": "0.6192598",
"text": "def skip?\n false \n end",
"title": ""
},
{
"docid": "5c569a5d25ca571d515c54e614470826",
"score": "0.6144532",
"text": "def covered?\n !never? && !skipped? && coverage.positive?\n end",
"title": ""
},
{
"docid": "aaca56d1be527c841a741e9c76a06f44",
"score": "0.6098192",
"text": "def skipped(message)\n log << \"[SKIPPED] #{message}\"\n false\n end",
"title": ""
},
{
"docid": "b09ca0a1e3b4c0fa2ab7c3f0efafb51e",
"score": "0.60875267",
"text": "def is_comment?(line)\n line =~ /^\\s*#/\n end",
"title": ""
},
{
"docid": "717077756af7c6f130241a65a2537e01",
"score": "0.604407",
"text": "def skip_to_eoln\r\n @source.get until @source.eoln?\r\n true\r\n end",
"title": ""
},
{
"docid": "4c3c02e3c83b88a57c2bdf3f89be8fcd",
"score": "0.60299695",
"text": "def commented?(entity)\n line(number: entity.last_line).end_with?(entity.ending)\n end",
"title": ""
},
{
"docid": "db4bd28ed9900efb8d0a5a71eaf2d8bc",
"score": "0.60040903",
"text": "def is_comment(line)\n result = false\n # If source supports single line comments\n if comment_symbols[:single_line]\n result ||= line =~ /^\\s*#{Regexp.escape(comment_symbols[:single_line])}/\n end\n\n # If source supports multi-line comments\n if comment_symbols[:multiline]\n result ||= line =~ /^\\s*#{Regexp.escape(comment_symbols[:multiline][:begin])}/\n end\n result\n end",
"title": ""
},
{
"docid": "2ce582ff25b038394425b12ffac5ca1b",
"score": "0.60011965",
"text": "def skipped?; end",
"title": ""
},
{
"docid": "2ce582ff25b038394425b12ffac5ca1b",
"score": "0.60011965",
"text": "def skipped?; end",
"title": ""
},
{
"docid": "2ce582ff25b038394425b12ffac5ca1b",
"score": "0.60011965",
"text": "def skipped?; end",
"title": ""
},
{
"docid": "2ce582ff25b038394425b12ffac5ca1b",
"score": "0.60011965",
"text": "def skipped?; end",
"title": ""
},
{
"docid": "53d54f599123d95b1b6cdaa5e08ac643",
"score": "0.5975611",
"text": "def line?\n !export? && !alias?\n end",
"title": ""
},
{
"docid": "36d1c5b4dcccf686c3b4564c781bd86c",
"score": "0.5888656",
"text": "def skipped_lines\n to_a.map(&:skipped_lines).inject(:+)\n end",
"title": ""
},
{
"docid": "e89d855de867179765ee7914ef6d0778",
"score": "0.58722764",
"text": "def should_skip\n @skip = process_exist? if @skip.nil?\n @skip\n end",
"title": ""
},
{
"docid": "2866440cdf296e3d37d5050bb51f2d08",
"score": "0.58528465",
"text": "def skipped!\n @skipped = true\n end",
"title": ""
},
{
"docid": "a789b3c62a4b3080653fdc5925788ae3",
"score": "0.5841684",
"text": "def comment?\n return @assigned_paragraph_type == :comment if @assigned_paragraph_type\n return block_type.casecmp(\"COMMENT\") if begin_block? or end_block?\n return @line =~ /^[ \\t]*?#[ \\t]/\n end",
"title": ""
},
{
"docid": "8d34e233fa3ef4e9861e56f7527aa4a4",
"score": "0.5822123",
"text": "def ignore?\n !!@ignore\n end",
"title": ""
},
{
"docid": "56e4ff4911b1472a04a1f1b5ed4b51c3",
"score": "0.5808228",
"text": "def process_skipped_lines(lines); end",
"title": ""
},
{
"docid": "372c9273a38959689fa5c6848a18be9f",
"score": "0.5788652",
"text": "def is_skippable?\n return true if @label.include? 'coverblank'\n end",
"title": ""
},
{
"docid": "8005bde7b748936507bf47d128b1f81f",
"score": "0.5779155",
"text": "def unbroken?(line)\n\tline.each do |c|\n\t\tif c == \".\"\n\t\t\treturn false\n\t\tend\n\tend\n\treturn true\nend",
"title": ""
},
{
"docid": "524f442456f87553a575edd4d4a549b4",
"score": "0.5777254",
"text": "def skip_test?(client, features_to_skip = test_file.features_to_skip)\n return true if pre_defined_skip?\n\n if @skip\n @skip.collect { |s| s['skip'] }.any? do |skip_definition|\n contains_features_to_skip?(features_to_skip, skip_definition) || test_file.skip_version?(client, skip_definition)\n end\n end\n end",
"title": ""
},
{
"docid": "a9fd9ea134553ac60359b4677ea88279",
"score": "0.57755244",
"text": "def ignore?\n @should_ignore\n end",
"title": ""
},
{
"docid": "098a03a1b94a0fe70a1eac675d4079f3",
"score": "0.57674086",
"text": "def should_parse?(line)\n stripped = line.strip\n (!stripped.empty?) && (!stripped.start_with?('#'))\n end",
"title": ""
},
{
"docid": "d3e839df08f479e054df0c1f35f3af72",
"score": "0.57648736",
"text": "def skip?\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "7e9dd4e1b8edf9bd46a251b2bf29747b",
"score": "0.57410544",
"text": "def comment?\n @kind == :line_comment || @kind == :block_comment\n end",
"title": ""
},
{
"docid": "37aed53e8c88ee7dd118569eda145903",
"score": "0.5738195",
"text": "def skipping_frame?\n return @frame_to_skip > 0\n end",
"title": ""
},
{
"docid": "6b4c1a45f8a72b6d15b5dfb20c3ec50f",
"score": "0.5733721",
"text": "def verify_comment(line) \n end",
"title": ""
},
{
"docid": "00a688840e039d4ffd71400f250203f0",
"score": "0.5732491",
"text": "def unimportant_missing_cr?(index, last_line, line); end",
"title": ""
},
{
"docid": "d606ed87ec3cada3344be978e1c9e1d4",
"score": "0.5724696",
"text": "def skip_meta_statements\n while @scanner.peek.type == :comment\n\t write(\"#{@scanner.peek.value}\\n\")\n\t @scanner.next\n end\n rescue StopIteration\n false\n end",
"title": ""
},
{
"docid": "94d8b38bf4c570991dc8e70d17ed22ec",
"score": "0.5705609",
"text": "def ignored?\n !!ignored\n end",
"title": ""
},
{
"docid": "74550114df5d1c31b9f31ceab820347a",
"score": "0.5699173",
"text": "def missed_lines; end",
"title": ""
},
{
"docid": "74550114df5d1c31b9f31ceab820347a",
"score": "0.5699173",
"text": "def missed_lines; end",
"title": ""
},
{
"docid": "65308505709342c6ad931be0a0795342",
"score": "0.5685248",
"text": "def è_un_commento?\n @contenuto.start_with? \"#\"\n end",
"title": ""
},
{
"docid": "76b13501b19d185adf3395b20276cb0a",
"score": "0.56781274",
"text": "def should_ignore_log_message(line)\n if not @ignorable_messages.select { |regex| regex.match(line) }.empty?\n return true\n end\n\n if @valgrind\n if not @valgrind_ignorable_messages.select { |regex| regex.match(line) }.empty?\n return true\n end\n end\n return matches_expected_logged?(line)\n end",
"title": ""
},
{
"docid": "1db856299c126d1e2706d66c0a67f8e6",
"score": "0.5663001",
"text": "def is_desc?(line)\n @desc += \"\\n\"+line unless @skip or @to_code\n end",
"title": ""
},
{
"docid": "820abf875d8d2dcd62850c3d454cfdd0",
"score": "0.56625247",
"text": "def indented?(line)\n line.gsub(\"\\n\", \"\").match(/(\\s+)/).nil? ? false : true\nend",
"title": ""
},
{
"docid": "cbc771ee23f993d4ec26c9d643abdf63",
"score": "0.5656293",
"text": "def potential_line?(filename, lineno); end",
"title": ""
},
{
"docid": "cfb8f911bc0c010497976066b580977f",
"score": "0.5656249",
"text": "def lines_of_code\n covered_lines + missed_lines\n end",
"title": ""
},
{
"docid": "9e683366d44e5636743116616f6d5efe",
"score": "0.56360316",
"text": "def advance?\n line_count = SandboxModule::line_count\n #@@logger.warn \"At line: #{line_count}, #{caller[0][/`.*'/][1..-2]}\"\n return false if at_breakpoint?\n @program_counter += 1\n @current_line = line_count\n # If we're doing a step or continue, don't execute until at the right line.\n return false if fast_forward?\n return true\n end",
"title": ""
},
{
"docid": "e6a1cefb43651e79fde6cfb2d328b574",
"score": "0.56335974",
"text": "def skipped!; end",
"title": ""
},
{
"docid": "9b43eabace25d93be49f2e3bd0ea385c",
"score": "0.5602334",
"text": "def skips_pre \n @skips_pre\n end",
"title": ""
},
{
"docid": "7f46b798c883790a40e5db4fc2a09a42",
"score": "0.5596438",
"text": "def uncovered_relevant_lines\n lineno = 0\n File.open(@filename, \"rb\").each_line do |line|\n if @coverage[lineno] == Bashcov::Line::IGNORED && revelant?(line)\n yield lineno\n end\n lineno += 1\n end\n end",
"title": ""
},
{
"docid": "4c1adf53c203b6ef13ef1dc375459dbc",
"score": "0.55616236",
"text": "def ignored?\n marking == \"IGNORED\"\n end",
"title": ""
},
{
"docid": "99cfa8030f8321e0fa3a515a932ec1d9",
"score": "0.5548936",
"text": "def parse_skipline\n s0 = @scanner.pos\n s1 = match_str('#')\n if s1 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_nonls\n s3 = parse_newline\n s0 = if s3 == :failed\n @scanner.pos = s0\n :failed\n else\n [s1, s2, s3]\n end\n end\n s0\n end",
"title": ""
},
{
"docid": "b98c3b360216c10034babcdef03b5fce",
"score": "0.55407983",
"text": "def skip_meta_statements\n while @enum.peek.type == :comment\n @instruction.push(@enum.peek.value+\"\\n\")\n @enum.next\n end\n rescue StopIteration\n false\n end",
"title": ""
},
{
"docid": "9ef1a7f191849004d9edbac8007900df",
"score": "0.55406505",
"text": "def header_line_rate?\n !additional_headers.nil? && additional_headers.include?(:line)\n end",
"title": ""
},
{
"docid": "38f90ce4f2c63858bee18296455cbcd3",
"score": "0.55346656",
"text": "def skip!\n @skip ||= true\n end",
"title": ""
},
{
"docid": "651909ededd8c6f5fde9b8b75f00d65d",
"score": "0.55151945",
"text": "def skip?\n !value_of(entity.only_if)\n end",
"title": ""
},
{
"docid": "6fd9336ef4b412b826450e906930fb0d",
"score": "0.54878855",
"text": "def irrelevant_line(source_line); end",
"title": ""
},
{
"docid": "605ac193eebc24f5f37c2cd8d5c611c4",
"score": "0.54862607",
"text": "def should_be_skipped?(word)\n reject?(word) || hashtag?(word) || uri?(word) || mention?(word)\n end",
"title": ""
},
{
"docid": "2dd4450a998706e0f340bc89741ad39b",
"score": "0.54839927",
"text": "def skips_pre #:nodoc:\n @skips_pre\n end",
"title": ""
},
{
"docid": "4bb9db6b0664cb3d1b9d15ae3bc2f9d5",
"score": "0.5478358",
"text": "def skip?\n return false unless has_group?\n return true if group.any_true?(skip_if)\n return true unless group.all_true?(only_if)\n false\n end",
"title": ""
},
{
"docid": "85de17dc615dda2f7f16fd0739fa9657",
"score": "0.5473777",
"text": "def skip_validation\n if self.category == 'comment'\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "a738cfef1c847cc0d0f4f77b936ba432",
"score": "0.54689246",
"text": "def skip_section(section, parent_section, object_index:)\n return true if section.nil? # allows for suppressed sections\n # Skip sections which are restricted to certain parent codes for objects\n return true unless section[:parent_codes].nil? || parent_section.nil? ||\n section[:parent_codes].include?(parent_section[:code])\n # Skip sections which have visibility rules\n return true unless include_item_or_section?(section[:when], section[:is], section[:is_not],\n object_index: object_index)\n\n Rails.logger.debug { \"Section #{section[:code]} Not Skipped\" }\n false\n end",
"title": ""
},
{
"docid": "56dec1556d2f71e33b859b410a4a9d4d",
"score": "0.5460545",
"text": "def multiline_kspawn? line\n if @kspawn_multiline\n @kspawn[:text] << line\n if line.include?(\"~\")\n @kspawn_multiline = false\n # However nothing but whitespace can follow that tilde!\n validate_tilde(\n line: line,\n line_number: @current_line,\n present: false\n )\n end\n true\n else\n false\n end\n # Returning true skips the rest of the parse method for this line\n end",
"title": ""
},
{
"docid": "50958ae4d712d1d5093a663ba7f2fc0d",
"score": "0.5447487",
"text": "def ignored?\n @ignored\n end",
"title": ""
},
{
"docid": "f1686b65b8d332be70498e2f7694ae79",
"score": "0.5440207",
"text": "def skip?\n $game_switches[CP::VICTORY::SKIP_SWITCH]\n end",
"title": ""
},
{
"docid": "1cb391d438089e7c3dc96f3d214ac948",
"score": "0.543939",
"text": "def comment?\n @contents[0] == :comment\n end",
"title": ""
},
{
"docid": "c5d6b951725bb96b9480fa088a58a205",
"score": "0.54229856",
"text": "def should_be_skipped_by_paths?(filepath)\n exclude_by_paths = options[:exclude_by_paths]\n filter_by_paths = options[:filter_by_paths]\n exclude_by_paths.any? { |pattern| pattern.match?(filepath) } ||\n (filter_by_paths && !filter_by_paths.empty? && !filter_by_paths.any? { |pattern| pattern.match?(filepath) })\n end",
"title": ""
},
{
"docid": "e934a4958b6d15e8cacf716d3f8adfad",
"score": "0.5419886",
"text": "def ignored?\n\t\treturn self.status == 'I'\n\tend",
"title": ""
},
{
"docid": "f7351b3e659efba736d7181f47a19442",
"score": "0.54194146",
"text": "def indent_line\n result = false\n level = calculate_indentation\n return result if level.nil? || level < 0\n @buffer.save_excursion do\n @buffer.beginning_of_line\n @buffer.composite_edit do\n if @buffer.looking_at?(/[ \\t]+/)\n s = @buffer.match_string(0)\n break if /\\t/ !~ s && s.size == level\n @buffer.delete_region(@buffer.match_beginning(0),\n @buffer.match_end(0))\n else\n break if level == 0\n end\n @buffer.indent_to(level)\n end\n result = true\n end\n pos = @buffer.point\n @buffer.beginning_of_line\n @buffer.forward_char while /[ \\t]/ =~ @buffer.char_after\n if @buffer.point < pos\n @buffer.goto_char(pos)\n end\n result\n end",
"title": ""
},
{
"docid": "fb1a8e31c00d6c7838277d83174fed39",
"score": "0.5414389",
"text": "def not_applicable(note = nil)\n $stderr.puts ['TEST SKIPPED', 'NOT APPLICABLE', note].compact.join(' - ')\n true\n end",
"title": ""
},
{
"docid": "b41a73a93c2900ee0658dcddf33807d8",
"score": "0.5406541",
"text": "def associated_comment?(node, ast_with_comments)\n preceding_comments = preceding_comments(node, ast_with_comments)\n return false if preceding_comments.empty?\n\n distance = node.loc.keyword.line - preceding_comments.last.loc.line\n return false if distance > 1\n return false unless comment_line_only?(preceding_comments.last)\n\n # As long as there's at least one comment line that isn't an\n # annotation, it's OK.\n preceding_comments.any? { |comment| !annotation?(comment) }\n end",
"title": ""
},
{
"docid": "628d41b20b460247db0b8ab9fb0dd68b",
"score": "0.539686",
"text": "def skip_comments=(bool)\n @skip_comments = bool\n end",
"title": ""
},
{
"docid": "6eeeb674effe1f3967f87177820e22eb",
"score": "0.5390312",
"text": "def newline_before_nonwhitespace(string)\n offset = -2\n while /\\S/.match(string[offset]).nil?\n return true if string[offset] == \"\\n\"\n offset -= 1\n end\n false\n end",
"title": ""
}
] |
36ae9cfa6c5ff85936589e4589a46aea
|
index the set of libraries by installing a dummy library related to WORKAROUND_LIB and TODO: unclear if this is still necessary
|
[
{
"docid": "9e5f1766d1cc844ba49d113e58b6c2f4",
"score": "0.82982785",
"text": "def index_libraries\n return true if @libraries_indexed\n\n _install_library(WORKAROUND_LIB)\n @libraries_indexed\n end",
"title": ""
}
] |
[
{
"docid": "68571c035dacd3b12605080253f32b9f",
"score": "0.75000995",
"text": "def update_library_index\n # install random lib so the arduino IDE grabs a new library index\n # see: https://github.com/arduino/Arduino/issues/3535\n install_library(WORKAROUND_LIB)\n end",
"title": ""
},
{
"docid": "7804b11966af5d5e7e4251b68b872057",
"score": "0.6646303",
"text": "def check_for_libraries; end",
"title": ""
},
{
"docid": "ab5ca5b0551403d95098192849cc8c87",
"score": "0.5960194",
"text": "def _install_library(library_name)\n result = run_and_capture(flag_install_library, library_name)\n\n already_installed = result[:err].include?(\"Library is already installed: #{library_name}\")\n success = result[:success] || already_installed\n\n @libraries_indexed = (@libraries_indexed || success) if library_name == WORKAROUND_LIB\n success\n end",
"title": ""
},
{
"docid": "3af99b76a3b95098ec593dc391c27025",
"score": "0.58830357",
"text": "def libs; end",
"title": ""
},
{
"docid": "fe2ecb7082b773e1c93a0cb8d5df4625",
"score": "0.5842885",
"text": "def patch_facets\n cp_r Dir.glob('lib/{core,more}/*'), 'lib'\n rm_r Dir.glob('lib/{core,more}')\n end",
"title": ""
},
{
"docid": "bf82ac9963dfa66fa2e408f4a83c5152",
"score": "0.5812052",
"text": "def load_library\n mkl_dirs = ['/opt/intel/lib', '/opt/intel/lib64', '/opt/intel/mkl/lib', '/opt/intel/mkl/lib64']\n openblas_dirs = ['/opt/OpenBLAS/lib', '/opt/OpenBLAS/lib64', '/opt/openblas/lib', '/opt/openblas/lib64',\n '/usr/local/opt/openblas/lib']\n atlas_dirs = ['/opt/atlas/lib', '/opt/atlas/lib64',\n '/usr/lib/atlas', '/usr/lib64/atlas', '/usr/local/opt/atlas/lib']\n lapacke_dirs = ['/opt/lapack/lib', '/opt/lapack/lib64', '/opt/local/lib/lapack',\n '/usr/local/opt/lapack/lib']\n opt_dirs = ['/opt/local/lib', '/opt/local/lib64', '/opt/lib', '/opt/lib64']\n base_dirs = ['/usr/local/lib', '/usr/local/lib64', '/usr/lib', '/usr/lib64']\n base_dirs.concat(Dir[\"/usr/lib/#{RbConfig::CONFIG['host_cpu']}-*\"])\n base_dirs.unshift(*ENV['LD_LIBRARY_PATH'].split(':')) unless ENV['LD_LIBRARY_PATH'].nil?\n\n select_dirs(base_dirs)\n select_dirs(opt_dirs)\n select_dirs(lapacke_dirs)\n select_dirs(atlas_dirs)\n select_dirs(mkl_dirs)\n\n mkl_libs = find_mkl_libs([*base_dirs, *opt_dirs, *mkl_dirs])\n openblas_libs = find_openblas_libs([*base_dirs, *opt_dirs, *openblas_dirs])\n atlas_libs = find_atlas_libs([*base_dirs, *opt_dirs, *atlas_dirs, *lapacke_dirs])\n lapack_libs = find_lapack_libs([*base_dirs, *opt_dirs, *lapacke_dirs])\n\n @@libs = nil\n if !mkl_libs.value?(nil)\n open_mkl_libs(mkl_libs)\n @@libs = mkl_libs.values\n 'mkl'\n elsif !openblas_libs.value?(nil)\n open_openblas_libs(openblas_libs)\n @@libs = openblas_libs.values.uniq\n 'openblas'\n elsif !atlas_libs.value?(nil)\n open_atlas_libs(atlas_libs)\n @@libs = atlas_libs.values.uniq\n 'atlas'\n elsif !lapack_libs.value?(nil)\n open_lapack_libs(lapack_libs)\n @@libs = lapack_libs.values.uniq\n 'lapack'\n else\n raise 'cannot find MKL/OpenBLAS/ATLAS/BLAS-LAPACK library'\n end\n end",
"title": ""
},
{
"docid": "91eaf2f79779b9a1939bbd8ce9e0841f",
"score": "0.5765505",
"text": "def load_libs; end",
"title": ""
},
{
"docid": "f756db51d3a46bcccace8d78ab893147",
"score": "0.57220143",
"text": "def determine_libraries\n lib = @info[:lib] = {}\n\n libc_cmd = \"ls -la `find /lib /usr/lib -name 'libc.so*'|head -1`|\" \\\n \"sed 's/.*-> //'\"\n lib[:libc] = @shell.query('LIBC', libc_cmd)\n lib[:libc].gsub!(/^.*-|\\.so$/, '')\n\n lib[:perl] = @shell.query('PERL', 'perl -e \"print $^V;\"')\n lib[:perl].gsub!(/^v([0-9.]*).*/, '\\1')\n\n python_cmd = 'python -c \"import sys; print sys.version\" 2>/dev/null'\n lib[:python] = @shell.query('PYTHON', python_cmd)\n lib[:python].gsub!(/([0-9.]*).*/m, '\\1')\n\n ruby_cmd = 'ruby -e \"print RUBY_VERSION\" 2>/dev/null'\n lib[:ruby] = @shell.query('RUBY', ruby_cmd)\n\n lib[:php] = @shell.query('PHP', 'php -v 2>/dev/null|head -1')\n lib[:php].gsub!(/^PHP ([0-9.]*).*/, '\\1')\n end",
"title": ""
},
{
"docid": "6c5e23d7a27e578c2f0486edfc10c301",
"score": "0.56814337",
"text": "def set_platform_libs\n\n case p4osname\n when 'SOLARIS'\n osver = `uname -r`\n osver.gsub!(/5\\./, '2')\n if (osver == '25')\n $LDFLAGS += '/usr/ucblib/libucb.a '\n end\n have_library('nsl')\n have_library('socket')\n when 'NT'\n have_library('advapi32')\n have_library('wsock32')\n have_library('kernel32')\n have_library('oldnames')\n when 'CYGWIN'\n # Clear out 'bogus' libs on cygwin\n CONFIG['LIBS'] = ''\n when 'DARWIN'\n if p4osver.to_i >= 8\n # Only build for 64 bit if we have more than one arch defined in CFLAGS\n $LDFLAGS.slice!('-arch i386')\n $LDFLAGS.slice!('-arch ppc')\n $LDFLAGS += ' -framework CoreFoundation -framework Foundation'\n end\n when 'LINUX', 'MINGW32'\n $LDFLAGS += ' -Wl,--allow-multiple-definition'\n have_library('supc++')\n end\nend",
"title": ""
},
{
"docid": "8c77daef811bfec9ed9449b6a4fc4e99",
"score": "0.56333387",
"text": "def test_application_app_libs_should_precede_all_plugin_app_libs\r\n types = %w(app/controllers app/helpers app/models lib)\r\n types.each do |t|\r\n app_index = load_path_index(File.join(RAILS_ROOT, t))\r\n assert_not_nil app_index, \"#{t} is missing in $LOAD_PATH\"\r\n Engines.plugins.each do |plugin|\r\n first_plugin_index = load_path_index(File.join(plugin.directory, t))\r\n assert(app_index < first_plugin_index) unless first_plugin_index.nil?\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "d1f47f00e751283f45666856da09e94b",
"score": "0.5576162",
"text": "def test_framework_runtimes\n find_duplicates :frameworks\n end",
"title": ""
},
{
"docid": "e6de5d53bdf7e299be371f9d909e9de3",
"score": "0.55147237",
"text": "def require_lib(*libs); end",
"title": ""
},
{
"docid": "6408a60cfc6d44cdd1d80a6ad145c66e",
"score": "0.5473174",
"text": "def install_when_cache_hit!\n # just print log\n sandbox.exsited_framework_target_names.each do |name|\n UI.puts \"Using #{name}\"\n end\n end",
"title": ""
},
{
"docid": "ca7ac1122232e4df66bab788987cbdaa",
"score": "0.5446283",
"text": "def install_dependencies\n raise 'Not implemented'\n end",
"title": ""
},
{
"docid": "ba980f9a20e1f421709ac505d6af03e0",
"score": "0.54288095",
"text": "def install_flutter_business_pods\n install_business_pods\n install_plugin_pods\nend",
"title": ""
},
{
"docid": "6cdf7d9933a16615c7af7e255d470572",
"score": "0.54096955",
"text": "def packages_providing_library(library, *paths)\n packages_providing(\"*/usr/lib/lib#{library}.so.*\") +\n packages_providing(\"*/usr/lib64/lib#{library}.so.*\") +\n paths.collect { |path|\n packages_providing(\"*/usr/lib#{path}/lib#{library}.so.*\") +\n packages_providing(\"*/usr/lib64#{path}/lib#{library}.so.*\")\n }.flatten\nend",
"title": ""
},
{
"docid": "87c26878f00e90dbd67824d0bafab7d2",
"score": "0.53983265",
"text": "def request_libraries\n raise StandardError, 'Unsupported, fix this'\n end",
"title": ""
},
{
"docid": "66a52b636f98d45637c5ac1769e73bb5",
"score": "0.5361401",
"text": "def dynamically_linked_libraries(except: :none)\n # The argument except is unused.\n puts if except == :unused\n metadata.dylibs\n end",
"title": ""
},
{
"docid": "45feb1b0c0203150cb8c370397ab5c4f",
"score": "0.535431",
"text": "def lookup_library(args)\n library = args[:library]\n paths = args.key?(:paths) ? sanitize_paths(args[:paths]) : []\n matches = packages_providing_library(library, *paths).join(\"\\n\")\n puts \"packages which provide library:\\n#{matches}\".bold.blue\nend",
"title": ""
},
{
"docid": "971f26452dcc7c07f34f29b2d274dd0e",
"score": "0.5334727",
"text": "def add_system_library(names)\n Array(names).each do |name|\n path = \"usr/lib/lib#{name}.dylib\"\n unless ref = project.frameworks_group.files.find { |ref| ref.path == path }\n ref = project.frameworks_group.new_file(path, :sdk_root)\n end\n frameworks_build_phase.add_file_reference(ref, true)\n ref\n end\n end",
"title": ""
},
{
"docid": "3f647a59bbdc0d7c89a10a1da775fa3a",
"score": "0.5319776",
"text": "def post_install\n rm_f Dir[\"#{HOMEBREW_PREFIX}/lib/python*.*/site-packages/scipy/**/*.pyc\"]\n end",
"title": ""
},
{
"docid": "c2350ec86867e13d0f55f88b3bf5b415",
"score": "0.5313542",
"text": "def forced_packages_missing_candidates\n @forced_packages_missing_candidates ||=\n begin\n missing = []\n each_package do |package_name, new_version, current_version, candidate_version, magic_version|\n next if new_version.nil? || current_version.nil?\n\n if use_magic_version?\n if !magic_version && candidate_version.nil?\n missing.push(package_name)\n end\n else\n if !version_requirement_satisfied?(current_version, new_version) && candidate_version.nil?\n missing.push(package_name)\n end\n end\n end\n missing\n end\n end",
"title": ""
},
{
"docid": "4f26732803e34a9c3d9465ce0413f4b1",
"score": "0.53090936",
"text": "def require_libraries\n return if @libraries.nil?\n\n missing_dependencies = []\n\n @libraries.each do |lib|\n begin\n vrequire(lib)\n rescue LoadError\n # rubocop:disable Metrics/LineLength\n vputs \"[**:#{@name}](#{lib}) Unable to require; adding to install list...\"\n # rubocop:enable Metrics/LineLength\n missing_dependencies << lib\n end\n end\n\n requirer = new_dependency_requirer(dependency_installer)\n install_missing_dependencies(missing_dependencies, requirer).resume\n end",
"title": ""
},
{
"docid": "21f48aafc80ff4d0be3e3b3323bbfd01",
"score": "0.52971596",
"text": "def test_refuse_to_install_gems_with_wrong_name_prefix\n # Here, ordinal_array is the name of a simple, small gem available on rubygems.org\n # There is no significance in choosing that gem over any other.\n # Main point here is that its name does not begin with 'inspec-'.\n assert_raises(Inspec::Plugin::V2::InstallError) { @installer.install(\"ordinal_array\") }\n end",
"title": ""
},
{
"docid": "2a5ae2001203f89187cb46562b65ef8c",
"score": "0.5289026",
"text": "def install_modules_dependencies(spec, new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == \"1\")\n NewArchitectureHelper.install_modules_dependencies(spec, new_arch_enabled, $FOLLY_VERSION)\nend",
"title": ""
},
{
"docid": "0fecb5e103755f456504b77c03b5de09",
"score": "0.5288122",
"text": "def install(libraries)\n\t\t\t# Abort with a friendly message if the running OS is not supported yet\n\t\t\tabort \"We're sorry but currently we don't support #{@os_name} package installation\" if(!is_os_available?(@os_name))\n\n\t\t\t# Message shown handled by the displayer already\n\t\t\tabort if libraries.count == 0\n\t\t\tinstalled_libraries = []\n\t\t\tfailed_libraries = []\n\n\t\t\tlibraries.each do |library|\n\t\t\t\tinstalled = self.send(\"#{@os_name}_installer\", library)\n\t\t\t\tif(installed == true)\n\t\t\t\t\tinstalled_libraries << library\n\t\t\t\telse\n\t\t\t\t\tfailed_libraries << library\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif(failed_libraries.count > 0)\n\t\t\t\tabort \"#{failed_libraries.count} libraries failed to be installed: #{failed_libraries}\"\n\t\t\telse\n\t\t\t\tabort \"#{installed_libraries.count} libraries installed successfully!\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "190e9e2d56d5cd85ee77cd450e7f7bdd",
"score": "0.52351767",
"text": "def install_when_cache_hit!\n # just print log\n self.sandbox.exsited_framework_target_names.each do |name|\n Pod::UI.puts \"🚀 Using cache #{name}\".blue\n end\n end",
"title": ""
},
{
"docid": "e8e65208bac5016b568b02f67aaa42b5",
"score": "0.52294934",
"text": "def install\n # If we're installing from the repo, then use GNU autotools to make\n # the ./configure script. Note that libtool is often installed with\n # a 'g' prefix by homebrew.\n if build.head?\n mkdir \"m4\"\n system \"autoreconf\", \"-i\"\n end\n\n # Set up CXXFLAGS\n if build.with? \"no-range-check\"\n if build.with? \"fast-test\"\n if build.with? \"python\"\n # no-range-check, fast-test, python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK -DO2SCL_FAST_TEST -I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e1\"\n else # else for if python\n # no-range-check, fast-test, no python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK -DO2SCL_FAST_TEST\"\n system \"echo\", \"e2\"\n end # end of if python\n else # else for fast-test\n if build.with? \"python\"\n # no-range-check, no fast-test, python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK -I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e3\"\n else # else for if python\n # no-range-check, no fast-test, no python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK\"\n system \"echo\", \"e4\"\n end # end of if python\n end # end of if fast-test\n else # else for if no-range-check\n if build.with? \"fast-test\"\n if build.with? \"python\"\n # with range-check, fast-test, python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_FAST_TEST -I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e5\"\n else # else for python\n # with range-check, fast-test, no python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_FAST_TEST\"\n system \"echo\", \"e6\"\n end # end of if python\n else # else for fast-test\n if build.with? \"python\"\n # with range-check, no fast-test, python\n ENV[\"CXXFLAGS\"] = \"-I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e7\"\n else\n # with range-check, no fast-test, no python\n ENV[\"CXXFLAGS\"] = \"\"\n system \"echo\", \"e8\"\n end # end of if python\n end # end of if fast-test\n end # end of if no-range-check\n\n # ------------------------------------------------------------\n # Set up ./configure script\n \n if build.with? \"armadillo\"\n if build.with? \"eigen\"\n if build.with? \"openmp\"\n if build.with? \"python\"\n # armadillo, eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--enable-python\",\"--enable-openmp\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # armadillo, eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--enable-openmp\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # armadillo, eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--enable-python\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # armadillo, eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n end\n else \n if build.with? \"openmp\"\n if build.with? \"python\"\n # armadillo, no eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--enable-python\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n else\n # armadillo, no eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # armadillo, no eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--enable-python\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # armadillo, no eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n end\n end\n else\n if build.with? \"eigen\"\n if build.with? \"openmp\"\n if build.with? \"python\"\n # no armadillo, eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-eigen\",\n \"--enable-python\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n else\n # no armadillo, eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-eigen\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # no armadillo, eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-python\",\n \"--enable-eigen\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # no armadillo, eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-eigen\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n end\n else\n if build.with? \"openmp\"\n if build.with? \"python\"\n # no armadillo, no eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--enable-python\",\n \"--enable-openmp\",\"--prefix=#{prefix}\"\n else\n # no armadillo, no eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--enable-openmp\",\"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # no armadillo, no eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--enable-python\",\n \"--prefix=#{prefix}\"\n else\n # no armadillo, no eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n end\n end\n end\n end\n \n #\n # If there's no documentation, just add some blank files so\n # that the install target succeeds.\n #\n if build.head?\n system \"make\", \"blank-doc\"\n end\n \n #\n # Unfortunately if we do 'make' and then 'make install', it fails\n # to build acol properly (e.g. on antares), so we just do 'make\n # install'.\n #\n # 2/24/17: Actually this most recent time it worked better\n # with 'make' and 'make install' on antares, so I leave it\n # this way for now. Alternatively, there is an LDFLAGS\n # setting above which I can try if I'm still having problems.\n #\n # 9/28/17: I'm having problems with acol again on mimosa,\n # so I just do 'make install'\n\n ENV.deparallelize\n \n #system \"make\"\n system \"make\", \"install\"\n\n #\n # FIXME: should document why this is necessary\n #\n if build.with? \"check\"\n system \"make\", \"check\"\n end\n if build.with? \"examples\"\n system \"make\", \"o2scl-examples\"\n end\n include.install Dir[\"include/o2scl/*.h\"]\n if build.with? \"examples\"\n share.install Dir[\"examples/ex*.cpp\"]\n end\n end",
"title": ""
},
{
"docid": "2affa3f4fa902c86b3c37d92dc2f9332",
"score": "0.5228652",
"text": "def packages_missing_candidates\n @packages_missing_candidates ||=\n begin\n missing = []\n each_package do |package_name, new_version, current_version, candidate_version, magic_version|\n missing.push(package_name) if magic_version.nil? && candidate_version.nil?\n end\n missing\n end\n end",
"title": ""
},
{
"docid": "74bab6fdf1b0518f68a6db6df0513e8c",
"score": "0.52282494",
"text": "def install_library(library_name)\n index_libraries\n _install_library(library_name)\n end",
"title": ""
},
{
"docid": "1bc0f253b55e5d38028310e6756cb2ec",
"score": "0.5226317",
"text": "def reset_gem_specs!\n return unless Gem.loaded_specs.keys.include?('locomotivecms_wagon')\n\n core_gems = %w(did_you_mean).freeze\n\n Gem.loaded_specs.values.each do |spec|\n next if core_gems.include?(spec.name)\n spec.full_require_paths.each do |path|\n $LOAD_PATH.delete(path)\n end\n\n # Without this statement, bundler will raise the infamous \"You have already activated ...\"\n Gem.loaded_specs.delete(spec.name)\n end\nend",
"title": ""
},
{
"docid": "3a2ec42159efae554c8311556771098c",
"score": "0.5225928",
"text": "def make_legacy_index\n indexer = Gem::Indexer.new( @scratch_datadir, :build_legacy => true, :build_modern => false )\n quiet_indexing( indexer )\n end",
"title": ""
},
{
"docid": "397c3cb61e7ae2fe91de1434aeaa540f",
"score": "0.52244526",
"text": "def unloaded_libraries\n (Boson::BareRunner.all_libraries - Boson.libraries.map {|e| e.name }).sort\n end",
"title": ""
},
{
"docid": "06c1a688faaadcd394cf855e3c38b7f0",
"score": "0.5219314",
"text": "def _reload_libs\n RELOAD_LIBS.each do |lib|\n require_dependency lib\n end\n end",
"title": ""
},
{
"docid": "4526e53b68ac15dc22393f3c12195d63",
"score": "0.5218286",
"text": "def add_vendored_libraries\n UI.message '- Adding libraries' do\n add_file_accessors_paths_to_pods_group(:vendored_libraries, :frameworks)\n end\n end",
"title": ""
},
{
"docid": "5d725b4dc7104f079526360932a54fe2",
"score": "0.5214044",
"text": "def install_gems\n puts \"[Checking for missing required gems]\"\n while (gemspecs = get_requirements).any?\n gemspecs.each do |gemspec|\n install_gem(gemspec)\n end\n end\n end",
"title": ""
},
{
"docid": "c96bd7bf7dd7d0a724f46e46b5514e69",
"score": "0.52069217",
"text": "def resolve_packages\n installation_manifest =\n Autoproj::InstallationManifest.from_workspace_root(ws.root_dir)\n installation_manifest.each_package.to_a +\n installation_manifest.each_package_set.to_a\n end",
"title": ""
},
{
"docid": "5ee91310be856b573efad992684e0cf6",
"score": "0.5201954",
"text": "def post_install; end",
"title": ""
},
{
"docid": "87269cc63320e7e9e8e33ada77c78eaa",
"score": "0.5196527",
"text": "def require_libs(*libs); end",
"title": ""
},
{
"docid": "1f016dcefb4cebb34f75593975f81a41",
"score": "0.518343",
"text": "def setup\n install_latest_ruby\n\n install_global_gems\n end",
"title": ""
},
{
"docid": "63ad1424fedeefefb2a1b7d851628d3b",
"score": "0.51726466",
"text": "def install\n # When building the head, temp patch for ROOT-8032\n if build.head? || build.devel?\n inreplace \"cmake/modules/RootBuildOptions.cmake\", \"thread|cxx11|cling|builtin_llvm|builtin_ftgl|explicitlink\", \"thread|cxx11|cling|builtin_llvm|builtin_ftgl|explicitlink|python|mathmore|asimage|gnuinstall|rpath|soversion|opengl|builtin_glew\"\n end\n\n mkdir \"hb-build-root\" do\n ENV.cxx11\n\n # Defaults\n args = std_cmake_args\n args << \"-Dgnuinstall=ON\"\n args << \"-DCMAKE_INSTALL_SYSCONFDIR=etc/root\"\n args << \"-Dgminimal=ON\"\n args << \"-Dx11=OFF\" if OS.mac?\n args << \"-Dcocoa=ON\" if OS.mac?\n args << \"-Dlibcxx=ON\" if OS.mac?\n args << \"-Dfortran=OFF\"\n args << \"-Drpath=ON\"\n args << \"-Dsoversion=ON\"\n args << \"-Dasimage=ON\"\n args << \"-Dbuiltin_asimage=ON\"\n args << \"-Dbuiltin_freetype=ON\"\n args << \"-Dopengl=ON\"\n args << \"-Dbuiltin_glew=ON\"\n\n # Options\n args << \"-Dcxx11=ON\"\n args << \"-Dpython=\".concat((build.with? \"python\") ? \"ON\" : \"OFF\")\n args << \"-Dmathmore=\".concat((build.with? \"gsl\") ? \"ON\" : \"OFF\")\n\n system \"cmake\", \"../\", *args\n system \"make\"\n system \"make\", \"install\"\n end\n end",
"title": ""
},
{
"docid": "1bac6b87a51180ea6516168f35fa7895",
"score": "0.5168185",
"text": "def _reload_libs\n RELOAD_LIBS.each do |lib|\n require_dependency lib\n end\n end",
"title": ""
},
{
"docid": "afbd690882066f9e0e925a633be72d86",
"score": "0.51615053",
"text": "def library; end",
"title": ""
},
{
"docid": "afbd690882066f9e0e925a633be72d86",
"score": "0.51615053",
"text": "def library; end",
"title": ""
},
{
"docid": "6ce2ce87a7fae2bc821e33638379f5cd",
"score": "0.5156587",
"text": "def all_arduino_library_dependencies!(additional_libraries = [])\n # Pull in all possible places that headers could live, according to the spec:\n # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification\n recursive = (additional_libraries + arduino_library_dependencies).map do |n|\n other_lib = self.class.new(n, @backend)\n other_lib.install unless other_lib.installed?\n other_lib.all_arduino_library_dependencies!\n end.flatten\n (additional_libraries + recursive).uniq\n end",
"title": ""
},
{
"docid": "1ae0926f07e0694d1ac6f04cbb32cadf",
"score": "0.5147807",
"text": "def libraries_order\n order = [:Ruby_]\n order.unshift(:Statistics2_) if has_statistics2?\n order.unshift(:GSL_) if has_gsl?\n order.unshift(:Java_) if has_java?\n order\n end",
"title": ""
},
{
"docid": "299eef35fe987bf6bd8031a67a74218f",
"score": "0.5138169",
"text": "def additional_dylibs dylibs, other_lib\n dylibs_to_change(other_lib).delete_if do |d|\n basenames = dylibs.map { |lib| File.basename(lib) }\n basenames.include? File.basename(d)\n end\n end",
"title": ""
},
{
"docid": "9f458f613c32d9500e4ca399e75b293f",
"score": "0.51350516",
"text": "def sync_libraries\n debug 'Syncing libraries'\n processed_paths = []\n @makefile.each_library do |lib|\n sync_library(lib)\n processed_paths << lib.target_path\n end\n # Determine libraries that should be deleted from the 'libraries' folder.\n # The above is a bit of an overstatement, as it is basically impossible\n # to detect a \"library\" in a reliable way. What we actually do is just\n # deleting \"spurious\" paths inside the 'libraries' folder.\n # Note also that Drupid is not smart enough to find libraries installed\n # inside modules or themes.\n Pathname.glob(@platform.libraries_path.to_s + '/**/*').each do |p|\n next unless p.directory?\n q = p.relative_path_from(@platform.local_path + @platform.contrib_path)\n # If q is not a prefix of any processed path, or viceversa, delete it\n if processed_paths.find_all { |pp| pp.fnmatch(q.to_s + '*') or q.fnmatch(pp.to_s + '*') }.empty?\n l = Library.new(p.basename)\n l.local_path = p\n log.action(DeleteAction.new(@platform, l))\n # Do not need to delete subdirectories\n processed_paths << q\n end\n end\n end",
"title": ""
},
{
"docid": "c8d072f64d6b00a044669ade8e859ead",
"score": "0.5123911",
"text": "def pre_install; end",
"title": ""
},
{
"docid": "ab3508bd17c724386ecd1b541a25bfde",
"score": "0.5120448",
"text": "def install_missing_indexes\n db_connection.execute(\n <<-SQL\n SELECT install_missing_indexes();\n SQL\n )\n end",
"title": ""
},
{
"docid": "b8b708dfdfeb3a54aa68e8e9550af591",
"score": "0.5118401",
"text": "def get_library_functions_list\n library_functions = []\n @indexes.each do |index|\n library_functions += JSON.parse(IO.read(@feature_dir + \"/library_calls/#{index.to_s}.json\")).keys\n end\n library_functions.uniq\n end",
"title": ""
},
{
"docid": "c8912c9bcda5ba53d0e19e00d9b8e13a",
"score": "0.51183647",
"text": "def all_libraries\n Settings.libraries.map.to_h.with_indifferent_access\n end",
"title": ""
},
{
"docid": "c9602d45c7f5466bdeaad6403ee7f30d",
"score": "0.5112366",
"text": "def load_no_focus_lib=(_arg0); end",
"title": ""
},
{
"docid": "50c09ae9793b8643f935190fb6b11866",
"score": "0.51094234",
"text": "def init_gemspecs\n Gem.source_index.map { |_, spec| spec }.sort { |a,b|\n\t(a.name <=> b.name).nonzero? || (b.version <=> a.version)\n }\n end",
"title": ""
},
{
"docid": "02967c6c02164ebd93f5d50972225dc2",
"score": "0.51034045",
"text": "def link_libraries\n if RbConfig::CONFIG[\"THREAD_MODEL\"] == \"pthread\"\n # Link gem extension against pthread library\n have_library \"pthread\"\n have_required_function \"pthread\", \"pthread_create\"\n end\n\n # Links gem extension against the `dl` library. This is needed when Ruby is\n # not linked against `dl` itself, so link it on the gem extension.\n have_library \"dl\"\n # Check if functions are available now from the linked library\n %w[dlopen dlclose dlsym].each do |func|\n have_required_function \"dl\", func\n end\nend",
"title": ""
},
{
"docid": "087e1ccc127733779d1c33a5c22f77a2",
"score": "0.5102242",
"text": "def common_build\n puts \"common_build dir=#{pwd} #{SHOES_TGT_ARCH}\"\n #mkdir_p \"#{TGT_DIR}/ruby\"\n #cp_r \"#{EXT_RUBY}/lib/ruby/#{RUBY_V}\", \"#{TGT_DIR}/ruby/lib\"\n %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir|\n FileList[rdir].each { |rlib| cp_r rlib, \"#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}\" }\n end\n %w[req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk].\n #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk].\n each { |xdir| copy_ext xdir, \"#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}/#{SHOES_TGT_ARCH}\" }\n\n gdir = \"#{TGT_DIR}/lib/ruby/gems/#{RUBY_V}\"\n {'hpricot' => 'lib', 'sqlite3' => 'lib'}.each do |gemn, xdir|\n #{'hpricot' => 'lib', 'json' => 'lib/json/ext', 'sqlite3' => 'lib'}.each do |gemn, xdir|\n spec = eval(File.read(\"req/#{gemn}/gemspec\"))\n mkdir_p \"#{gdir}/specifications\"\n mkdir_p \"#{gdir}/gems/#{spec.full_name}/lib\"\n FileList[\"req/#{gemn}/lib/*\"].each { |rlib| cp_r rlib, \"#{gdir}/gems/#{spec.full_name}/lib\" }\n mkdir_p \"#{gdir}/gems/#{spec.full_name}/#{xdir}\"\n FileList[\"req/#{gemn}/ext/*\"].each { |elib| copy_ext elib, \"#{gdir}/gems/#{spec.full_name}/#{xdir}\" }\n cp \"req/#{gemn}/gemspec\", \"#{gdir}/specifications/#{spec.full_name}.gemspec\"\n end\n end",
"title": ""
},
{
"docid": "b7b43105657bca6ad3cf0666f58cbb86",
"score": "0.50989926",
"text": "def get_dylibs lib\n `otool -L #{lib}`.split(\"\\n\").inject([]) do |dylibs, line|\n if line =~ /^\\S/ or line =~ /System|@executable_path|libobjc/\n dylibs\n else\n dylibs << line.gsub(/\\s\\(compatibility.*$/, '').strip\n end\n end\n end",
"title": ""
},
{
"docid": "3f85d9566944eed02f1caf0938264ce4",
"score": "0.50971437",
"text": "def runtime_specific_gems\n []\n end",
"title": ""
},
{
"docid": "feba17a2de600ec55add0f66a7e9485f",
"score": "0.5097007",
"text": "def install_packages\n return(interpreter.package_manager.install <<-HERE)\n # Core\n mysql-server\n mysql-client\n\n # Tools\n libcompress-zlib-perl\n mytop\n dbishell\n\n # Ruby drivers\n libmysql-ruby\n libdbd-mysql-ruby\n HERE\n end",
"title": ""
},
{
"docid": "f4eb1fa0109665407a3f7e8671417606",
"score": "0.5094042",
"text": "def library pkgname, fail_after=300\n Timeout::timeout(fail_after) do\n install_package pkgname\n e \"library(#{pkgname})\"\n end\n end",
"title": ""
},
{
"docid": "4dfdff5c63a02da0b6a51174735b1bf2",
"score": "0.5087734",
"text": "def prepare_for_installation; end",
"title": ""
},
{
"docid": "40a3186e3f9143ea9ce0e50fcdbd754a",
"score": "0.5086969",
"text": "def common_pods\n# pod 'AESCrypt-ObjC’\n pod 'AFNetworking’\n pod 'Aspects'\n \n pod 'FCUUID'\n pod 'FMDB'\n \n pod 'IQKeyboardManager'\n# pod 'iCarousel’\n \n# pod 'JPush'\n# pod 'JZLocationConverter'\n \n pod 'MBProgressHUD'\n pod 'MJExtension'\n pod 'MJRefresh'\n pod 'Masonry'\n \n# pod 'PopoverView'\n pod 'PPNumberButton'\n \n pod 'SDCycleScrollView'\n pod 'SDWebImage'\n pod 'SVProgressHUD'\n pod 'SocketRocket'\n pod 'Toast'\n \n# pod 'UICKeyChainStore'\n \n pod 'YBAttributeTextTapAction'\n \n# pod 'YYKit'\n pod 'YYCache'\n pod 'YYCategories'\n pod 'YYWebImage’\n pod 'YYModel’\n# pod 'YZPullDownMenu'\n# pod 'ZYCornerRadius'\n \n# pod 'UMengAnalytics-NO-IDFA'\n \n# pod 'AMapSearch-NO-IDFA'\n# pod 'AMapLocation-NO-IDFA'\n# pod 'AMapNavi-NO-IDFA'\n \n # 主模块(必须)\n# pod 'mob_sharesdk'\n# pod 'mob_sharesdk/ShareSDKUI'\n# pod 'mob_sharesdk/ShareSDKExtension'# 扩展模块(在调用可以弹出我们UI分享方法的时候是必需的)\n# pod 'mob_sharesdk/ShareSDKPlatforms/QQ'\n# pod 'mob_sharesdk/ShareSDKPlatforms/SinaWeibo'\n# pod 'mob_sharesdk/ShareSDKPlatforms/WeChatFull' #(微信sdk带支付的命令,和上面不带支付的不能共存,只能选择一个)\n# pod 'PromiseKit'\n\n pod 'NNGloble'\n pod 'NNCategoryPro'\n \n pod 'TZImagePickerController'\n \n# pod 'LookinServer', :configurations => ['Debug']\n# pod 'EchoSDK', :configurations => [\"Debug\"]\n pod 'Reveal-SDK', :configurations => ['Debug']\n\n end",
"title": ""
},
{
"docid": "0e19270e4727bbca510d121ea64b67a2",
"score": "0.50868046",
"text": "def find_shared_library(doc, jdbc_driver)\n by_reference = []\n by_containment = []\n jdbc_driver.each do |driver|\n # by reference - check for libraryRef\n lib_attribute = driver.attribute('libraryRef').value unless driver.attribute('libraryRef').nil?\n unless lib_attribute.nil?\n libs = doc.elements.to_a(\"//library[@id='#{lib_attribute}']\")\n libs.each { |lib| by_reference.push(lib) }\n end\n # next check for contained library elements\n lib_elements = driver.get_elements('library')\n lib_elements.each { |element| by_containment.push(element) }\n end\n raise \"JDBC library for #{@service_name} is configured incorrectly. It is configured both by-reference and by-containment\" unless by_reference.empty? || by_containment.empty?\n raise \"There is no configured JDBC library for #{@service_name}\" if by_reference.empty? && by_containment.empty?\n library = by_reference.empty? ? by_containment : by_reference\n library\n end",
"title": ""
},
{
"docid": "7129e792ae1f0e12ce5882baeac9bacd",
"score": "0.5082692",
"text": "def post_install\n end",
"title": ""
},
{
"docid": "e6ea241f1d135a793f527ae958161e30",
"score": "0.5073909",
"text": "def package_setup\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "45dd27ba021f74e894f778950da2cb5f",
"score": "0.5071487",
"text": "def install\n ENV.deparallelize\n ENV['OCAMLFIND_DESTDIR'] = \"#{lib}/ocaml/site-lib/\"\n\n (lib + \"ocaml/site-lib/\").mkpath\n\n system \"make\"\n system \"make install\"\n end",
"title": ""
},
{
"docid": "9877479bd2232e86d76c57846e1e3491",
"score": "0.5067031",
"text": "def retry_install\n Logger.arrow(\n 'Could not find a solution in local cache, refreshing packages...'\n )\n\n @git_resolver.clear\n resolver.add_constraints dependencies\n\n populate_elm_stuff\n rescue Solve::Errors::NoSolutionError => error\n puts 'Could not find a solution:'\n puts error.to_s.indent(2)\n end",
"title": ""
},
{
"docid": "3f0cf961e6563d5a1d9bac7e8c09595c",
"score": "0.50637984",
"text": "def library(lib)\n Dissident::LIBRARIES[self] = lib\n end",
"title": ""
},
{
"docid": "b966faf8aaa0e74f72f2370d913cc2c3",
"score": "0.50637543",
"text": "def installed_spec_directories; end",
"title": ""
},
{
"docid": "708bb56099fe4e3d65d3032bd9a1404e",
"score": "0.5056146",
"text": "def list_beshared_libraries\n get_list_beshared_libraries\n end",
"title": ""
},
{
"docid": "81f4a0cadecfcc4d3f6acbc18a86c67d",
"score": "0.5053198",
"text": "def check_gems\n @gems ||= {}\n @gems.keys.select { |g| Gem.source_index.find_name(g, @gems[g]).size == 0 }\n end",
"title": ""
},
{
"docid": "b93ae7f7f073f682005273d3126b11bf",
"score": "0.5043136",
"text": "def dep_find_and_copy(locs, shlibs)\n # load all the file names in locs into some hashes\n loc = {}\n locs.each do |lib| \n loc[lib] = {}\n Dir.glob(\"#{lib}/*\").each do |fp|\n fn = File.basename(fp)\n short = fn[/(\\w|\\d|_|\\-)+/] # up to first period\n hsh = loc[lib]\n ary = hsh[short]\n ary ? ary << fn : ary=[fn]\n hsh[short] = ary # needed? reference vs copy\n end\n end\n shlibs.each_key do |libname|\n hit = nil\n p = \"\"\n loc.each_pair do |k,hsh|\n if hsh[libname]\n hit = hsh[libname]\n p = k\n break\n end\n end\n if !hit\n puts \"Failed to find #{libname} in hashes\"\n abort\n else\n hits = []\n hit.each do |ent| \n if ent.include? \"#{libname}.#{DLEXT}\"\n hits << ent\n end\n end\n #puts \"Deal with #{hits.inspect} in #{p}\"\n if RUBY_PLATFORM =~ /mingw/\n cp \"#{p}/#{hits[0]}\", TGT_DIR\n else\n syml = {}\n cph = \"\"\n hits.each do |fn|\n fp =\"#{p}/#{fn}\"\n if File.symlink? fp\n syml[fp] = File.readlink(fp)\n else\n cph = fp\n end\n end\n if cph.length > 0\n cp cph, TGT_DIR\n Dir.chdir(TGT_DIR) do\n cph = File.basename(cph)\n syml.each_pair { |k,v| File.symlink(cph, File.basename(k)) }\n end\n else\n # We're Special! A symlink between dirs (libpcre.so?) - chase it\n syml.each_pair do |k,v|\n pos = \"#{ShoesDeps}#{v}\"\n while File.symlink?(pos) do\n #puts \"chase #{pos}\"\n pos = \"#{ShoesDeps}/#{File.readlink(pos)}\"\n end\n dp = File.dirname(v)\n fn = File.basename(pos)\n #puts \"chased #{k}, #{v} to here: #{pos}\"\n cp \"#{ShoesDeps}#{dp}/#{fn}\", TGT_DIR\n end\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "75e0ea04a664868cb799e69401ac1b5b",
"score": "0.50356007",
"text": "def load_minimal_gems\r\n end",
"title": ""
},
{
"docid": "5e8a4fed93d0643ad823d3140847b881",
"score": "0.5031764",
"text": "def additional_folders\n ['lib']\n end",
"title": ""
},
{
"docid": "3b2b86fab696f064cb53a9853ccf624b",
"score": "0.50242",
"text": "def default_gems() \n puts \"Gems found in default gem install location:\"\n gems_in_default = self.each_value.find_all do |gce|\n gce.gemsets_containing.include? 'default'\n end\n end",
"title": ""
},
{
"docid": "1412ebbd0773492e99b5505e5999a700",
"score": "0.5024175",
"text": "def excel_dlls_register(libraries)\n failed_registrations = []\n # Register the DLLs.\n libraries.each do |library|\n dll_name = @config_manager[\"library.#{library}.excel_dll\"].strip\n @logger.fine(\"Registering '#{dll_name}'...\")\n unless @excel.RegisterXLL(dll_name)\n @logger.warn(\"Registration failed for '#{dll_name}'.\")\n failed_registrations << dll_name if @config_manager[\"library.#{library}.required\", default: false]\n end\n end\n # Raise an exception if any required DLLs did not get registered.\n raise ExcelError.new(\"Registration failed for: #{failed_registrations.join(', ')}\") if failed_registrations.length > 0\n end",
"title": ""
},
{
"docid": "1f975a540dfe77f37c85cfe79c14261e",
"score": "0.5023067",
"text": "def use_usr_libs\n # Add flags\n set_rpi_flags\n add_flags(:c, '-I/usr/local/include')\nend",
"title": ""
},
{
"docid": "cd6520d924b68b638c4d3912bb27f27c",
"score": "0.5019765",
"text": "def install\n\n # --- custom ---\n ENV.prepend_path \"PKG_CONFIG_PATH\", \"/usr/local/lib/pkgconfig/\"\n inreplace \"build/modules.conf.in\", /^codecs/, \"#codecs\"\n\n args = []\n if build.with?(\"freetype\")\n ENV.append_to_cflags \"-I#{Formula[\"freetype\"].opt_include}/freetype2/\"\n else\n args << \"--without-freetype\"\n end\n\n if build.with?(\"lua\")\n ENV.append_to_cflags \"-I#{Formula[\"lua\"].opt_include}/lua/\"\n else\n inreplace \"build/modules.conf.in\", \"languages/mod_lua\",\n \"#languages/mod_lua\"\n end\n\n if build.with?(\"amqp\")\n inreplace \"build/modules.conf.in\", \"#event_handlers/mod_amqp\",\n \"event_handlers/mod_amqp\"\n end\n\n if build.with?(\"shout\")\n inreplace \"build/modules.conf.in\", \"#formats/mod_shout\",\n \"formats/mod_shout\"\n end\n\n if build.with?(\"libyuv\")\n raise \"Building with libyuv is not supported yet\"\n else\n args << \"--disable-libyuv\"\n end\n\n if build.with?(\"libvpx\")\n raise \"Building with libvpx is not supported yet\"\n else\n args << \"--disable-libvpx\"\n end\n\n # --- end of custom ---\n\n ENV[\"ac_cv_lib_lzma_lzma_code\"] = \"no\" # prevent opportunistic linkage to xz\n\n # avoid a dependency on ldns to prevent OpenSSL version conflicts\n inreplace \"build/modules.conf.in\", \"applications/mod_enum\",\n \"#applications/mod_enum\"\n\n system \"./bootstrap.sh\", \"-j\"\n\n # tiff will fail to find OpenGL unless told not to use X\n inreplace \"libs/tiff-4.0.2/configure.gnu\", \"--with-pic\", \"--with-pic --without-x\"\n\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-shared\",\n \"--enable-static\",\n \"--prefix=#{prefix}\",\n \"--exec_prefix=#{prefix}\",\n *args,\n \"LIBS=#{ENV['LIBS']}\",\n \"CFLAGS=#{ENV['CFLAGS']}\",\n \"CXXFLAGS=#{ENV['CFLAGS']}\",\n \"LDFLAGS=#{ENV['LDFLAGS']}\"\n\n system \"make\"\n system \"make\", \"install\", \"all\"\n\n if build.with?(\"moh\")\n # Should be equivalent to: system \"make\", \"cd-moh-install\"\n mkdir_p share/\"freeswitch/sounds/music\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-music-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/music\"\n end\n end\n end\n\n if build.with?(\"sounds-en\")\n # Should be equivalent to: system \"make\", \"cd-sounds-install\"\n mkdir_p share/\"freeswitch/sounds/en\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-en-us-callie-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/en\"\n end\n end\n end\n\n if build.with?(\"sounds-fr\")\n # Should be equivalent to: system \"make\", \"cd-sounds-fr-install\"\n mkdir_p share/\"freeswitch/sounds/fr\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-fr-ca-june-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/fr\"\n end\n end\n end\n\n if build.with?(\"sounds-ru\")\n # Should be equivalent to: system \"make\", \"cd-sounds-ru-install\"\n mkdir_p share/\"freeswitch/sounds/ru\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-ru-RU-elena-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/ru\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "02b249568ccb23ca7e1868adda9ad13a",
"score": "0.5007566",
"text": "def get_root_dirs_from_gems\n # Get Application root dir and Modules\n hlist = {}\n alist = []\n\n # All gems\n # NOTE: Gem::GemPathSearcher#initialize is deprecated with no replacement. It will be removed on or after 2011-10-01.\n # searcher = Gem::GemPathSearcher.new\n # list = searcher.init_gemspecs\n # GemPathSearcher => Specification\n path = \"\"\n specs = Gem::Specification.find_all # {|spec| spec.contains_requirable_file? path}\n specs = specs.sort_by { |spec| spec.version }\n\n specs.each do |spec|\n $log.debug \"spec name : #{spec.name}\"\n\n # TODO: pick the first (newone), must check the Gemfile?\n if spec.name == 'rails'\n if $rails_version.nil?\n $log.debug \"rails version is #{spec.version}\"\n $rails_version = spec.version.to_s\n end\n end\n\n # KNOWN security functions\n # authentication\n $authentication = 'devise' if spec.name == 'devise'\n $authentication = 'authlogic' if spec.name == 'authlogic' # TODO\n\n # authorization\n $authorization = 'cancan' if spec.name == 'cancan'\n $authorization = 'the_role' if spec.name == 'the_role' # TODO\n\n # test\n # TODO: rspec?\n $test = 'cucumber' if spec.name == 'cucumber'\n\n c_path = spec.full_gem_path + '/app/controllers'\n v_path = spec.full_gem_path + '/app/views'\n if File.exists?(c_path) && File.exists?(v_path)\n if hlist[spec.name].nil?\n # new\n $log.debug \"rails app?\"\n hlist[spec.name] = [spec.version, spec.full_gem_path]\n else\n # hit, select latest one\n if hlist[spec.name][0] < spec.version\n hlist[spec.name][0] = spec.version\n hlist[spec.name][1] = spec.full_gem_path\n end\n end\n elsif File.exists?(c_path)\n puts \"TODO C only #{spec.full_gem_path}\"\n elsif File.exists?(v_path)\n puts \"TODO V only #{spec.full_gem_path}\"\n end\n end\n # Add this app\n hlist['this'] = [nil, Dir.pwd]\n hlist\n end",
"title": ""
},
{
"docid": "a4062f0e6236d7eb6bbafa85f028d2eb",
"score": "0.5005902",
"text": "def installed_by_version # :nodoc:\n @installed_by_version ||= Gem::Version.new(0)\n end",
"title": ""
},
{
"docid": "347a6889511da1a40720292c4a017a5b",
"score": "0.50049853",
"text": "def site_packages\n effective_lib+\"python2.7/site-packages\"\n end",
"title": ""
},
{
"docid": "15559adeb33774564cf86ce4c354b41d",
"score": "0.5004732",
"text": "def xfixil(path) \n path.gsub!(/-L\\/usr\\/lib/, \"-L#{TGT_SYS_DIR}usr/lib\")\n return path\nend",
"title": ""
},
{
"docid": "38de8fa68590e0371284735948010031",
"score": "0.50009364",
"text": "def install\n # ENV.deparallelize # if your formula fails when building in parallel\n args = std_cmake_args\n if build.with? \"static\"\n args << \"-DBUILD_SHARED_LIBS:BOOL=OFF\"\n end\n inreplace \"cmake/External_zlib.cmake\", \"1.2.8\", \"1.2.11\"\n inreplace \"cmake/External_zlib.cmake\", \"44d667c142d7cda120332623eab69f40\", \"1c9f62f0778697a09d36121ead88e08e\"\n\n system \"cmake\", \".\", *args\n system \"make\"\n system \"make\", \"install\"\n end",
"title": ""
},
{
"docid": "502364b9e8539bfa79e954f457d2f77b",
"score": "0.49991837",
"text": "def patch_nokogiri\n rm_rf \"deps.rip\"\n end",
"title": ""
},
{
"docid": "23c5e85edf144e58797552367faaa170",
"score": "0.49981248",
"text": "def referenced_libraries\n # TODO: check content type before scanning\n content.scan(%r{\\s*needs\\s+[\\\"\\'](.+)/(.+)[\\\"\\']}).map { |a, b| a + '/' + b }.uniq\n end",
"title": ""
},
{
"docid": "7651aa0bbce502d40b609ddd0895f0d1",
"score": "0.49942577",
"text": "def constrain(lib)\n cmp = index[lib.name]\n if Array === cmp\n index[lib.name] = lib\n else\n if lib.version != cmp.version\n raise VersionError\n end\n end\n end",
"title": ""
},
{
"docid": "d7d6c45f4df3afc998fddb433141a9b8",
"score": "0.49936822",
"text": "def global_site_packages\n HOMEBREW_PREFIX/\"lib/#{xy}/site-packages\"\n end",
"title": ""
},
{
"docid": "0138aa9e4bb4c25104706c1450ed5fc5",
"score": "0.4990501",
"text": "def installPackages\n Dir.chdir(\"/tmp\")\n `wget http://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz`\n `wget http://garr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz`\n `tar -zxf nagios-plugins-1.5.tar.gz`\n `tar -zxf nrpe-2.15.tar.gz`\n Dir.chdir(\"nagios-plugins-1.5\")\n `./configure`\n `make`\n `make install`\n `chown nagios.nagios /usr/local/nagios`\n `chown -R nagios.nagios /usr/local/nagios/libexec`\n Dir.chdir(\"../nrpe-2.15\")\n `./configure`\n `make all`\n `make install-plugin`\n `make install-daemon`\n `make install-daemon-config`\n `make install-xinetd`\n end",
"title": ""
},
{
"docid": "1d28757a37139c69fa6ad3dbb1f19a58",
"score": "0.49889418",
"text": "def check_all_packages\n packages_not_installed = []\n Constants::PACKAGES.each do |pkg|\n string = \"Looking for package #{pkg}...\"\n installed = check_package(pkg)\n installed ? string << green(\"Found\") : string << red(\"Not Found\")\n log_print string\n if !installed\n #if not installed append package name to packages_not_installed list\n packages_not_installed << pkg\n end #if\n end #do\n \n packages_not_installed\n end",
"title": ""
},
{
"docid": "d824b71b49260571b47e14c862037b53",
"score": "0.49885938",
"text": "def set_up_libraries\n R.eval <<-EOR\n suppressMessages(library(ROCR, warn.conflicts = FALSE, quietly=TRUE))\n suppressMessages(library(bestglm, warn.conflicts = FALSE, quietly=TRUE))\n suppressMessages(library(lsr, warn.conflicts = FALSE, quietly=TRUE))\n suppressMessages(library(FactoMineR, warn.conflicts = FALSE, quietly=TRUE))\n source('#{File.dirname(__FILE__)}/experience_functions.R')\n EOR\n end",
"title": ""
},
{
"docid": "5a32cbb7d48c5a36f6411659bb778b85",
"score": "0.49875972",
"text": "def install\n ENV[\"ENABLE_MONGODB\"] = \"0\"\n #ENV[\"LDFLAGS\"] = \"-all_load\"\n\n\n #ENV[\"ENABLE_MYSQL\"] = \"1\"\n #ENV[\"CC\"] = \"#{Formula[\"gcc\"].bin}/gcc-9\"\n #ENV[\"CXX\"] = \"#{Formula[\"gcc\"].bin}/g++-9\"\n #ENV[\"CFLAGS\"] = \"-I/usr/local/include\"\n #ENV[\"CXXFLAGS\"] = \"-I/usr/local/include\"\n #ENV[\"LDFLAGS\"] = \"-L/usr/local/lib\"\n\n cmake_args = %w[]\n cmake_args << \"-DUSE_STATIC_LIBRARIES=1\" if MacOS.version >= :sierra\n cmake_args << \"-DENABLE_MYSQL=0\"\n cmake_args << \"-DENABLE_IPO=0\" # WE have -- IPO/LTO not enabled.\n # cmake_args << \"-DLLVM_ENABLE_LTO=Thin\" # ????\n\n mkdir \"build\"\n # boost somehow is not populated with standard git commands, do manual forced fetch!\n system \"git\", \"submodule\", \"update\", \"--init\", \"--recursive\", \"--force\", \"contrib/boost\"\n cd \"build\" do\n system \"cmake\", \"..\", *cmake_args\n system \"ninja\"\n if MacOS.version >= :sierra\n #lib.install Dir[\"#{buildpath}/build/dbms/*.dylib\"]\n #lib.install Dir[\"#{buildpath}/build/contrib/libzlib-ng/*.dylib\"]\n end\n bin.install \"#{buildpath}/build/dbms/programs/clickhouse\"\n bin.install_symlink \"clickhouse\" => \"clickhouse-server\"\n bin.install_symlink \"clickhouse\" => \"clickhouse-client\"\n end\n\n mkdir \"#{var}/clickhouse\"\n\n inreplace \"#{buildpath}/dbms/programs/server/config.xml\" do |s|\n s.gsub! \"/var/lib/clickhouse/\", \"#{var}/clickhouse/\"\n s.gsub! \"/var/log/clickhouse-server/\", \"#{var}/log/clickhouse/\"\n s.gsub! \"<!-- <max_open_files>262144</max_open_files> -->\", \"<max_open_files>262144</max_open_files>\"\n end\n\n # Copy configuration files\n mkdir \"#{etc}/clickhouse-client/\"\n mkdir \"#{etc}/clickhouse-server/\"\n mkdir \"#{etc}/clickhouse-server/config.d/\"\n mkdir \"#{etc}/clickhouse-server/users.d/\"\n\n #there is no client config as of Sept 2017\n #(etc/\"clickhouse-client\").install \"#{buildpath}/dbms/src/Client/config.xml\"\n (etc/\"clickhouse-server\").install \"#{buildpath}/dbms/programs/server/config.xml\"\n (etc/\"clickhouse-server\").install \"#{buildpath}/dbms/programs/server/users.xml\"\n end",
"title": ""
},
{
"docid": "fa6623a7fec308682e086b901d4902f7",
"score": "0.49855354",
"text": "def install!\n refresh_file_accessors\n prepare_pod_groups\n add_source_files_references\n add_frameworks_bundles\n add_vendored_libraries\n add_resources\n add_developer_files unless sandbox.development_pods.empty?\n link_headers\n end",
"title": ""
},
{
"docid": "2a8eba74c175b3e5886d2659e46d7f18",
"score": "0.49851722",
"text": "def activate(library)\n name = library.name\n\n lib = $LEDGER.index[name]\n\n if Library === lib\n raise VersionConflict.new(library, lib) if lib != library\n else\n library.absolute_loadpath.each do |path|\n $LOAD_PATH.unshift(path)\n end\n\n $LEDGER.index[name] = library\n\n# TODO\n #if library.requirements.exist?\n # library.requirements.verify(true)\n # # complete collapse\n #end\n end\n end",
"title": ""
},
{
"docid": "34fe576287c9cd6aa3645567f61abde6",
"score": "0.49811548",
"text": "def init_links(installed_path, tpkgfile)\n # I think users would rather have packages install without their init\n # scripts enabled than have them fail to install on platforms where we\n # don't have init script support.\n # raise NotImplementedError\n warn \"No init script support for OS #{os}\"\n []\n end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.49748525",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.49748525",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.49748525",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "dce114eefb754df2071eef9b8e58ebbb",
"score": "0.49704516",
"text": "def reuse(workspace_root)\n return if reused_installations.any? { |mnf| mnf.path == workspace_root }\n\n manifest = InstallationManifest.from_workspace_root(workspace_root)\n manifest.load\n @reused_installations << manifest\n manifest.each do |pkg|\n ignore_package pkg.name\n end\n end",
"title": ""
},
{
"docid": "a4c71f52c0f1f3f85b2e1125b07f9e10",
"score": "0.49668318",
"text": "def load_dependencies\r\n @local_gems.each do |gem_info|\r\n gem_file_name = gem_info.gem_file\r\n gem_name = installed_as_name_for( short_form_of_gem_name( gem_file_name ) )\r\n @required_gem_names.delete gem_file_name\r\n end\r\n @required_gem_paths.each do |gem_path|\r\n gem_short_name = short_form_of_gem_name gem_path\r\n if @required_gem_names.include? gem_short_name\r\n puts \"installing #{gem_path}\"\r\n installer = @force_require ? PreloadingInstaller.new( gem_path, @local_gems ) : Installer.new( gem_path )\r\n installer.install\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "be9ec954c6ac8186521a780b7e16eb61",
"score": "0.4964241",
"text": "def check_and_install_packages_if_needed host, package_list\n package_list.each do |string|\n alternatives = string.split('|')\n next if alternatives.any? { |pkg| host.check_for_package pkg }\n\n install_one_of_packages host, alternatives\n end\n end",
"title": ""
}
] |
52b7bd4c161412c8fa51dba97988b840
|
:callseq: enum.first => obj or nil enum.first(n) => an_array Returns the first element, or the first +n+ elements, of the enumerable. If the enumerable is empty, the first form returns nil, and the second form returns an empty array.
|
[
{
"docid": "d232e02f504877cfa473118e568b4335",
"score": "0.69016004",
"text": "def first(count=MaglevUndefined)\n if count._equal?(MaglevUndefined)\n return self.first()\n end\n # return Array of first count elements of the enumeration\n cnt = Maglev::Type.coerce_to(count, Fixnum, :to_int)\n if cnt <= 0\n if cnt._equal?(0)\n return []\n end\n raise ArgumentError, 'negative count'\n end\n arr = []\n n = 0\n self.each { |o| \n arr << o\n n += 1\n if n >= cnt\n return arr\n end\n }\n return arr\n end",
"title": ""
}
] |
[
{
"docid": "5e018131114011917e43ee26f754ec52",
"score": "0.7044337",
"text": "def first\n @enumerable.first\n end",
"title": ""
},
{
"docid": "1bfbc39bfdd6c5b376ded9802cc5adef",
"score": "0.6857624",
"text": "def first\n limit(1).to_a.first\n end",
"title": ""
},
{
"docid": "cd2135263854705e063bb6e7babbd86d",
"score": "0.67804897",
"text": "def first\n all[0]\n end",
"title": ""
},
{
"docid": "593082b9b32f3db55423f6c1e122a235",
"score": "0.6768548",
"text": "def first\n enumerator(:limit => 1).first \n end",
"title": ""
},
{
"docid": "6dc2e2b83a43a0b9bc83e0b77f542b29",
"score": "0.66591614",
"text": "def first(n = 1)\n return self.clone if n >= self.size\n return self[0] if n == 1\n return self[0...n]\n end",
"title": ""
},
{
"docid": "a549f2f2e7667c8220c61980922e6632",
"score": "0.6656202",
"text": "def first_of(array)\n return array[0]\nend",
"title": ""
},
{
"docid": "a549f2f2e7667c8220c61980922e6632",
"score": "0.6656202",
"text": "def first_of(array)\n return array[0]\nend",
"title": ""
},
{
"docid": "b7a7dee68c6f16a53698781d90d505df",
"score": "0.6655777",
"text": "def using_first(array)\n array.first\nend",
"title": ""
},
{
"docid": "b7a7dee68c6f16a53698781d90d505df",
"score": "0.6655777",
"text": "def using_first(array)\n array.first\nend",
"title": ""
},
{
"docid": "b7a7dee68c6f16a53698781d90d505df",
"score": "0.6655777",
"text": "def using_first(array)\n array.first\nend",
"title": ""
},
{
"docid": "b7a7dee68c6f16a53698781d90d505df",
"score": "0.6655777",
"text": "def using_first(array)\n array.first\nend",
"title": ""
},
{
"docid": "633327374f5f7ad0ae1421e894e7e02a",
"score": "0.6588285",
"text": "def first(*n) end",
"title": ""
},
{
"docid": "aaf8622d49b383175da6b4d22e91d3cd",
"score": "0.6584903",
"text": "def using_first(array)\narray.first\nend",
"title": ""
},
{
"docid": "a3804fb96f3defde20bfb2a427285d18",
"score": "0.6583058",
"text": "def get_first_element(arr)\n return arr.first()\nend",
"title": ""
},
{
"docid": "d8ed13a86012fbe9f8333fd700d8b2d7",
"score": "0.6561277",
"text": "def first(arr)\n return arr[0]\nend",
"title": ""
},
{
"docid": "325f1be1f4706d80a18e386ec67c7b94",
"score": "0.65542483",
"text": "def first(n = nil)\n if n\n apply_scope(:first, n)\n else\n self[0]\n end\n end",
"title": ""
},
{
"docid": "96cdb817e77ac10eeeba56b1791c9d82",
"score": "0.65349084",
"text": "def first_of(arr)\n return arr[0]\nend",
"title": ""
},
{
"docid": "96cdb817e77ac10eeeba56b1791c9d82",
"score": "0.65349084",
"text": "def first_of(arr)\n return arr[0]\nend",
"title": ""
},
{
"docid": "96cdb817e77ac10eeeba56b1791c9d82",
"score": "0.65349084",
"text": "def first_of(arr)\n return arr[0]\nend",
"title": ""
},
{
"docid": "dcec344034b9e27b6160c98431139091",
"score": "0.65227365",
"text": "def first\n to_a.first\n end",
"title": ""
},
{
"docid": "0be0108dcbfb49e8fcac19f38f732950",
"score": "0.6467257",
"text": "def first_of(array)\n output = array[0]\n return output\nend",
"title": ""
},
{
"docid": "b734ee2afa73b553a84ff9ab0b7afa24",
"score": "0.6449376",
"text": "def using_first(array)\n first_element=array.first\nend",
"title": ""
},
{
"docid": "f7db7f6aa48d753c92b690f768aa085f",
"score": "0.63928604",
"text": "def first list, n = 1\n n == 1 ? list.first : list.first(n)\nend",
"title": ""
},
{
"docid": "ed27718311c3cc375143d9ad2587a34c",
"score": "0.63145083",
"text": "def first list, n=nil\n n ? list.first(n) : list.first\nend",
"title": ""
},
{
"docid": "40e9fb9717b5da76fdf66dd82a68ab8e",
"score": "0.63075686",
"text": "def first options = {}\n enum(options.merge(:limit => 1)).first\n end",
"title": ""
},
{
"docid": "fcf173b6dc71155fd8f0576dea4e0fd3",
"score": "0.62972826",
"text": "def retrieve_first_element_from_array(array)\n array.first\nend",
"title": ""
},
{
"docid": "5c5fc65b6ceb2a29d540060d6b38bc58",
"score": "0.6296858",
"text": "def custom_first(arr, num_of_elements = 0)\n return arr[0] if num_of_elements == 0\n arr[0, num_of_elements]\nend",
"title": ""
},
{
"docid": "7ab35b4cbdd66cfe2d5390e4536dccb5",
"score": "0.6283712",
"text": "def get_first_element(arr)\n arr.first\nend",
"title": ""
},
{
"docid": "e252b6a05b1f861b90f932bd605329db",
"score": "0.62778014",
"text": "def retrieve_first_element_from_array(array)\n return array[0]\nend",
"title": ""
},
{
"docid": "13497b1ac8472782196850389bab4350",
"score": "0.6270705",
"text": "def custom_first(arr,num=0)\n return arr[0] if num==0\n arr[0...num]\nend",
"title": ""
},
{
"docid": "64ac3e3bd131035a81081a18eee02b20",
"score": "0.6262331",
"text": "def first(n=1)\n return values[0] if self.class == BaseRelation && loaded && n == 1\n result = limit(n).load\n result.length == 1 ? result[0] : result\n end",
"title": ""
},
{
"docid": "c158a101ed2ec2f85b50e5efc7dc1f91",
"score": "0.6245101",
"text": "def first_element(array)\n array[0]\nend",
"title": ""
},
{
"docid": "02671fe312ebe9f42d2b9bf64cc451a9",
"score": "0.6241569",
"text": "def first\n self.take(1)[0]\n end",
"title": ""
},
{
"docid": "0fccc19184b92c532d09802d553f178b",
"score": "0.6240804",
"text": "def first(n = nil)\n if n\n self[0,n]\n else\n self[0]\n end\n end",
"title": ""
},
{
"docid": "4142e49fd330ffa70ac0e43f6ef6506f",
"score": "0.6224919",
"text": "def first(*args)\n find_first_or_last(:first, *args)\n end",
"title": ""
},
{
"docid": "e6e73412ca34426dd98cf8ccd3f39c74",
"score": "0.6224307",
"text": "def retrieve_first_element_from_array(array)\n array[0]\nend",
"title": ""
},
{
"docid": "c000ef5894a18cc58eae25dbbf6ea1d5",
"score": "0.6210894",
"text": "def first\n if resources.is_a?(Array)\n resources.first\n else\n resources\n end\n end",
"title": ""
},
{
"docid": "6afe5ce8f9a9be7d0bb3fed6cdc16f08",
"score": "0.61623484",
"text": "def first(numbers, int)\n numbers.first(int)\nend",
"title": ""
},
{
"docid": "21fd28930aba4d1b9025f4e0e0ff7146",
"score": "0.6160729",
"text": "def first\n items.compact.first\n end",
"title": ""
},
{
"docid": "515f46101ebfe2ce4c698a4633efc5e6",
"score": "0.6147647",
"text": "def select_first(&block)\n if block_given?\n result = nil\n begin\n each { |obj|\n result = yield obj\n return result unless result.nil?\n }\n rescue StopIteration => ex\n end\n result\n else\n to_enum(:select_first)\n end\n end",
"title": ""
},
{
"docid": "abf2ba87c051871134d0fd0bba3cad8a",
"score": "0.6145499",
"text": "def custom_first(arr,num=0)\n l = arr.length\n if num==0\n arr[0]\n else\n (num<l)? arr[0...num] : arr[0...l]\n end\nend",
"title": ""
},
{
"docid": "083c5ea7840cebac7040ed65145d4891",
"score": "0.61174524",
"text": "def first(*args)\n all.send(:first, *args)\n end",
"title": ""
},
{
"docid": "f1d6ccf72a4791191b3ed11042c51c87",
"score": "0.6098392",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "f1d6ccf72a4791191b3ed11042c51c87",
"score": "0.6098392",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "f1d6ccf72a4791191b3ed11042c51c87",
"score": "0.6098392",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "f1d6ccf72a4791191b3ed11042c51c87",
"score": "0.6098392",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "f3e29201a0a7fdd4fd2417f526af115d",
"score": "0.6092916",
"text": "def first(n = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f3e29201a0a7fdd4fd2417f526af115d",
"score": "0.6092916",
"text": "def first(n = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "fa2b9580b681a207a117f28eac8b4d7f",
"score": "0.6057951",
"text": "def first() end",
"title": ""
},
{
"docid": "8df3c24fd60b474a09cd3c44ea6a0149",
"score": "0.6052477",
"text": "def first\r\n self[0]\r\n end",
"title": ""
},
{
"docid": "9bed8297353a68ef6032aa875fb76bf6",
"score": "0.60189563",
"text": "def first\n @values.first\n end",
"title": ""
},
{
"docid": "59fa5fc7debc26276f71334c0bd93dc5",
"score": "0.6012632",
"text": "def first\n @elements.empty? ? nil : @elements[0]\n end",
"title": ""
},
{
"docid": "4218e2bb8bec1ca8925e43134da049eb",
"score": "0.6005079",
"text": "def first\n self[0]\n end",
"title": ""
},
{
"docid": "70ec172b4070fde1ceaa35850bda4c06",
"score": "0.6002572",
"text": "def first(options = {})\n all(options).first\n end",
"title": ""
},
{
"docid": "d91ffa3263c22a534dba0b3f73ec8e91",
"score": "0.59874594",
"text": "def first_element_with_array_methods(array)\n array.first\nend",
"title": ""
},
{
"docid": "d91ffa3263c22a534dba0b3f73ec8e91",
"score": "0.59874594",
"text": "def first_element_with_array_methods(array)\n array.first\nend",
"title": ""
},
{
"docid": "6dd5f7f4ac96f41e0d851286c6dd2969",
"score": "0.5961585",
"text": "def first\n result ? all.first : limit(1).all.first\n end",
"title": ""
},
{
"docid": "cbfc57f33718a6a415035dcee0a81c0f",
"score": "0.595182",
"text": "def first(n=nil)\n to_recv = n || 1\n received = []\n each do |m|\n received << m\n break if received.size == to_recv\n end\n n ? received : received.first\n end",
"title": ""
},
{
"docid": "3b4445546b0454bbe9781276080628bb",
"score": "0.59487903",
"text": "def all_or_one(what, &block)\n result = Array(what).each(&block)\n return what.is_a?(Array) ? result : result.first\n end",
"title": ""
},
{
"docid": "2ae4f9fdae82743ea93e5d9cc65243c4",
"score": "0.59406763",
"text": "def first_or_nil(lst)\n return nil if lst.nil?\n lst.first\nend",
"title": ""
},
{
"docid": "581500bc7f5878fa9880d5f29d389f4c",
"score": "0.59387577",
"text": "def array_first\n golf_scores=[75,76,78,77,79,74,72] # this is the orignal array\n golf_scores.first(3) #this example return the first 3 scores\n # from the golf_scores array\nend",
"title": ""
},
{
"docid": "87e719ee17cfdb56dd1c7c5f043948ec",
"score": "0.5937974",
"text": "def first_element_with_array_methods(array)\n return array.first\nend",
"title": ""
},
{
"docid": "36e319aed072aa2b5758190d19ac29a1",
"score": "0.5923342",
"text": "def custom_first(arr, num= 0)\n arr[0..num]\nend",
"title": ""
},
{
"docid": "b7f1d151b8eb9eb76d62865f955f4849",
"score": "0.5918875",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "b7f1d151b8eb9eb76d62865f955f4849",
"score": "0.5918875",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "b7f1d151b8eb9eb76d62865f955f4849",
"score": "0.5918875",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "e28573f91a0597efd17b6829e261a3ab",
"score": "0.59120303",
"text": "def first\n self[0]\n end",
"title": ""
},
{
"docid": "e28573f91a0597efd17b6829e261a3ab",
"score": "0.59120303",
"text": "def first\n self[0]\n end",
"title": ""
},
{
"docid": "4a12b8d122b44585ef8547d08f7474af",
"score": "0.59095794",
"text": "def first\n\n @items.values.first\n end",
"title": ""
},
{
"docid": "82bc4bc3cbdbb5679b844e763cd72e2d",
"score": "0.5900663",
"text": "def first(*several_variants)\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "4feeab9ac2cb42cfbe9d35db0681713c",
"score": "0.5891771",
"text": "def custom_first(arr, num=0)\n return arr[0] if num == 0\n arr[0, num]\nend",
"title": ""
},
{
"docid": "4726578050fcf364af05a21a12a9b3d9",
"score": "0.5887497",
"text": "def first\n\t\t\tarray = pop\n\t\t\traise ArgumentError, \"FIRST: first element is not an Array.\" unless array.is_a? Array\n\t\t\traise ArgumentError, \"FIRST: empty array.\" if array.length == 0\n\t\t\tpush array.first\n\t\tend",
"title": ""
},
{
"docid": "bb9ec31f4138f7bd6ace66956677d1dd",
"score": "0.5874817",
"text": "def first(*args)\n if args.any?\n if args.first.kind_of?(Integer) ||\n (loaded? && !args.first.kind_of?(Hash))\n to_a.first(*args)\n else\n apply_finder_options(args.first).first\n end\n else\n find_first\n end\nend",
"title": ""
},
{
"docid": "58b9be6a523b1dd8e88cd0c17cb38d01",
"score": "0.5874207",
"text": "def first_item(elective_array)\n return elective_array[0]\nend",
"title": ""
},
{
"docid": "07f9b1883eb9f5a3749025292ed7a7ef",
"score": "0.58699894",
"text": "def first\n all.first\n end",
"title": ""
},
{
"docid": "2147b5c259fd88538095d9e97d0e3cdb",
"score": "0.5850798",
"text": "def butfirst\n if self.empty?\n []\n else\n self[1..-1]\n end\n end",
"title": ""
},
{
"docid": "c43a897ef80fe4e0dff66806cd41da81",
"score": "0.58391875",
"text": "def custom_first(arr, num = 0)\n return arr[0] if num == 0\n arr[0, num]\nend",
"title": ""
},
{
"docid": "fd5022fc6a14ecdec27a947a2c331812",
"score": "0.58262306",
"text": "def first_event(array)\n array.first\nend",
"title": ""
},
{
"docid": "a7e97f607db1fb641f16ac3efa0b80f2",
"score": "0.578924",
"text": "def head_or_all(arr)\n f, *r = arr\n return f if r.empty?\n arr\nend",
"title": ""
},
{
"docid": "1fb0a9b8041c9db6ae8f0bee96832c4b",
"score": "0.57763284",
"text": "def first\n self.slice(0)\n end",
"title": ""
},
{
"docid": "5427bd5a8dfb865799dcaa553ec264f0",
"score": "0.57585764",
"text": "def first\n\n wi(fetch_all({}).first)\n end",
"title": ""
},
{
"docid": "a288d8e1c85b4a7dfc16ff94e0d7f9de",
"score": "0.57430947",
"text": "def nth_from_array_or_range\n C.curry.(\n ->(xs, n) {\n xs.is_a?(Range) ? xs.first(n) : S.take.(xs, n)\n }\n )\n end",
"title": ""
},
{
"docid": "5cd90623b61fd2c29e6f8a3c44446ef1",
"score": "0.57380795",
"text": "def first ; list.first ; end",
"title": ""
},
{
"docid": "49ec019b8fb1ea5070ea0ba4ab93cda8",
"score": "0.5723763",
"text": "def first(n = 1)\n if n > 1\n (ds = Array(min)).empty? ? ds : ds.concat(ds[0].next(n - 1))\n else\n min\n end\n end",
"title": ""
},
{
"docid": "0d3a6f457d0aaa5f1f77e74531e6cdfa",
"score": "0.57143",
"text": "def first(amount = nil)\n objects = all.first(amount || 1)\n amount.nil? ? objects.first : objects\n end",
"title": ""
},
{
"docid": "1b34aefb62b6c2dc489d8f5d15ce08ff",
"score": "0.5706147",
"text": "def peek\n raise StopIteration if @enumerators.empty?\n minimum_enumrator.peek\n end",
"title": ""
},
{
"docid": "bb3074fc97cfcb3ab2b0921b14dda248",
"score": "0.57029164",
"text": "def first(*args)\n find(:first, *args)\n end",
"title": ""
},
{
"docid": "bb3074fc97cfcb3ab2b0921b14dda248",
"score": "0.57029164",
"text": "def first(*args)\n find(:first, *args)\n end",
"title": ""
},
{
"docid": "696d53569ee2d1fcbe0f0d0d0489ad6a",
"score": "0.5697428",
"text": "def first_index(arr, &prc)\n\n arr.each_with_index do |ele, i|\n return i if prc.call(ele)\n end\n return nil\nend",
"title": ""
},
{
"docid": "c54ac1209133ad4b0df7c9151d8f956e",
"score": "0.5683287",
"text": "def only default: nil\n if count == 1\n first\n else\n default\n end\n end",
"title": ""
},
{
"docid": "975b5dfb0a71735e372d81d0ba2ef2f4",
"score": "0.56662613",
"text": "def first_index(arr, &prc)\n arr.each.with_index do |ele, idx| \n return idx if prc.call(ele)\n end\n nil\nend",
"title": ""
},
{
"docid": "55452ff04ce10283e3b984096325f66f",
"score": "0.5660433",
"text": "def first\n @range.first\n end",
"title": ""
},
{
"docid": "059360038429fbbe604b7cbb0778f533",
"score": "0.56576765",
"text": "def first(*args)\n find(:first, *args)\n end",
"title": ""
},
{
"docid": "ce6f1a03e72dbf1a7b188ae986f56e0c",
"score": "0.56433624",
"text": "def first(count = nil)\n if count.nil?\n @collection.first\n else\n out = []\n @collection.first(count).each do |item|\n out << item\n end\n out\n end\n end",
"title": ""
},
{
"docid": "0beec2afc074323cef4cd8eb3a825a92",
"score": "0.5641149",
"text": "def one(array)\n return array.first if array.one?\n\n raise SizeError,\n \"expected size to be exactly 1 but size was #{array.size}\"\n end",
"title": ""
},
{
"docid": "866af3d7d0a0f2e137b63c17b5c1967b",
"score": "0.56372744",
"text": "def first(limit = 1)\n take(limit)\n end",
"title": ""
},
{
"docid": "2a62b64bba825fd3b7c48b3424952b04",
"score": "0.56318206",
"text": "def select_first!\n limit(1).select!.first\n end",
"title": ""
},
{
"docid": "2f451d3c0edf52235c48ba88c89b7080",
"score": "0.56288534",
"text": "def first(options = {})\n raise MethodNotAllowed.new(self, :all) unless self.class.permissions && self.class.permissions[:read]\n result = all(options)\n result.first if result.is_a?(Array)\n end",
"title": ""
},
{
"docid": "f327e41bdf6e0ba9486036cd3b1b21fa",
"score": "0.5619087",
"text": "def first_element_with_array_methods(first_country)\n first_country = @south_east_asia.first\nend",
"title": ""
},
{
"docid": "bd1e5d5ecaccb55b1d1518a6d271b983",
"score": "0.5563044",
"text": "def first_index(arr, &proc)\r\n arr.each_with_index { |el, i| return i if proc.call(el) }\r\n nil\r\nend",
"title": ""
}
] |
47e2ec52d0776fa38f896811ff7c1151
|
Extract buyer's info for agent's enquiries curl XGET 'Authorization: bns6nsk2n' '
|
[
{
"docid": "c3f54ee1460c568554a3ca23465fcb0d",
"score": "0.61228865",
"text": "def agent_enquiries_buyer_reqs\n attr_list = [:min_beds, :max_beds, :min_baths, :max_baths, :min_receptions, :max_receptions, :property_types,\n :status, :buying_status, :funding, :biggest_problems, :chain_free, :budget_from, :budget_to, :locations,\n :mortgage_approval ].map(&:to_s)\n buyer_details = PropertyBuyer.where(id: params[:buyer_id].to_i).select(attr_list).last.as_json\n response = nil\n\n if buyer_details\n buyer_details['status'] = PropertyBuyer::REVERSE_STATUS_HASH[buyer_details['status']]\n buyer_details['buying_status'] = PropertyBuyer::REVERSE_BUYING_STATUS_HASH[buyer_details['buying_status']]\n buyer_details['funding'] = PropertyBuyer::REVERSE_FUNDING_STATUS_HASH[buyer_details['funding']]\n buyer_details['property_tracking'] = Events::Track.where(udprn: params[:udprn].to_i).select(:id).last.nil?\n response = {}\n (attr_list- ['property_tracking', 'chain_free', 'budget_from', 'budget_to']).each { |t| response[\"buyer_#{t}\"] = buyer_details[t] }\n response['property_tracking'] = buyer_details['property_tracking']\n response['chain_free'] = buyer_details['chain_free']\n response['buyer_min_budget'] = buyer_details['budget_from']\n response['buyer_max_budget'] = buyer_details['budget_to']\n end\n Rails.logger.info(\"RESPONSE_#{response}\")\n\n render json: { buyer_details: response }, status: 200\n end",
"title": ""
}
] |
[
{
"docid": "5f4a91a29578e5dd3a60424fe65a5a58",
"score": "0.58904076",
"text": "def buyer_intent_info\n buyer_intent_info = Enquiries::PropertyService.new(udprn: params[:udprn].to_i).buyer_intent_info\n render json: buyer_intent_info, status: 200\n end",
"title": ""
},
{
"docid": "98fc2e6164e48f4153eb1f9618703e8b",
"score": "0.5844509",
"text": "def buyer_info(buyer_id)\n GunBroker::API.get('/Users/ContactInfo', { 'UserID' => buyer_id }, token_header(@token))\n end",
"title": ""
},
{
"docid": "398d4818e2e7c8af4e308ee72dcd2ca7",
"score": "0.577265",
"text": "def get_agent_by_email email\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get AGENTS, nil, \"query=\"+URI.encode(\"email is #{email}\") )\n\t\t\t\tend",
"title": ""
},
{
"docid": "1f6745b279abddd8e2da4b341121693d",
"score": "0.56657946",
"text": "def get_profile(xq_publisher_token, xq_client_token)\n\tLOGGER.info \"get researcher profile from Click-Through Service using publisher_token #{xq_publisher_token}\"\n\tbegin\n\t\tresponse = \tRestClient.get(\"https://apps.crossref.org/clickthrough/api/licenses/#{xq_client_token}\", { :cr_clickthrough_publisher_token => xq_publisher_token })\n\trescue Exception => e\n\t\tLOGGER.error \"error looking up license with Click-Through Service: #{e.http_code}\"\n\t\tcase e.http_code\n\t\twhen 404\n\t\t\traise APITokenNotFound\n\t\twhen 500\n\t\t\traise ClickThroughServiceDown\n\t\telse\n\t\t\traise e\n\t\tend\n\tend\n\treturn JSON.parse response\nend",
"title": ""
},
{
"docid": "1e7c2f341a33bc2381f1fcb9714784ea",
"score": "0.5632921",
"text": "def agent\n @agent ||= Sawyer::Agent.new(endpoint) do |http|\n http.headers[:content_type] = \"application/json\"\n http.headers[:Accept] = \"application/json\"\n http.headers[:apikey] = Citybreak::Config.api_key\n end\n end",
"title": ""
},
{
"docid": "2852bdfb0e00faff856a0e5bbcca9e73",
"score": "0.56018925",
"text": "def branch_specific_invited_developers\n agent = user_valid_for_viewing?('Developer')\n if !agent.nil?\n branch_id = agent.branch_id\n invited_developers = InvitedDeveloper.where(branch_id: branch_id).select([:email, :created_at])\n render json: invited_developers, status: 200\n else\n render json: { message: 'Authorization failed' }, status: 401\n end\n end",
"title": ""
},
{
"docid": "24a1a79722f5f03784e9ac87b084f9c7",
"score": "0.55973196",
"text": "def user_requested_by()\n response = get(\"users/self/requested-by\")\n response[\"data\"]\n end",
"title": ""
},
{
"docid": "3bbfa8d5827087ddf423ff6316ef7861",
"score": "0.55742234",
"text": "def agent_properties_vendor_buying_reqs\n property_details = PropertyDetails.details(params[:udprn].to_i)[:_source]\n attr_list = [:min_beds, :max_beds, :min_baths, :max_baths, :min_receptions, :max_receptions, :property_types,\n :status, :buying_status, :funding, :biggest_problems, :chain_free, :budget_from, :budget_to, :locations,\n :mortgage_approval ].map(&:to_s)\n buyer_details = PropertyBuyer.where(vendor_id: property_details[:vendor_id].to_i).select(attr_list).last.as_json\n response = nil\n\n if buyer_details\n buyer_details['status'] = PropertyBuyer::REVERSE_STATUS_HASH[buyer_details['status']]\n buyer_details['buying_status'] = PropertyBuyer::REVERSE_BUYING_STATUS_HASH[buyer_details['buying_status']]\n buyer_details['funding'] = PropertyBuyer::REVERSE_FUNDING_STATUS_HASH[buyer_details['funding']]\n buyer_details['property_tracking'] = Events::Track.where(udprn: params[:udprn].to_i).select(:id).last.nil?\n response = {}\n (attr_list- ['property_tracking', 'chain_free', 'budget_from', 'budget_to']).each { |t| response[\"buyer_#{t}\"] = buyer_details[t] }\n response['property_tracking'] = buyer_details['property_tracking']\n response['chain_free'] = buyer_details['chain_free']\n response['buyer_min_budget'] = buyer_details['budget_from']\n response['buyer_max_budget'] = buyer_details['budget_to']\n end\n\n render json: { buyer_details: response }, status: 200\n end",
"title": ""
},
{
"docid": "349d5af9d2a2c35500975ac6584ed053",
"score": "0.5528019",
"text": "def buyer_stats_for_enquiry\n enquiry_id = params[:enquiry_id].to_i\n event = Event.unscope(where: :is_developer).where(id: enquiry_id).select([:buyer_id, :udprn, :agent_id]).first\n if event\n if event.agent_id == @current_user.id\n agent_service = Enquiries::AgentService\n view_ratio = agent_service.buyer_views(event.buyer_id, event.udprn)\n enquiry_ratio = agent_service.buyer_enquiries(event.buyer_id, event.udprn)\n render json: { views: view_ratio, enquiries: enquiry_ratio }\n else\n render json: { message: 'Agent is not attached to the property' }, status: 400\n end\n else\n render json: { message: 'Enquiry not found' }, status: 404\n end\n end",
"title": ""
},
{
"docid": "19c96b1042a15c146544aba527edff7b",
"score": "0.5505921",
"text": "def account_details_list(requested_by)\n { Forename: forename, Surname: surname, EmailAddress: email_address, PhoneNumber: contact_number,\n PartyNINO: nino,\n 'ins2:Update': { 'ins2:PartyRef': requested_by.party_refno }, 'ins1:Requestor': requested_by.username }\n end",
"title": ""
},
{
"docid": "3a5379c448d6e53b11f6ff889ef29490",
"score": "0.5477191",
"text": "def get_by_buyers_company(buyer_company_reference, params)\n $LOG.i \"running \" + __method__.to_s\n @client.get '/finreports/v2/buyer_companies/' + buyer_company_reference + '/billings', params\n end",
"title": ""
},
{
"docid": "c54cbdfb489b5a35326149a58bab8b3f",
"score": "0.5470497",
"text": "def agent_details_for_the_vendor\n udprn = params[:udprn]\n agent_id = InvitedVendor.where(email: @current_user.email).where(udprn: udprn).pluck(:agent_id).last.to_i\n agent = Agents::Branches::AssignedAgent.unscope(where: :is_developer).where(id: agent_id).last\n details = {}\n if agent\n branch = agent.branch\n company = branch.agent\n details = { \n assigned_agent_first_name: agent.first_name,\n assigned_agent_last_name: agent.last_name,\n assigned_agent_image_url: agent.image_url,\n assigned_agent_branch_logo: branch.image_url,\n assigned_agent_branch_name: branch.name,\n assigned_agent_branch_address: branch.address,\n assigned_agent_company_name: company.name\n }\n\n end\n render json: details, status: 200 \n\n end",
"title": ""
},
{
"docid": "a602c41d933cad08fced66d4eff0055d",
"score": "0.5461513",
"text": "def getCustomerDetails(email)\n parameters = {'email' => email, 'userid' => @userid, 'time' => Time.now.to_i().to_s()}\n parameters['hash'] = OpenSSL::HMAC.hexdigest('md5', @key, parameters.values.join('.'))\n \n uri = @baseuri + @webstore + '/v1/customer.json?' + parameters.map{|k,v| \"#{CGI.escape(k)}=#{CGI.escape(v)}\"}.join('&')\n #uri = @baseuri + @webstore + '/v1/customer.json?' + URI.encode_www_form(parameters)\n \n uriReq = URI.parse(uri)\t\n http = Net::HTTP.new(uriReq.host, uriReq.port) \n # for an SSL connection uncomment the next lines\n # http.use_ssl = true\n # http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n response = http.request(Net::HTTP::Get.new(uriReq.request_uri, {'User-Agent' => 'Mozilla/5.0'}))\n puts response.body \n end",
"title": ""
},
{
"docid": "cc1a7a29eac9b5cdbc1e836606f07cad",
"score": "0.54238504",
"text": "def get_buyer\n puts \"deprecated #{__method__}\"\n get_sale_agent_with_role(SaleAgent::ROLE_BUYER)\n end",
"title": ""
},
{
"docid": "003416246e33985b48228901b4f10082",
"score": "0.54074556",
"text": "def headers\n h = {\n content_type: :json, \n accept: :json, \n cache_control: 'no-cache'\n }\n # add requesters email address for human communication\n if LeisureKing::Config.client_email && LeisureKing::Config.client_email != ''\n h[:from] = LeisureKing::Config.client_email # email address for human communication\n end\n if LeisureKing::Authentication.has_valid_api_key\n h[\"Authorization\"] = \"Token #{LeisureKing::Authentication.token}\"\n end\n return h\n end",
"title": ""
},
{
"docid": "93c664bdc6ca047cc5404d5181b49ed9",
"score": "0.5347846",
"text": "def get_clients token\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Accounts/GetClients\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n request = Net::HTTP::Get.new uri.request_uri\n request['Authorization'] = get_authorization_header token \n\n response = http.request request\n puts \"#{response.code} #{response.message}\"\n \n if response.kind_of? Net::HTTPSuccess\n feed = JSON.parse response.body\n if feed[\"value\"]\n for client in feed[\"value\"]\n puts \"#{client['Id']} #{client['Email']}\"\n end\n end \n end\nend",
"title": ""
},
{
"docid": "fa2cfe69e1cf30cf5dddb0eb7840dd49",
"score": "0.53375685",
"text": "def headers\n {\n :subject => \"Question from Xaxis Careers\",\n :to => \"troy.starwalt@xaxis.com\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "3bc8a426adb26d6df91c692c17c29b6b",
"score": "0.5335491",
"text": "def agent\n @agent ||= Sawyer::Agent.new(api_endpoint, sawyer_options) do |http|\n # http.headers[:accept] = \"image/jpg\"\n http.headers[:content_type] = \"application/json\"\n http.headers[:user_agent] = user_agent\n http.headers[:accept] = \"application/json\"\n http.headers[:api_key] = api_key\n http.headers[:'x-client-platform'] = \"api\"\n\n if @access_token\n http.headers.merge!({\n :'access-token' => @access_token,\n :client => @client_id,\n :expiry => @expiry,\n :'token-type' => \"Bearer\",\n :uid => @uid\n })\n end\n\n # if\n # if basic_authenticated?\n # http.basic_auth(@login, @password)\n # elsif token_authenticated?\n # http.authorization 'token', @access_token\n # end\n end\n end",
"title": ""
},
{
"docid": "4746fc96e020745fe4808922e1431aa5",
"score": "0.5326485",
"text": "def get_eligible\n # Get the list of abandoned carts which haven't sent an email; parse the HTML into understandable hashes\n results = @agent.get(\"#{@base_url}/admin/checkouts?direction=next&limit=250&order=created_at+desc&query=&abandoned_email_state=not_sent\")\n #results = @agent.get(\"#{@base_url}/admin/checkouts?direction=next&limit=250&order=created_at+desc&query=&abandoned_email_state=sent\")\n hashes = results.search(\"table[@id=all-checkouts]/tbody/tr\").collect do |row|\n detail = {}\n [\n [:url, 'td[2]/a/@href'],\n [:date, 'td[3]/span/@title'],\n [:customer, 'td[4]/div/a/text()'],\n [:email_status, 'td[5]/span/text()'],\n ].each do |name, xpath|\n detail[name] = row.at_xpath(xpath).to_s.strip\n end\n # Parse the date string into an actual object\n detail[:date_obj] = DateTime.parse(\"#{detail[:date]}-0800\")\n detail\n end\n # Return those hashes which are over a day old and are newer than the cutoff\n eligible = hashes.select do |x|\n ((x[:date_obj] + (6.0/24)) < DateTime.now) && (x[:date_obj] > @cutoff_date)\n end\n #eligible.each {|x| puts \"Customer #{x[:customer]} is eligible with ruby timestamp #{x[:date_obj]} and shopify date of #{x[:date]}\"}\n eligible\nend",
"title": ""
},
{
"docid": "c8a2524791d35ecf91602f4fb463d646",
"score": "0.5319296",
"text": "def prepare_headers\n agent.basic_auth ENV.fetch('REDDIT_APP_ID'), ENV.fetch('REDDIT_APP_SECRET')\n agent.headers[\"User-Agent\"] = \"script:#{ENV.fetch('REDDIT_APP_ID')}:#{Ossert::VERSION}\"\n end",
"title": ""
},
{
"docid": "d42d456e3652d431c4b7dc4f7fe4f74b",
"score": "0.5318124",
"text": "def get_ticket(queues, agents)\n params = {\n :queues => queues,\n :agents => agents\n }\n RestClient.post(\"#{@host_addr}/ticket\", params.to_json, :content_type => :json).to_str.gsub('\"', '')\n end",
"title": ""
},
{
"docid": "ef4c80acc408854c4ee48fe7d296d7dd",
"score": "0.5315516",
"text": "def customer_from_email(email)\n HTTParty.get('http://localhost:8081/customers', query: {email: email})\n end",
"title": ""
},
{
"docid": "3ee3858de5e25d73dd5b03239a48d54d",
"score": "0.5301551",
"text": "def headers\n {\n :subject => \"Culverhouse Alumni Achievement\",\n :to => \"fstewart@culverhouse.ua.edu\",\n :from => %(\"#{fullname}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "46649b28f73157bfd333182786e3538a",
"score": "0.52897006",
"text": "def send_agentinfo_request\r\n # Connect and send fake auth\r\n vprint_status('Connecting to RSCD agent and sending fake auth.')\r\n connect_to_rscd\r\n send_fake_agentinfo_auth\r\n\r\n # Send agentinfo request, read the response, and disconnect\r\n vprint_status('Requesting agent information.')\r\n sock.put(\"\\x00\\x00\\x00\\x32\\x30\\x30\\x30\\x30\\x30\\x30\\x32\\x61\\x30\\x30\\x30\" \\\r\n \"\\x30\\x30\\x30\\x31\\x30\\x36\\x34\\x3b\\x30\\x3b\\x32\\x3b\\x36\\x66\\x37\" \\\r\n \"\\x3b\\x38\\x38\\x30\\x3b\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x32\\x34\" \\\r\n \"\\x31\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\")\r\n res = sock.get_once\r\n disconnect\r\n\r\n # Return the platform field from the response if it looks valid\r\n res_len = res.length > 3 ? res[0..3].unpack('N')[0] : 0\r\n return [1, res.split(';')[4]] if res &&\r\n res.split(';').length > 6 &&\r\n res.length == (res_len + 4)\r\n\r\n # Invalid or unexpected response format, return the complete response\r\n [0, res]\r\n end",
"title": ""
},
{
"docid": "c1d32780380f77b62460a2c5d80feca5",
"score": "0.526943",
"text": "def headers\n {\n :subject => \"Credit Application\",\n :to => \"dealsunlimitedinc@live.com\",\n :from => %(\"#{name} #{last_name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "444588923e5c2ef62867bf44d9d8417c",
"score": "0.5262823",
"text": "def headers\n {\n subject: 'Call me Back request - Global Accounting',\n to: Setting.email,\n from: %(\"#{first_name} #{last_name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "fbec5c423452344057881d7c3db47363",
"score": "0.5259888",
"text": "def agent_credit_info\n agent = @current_user\n remaining_credits = agent.credit\n klass = Agents::Branches::AssignedAgents::Quote\n new_status = klass::STATUS_HASH['New']\n new_quotes = klass.where(agent_id: @current_user.id).where(status: new_status).where(expired: false).pluck(:amount)\n quote_count = new_quotes.count\n locked_amount = new_quotes.reduce(:+)\n locked_credits = (locked_amount.to_f*0.01*0.01).round/Agents::Branches::AssignedAgent::PER_CREDIT_COST\n result_hash = { total_credits: (locked_credits + remaining_credits), remaining_credits: remaining_credits,\n locked_credits: locked_credits, quote_count: quote_count }\n render json: result_hash, status: 200\n end",
"title": ""
},
{
"docid": "7ae4dff9457749af36ded117f02cf641",
"score": "0.5255654",
"text": "def headers\n {\n :subject => \"Inquiry from website | #{Time.now.strftime('%Y-%m-%d %l:%M %p')}\",\n :to => \"anne@belightfulyoga.com\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "aa1e20bda5cdcc8203e97aa0bd25cf7b",
"score": "0.5249771",
"text": "def headers\n {\n \"Accept\" => \"application/xml\",\n \"Content-Type\" => \"application/xml; charset=utf-8\",\n \"Authorization\" => \"Basic #{auth_string}\",\n \"User-Agent\" => 'application/github-harvest'\n }\n end",
"title": ""
},
{
"docid": "da0f2fb5eec8601cd20665488941e010",
"score": "0.5242747",
"text": "def check_account\n response = HTTParty.get('https://api.paystack.co/bank/resolve?account_number=0022728151&bank_code=063',\n {:headers => HEADERS}).parsed_response\n end",
"title": ""
},
{
"docid": "bc62ae70ad172d122365f0284f649ccc",
"score": "0.5228035",
"text": "def agent\n @agent ||= Sawyer::Agent.new(api_endpoint, sawyer_options) do |http|\n http.headers[:content_type] = 'application/json'\n http.headers[:user_agent] = user_agent\n http.authorization :Bearer, token.token\n http.response :logger\n http.adapter Faraday.default_adapter\n end\n end",
"title": ""
},
{
"docid": "52c7801109b04f2d97a1427f9a5447d1",
"score": "0.5225679",
"text": "def agent\n @agent ||= Sawyer::Agent.new(api_endpoint, sawyer_options) do |http|\n # http.headers[:accept] = default_media_type\n http.headers[:content_type] = \"application/json\"\n http.headers[:user_agent] = user_agent\n\n # if \n # if basic_authenticated?\n # http.basic_auth(@login, @password)\n # elsif token_authenticated?\n # http.authorization 'token', @access_token\n # end\n end\n end",
"title": ""
},
{
"docid": "96bff29b7bef25a109cd87416f347940",
"score": "0.5195962",
"text": "def scholarship_info_request(requester_address, list_of_scholarships)\n @requester = requester_address\n @scholarships = list_of_scholarships\n mail :to => \"xto@pyxis-tech.com\"\n end",
"title": ""
},
{
"docid": "c9c39ffcae478ba24322189c7542a95c",
"score": "0.5187556",
"text": "def _get_ticket(authorization_endpoint,user_name,password,partner,policy,client_id,device_token)\n header = _compose_header('user',user_name,password,client_id,device_token)\n body = _compose_body(partner,policy)\n message = compose_message(header,body)\n # call authorization endpoint\n doc = send_request(authorization_endpoint,message,nil,\"application/soap+xml; charset=UTF-8\")\n # validate response and raise if invalid\n _is_response_valid(doc,\"IssueTicket\")\n # get ticket\n expires = DateTime.parse(select_node_text(doc,'//wst:Lifetime/wsu:Expires'))\n ticket = select_node_text(doc,'//wsse:BinarySecurityToken')\n [CGI::escape(ticket),expires]\n end",
"title": ""
},
{
"docid": "eb957fb2ae7a2ad9d7e3faaba4eb2a83",
"score": "0.51864594",
"text": "def headers\n {\n 'Accept' => 'application/json',\n 'Content-type' => 'application/json',\n 'Authorization' => \"Basic #{Base64.strict_encode64(@options[:api_key].to_s)}\",\n 'User-Agent' => \"Netbanx-Paysafe v1.0/ActiveMerchant #{ActiveMerchant::VERSION}\"\n }\n end",
"title": ""
},
{
"docid": "971aacc9d682849d57242bd328c6f15f",
"score": "0.5181133",
"text": "def manual_agent_details\n vendor = user_valid_for_viewing?('Vendor')\n if !vendor.nil?\n agent_id = Agents::Branches::AssignedAgents::Lead.where(property_id: params[:udprn].to_i).first.agent_id\n details = Agents::Branches::AssignedAgent.find(agent_id).details\n render json: details, status: 200\n else\n render json: { message: 'Authorization failed' }, status: 401\n end\n end",
"title": ""
},
{
"docid": "d585d99b02f9f148cbbe9317a27384de",
"score": "0.5169627",
"text": "def request_account()\n params = %w{email user pmc podling votelink}.map do |name|\n \"#{name}=#{encodeURIComponent(self.state[name])}\"\n end\n\n window.parent.frames.content.location.href = \n \"https://id.apache.org/acreq/members/?\" + params.join('&')\n end",
"title": ""
},
{
"docid": "ba82aef7940c3541860a67b7aa400b7f",
"score": "0.51608527",
"text": "def request_headers\n { \"Content-Type\" => \"application/json\", \n \"User-Agent\" => \"ruby borrow_direct gem #{BorrowDirect::VERSION} (HTTPClient #{HTTPClient::VERSION}) https://github.com/jrochkind/borrow_direct\", \n \"Accept-Language\" => \"en\"\n }\n end",
"title": ""
},
{
"docid": "5a710581be2c86e1fff794f7cfa48d34",
"score": "0.5159254",
"text": "def buyer_intent_info\n udprn = @udprn.to_i\n details = PropertyDetails.details(udprn.to_i)['_source']\n\n #### Similar properties to the udprn\n default_search_params = {\n min_beds: details['beds'].to_i,\n max_beds: details['beds'].to_i,\n min_baths: details['baths'].to_i,\n max_baths: details['baths'].to_i,\n min_receptions: details['receptions'].to_i,\n max_receptions: details['receptions'].to_i,\n property_status_types: details['property_status_type']\n }\n\n ### analysis for each of the postcode type\n search_stats = {}\n [ :district, :sector, :unit ].each do |region_type|\n ### Default search stats\n search_stats[region_type] = { green: 0, amber: 0, red: 0 }\n\n search_params = default_search_params.clone\n search_params[region_type] = details[region_type.to_s]\n search_stats[region_type][:value] = details[region_type.to_s] ### Populate the value of sector, district and unit\n api = PropertySearchApi.new(filtered_params: search_params)\n api.apply_filters\n body, status = api.fetch_data_from_es\n udprns = []\n if status.to_i == 200\n udprns = body.map { |e| e['udprn'] }\n end\n\n ### Exclude the current udprn from the result\n udprns = udprns - [ udprn.to_s ]\n # p udprns\n ### Accumulate buyer_id for each udprn\n buyer_ids = []\n event = Event::EVENTS[:save_search_hash]\n query = Event\n buyer_ids = query.where(event: event).where(udprn: udprns).pluck(:buyer_id).uniq\n\n ### Extract status of the buyers in bulk\n buyers = PropertyBuyer.where(id: buyer_ids).select([:id, :status])\n\n buyers.each do |each_buyer_info|\n buyer_status = PropertyBuyer::REVERSE_STATUS_HASH[each_buyer_info.status]\n search_stats[region_type][buyer_status] += 1\n end\n\n search_stats[region_type][:total] = search_stats[region_type][:green] + search_stats[region_type][:red] + search_stats[region_type][:amber]\n\n if search_stats[region_type][:total] > 0\n search_stats[region_type][:green_percent] = ((search_stats[region_type][:green].to_f/search_stats[region_type][:total].to_f)*100).round(2)\n search_stats[region_type][:amber_percent] = ((search_stats[region_type][:red].to_f/search_stats[region_type][:total].to_f)*100).round(2)\n search_stats[region_type][:red_percent] = ((search_stats[region_type][:amber].to_f/search_stats[region_type][:total].to_f)*100).round(2)\n else\n search_stats[region_type][:green_percent] = nil\n search_stats[region_type][:amber_percent] = nil\n search_stats[region_type][:red_percent] = nil\n end\n end\n search_stats\n end",
"title": ""
},
{
"docid": "24442ccfa9958c5120d5f09d0744fbf8",
"score": "0.5153097",
"text": "def all_breaches(email,api_key=$api_key)\n get_resource_protected('https://haveibeenpwned.com/api/v3/breachedaccount/'.concat(email),api_key)\nend",
"title": ""
},
{
"docid": "1dccf037e7fbfa2411fac593d2abfae2",
"score": "0.51449084",
"text": "def bike_grabber(params=\"\")\n token = ENV[\"XTOKEN\"]\n data = HTTParty.get(\"https://data.sfgov.org/resource/dd7x-3h4a.json?#{params}\", \n :headers => {'X-App-Token' => token },\n )\n end",
"title": ""
},
{
"docid": "a63869f19489abeb3a3f935de04fac3c",
"score": "0.5140667",
"text": "def fetch_additional_headers\n api_key = params.fetch('api_key', '')\n { 'Authorization' => api_key }\n end",
"title": ""
},
{
"docid": "139c867493bec852e3e76c548f9a76ba",
"score": "0.5133922",
"text": "def find\n buyer_account = find_buyer_account\n authorize! :read, buyer_account\n respond_with(buyer_account)\n end",
"title": ""
},
{
"docid": "cd4dd9f34813564718aa7969eb224ed8",
"score": "0.51240957",
"text": "def account_information(recv_window: nil)\n params = {}\n params[:recWindow] = recv_window if recv_window\n SignedRequest.perform({\n request_method: :get,\n path: '/api/v3/account',\n params: params,\n })\n end",
"title": ""
},
{
"docid": "8e9dc3c57ba8b5be98e219d011109b2c",
"score": "0.5120229",
"text": "def headers\n {\n :subject => \"Trident Applicant\",\n :to => \"sarah.humphreys59@gmail.com\",\n :from => %(\"#{name}\" <#{email}>),\n \n }\n end",
"title": ""
},
{
"docid": "b298c492b2ecbd936884302936bc5e8b",
"score": "0.51093066",
"text": "def owner_information\n OrderItem.all.order('id DESC')\n .where(\"context IS NOT NULL\")\n .map { |item| JSON.parse(Base64.decode64(item.context['headers']['x-rh-identity'])) }\n .map { |item| [item.dig('identity', 'user', 'username'), item.with_indifferent_access] }\n .to_h\n end",
"title": ""
},
{
"docid": "33a827fd56b8e1fe01f7d2b8f7b05377",
"score": "0.51079744",
"text": "def get_user_info(bearer) \n return get_info(bearer, \"v2/my/info\")\n end",
"title": ""
},
{
"docid": "4fec847818159252cc3d6c6ebe4548f3",
"score": "0.510634",
"text": "def user_information\n self.request_ebay\n end",
"title": ""
},
{
"docid": "248b6259ad9d3fd4aec1b7cd617a14f0",
"score": "0.5099477",
"text": "def headers\n {\n :subject => \"New Booking Request Through Shyft\",\n :to => \"bookings@shyftworks.com\",\n :from => %(\"Shyft\" <#{email}>), #%(\"#{company_name}\" <#{email}>),\n :body => \"#{ambassador_first_name} #{ambassador_last_name},\n You have a new booking request for #{amount_of_hours} hours. Please review the below details and respond to the request.\n\n Company Name: #{company_name}\n Contact Name: #{contact_name}\n Starting Date: #{start_date}\n Ending Date: #{end_date}\n Location: #{location}\n Work Details: #{message}\n\n Ambassador Info:\n Name: #{ambassador_first_name} #{ambassador_last_name}\n Email: #{ambassador_email}\n Rate: #{ambassador_rate}\n\n If you have any questions for the company please feel free to respond with those questions.\n\n Shyft\n bookings@shyftworks.com\n 1-800-719-6778\"\n }\n end",
"title": ""
},
{
"docid": "beecf73bcd80267d92947c9a3923acc4",
"score": "0.5090948",
"text": "def property_enquiry_details_buyer(agent_id, enquiry_type=nil, type_of_match=nil, qualifying_stage=nil, rating=nil, hash_str=nil, property_for='Sale', last_time=nil, is_premium=nil, buyer_id=nil, page_number=0, is_archived=nil, closed=nil, count=false, old_stats_flag=false)\n result = []\n events = ENQUIRY_EVENTS.map { |e| EVENTS[e] }\n ### Process filtered buyer_id only\n ### FIlter only the enquiries which are asked by the caller\n events = events.select{ |t| t == EVENTS[enquiry_type.to_sym] } if enquiry_type\n\n ### Filter only the type_of_match which are asked by the caller\n query = filtered_agent_query agent_id: agent_id, search_str: hash_str, last_time: last_time, is_premium: is_premium, buyer_id: buyer_id, type_of_match: type_of_match, is_archived: is_archived, closed: closed\n query = query.where(event: events) if enquiry_type\n query = query.where(stage: EVENTS[qualifying_stage.to_sym]) if qualifying_stage\n query = query.where(rating: EVENTS[rating.to_sym]) if rating\n \n if count && is_premium\n result = query.count\n elsif is_premium\n query = query.order('created_at DESC')\n total_rows = query.to_a\n result = process_enquiries_result(total_rows, agent_id, is_premium, old_stats_flag)\n else\n query = query.order('created_at DESC')\n total_rows = query.limit(PAGE_SIZE).offset(page_number.to_i*PAGE_SIZE)\n result = process_enquiries_result(total_rows, agent_id)\n end\n result\n end",
"title": ""
},
{
"docid": "e3e6d4738e593b3af798aecd5bee1fde",
"score": "0.508122",
"text": "def get_buyer_as_name\n puts \"deprecated #{__method__}\"\n ea = get_buyer\n ea.agent if ea\n end",
"title": ""
},
{
"docid": "e0d264b9f5eae41560187e039ebb8527",
"score": "0.5078729",
"text": "def headers\n {\n subject: 'Register Candidate Request - Global Accounting',\n to: Setting.email,\n from: %(\"#{first_name} #{last_name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "ed661309dfb6c3250cb626689f8ddac4",
"score": "0.5059523",
"text": "def current_user_orders\n uri = URI.join(@host, 'api/orders.json')\n uri.query = URI.encode_www_form({ user_email: @email, user_token: @token })\n\n res = Net::HTTP.get_response(uri)\n\n puts res.body\n end",
"title": ""
},
{
"docid": "3830a2356e723dd76a013790111599de",
"score": "0.5059085",
"text": "def fetch_company_token_holder\n params = { user_id: @company_uuid, client_id: @client_id }\n\n saas_response = SaasApi::User::Get.new.perform(params)\n user_data = saas_response.data\n\n @addresses['token_holder_address'] = user_data['user']['tokenHolderAddress'] if user_data['user']\n\n success\n end",
"title": ""
},
{
"docid": "fb6f9d55449a305008c0b768d2fce709",
"score": "0.5058454",
"text": "def get_user_subscription_details\n send_request 'getUserSubscriptionDetails'\n end",
"title": ""
},
{
"docid": "e50112310fecc0861f750ac091c5c634",
"score": "0.50392",
"text": "def lookup(args)\n request_url = service_base + '?' + args.to_query \n \n first_borrower = Nokogiri::XML(fetch_with_auth(request_url)).at('/borrowers/borrower')\n hash = nil\n if first_borrower\n hash = {}\n hash[:xml] = first_borrower\n hash[:name] = to_text( first_borrower.at('name') )\n hash[:barcode] = to_text(first_borrower.at('barcode'))\n hash[:pin] = to_text(first_borrower.at(\"pin\"))\n hash[:horizon_borrower_id] = first_borrower['id']\n hash[:jhed_lid] = \n to_text( first_borrower.at('other_ids/other_id[location=\"general\"]') )\n #hopkinsID is tricky. What's in second_id is sometimes it, sometimes\n #not. We'll count it a hopkinsID if it looks like one.\n second_id = to_text( first_borrower.at('second_id') )\n if (second_id && second_id =~ /^[A-Z0-9]{6}$/)\n hash[:hopkins_id] = second_id\n end\n end\n \n return hash\n \n end",
"title": ""
},
{
"docid": "eab41b9424768a30d4a5bfb63e6227f1",
"score": "0.5033043",
"text": "def get_user_data(checkout_url)\n JSON.parse(@agent.get(\"#{@base_url}#{checkout_url}.json\").body)\nend",
"title": ""
},
{
"docid": "6193c39ec5d81bc5ec014261eaa450ff",
"score": "0.5032413",
"text": "def headers\n {\n subject: 'Register Vacancy request - Global Accounting',\n to: Setting.email,\n from: %(\"#{first_name} #{last_name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "7eaee026854014468d1d7bd1de27b744",
"score": "0.5028972",
"text": "def email_address_and_api_key\n if ENV['TURBOT_API_KEY']\n ['', ENV['TURBOT_API_KEY']]\n elsif netrc_exists?\n open_netrc[\"api.#{host}\"] || []\n else\n []\n end\n end",
"title": ""
},
{
"docid": "b43081cebcca27092b88e54c0d0ef3e0",
"score": "0.50224936",
"text": "def who_i_am\n JSON.parse(request(:get, \"https://api.harvestapp.com/account/who_am_i\").body)\n end",
"title": ""
},
{
"docid": "2ddbbe486176865a941b85ebe0f4eaee",
"score": "0.50169367",
"text": "def expand_header(header = {})\n header = DEFAULT_HEADER.merge(header)\n header['X-ITRP-Account'] = option(:account) if option(:account)\n header['AUTHORIZATION'] = 'Basic ' + [\"#{option(:api_token)}:x\"].pack('m*').gsub(/\\s/, '')\n if option(:source)\n header['X-ITRP-Source'] = option(:source)\n header['HTTP_USER_AGENT'] = option(:source)\n end\n header\n end",
"title": ""
},
{
"docid": "32108cb7833d9cc06f0c6b078ac9dac8",
"score": "0.50072193",
"text": "def headers\n {\n subject: 'Financial Assistance Form Inquiry',\n to: 'meljcenter@gmail.com',\n from: %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "586e91ba6e1028285115a29552d0fd35",
"score": "0.50027084",
"text": "def get_credit\n path = @constants::PATH_CREDIT\n data = user_hash\n request @domain, path, data\n end",
"title": ""
},
{
"docid": "c539b0cf3216af68c54e653bb27cadaa",
"score": "0.50011426",
"text": "def included_headers\n {\n \"uid\" => \"Uid\",\n \"access-token\" => \"Access-Token\",\n \"token-type\" => \"Token-Type\",\n \"expiry\" => \"Expiry\",\n \"client\" => \"Client\",\n \"User-Agent\" => \"User-Agent\",\n \"Upgrade-Insecure-Requests\" => \"Upgrade-Insecure-Requests\"\n }\n end",
"title": ""
},
{
"docid": "d9d1b77518640d8e13f428d9f184129b",
"score": "0.50011367",
"text": "def get_accounts\n response = access_token.get(\"https://launchpad.37signals.com/authorization.json\")\n JSON.parse(response.body)[\"accounts\"].select { |account| account[\"product\"] == \"bcx\" }\n rescue => ex\n Basecamp::Error.new(ex.message).raise_exception\n end",
"title": ""
},
{
"docid": "a970e813a08496513d801e62d29634f3",
"score": "0.49950862",
"text": "def enterprise_details\n KONG_AUTH_HEADERS.collect do |prop|\n request.env.fetch(prop, nil)\n end\n end",
"title": ""
},
{
"docid": "ac596f05443eb2449320f933a0f47956",
"score": "0.49894926",
"text": "def agent\n @agent ||= Sawyer::Agent.new(endpoint, sawyer_options) do |http|\n http.headers[:accept] = default_media_type\n http.headers[:content_type] = \"application/json\"\n http.headers[:user_agent] = user_agent\n if basic_authenticated?\n http.request :basic_auth, @login, @password\n elsif token_authenticated?\n http.request :authorization, 'token', @access_token\n elsif bearer_authenticated?\n http.request :authorization, 'Bearer', @bearer_token\n elsif application_authenticated?\n http.request :basic_auth, @client_id, @client_secret\n end\n end\n end",
"title": ""
},
{
"docid": "a9e1c5b68850dddb2527fae411c48a78",
"score": "0.498693",
"text": "def fetch_customer_information(funding=false,locations=false) \n url_options = \"/api/customer/#{system_id}/\"\n url_options += @customer_id.to_s\n url_options += \"?funding=\" + funding.to_s + \"&locations=\" + locations.to_s\n url = @url + url_options\n t = Time.current\n resp = send_request(url)\n Hash.from_xml(resp.body).with_indifferent_access\n end",
"title": ""
},
{
"docid": "d52a51859542acd64270e57a9fc1478b",
"score": "0.49858484",
"text": "def headers\n {\n :subject => \"Suggestions for HRMS\",\n :to => \"parulk.tps@gmail.com, nency.tps@gmail.com, info@techplussoftware.com, hr@techplussoftware.com\",\n :from => %(<#{email}>)\n }\n end",
"title": ""
},
{
"docid": "20f414e95c49560eb58c186e110a9000",
"score": "0.4984482",
"text": "def enterprise_details\n kong_config = Octo.get_config :kong\n if kong_config[:enabled]\n KONG_HEADERS.inject({}) do |r, header|\n key = header.gsub('HTTP_X_CONSUMER_', '').downcase\n r[key] = request.env.fetch(header, nil)\n r\n end\n else\n apikey = request.env.fetch('HTTP_APIKEY')\n {custom_id: settings.redis.get(apikey)}\n end\n end",
"title": ""
},
{
"docid": "acb54249da8596d188d4ece1662c3013",
"score": "0.49820748",
"text": "def fetch_userdata_from_whoswho( key )\n if not key.nil? \n # concatenate the post url of WSW api \n postquery = ( ( key =~ /@/ )? \"byemail&e=\" : \"&u=\" ) + key\n postquery = \"#{request.protocol}#{request.host_with_port}/index.php?option=com_ofsso&controller=sso&task=getuser\" + postquery\n\n # obtain the user data from WSW\n require 'curb'\n chk = Curl::Easy.http_post( postquery )\n begin\n return JSON.parse( chk.body_str ) if not chk.body_str =~ /false/\n rescue JSON::ParserError => e\n flash.now[ :error ] = \"Integration Error!!\"\n return nil\n end\n end\n end",
"title": ""
},
{
"docid": "3b0a8a1542280ae47a5043ebc8f96723",
"score": "0.49810156",
"text": "def headers\n {\n :subject => \"[#{about}] #{subject}\",\n :to => '#{ORG::EMAIL}',\n :from => %(\"#{username}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "da7729ab09fcfe91a118df8b8de70f04",
"score": "0.49743363",
"text": "def get_account\n\trequest_type = \"GET\"\n\turl = \"account\"\n\thash = create_hmac(request_type, url)\n\tresponse = http_send(request_type, url, hash)\nend",
"title": ""
},
{
"docid": "333ad6b778f5f7601f06a9417a5e4c7a",
"score": "0.49721768",
"text": "def buyer\n Remembers.buyer\n end",
"title": ""
},
{
"docid": "08f1e57e15031bae9ae6b344b800df1b",
"score": "0.49703673",
"text": "def load_submitting_agent\n name = @doc.xpath(\"//mets:techMD//daitss:AGREEMENT_INFO/@ACCOUNT\", NS).first.content\n project_code = @doc.xpath(\"//mets:techMD//daitss:ACCOUNT_PROJECT\", NS).first.content\n { :name => name, :project_code => project_code, :type => \"organization\" }\n end",
"title": ""
},
{
"docid": "7e9a683cfe6e03ac190bee0104e0b9b2",
"score": "0.49622256",
"text": "def headers\n {\n :subject => \"Lead from Lodi Solar Rebate\",\n :to => \"feasterc@gmail.com\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "5bf13c2b79171a97a9cb8925fce517bb",
"score": "0.4959812",
"text": "def grant_info\n gi = Hash.new\n\n if b400 = @doc.at_xpath(\"//400\")\n if b472 = b400.at_xpath(\".//b472\")\n b473us b472.at_xpath(\".//b473us\")\n disclaimer = extract_inner_text(b473us)\n gi.store(:disclaimer, disclaimer) unless disclaimer.empty?\n\n b474us = b472.at_xpath(\".//b474us\")\n length = extract_inner_text(b474us)\n gi.store(:length, length) unless length.empty?\n end\n\n end\n\n gi\n end",
"title": ""
},
{
"docid": "7ae80fca0f515a9307ce333085ecc531",
"score": "0.49590278",
"text": "def procore_headers(company_id: nil, token: '')\n if company_id.nil?\n {\n \"Authorization\": \"Bearer #{token}\",\n \"Content-Type\": \"application/json\",\n }\n else\n {\n \"Authorization\": \"Bearer #{token}\",\n \"Content-Type\": \"application/json\",\n \"Procore-Company-Id\": \"#{company_id}\"\n }\n end\nend",
"title": ""
},
{
"docid": "8a3171fd267fb3fa7f2d3880b369cd82",
"score": "0.49575225",
"text": "def GetCreditCardWithBuyerKey(buyer_key)\n # try, tenta fazer o request\n begin\n response = getRequest(@@SERVICE_URL + '/CreditCard/BuyerKey=' + buyer_key)\n\n # se der algum erro, trata aqui\n rescue Exception => e\n return e.message\n end\n\n # se nao houver erros, retorna o objeto\n response\n end",
"title": ""
},
{
"docid": "c821aa5b4fa0f10bd2b42daf3b2a82df",
"score": "0.4957176",
"text": "def get_warranty_info(serial, cookies)\n begin\n resp = HTTP.get(\"/Coverage.action?serialId=#{serial}\", cookies)\n hash = JSON.parse(resp.body)\n rescue => e\n puts \"An error occured checking this serial - #{serial}\"\n puts e.backtrace\n end\n\nend",
"title": ""
},
{
"docid": "9fd2d9ec47a312b2178bc8fe19dc209a",
"score": "0.49560285",
"text": "def buyer_intent_info(udprn, property_for='Sale')\n details = PropertyDetails.details(udprn.to_i)['_source']\n \n #### Similar properties to the udprn\n default_search_params = {\n min_beds: details['beds'].to_i - 2,\n max_beds: details['beds'].to_i + 2,\n min_baths: details['baths'].to_i - 2 ,\n max_baths: details['baths'].to_i + 2,\n min_receptions: details['receptions'].to_i - 2,\n max_receptions: details['receptions'].to_i + 2,\n property_status_types: details['property_status_type']\n }\n\n ### analysis for each of the postcode type\n search_stats = {}\n [ :district, :sector, :unit ].each do |region_type|\n ### Default search stats\n search_stats[region_type] = { green: 0, amber: 0, red: 0 }\n\n search_params = default_search_params.clone\n search_params[region_type] = details[region_type.to_s]\n search_stats[region_type][:value] = details[region_type.to_s] ### Populate the value of sector, district and unit\n api = PropertySearchApi.new(filtered_params: search_params)\n api.apply_filters\n body, status = api.fetch_data_from_es\n udprns = []\n if status.to_i == 200\n udprns = body.map { |e| e['udprn'] }\n end\n\n ### Exclude the current udprn from the result\n udprns = udprns - [ udprn.to_s ]\n # p udprns\n ### Accumulate buyer_id for each udprn\n buyer_ids = []\n event = EVENTS[:save_search_hash]\n query = Event\n buyer_ids = query.where(event: event).where(udprn: udprns).pluck(:buyer_id).uniq\n\n ### Extract status of the buyers in bulk\n buyers = PropertyBuyer.where(id: buyer_ids).select([:id, :status])\n\n buyers.each do |each_buyer_info|\n buyer_status = PropertyBuyer::REVERSE_STATUS_HASH[each_buyer_info.status]\n search_stats[region_type][buyer_status] += 1\n end\n\n search_stats[region_type][:total] = search_stats[region_type][:green] + search_stats[region_type][:red] + search_stats[region_type][:amber]\n\n if search_stats[region_type][:total] > 0\n search_stats[region_type][:green_percent] = ((search_stats[region_type][:green].to_f/search_stats[region_type][:total].to_f)*100).round(2)\n search_stats[region_type][:amber_percent] = ((search_stats[region_type][:red].to_f/search_stats[region_type][:total].to_f)*100).round(2)\n search_stats[region_type][:red_percent] = ((search_stats[region_type][:amber].to_f/search_stats[region_type][:total].to_f)*100).round(2)\n else\n search_stats[region_type][:green_percent] = nil\n search_stats[region_type][:amber_percent] = nil\n search_stats[region_type][:red_percent] = nil\n end\n end\n search_stats\n end",
"title": ""
},
{
"docid": "6c6c83442bcbfe6c83521b9f37be5792",
"score": "0.49480158",
"text": "def headers\n {\n :subject => \"Retour formulaire landing page\",\n :to => \"romain.hethener@gmail.com\",\n :from => %(\"#{name}\" <#{email}>),\n }\n end",
"title": ""
},
{
"docid": "53732f74790b6b444ae44583691fa9bd",
"score": "0.4947493",
"text": "def headers\n {\n :subject => I18n.t('ecm.contact_form.attributes.subscription_request.subject'),\n :to => \"recipient@your-site.com\",\n :from => %(\"#{fullname}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "eef218b3936d223b0191fec1e78da84c",
"score": "0.4943295",
"text": "def headers\n {\n :subject => \"Culverhouse Ambassador Application\",\n :to => \"fstewart@cba.ua.edu\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "de4e92983c62c37b13aedb4095bd4a3c",
"score": "0.4935425",
"text": "def http_request_headers(contact)\n h = { \"User-Agent\" => \"MFT (https://github.com/Lapizistik/mapfromtiles, contact: #{contact}) \" }\n # is it an email address?\n h['From'] = contact if (contact !~ %r{//:}) && (contact =~ /.+@.+/)\n h\n end",
"title": ""
},
{
"docid": "b7b4d904558dcb25a8371f98413d8856",
"score": "0.49243778",
"text": "def headers\n @agent.headers.to_hash\n end",
"title": ""
},
{
"docid": "501440d907a458d7594a412b53766764",
"score": "0.4921464",
"text": "def headers\n {\n :subject => \"NEW APPLICATION !!!!\",\n :to => \"andrew@bongopass.com\",\n :from => %(\"#{full_name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "3e79b24572d5152d1072ab2d04d97704",
"score": "0.4913367",
"text": "def register_account_request_company_contact_details(company)\n return {} if company&.company_name.nil?\n\n { PartyEmailAddress: company.org_email_address, PartyPhoneNumber: company.org_telephone }\n end",
"title": ""
},
{
"docid": "b66016cd117233e0ad895557e80bbad6",
"score": "0.49096",
"text": "def hospital_request(body,email,subject)\n @data = data\n @user = user\n @subject = subject\n\n mail to: \"leonmul96@gmail.com\", subject: \"Hospital Referral\"\n end",
"title": ""
},
{
"docid": "71da4d05b44f68bbb010c12eaf8e60d5",
"score": "0.4908693",
"text": "def headers\n {\n :subject => \"Aanvraag voor een werkvergunning\",\n :to => \"marco.groenhof@jpbgroep.nl\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "0492d8b7a035d1ccf68130676eeb081b",
"score": "0.49060446",
"text": "def get_customer_info\n # put a loop here to go through all of the keys and all of the elements\n puts WELCOME\n get_questions_n_responses\n thank_you\n end",
"title": ""
},
{
"docid": "6cd6bde7bd25a26d8cec7741986e4952",
"score": "0.49037528",
"text": "def headers \n {\n :subject => :subject,\n :to => \"x19222114@student.ncirl.ie\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "41177e18e8660e6a0d9404d01ed1f887",
"score": "0.49014965",
"text": "def getMemberOrganizationsInvitedField(memberId, field)\n\tresponse = RestClient.get(\"https://api.trello.com/1/members/\"+memberId+\"/organizationsInvited/\"+field+\"?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tresponse = JSON.parse(response)\nend",
"title": ""
},
{
"docid": "d8986c37e0784be115ae60b336f1a096",
"score": "0.48915493",
"text": "def quote_requested_confirmation receiver_user, senter_user, quotation\n @quotation = quotation\n @receiver_user = receiver_user\n @senter_user = senter_user\n\n mail to: @receiver_user.email, subject: \"Você tem um cliente querendo cotar um CDB\"\n end",
"title": ""
},
{
"docid": "2f100e55145fd69bf34492d60dc57bca",
"score": "0.4891483",
"text": "def headers\n {\n 'Accept' => 'application/json',\n 'Authorization' => \"Bearer #{api_key}\",\n 'Content-Type' => 'application/json',\n 'User-Agent' => 'Workable Ruby Client'\n }\n end",
"title": ""
},
{
"docid": "b5adf0cf50a277e0dc24547463f83d70",
"score": "0.48880026",
"text": "def get_buyer_name(user_details)\n buyer_name = ' '\n user_details.each do |details|\n details.each do |_key, _value|\n buyer_name = user_details[0][:first_name] if details[:role] == 'buyer'\n end\n end\n buyer_name\n end",
"title": ""
},
{
"docid": "4caa9101078843d1836f458c1be4ea17",
"score": "0.4887241",
"text": "def get_by_buyers_team(buyer_team_reference, params)\n $LOG.i \"running \" + __method__.to_s\n @client.get '/finreports/v2/buyer_teams/' + buyer_team_reference + '/billings', params\n end",
"title": ""
},
{
"docid": "84afba89b7658f46f19916cfae34d852",
"score": "0.4886181",
"text": "def enquiries\n #cache_response(params[:udprn].to_i, [params[:page], params[:buyer_id], params[:qualifying_stage], params[:rating], params[:archived], params[:closed], params[:count]]) do\n page = params[:page]\n page ||= 0\n page = page.to_i\n udprn = params[:udprn].to_i\n count = params[:count].to_s == 'true'\n is_premium = @current_user.is_premium rescue false\n old_stats_flag = (params[:old_stats_flag].to_s == 'true')\n profile = @current_user.class.to_s\n event_service = EventService.new(udprn: udprn, buyer_id: params[:buyer_id], \n last_time: params[:latest_time], qualifying_stage: params[:qualifying_stage],\n rating: params[:rating], archived: params[:archived], is_premium: is_premium, \n closed: params[:closed], count: count, profile: profile, old_stats_flag: old_stats_flag)\n if @current_user.is_a?(Agents::Branches::AssignedAgent) && event_service.details[:agent_id].to_i != @current_user.id\n render json: { message: 'The agent does not belong to the property' }, status: 400\n else\n enquiries = event_service.property_specific_enquiry_details(page)\n render json: enquiries, status: 200\n end\n #end\n end",
"title": ""
},
{
"docid": "7e8f0b2d6274b35577eaa25f6996fa8e",
"score": "0.48850304",
"text": "def retrieve_address_book_xml\n return unless @consent_successful\n url = URI.parse(\"https://livecontacts.services.live.com\" + \"/users/@C@\" + self.int_lid.to_s + \"/REST/LiveContacts/Contacts\")\n\n req = Net::HTTP::Get.new(url.path)\n req.add_field('Authorization', \"DelegatedToken dt=\\\"\" + self.delt + \"\\\"\")\n req.set_content_type('application/xml', :charset => 'utf-8')\n\n con = Net::HTTP.new(url.host, url.port)\n con.use_ssl = true\n\n res = con.start { |http| http.request(req) }\n res.body\n end",
"title": ""
},
{
"docid": "125ac3531b7208a952a31f33d75d59a6",
"score": "0.48850295",
"text": "def basic_information\n vals={}\n\n new_agent\n welcome_page=login(AGREEMENTS_URL)\n bodypage=welcome_page.iframe.click\n ps=bodypage.search(\"//p\")\n ps.each do |node|\n if node.text.include?(\"Käyttöpaikka:\")\n parts=node.text.split(\"\\n\")\n vals[:street_address]=parts[1].chomp.strip\n vals[:postno]=parts[2].chomp.strip\n vals[:city]=parts[3].chomp.strip.capitalize\n end\n end\n\n vals\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "bb98239b5379b131d6e0e768a364da5d",
"score": "0.0",
"text": "def office_params\n params.fetch(:office, {})\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7493595",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6954758",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69205236",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6891565",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6783412",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6741766",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.66818774",
"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.6634386",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6627996",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6624317",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.6561549",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.648986",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64755446",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6452771",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.639812",
"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.6379535",
"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.63622755",
"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.63365924",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.63347775",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63249147",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63191724",
"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.6313892",
"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.6312876",
"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.63040864",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.62999487",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.629886",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6294405",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62785035",
"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.62718505",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6265872",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62543756",
"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.62532973",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6250798",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6233973",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62272465",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6227004",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6225902",
"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.62246615",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6199634",
"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.6190174",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6181904",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61772704",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6162726",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160626",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6154942",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61526656",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61359465",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61319274",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61170536",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114007",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.6109575",
"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.61028",
"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.61028",
"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.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6085453",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60841954",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6083834",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076738",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60734737",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6066163",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065011",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60641026",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6063542",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60627866",
"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.60613674",
"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.60602236",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562223",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6047439",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6047015",
"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.6047015",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.60457283",
"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.60412854",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6032506",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6029243",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.60251915",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6020472",
"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.60178447",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6016368",
"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.60133153",
"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.6007004",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60052776",
"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.60052776",
"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.60052764",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60026777",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60007924",
"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.6000297",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59981924",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5995787",
"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.5995787",
"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.59932935",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.59924304",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59919494",
"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.59897816",
"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.5988952",
"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": ""
}
] |
5bea4239f59961db82a9bb7504aa7ed5
|
Execte Arounds must handle all exceptions really well. Their naming should be much clearer. Think of it as naming a new feature. Use Execute Around when you frequently have code that needs to come before or after another set of code, or both. This way you can define a method that takes a block,
|
[
{
"docid": "7761fa98452abb2b3c267aea6e024688",
"score": "0.0",
"text": "def run_that_block( &that_block )\n puts \"About to run the block\"\n that_block.call # if that_block # this checks to see if a block was passed\n puts \"Done running the block\"\nend",
"title": ""
}
] |
[
{
"docid": "9b1c3b87f35505d3d5105ae1dacafa44",
"score": "0.6840511",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "555266b90d8f22685d7d597108d7aba2",
"score": "0.6815939",
"text": "def execute(block)\n block.call\nend",
"title": ""
},
{
"docid": "a7eff477275db5fed6cff7ed45bf62ee",
"score": "0.6766017",
"text": "def execute(&block)\n block#.call\nend",
"title": ""
},
{
"docid": "8894bc2eafdbedb2ae429f0d69b6a036",
"score": "0.6754994",
"text": "def execute(block)\n block.call\n end",
"title": ""
},
{
"docid": "6f0d5e7d6fc50e749897329b5656b531",
"score": "0.6732731",
"text": "def execute(&block)\n block\n end",
"title": ""
},
{
"docid": "4452e016e2e65431233f3df2c911d3e1",
"score": "0.6701822",
"text": "def execute(block)\n block.call \nend",
"title": ""
},
{
"docid": "9ac51a4e3675e6693e3aa6bc989fff55",
"score": "0.66917163",
"text": "def execute(&block) \n block \nend",
"title": ""
},
{
"docid": "4918da2d30a1df2704f88dbdefa01ac9",
"score": "0.6688612",
"text": "def execute_correctly(&block)\n block.call\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "e93b215928af8d9cc1fae2751ea3d47d",
"score": "0.6672134",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "57f93a8f3740619f1ea30a57588c50bc",
"score": "0.6655885",
"text": "def execute(&block)\n block\nend",
"title": ""
},
{
"docid": "ca8db3f9ed3d3df8c513b6c7e8c7ae78",
"score": "0.66547185",
"text": "def execute_block(&block)\n block.call\nend",
"title": ""
},
{
"docid": "d3b85eeacca203b72fc95acb2f9efea4",
"score": "0.66482615",
"text": "def execute(&block)\n block.call # .call was added as part of exercise 4, to correct the code to call the block.\nend",
"title": ""
},
{
"docid": "86b48c40c2e572f770c0277b832d4ffb",
"score": "0.6646486",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "3517e6aeca527ea5ac6d7de50e5bb7c0",
"score": "0.66373724",
"text": "def execute(&block)\n block # missing .call to run the block\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
},
{
"docid": "158ff8e6973776ada55ece5ca5e51a69",
"score": "0.6631216",
"text": "def execute(&block)\n block.call\nend",
"title": ""
}
] |
2e814b279e265773be5794fa7b9edae2
|
Verify that letter is in the current word Note need to comment out this test if running test 15
|
[
{
"docid": "83723bb183a669b09730467dcd915422",
"score": "0.77037156",
"text": "def test_13_return_good_job_prompt_if_letter_in_word\n $word = \"test\"\n letter = \"e\"\n results = letter_test(letter)\n assert_equal(\"Good job - that letter was in the word. Please guess again!\", results)\n end",
"title": ""
}
] |
[
{
"docid": "16522c7a2904d9e3161cba520799b042",
"score": "0.7604438",
"text": "def test_letter(letter)\n check_win do\n @used_letters << letter\n if @word.include? letter and !@guessed.include? letter then\n @word.scan(/(?=#{letter})/).count.times do\n @guessed << letter\n end\n else\n @tries -= 1\n end\n end\n end",
"title": ""
},
{
"docid": "e33f7bb100ca107bdb5ed0b2da6b03f1",
"score": "0.75338924",
"text": "def in_word?(letter)\n @word.include? letter\n end",
"title": ""
},
{
"docid": "3617411e0a94bd8a546a475edf1e36b4",
"score": "0.739605",
"text": "def include_letter?(guess) \n self.word.include?(guess)\n end",
"title": ""
},
{
"docid": "33fe77a840e6bb13cebf848d0e8c35e4",
"score": "0.7365856",
"text": "def test_14_return_sorry_prompt_if_letter_not_in_word\n $word = \"test\"\n letter = \"y\"\n results = letter_test(letter)\n assert_equal(\"Sorry - that letter was not in the word. Please try again!\", results)\n end",
"title": ""
},
{
"docid": "08e2e6fc86b5a2ba233f6e5d8eb57e1d",
"score": "0.73608494",
"text": "def letter_test(letter)\n # If it is in the word pass it to find_locations(), if not pass it to wrong_letter()\n $word.include?(letter) ? find_locations(letter) : wrong_letter(letter)\n # $word.include?(letter) # use for testing\nend",
"title": ""
},
{
"docid": "c0c47b03a680e271555d70d94fa21f86",
"score": "0.735098",
"text": "def guess?(letter)\n @word.downcase.include?(letter)\n end",
"title": ""
},
{
"docid": "2d545a37301323f8b7eace12daac44e3",
"score": "0.734676",
"text": "def test_word(character)\r\n #Once the character is passed through, delete it as we dont want to use it again\r\n @alpha.delete(character)\r\n #If the word includes this charater, store it in variable, correct\r\n correct = word.include?(character)\r\n #Iterate through each value of word as an array\r\n #Item will equal the letter and index will equal the index (per using each_with-index)\r\n word.chars.each_with_index do |item, index| # item = \"p\", index = 0\r\n #The index from word that matches within placeholder, should equal the random \r\n #character if the character is equal to the item from word\r\n @placeholder[index] = character if character == item \r\n #End method\r\n end\r\n #Return correct\r\n correct\r\n #End method\r\n end",
"title": ""
},
{
"docid": "998e651f37b97dd5965352795585fc72",
"score": "0.7339018",
"text": "def letter_in_word(guess)\n @secret_word.include?(guess) ? true : false\n end",
"title": ""
},
{
"docid": "e757f06409dfc8ed0da70c758f45477e",
"score": "0.730129",
"text": "def word_has?(letter)\n\t\t@word.include?(letter)\n end",
"title": ""
},
{
"docid": "8cf83dd22dfba643c770752df4bae5df",
"score": "0.7296226",
"text": "def word_has?(letter)\n \tword.each_char do |char| \n if char == letter\n true\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "f1cc21b11246cde4d5d43171ceba4603",
"score": "0.7233972",
"text": "def check_letter(letter)\n letters_to_array(letter)\n @word.each_with_index do |char, index|\n if char == letter\n @word_progress[index] = char\n end\n end\n @guess_count -= 1\n letter\n end",
"title": ""
},
{
"docid": "baf02dc1ae4650fe0e6bbf0fd83ad349",
"score": "0.7157531",
"text": "def check_letter\n if @mystery_word.include?(@letter)\n puts \"Yes, there is at least one #{@letter} in the mystery word.\"\n if @mystery_word.count(@letter) > 1\n puts \"Turns out there are #{@mystery_word.count(letter)} #{@letter}'s'\"\n replace_letter\n else\n replace_letter\n end#end of the conditional to see if the guessed letter occurs more than once in the mystery word\n #displays ascii art to show the user that they guessed correctly\n puts @fish_tank[@counter]\n puts \"Fishy stays in place.\"\n puts\n puts\n else\n wrong_guess\n end #end of conditional to see if the letter guessed is in the mystery_word\n end",
"title": ""
},
{
"docid": "510477cd77069716ed0355b25b857b5b",
"score": "0.7157173",
"text": "def guess?(letter)\n # puts \"guess letter for the word\"\n @word.include?(letter)\n end",
"title": ""
},
{
"docid": "2b4953697616ab15208f5356d11f2d94",
"score": "0.714663",
"text": "def test_word_is_only_letters\n WORD.generate_word(1)\n assert WORD.word.scan(/[^a-zA-Z]/).empty?\n end",
"title": ""
},
{
"docid": "7d2dbb37a50743ffdb0c63d3cffc59fd",
"score": "0.7108335",
"text": "def check_word_for_char(char)\n @word.include?(char) ? true : false\n end",
"title": ""
},
{
"docid": "81e824980f752dd2d0037ca353bc570c",
"score": "0.70941395",
"text": "def containLetter letter\n\t\tif word.match(letter)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "5c0a1f3c69fc3241ca926a190f8dd57d",
"score": "0.7092064",
"text": "def victory(word,letters)\n if word.split(\"\").all? { |i| letters.include?(i) }\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "88847b7cd7972297ca8253fd8c3047ae",
"score": "0.70882225",
"text": "def test_random_character_alt_spelling_quote\n assert @tester.quote(character: 'ackbar').match(/\\w+/)\n end",
"title": ""
},
{
"docid": "baaf5ae8ac29290bdd5f9f7cc95b24f6",
"score": "0.70561206",
"text": "def checkWord(w)\n @count -= 1\n if w == @comp_guess\n chars = w.split(\"\")\n chars.each_index do |i|\n @user_guess[i] = chars[i]\n end\n @guess.push(w)\n return true\n end\n @misses.push(w)\n return false\n end",
"title": ""
},
{
"docid": "ca2a76cdb101fcff01444cd3cc030c9d",
"score": "0.7050812",
"text": "def test_quote_random_character_alt_spelling\n assert @tester.quote(character: 'Laura Baines').match(/\\w+/)\n end",
"title": ""
},
{
"docid": "3330b99860727733268e39dd0f653ce2",
"score": "0.7046634",
"text": "def check_letter(letter)\n\t\t\ttotal = @word.split('').enum_with_index.inject(0) do |t,(l,i)| \n\t\t\t\tif l == letter\n\t\t\t\t\tself[i,1] = l \n\t\t\t\t\tt += 1\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tt\n\t\t\tend\n\t\t\t\n\t\t\t@turns += 1\n\t\t\t@fails += 1 if total == 0\n\t\t\t\n\t\t\ttotal\n\t\tend",
"title": ""
},
{
"docid": "a05f6053d60b30f9236ddd1ff3007038",
"score": "0.7045553",
"text": "def letterfound\n word = \"string\"\n if word.include \"i\"\n return true\nend\nend",
"title": ""
},
{
"docid": "a2e7e9d95b37c8e4987309561392edaa",
"score": "0.7027605",
"text": "def process_letter(cur)\n if in_word? cur\n @good << cur unless good? cur\n else\n @bad << cur unless bad? cur\n end\n end",
"title": ""
},
{
"docid": "31fce2f7de0ceec8c42f1709f68a84f3",
"score": "0.70142853",
"text": "def test_random_character_alt_spelling_quote\n assert_match(/\\w+/, @tester.quote(character: 'ackbar'))\n end",
"title": ""
},
{
"docid": "ea665cf4391d7dd52a5aa682481e1feb",
"score": "0.70096564",
"text": "def verify_word(word)\n guessed_chars = INITIAL_MOVES - @moves \n puts \"Computer guessed: #{guessed_chars}\" #Note that I'm setting guessed chars within the string\n \n print \"Computer failed. What was the word? \"\n correct_word = gets.chomp\n\n #TODO: Can I easily substitute the string, \"I think you made a mistake,\" to the beggining of the reason why the user made a mistake?\n if /[^a-z]/i =~ correct_word.downcase\n puts \"I think you made a mistake, '#{correct_word}' has non-alphabetic letters.\"\n elsif correct_word.length != word.length\n puts \"I think you made a mistake, '#{correct_word}' is not #{word.length} letter(s).\"\n elsif correct_word.count(guessed_chars.join) == correct_word.length\n puts \"I think you made a mistake, I guessed all the letters of '#{correct_word}'.\"\n end\n \n end",
"title": ""
},
{
"docid": "a3061405b21562b796605ab31e8771b6",
"score": "0.70074135",
"text": "def check_if_in_word(letter)\n @word.each do |item|\n @letter_locations = []\n if item == letter\n @letter_locations = @word.each_index.select{|i| @word[i] == letter }\n @letter_locations.each do |location|\n @blanks_array[location] = letter\n end\n true\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "fb5dc1379ddc299c15defa50121f6b06",
"score": "0.70018697",
"text": "def check_letter(letter_selected)\n @word_to_guess.each_with_index do |letter,index|\n \t @word_uncomplete[index] = letter if letter.downcase == letter_selected\n end\n @letters_played << letter_selected\n end",
"title": ""
},
{
"docid": "c0b3485150e5dd8d988c6d6562c03eb1",
"score": "0.6977725",
"text": "def guess?(letter)\n if @word.include?(letter)\n right = @array_of_letters.each_index.select { |i| @array_of_letters[i] == letter }\n right.each { |n| @displaying_word[n] = letter }\n puts \"true\"\n puts @displaying_word\n else\n puts 'false'\n end\n end",
"title": ""
},
{
"docid": "a1bfe780034a19ee7e854ba01f16c14c",
"score": "0.6976565",
"text": "def check(char)\n found = false\n @word.value.each_with_index do |val, index|\n if val == char.upcase\n @word.progress[index] = char.upcase\n found = true\n end\n end\n return if @word.bad_guesses.include?(char)\n puts \"Bad guess!\" unless found\n @word.bad_guesses << char.upcase unless found\n end",
"title": ""
},
{
"docid": "7eb4fe6dc70e8ec2751432e14b80db4c",
"score": "0.69697964",
"text": "def letter_test(letter)\n if $word.include? letter # If it is in the word, pass it to find_locations()\n find_locations(letter)\n else # If it is not in the word, pass it to wrong_letter()\n wrong_letter(letter)\n end\nend",
"title": ""
},
{
"docid": "7eb4fe6dc70e8ec2751432e14b80db4c",
"score": "0.69697964",
"text": "def letter_test(letter)\n if $word.include? letter # If it is in the word, pass it to find_locations()\n find_locations(letter)\n else # If it is not in the word, pass it to wrong_letter()\n wrong_letter(letter)\n end\nend",
"title": ""
},
{
"docid": "7eb4fe6dc70e8ec2751432e14b80db4c",
"score": "0.69697964",
"text": "def letter_test(letter)\n if $word.include? letter # If it is in the word, pass it to find_locations()\n find_locations(letter)\n else # If it is not in the word, pass it to wrong_letter()\n wrong_letter(letter)\n end\nend",
"title": ""
},
{
"docid": "79b3310663eb4daf7577c932966b043e",
"score": "0.69644874",
"text": "def check_letter(input)\n\tif @target.include? \"input\"\n\t\treturn true\n\tend\nend",
"title": ""
},
{
"docid": "052adf30584e9664bc48218b51f54812",
"score": "0.69475794",
"text": "def guess?(letter)\n if (@word.include?(letter))\n arr_of_indicies = []\n arr_of_indicies = @array_of_letters.each_index.select do |i|\n @array_of_letters[i] == letter\n end\n arr_of_indicies.each do |index|\n @displaying_word[index] = letter\n end\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "5893570d61fb9cbc0fc58484d55f9b51",
"score": "0.69387776",
"text": "def valid_word?(letter)\n possible_frag = @fragment + letter\n\n File.open(dictionary.txt) do |f|\n f.any? {|line| line.include?(possible_frag)}\n end\n\n end",
"title": ""
},
{
"docid": "906ee4e33e5fb4eed59d525e9c100cd5",
"score": "0.69335604",
"text": "def test_quote_random_character_alt_spelling\n assert_match(/\\w+/, @tester.quote(character: 'Laura Baines'))\n end",
"title": ""
},
{
"docid": "5738703bb7ba754578f2f49f22d37a99",
"score": "0.6928794",
"text": "def guess(letter)\n\t\tif @target_word.include? letter\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e4af4c99d754b5d4a4b71aa8dd921f08",
"score": "0.6920417",
"text": "def letter_checker(letter)\r\n if @secret_word.include?(\"_\") == FALSE or @word == letter\r\n p \"Congratulations\"\r\n @game_over = TRUE\r\n elsif chances == 0\r\n p \"GAME OVER KID!\"\r\n @game_over = TRUE\r\n elsif @word_array.include? (letter)\r\n @word_array.length.times {|index| \r\n if @word_array[index] == letter\r\n @secret_word[index] = letter\r\n end\r\n }\r\n @secret_word[@word_array.index(letter)] = letter\r\n p @secret_word.join(' ')\r\n if @secret_word.include?(\"_\") == FALSE or @word == letter\r\n p \"Congratulations\"\r\n @game_over = TRUE\r\n end\r\n elsif @old_guess.include? (letter)\r\n p \"You tried that already\"\r\n else\r\n @chances -= 1\r\n @old_guess << letter\r\n p \"there is no #{letter} there's #{@chances} left\"\r\n p @secret_word.join(' ')\r\n end\r\n end",
"title": ""
},
{
"docid": "6ee36cde3beac061cdf8774924034fdc",
"score": "0.6898924",
"text": "def printWord\n temp = 0\n print \"THE WORD \\n\"\n #for each letter, check if it has been guessed and print\n #the appropriate character\n while(temp < @word.size-1)\n \n if(@letters_tried.include?(@word[temp]))\n print \"#{@word[temp]} \"\n else \n print \"_ \"\n end\n temp += 1\n end\nend",
"title": ""
},
{
"docid": "ccc04710ef0454044cb3b99a38bf3441",
"score": "0.6881664",
"text": "def check_letter(letterx)\n # puts 'checking letter', letter\n positions = @random_word.positions_for(letterx)\n if positions.length > 0\n\n # print positions\n for pos in positions\n # puts pos\n @guesesses_positions[pos] = letterx\n end\n else\n @bad_guesses_list << letterx\n end\n end",
"title": ""
},
{
"docid": "3b307100c9ffa312c20178dd8a2d85cc",
"score": "0.68790406",
"text": "def word_char?(c)\n ('a'..'z') === c or \n ('A'..'Z') === c or \n ('0'..'9') === c or \n '_' == c\n end",
"title": ""
},
{
"docid": "42bbdd0db455b2627b1dbf15f56c9ca7",
"score": "0.68772763",
"text": "def is_letter_in_word(word,letter)\r\n # Given the word \"word\", check if it contains the letter \"letter\".\r\n # REPLACE THIS CODE WITH YOUR is_letter_in_word() METHOD\r\n if (word == nil)\r\n return false\r\n else\r\n if(word.index(letter)!=nil)\r\n return true\r\n else\r\n return false\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "1bfc59493519e5288a8a43346254ebf4",
"score": "0.6872303",
"text": "def good?(letter)\n @good.include? letter\n end",
"title": ""
},
{
"docid": "9bcf100f0c0f60b9abf7cfcd5324bb48",
"score": "0.6855134",
"text": "def letter?(guess)\n return guess[/[a-zA-Z]+/] == guess\nend",
"title": ""
},
{
"docid": "f847edf49167652b82324166cca9d032",
"score": "0.68400866",
"text": "def check_next_letter\n\t\t\trecalculate_letter_frequencies\n\t\t\tletter = @letters.shift\n\t\t\t@word.check_letter(letter)\n\t\t\tprune_dictionary\n\t\t\t\n\t\t\tletter\n\t\tend",
"title": ""
},
{
"docid": "db5e7df5b8b13c4eceef3263f8ecb0d9",
"score": "0.68278426",
"text": "def guess?(letter)\n if(@word.include?(letter))\n array = []\n array = @bank.each_index.select do |i| \n @bank[i] == letter\n end\n array.each do |index|\n @show_word[index] = letter\n end\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "fd9b94705796bb5cdf65e59a67330168",
"score": "0.68265855",
"text": "def guessed?\n (word.split('') - selected_letters).empty?\n end",
"title": ""
},
{
"docid": "d449ce783082cefa31186f1e19ce8858",
"score": "0.68263435",
"text": "def check_letter(letter)\n\t\tif @word_to_guess.include? letter\n\t\t\tputs \"You found: #{letter}!\"\n\t\t\t@word_to_guess.length.times do |i|\n\t\t\t\tif word_to_guess[i] == letter\n\t\t\t\t\t@guessed[i] = letter\n\t\t\t\t\tputs \"Good guess!\"\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tputs \"Sorry, #{letter} is not part of the word.\"\n\t\tend\n\n\t\t@attempts -= 1\n\t\tstatus(@word_to_guess, @guessed)\n\t\tputs \"You have #{@attempts} attempts remaining.\"\n\tend",
"title": ""
},
{
"docid": "2b1993b3228c04ee0987b7340e41f683",
"score": "0.6824074",
"text": "def vindicated_word?(word)\n \nend",
"title": ""
},
{
"docid": "a8ce42682a0f0beee089fe3670149dc4",
"score": "0.681787",
"text": "def valid_play?(letter)\n string = @fragment + letter\n\n @dictionary.each do |word|\n if word.match?(string)\n return true\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "5ea047c5142f9caca21b95651efcfe59",
"score": "0.6809266",
"text": "def is_letter?(word)\r\n if word[/[a-zA-Z]+/] == word\r\n return true\r\n else\r\n return false\r\n end\r\n end",
"title": ""
},
{
"docid": "45097850ad85fc0240048d5c37207c2c",
"score": "0.6803136",
"text": "def test_invalid_letter\n assert_equal (@checker.letter \"1\"), false\n end",
"title": ""
},
{
"docid": "003779abaf0b17b29bb00c23207aa070",
"score": "0.6788967",
"text": "def letter?(lookAhead)\n\tlookAhead =~ /[[:alpha:]]/\nend",
"title": ""
},
{
"docid": "db1c17e3f8a6319bc4115e43cca18689",
"score": "0.6788586",
"text": "def checker(letter)\n if @word.include?(\"#{@letter}\") == true\n letter_index = @word.index(\"#{@letter}\")\n @feedback[letter_index] = \"#{letter}\"\n attempts += 1\n else \n if @store_attempts.include?(\"#{@letter}\") == true\n @attempts += 0\n else \n @attempts +=1\n end\n end\nend",
"title": ""
},
{
"docid": "372b0c368891be517177660e0e5e9c8b",
"score": "0.6781426",
"text": "def check_letter(word, guess)\n@c=word.include?(guess)\n0.upto(word.size - 1) do |b|\n\tif guess.include?(word[b,1]) then\n\t\t@result.push(b+1) \n\tend\nend\nend",
"title": ""
},
{
"docid": "28256df806e89af235e6fda37d901eaa",
"score": "0.67741084",
"text": "def reveal(letter)\n lc_letter = letter.downcase \n return 0 if used_before(letter) \n @word.each_char.with_index do |l,index| # We want to go through each letter \n # in the word and if choosen correcly reveal the letter whether it be upcase\n # or downcase\n if l == lc_letter || l == lc_letter.upcase\n @revealed_letters += 1 # revealed_letters += 1 so that the guess donesn't \n # count against if it is right\n @result[2* index] = l # store result [2* index] to equal l because we created\n # space between our letter in the word choosen\n end \n end\n return 1\n end",
"title": ""
},
{
"docid": "22a874aba90e64d51469b9f3027b48d1",
"score": "0.67736274",
"text": "def word_checker(word, correct_letters)\n # Enables case insensitivity in guesses\n case_pairs = []\n word.chars.each do |char| \n case_pairs << char && \n case_pairs << switch_case(char)\n end\n\n chars_check_format(case_pairs) == correct_letters.sort\nend",
"title": ""
},
{
"docid": "13df593da4484923eff056f2ab36e5c3",
"score": "0.67542917",
"text": "def yell\n\t\t\treturn @word.match(/[a-z]/).nil?? true : false\n\t\tend",
"title": ""
},
{
"docid": "8c0f7f26afa718a27c200c51857f4ce7",
"score": "0.67542136",
"text": "def include_letter?\n @guess_ind = (0 ... @word.length).find_all { |i| @word[i,1] == @used_guesses[-1]}\n return @guess_ind\n end",
"title": ""
},
{
"docid": "7efbce30659a00d7fbc694cc4e9a12d0",
"score": "0.67535454",
"text": "def any_letters?(guess)\n\t\t @secret_word.include?(guess) ? true : false\n\t end",
"title": ""
},
{
"docid": "54bff5f939780ae73fda3a00c8265c82",
"score": "0.6751802",
"text": "def all_letters_guessed?\n word_guessed = true\n @player_work.each { |c| word_guessed = false if c == '_' }\n word_guessed\n end",
"title": ""
},
{
"docid": "2d9e9b8f6deb2f6da263bf71059f840b",
"score": "0.67499",
"text": "def is_partofword(ch)\r\n # REPLACE THIS CODE WITH YOUR isPartOfWord() METHOD\r\n if((ch >= 'A' and ch <= 'Z') or (ch >= 'a' and ch <= 'z') or (ch >= '0' and ch <= '9'))\r\n return true\r\n else\r\n return false\r\n end\r\nend",
"title": ""
},
{
"docid": "8973cebc30b5c33f83cdba2f51bb3767",
"score": "0.6745704",
"text": "def letter?(look_a_head)\n look_a_head =~ /[A-Za-z]/\n end",
"title": ""
},
{
"docid": "ad6547a3def4aa3d7c8baaf9cdd7141b",
"score": "0.6732227",
"text": "def hit?(letter)\n\t\n\t# Check number of occurences of the letter in the array\n\tmatches = 0\n\trx = Regexp.new(letter)\n\tmatches = $words.count { |word| word =~ rx }\n\n\t# puts matches.to_s + \" words contain the letter \" + letter\n\n\tif (matches == 1)\n\t\t# Remove all words from the array that\n\t\t# do not match\n\t\t$words.keep_if { |word| word =~ rx }\n\t\t# puts \"Found target word: \" + $words.inspect\n\t\treturn true\n\telsif (matches == $words.size)\n\t\trindex = rand($words.size)\n\t\t# puts \"Random index = \" + rindex.to_s\n\t\tword = $words[rindex]\n\t\t# puts \"Selected word = \" + word\n\t\t$words.clear\n\t\t$words << word\n\t\t# puts \"$words = \" + $words.to_s\n\t\treturn true\n\telse\n\t\t# Remove all the words from the array\n\t\t# that contain the letter\n\t\t$words.delete_if {|word| word =~ rx}\n\n\t\tmatches = 0\n\t\trx = Regexp.new(letter)\n\t\t$words.each do |word|\n\t\t\tif (rx.match(word) != nil)\n\t\t\t\t# print word + \" \"\n\t\t\t\tmatches += 1\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend\nend",
"title": ""
},
{
"docid": "82d16a540bac57fe2b048c578f57f50e",
"score": "0.67297745",
"text": "def check_guess(letter_guessed)\r\n letter_guessed.downcase\r\n @users_word.split('').each_with_index do|user_letter, hidden_letter|\r\n if letter_guessed == user_letter\r\n @hidden_word[hidden_letter] = letter_guessed\r\n p @hidden_word\r\n end\r\n if !@users_word.include?(letter_guessed)\r\n puts \"#{letter_guessed} is not in the word. Try again.\"\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "1d75f8e06acf75d9ee57ff8663fffac8",
"score": "0.672715",
"text": "def uses_available_letters?(test_word, drawn_letters)\n \n # Create duplicate of drawn_letters to ensure data in this array does not change\n drawn_letters_2 = drawn_letters.dup\n # Take users's word and identify each character in that word\n input_letters = test_word.split('')\n input_letters = input_letters.map {|letter| letter.upcase}\n input_letters.each do |letter|\n # Verify user's word character against collection of drawn letters\n index = drawn_letters_2.index(letter)\n # If user's word character exist in the collection of drawn letters,\n # delete character from collection of drawn letters to account for repeats of same letter\n if index != nil\n drawn_letters_2.delete_at(index)\n else\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "de6d986a40c4f438c8a3058bd3246c68",
"score": "0.6722874",
"text": "def check_word(guess)\n\t\tif guess == @word\n\t\t\t@is_over = true\n\t\t\tp \"You are clearly a word guessing genius.\"\n\t\telsif @word.include?(guess)\n\t\t\t@guessed_letters << guess\n\t\t\tp \"Getting closer to solving.\"\n\t\telsif @guessed_letters.include?(guess)\n\t\t\tp \"You already tried that letter.\"\n\t\telsif @guess_count == 0\n\t\t\t@is_over = true\n\t\t\tp \"Better luck next time, loser.\"\n\t\telse \n\t\t\t@guess_count -= 1\n\t\t\tp \"Guess another letter.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "198d69d00c0b7e5fbe144b55905ecd15",
"score": "0.67150795",
"text": "def block_word1?(str)\n counter = 0\n loop do\n return true if counter == str.size\n char = str[counter].upcase\n ascii_value = char.ord\n rest_of_str = str[(counter + 1)..-1]\n if ascii_value <= 77\n doppleganger = (ascii_value + 13).chr\n return false if rest_of_str.include?(doppleganger)\n else\n doppleganger = (ascii_value - 13).chr\n return false if rest_of_str.include?(doppleganger)\n end\n counter += 1\n end\nend",
"title": ""
},
{
"docid": "8756cebb47c19de31cb6f1fb67dba01c",
"score": "0.671066",
"text": "def vindicated_word?(word)\n \nend",
"title": ""
},
{
"docid": "f40f3c0791bc882965407b06c84ced0d",
"score": "0.6703886",
"text": "def test_case_3\n terms = @gh.all_words.with_word_length(6).begins_with('e').char_count_less_than('e', 2).does_not_contain('y')\n assert(terms.all? { |term| term.size == 6 && term.match(/\\Ae[^ey]{5}\\z/) })\n end",
"title": ""
},
{
"docid": "10b0e3d1d311a360c0e01a00b46d1292",
"score": "0.66979635",
"text": "def mutation?(base_word, mutation)\n base_word.each_char do |letter|\n if mutation.include? (letter)\n true\n else\n false\n end\n end\nend",
"title": ""
},
{
"docid": "1b1c5b4b0cb5028d8fac429fb6881414",
"score": "0.66900843",
"text": "def uses_available_letters? (input, letters_in_hand)\n input = input.upcase.chars\n # make copy of drawn letters\n dl_copy = letters_in_hand.dup\n\n # if letter of input = letter in drawn letters, remove letter in drawn letters\n # continue to compare rest of letters to drawn letters\n # times_true array used to determine if word is valid\n times_true = []\n input.each do |letter|\n if dl_copy.include?(letter) == true\n dl_copy.delete_at(dl_copy.index(letter))\n times_true << \"true\"\n else\n times_true << \"false\"\n end\n end\n\n if times_true.count(\"true\") == input.length\n is_valid = true\n else\n is_valid = false\n end\n return is_valid\nend",
"title": ""
},
{
"docid": "994d282af2b77188d0da1c6ec7359ed1",
"score": "0.6680499",
"text": "def check_letter\n\n unless @used_letters.include?(@guess) == false\n puts \"You have already guessed this letter!\"\n puts \"Please guess again!\"\n @guess = gets.chomp.upcase\n else\n # add letter to used letters array\n @used_letters.push(@guess)\n end\n\n if @word.upcase.include?(@guess)\n for index in 0..@word.length - 1\n if @word[index].upcase == @guess\n # update_word #took it out of method just to check variable\n @word_so_far[index] = @guess\n end\n end\n puts \"What a great guess!\"\n puts \"Good job!\"\n update_board\n else\n #guess is wrong\n @wrong_count -= 1\n puts \"You have made a terrible guess!\"\n puts \"How could you pick that letter?!\"\n update_board\n puts \"You have #{ @wrong_count } guesses left.\"\n end\n end",
"title": ""
},
{
"docid": "79433c92a1a8c0a932d8d8d534bb5a77",
"score": "0.66744626",
"text": "def guessed_entire_word(word, guessed_letters)\r\n word_array = word.split('')\r\n\r\n word_array.each do |letter_in_word|\r\n did_guess_letter = false\r\n guessed_letters.each do |letter|\r\n if letter_in_word == letter\r\n did_guess_letter = true\r\n end\r\n end\r\n if did_guess_letter == false\r\n return false\r\n end\r\n end\r\n\r\n return true\r\nend",
"title": ""
},
{
"docid": "d5b631b16ea97425be38f31d865c4b1d",
"score": "0.66739655",
"text": "def uses_available_letters?(user_input, letters_in_hand)\n untouched_hand = letters_in_hand.dup\n word_split = user_input.upcase.split(\"\")\n result = 0\n word_split.each do |letter|\n if untouched_hand.include?(letter)\n untouched_hand.slice!(untouched_hand.index(letter))\n result = true\n else\n result = false\n break\n end\n end\n return result\nend",
"title": ""
},
{
"docid": "601b6b258574107c59083c0912935884",
"score": "0.66688067",
"text": "def does_it?(word)\n puts word if word.downcase =~ /lab/\nend",
"title": ""
},
{
"docid": "56b392bbb5a17fe9a6facd5c5775957d",
"score": "0.66663456",
"text": "def letter!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 80)\n\n \n # - - - - main rule block - - - -\n # at line \n if @input.peek(1) == ?$ || @input.peek(1).between?(?A, ?Z) || @input.peek(1) == ?_ || @input.peek(1).between?(?a, ?z)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 80)\n\n end",
"title": ""
},
{
"docid": "08effdace0a7d42a9bc5354e040beb7c",
"score": "0.6663592",
"text": "def missing_letter(word)\n # your code goes here\nend",
"title": ""
},
{
"docid": "aa41b70dba23ad439617b34bb824332d",
"score": "0.6658693",
"text": "def mutation?(base_word, mutation)\n letter_counter = 0\n mut_array = mutation.split(\"\")\n base_array = base_word.split(\"\")\n\n mut_array.each do |mut_letter|\n if base_array.include? mut_letter\n letter_counter += 1\n base_array -= [mut_letter] #Makes sure the letter doesn't get counted twice\n end\n end\n\n if letter_counter == mutation.length\n return true\n else\n return false\n end\n\nend",
"title": ""
},
{
"docid": "6bea5e2a031861784551b6250af238c0",
"score": "0.6654653",
"text": "def letter?(lookAhead)\n lookAhead =~ /[[:alpha:]]/\nend",
"title": ""
},
{
"docid": "fa02b0afb258366c178ec3b8d943adb5",
"score": "0.66520375",
"text": "def check_letter_guess(guess)\n match = false\n @word_array.each_with_index do |letter, i|\n if letter == guess\n @current_status[i] = letter\n match = true\n if @current_status == @word_array\n @outcome = \"win\"\n end\n end\n end\n if match == false\n @points -= 1\n if lose?\n @outcome = \"lose\"\n end\n end\n end",
"title": ""
},
{
"docid": "8926d3e9dd7c0ddee2ab407a0ce07a59",
"score": "0.6642015",
"text": "def guess_the_letter(g_letter)\n\t \t@attempts += 1\n\t\tg_letter.downcase\n\t\tif !@word.include? (g_letter)\n\t\t\t puts \"Nope...\"\n\t\tend\n\t\t@word.split(\"\").each_with_index do |w_letter, index|\n\t\t\tif g_letter == w_letter\n\t\t\t\t@display_word[index] = g_letter\n\t\t\t\tputs \"Player 2, here is your progress towards guessing the word:\"\n p @display_word\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "29100da9c8ade9f393c8fc77ded5c66e",
"score": "0.6641459",
"text": "def whole_word_guessed\n\n if @letter == mystery_word\n puts \"You're a lucky guesser!\"\n\n else\n puts \"No, #{@letter} is not the mystery word.\"\n wrong_guess\n\n if @letter.length != mystery_word.length\n puts \"Come on, count the blanks. Your guess doesn't even have the right number of letters.\"\n end\n\n if @letter =~ /\\d/ || @letter =~ /\\W/\n puts \"What do you have against Fishy?! Those aren't even letters!\"\n end\n end #end of conditional to see if the whole word guessed is correct\n end",
"title": ""
},
{
"docid": "d0ccaf0292872947263e3a195863dfc9",
"score": "0.66392064",
"text": "def acceptable_whole_word(whole_word_guess)\n while is_a_letter?(whole_word_guess) == nil\n puts \"Say what? Please enter a word.\".colorize(:red)\n whole_word_guess = gets.chomp.downcase\n end\n end",
"title": ""
},
{
"docid": "b8b8c0e9659f86738b3fb8ab4c10bed4",
"score": "0.66344833",
"text": "def vindicated_word?(word)\n\nend",
"title": ""
},
{
"docid": "2f560bd7a8618b0a395f81f7c4539b3a",
"score": "0.6633792",
"text": "def test_case_1\n terms = @gh.all_words.with_word_length(5).begins_with('e').does_not_contain('x')\n assert(terms.all? { |term| term.size == 5 && term.match(/\\Ae[^x]{4}\\z/) })\n end",
"title": ""
},
{
"docid": "17aabd8e1f2956a067e8ac898ddd3afb",
"score": "0.6627001",
"text": "def display_result(word_played, guessed_letters)\r\n letters = word_played.split('')\r\n letters.each do |letter|\r\n if letter_exists_in_array(letter, guessed_letters)\r\n print letter + ' '\r\n else\r\n print '_ '\r\n end\r\n end\r\n puts ' '\r\nend",
"title": ""
},
{
"docid": "c08defb6a8f34661fd491fceb1d7f8e2",
"score": "0.66250736",
"text": "def block_word?(str)\n # upcase the word\n # check each letter block, if the count is > 1, return false\n # return true\n str = str.upcase\n LETTER_BLOCKS.each do |block|\n return false if str.count(block) > 1\n end\n true\nend",
"title": ""
},
{
"docid": "da31461c8a6e680eb609626b96f3a18d",
"score": "0.6622419",
"text": "def guessed_all_correct?\n if letter_counter == word.length\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "aeb2826430e2066d0243a303818180b5",
"score": "0.66219234",
"text": "def letter?(lookAhead)\n\tlookAhead =~ /^[a-z]|[A-Z]$/\nend",
"title": ""
},
{
"docid": "aeb2826430e2066d0243a303818180b5",
"score": "0.66219234",
"text": "def letter?(lookAhead)\n\tlookAhead =~ /^[a-z]|[A-Z]$/\nend",
"title": ""
},
{
"docid": "398d961a4720678ae63963c549d914e6",
"score": "0.6621168",
"text": "def test_correct_choice_of_play_should_update_all_the_word_placeholders_if_that_character_occurs_more_than_once\n @hangman.play('e')\n assert_equal @hangman.word_placeholders, %w(e _ e _ _ _ _ _ _ _ _ _ )\n end",
"title": ""
},
{
"docid": "4f7590e4d255786d181e28752d225452",
"score": "0.6618712",
"text": "def letter_correct?\n if @game_word.include?(@player_guess)\n puts \"\\'#{@player_guess}\\' is in the hidden word!\"\n attempts_array\n game_round\n else\n puts \"\\'#{@player_guess}\\' is not in the hidden word... I'm so sorry for you.\"\n attempts_array\n game_round\n end\n end",
"title": ""
},
{
"docid": "d16e971f8724fd1b0e0b380ba17e6bf3",
"score": "0.661462",
"text": "def guess_letter_check(letter1)\n\t\tif @secret_word.include? letter1\n\t\t\tspot_change = @secret_word.index(letter1)\n\t\t\t@guess_word.delete_at(spot_change)\n\t\t\t@guess_word.insert(spot_change,letter1)\n\t\t\tputs \"Good Job!\"\n\t\telse \n\t\t\tputs \"Sorry wrong letter...\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cd60778df8750a3c2e5199081a1bb92b",
"score": "0.66140246",
"text": "def check_letter(letter_guessed)\n if @word_array.include?(letter_guessed)\n puts \"Yep! We've got some of that!\"\n letter_reveal(letter_guessed)\n update_counter(letter_guessed)\n array_beautifier\n else\n puts \"Nope! Sorry!\"\n update_counter(letter_guessed)\n array_beautifier\n end\n end",
"title": ""
},
{
"docid": "60bfbdd6ca4e27e7596cc3bf4cd150da",
"score": "0.6606949",
"text": "def print_letters(word, guessed)\n word.each_char do |char|\n if guessed.include?(char)\n print \" _#{char.upcase}_\"\n else print ' ___'\n end\n end\nend",
"title": ""
},
{
"docid": "6555bcf64010a8c3db5c6a2b3e2787d2",
"score": "0.6601785",
"text": "def guess(letter)\n @guesses << letter\n correct = false\n @word.each_char do |index|\n if index == letter\n correct = true\n end\n end\n correct\n end",
"title": ""
},
{
"docid": "1e0fe1c3ec1f8caa18df40f4994526bd",
"score": "0.6594914",
"text": "def word_match\n @expected.gsub(/[^\\w]/, '') == @actual.gsub(/[^\\w]/, '')\n end",
"title": ""
},
{
"docid": "583d29fa375a216a437688b80b9cdee3",
"score": "0.6590915",
"text": "def letterCheck(lookAtLetter)\t#def is used to declare a method.\n\tlookAHead = lookAtLetter =~ /[[:alpha:]]/\t#Saves the conditonal result as lookAHead. The conditonal result is the result of comparing lookAtLetter to the regular expression using the =~ operatotor. Return does not need to be written as the value if the last expression is automatically returned.\nend",
"title": ""
},
{
"docid": "fbca2cf7827bc3b12b0eb4fc00b37959",
"score": "0.6580023",
"text": "def correct_word\n if !@guess_word.index('-')\n @is_over = true\n puts \"CONGRATS YOU GUESSED THE WORD, #{@word}\"\n end\n end",
"title": ""
}
] |
03a52cb2a01e6371d26636b1400667a0
|
Returns true if the current user is logged in as company admin or app admin.
|
[
{
"docid": "b8ed19681f889c890f40fd5daf5bdb73",
"score": "0.8640663",
"text": "def logged_in_admin?\n logged_in? && (app_admin? || company_admin?)\n end",
"title": ""
}
] |
[
{
"docid": "13e651118531e2556ea85995b4e3e0b5",
"score": "0.844553",
"text": "def logged_in_company_admin?\n logged_in? && company_admin?\n end",
"title": ""
},
{
"docid": "5a5f49078b9b23b7f526abb1f78a4259",
"score": "0.8224782",
"text": "def logged_in_app_admin?\n logged_in? && app_admin?\n end",
"title": ""
},
{
"docid": "5c0fb972392de2606b17b910afbf39e0",
"score": "0.8195029",
"text": "def company_admin?\n current_user.company_admin\n end",
"title": ""
},
{
"docid": "7a109bc3bb76a308e6d89a440621cff9",
"score": "0.8194828",
"text": "def is_admin?\n if user_signed_in? \n ((current_user.email == \"consigndotnyc@gmail.com\") || (current_user.email == @business.admin_email))\n end\n end",
"title": ""
},
{
"docid": "b2acc45c0a8c96d6fc12a4b7e3ba8ed3",
"score": "0.81594265",
"text": "def user_is_admin()\n site_admins = ENV[\"VOICES_ADMINS\"].split(\"#\")\n if site_admins.include? session[:cas_user]\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "b2555735598bc5dd06495153dce44060",
"score": "0.8124856",
"text": "def current_user_admin?\n signed_in? && (ADMIN_USER_ID == session[:user_id])\n end",
"title": ""
},
{
"docid": "7cdc79e368a6fe27a24018b7de811aff",
"score": "0.81154597",
"text": "def admin?\n current_user && (current_user.login==MDSL_SUPER_USER) \n end",
"title": ""
},
{
"docid": "c9c39e6fc3692462736928f8b1f19c8d",
"score": "0.80416393",
"text": "def admin_logged_in?\n current_admin != :false\n end",
"title": ""
},
{
"docid": "145da3fc17db0dee9bfa30bfabba8e5c",
"score": "0.8041232",
"text": "def admin_user?\r\n logged_in? and current_user.admin?\r\n end",
"title": ""
},
{
"docid": "6c811ead4e76da7c75537a2e57b63993",
"score": "0.8024918",
"text": "def app_admin?\n current_user.app_admin\n end",
"title": ""
},
{
"docid": "2e96b2e8b9aab4d0cd14044ba12e415f",
"score": "0.8007623",
"text": "def admin?\n\t\t\tcurrent_user && current_user.username == \"admin\"\n\t\tend",
"title": ""
},
{
"docid": "439629d15d48553be9a0b7c98e0325f1",
"score": "0.8001161",
"text": "def admin?\n app_admin? || company_admin?\n end",
"title": ""
},
{
"docid": "c0e9a61826895eda8356fcb35350cc65",
"score": "0.79588073",
"text": "def current_user_admin?\n\t\tif !current_user\n\t\t\tfalse\n\t\telse\n\t\t\tcurrent_user.admin?\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0af174e481aceb2f4847317ddb55b18a",
"score": "0.79406655",
"text": "def admin_loggedin?\r\n @logged_in_user and @logged_in_user.admin?\r\n end",
"title": ""
},
{
"docid": "054525d37af0f375b8ef80280dda8cfd",
"score": "0.79202724",
"text": "def admin_user?\n logged_in? && current_user.admin\n end",
"title": ""
},
{
"docid": "054525d37af0f375b8ef80280dda8cfd",
"score": "0.79202724",
"text": "def admin_user?\n logged_in? && current_user.admin\n end",
"title": ""
},
{
"docid": "baa5cf24b0be9db49b3e4844031c88d9",
"score": "0.79190034",
"text": "def logged_in?\n current_admin.is_a? Admin\n end",
"title": ""
},
{
"docid": "1f557b7c4d248ade0861af1d8b49aea7",
"score": "0.78645575",
"text": "def admin_user?\n current_user.admin != 0\n end",
"title": ""
},
{
"docid": "7d31138987499b8fbafda802f77ae84e",
"score": "0.7863997",
"text": "def current_user?(admin_admin)\n admin_admin == current_user\n end",
"title": ""
},
{
"docid": "369fe8256af5833c40d8f593cf2fe025",
"score": "0.7818277",
"text": "def admin?\n user = current_user\n if logged_in?\n return user.is_admin\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "f49ab0439df6bd1d9664ab442054b812",
"score": "0.7816451",
"text": "def admin?\n # if there is no logged in user, there is no admin\n unless current_user\n @admin = false\n return\n end\n # check config to see if the user is an admin (true/false)\n @admin = current_user.is_admin?\n end",
"title": ""
},
{
"docid": "6a9d05749c1046bf988de670c0f3dc32",
"score": "0.78088343",
"text": "def admin_authorized?\n admin_logged_in?\n end",
"title": ""
},
{
"docid": "28b9da6f69a7d93238308414224b1c6b",
"score": "0.7805958",
"text": "def admin_logged_in?\n !current_admin.nil? # An admin is logged in if current_admin is not nil\n end",
"title": ""
},
{
"docid": "c3e9f63c9244ddd1175c83b506d94c17",
"score": "0.77973163",
"text": "def admin_logged_in? \n logged_in? && current_user.admin\n end",
"title": ""
},
{
"docid": "5c134279cbba0f038d2341a839916783",
"score": "0.77874595",
"text": "def logged_in_admin?\n return logged_in? && current_user.admin\n end",
"title": ""
},
{
"docid": "0a8b157fc41a05572d98b884696ff60e",
"score": "0.7783531",
"text": "def is_admin?\n current_user ? current_user.login == \"admin\" : false\n end",
"title": ""
},
{
"docid": "3fcdce6793709fd6b2b4875ca9195802",
"score": "0.7769848",
"text": "def admin_logged_in?\n if current_user.instance_of? Admin\n !current_user.nil?\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "bf1e65f0f2b51f35b64b09a91da9037b",
"score": "0.77697414",
"text": "def current_user_is_admin?\n !current_user.nil? && current_user.admin?\n end",
"title": ""
},
{
"docid": "c115380a99f1711ef6eee7275f52c6f8",
"score": "0.7764781",
"text": "def admin_logged_in?\n !current_agent.nil? && current_agent.admin?\n end",
"title": ""
},
{
"docid": "76b5f0e9126c5c2e4085d9c92a8ce2aa",
"score": "0.7762966",
"text": "def is_admin?\n (logged_in? && (current_user.isAdmin == true))\n end",
"title": ""
},
{
"docid": "52f1c4c77cdfc94883ff6c368fbed31a",
"score": "0.7753485",
"text": "def is_admin_user?\n false\n #is_logged_in? && (is_admin? || is_manager? || is_division_rep?)\n end",
"title": ""
},
{
"docid": "406a41013142526d7c889d7a0d448f20",
"score": "0.7748085",
"text": "def logged_in_as_admin?\n not current_user.nil? and current_user.is_a? Admin\n end",
"title": ""
},
{
"docid": "78c96870937a0593097fbc4450726c9a",
"score": "0.7726605",
"text": "def user_org_admin?(user)\n current_user.id == user.org.admin_id\n end",
"title": ""
},
{
"docid": "802ef87e3fc146806b5c821f66f843ce",
"score": "0.7720059",
"text": "def admin_user?\n logged_in? && current_user.roles.exists?(name: 'admin')\n end",
"title": ""
},
{
"docid": "ac1a0afa76f70a9b0c978fec0953c308",
"score": "0.7719859",
"text": "def is_admin?\n\t\t\tnot current_user.nil? and current_user.is_a? Admin\n\t\tend",
"title": ""
},
{
"docid": "954a16fa0a49c021025afe9280949487",
"score": "0.77184075",
"text": "def user_admin?\n return false unless logged_in?\n current_user.has_role?('admin')\n end",
"title": ""
},
{
"docid": "9b64c8787e163fab1309701fbf32d01d",
"score": "0.77122116",
"text": "def is_admin?\n user.admin? || current_admin \n end",
"title": ""
},
{
"docid": "97b2f1f0fdec04644d2e0f97d435aa7d",
"score": "0.7709078",
"text": "def admin?\n logged_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "97b2f1f0fdec04644d2e0f97d435aa7d",
"score": "0.7709078",
"text": "def admin?\n logged_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "b7ebebf54885308941169dd3a12da008",
"score": "0.7708452",
"text": "def admin?\n logged_in? && current_user.has_role?(:admin)\n end",
"title": ""
},
{
"docid": "b7ebebf54885308941169dd3a12da008",
"score": "0.7708452",
"text": "def admin?\n logged_in? && current_user.has_role?(:admin)\n end",
"title": ""
},
{
"docid": "2472499653db78bc61d1d5f3c38d45ee",
"score": "0.770676",
"text": "def admin?\t\n\t\tuser_signed_in? && current_user.admin\n\tend",
"title": ""
},
{
"docid": "22e9286e9db51d70ecbe30321626a9a1",
"score": "0.76904094",
"text": "def is_admin?\n return (logged_in? && current_user.admin?)\n end",
"title": ""
},
{
"docid": "096aa1a6af2b730487e744388c01bbf2",
"score": "0.7688883",
"text": "def admin?\n\t\tu = User.get(session[:uid])\n\t\treturn false if u.org == 0\n\t\treturn false if !u.active\n\n\t\treturn u.admin\n\tend",
"title": ""
},
{
"docid": "9c5304be999ebb6641c6ed3786a16060",
"score": "0.7684455",
"text": "def admin?\n current_user.has_role?(:admin, Site.instance)\n end",
"title": ""
},
{
"docid": "33cdbb13705836179f288d19c664f922",
"score": "0.7680385",
"text": "def admin?\n user_signed_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "33cdbb13705836179f288d19c664f922",
"score": "0.7680385",
"text": "def admin?\n user_signed_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "4982038bf5172086496ead21925980d4",
"score": "0.7679331",
"text": "def admin?\n logged_in? && current_user.admin == 1\n end",
"title": ""
},
{
"docid": "73fbf3c84c2b6c250eda742723e81c47",
"score": "0.7678913",
"text": "def current_user_admin?\n current_user && current_user.read_attribute(\"admin\")\n end",
"title": ""
},
{
"docid": "bcc3a30c367dd72e0cc1f5444956e3bf",
"score": "0.7676735",
"text": "def is_admin?\n logged_in? && current_user && current_user.admin\n end",
"title": ""
},
{
"docid": "e822faee8499481996fa5a4f42a58a53",
"score": "0.7668453",
"text": "def admin_authorized?\n user_signed_in? && @current_user.has_role?('administrator')\n end",
"title": ""
},
{
"docid": "71a1ef754369ce4e58de63ef206f3964",
"score": "0.7668093",
"text": "def admin?\n result = false\n if current_user != nil && ADMIN_ID == current_user.id.to_s\n result = true\n end\n result\n end",
"title": ""
},
{
"docid": "fbdf9b5775acd266a8c9d3ad962813b7",
"score": "0.76590323",
"text": "def admin?\n logger.debug(\"in admin?\")\n application_user.admin\n end",
"title": ""
},
{
"docid": "2a53119a72a041cf1b6ae0c6696544bb",
"score": "0.7652362",
"text": "def current_user_admin?\n current_user && current_user.admin?\n end",
"title": ""
},
{
"docid": "2a53119a72a041cf1b6ae0c6696544bb",
"score": "0.7652362",
"text": "def current_user_admin?\n current_user && current_user.admin?\n end",
"title": ""
},
{
"docid": "8aaac0c8e4ae95f2d11c37e6562e0888",
"score": "0.7648562",
"text": "def user_admin?\n current_user.account_type == 'Admin'\n end",
"title": ""
},
{
"docid": "de34e6c17149c187133655cc4f9cea02",
"score": "0.76454335",
"text": "def are_you_admin?\n if current_user.email == \"laurenceweening@gmail.com\" && \"test@example.com\"\n return true\n end\n end",
"title": ""
},
{
"docid": "422c10e2ab077b4759b2399ec0a3ecb3",
"score": "0.7643082",
"text": "def is_admin?\n logged_in? && current_user.admin\n end",
"title": ""
},
{
"docid": "422c10e2ab077b4759b2399ec0a3ecb3",
"score": "0.7643082",
"text": "def is_admin?\n logged_in? && current_user.admin\n end",
"title": ""
},
{
"docid": "32995fa4041ea56e9ae2128505379142",
"score": "0.7642889",
"text": "def current_user_admin?\n return false if current_user.nil?\n return current_user.admin?\n end",
"title": ""
},
{
"docid": "084b9fcbcb91cd618ccd9d8af3209176",
"score": "0.76419055",
"text": "def is_admin?\n @current_user.role == 'admin'\n end",
"title": ""
},
{
"docid": "93218a34fedf549e2679d7431a60873c",
"score": "0.7634531",
"text": "def is_admin?\n is_logged_in? && current_user.is_admin\n end",
"title": ""
},
{
"docid": "4b1d1f26d806d9c8785eba90feccf9b4",
"score": "0.7633763",
"text": "def user_is_admin?\n if user_signed_in?\n current_user.admin?\n else\n false\n end\n end",
"title": ""
},
{
"docid": "9fd697a2a197ef7434c26296f6ac247e",
"score": "0.7630483",
"text": "def admin_check\n if current_user\n return true if current_user.evil_master\n return true if current_user.site_admin\n return true if current_user.group && current_user.group.system_name && (current_user.group.system_name == 'admin')\n return true if current_user.group && current_user.group.system_name && (current_user.group.system_name == 'owner')\n else\n false\n end\n end",
"title": ""
},
{
"docid": "6ad2ebbab8819660c2f4ebac0c9b687e",
"score": "0.76287246",
"text": "def is_admin?\n if(current_user == nil)\n return false\n else\n current_user.name == \"admin\" or current_user.name == \"administrator\"\n end\n end",
"title": ""
},
{
"docid": "71f56e1b5d722c6ba52f8ed2de993484",
"score": "0.7624964",
"text": "def is_admin?\n return false if !current_alchemy_user\n\n current_alchemy_user.admin?\n end",
"title": ""
},
{
"docid": "fc472c378475047e1cf558c428241098",
"score": "0.76244247",
"text": "def admin_signed_in?\n current_user.try(:administrator?)\n end",
"title": ""
},
{
"docid": "4cf158787b6487cdb78b67c9e31816e3",
"score": "0.76057774",
"text": "def current_user_admin\n #if \"admin\".casecmp(current_user.user_class)\n if current_user.user_class == \"admin\"\n return true\n end\n end",
"title": ""
},
{
"docid": "16f4abab839c91686897c6f667942e1c",
"score": "0.760193",
"text": "def admin?\n if user_level === 'admin' || user_level === 'super-admin'\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "4cc9167feee6d036fb1819155c896354",
"score": "0.75973624",
"text": "def logged_in_admin?\n !current_user.nil? && current_user.role == 1\n end",
"title": ""
},
{
"docid": "5926a1a29b704fcdd09150237a1f9c93",
"score": "0.75959057",
"text": "def admin?\n if (User.find_by_login(session[:login]).is_admin rescue nil)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "16690eb77b2fca7c80fc986610425fa8",
"score": "0.75949705",
"text": "def logged_in_admin?\n !current_admin.nil?\n end",
"title": ""
},
{
"docid": "821f74ea457b979cd89e4b02dd6eacfd",
"score": "0.75928867",
"text": "def admin?\n if current_user.role == 'Admin'\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "59bf473b4d2e3272fde6763be80dcb59",
"score": "0.7584478",
"text": "def evaluated_as_admin?\n return false if params.key?(:on_behalf_of)\n current_user.admin?\n end",
"title": ""
},
{
"docid": "1c18cba97b1470023f8cde921f73925e",
"score": "0.7570191",
"text": "def admin_signed_in?\n if user_signed_in? && current_user.admin\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "8e980bf31db7e6a72b3e2695ce06ce45",
"score": "0.75698537",
"text": "def admin?\n current_user? && current_user.admin?\n end",
"title": ""
},
{
"docid": "652c1b2aa1b0a16cccf9a2b69534a1c3",
"score": "0.75594664",
"text": "def admin_user?\n current_user == 'akiyama'\n end",
"title": ""
},
{
"docid": "72fc3ea446b70554813505902f13c1e1",
"score": "0.7559043",
"text": "def is_admin?\n\t\t!current_user.nil? && current_user.id == 1\n\tend",
"title": ""
},
{
"docid": "48f9c00f0f6abe58308a2875e3761156",
"score": "0.7554964",
"text": "def is_admin?\n signed_in? ? current_user.admin : false\n end",
"title": ""
},
{
"docid": "668343c0bd9e03cdfd7b5cff2f1439f2",
"score": "0.7554448",
"text": "def system_admin?\n logged_in? && current_user.system_admin? && current_user.enabled? && current_user.activated?\n end",
"title": ""
},
{
"docid": "c581c4c7def4e4bb7bfccac89933d00a",
"score": "0.7552663",
"text": "def admin?\n User.admin_logged_in?\n end",
"title": ""
},
{
"docid": "275167b02ba24291d9106ff380dcec44",
"score": "0.7552117",
"text": "def system_admin?\n current_user && current_user.system_admin?\n end",
"title": ""
},
{
"docid": "91031b031e67e11218bd2f95feb97424",
"score": "0.75510347",
"text": "def current_user_is_admin?\n current_user.is_admin?\n end",
"title": ""
},
{
"docid": "e9e64fa2bb147df7c462ca99f2d3956c",
"score": "0.75476104",
"text": "def context_admin?\n has_exact_role?('Administrator') || has_exact_role?('urn:lti:role:ims/lis/Administrator')\n end",
"title": ""
},
{
"docid": "3081093b74734992e6795227c3d6a424",
"score": "0.7543656",
"text": "def admin?\n Service.is_user_admin?\n end",
"title": ""
},
{
"docid": "3081093b74734992e6795227c3d6a424",
"score": "0.7543656",
"text": "def admin?\n Service.is_user_admin?\n end",
"title": ""
},
{
"docid": "6c90d4c1273ea09ca2fd71d6c7dc506c",
"score": "0.754187",
"text": "def current_admin?(user)\n user.current_organizations.include?(self)\n end",
"title": ""
},
{
"docid": "58d8b960bf9b9fc703ae425178edb807",
"score": "0.75412923",
"text": "def is_admin?\n if current_user\n return true if current_user.is_admin?\n end\n end",
"title": ""
},
{
"docid": "95c2e592d27f80bfed1753fe3b4957e0",
"score": "0.7540819",
"text": "def admin?\n \tif current_user.role == \"admin\"\n \t\treturn true\n \tend\n end",
"title": ""
},
{
"docid": "72ad2ac9147c2eecc3bac8e7d2bbce6b",
"score": "0.7540209",
"text": "def admin?\n\t\tcurrent_user.admin == true\n\tend",
"title": ""
},
{
"docid": "6ef86dee4a01caf6afde132e95ed4b3b",
"score": "0.7536",
"text": "def admin_signed_in?\n user_signed_in? && current_user.admin?\n end",
"title": ""
},
{
"docid": "4226b0afa8b587b62b0da4ff4f840427",
"score": "0.7534432",
"text": "def is_admin?\n current_user && current_user.starts_with?('admin')\n end",
"title": ""
},
{
"docid": "3ac5c7bf17f92ab8616d12443c9410a8",
"score": "0.75342613",
"text": "def admin?\n\t\t\tif logged_in?\n\t\t\t\tUser.find_by(id: session[:user_id]).role == 'admin'\n\t\t\tend\n\n\tend",
"title": ""
},
{
"docid": "628b7cc59ad791f144eb338164c59fc4",
"score": "0.75337213",
"text": "def admin?\n\t\tresult = Admin.find_by_samaccountname(self.username)\n\t\tif !result.nil? || self.username == ENV['default_admin']\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "718bd23c33c422f4257e1976ad20e86d",
"score": "0.75322944",
"text": "def current_user_admin\n current_user.admin?\n end",
"title": ""
},
{
"docid": "b88d69a9072bfbc951dc8c9ed6b69e9d",
"score": "0.7530769",
"text": "def admin_signed_in?\n user_signed_in? and current_user.admin?\n end",
"title": ""
},
{
"docid": "67bea6b2dd35697ca3d4fd93539a58e0",
"score": "0.7530179",
"text": "def admin_present?\n\t\trole = current_user.role\n\t\treturn role.downcase == \"admin\"\n\tend",
"title": ""
},
{
"docid": "67764a75f0d2e1adeb48f0d11c193450",
"score": "0.75281763",
"text": "def admin_user?\n return true if current_user.email == 'samatov.dilshod@gmail.com' && Rails.env.production?\n return false if Rails.env.production?\n true\n end",
"title": ""
},
{
"docid": "aa01d2f451a42e622eb2412cee215eca",
"score": "0.7520564",
"text": "def user_has_admin_access?\n return ((not current_user.nil?) and (current_user.admin? or current_user.moderator?))\n end",
"title": ""
},
{
"docid": "ac6a6b8ef5afb13eb0056c6b8a09d20e",
"score": "0.7516744",
"text": "def has_admin?\n has_auth? && current_person.is_admin\n end",
"title": ""
}
] |
ea93d558d230096946e521e7ffc1c193
|
returns [Boolean] True when validation passed
|
[
{
"docid": "21d466eada306a358a23c88fef0111db",
"score": "0.0",
"text": "def validate\n validate_params\n validate_colour\n validate_coordinates\n validate_dimension\n end",
"title": ""
}
] |
[
{
"docid": "c75ff69fc974f4adee454c385f652c1b",
"score": "0.861637",
"text": "def valid?\n return validate\n end",
"title": ""
},
{
"docid": "b8c9ad3787c00e09b2d29227e5e7ef5f",
"score": "0.857561",
"text": "def valid?\n validate\n end",
"title": ""
},
{
"docid": "6277243dfb055a5a926a11a6022b4154",
"score": "0.8542693",
"text": "def valid?\n begin\n validate\n true\n rescue\n false\n end\n end",
"title": ""
},
{
"docid": "e04ebf1724720ba15e6953ce42624bc4",
"score": "0.85345167",
"text": "def validate?\n !!validation\n end",
"title": ""
},
{
"docid": "72b29026b54616f43226513371c68d0d",
"score": "0.851573",
"text": "def is_valid\n self.set_errors\n\n if @errors.length > 0\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "af7fa5e40756a9ba4cb4d6558d65d387",
"score": "0.8475905",
"text": "def valid?\n validate!\n true\n rescue\n false\n end",
"title": ""
},
{
"docid": "8a7ea4e48d7140985465e9ae8559c6fc",
"score": "0.84544843",
"text": "def valid?\n run_validation\n @errors.empty?\n end",
"title": ""
},
{
"docid": "d9420475cf4201424aac528d45927605",
"score": "0.83987045",
"text": "def valid?\n validate\n errors.empty?\n end",
"title": ""
},
{
"docid": "1396ae2bf52105603174dd5677edc4f5",
"score": "0.83848745",
"text": "def validate?\n !@valid.nil?\n end",
"title": ""
},
{
"docid": "d27035227fa84f55d6b8a034042d0a87",
"score": "0.8380801",
"text": "def validate\n valid?\n end",
"title": ""
},
{
"docid": "cf0a17daf0f947547009bb235c3dbf01",
"score": "0.83801293",
"text": "def valid?\n validate\n @errors.empty?\n end",
"title": ""
},
{
"docid": "a5063af3bd14bbba624f6243defea4a3",
"score": "0.8330427",
"text": "def is_valid\n \tself.set_errors\n \tif @errors.length > 0\n \treturn false\n \telse\n \treturn true\n \tend\n \tend",
"title": ""
},
{
"docid": "6790dee51ff871fc2871bb850275962b",
"score": "0.83093655",
"text": "def valid?\r\n @valid\r\n end",
"title": ""
},
{
"docid": "46ff5ebc957548904ff4e892f7d4a043",
"score": "0.8307573",
"text": "def valid?\n validate\n @errors.empty?\n end",
"title": ""
},
{
"docid": "6e0f98cf0301c1828331a4da96ea26bc",
"score": "0.8304471",
"text": "def valid?\r\n @valid\r\n end",
"title": ""
},
{
"docid": "285784678396e5ab9535b29a9c479e25",
"score": "0.8302788",
"text": "def valid?\n validate.empty?\n end",
"title": ""
},
{
"docid": "285784678396e5ab9535b29a9c479e25",
"score": "0.8302788",
"text": "def valid?\n validate.empty?\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "e1e228a92b4efaa2ab3f22352d3f7431",
"score": "0.82846546",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "ab635f7627eaa68a4608cbc628c6794e",
"score": "0.8283609",
"text": "def valid?\n validate.empty?\n end",
"title": ""
},
{
"docid": "ab635f7627eaa68a4608cbc628c6794e",
"score": "0.8283609",
"text": "def valid?\n validate.empty?\n end",
"title": ""
},
{
"docid": "02d44bf56988ab021363f8a8acabb66c",
"score": "0.82751226",
"text": "def valid?\n @valid\n end",
"title": ""
},
{
"docid": "02d44bf56988ab021363f8a8acabb66c",
"score": "0.82751226",
"text": "def valid?\n @valid\n end",
"title": ""
},
{
"docid": "02d44bf56988ab021363f8a8acabb66c",
"score": "0.82751226",
"text": "def valid?\n @valid\n end",
"title": ""
},
{
"docid": "02d44bf56988ab021363f8a8acabb66c",
"score": "0.82751226",
"text": "def valid?\n @valid\n end",
"title": ""
},
{
"docid": "80429a6a68067d7cdbc0d024d6872b8a",
"score": "0.82673925",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "bdf2c2da2960edf8a40718e50fd16977",
"score": "0.82626355",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "bdf2c2da2960edf8a40718e50fd16977",
"score": "0.82626355",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "bdf2c2da2960edf8a40718e50fd16977",
"score": "0.82626355",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "bdf2c2da2960edf8a40718e50fd16977",
"score": "0.82626355",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "bdf2c2da2960edf8a40718e50fd16977",
"score": "0.82626355",
"text": "def valid?\n return true\n end",
"title": ""
},
{
"docid": "48450743336fd1505378ed264606a9c6",
"score": "0.82565343",
"text": "def valid?\n @valid\n end",
"title": ""
},
{
"docid": "48450743336fd1505378ed264606a9c6",
"score": "0.82565343",
"text": "def valid?\n @valid\n end",
"title": ""
},
{
"docid": "48450743336fd1505378ed264606a9c6",
"score": "0.82565343",
"text": "def valid?\n @valid\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
},
{
"docid": "eb3026600e2325c5fc48b9af9bc1323d",
"score": "0.8252817",
"text": "def valid?\n true\n end",
"title": ""
}
] |
5005acc115c8b805faa6b137b90652d6
|
GET /product_sliders/1 GET /product_sliders/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "3d7537c79502e8281a15d26c9319768d",
"score": "0.6842047",
"text": "def index\n @food_sliders = FoodSlider.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @food_sliders }\n end\n end",
"title": ""
},
{
"docid": "2eb42abb2baf9ae06bb76418da366433",
"score": "0.6780983",
"text": "def index\n @product_sliders = @current_branch.product_sliders\n end",
"title": ""
},
{
"docid": "5c46ac614e29fb58b806895fef91209f",
"score": "0.66569936",
"text": "def show\n @food_slider = FoodSlider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food_slider }\n end\n end",
"title": ""
},
{
"docid": "ce5f67cb27efea367bef0feffc71d99b",
"score": "0.6593336",
"text": "def show\n @admin_slider_item = SliderItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_slider_item }\n end\n end",
"title": ""
},
{
"docid": "b08de27b08a5ac9aed73ba7f5bbeda88",
"score": "0.6589511",
"text": "def set_product_slider\n @product_slider = @current_branch.product_sliders.find(params[:id])\n end",
"title": ""
},
{
"docid": "544f8dbef13f06d49bb5de52642eeb69",
"score": "0.6464059",
"text": "def index\n @sliders = Slider::Carrousel.all\n end",
"title": ""
},
{
"docid": "00c9ea7c103aae1ffccc50b97f6c8429",
"score": "0.64463997",
"text": "def index\n @image_sliders = ImageSlider.all\n end",
"title": ""
},
{
"docid": "f30462e8c9bbeb8b7b6e8d0caeb2e6e6",
"score": "0.6419553",
"text": "def show\n @slider_image = SliderImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slider_image }\n end\n end",
"title": ""
},
{
"docid": "f30462e8c9bbeb8b7b6e8d0caeb2e6e6",
"score": "0.6419553",
"text": "def show\n @slider_image = SliderImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slider_image }\n end\n end",
"title": ""
},
{
"docid": "c35e583ae7d18da1dabd168aae091818",
"score": "0.6393823",
"text": "def index\n @main_sliders = MainSlider.all\n end",
"title": ""
},
{
"docid": "d7a3597dfbd3c83516d09e5dbf41c4a6",
"score": "0.63849413",
"text": "def index\n @admin_slider_items = SliderItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_slider_items }\n end\n end",
"title": ""
},
{
"docid": "d90563b30505d2ba7d91db683600fbfd",
"score": "0.63150257",
"text": "def index\n @slider_servs = SliderServ.all\n end",
"title": ""
},
{
"docid": "974108a9d1fa2b5609be99ebfe96daf4",
"score": "0.6268661",
"text": "def index\n @slider_images = SliderImage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slider_images }\n end\n end",
"title": ""
},
{
"docid": "e75115e9e9b68f8d07a87bf6be00d2a1",
"score": "0.62441266",
"text": "def index\n @slider_images = @selected_template.spree_slider_images\n @slider = Spree::SliderImage.new\n end",
"title": ""
},
{
"docid": "37d74641aebfded6706e66c2a2d94ab7",
"score": "0.6237561",
"text": "def index\n @branch_sliders = @current_shop.branch_sliders\n end",
"title": ""
},
{
"docid": "bf26bf0a88b2c417a7033307ced436cb",
"score": "0.60779244",
"text": "def show\n @slideshow = Slideshow.find(params[:id])\n @slides = @slideshow.slides\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow }\n end\n end",
"title": ""
},
{
"docid": "4a8536c71da97a713153d862e8bdaf66",
"score": "0.6053412",
"text": "def index\n @product_images = ProductImage.where(product_uuid: params[:product_id])\n render json: @product_images, status: 200\n end",
"title": ""
},
{
"docid": "fdeac416ec4d45e8fc0ba158a4e8b7be",
"score": "0.60238695",
"text": "def index\n @slider_image_types = SliderImageType.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slider_images }\n end\n end",
"title": ""
},
{
"docid": "c5646d33b39135d425e877a36658664d",
"score": "0.60060126",
"text": "def show\n @slide = Slide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "c5646d33b39135d425e877a36658664d",
"score": "0.60060126",
"text": "def show\n @slide = Slide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "c5646d33b39135d425e877a36658664d",
"score": "0.60060126",
"text": "def show\n @slide = Slide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "8ff28c9ff9c254503d27c003ce5205d3",
"score": "0.59666497",
"text": "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_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 render json: @products\n end\n end",
"title": ""
},
{
"docid": "cb5692caf0e8d1ab39535442796a9ce1",
"score": "0.5965174",
"text": "def new\n @admin_slider_item = SliderItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_slider_item }\n end\n end",
"title": ""
},
{
"docid": "39d9605f7ba12d64d8ece4171cdaa43d",
"score": "0.5955737",
"text": "def set_slider\n @slider = Slider.find(params[:id])\n end",
"title": ""
},
{
"docid": "45adaca82f691afd3d63d546d65154b8",
"score": "0.5954065",
"text": "def show\n @slide_image = SlideImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slide_image }\n end\n end",
"title": ""
},
{
"docid": "3503e75535ccbeba6849aee931bb6e9d",
"score": "0.59342045",
"text": "def index\n @api_v1_products = Product.all\n json_response(@api_v1_products)\n end",
"title": ""
},
{
"docid": "3da1e265a64a0fae598fe0b199ba56e2",
"score": "0.5921939",
"text": "def show\n @slideshow_item = SlideshowItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow_item }\n end\n end",
"title": ""
},
{
"docid": "af89e601e018b2b87770efbb2f2cf870",
"score": "0.5906716",
"text": "def new\n @food_slider = FoodSlider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @food_slider }\n end\n end",
"title": ""
},
{
"docid": "1f14a8cbedc11c06891b507c0edc14ca",
"score": "0.5900697",
"text": "def show\n @rating_scale_step = RatingScaleStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rating_scale_step }\n end\n end",
"title": ""
},
{
"docid": "96c08a57a79a8124cd1049f8ba1dafd1",
"score": "0.5893832",
"text": "def show\n @product_series = ProductSeries.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_series }\n end\n end",
"title": ""
},
{
"docid": "a748d686a3cb0ae22387b212ed82af4d",
"score": "0.58823967",
"text": "def index\n @user_interactive_products = UserInteractiveProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_interactive_products }\n end\n end",
"title": ""
},
{
"docid": "99615caa1ca0dba664dd5b4e415a7940",
"score": "0.58742434",
"text": "def show\n @page_slide = Slide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page_slide }\n end\n end",
"title": ""
},
{
"docid": "f45cf8d17f217feb7e1520578f86aa81",
"score": "0.58733755",
"text": "def show\n @slideshow = Slideshow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow }\n end\n end",
"title": ""
},
{
"docid": "f45cf8d17f217feb7e1520578f86aa81",
"score": "0.58733755",
"text": "def show\n @slideshow = Slideshow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow }\n end\n end",
"title": ""
},
{
"docid": "19210ddea6e3a8d6d95c4ca55b670259",
"score": "0.5864924",
"text": "def show\n json_response(@api_v1_product)\n end",
"title": ""
},
{
"docid": "53b99c4ec86ba709e7ff11821bdf0f6a",
"score": "0.5844088",
"text": "def set_slider_serv\n @slider_serv = SliderServ.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a9b681b4df68f630dfc374f7110228d",
"score": "0.5841111",
"text": "def index\n @logical_products = LogicalProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @logical_products }\n end\n end",
"title": ""
},
{
"docid": "428d645569d5ea06426f772572a92d89",
"score": "0.5837043",
"text": "def create\n @product_slider = @current_branch.product_sliders.build(product_slider_params)\n\n respond_to do |format|\n if @product_slider.save\n format.html { redirect_to backend_shop_branch_product_slider_path(@current_shop.slug, @current_branch, @product_slider), notice: '产品幻灯片成功创建.' }\n format.json { render action: 'show', status: :created, location: @product_slider }\n else\n format.html { render action: 'new' }\n format.json { render json: @product_slider.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7ff98db2d24e79b2293a97e776f32ec",
"score": "0.58246505",
"text": "def show\n @pro_wmall_slide_picture = Wmall::SlidePicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pro_wmall_slide_picture }\n end\n end",
"title": ""
},
{
"docid": "2ecdd8b7ee60733304ad9e335ade6dcf",
"score": "0.5794238",
"text": "def index\n get_sparepart\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n format.js\n end\n end",
"title": ""
},
{
"docid": "cbe9bfc8528a9100c5ab5f78e23a528f",
"score": "0.5781159",
"text": "def show\n @product = Product.find(params[:id])\n json_response(params)\n end",
"title": ""
},
{
"docid": "cda9cc6ce501e0759ebd220bb0d15c09",
"score": "0.57793903",
"text": "def product(name)\n get(\"/apiproducts/#{name}\")\n end",
"title": ""
},
{
"docid": "a28e7bd54db8352a544d8e16148a872d",
"score": "0.57646525",
"text": "def new\n @slider_image = SliderImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slider_image }\n end\n end",
"title": ""
},
{
"docid": "a28e7bd54db8352a544d8e16148a872d",
"score": "0.57646525",
"text": "def new\n @slider_image = SliderImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slider_image }\n end\n end",
"title": ""
},
{
"docid": "39954a9004383ebadcde3635937e7b58",
"score": "0.57605344",
"text": "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end",
"title": ""
},
{
"docid": "bde33ea78ab3b931b5d3a3f571943bc1",
"score": "0.5751042",
"text": "def index\n limit = params[:limit]&.to_i || 10\n page = params[:page]&.to_i || 0\n if params[:available] == \"1\"\n @products = Product.paginate(page, limit).available\n else\n @products = Product.paginate(page, limit)\n end\n render json: @products\n end",
"title": ""
},
{
"docid": "79f9128fd8d4fd255374bc4ba6f0c9a6",
"score": "0.5744503",
"text": "def product_slider_params\n params.require(:product_slider).permit(:img, :desc, :position, :product_id)\n end",
"title": ""
},
{
"docid": "fd872907eafc1e4ecae3f32975d12906",
"score": "0.5739511",
"text": "def show\n product = Product.find_by_id(params[:id])\n\n render json: product\n end",
"title": ""
},
{
"docid": "4c69385291cdf302a722e7bd92fe6e18",
"score": "0.57390845",
"text": "def index\n before_filter { |c| c.include_stylesheet 'admin/extensions/shop/products/products' }\n before_filter { |c| c.include_javascript 'admin/pagefactory' }\n @shop_products = ShopProduct.search(params[:query])\n \n unless @shop_products.empty?\n @radiant_layout = Radiant::Config['shop.category_layout']\n\n respond_to do |format|\n format.html { render }\n format.js { render :partial => '/shop/products/products', :collection => @shop_products }\n format.xml { render :xml => @shop_products.to_xml(attr_hash) }\n format.json { render :json => @shop_products.to_json(attr_hash) }\n end\n else\n render :template => 'site/not_found', :status => 404\n end\n end",
"title": ""
},
{
"docid": "45261971ac8a9608bd635907c1d005b4",
"score": "0.5737095",
"text": "def show\n @product_lot = ProductLot.find(params[:id])\n render json: @product_lot, root: false\n end",
"title": ""
},
{
"docid": "15487489fda1615d234261cbdb26c863",
"score": "0.5726417",
"text": "def index\n @products = Product.all\n render json: @products\n end",
"title": ""
},
{
"docid": "c7e306647bbc87b76cfdfa27a2093dd1",
"score": "0.5717403",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventories }\n end\n end",
"title": ""
},
{
"docid": "c15e26856d1c0bf482da05f023949c3e",
"score": "0.57129097",
"text": "def index\n \tproducts = Product.all\n \trender json: products\n \tend",
"title": ""
},
{
"docid": "b40f68ded0e4e20ea636542bf8f566cb",
"score": "0.5705025",
"text": "def set_slider_image\n @slider_image = Spree::SliderImage.find(params[:id])\n end",
"title": ""
},
{
"docid": "1868906cb77b368d3979acb562fd48f1",
"score": "0.56963414",
"text": "def index\n @sliders = Slider.sorted\n end",
"title": ""
},
{
"docid": "34b2ee5c83e7565ea25f57d84bc93e58",
"score": "0.5685585",
"text": "def get_variant\n @product = Spree::Product.find_by :slug => params[:product_id]\n @variant = @product.find_variant_by_options(params[:ids].split(','))\n if @variant\n respond_to do |format|\n format.json {render json: {variant_id: @variant.id, image_ids: @variant.image_ids}}\n end\n end\n end",
"title": ""
},
{
"docid": "d80cac1f83a709c3b4d5f4a3996c28ee",
"score": "0.5655117",
"text": "def index\n @thumbs = Thumb.all\n\n render json: @thumbs\n end",
"title": ""
},
{
"docid": "5255c70754e7f7092da2c4f6eefcac72",
"score": "0.5647541",
"text": "def set_image_slider\n @image_slider = ImageSlider.find(params[:id])\n end",
"title": ""
},
{
"docid": "92a6a3f0560926e9e04fa5a12e077863",
"score": "0.5630773",
"text": "def getKind\n @products = Product.where(\"kind = ?\", params[:kind]).available.PriceOrder.paginate(page: params[:page], per_page: 5)\n render json: @products\n end",
"title": ""
},
{
"docid": "9c065f81ee5f7c39ee9075914f0f0bca",
"score": "0.5627515",
"text": "def index\n @products = Product.all\n respond_to do |format|\n format.html\n format.json { render :json => @product }\n end\n end",
"title": ""
},
{
"docid": "c1131125291b7d642c8bc0fc87fddf57",
"score": "0.5621063",
"text": "def show\n render json: @product, status: 200\n end",
"title": ""
},
{
"docid": "a20d21f1638e31392b722775373fc843",
"score": "0.561628",
"text": "def set_lider\n @lider = Lider.find(params[:id])\n end",
"title": ""
},
{
"docid": "6c6d68ac040b13bec98600ae91067da9",
"score": "0.56115913",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end",
"title": ""
},
{
"docid": "6c6d68ac040b13bec98600ae91067da9",
"score": "0.56115913",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end",
"title": ""
},
{
"docid": "6c6d68ac040b13bec98600ae91067da9",
"score": "0.56115913",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end",
"title": ""
},
{
"docid": "6c6d68ac040b13bec98600ae91067da9",
"score": "0.5610383",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end",
"title": ""
},
{
"docid": "32ad349eff589ac48e0d24f8e91d39ab",
"score": "0.5608816",
"text": "def show\n @product_price = ProductPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_price }\n end\n end",
"title": ""
},
{
"docid": "b87484a56cba3da8597b9e04bf9c47bf",
"score": "0.5602784",
"text": "def show\n render json: @product\n end",
"title": ""
},
{
"docid": "4132c517ea859d25dbe493cd50adb457",
"score": "0.5593192",
"text": "def show\n @user_interactive_product = UserInteractiveProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_interactive_product }\n end\n end",
"title": ""
},
{
"docid": "3738741b91e2c274e3a6b0b7bac7605c",
"score": "0.5592999",
"text": "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end",
"title": ""
},
{
"docid": "13a0b8045090cf1c301bcb56793a9a07",
"score": "0.55864865",
"text": "def getListProducts\n $products=Product.where(retire_note_id: params[:id])\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "5ee7028e07bd5c90cb35b486acd71a97",
"score": "0.55848116",
"text": "def new\n @pslide = Pslide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pslide }\n end\n end",
"title": ""
},
{
"docid": "a48a8f5abcada6a4a53dfcb675407427",
"score": "0.55712104",
"text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "a48a8f5abcada6a4a53dfcb675407427",
"score": "0.55712104",
"text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "a48a8f5abcada6a4a53dfcb675407427",
"score": "0.55712104",
"text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "6c8d7e4dcd0a6d46362e62a643bbf326",
"score": "0.556819",
"text": "def show\n render json: @product\n end",
"title": ""
},
{
"docid": "6e4eb72a7bb0305250690b76ff27818f",
"score": "0.55674046",
"text": "def index\n @mixproductos = Mixproducto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mixproductos }\n end\n end",
"title": ""
},
{
"docid": "f25e4b3c0458b3627a0a4d71dc41a322",
"score": "0.55665076",
"text": "def show\n @carousel_slides = @carousel.carousel_slides\n end",
"title": ""
},
{
"docid": "ca2505d77a30a229da977ec6ddf7a596",
"score": "0.55656976",
"text": "def products\n request :public, :get, :products\n end",
"title": ""
},
{
"docid": "901a4797f4d33199ced17e8fd0fb4dfb",
"score": "0.55651724",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end",
"title": ""
},
{
"docid": "901a4797f4d33199ced17e8fd0fb4dfb",
"score": "0.55651724",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end",
"title": ""
},
{
"docid": "901a4797f4d33199ced17e8fd0fb4dfb",
"score": "0.55651724",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end",
"title": ""
},
{
"docid": "901a4797f4d33199ced17e8fd0fb4dfb",
"score": "0.55651724",
"text": "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end",
"title": ""
},
{
"docid": "ba8a360fc08979573777213c89917c24",
"score": "0.55648893",
"text": "def index\n @slides = Slide.all\n end",
"title": ""
},
{
"docid": "6a5a5406c53b4f39fc8056a3dba06c1a",
"score": "0.5561937",
"text": "def index\n @lighting_products = LightingProduct.all\n end",
"title": ""
},
{
"docid": "6a5a5406c53b4f39fc8056a3dba06c1a",
"score": "0.5561937",
"text": "def index\n @lighting_products = LightingProduct.all\n end",
"title": ""
},
{
"docid": "ebc58d87a16c591cdfe7c5c829eaaeea",
"score": "0.5555987",
"text": "def index\n begin\n @products = Product.all\n render json: @products, status: 200\n rescue => exception\n render json: { errors: exception }\n end\n end",
"title": ""
},
{
"docid": "92d87189ba3298b171f77c895073d717",
"score": "0.5549734",
"text": "def show\n @shopifyproduct = Shopifyproduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shopifyproduct }\n end\n end",
"title": ""
},
{
"docid": "a5fb6f838d9a5f9cd41883c9e0794e0f",
"score": "0.5542131",
"text": "def show\n render json: @pricing\n end",
"title": ""
},
{
"docid": "4eed994508f6cb3d6e9dd4a440830d8a",
"score": "0.5536753",
"text": "def index\n @products = get_products\n \n respond_to do |format|\n format.html # index.html.haml\n format.js # index.js.rjs\n format.xml { render :xml => @products }\n end\n end",
"title": ""
},
{
"docid": "3ecc00117e5a0474c987651dea0b0fce",
"score": "0.55327874",
"text": "def show\n @product = Product.find(params[:id])\n render json: @product, status: :ok\n end",
"title": ""
},
{
"docid": "d34707f6fc7807dae03b895aec9ab0fd",
"score": "0.5528623",
"text": "def show\n render :json => Producto.find(params[:id])\n end",
"title": ""
},
{
"docid": "245d838ee2f627fecbda6da74f595bb3",
"score": "0.5527357",
"text": "def index\n if params[:search]\n filtering_params = params[:search].slice(:search_string, :category, :product_format, :language, :price_above, :price_below, :sale_or_rent, :pages_above, :pages_below)\n @products = Product.filter(filtering_params).order(\"updated_at DESC\").paginate(page: params[:page])\n else \n @products = Product.order(\"updated_at DESC\").paginate(page: params[:page])\n end\n @images = Dir.glob(\"app/assets/images/slides/*.jpg\")\n respond_to do |format|\n format.html\n format.js\n end\n end",
"title": ""
},
{
"docid": "563e03a22e290bd421841fea2cf315a1",
"score": "0.55268395",
"text": "def update\n respond_to do |format|\n if @product_slider.update(product_slider_params)\n format.html { redirect_to backend_shop_branch_product_slider_path(@current_shop.slug, @current_branch, @product_slider), notice: '产品幻灯片成功更新.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product_slider.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9559e8d09288528c70dc48c620906f85",
"score": "0.5519184",
"text": "def show\n @star_product = Star::Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @star_product }\n end\n end",
"title": ""
},
{
"docid": "ac5ae72dcf7795fa4202e565f7bad5c3",
"score": "0.55062234",
"text": "def index\r\n @product_periods = ProductPeriod.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @product_periods }\r\n end\r\n end",
"title": ""
},
{
"docid": "8b628a6cb54c59730bee1295bfc8a336",
"score": "0.55060625",
"text": "def show\n render json: @product_management\n end",
"title": ""
},
{
"docid": "d30f7c365bc8d4d3dfef94d966efe9c4",
"score": "0.5501099",
"text": "def index\n render :json => Producto.all\n end",
"title": ""
},
{
"docid": "c4c18cbbb7ebe8da84d1264bc7bd7520",
"score": "0.5499041",
"text": "def set_api_v1_product\n begin\n @api_v1_product = Product.find(params[:id])\n rescue => ex\n json_response({error: ex.message}, :not_found)\n end\n end",
"title": ""
},
{
"docid": "f4778b977254735c05948bec43b21062",
"score": "0.5496776",
"text": "def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end",
"title": ""
},
{
"docid": "c17eab94e53a2705274eb488470e47f9",
"score": "0.54939663",
"text": "def index\n @sales_productivities = SalesProductivity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sales_productivities }\n end\n end",
"title": ""
}
] |
0a5d9ed86d46026b7e534ffc503648be
|
convert everything to a string so it can be written to a file
|
[
{
"docid": "ebbcea1952763a65598125835d9f7039",
"score": "0.0",
"text": "def to_s()\n lines = []\n\n # go through each of the config lines, if the line number is in new_conf_lookup\n # it means we've changed it so we will use those lines instead of the original\n # lines. If we encounter a line number that isn't in new_conf_lookup but is\n # in new_conf_ignore we will just skip passed it\n @conf_lines.each_with_index do |conf_line, index|\n if @new_conf_lookup.has_key?(index)\n lines.concat(@new_conf_lookup[index])\n else\n if !@new_conf_ignore.member?(index)\n lines << conf_line\n end\n end\n end\n\n return lines.join(\"\\n\")\n\n end",
"title": ""
}
] |
[
{
"docid": "15968a33c079f19bed80de8636658866",
"score": "0.7259721",
"text": "def to_s(file = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7b13d3ab162c98099faab85d5b098637",
"score": "0.69449085",
"text": "def to_s\n [ super.chop,\n \"@filepath=\\\"#{@filepath}\\\",\", \n \"charset=#{self.charset},\", \n \"type=#{self.type}>\" ].join(' ')\n end",
"title": ""
},
{
"docid": "d02288bd9453ce5b998e22c30d9cbd60",
"score": "0.691695",
"text": "def to_s\n io = StringIO.new\n write(io)\n io.string\n end",
"title": ""
},
{
"docid": "23847b0c58ee515bf271ce2c1e54c30d",
"score": "0.68840766",
"text": "def to_s\n \"{#{@name};#{@file}}\"\n end",
"title": ""
},
{
"docid": "23847b0c58ee515bf271ce2c1e54c30d",
"score": "0.68840766",
"text": "def to_s\n \"{#{@name};#{@file}}\"\n end",
"title": ""
},
{
"docid": "54bd8ae7e61c3888e6e778d601d1d9d1",
"score": "0.6838966",
"text": "def write_to(path,str);end",
"title": ""
},
{
"docid": "54bd8ae7e61c3888e6e778d601d1d9d1",
"score": "0.6838966",
"text": "def write_to(path,str);end",
"title": ""
},
{
"docid": "0c95355320e57a8f2a6fc9fc745401df",
"score": "0.6837902",
"text": "def to_string\n io.string\n end",
"title": ""
},
{
"docid": "b8c6ed7e1004782edac4b4acbd96031e",
"score": "0.6831009",
"text": "def to_s\n stringio = StringIO.new\n output(stringio)\n stringio.string\n end",
"title": ""
},
{
"docid": "23364cc0f6f16772b0c109eeef538326",
"score": "0.6823782",
"text": "def to_s\n to_string_io.string\n end",
"title": ""
},
{
"docid": "d03f236b9366582f317edf2f59b11bf2",
"score": "0.6777673",
"text": "def to_s\n io = StringIO.new\n export_to(io)\n io.string\n end",
"title": ""
},
{
"docid": "e552fda37a730c9e3bae834ea26df25a",
"score": "0.67537785",
"text": "def to_string; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "ffd5f041d0373e45648edf13d531703d",
"score": "0.6675218",
"text": "def to_str; end",
"title": ""
},
{
"docid": "cdf08074e3c735adca9cb9fa593ab101",
"score": "0.6672271",
"text": "def convert_to_string_and_write(output_array)\n final_output = \"\"\n output_array.each { |n| final_output << n }\n @reader.writes(final_output)\n puts \"Created #{ARGV[1]} containing #{final_output.length} characters.\"\n end",
"title": ""
},
{
"docid": "fadb2b1a80237da0c5e64f586cfa696a",
"score": "0.66603625",
"text": "def to_file; end",
"title": ""
},
{
"docid": "5953ad1ee54980d0c37ef83ac4d50efb",
"score": "0.6638072",
"text": "def fileToString(file)\n \n data = ''\n f = File.open(file, \"r\")\n f.each_line do |line|\n data += line\n end\n return data\nend",
"title": ""
},
{
"docid": "96b57acdddc7d9d9141ef72e73c9ce76",
"score": "0.6623542",
"text": "def to_s\n l = ''\n lines.each do |line|\n l += \"#{line}\\r\\n\"\n end\n l.chomp\n end",
"title": ""
},
{
"docid": "96b57acdddc7d9d9141ef72e73c9ce76",
"score": "0.6623542",
"text": "def to_s\n l = ''\n lines.each do |line|\n l += \"#{line}\\r\\n\"\n end\n l.chomp\n end",
"title": ""
},
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.6564833",
"text": "def to_s() end",
"title": ""
},
{
"docid": "e3b0cd6d45284ce1f942499debb5ba13",
"score": "0.6520884",
"text": "def toFileString\n\t\t@time.to_i.to_s + \" , \" + @url.to_s + \" , \" + @ref.to_s\n\tend",
"title": ""
},
{
"docid": "abe644c681a52fe5b8b1359745d5630c",
"score": "0.65078133",
"text": "def to_s\n text = \"\\\"\\\"\\\"#{content_type_output_string}\\n\"\n text << contents_output_string\n text << '\"\"\"'\n end",
"title": ""
},
{
"docid": "e2605bc7a2f9b5ea50adaa22fbf273e6",
"score": "0.6500897",
"text": "def to_s\n assert_exists\n return string_creator.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "e2605bc7a2f9b5ea50adaa22fbf273e6",
"score": "0.6500897",
"text": "def to_s\n assert_exists\n return string_creator.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "79dfa2977dab7665cf41d6ebbac5ae31",
"score": "0.6496575",
"text": "def to_string_io\n sio = StringIO.new\n write_to_io( sio )\n return sio\n end",
"title": ""
},
{
"docid": "153f3ffc38acf29ee97212fad99a04fe",
"score": "0.6480977",
"text": "def to_file(file)\n file.write(to_s)\n end",
"title": ""
},
{
"docid": "c2d0303f9d78f8547c64607c60f97b2a",
"score": "0.6466016",
"text": "def to_s = @data.to_s",
"title": ""
},
{
"docid": "cd85983767bcfbad65a376560bace9f5",
"score": "0.6447438",
"text": "def to_strio\n self\n end",
"title": ""
},
{
"docid": "8ec8960cf516a484e4cc4ca87283fa9a",
"score": "0.6443676",
"text": "def convert_to_string(ins)\n string = \"\"\n #puts \"convert_to_string...\"\n ins.each do |line|\n string << line\n #p line\n end\n return string\nend",
"title": ""
},
{
"docid": "17ee24cf30a4faa9c1e6baf2cecc8c65",
"score": "0.64227086",
"text": "def to_s\n contents.flatten.join\n end",
"title": ""
},
{
"docid": "9b70145dd8887e769f2f54795262d6b0",
"score": "0.6402159",
"text": "def file2str(filename)\n data = \"\"\n f = File.open(filename, \"r\")\n f.each_line do |line|\n data += line\n end\n data\nend",
"title": ""
},
{
"docid": "09de6c9f3437595a50e313131417a448",
"score": "0.6399854",
"text": "def to_s\n s = \"\"\n each_line {|line| s << line.to_s; s << \"\\n\"}\n return s\n end",
"title": ""
},
{
"docid": "7af4133bd9fb822c9e575cc31ff67458",
"score": "0.6385422",
"text": "def to_str; \"\"; end",
"title": ""
},
{
"docid": "0b1cc12809048c01ae10b5b731b30d0e",
"score": "0.63816553",
"text": "def to_s; \"\"; end",
"title": ""
},
{
"docid": "ae8bbe8b034eb9ef56b64fd6b3152b18",
"score": "0.63758785",
"text": "def to_str\n\t\t# nothing to do here\n\tend",
"title": ""
},
{
"docid": "87aa72f2f5506e78d75cab333421a0d6",
"score": "0.6356093",
"text": "def write(_str); end",
"title": ""
},
{
"docid": "b29851551a304961a5e0dce64c54fbbf",
"score": "0.63368416",
"text": "def to_s\n to_io.read(nil)\n end",
"title": ""
},
{
"docid": "b29851551a304961a5e0dce64c54fbbf",
"score": "0.63368416",
"text": "def to_s\n to_io.read(nil)\n end",
"title": ""
},
{
"docid": "b29851551a304961a5e0dce64c54fbbf",
"score": "0.63368416",
"text": "def to_s\n to_io.read(nil)\n end",
"title": ""
},
{
"docid": "b29851551a304961a5e0dce64c54fbbf",
"score": "0.63368416",
"text": "def to_s\n to_io.read(nil)\n end",
"title": ""
},
{
"docid": "fe8c084fb4be2b3146e6587039c26816",
"score": "0.6336124",
"text": "def to_s()\n s = ''\n each { |text| s << text }\n s\n end",
"title": ""
},
{
"docid": "8182e11d12a2785ccf2b73d73ffe3b36",
"score": "0.63293874",
"text": "def to_s\n \"+%s\\t%s\" % [facts, filename]\n end",
"title": ""
},
{
"docid": "fc87ccefe49c2342aabe9f5683d636c6",
"score": "0.63289565",
"text": "def write(s) end",
"title": ""
},
{
"docid": "4ab0742318d7ad4437b87915a106e565",
"score": "0.6318142",
"text": "def to_str\n end",
"title": ""
},
{
"docid": "7226331c985f3a2e4dbc0ab965d5b385",
"score": "0.6312699",
"text": "def to_s\n text = \"\\\"\\\"\\\"#{content_type_output_string}\\n\"\n text << content_output_string\n text << '\"\"\"'\n end",
"title": ""
},
{
"docid": "e96e75572a65a6d61e1f0b9d5f2a8664",
"score": "0.63085526",
"text": "def write(str); end",
"title": ""
},
{
"docid": "e96e75572a65a6d61e1f0b9d5f2a8664",
"score": "0.63085526",
"text": "def write(str); end",
"title": ""
},
{
"docid": "a6f7134304dd55c8a8638ad76741aaf2",
"score": "0.63042057",
"text": "def to_s\n return @string if @string\n @string = @exporter.export self\n end",
"title": ""
},
{
"docid": "8935b99d8a410546d4bfc29fc927ae7d",
"score": "0.62957126",
"text": "def to_str\n\t\t\t@output\n\t\tend",
"title": ""
},
{
"docid": "8935b99d8a410546d4bfc29fc927ae7d",
"score": "0.62957126",
"text": "def to_str\n\t\t\t@output\n\t\tend",
"title": ""
},
{
"docid": "8935b99d8a410546d4bfc29fc927ae7d",
"score": "0.62957126",
"text": "def to_str\n\t\t\t@output\n\t\tend",
"title": ""
},
{
"docid": "cc9f5d9ea8f778b889494823873dcb5f",
"score": "0.6294142",
"text": "def string_to_file(st,filename)\n f = File.new(filename,\"w\")\n f.puts st\n f.close\n end",
"title": ""
},
{
"docid": "0ea9edc5d77bc8f68bd8dacf375dfb04",
"score": "0.6280159",
"text": "def fileToString(file)\n file = File.open(file)\n contents = \"\"\n file.each {|line|\n contents << line\n }\n return contents\nend",
"title": ""
},
{
"docid": "3d4df09361f66b0951f7625f305c7cac",
"score": "0.62648267",
"text": "def to_s\n self.filename + \"\\n\" + self.metadata.to_s\n end",
"title": ""
},
{
"docid": "8417c71d9284a18fb4a554a29f83bc72",
"score": "0.6262866",
"text": "def to_s\n result = \"#{identifier} | #{developer} | #{time} | #{message}\\n\"\n self.each do |file|\n result << \" \" << file.to_s << \"\\n\"\n end\n result\n end",
"title": ""
},
{
"docid": "bcabd9288243e650230ea7d8ddc7602c",
"score": "0.62618077",
"text": "def to_s\n return string\n end",
"title": ""
},
{
"docid": "c750bd83e3742e11f6b085c10ac122ea",
"score": "0.62572056",
"text": "def write(nombre_archivo,string)\n archivo = File.open(nombre_archivo, 'w')\n archivo.write \"#{string}\"\n archivo.close\nend",
"title": ""
},
{
"docid": "ee5801c845914fc6d8a4395f987e7ac4",
"score": "0.6255413",
"text": "def write_out(file, str)\n if @model.settings()[:substitute_iv_ats] \n str.gsub!('@', 'this->')\n end\n FileUtils.mkdir_p(File.dirname(file))\n File.open(file, 'w+') {|out| out.puts str}\n end",
"title": ""
},
{
"docid": "1c45f1376d36c4cff7f4b60d54b2ece8",
"score": "0.6254586",
"text": "def to_txt\n res = \"\"\n @foodbase.each { | k,v | res += \"#{v.line}\\n\" }\n res\n end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
},
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.62392944",
"text": "def to_s; end",
"title": ""
}
] |
b5f6c1265c5f15c62d34f06c580afd07
|
Fix Mountain Lion build. Committed upstream as r9649
|
[
{
"docid": "2b89c3a47e97c64336d491399d49ab94",
"score": "0.0",
"text": "def patches\n { :p0 => DATA }\n end",
"title": ""
}
] |
[
{
"docid": "34f2be6ca5d5325f4afea2ee94aa8132",
"score": "0.5956729",
"text": "def __apply_Xcode_12_5_M1_post_install_workaround(installer)\n # NOTE: This fix is still required due to RCT-Folly\n # creating a function with a better name but keeping the\n # previous for backward compatibility\n __fix_double_definition_of_clockid_in_folly()\nend",
"title": ""
},
{
"docid": "95ed07d034bee6188155ff3a28c56238",
"score": "0.5718035",
"text": "def caveats; <<-EOS.undent\n After installation please follow the instruction here to make it work on Mavericks\n http://synergy-foss.org/blog/mac-os-x-10-9-mavericks-support/\n EOS\n end",
"title": ""
},
{
"docid": "7bf21389ba9b1b78ef5cfd20a5a5a60f",
"score": "0.56431264",
"text": "def ensure_shell_commands\n xcodebuild_version\n swift_version\n end",
"title": ""
},
{
"docid": "25dc87885c3d05e30679c83de89c71cf",
"score": "0.5632499",
"text": "def setup_fortran_osx\n return unless (config[:os] == 'osx')\n if r_version_less_than('3.4')\n sh.cmd 'curl -fLo /tmp/gfortran.tar.bz2 http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2', retry: true\n sh.cmd 'sudo tar fvxz /tmp/gfortran.tar.bz2 -C /'\n sh.rm '/tmp/gfortran.tar.bz2'\n elsif r_version_less_than('3.7')\n sh.cmd \"curl -fLo /tmp/gfortran61.dmg #{repos[:CRAN]}/contrib/extra/macOS/gfortran-6.1-ElCapitan.dmg\", retry: true\n sh.cmd 'sudo hdiutil attach /tmp/gfortran61.dmg -mountpoint /Volumes/gfortran'\n sh.cmd 'sudo installer -pkg \"/Volumes/gfortran/gfortran-6.1-ElCapitan/gfortran.pkg\" -target /'\n sh.cmd 'sudo hdiutil detach /Volumes/gfortran'\n sh.rm '/tmp/gfortran61.dmg'\n else\n sh.cmd \"curl -fLo /tmp/gfortran82.dmg https://github.com/fxcoudert/gfortran-for-macOS/releases/download/8.2/gfortran-8.2-Mojave.dmg\", retry: true\n sh.cmd 'sudo hdiutil attach /tmp/gfortran82.dmg -mountpoint /Volumes/gfortran'\n sh.cmd 'sudo installer -pkg \"/Volumes/gfortran/gfortran-8.2-Mojave/gfortran.pkg\" -target /'\n sh.cmd 'sudo hdiutil detach /Volumes/gfortran'\n sh.rm '/tmp/gfortran82.dmg'\n end\n end",
"title": ""
},
{
"docid": "138e8976029e3e6c7badf9bad2d66c0b",
"score": "0.56162757",
"text": "def workaround_older_macosx_misreported_cpu?\n os == :macosx && is_64_bit?\n end",
"title": ""
},
{
"docid": "4264cb249737e6edc8c5d0dc66f069f6",
"score": "0.5493228",
"text": "def has_stupid_crash\n require 'rbconfig'\n ANDROID_OS <= 15 && JRUBY_JARS_VERSION >= Gem::Version.new('1.7.19') &&\n ON_LINUX\n end",
"title": ""
},
{
"docid": "52b7d31186d4f706a93450212430a321",
"score": "0.54830134",
"text": "def patch_kingfisher_for_ios10\n system(\"rm -rf ./Pods/Kingfisher/Sources/SwiftUI\")\n code_file = \"./Pods/Kingfisher/Sources/General/KFOptionsSetter.swift\"\n code_text = File.read(code_file)\n code_text.gsub!(/#if canImport\\(SwiftUI\\) \\&\\& canImport\\(Combine\\)(.|\\n)+#endif/,'')\n system(\"rm -rf \" + code_file)\n aFile = File.new(code_file, 'w+')\n aFile.syswrite(code_text)\n aFile.close()\nend",
"title": ""
},
{
"docid": "49ba43db41bb295f727eb3aa5ebdea82",
"score": "0.5403622",
"text": "def install\n # Fix \"fatal error: 'os/availability.h' file not found\" on 10.11 and\n # \"error: expected function body after function declarator\" on 10.12\n if MacOS.version == :sierra || MacOS.version == :el_capitan\n ENV[\"SDKROOT\"] = MacOS.sdk_path\n end\n\n args = std_cmake_args\n\n args << \"-DCMAKE_PREFIX_PATH=#{Formula[\"qt\"].opt_lib}/cmake\"\n args << \"-DCMAKE_CXX_FLAGS=-Wno-error=narrowing\" # or: -Wno-c++11-narrowing\n args << \"-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}\"\n args << \"-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio\"\n args << \"-DOSG_WINDOWING_SYSTEM=Cocoa\"\n\n mkdir \"build\" do\n system \"cmake\", \"..\", *args\n system \"make\"\n system \"make\", \"install\"\n end\n end",
"title": ""
},
{
"docid": "502364b9e8539bfa79e954f457d2f77b",
"score": "0.5386816",
"text": "def patch_nokogiri\n rm_rf \"deps.rip\"\n end",
"title": ""
},
{
"docid": "c3b892d0364bf5e1da27e3961eb10412",
"score": "0.538315",
"text": "def disable_homebrew\n return unless (config[:os] == 'osx')\n sh.cmd \"curl -fsSOL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh\"\n sh.cmd \"sudo /bin/bash uninstall.sh --force\"\n sh.cmd \"rm uninstall.sh\"\n sh.cmd \"hash -r\"\n sh.cmd \"git config --global --unset protocol.version || true\"\n end",
"title": ""
},
{
"docid": "ce5f547f3cbbcc387a80000f567d4e89",
"score": "0.5364296",
"text": "def fixup_libgfortran(prefix)\n keg = Keg.for(prefix)\n libgfortran = Formula.factory(\"libgfortran\")\n\n # For each dylib/executable within this keg\n keg.mach_o_files.each do |file|\n # Make sure it's writable\n file.ensure_writable do\n # Search its dependent dylibs\n keg.each_install_name_for(file) do |bad_name|\n # If we find a quadmath, gcc, or gfortran,\n for f in ['quadmath.0', 'gcc_s.1', 'gfortran.3']\n if bad_name =~ /.*#{f}\\.dylib/\n # Rename the dependency!\n good_name = libgfortran.opt_lib + Pathname.new(bad_name).basename\n keg.change_install_name(bad_name, good_name, file)\n end\n end\n end\n end\n end\n\n gcc = Formula.factory(\"gcc\")\n # For each .pc file within this keg\n keg.pkgconfig_files.each do |file|\n # Make sure it's writable\n file.ensure_writable do\n begin\n inreplace file do |s|\n s.gsub! /#{gcc.lib}\\/[^ ]*/, \"#{libgfortran.opt_lib}\"\n end\n rescue\n end\n end\n end\nend",
"title": ""
},
{
"docid": "780fc5d69b722be9905ae7ad09910cd2",
"score": "0.53010076",
"text": "def scratch_build\n begin\n distgit_pkg.build\n rescue => e\n puts \"Warning: scratch build failed: #{e}\".bold.red\n end\n end",
"title": ""
},
{
"docid": "780fc5d69b722be9905ae7ad09910cd2",
"score": "0.53010076",
"text": "def scratch_build\n begin\n distgit_pkg.build\n rescue => e\n puts \"Warning: scratch build failed: #{e}\".bold.red\n end\n end",
"title": ""
},
{
"docid": "d4eb1ec773e13cfe124c7bf4bd6d381f",
"score": "0.52797705",
"text": "def check_osx_ips(options)\n python_bin = \"/usr/bin/python\"\n pip_bin = \"/usr/bin/pip\"\n setup_url = \"https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py\"\n if not File.symlink?(pip_bin)\n message = \"Information:\\tInstalling Pip\"\n command = \"/usr/bin/easy_install --prefix=/usr pip\"\n execute_command(options,message,command)\n message = \"Information:\\tUpdating Setuptools\"\n command = \"wget #{setup_url} -O |sudo #{python_bin}\"\n execute_command(options,message,command)\n ['simplejson\",\"coverage\",\"pyOpenSSL\",\"mercurial'].each do |module_name|\n message = \"information:\\tInstalling Python module \"+module_name\n command = \"#{pip_bin} install #{module_name}\"\n execute_command(options,message,command)\n end\n end\n python_ver = %x[#{python_bin} --version |awk '{print $2}']\n python_ver = python_ver.chomp.split(/\\./)[0..1].join(\".\")\n module_dir = \"/usr/local/lin/python\"+python_ver+\"/site-packages\"\n pkg_dest_dir = module_dir+\"/pkg\"\n check_dir_exists(options,pkg_dest_dir)\n hg_bin = \"/usr/local/bin/hg\"\n if not File.exist?(hg_bin)\n message = \"Information:\\tInstalling Mercurial\"\n command = \"brew install mercurial\"\n execute_command(options,message,command)\n end\n pkgrepo_bin = \"/usr/local/bin/pkgrepo\"\n if not File.exist?(pkgrepo_bin)\n ips_url = \"https://hg.java.net/hg/ips~pkg-gate\"\n message = \"Information:\\tDownloading IPS source code\"\n command = \"cd #{options['workdir']} ; hg clone #{ips_url} ips\"\n execute_command(options,message,command)\n end\n return\nend",
"title": ""
},
{
"docid": "f0ea3ec5f8b7b4c1665de4e1d0617dcd",
"score": "0.527397",
"text": "def fixed_name(file, bad_name)\n if (file.dylib? || file.mach_o_bundle?) && (file.parent + bad_name).exist?\n \"@loader_path/#{bad_name}\"\n elsif file.mach_o_executable? && (lib + bad_name).exist?\n \"#{lib}/#{bad_name}\"\n elsif (abs_name = find_dylib(Pathname.new(bad_name).basename)) && abs_name.exist?\n abs_name.to_s\n else\n opoo \"Could not fix #{bad_name} in #{file}\"\n bad_name\n end\n end",
"title": ""
},
{
"docid": "f8eded231c81c51ccaf0b5502e1b24cb",
"score": "0.52615535",
"text": "def patches\n # Latest versions of NodeJS stable have changed gyp's xcode_emulation, so\n # it requires a different patch than devel currently. This will probably go away soon\n if build.devel?\n 'https://gist.github.com/bbhoss/7439859/raw/9037240e90c62ce462383469874d4c269e3ead0d/xcode_emulation.patch'\n else\n DATA\n end\n end",
"title": ""
},
{
"docid": "e8e65208bac5016b568b02f67aaa42b5",
"score": "0.5250915",
"text": "def install\n # If we're installing from the repo, then use GNU autotools to make\n # the ./configure script. Note that libtool is often installed with\n # a 'g' prefix by homebrew.\n if build.head?\n mkdir \"m4\"\n system \"autoreconf\", \"-i\"\n end\n\n # Set up CXXFLAGS\n if build.with? \"no-range-check\"\n if build.with? \"fast-test\"\n if build.with? \"python\"\n # no-range-check, fast-test, python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK -DO2SCL_FAST_TEST -I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e1\"\n else # else for if python\n # no-range-check, fast-test, no python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK -DO2SCL_FAST_TEST\"\n system \"echo\", \"e2\"\n end # end of if python\n else # else for fast-test\n if build.with? \"python\"\n # no-range-check, no fast-test, python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK -I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e3\"\n else # else for if python\n # no-range-check, no fast-test, no python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_NO_RANGE_CHECK\"\n system \"echo\", \"e4\"\n end # end of if python\n end # end of if fast-test\n else # else for if no-range-check\n if build.with? \"fast-test\"\n if build.with? \"python\"\n # with range-check, fast-test, python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_FAST_TEST -I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e5\"\n else # else for python\n # with range-check, fast-test, no python\n ENV[\"CXXFLAGS\"] = \"-DO2SCL_FAST_TEST\"\n system \"echo\", \"e6\"\n end # end of if python\n else # else for fast-test\n if build.with? \"python\"\n # with range-check, no fast-test, python\n ENV[\"CXXFLAGS\"] = \"-I/usr/local/lib/python3.11/site-packages/numpy/core/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11\"\n system \"echo\", \"e7\"\n else\n # with range-check, no fast-test, no python\n ENV[\"CXXFLAGS\"] = \"\"\n system \"echo\", \"e8\"\n end # end of if python\n end # end of if fast-test\n end # end of if no-range-check\n\n # ------------------------------------------------------------\n # Set up ./configure script\n \n if build.with? \"armadillo\"\n if build.with? \"eigen\"\n if build.with? \"openmp\"\n if build.with? \"python\"\n # armadillo, eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--enable-python\",\"--enable-openmp\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # armadillo, eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--enable-openmp\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # armadillo, eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--enable-python\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # armadillo, eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\", \"--enable-eigen\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n end\n else \n if build.with? \"openmp\"\n if build.with? \"python\"\n # armadillo, no eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--enable-python\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n else\n # armadillo, no eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # armadillo, no eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--enable-python\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # armadillo, no eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-armadillo\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n end\n end\n else\n if build.with? \"eigen\"\n if build.with? \"openmp\"\n if build.with? \"python\"\n # no armadillo, eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-eigen\",\n \"--enable-python\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n else\n # no armadillo, eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-eigen\",\n \"--enable-openmp\",\"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # no armadillo, eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-python\",\n \"--enable-eigen\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n else\n # no armadillo, eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-eigen\",\n \"--disable-silent-rules\",\"--prefix=#{prefix}\"\n end\n end\n else\n if build.with? \"openmp\"\n if build.with? \"python\"\n # no armadillo, no eigen, openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--enable-python\",\n \"--enable-openmp\",\"--prefix=#{prefix}\"\n else\n # no armadillo, no eigen, openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--enable-openmp\",\"--prefix=#{prefix}\"\n end\n else\n if build.with? \"python\"\n # no armadillo, no eigen, no openmp, python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--enable-python\",\n \"--prefix=#{prefix}\"\n else\n # no armadillo, no eigen, no openmp, no python\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n end\n end\n end\n end\n \n #\n # If there's no documentation, just add some blank files so\n # that the install target succeeds.\n #\n if build.head?\n system \"make\", \"blank-doc\"\n end\n \n #\n # Unfortunately if we do 'make' and then 'make install', it fails\n # to build acol properly (e.g. on antares), so we just do 'make\n # install'.\n #\n # 2/24/17: Actually this most recent time it worked better\n # with 'make' and 'make install' on antares, so I leave it\n # this way for now. Alternatively, there is an LDFLAGS\n # setting above which I can try if I'm still having problems.\n #\n # 9/28/17: I'm having problems with acol again on mimosa,\n # so I just do 'make install'\n\n ENV.deparallelize\n \n #system \"make\"\n system \"make\", \"install\"\n\n #\n # FIXME: should document why this is necessary\n #\n if build.with? \"check\"\n system \"make\", \"check\"\n end\n if build.with? \"examples\"\n system \"make\", \"o2scl-examples\"\n end\n include.install Dir[\"include/o2scl/*.h\"]\n if build.with? \"examples\"\n share.install Dir[\"examples/ex*.cpp\"]\n end\n end",
"title": ""
},
{
"docid": "82bbf9b6c6ba30574a6d26374fb21154",
"score": "0.5235638",
"text": "def fix_mac!\n if self =~ /\\bMac[A-Za-z]{2,}[^acizj]\\b/ || self =~ /\\bMc/\n gsub!(/\\b(Ma?c)([A-Za-z]+)/) { |_| Regexp.last_match[1] + Regexp.last_match[2].capitalize }\n\n # Fix Mac exceptions\n %w[\n MacEdo MacEvicius MacHado MacHar MacHin MacHlin MacIas MacIulis MacKie\n MacKle MacKlin MacKmin MacKmurdo MacQuarie MacLise MacKenzie\n ].each { |mac_name| substitute!(/\\b#{mac_name}/, mac_name.capitalize) }\n end\n\n self # Allows chaining\n end",
"title": ""
},
{
"docid": "1c0f22c23b4749facdab4e8c8e9e5dc9",
"score": "0.52211344",
"text": "def skip_xcodebuild?\n ENV['SKIP_XCODEBUILD']\nend",
"title": ""
},
{
"docid": "ee8e9677640495d29120fb8ce7c6e245",
"score": "0.5211387",
"text": "def resetIOSRepo\n # sh \"git checkout -q bFan-ios-dev/bfan-ios-qa-Info.plist bFan-ios-dev/bfan-ios-prod-Info.plist bFan-ios-dev/bfan-ios-dev-Info.plist bFanUITest/Info.plist\"\nend",
"title": ""
},
{
"docid": "1ca696592324a9f19fe4f574fb676c9d",
"score": "0.5207451",
"text": "def fixup_args ()\n\n print \"Using Ruby version: #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\\n\"\n\n if $my_base_url[-4..-1] != \"/slm\" && $my_base_url[-5..-1] != \"/slm/\"\n print \"Fixup: Modifing URL from <#{$my_base_url}>\"\n if $my_base_url[-1..-1] == \"/\"\n $my_base_url.concat(\"slm\")\n else\n $my_base_url.concat(\"/slm\")\n end\n print \" to <#{$my_base_url}>\\n\"\n end\nend",
"title": ""
},
{
"docid": "b8d392b510ca6d65fee715a629a8d35d",
"score": "0.5183629",
"text": "def build\n safesystem \"autoreconf -vfi\"\n configure :prefix => prefix\n make\n end",
"title": ""
},
{
"docid": "da2d4504d4e30c3d8f739c9e84ca0218",
"score": "0.5158704",
"text": "def fixCMakeFiles(st)\n\t# Once things have been added/backedup, we don't need to do this again\n\t#sh \"git add #{st}\"\n\t#sh \"cp #{st} #{st}.bak\"\n\n\t# We don't need to work on backup copies\n\tif st =~ /bak$/\n\t\treturn\n\tend\n\n\tfr = File.open(\"#{st}.bak\", \"r\") \n\tfw = File.open(\"#{st}\", \"w\") \n\tfr.each{ |line|\n\t\tnewline = line.gsub(\"kde4\", \"kde5\")\n\t\tnewline = newline.gsub(\"KDE4\", \"KDE5\")\n\t\tnewline = newline.gsub(\"QT4\", \"QT5\")\n\t\tnewline = newline.gsub(\"qt4\", \"qt5\")\n\t\tputs newline\n\t\tfw.write(newline)\n\t}\n\tfw.close()\n\tfr.close()\nend",
"title": ""
},
{
"docid": "1ac6078b6cc786be7b08ed0c4d098b9c",
"score": "0.51578283",
"text": "def patches\n { :p0 =>\n \"https://trac.macports.org/export/91404/trunk/dports/sysutils/renameutils/files/patch-use_coreutils.diff\"\n }\n end",
"title": ""
},
{
"docid": "3d53afa98d1784d28cf4904038e19627",
"score": "0.5126129",
"text": "def brew\n validate_variable :name\n validate_variable :version\n\n stage do\n begin\n patch\n # we allow formulas to do anything they want to the Ruby process\n # so load any deps before this point! And exit asap afterwards\n yield self\n rescue Interrupt, RuntimeError, SystemCallError => e\n raise unless ARGV.debug?\n onoe e.inspect\n puts e.backtrace\n ohai \"Rescuing build...\"\n puts \"When you exit this shell Homebrew will attempt to finalise the installation.\"\n puts \"If nothing is installed or the shell exits with a non-zero error code,\"\n puts \"Homebrew will abort. The installation prefix is:\"\n puts prefix\n interactive_shell\n end\n end\n end",
"title": ""
},
{
"docid": "72a325a1c7110eed11350b541d8d8281",
"score": "0.50989914",
"text": "def xfixip(path)\n path.gsub!(/-I\\/usr\\//, \"-I#{ShoesDeps}/usr/\")\n return path\nend",
"title": ""
},
{
"docid": "b4446613c0976526a38971a3e7927b6f",
"score": "0.5084572",
"text": "def flutter_additional_macos_build_settings(target)\n return unless target.platform_name == :osx\n\n # [target.deployment_target] is a [String] formatted as \"10.8\".\n deployment_target_major, deployment_target_minor = target.deployment_target.match(/(\\d+).?(\\d*)/).captures\n\n # ARC code targeting macOS 10.10 does not build on Xcode 14.3.\n force_to_arc_supported_min = !target.deployment_target.blank? &&\n (deployment_target_major.to_i < 10) ||\n (deployment_target_major.to_i == 10 && deployment_target_minor.to_i < 11)\n\n # Suppress warning when pod supports a version lower than the minimum supported by the latest stable version of Xcode (currently 10.14).\n # This warning is harmless but confusing--it's not a bad thing for dependencies to support a lower version.\n inherit_deployment_target = !target.deployment_target.blank? &&\n (deployment_target_major.to_i < 10) ||\n (deployment_target_major.to_i == 10 && deployment_target_minor.to_i < 14)\n\n # This podhelper script is at $FLUTTER_ROOT/packages/flutter_tools/bin.\n # Add search paths from $FLUTTER_ROOT/bin/cache/artifacts/engine.\n artifacts_dir = File.join('..', '..', '..', '..', 'bin', 'cache', 'artifacts', 'engine')\n debug_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64'), __FILE__)\n release_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64-release'), __FILE__)\n\n unless Dir.exist?(debug_framework_dir)\n # macOS artifacts have not been downloaded.\n raise \"#{debug_framework_dir} must exist. If you're running pod install manually, make sure \\\"flutter precache --macos\\\" is executed first\"\n end\n\n target.build_configurations.each do |build_configuration|\n # ARC code targeting macOS 10.10 does not build on Xcode 14.3. Force to at least macOS 10.11.\n build_configuration.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.11' if force_to_arc_supported_min\n\n # Skip other updates if it's not a Flutter plugin (transitive dependency).\n next unless target.dependencies.any? { |dependency| dependency.name == 'FlutterMacOS' }\n\n # Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only).\n configuration_engine_dir = build_configuration.type == :debug ? debug_framework_dir : release_framework_dir\n build_configuration.build_settings['FRAMEWORK_SEARCH_PATHS'] = \"\\\"#{configuration_engine_dir}\\\" $(inherited)\"\n\n # When deleted, the deployment version will inherit from the higher version derived from the 'Runner' target.\n # If the pod only supports a higher version, do not delete to correctly produce an error.\n build_configuration.build_settings.delete 'MACOSX_DEPLOYMENT_TARGET' if inherit_deployment_target\n\n # Avoid error about Pods-Runner not supporting provisioning profiles.\n # Framework signing is handled at the app layer, not per framework, so disallow individual signing.\n build_configuration.build_settings.delete 'EXPANDED_CODE_SIGN_IDENTITY'\n build_configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'\n build_configuration.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n end\nend",
"title": ""
},
{
"docid": "de06d298d8bb62cffe3b11259b2597d4",
"score": "0.5081541",
"text": "def install\n system \"make\"\n bin.install('osx-cpu-temp')\n end",
"title": ""
},
{
"docid": "06616a08e4e28ea35f204cdf1146646b",
"score": "0.50651217",
"text": "def flutter_macos_podfile_setup; end",
"title": ""
},
{
"docid": "f69e92d27510483c5829c7ceac139fdb",
"score": "0.5042071",
"text": "def osx_installer(package)\n\t\t\t\tsystem(\"brew install #{package}\")\n\t\t\tend",
"title": ""
},
{
"docid": "835f56735dac86e2ec9fd5dff876803c",
"score": "0.50396466",
"text": "def tidy_up\n return if DEBUG\n\n puts heading(\"Tidying up PWD\")\n\n FileUtils.remove(Dir[\"#{FileUtils.pwd}/bugsnag-*.tgz\"])\nend",
"title": ""
},
{
"docid": "e9db8bb767eb3e3bde0d9b509cf13835",
"score": "0.5036928",
"text": "def install\n ENV.deparallelize\n\n cd \"src\" do\n cp \"config/MAC.in\", \"config.in\"\n inreplace \"config.in\" do |s|\n s.change_make_var! \"CCPROG\", ENV.compiler\n s.change_make_var! \"CFPROG\", ENV[\"FC\"]\n s.change_make_var! \"CF90PROG\", ENV[\"FC\"]\n s.change_make_var! \"MCFPROG\", ENV[\"MPIFC\"]\n s.change_make_var! \"MPCCPROG\", ENV[\"MPICC\"]\n s.change_make_var! \"MPCXXPROG\", ENV[\"MPICXX\"]\n s.change_make_var! \"VERSIONBIT\", MacOS.prefer_64_bit? ? \"_64bit\" : \"_32bit\"\n\n libgfortran = `#{ENV[\"MPIFC\"]} --print-file-name libgfortran.a`.chomp\n s.change_make_var! \"EXTRALIB\", \"-L#{File.dirname(libgfortran)} -lgfortran -lm\"\n\n # set prefix\n s.gsub!(/#\\s*ROOT\\s*=/, \"ROOT = \")\n s.change_make_var! \"ROOT\", prefix\n s.gsub!(/#\\s*INCLUDEDIR\\s*=/, \"INCLUDEDIR = \")\n s.change_make_var! \"INCLUDEDIR\", include\n s.gsub!(/#\\s*LIBDIR\\s*=/, \"LIBDIR = \")\n s.change_make_var! \"LIBDIR\", lib\n s.gsub!(/#\\s*BINDIR\\s*=/, \"BINDIR = \")\n s.change_make_var! \"BINDIR\", bin\n s.gsub!(/#\\s*PYTHON_PREFIX\\s*=/, \" PYTHON_PREFIX = \")\n\n # shared library building\n s.gsub!(/#\\s*SHARED\\s*=/, \"SHARED = \")\n s.change_make_var! \"SHARED\", 1\n s.gsub!(/#\\s*SOEXT\\s*=/, \"SOEXT = \")\n s.gsub!(/#\\s*SHARED_FLAGS\\s*=/, \"SHARED_FLAGS = \")\n\n # activate FUNNELED mode\n s.gsub!(/#\\s*CCPASTIX\\s*:=\\s*\\$\\(CCPASTIX\\)\\s+-DPASTIX_FUNNELED/,\n\"CCPASTIX := \\$(CCPASTIX) -DPASTIX_FUNNELED\")\n\n s.gsub!(/#\\s*CCFDEB\\s*:=/, \"CCFDEB := \")\n s.gsub!(/#\\s*CCFOPT\\s*:=/, \"CCFOPT := \")\n s.gsub!(/#\\s*CFPROG\\s*:=/, \"CFPROG := \")\n\n s.gsub!(/SCOTCH_HOME\\s*\\?=/, \"SCOTCH_HOME=\")\n s.change_make_var! \"SCOTCH_HOME\", Formula[\"scotch\"].opt_prefix\n\n s.gsub!(/HWLOC_HOME\\s*\\?=/, \"HWLOC_HOME=\")\n s.change_make_var! \"HWLOC_HOME\", Formula[\"hwloc\"].opt_prefix\n\n if build.with? \"metis4\"\n s.gsub!(/#\\s*VERSIONORD\\s*=\\s*_metis/, \"VERSIONORD = _metis\")\n s.gsub!(/#\\s*METIS_HOME/, \"METIS_HOME\")\n s.change_make_var! \"METIS_HOME\", Formula[\"metis4\"].opt_prefix\n s.gsub! %r{#\\s*CCPASTIX\\s*:=\\s*\\$\\(CCPASTIX\\)\\s+-DMETIS\\s+-I\\$\\(METIS_HOME\\)/Lib},\n\"CCPASTIX := \\$(CCPASTIX) -DMETIS -I#{Formula[\"metis4\"].opt_include}\"\n s.gsub!(/#\\s*EXTRALIB\\s*:=\\s*\\$\\(EXTRALIB\\)\\s+-L\\$\\(METIS_HOME\\)\\s+-lmetis/,\n\"EXTRALIB := \\$\\(EXTRALIB\\) -L#{Formula[\"metis4\"].opt_lib} -lmetis\")\n end\n\n if build.with? \"openblas\"\n s.gsub! %r{#\\s*BLAS_HOME\\s*=\\s*/path/to/blas}, \"BLAS_HOME = #{Formula[\"openblas\"].opt_lib}\"\n s.change_make_var! \"BLASLIB\", \"-lopenblas\"\n end\n end\n system \"make\"\n system \"make\", \"install\"\n\n # Build examples against just installed libraries, so they continue to\n # work once the temporary directory is gone, e.g., for `brew test`.\n system \"make\", \"examples\", \"PASTIX_BIN=#{bin}\",\n \"PASTIX_LIB=#{lib}\",\n \"PASTIX_INC=#{include}\"\n system \"./example/bin/simple\", \"-lap\", \"100\"\n prefix.install \"config.in\" # For the record.\n pkgshare.install \"example\" # Contains all test programs.\n ohai \"Simple test result is in #{HOMEBREW_LOGS}/pastix. Please check.\"\n end\n end",
"title": ""
},
{
"docid": "0819287311b5a33337ab7ff6e2ef0637",
"score": "0.49901378",
"text": "def peform_extensive_analysis\n set_up_lint_environment\n install_pod\n puts \"Building with xcodebuild.\\n\".yellow if config.verbose?\n # treat xcodebuild warnings as notes because the spec maintainer might not be the author of the library\n xcodebuild_output.each { |msg| ( msg.include?('error: ') ? @platform_errors[@platform] : @platform_notes[@platform] ) << msg }\n @platform_errors[@platform] += file_patterns_errors\n @platform_warnings[@platform] += file_patterns_warnings\n tear_down_lint_environment\n end",
"title": ""
},
{
"docid": "94e966f3e15fa70b02285b1aa9d33760",
"score": "0.49891055",
"text": "def install\n bin.install \"macosupdate\"\n end",
"title": ""
},
{
"docid": "9ae88ef298cac355cb709b954f08a14c",
"score": "0.49828997",
"text": "def patches\n \"https://gist.github.com/raw/636194/a8f5326ea27faed38da6c188045dd166b1eb6af6/jack-1.9.6_homebrew.patch\"\n end",
"title": ""
},
{
"docid": "63ad1424fedeefefb2a1b7d851628d3b",
"score": "0.49805838",
"text": "def install\n # When building the head, temp patch for ROOT-8032\n if build.head? || build.devel?\n inreplace \"cmake/modules/RootBuildOptions.cmake\", \"thread|cxx11|cling|builtin_llvm|builtin_ftgl|explicitlink\", \"thread|cxx11|cling|builtin_llvm|builtin_ftgl|explicitlink|python|mathmore|asimage|gnuinstall|rpath|soversion|opengl|builtin_glew\"\n end\n\n mkdir \"hb-build-root\" do\n ENV.cxx11\n\n # Defaults\n args = std_cmake_args\n args << \"-Dgnuinstall=ON\"\n args << \"-DCMAKE_INSTALL_SYSCONFDIR=etc/root\"\n args << \"-Dgminimal=ON\"\n args << \"-Dx11=OFF\" if OS.mac?\n args << \"-Dcocoa=ON\" if OS.mac?\n args << \"-Dlibcxx=ON\" if OS.mac?\n args << \"-Dfortran=OFF\"\n args << \"-Drpath=ON\"\n args << \"-Dsoversion=ON\"\n args << \"-Dasimage=ON\"\n args << \"-Dbuiltin_asimage=ON\"\n args << \"-Dbuiltin_freetype=ON\"\n args << \"-Dopengl=ON\"\n args << \"-Dbuiltin_glew=ON\"\n\n # Options\n args << \"-Dcxx11=ON\"\n args << \"-Dpython=\".concat((build.with? \"python\") ? \"ON\" : \"OFF\")\n args << \"-Dmathmore=\".concat((build.with? \"gsl\") ? \"ON\" : \"OFF\")\n\n system \"cmake\", \"../\", *args\n system \"make\"\n system \"make\", \"install\"\n end\n end",
"title": ""
},
{
"docid": "c65463b98c2c79a74eddd23c66ab94fc",
"score": "0.49792227",
"text": "def install\n mktemp do\n File.open(\"make.sh\", \"w\") { |f| f.write \"\\#!/bin/sh\\nmake \\\"$@\\\"\\nexit 0\\n\" }\n arm = Utils.safe_popen_read(\"/usr/local/bin/brew\", \"--prefix\",\n \"cesarvandevelde/formulae/arm-none-eabi-gcc\").chomp\n # path = Utils.popen_read(\"/usr/bin/find\",\"#{arm}/\",\"-name\",\"stddef.h\",\"-print`\")\n # inc = path[0..-10]\n ENV[\"TARGET\"] = \"arm-none-eabi\"\n ENV[\"PREFIX\"] = \"#{arm}/gcc\"\n ENV[\"PATH\"] = \"#{ENV[\"PATH\"]}:#{arm}/gcc/bin\"\n system \"#{buildpath}/configure\",\n \"--target=arm-none-eabi\",\n \"--prefix=#{prefix}\",\n \"--with-as=#{arm}/bin/arm-none-eabi-as\", \"--with-ld=#{arm}/bin/arm-none-eabi-ld\",\n \"--disable-nls\",\n \"--disable-bootstrap\",\n \"--enable-checking=tree,rtl,assert,types\",\n \"--no-create\", \"--no-recursion\",\n \"--with-arch=armv7-a\", \"--with-fpu=vfp\", \"--with-float=hard\",\n \"CFLAGS=-g3 -O0\",\n \"--enable-languages=c,lto\",\n \"--disable-multilib\",\n \"--disable-werror\",\n \"--disable-libssp\", \"--disable-libstdcxx-pch\", \"--disable-libmudflap\",\n \"--with-newlib\",\n \"--enable-interwork\",\n \"--with-headers=yes\"\n # \"--with-headers=#{arm}/gcc/arm-none-eabi/include,#{inc}\"\n system \"sh\", \"config.status\"\n system \"sh\", \"make.sh\", \"-k\", \"-j\", \"20\" # for firefly\n system \"sh\", \"make.sh\", \"-k\", \"install\"\n # raise\n end\n end",
"title": ""
},
{
"docid": "aef5b43d5bb705443e902c1f71b1faa7",
"score": "0.49611893",
"text": "def bump_major_version; end",
"title": ""
},
{
"docid": "3a084de2b0da8b89505a15f49d809acc",
"score": "0.49522972",
"text": "def bump_patch_version; end",
"title": ""
},
{
"docid": "636d2f86ccf6c425b09e1dd476e5cf66",
"score": "0.49409443",
"text": "def bump_minor_version; end",
"title": ""
},
{
"docid": "c4511847194d01e3da0a65ea57d3c1f8",
"score": "0.49179128",
"text": "def remove_native_stub_pkg(pkg)\n # raise NotImplementedError\n warn \"No native stub support for OS #{os}\"\n end",
"title": ""
},
{
"docid": "f8513b5a2f048781d98f358a30e7c59b",
"score": "0.4916797",
"text": "def patches\n {:p0 => %W[\n https://raw.github.com/collective/buildout.python/46f883ddaab4be778e87c9dcd23ec3446799dd04/src/python-2.4-darwin-10.6.patch\n ]}\n end",
"title": ""
},
{
"docid": "f7583e0e230bdec55a16561d5dcf6c7f",
"score": "0.49150053",
"text": "def fixLoadPath(oldpath,libpath,target)\n debug \"#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}\"\n `#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}`\nend",
"title": ""
},
{
"docid": "c987d0fef3a7bf633897ec88d266764e",
"score": "0.49098065",
"text": "def test_bad_rubinius_deps\n check_deps_fail BadRubiniusBall unless `/usr/bin/which rbx`.chomp.empty?\n end",
"title": ""
},
{
"docid": "d11d1de80c0c908758d86337d95a6807",
"score": "0.48757178",
"text": "def wrap_xcodebuild\n require 'fileutils'\n @wrapped_xcodebuild_path ||= File.join(Gym::ROOT, \"lib/assets/wrap_xcodebuild/xcbuild-safe.sh\")\n end",
"title": ""
},
{
"docid": "b366ea9417f75c752f0072145a4e4294",
"score": "0.4859024",
"text": "def build_for_iosish_platform(sandbox, \n build_dir, \n output_path,\n target, \n device, \n simulator,\n bitcode_enabled)\n\n deployment_target = target.platform.deployment_target.to_s\n \n target_label = target.label\n Pod::UI.puts \"Prebuilding #{target_label}...\"\n \n other_options = [] \n if bitcode_enabled\n other_options += ['OTHER_CFLAGS=\"-fembed-bitcode\"']\n end\n xcodebuild(sandbox, target_label, device, deployment_target, other_options)\n xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'])\n\n root_name = target.pod_name\n module_name = target.product_module_name\n \n executable_path = \"#{build_dir}/#{root_name}\"\n device_lib = \"#{build_dir}/#{CONFIGURATION}-#{device}/#{root_name}/#{module_name}.framework/#{module_name}\"\n device_framework_lib = File.dirname(device_lib)\n simulator_lib = \"#{build_dir}/#{CONFIGURATION}-#{simulator}/#{root_name}/#{module_name}.framework/#{module_name}\"\n\n return unless File.file?(device_lib) && File.file?(simulator_lib)\n\n lipo_log = `lipo -create -output #{executable_path} #{device_lib} #{simulator_lib}`\n puts lipo_log unless File.exist?(executable_path)\n\n FileUtils.mv executable_path, device_lib, :force => true\n output_path.mkpath unless output_path.exist?\n FileUtils.mv device_framework_lib, output_path, :force => true\n FileUtils.rm simulator_lib if File.file?(simulator_lib)\n FileUtils.rm device_lib if File.file?(device_lib)\nend",
"title": ""
},
{
"docid": "72062648ddc9a4f060f44a97156159d2",
"score": "0.48564884",
"text": "def build_flags_cross\n # Unclear if we need config_site CONFIG_SITE=/etc/dpkg-cross/cross-config.i386\n [] << '-a' << cross_arch\n end",
"title": ""
},
{
"docid": "5b01d95e3bcdcc3b8cd708e51d354734",
"score": "0.4855914",
"text": "def grin_wallet_post_install(installer)\n installer.pods_project.targets.each do |target|\n if target.name == 'YogaKit'\n target.build_configurations.each do |config|\n config.build_settings['SWIFT_VERSION'] = '4.1'\n end\n end\n end\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n ldflags = config.build_settings['OTHER_LDFLAGS'] || '$(inherited) '\n unless ldflags.include? 'IOKit'\n puts 'Adding -framework IOKit in OTHER_LDFLAGS...'\n ldflags << '-framework IOKit'\n end\n config.build_settings['OTHER_LDFLAGS'] = ldflags\n end\n app_project.save\n end\n installer.pods_project.save\nend",
"title": ""
},
{
"docid": "757d531bd1cc5aceb141399ab7da2b38",
"score": "0.48530406",
"text": "def build_gem; end",
"title": ""
},
{
"docid": "c4bc32d5bd43e9cdbc8f01777fe36553",
"score": "0.484276",
"text": "def check_sdk_path_not_nil_yosemite\n if MacOS.version == :yosemite && !MacOS::CLT.installed? && MacOS::Xcode.installed? && MacOS.sdk_path.nil?\n <<-EOS.undent\n Xcode 7 lacks the 10.10 SDK which can cause some builds to fail.\n We recommend installing the Command Line Tools with:\n xcode-select --install\n to resolve this issue.\n EOS\n end\n end",
"title": ""
},
{
"docid": "755c5b891f44235ae8348b0685d6301a",
"score": "0.4837785",
"text": "def should_remove_librun_and_stc_sources\n !(core_developer? or ENV['RETAIN_STX_AND_LIBRUN_SOURCE'] == 'yespleaseretain!')\nend",
"title": ""
},
{
"docid": "a595967fa10b3d2df230e0a13b975800",
"score": "0.48314595",
"text": "def has_required_xcode_version?\n # TODO: bring in from build_runner\n rand(10) > 3 # 1 in 3 chance of failure\n end",
"title": ""
},
{
"docid": "947cd6024d94bf73627f438b829e4805",
"score": "0.4831278",
"text": "def flipper_post_install(installer)\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '\n unless cflags.include? '-DFB_SONARKIT_ENABLED=1'\n puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'\n cflags << ' -DFB_SONARKIT_ENABLED=1 '\n end\n config.build_settings['OTHER_CFLAGS'] = cflags\n end\n app_project.save\n end\n installer.pods_project.save\nend",
"title": ""
},
{
"docid": "947cd6024d94bf73627f438b829e4805",
"score": "0.4831278",
"text": "def flipper_post_install(installer)\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '\n unless cflags.include? '-DFB_SONARKIT_ENABLED=1'\n puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'\n cflags << ' -DFB_SONARKIT_ENABLED=1 '\n end\n config.build_settings['OTHER_CFLAGS'] = cflags\n end\n app_project.save\n end\n installer.pods_project.save\nend",
"title": ""
},
{
"docid": "15559adeb33774564cf86ce4c354b41d",
"score": "0.48311767",
"text": "def xfixil(path) \n path.gsub!(/-L\\/usr\\/lib/, \"-L#{TGT_SYS_DIR}usr/lib\")\n return path\nend",
"title": ""
},
{
"docid": "73cbb8d29ff6a91d8b6291cf2fdf2250",
"score": "0.4827827",
"text": "def flipper_post_install(installer)\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '\n unless cflags.include? '-DFB_SONARKIT_ENABLED=1'\n puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'\n cflags << '-DFB_SONARKIT_ENABLED=1'\n end\n config.build_settings['OTHER_CFLAGS'] = cflags\n end\n app_project.save\n end\n installer.pods_project.save\nend",
"title": ""
},
{
"docid": "73cbb8d29ff6a91d8b6291cf2fdf2250",
"score": "0.4827827",
"text": "def flipper_post_install(installer)\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '\n unless cflags.include? '-DFB_SONARKIT_ENABLED=1'\n puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'\n cflags << '-DFB_SONARKIT_ENABLED=1'\n end\n config.build_settings['OTHER_CFLAGS'] = cflags\n end\n app_project.save\n end\n installer.pods_project.save\nend",
"title": ""
},
{
"docid": "6c5e23d7a27e578c2f0486edfc10c301",
"score": "0.4825216",
"text": "def set_platform_libs\n\n case p4osname\n when 'SOLARIS'\n osver = `uname -r`\n osver.gsub!(/5\\./, '2')\n if (osver == '25')\n $LDFLAGS += '/usr/ucblib/libucb.a '\n end\n have_library('nsl')\n have_library('socket')\n when 'NT'\n have_library('advapi32')\n have_library('wsock32')\n have_library('kernel32')\n have_library('oldnames')\n when 'CYGWIN'\n # Clear out 'bogus' libs on cygwin\n CONFIG['LIBS'] = ''\n when 'DARWIN'\n if p4osver.to_i >= 8\n # Only build for 64 bit if we have more than one arch defined in CFLAGS\n $LDFLAGS.slice!('-arch i386')\n $LDFLAGS.slice!('-arch ppc')\n $LDFLAGS += ' -framework CoreFoundation -framework Foundation'\n end\n when 'LINUX', 'MINGW32'\n $LDFLAGS += ' -Wl,--allow-multiple-definition'\n have_library('supc++')\n end\nend",
"title": ""
},
{
"docid": "8f7e7158c08aba0986d5b7128dfeccb2",
"score": "0.48060974",
"text": "def prepare_react_native_project!\n # Temporary solution to suppress duplicated GUID error.\n # Can be removed once we move to generate files outside pod install.\n install! 'cocoapods', :deterministic_uuids => false\n\n ReactNativePodsUtils.create_xcode_env_if_missing\nend",
"title": ""
},
{
"docid": "80f9012b924023e2196a73aa7aed34ac",
"score": "0.48058262",
"text": "def pour_bottle?\n quiet_system(\"/usr/libexec/java_home --version 1.8 --failfast\")\n end",
"title": ""
},
{
"docid": "94d8267a5bafed5c4ed4f717b3b00513",
"score": "0.4800414",
"text": "def build_for_iosish_platform(sandbox, \n build_dir, \n output_path,\n target, \n deployment_target, \n device, \n simulator,\n bitcode_enabled,\n custom_build_options = [], # Array<String>\n custom_build_options_simulator = [] # Array<String>\n )\n \n target_label = target.label # name with platform if it's used in multiple platforms\n Pod::UI.puts \"Prebuilding #{target_label}...\"\n \n other_options = []\n # bitcode enabled\n other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled\n # make less arch to iphone simulator for faster build\n custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator'\n\n is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options)\n exit 1 unless is_succeed\n is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + custom_build_options_simulator)\n exit 1 unless is_succeed\n\n # paths\n target_name = target.name # equals target.label, like \"AFNeworking-iOS\" when AFNetworking is used in multiple platforms.\n module_name = target.product_module_name\n device_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework\"\n simulator_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework\"\n if !File.directory?(device_framework_path)\n # Newer Xcodes seem to build all in one directory.\n device_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{device}/#{module_name}.framework\"\n simulator_framework_path = \"#{build_dir}/#{CONFIGURATION}-#{simulator}/#{module_name}.framework\"\n end\n output_framework_path = \"#{output_path}/#{module_name}.framework\"\n\n device_binary = device_framework_path + \"/#{module_name}\"\n simulator_binary = simulator_framework_path + \"/#{module_name}\"\n return unless File.file?(device_binary) && File.file?(simulator_binary)\n \n # the device_lib path is the final output file path\n # combine the binaries\n tmp_lipoed_binary_path = \"#{build_dir}/#{target_name}\"\n lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}`\n Pod::UI.puts lipo_log unless File.exist?(tmp_lipoed_binary_path)\n FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true\n \n # collect the swiftmodule file for various archs.\n device_swiftmodule_path = device_framework_path + \"/Modules/#{module_name}.swiftmodule\"\n simulator_swiftmodule_path = simulator_framework_path + \"/Modules/#{module_name}.swiftmodule\"\n if File.exist?(device_swiftmodule_path)\n FileUtils.cp_r simulator_swiftmodule_path + \"/.\", device_swiftmodule_path\n end\n\n # combine the generated swift headers\n # (In xcode 10.2, the generated swift headers vary for each archs)\n # https://github.com/leavez/cocoapods-binary/issues/58\n simulator_generated_swift_header_path = simulator_framework_path + \"/Headers/#{module_name}-Swift.h\"\n device_generated_swift_header_path = device_framework_path + \"/Headers/#{module_name}-Swift.h\"\n if File.exist? simulator_generated_swift_header_path\n device_header = File.read(device_generated_swift_header_path)\n simulator_header = File.read(simulator_generated_swift_header_path)\n # https://github.com/Carthage/Carthage/issues/2718#issuecomment-473870461\n combined_header_content = %Q{\n#if TARGET_OS_SIMULATOR // merged by cocoapods-binary\n\n#{simulator_header}\n\n#else // merged by cocoapods-binary\n\n#{device_header}\n\n#endif // merged by cocoapods-binary\n}\n File.write(device_generated_swift_header_path, combined_header_content.strip)\n end\n\n # handle the dSYM files\n device_dsym = \"#{device_framework_path}.dSYM\"\n device_dsym_output_path = \"#{output_framework_path}.dSYM\"\n if File.exist? device_dsym\n # lipo the simulator dsym\n simulator_dsym = \"#{simulator_framework_path}.dSYM\"\n if File.exist? simulator_dsym\n tmp_lipoed_binary_path = \"#{output_path}/#{module_name}.draft\"\n lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}`\n puts lipo_log unless File.exist?(tmp_lipoed_binary_path)\n FileUtils.mv tmp_lipoed_binary_path, \"#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}\", :force => true\n end\n # move\n FileUtils.rm_r device_dsym_output_path if Dir.exist? device_dsym_output_path\n File.rename device_dsym, device_dsym_output_path\n end\n\n # output\n output_path.mkpath unless output_path.exist?\n FileUtils.rm_r output_framework_path if Dir.exist? output_framework_path\n File.rename device_framework_path, output_framework_path\n\nend",
"title": ""
},
{
"docid": "5826fca52f5904e50d3fe01e3251788f",
"score": "0.4793628",
"text": "def make(args)\n # Maybe we should write an \"uncrustify\" fastlane action?...\n Dir.chdir '..' do\n sh 'make ' + args\n end\nend",
"title": ""
},
{
"docid": "5826fca52f5904e50d3fe01e3251788f",
"score": "0.4793628",
"text": "def make(args)\n # Maybe we should write an \"uncrustify\" fastlane action?...\n Dir.chdir '..' do\n sh 'make ' + args\n end\nend",
"title": ""
},
{
"docid": "588f2690bdb13779210bfbc1acecb398",
"score": "0.47895613",
"text": "def install\n # LANG is unset by default on macOS and causes issues when calling getlocale\n # or getdefaultlocale in docutils. Force the default c/posix locale since\n # that's good enough for building the manpage.\n ENV[\"LC_ALL\"] = \"C\"\n\n # Avoid unreliable macOS SDK version detection\n # See https://github.com/mpv-player/mpv/pull/8939\n if OS.mac?\n sdk = (MacOS.version == :big_sur) ? MacOS::Xcode.sdk : MacOS.sdk\n ENV[\"MACOS_SDK\"] = sdk.path\n ENV[\"MACOS_SDK_VERSION\"] = \"#{sdk.version}.0\"\n end\n\n # libarchive is keg-only\n ENV.prepend_path \"PKG_CONFIG_PATH\", Formula[\"libarchive\"].opt_lib/\"pkgconfig\"\n\n # luajit-openresty is keg-only\n ENV.prepend_path \"PKG_CONFIG_PATH\", Formula[\"luajit-openresty\"].opt_lib/\"pkgconfig\"\n\n args = %W[\n --prefix=#{prefix}\n --enable-html-build\n --enable-javascript\n --enable-libmpv-shared\n --enable-lua\n --enable-libarchive\n --enable-uchardet\n --confdir=#{etc}/mpv\n --datadir=#{pkgshare}\n --mandir=#{man}\n --docdir=#{doc}\n --zshdir=#{zsh_completion}\n --lua=luajit\n --disable-swift\n ]\n\n args << \"--enable-libbluray\" if build.with? \"libbluray\"\n args << \"--enable-caca\" if build.with? \"libcaca\"\n args << \"--enable-dvdnav\" if build.with? \"dvdnav\"\n args << \"--enable-rubberband\" if build.with? \"rubberband\"\n args << \"--enable-lgpl\" if build.with? \"lgpl\"\n\n python3 = \"python3.10\"\n system python3, \"bootstrap.py\"\n system python3, \"waf\", \"configure\", *args\n system python3, \"waf\", \"install\"\n\n if build.with? \"bundle\"\n system \"python3\", \"TOOLS/osxbundle.py\", \"build/mpv\"\n prefix.install \"build/mpv.app\"\n end\n\n bash_completion.install \"etc/mpv.bash-completion\" => \"mpv\"\n end",
"title": ""
},
{
"docid": "628c0d2cd5208b8ef97565687d39d9ce",
"score": "0.47878838",
"text": "def test_bad_chicken_deps\n check_deps_fail BadChickenBall unless `/usr/bin/which csc`.chomp.empty?\n end",
"title": ""
},
{
"docid": "cebd01c4f529d366ffb9a33f2ae22477",
"score": "0.4785288",
"text": "def build_apple(rb_file, device)\n check_build_src_file(rb_file)\n\n # Check for Simple 2D framework,\n unless File.exists?('/usr/local/Frameworks/Simple2D/iOS/Simple2D.framework') && File.exists?('/usr/local/Frameworks/Simple2D/tvOS/Simple2D.framework')\n puts \"#{'Error:'.error} Simple 2D iOS and tvOS frameworks not found. Install them and try again.\\n\"\n exit\n end\n\n # Check if MRuby exists; if not, quit\n if `which mruby`.empty?\n puts \"#{'Error:'.error} Can't find MRuby, which is needed to build native Ruby 2D applications.\\n\"\n exit\n end\n\n # Add debugging information to produce backtrace\n if @debug then debug_flag = '-g' end\n\n # Assemble the Ruby 2D library in one `.rb` file and compile to bytecode\n make_lib\n `mrbc #{debug_flag} -Bruby2d_lib -obuild/lib.c build/lib.rb`\n\n # Read the provided Ruby source file, copy to build dir and compile to bytecode\n File.open('build/src.rb', 'w') { |file| file << strip_require(rb_file) }\n `mrbc #{debug_flag} -Bruby2d_app -obuild/src.c build/src.rb`\n\n # Copy over iOS project\n FileUtils.cp_r \"#{@gem_dir}/assets/#{device}\", \"build\"\n\n # Combine contents of C source files and bytecode into one file\n File.open(\"build/#{device}/main.c\", 'w') do |f|\n f << \"#define RUBY2D_IOS_TVOS 1\" << \"\\n\\n\"\n f << \"#define MRUBY 1\" << \"\\n\\n\"\n f << File.read(\"build/lib.c\") << \"\\n\\n\"\n f << File.read(\"build/src.c\") << \"\\n\\n\"\n f << File.read(\"#{@gem_dir}/ext/ruby2d/ruby2d.c\")\n end\n\n # Build the Xcode project\n `simple2d build --#{device} build/#{device}/MyApp.xcodeproj`\n\n # Clean up\n clean_up unless @debug\n\n # Success!\n puts \"App created at `build/#{device}`\"\nend",
"title": ""
},
{
"docid": "9de88493acb8eea88116633e5715ae27",
"score": "0.47773048",
"text": "def flutter_ios_podfile_setup; end",
"title": ""
},
{
"docid": "f7c093a5ea21aa1e7bb9866a4c31f479",
"score": "0.47762477",
"text": "def add_swift_fallback_version(installer_context, version)\n installer_context.pod_targets.select(&:uses_swift?).each do |target|\n target.root_spec.swift_versions << swift_fallback_version if target.root_spec.swift_versions.empty?\n\n # fix crash in target_validator.rb:119 (undefined method `empty?' for nil:NilClass)\n target.instance_variable_set(:@swift_version, swift_fallback_version) unless target.swift_version\n end\nend",
"title": ""
},
{
"docid": "4dfdff5c63a02da0b6a51174735b1bf2",
"score": "0.4775647",
"text": "def prepare_for_installation; end",
"title": ""
},
{
"docid": "3340525d9fa5eb33b086158a9f6e9d31",
"score": "0.4774276",
"text": "def patches\n # DATA is the embedded diff that comes after __END__ in this file!\n # In this example we only need the patch for older clang than 425:\n DATA unless MacOS.clang_build_version >= 425\n end",
"title": ""
},
{
"docid": "62a6d7a13d2d7b21f5d168920c83b4bd",
"score": "0.47725958",
"text": "def install\n # TODO: Per the mac info page above, should probably set LDLIBS/CFLAGS\n # so that you can install dependencies outside of /usr/local\n system \"make\", \"PREFIX=#{prefix}\", \"install\"\n end",
"title": ""
},
{
"docid": "606f1df9c5ce23b878caefd51e8b0396",
"score": "0.4767271",
"text": "def update_app_version_numbers\n version_string = ENV['FORCED_VERSION_NUMBER_STRING']\n xcode_project_version = nil\n\n if !version_string.nil? && version_string.length > 0\n\n puts \"using forced version \\\"#{version_string}\\\"\"\n\n else\n\n version_string = get_semver_from_branch(ENV['GIT_HEAD_REF'])\n\n if version_string.nil?\n\n app_store_build_number(live: false)\n latest_app_store_version = lane_context[SharedValues::LATEST_VERSION]\n xcode_project_version = get_project_xcode_version\n\n # use largest version (note ascii comparison - not sure if accurate enough)\n version_string = latest_app_store_version > xcode_project_version ? latest_app_store_version : xcode_project_version\n puts \"using version #{version_string} (latest app store = #{latest_app_store_version}, project version = #{xcode_project_version})\"\n\n end\n\n end\n\n # increment build number\n forced_build_number = ENV['FORCED_BUILD_NUMBER']\n if forced_build_number.nil? || forced_build_number.empty?\n current_build_number = parse_latest_testflight_build_number(version_string)\n\n if current_build_number == 0\n if m = version_string.match(semver_regex)\n # if no existing number was found we need to check variations of the same version\n # since Apple handles 1, 1.0, and 1.0.0 independently, but they share build number\n puts \"build number is 0 - checking version variations in case there's a match\"\n\n major = m.captures[0]\n minor = m.captures[1]\n patch = m.captures[2]\n\n puts \"major=#{major} minor=#{minor} patch=#{patch}\"\n if patch == '0'\n variation = \"#{major}.#{minor}\"\n current_build_number = latest_testflight_build_number(version: variation, initial_build_number: 0)\n puts \"variation \\\"#{variation}\\\" = #{current_build_number}\"\n\n if current_build_number == 0 && minor == '0'\n variation = major\n current_build_number = latest_testflight_build_number(version: variation, initial_build_number: 0)\n puts \"variation \\\"#{variation}\\\" = #{current_build_number}\"\n end\n end\n else\n UI.important 'build number is 0 and version is not semantically correct - unable to check version variations (build number may be incorrect)'\n end\n\n end\n\n build_number = current_build_number + 1\n increment_build_number(build_number: build_number)\n else\n puts \"using forced build number \\\"#{forced_build_number}\\\"\"\n build_number = forced_build_number\n increment_build_number(build_number: build_number)\n end\n\n # set version number\n current_version_string = xcode_project_version || get_project_xcode_version\n increment_version_number(version_number: version_string)\n update_package_version(version_string)\n\n puts \"build_number #{current_build_number} => #{build_number}\"\n puts \"version_number #{current_version_string} => #{version_string}\"\nend",
"title": ""
},
{
"docid": "4b1defa5e11389737510e5cd42177f3d",
"score": "0.47584397",
"text": "def install\n # ENV.deparallelize # if your formula fails when building in parallel\n # Remove unrecognized options if warned by configure\n system \"./configure\", \"--disable-debug\",\n \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--disable-macos-framework\", # as this is hardcoded to write to protected /library\n \"--prefix=#{prefix}\"\n # system \"cmake\", \".\", *std_cmake_args\n system \"make\", \"install\" # if this fails, try separate make/make install steps\n end",
"title": ""
},
{
"docid": "c8d072f64d6b00a044669ade8e859ead",
"score": "0.47512043",
"text": "def pre_install; end",
"title": ""
},
{
"docid": "a39ce77ba508252564a5ad0bcd08acd9",
"score": "0.47476923",
"text": "def install\n # ENV.deparallelize # if your formula fails when building in parallel\n # Remove unrecognized options if warned by configure\n system \"./configure\", \"--target=x86_64-pc-linux-gnu\",\n \"--prefix=#{prefix}\",\n \"--with-python=yes\",\n \"--enable-tui\",\n \"--with-curses\",\n \"--disable-nls\",\n \"--disable-werror\",\n \"--disable-gas\",\n \"--disable-binutils\",\n \"--disable-ld\",\n \"--disable-gprof\"\n system \"make\"\n system \"make\", \"install\"\n system \"cp\", \"rust-x86_64-elf-gdb\", \"#{prefix}/bin/rust-x86_64-elf-gdb\"\n system \"chmod\", \"+x\", \"#{prefix}/bin/rust-x86_64-elf-gdb\"\n end",
"title": ""
},
{
"docid": "e1c10270255e50bc3fe357726836facc",
"score": "0.47425872",
"text": "def clean_environment\n %{export GIT_SSH=\"#{ENV['GIT_SSH']}\" && export LANG=\"en_US.UTF-8\" && unset RUBYOPT BUNDLE_PATH BUNDLE_FROZEN BUNDLE_WITHOUT BUNDLE_BIN BUNDLE_GEMFILE}\n end",
"title": ""
},
{
"docid": "5ee91310be856b573efad992684e0cf6",
"score": "0.4738927",
"text": "def post_install; end",
"title": ""
},
{
"docid": "2cba17198118757502a3f74df02f4752",
"score": "0.47342417",
"text": "def install\n # ENV.deparallelize # if your formula fails when building in parallel\n system \"make\", \"CC=clang\"\n bin.install 'lz4mt'\n end",
"title": ""
},
{
"docid": "d508155c5f0640b795db2ca94e724e8d",
"score": "0.47320983",
"text": "def build_errors_for_spec(spec, file, platform_name)\n messages = []\n puts \"\\n\\n#{spec} - generating build errors for #{platform_name} platform\".yellow.reversed if config.verbose?\n podfile = podfile_from_spec(spec, file, platform_name)\n Installer.new(podfile).install!\n\n return messages if `which xcodebuild`.strip.empty?\n output = Dir.chdir(config.project_pods_root) { `xcodebuild 2>&1` }\n clean_output = process_xcode_build_output(output).map {|l| \"#{platform_name}: #{l}\"}\n messages += clean_output\n puts(output) if config.verbose?\n messages\n end",
"title": ""
},
{
"docid": "b01525c4259497362915aaf54747baa5",
"score": "0.47309732",
"text": "def buildLib(arch, isSim, host, minSDK, output, optFlags)\n Dir.chdir(SRC_DIR)\n\n puts \"Using architecture #{arch}, minimum iOS version: #{minSDK}\"\n puts \" => Configuring\"\n\n sdk = isSim ? \"iphonesimulator\" : \"iphoneos\"\n sdkPath = `xcrun -sdk #{sdk} --show-sdk-path`\n\n minSDK = isSim ? \"ios-simulator-version-min=#{minSDK}\" : \"iphoneos-version-min=#{minSDK}\"\n\n hostFlags = \"-arch #{arch} -m#{minSDK} -isysroot #{sdkPath}\"\n\n # compiling with USB support would require compiling libusb which itself needs iOS IOKit headers. Unfortunately\n # those are private and the app would require root privileges to use the USB devices\n configureOptions = \"--disable-local-backends --without-usb --enable-static --disable-shared --disable-warnings --enable-pthread --enable-silent-rules\"\n\n flags = {\n \"CC\" => `xcrun -find -sdk #{sdk} cc`,\n \"CPP\" => `xcrun -find -sdk #{sdk} cpp`,\n \"CFLAGS\" => hostFlags + \" \" + optFlags,\n \"CXXFLAGS\" => hostFlags + \" \" + optFlags,\n \"LDFLAGS\" => hostFlags,\n }\n\n dateStart = Time.now\n systemWithLog(flags, \"./configure --host=#{host} --prefix=\\\"#{output}\\\" #{configureOptions}\")\n\n # remove references of byte_order.h\n removeLineInFile(\"include/byteorder.h\", \"byte_order.h\")\n\n puts \" => Building\"\n systemWithLog(\"make clean\")\n systemWithLog(\"make V=0 -j#{MAKE_JOBS}\")\n systemWithLog(\"make install\")\n\n elapsed = (Time.now - dateStart).round\n puts \" => Time: #{elapsed} seconds\"\n puts \"\"\nend",
"title": ""
},
{
"docid": "055b2e3d2088c6e39bcf4867ce0160bc",
"score": "0.47267482",
"text": "def stage3\n set_temp_options(:nopaludis => true) do\n Athenry::build.target(\"install_pkgmgr\", \"update_everything\", \"update_configs\", \"rebuild\")\n end\n end",
"title": ""
},
{
"docid": "f05674e57c92078bff42a73d03c9a8b4",
"score": "0.47162256",
"text": "def after_lint; end",
"title": ""
},
{
"docid": "493deba27802efce5a107377ba7ecc2a",
"score": "0.47136307",
"text": "def rearrange_and_reship(rake, target_repo, signing_bundle)\n puts \"Retrieving packages...\"\n system(\"#{rake} -s pl:jenkins:retrieve &> /dev/null\")\n\n puts \"Moving the packages into the new layout...\"\n puts \"Moving debs...\"\n rearrange_packages(\"pkg/deb\", \"new_pkg/deb\", target_repo, [\"\"])\n puts \"Moving rpms...\"\n rearrange_packages(\"pkg/el\", \"new_pkg/el\", target_repo, [\"i386\", \"x86_64\", \"SRPMS\"])\n rearrange_packages(\"pkg/fedora\", \"new_pkg/fedora\", target_repo, [\"i386\", \"x86_64\", \"SRPMS\"])\n\n puts \"Moving new_pkg into place on top of pkg...\"\n FileUtils.mv(\"pkg\", \"old_pkg\")\n FileUtils.mv(\"new_pkg\", \"pkg\")\n\n puts \"uber_shipping relocated packages...\"\n ENV[\"SIGNING_BUNDLE\"] = \"../#{signing_bundle}\"\n ENV[\"TAR\"] = \"FALSE\"\n system(\"#{rake} -s pl:jenkins:sign_all pl:uber_ship pl:remote:update_apt_repo pl:remote:update_yum_repo\")\nend",
"title": ""
},
{
"docid": "193db0d9398fed30055dcf1895e8a1f8",
"score": "0.4710999",
"text": "def osx?(platform = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "68571c035dacd3b12605080253f32b9f",
"score": "0.47012842",
"text": "def update_library_index\n # install random lib so the arduino IDE grabs a new library index\n # see: https://github.com/arduino/Arduino/issues/3535\n install_library(WORKAROUND_LIB)\n end",
"title": ""
},
{
"docid": "4363cec4d362a1f00d476350303c339f",
"score": "0.47011074",
"text": "def xctools_fucked?\n xcode_folder == \"/\"\n end",
"title": ""
},
{
"docid": "4b614fcc2734ae8696f8c3e611b6597b",
"score": "0.47009432",
"text": "def prep_build(version)\n # Reset back to master and ensure the build branch is removed\n %x( cd #{@work_dir} && git checkout -f master && git branch -D build &> /dev/null )\n\n # Checkout version as build branch\n %x( cd #{@work_dir} && git checkout #{version} -b build )\n\n # Clean everything\n %x( cd #{@work_dir} && git clean -f -d -x )\n end",
"title": ""
},
{
"docid": "33ef19cb0e6b65aae51f7d3adb86550f",
"score": "0.46999004",
"text": "def install\n # Now the sources (from `url`) are downloaded, hash-checked and\n # Homebrew has changed into a temporary directory where the\n # archive has been unpacked or the repository has been cloned.\n\n # For Cmake, we have some necessary defaults in `std_cmake_args`:\n mkdir \"build\" do\n system \"cmake\", \"..\", *std_cmake_args\n system \"cmake\", \".\"\n system \"make\", \"install\"\n end\n\n\n # If the arguments given to configure (or make or cmake) are depending\n # on options defined above, we usually make a list first and then\n # use the `args << if <condition>` to append to:\n# args = \"-DCMAKE_BUILD_TYPE:STRING=RELEASE\"\n\n # The `build.with?` and `build.without?` are smart enough to do the\n # right thing with respect to defaults defined via `:optional` and\n # `:recommended` dependencies.\n\n # If you need to give the path to lib/include of another brewed formula\n # please use the `opt_prefix` instead of the `prefix` of that other\n # formula. The reasoning behind this is that `prefix` has the exact\n # version number and if you update that other formula, things might\n # break if they remember that exact path. In contrast to that, the\n # `$(brew --prefix)/opt/formula` is the same path for all future\n # versions of the formula!\n\n # A general note: The commands here are executed line by line, so if\n # you change some variable or call a method like ENV.deparallelize, it\n # only affects the lines after that command.\n\n\n # We are in a temporary directory and don't have to care about cleanup.\n\n # Instead of `system \"cp\"` or something, call `install` on the Pathname\n # objects as they are smarter with respect to correcting access rights.\n # (`install` is a Homebrew mixin into Ruby's Pathname)\n\n # Additional downloads can be defined as resources (see above).\n # The stage method will create a temporary directory and yield\n # to a block.\n #resource(\"additional_files\").stage { bin.install \"my/extra/tool\" }\n\n # `name` and `version` are accessible too, if you need them.\n end",
"title": ""
},
{
"docid": "f235680ad08c1bdbe015a4a2180efe90",
"score": "0.4690305",
"text": "def keep_source_code_for_prebuilt_frameworks!\n DSL.dont_remove_source_code = true\n end",
"title": ""
},
{
"docid": "2be5d5a273700d912a014918e136ac5d",
"score": "0.46824065",
"text": "def flipper_post_install(installer)\n installer.pods_project.targets.each do |target|\n if target.name == 'YogaKit'\n target.build_configurations.each do |config|\n config.build_settings['SWIFT_VERSION'] = '4.1'\n end\n end\n end\n file_name = Dir.glob(\"*.xcodeproj\")[0]\n app_project = Xcodeproj::Project.open(file_name)\n app_project.native_targets.each do |target|\n target.build_configurations.each do |config|\n cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '\n unless cflags.include? '-DFB_SONARKIT_ENABLED=1'\n puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'\n cflags << '-DFB_SONARKIT_ENABLED=1'\n end\n config.build_settings['OTHER_CFLAGS'] = cflags\n end\n app_project.save\n end\n installer.pods_project.save\nend",
"title": ""
},
{
"docid": "ef646253689f27b5145e332495915620",
"score": "0.46707237",
"text": "def pkg_binary; \"pacaur\" end",
"title": ""
},
{
"docid": "dc246bc527d33b435c1335f50a7125c2",
"score": "0.4669956",
"text": "def remove_suffix_apple(path)\n path.sub(/\\.(?:dylib|so)\\z/, '')\n end",
"title": ""
},
{
"docid": "919a6bca12d6ad790c361c83643b532d",
"score": "0.46681347",
"text": "def install\n args = [\"--prefix=#{prefix}\"]\n\n inreplace \"autogen.sh\", \"libtoolize\", \"glibtoolize\"\n ENV[\"NOCONFIGURE\"] = \"yes\"\n system \"./autogen.sh\"\n system \"./configure\", *args\n system \"make\", \"install\"\n\n end",
"title": ""
},
{
"docid": "841941ad67b35eac8b4817ed0e65dc20",
"score": "0.46612027",
"text": "def dev_minor() end",
"title": ""
},
{
"docid": "2eb9963a842543876565aeb8f62b91a9",
"score": "0.4653271",
"text": "def compile_android_before\n # TODO\n end",
"title": ""
},
{
"docid": "2eb9963a842543876565aeb8f62b91a9",
"score": "0.4653271",
"text": "def compile_android_before\n # TODO\n end",
"title": ""
},
{
"docid": "95a2b097c595268088365f851cf47f9d",
"score": "0.4648727",
"text": "def before_lint; end",
"title": ""
},
{
"docid": "e7aadfbdf409dcfda4faa80d3bfba02b",
"score": "0.46479863",
"text": "def xfixip(path)\n path.gsub!(/-I\\/usr\\//, \"-I#{TGT_SYS_DIR}usr/\")\n return path\nend",
"title": ""
},
{
"docid": "cd6520d924b68b638c4d3912bb27f27c",
"score": "0.46443802",
"text": "def install\n\n # --- custom ---\n ENV.prepend_path \"PKG_CONFIG_PATH\", \"/usr/local/lib/pkgconfig/\"\n inreplace \"build/modules.conf.in\", /^codecs/, \"#codecs\"\n\n args = []\n if build.with?(\"freetype\")\n ENV.append_to_cflags \"-I#{Formula[\"freetype\"].opt_include}/freetype2/\"\n else\n args << \"--without-freetype\"\n end\n\n if build.with?(\"lua\")\n ENV.append_to_cflags \"-I#{Formula[\"lua\"].opt_include}/lua/\"\n else\n inreplace \"build/modules.conf.in\", \"languages/mod_lua\",\n \"#languages/mod_lua\"\n end\n\n if build.with?(\"amqp\")\n inreplace \"build/modules.conf.in\", \"#event_handlers/mod_amqp\",\n \"event_handlers/mod_amqp\"\n end\n\n if build.with?(\"shout\")\n inreplace \"build/modules.conf.in\", \"#formats/mod_shout\",\n \"formats/mod_shout\"\n end\n\n if build.with?(\"libyuv\")\n raise \"Building with libyuv is not supported yet\"\n else\n args << \"--disable-libyuv\"\n end\n\n if build.with?(\"libvpx\")\n raise \"Building with libvpx is not supported yet\"\n else\n args << \"--disable-libvpx\"\n end\n\n # --- end of custom ---\n\n ENV[\"ac_cv_lib_lzma_lzma_code\"] = \"no\" # prevent opportunistic linkage to xz\n\n # avoid a dependency on ldns to prevent OpenSSL version conflicts\n inreplace \"build/modules.conf.in\", \"applications/mod_enum\",\n \"#applications/mod_enum\"\n\n system \"./bootstrap.sh\", \"-j\"\n\n # tiff will fail to find OpenGL unless told not to use X\n inreplace \"libs/tiff-4.0.2/configure.gnu\", \"--with-pic\", \"--with-pic --without-x\"\n\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--enable-shared\",\n \"--enable-static\",\n \"--prefix=#{prefix}\",\n \"--exec_prefix=#{prefix}\",\n *args,\n \"LIBS=#{ENV['LIBS']}\",\n \"CFLAGS=#{ENV['CFLAGS']}\",\n \"CXXFLAGS=#{ENV['CFLAGS']}\",\n \"LDFLAGS=#{ENV['LDFLAGS']}\"\n\n system \"make\"\n system \"make\", \"install\", \"all\"\n\n if build.with?(\"moh\")\n # Should be equivalent to: system \"make\", \"cd-moh-install\"\n mkdir_p share/\"freeswitch/sounds/music\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-music-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/music\"\n end\n end\n end\n\n if build.with?(\"sounds-en\")\n # Should be equivalent to: system \"make\", \"cd-sounds-install\"\n mkdir_p share/\"freeswitch/sounds/en\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-en-us-callie-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/en\"\n end\n end\n end\n\n if build.with?(\"sounds-fr\")\n # Should be equivalent to: system \"make\", \"cd-sounds-fr-install\"\n mkdir_p share/\"freeswitch/sounds/fr\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-fr-ca-june-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/fr\"\n end\n end\n end\n\n if build.with?(\"sounds-ru\")\n # Should be equivalent to: system \"make\", \"cd-sounds-ru-install\"\n mkdir_p share/\"freeswitch/sounds/ru\"\n [8, 16, 32, 48].each do |n|\n resource(\"sounds-ru-RU-elena-#{n}000\").stage do\n cp_r \".\", share/\"freeswitch/sounds/ru\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "adb30e5f34169b4ec076dbdad2715105",
"score": "0.46391842",
"text": "def needs_sandbox?\n MAC_OS_X_PRODUCT_VERSION > 10.7\n end",
"title": ""
},
{
"docid": "3086712ec2b747b541273ab884c9828f",
"score": "0.46389014",
"text": "def install\n # Avoid references to shim\n inreplace Dir[\"**/*-config.in\"], \"@PKG_CONFIG@\", Formula[\"pkg-config\"].opt_bin/\"pkg-config\"\n\n\n # Add a symlink that points to the X11 include files provided by XQuartz.\n # This prevents the `display wizard` command from segfaulting.\n ln_s \"/opt/X11/include/X11\", \"#{buildpath}/X11\"\n\n\n # Adding -I/opt/X11/include and -L/opt/X11/lib via compiler flags is blocked\n # by the HOMEBREW_CCCFG=Osa setting. (=sa works, maybe)\n #\n # See the following for details:\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/extend/ENV/super.rb#L83-L88\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/shims/super/cc#L36\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/shims/super/cc#L108\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/shims/super/cc#L140\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/shims/super/cc#L171 <-- refurbish_arg,\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/shims/super/cc#L252-L254 /opt/X11 is being filtered out\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/shims/super/cc#L270\n # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/shims/super/cc#L357\n\n # Consider appending /opt/X11/lib/pkgconfig to PKG_CONFIG_PATH and/or\n # adding a symlink to /opt/X11/lib during build instead of depending on\n # libx11/xorgproto.\n\n # See also the \"x11\" method that was removed from brew recently:\n # (Library/Homebrew/extend/os/mac/extend/ENV/std.rb)\n # https://github.com/Homebrew/brew/commit/87dd13aea6691e9d5e0f3ba8d1d1f862a809212a#diff-ed4c0c77ea1a192666ae8a1758389fb65054649d71e0e39e14ee08e919fdb2b3L13-L34\n\n\n args = [\n \"--enable-osx-universal-binary=no\",\n \"--prefix=#{prefix}\",\n \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--disable-opencl\",\n \"--enable-shared\",\n \"--enable-static\",\n \"--with-freetype=yes\",\n \"--with-modules\",\n \"--with-openjp2\",\n \"--with-openexr\",\n \"--with-webp=yes\",\n \"--with-heic=yes\",\n \"--with-gslib\",\n \"--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts\",\n \"--with-lqr\",\n \"--without-fftw\",\n \"--without-pango\",\n \"--without-wmf\",\n \"--enable-openmp\",\n \"ac_cv_prog_c_openmp=-Xpreprocessor -fopenmp\",\n \"ac_cv_prog_cxx_openmp=-Xpreprocessor -fopenmp\",\n \"LDFLAGS=-lomp -lz\",\n ]\n\n # versioned stuff in main tree is pointless for us\n inreplace \"configure\", \"${PACKAGE_NAME}-${PACKAGE_BASE_VERSION}\", \"${PACKAGE_NAME}\"\n system \"./configure\", *args\n system \"make\", \"install\"\n end",
"title": ""
}
] |
7d4b7ef3d90927cf4058e9d0463e6f7f
|
DELETE /announcers/1 DELETE /announcers/1.xml
|
[
{
"docid": "0953d710d838fe05a2780c13884edd26",
"score": "0.7127029",
"text": "def destroy\n @announcer = Announcer.find(params[:id])\n @announcer.destroy\n\n respond_to do |format|\n format.html { redirect_to(announcers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
[
{
"docid": "5df566458a239b2ad4d76658a823ac43",
"score": "0.6384154",
"text": "def destroy\n @ann.destroy\n respond_to do |format|\n format.html { redirect_to anns_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1592c9a7c989d01a99d8c2f4e789eab",
"score": "0.6292607",
"text": "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"title": ""
},
{
"docid": "7859d77c4ee2493d009eafab8f9e28be",
"score": "0.6245101",
"text": "def destroy\n @discovery = Discovery.find(params[:id])\n @discovery.destroy\n\n respond_to do |format|\n format.html { redirect_to(discoveries_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dfdfcbb7fc9dc8bb0179a5a59a73cbe4",
"score": "0.61864585",
"text": "def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end",
"title": ""
},
{
"docid": "ddd66135e258abacd5f974f0212e8e97",
"score": "0.61259645",
"text": "def ac_ac_nountg( this, xml )\n xml.vlan Netconf::JunosConfig::DELETE\n end",
"title": ""
},
{
"docid": "bfadc22e8c2d8b0ff971d0fcfda3170e",
"score": "0.60760635",
"text": "def destroy\n @abonne = Abonne.find(params[:id])\n @abonne.destroy\n\n respond_to do |format|\n format.html { redirect_to(abonnes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f367b8ae8a1b0d0e1af732cbc81b8b1f",
"score": "0.6060774",
"text": "def destroy\n @announcement = Announcement.find(params[:id])\n @announcement.destroy\n\n respond_to do |format|\n format.html { redirect_to(announcements_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f367b8ae8a1b0d0e1af732cbc81b8b1f",
"score": "0.6060774",
"text": "def destroy\n @announcement = Announcement.find(params[:id])\n @announcement.destroy\n\n respond_to do |format|\n format.html { redirect_to(announcements_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4037940d9591101262ded162a84f223c",
"score": "0.6044567",
"text": "def destroy\n @agent = Agent.find(params[:id])\n @agent.destroy\n \n respond_to do |format|\n format.html { redirect_to(agents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2f59fb31f7925721f74c0e30ba5be2dc",
"score": "0.6040917",
"text": "def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"title": ""
},
{
"docid": "a0205b1e659c52cc9bd974243d00f3a6",
"score": "0.6030006",
"text": "def destroy\n client = Connection::MarkLogic.new.client\n client.send_corona_request(\"/v1/documents?uri=/amandments/amandment_#{@amandment.id}.xml\", :delete)\n @amandment.destroy\n respond_to do |format|\n format.html { redirect_to home_meeting_path, notice: 'Amandman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6e381078f974aee77946c7efedaee9d",
"score": "0.6029095",
"text": "def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "28879e8f4613f1b09bbbd3f7c943aa24",
"score": "0.6014091",
"text": "def destroy\n @gtfs_agency = GtfsAgency.find(params[:id])\n @gtfs_agency.destroy\n\n respond_to do |format|\n format.html { redirect_to(gtfs_agencies_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f5dec0da8c1a2e938463444287862f87",
"score": "0.6008856",
"text": "def destroy\n @arc = Arc.find(params[:id])\n @arc.destroy\n\n respond_to do |format|\n format.html { redirect_to(arcs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1c684f8fe0f9a7610ed6d17803712727",
"score": "0.6007246",
"text": "def destroy\n @add_on = AddOn.find(params[:id])\n @add_on.destroy\n\n respond_to do |format|\n format.html { redirect_to(add_ons_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "69b205c158f7212cc750ed38fc878f1c",
"score": "0.6004607",
"text": "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"title": ""
},
{
"docid": "bd1c1d9f8d495d65c34f3372c81a2c8c",
"score": "0.5993338",
"text": "def destroy\n @annex = Annex.find(params[:id])\n @annex.destroy\n\n respond_to do |format|\n format.html { redirect_to annexes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "40fd2e71bb7f066c7745d537a44332dd",
"score": "0.59929544",
"text": "def destroy\n @cancer = Cancer.find(params[:id])\n @cancer.destroy\n\n respond_to do |format|\n format.html { redirect_to(cancers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e1d6f603cb5ea1e475ea71422432aeae",
"score": "0.59863126",
"text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"title": ""
},
{
"docid": "3d26e6333940ec75894ae9b12ebd2c24",
"score": "0.5959045",
"text": "def destroy\n @atest = Atest.find(params[:id])\n @atest.destroy\n\n respond_to do |format|\n format.html { redirect_to(atests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f607e5ed51a3acdfc7771fccdd5b99ca",
"score": "0.5941502",
"text": "def destroy\n @agent = Agent.find(params[:id])\n @agent.destroy\n\n respond_to do |format|\n format.html { redirect_to(agents_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"title": ""
},
{
"docid": "c7d1b8cdc60510a6f59487b8c3382631",
"score": "0.5939846",
"text": "def destroy\n @avance = Avance.find(params[:id])\n @avance.destroy\n\n respond_to do |format|\n format.html { redirect_to(avances_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cd5ff41af079e8eafbbca9509fc3c7a6",
"score": "0.5923909",
"text": "def destroy\n @organic_certifier = OrganicCertifier.find(params[:id])\n @organic_certifier.destroy\n\n respond_to do |format|\n format.html { redirect_to(organic_certifiers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ebe35303c7d85a6528e9dc9a87ee6983",
"score": "0.5917181",
"text": "def destroy\n @announce = Announce.find(params[:id])\n @announce.destroy\n\n respond_to do |format|\n format.html { redirect_to announces_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a378d1965c4aa50ef4f190f366bbed6d",
"score": "0.5915299",
"text": "def destroy\n @announce = Announce.find(params[:id])\n @announce.destroy\n #AnnounceMailer.delete_mail(@announce).deliver\n\n respond_to do |format|\n format.html { redirect_to announces_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e950d17dd165fefb44d698159919dce9",
"score": "0.5912351",
"text": "def destroy\n @erratum = Erratum.find(params[:id])\n @erratum.destroy\n\n respond_to do |format|\n format.html { redirect_to(errata_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "157fe8abaaec5b1279f321e52c86bc71",
"score": "0.59106207",
"text": "def delete!\n Recliner.delete(uri)\n end",
"title": ""
},
{
"docid": "8ab616cf326d6a390a622755dac6c9b1",
"score": "0.59080154",
"text": "def destroy\n @attender = Attender.find(params[:id])\n @attender.destroy\n\n respond_to do |format|\n format.html { redirect_to(attenders_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "27b1c6d9cb659fab910ca58a80a0ff15",
"score": "0.59039086",
"text": "def destroy\n @advertise = Advertise.find(params[:id])\n @advertise.destroy\n\n respond_to do |format|\n format.html { redirect_to(advertises_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "940492042d326ca39a1f04e19b48c5f4",
"score": "0.5887926",
"text": "def destroy\n @configattribincl.destroy\n respond_to do |format|\n format.html { redirect_to configattribs_path, notice: 'Configattribincl Threshold is reset to default.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "27602a53dfa7f31c7fcdc743b164b1ce",
"score": "0.58860356",
"text": "def destroy\n @adjunto = Adjunto.find(params[:id])\n @adjunto.destroy\n\n respond_to do |format|\n format.html { redirect_to(adjuntos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1736037f1555748362092bd094005088",
"score": "0.5882507",
"text": "def destroy\n @announcement = Announcement.find(params[:id])\n @announcement.destroy\n\n respond_to do |format|\n format.html do\n flash[:notice] = 'Announcement has been successfully delected'\n redirect_to announcements_path \n end\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e9c7a1b8669d243c9fcb9ab969646ed2",
"score": "0.58805686",
"text": "def destroy\n @probe = Probe.find(params[:id])\n @probe.destroy\n\n respond_to do |format|\n format.html { redirect_to(probes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aff5b6d6aa18ca99891b270336c33c35",
"score": "0.58791655",
"text": "def destroy\n @hr_attendence = Hr::Attendence.find(params[:id])\n @hr_attendence.destroy\n\n respond_to do |format|\n format.html { redirect_to(hr_attendences_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2d8764b1f2f25110816a17f73f497f0e",
"score": "0.5866013",
"text": "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"title": ""
},
{
"docid": "7bbea9463c9d1cdcd294068bed80fcdb",
"score": "0.5864451",
"text": "def destroy\n @analysis = Analysis.find(params[:id])\n @analysis.destroy\n\n respond_to do |format|\n format.html { redirect_to(analyses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7bbea9463c9d1cdcd294068bed80fcdb",
"score": "0.5864451",
"text": "def destroy\n @analysis = Analysis.find(params[:id])\n @analysis.destroy\n\n respond_to do |format|\n format.html { redirect_to(analyses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8eab047d8198ff394bbb79830b6fe06f",
"score": "0.5858041",
"text": "def destroy\n @calibration = Probe::Calibration.find(params[:id])\n @calibration.destroy\n\n respond_to do |format|\n format.html { redirect_to(calibrations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "af0bd566bb94063d62e4049bfc3d9e37",
"score": "0.5855487",
"text": "def destroy\n @agent = Agent.find(params[:id])\n flash[:success] = \"#{@agent.username}删除成功\"\n @agent.destroy\n\n respond_to do |format|\n format.html { redirect_to(agents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b60483de465d50804451a51ff00906ba",
"score": "0.58525443",
"text": "def destroy\n @nad = Nad.find(params[:id])\n @nad.destroy\n\n respond_to do |format|\n format.html { redirect_to(nads_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f20d9ded5aae563e53bfaffd26ceb918",
"score": "0.5841836",
"text": "def destroy\n @retain_node_selector = RetainNodeSelector.find(params[:id])\n @retain_node_selector.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_node_selectors_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "63cf3a67c70c4ecbcce21a3b7bb864c0",
"score": "0.5839489",
"text": "def destroy\n @annonce.destroy\n respond_to do |format|\n format.html { redirect_to annonces_url, notice: 'Votre annonce à été supprimé avec succès.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "154d520987006662e13470650a32f96d",
"score": "0.58343726",
"text": "def destroy\n @ingredience = Ingredience.find(params[:id])\n @ingredience.destroy\n\n respond_to do |format|\n format.html { redirect_to(ingrediences_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "50f2b2e88f8fdfdfeb6daf96a99f6efa",
"score": "0.58263665",
"text": "def destroy\n @email_tracker = EmailTracker.find(params[:id])\n @email_tracker.destroy\n\n respond_to do |format|\n format.html { redirect_to(email_trackers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0498158b38a50a93fe03d1ab9f5d484f",
"score": "0.5823211",
"text": "def destroy\n @kontak = Kontak.find(params[:id])\n @kontak.destroy\n\n respond_to do |format|\n format.html { redirect_to(kontaks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e23f1e8d95fa071abfac152e12fe3594",
"score": "0.5822903",
"text": "def destroy\n @activity_award_cfg.destroy\n respond_to do |format|\n format.html { redirect_to admin_activity_award_cfgs_url, notice: 'Activity award cfg was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "26766c587d0e9a89aacadefc80071df2",
"score": "0.58186746",
"text": "def destroy\r\n @antenne = Antenne.find(params[:id])\r\n @antenne.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to antennes_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.58151907",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "fff4919c4729b46193363f066dfeefff",
"score": "0.5814568",
"text": "def destroy\n @notifier.destroy\n\n respond_to do |format|\n format.html { redirect_to(notifiers_url, :notice => 'Kennisgever is succesvol ontkoppeld.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7fba944076e3d66dbbad3bbe3c5b87f9",
"score": "0.5812791",
"text": "def destroy\n @agendasalerta = Agendasalerta.find(params[:id])\n @agendasalerta.destroy\n\n respond_to do |format|\n format.html { redirect_to(agendasalertas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9e434c7f8b15d1f42ded2f60ce20d53d",
"score": "0.5803029",
"text": "def destroy\n @referral = Referral.find(params[:id])\n @referral.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_referrals_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fe807a194aeee6e99c8cbb022b81355c",
"score": "0.5801934",
"text": "def destroy\n @docent = Docent.find(params[:id])\n @docent.destroy\n\n respond_to do |format|\n format.html { redirect_to(docents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0e8c3cb02e4db34c6989f4f13b161ec3",
"score": "0.5801261",
"text": "def destroy\n @partner_coordinator_association = PartnerCoordinatorAssociation.find(params[:id])\n @partner_coordinator_association.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_partner_coordinator_associations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b7956d06762df94bdd15548341fec4c7",
"score": "0.5799334",
"text": "def destroy\n @correspondence = Correspondence.find(params[:id])\n @correspondence.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondences_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "15a73f975b874605a2ed717d738a7083",
"score": "0.57958716",
"text": "def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end",
"title": ""
},
{
"docid": "4b10cb0edd5cb6cb0127366994c231d7",
"score": "0.5793731",
"text": "def destroy\n @almacen = Almacen.find(params[:id])\n @almacen.destroy\n \n respond_to do |format|\n format.html { redirect_to(almacenes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "599c44a4edf08ea2f33d74b38abefe09",
"score": "0.5789986",
"text": "def destroy\n @bouncer = Bouncer.find(params[:id])\n @bouncer.destroy\n\n respond_to do |format|\n format.html { redirect_to(bouncers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2ab8ce73f6e0eb2b3d94166468072558",
"score": "0.5789688",
"text": "def destroy\n @advertiser = Advertiser.find(params[:id])\n @advertiser.destroy\n\n respond_to do |format|\n format.html { redirect_to advertisers_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c62aa2703f187d5fcecd5d9faa89a0e1",
"score": "0.5788568",
"text": "def destroy\n @announce_c = AnnounceC.find(params[:id])\n @announce_c.destroy\n\n respond_to do |format|\n format.html { redirect_to announce_cs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9928e5bd63688a23cf4b8a0eee784013",
"score": "0.57884216",
"text": "def report_delete(id)\r\n\t\tpost= { \"token\" => @token, \"report\" => id } \r\n\t\tdocxml=nessus_request('report/delete', post)\r\n\t\treturn docxml\r\n\tend",
"title": ""
},
{
"docid": "8775538da87f35b17ab8bff9dee3c793",
"score": "0.5781488",
"text": "def destroy\n @alfresco = Alfresco.find(params[:id])\n @alfresco.destroy\n\n respond_to do |format|\n format.html { redirect_to(alfrescos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bcebd43318fc74d2f6215b1e64763e06",
"score": "0.57791984",
"text": "def destroy\n @gene_ontology = GeneOntology.find(params[:id])\n @gene_ontology.destroy\n\n respond_to do |format|\n format.html { redirect_to(gene_ontologies_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "397a625e4f57d966b71ec50ccdcdd3a2",
"score": "0.577382",
"text": "def destroy\n @estatu = Estatu.find(params[:id])\n @estatu.destroy\n\n respond_to do |format|\n format.html { redirect_to(estatus_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ae9ea11e2d5c582f9670aa4799f28403",
"score": "0.5773385",
"text": "def destroy\n @concert = Concert.find(params[:id])\n @concert.destroy\n\n respond_to do |format|\n format.html { redirect_to(concerts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "83e7c26dd2d24c709af18ea6dcbe913d",
"score": "0.57732797",
"text": "def destroy\n @annonce.destroy\n respond_to do |format|\n format.html { redirect_to annonces_url, notice: 'Annonce was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "84622b9fedb3b9de86b89379a2e6ee52",
"score": "0.5770672",
"text": "def destroy\n @attend = Attend.find(params[:id])\n @attend.destroy\n\n respond_to do |format|\n format.html { redirect_to(attends_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "43689ee1f0059fd835c3a7b775701326",
"score": "0.5765318",
"text": "def destroy\n @annotation.destroy\n\n respond_to do |format|\n flash[:notice] = 'Annotation successfully deleted.'\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e205f943cc21314a5cfe4c64344fdca5",
"score": "0.5764847",
"text": "def destroy\r\n @asignacion = Asignacion.find(params[:id])\r\n @asignacion.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(asignacions_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "2fb2155b4de84bfe8d020512e257376e",
"score": "0.5760526",
"text": "def destroy\n @incrustation_tmp = @incrustation.dup\n @incrustation.destroy\n record_activity(@incrustation_tmp)\n respond_to do |format|\n format.html { redirect_to admin_incrustations_url, notice: 'Вставка была успешно удалена.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffbd8ee10242255ff44a63c852548195",
"score": "0.5760337",
"text": "def destroy\n @annotation.destroy\n respond_to do |format|\n flash[:notice] = 'Annotation successfully deleted.'\n format.html { redirect_to :back}\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b8fb9fc8bb3131574adcc49229b6a67a",
"score": "0.5759834",
"text": "def destroy\n @engagement_attendee.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "897c997c74036a4e9d22d8256387d51c",
"score": "0.5759042",
"text": "def destroy\n @user_testcase_xref = UserTestcaseXref.find(params[:id])\n @user_testcase_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_testcase_xrefs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c2c6f6a47e92d1810491544ee60e75e4",
"score": "0.5756815",
"text": "def destroy\n @clicker = Clicker.find(params[:id])\n @clicker.destroy\n\n respond_to do |format|\n format.html { redirect_to(clickers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c88c9ad548efff996a8e7291cb792bab",
"score": "0.5755996",
"text": "def destroy\n @actuator = Actuator.find(params[:id])\n @actuator.destroy\n\n respond_to do |format|\n format.html { redirect_to(actuators_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "25a3b19a5184e05b344bc615ec5c39b7",
"score": "0.57553196",
"text": "def destroy_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n @entry_instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(entry_instruments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0991cf5398650ae7416546d25c2629f4",
"score": "0.5754934",
"text": "def destroy\n @aisle = Aisle.find(params[:id])\n @aisle.destroy\n\n respond_to do |format|\n format.html { redirect_to(aisles_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d7d4453ffcd956013346990070d08453",
"score": "0.5752441",
"text": "def delete\n ruta = \"/actions/#{action_id}\"\n client.delete(ruta)\n end",
"title": ""
},
{
"docid": "b31a486035219c100d69c11f28cda63a",
"score": "0.57488656",
"text": "def destroy\n @patient_encounter = PatientEncounter.find(params[:id])\n @patient_encounter.destroy\n\n respond_to do |format|\n format.html { redirect_to(patient_encounters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4032e5231452c3da5aa612d9e4278e74",
"score": "0.5747446",
"text": "def destroy\n @configattribmaster.destroy\n respond_to do |format|\n format.html { redirect_to configattribmasters_url, notice: 'Configattribmaster was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f7a1e7b74693d11434996bb3b10a4a13",
"score": "0.5746018",
"text": "def destroy\n @assessment = Assessment.find(params[:id])\n @assessment.destroy\n \n respond_to do |format|\n format.html { redirect_to(assessments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "22328cbae1768553b796ad8a4f04f990",
"score": "0.5740884",
"text": "def destroy\n @deposit_threshold = DepositThreshold.find(params[:id])\n @deposit_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(deposit_thresholds_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "56b0b39e07ae06f6596550d3f6e12349",
"score": "0.57386655",
"text": "def destroy\n @guide_taxon.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_guide_url(@guide_taxon.guide_id), notice: \"Taxon removed\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "81b4fce2d34ac7672779f1ffd60fbc32",
"score": "0.57332397",
"text": "def destroy\n @coordinator = Coordinator.find(params[:id])\n @coordinator.destroy\n\n respond_to do |format|\n format.html { redirect_to(coordinator_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "55f04d8e84c1c8d93351c7837c2319f7",
"score": "0.57325804",
"text": "def destroy\n @agency.update_attribute(:status, 'N')\n respond_to do |format|\n format.html { redirect_to agencies_url, notice: 'Agency was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "36dff2bf6ff1bd6cb2972075e9bbf7f4",
"score": "0.5732572",
"text": "def destroy\n @insurance_master = InsuranceMaster.find(params[:id])\n @insurance_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(insurance_masters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "048c8a6d328312e287c29ee695946815",
"score": "0.5729054",
"text": "def destroy\n @news_agency = NewsAgency.find(params[:id])\n @news_agency.destroy\n\n respond_to do |format|\n format.html { redirect_to news_agencies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "823ed5098b2ac933c77babc42f3989ec",
"score": "0.5728816",
"text": "def destroy\n @aliment = Aliment.find(params[:id])\n @aliment.destroy\n\n respond_to do |format|\n format.html { redirect_to(aliments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8520535aab0a244d96bc5c4c735cf21c",
"score": "0.5724577",
"text": "def destroy\n @aktion = Aktion.find(params[:id])\n @aktion.destroy\n\n respond_to do |format|\n format.html { redirect_to(aktions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5683f5b76bc9326609e6ab8f60647d62",
"score": "0.57226944",
"text": "def destroy\n @acre = Acre.find(params[:id])\n @acre.destroy\n\n respond_to do |format|\n format.html { redirect_to(acres_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "46b228ab998428828a7b09f5f80b30eb",
"score": "0.572214",
"text": "def destroy\n @encounter = Encounter.find(params[:id])\n @encounter.destroy\n\n respond_to do |format|\n format.html { redirect_to(encounters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0e2e486548b17e8aac630a8a903034a0",
"score": "0.57172656",
"text": "def destroy\n @visaapp = Visaapp.find(params[:id])\n @visaapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(visaapps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "37044adec58a5db71bc7e5d686b12d7c",
"score": "0.57158065",
"text": "def destroy\n @associate = Associate.find(params[:id])\n @associate.destroy\n\n respond_to do |format|\n format.html { redirect_to(associates_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0aabfd70910b8480a97cffeb53be8800",
"score": "0.571443",
"text": "def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"title": ""
},
{
"docid": "01dfa3e6e90b422a417092f2a497cd67",
"score": "0.57134295",
"text": "def destroy\n @referral = Referral.find(params[:id])\n @referral.destroy\n\n respond_to do |format|\n format.html { redirect_to(referrals_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "01dfa3e6e90b422a417092f2a497cd67",
"score": "0.57134295",
"text": "def destroy\n @referral = Referral.find(params[:id])\n @referral.destroy\n\n respond_to do |format|\n format.html { redirect_to(referrals_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "136dde944e008f269d7867d138146a40",
"score": "0.5709815",
"text": "def destroy\n @referral_charge = ReferralCharge.find(params[:id])\n @referral_charge.destroy\n\n respond_to do |format|\n format.html { redirect_to(referral_charges_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dc6af2fd4205525c13e7f4640c1df2f4",
"score": "0.57087153",
"text": "def destroy\n @agent = @habitat.agents.find(params[:id])\n @agent.destroy\n\n respond_to do |format|\n format.html { redirect_to habitat_agents_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5b8481192a6ba7dc1bc374d9a808187f",
"score": "0.5705196",
"text": "def destroy\n @occurence = Occurence.find(params[:id])\n @occurence.destroy\n\n respond_to do |format|\n format.html { redirect_to(occurences_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b983c977d3ac97e6c9ba13ff71e8cecd",
"score": "0.5705024",
"text": "def delete uri\n @change_semaphore.synchronize do\n filename = uri_to_file(uri)\n library.delete filename\n # Remove diagnostics for deleted files\n send_notification \"textDocument/publishDiagnostics\", {\n uri: uri,\n diagnostics: []\n }\n end\n end",
"title": ""
},
{
"docid": "2ae3e063fa4bce26c90250c6e6ff3d50",
"score": "0.5704526",
"text": "def destroy\n @analisis = Analisis.find(params[:id])\n @analisis.destroy\n\n respond_to do |format|\n format.html { redirect_to(analisis_index_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
486880c03d51086ea209e2f0430cec4e
|
POST /mt_manufacturing_resource_datas POST /mt_manufacturing_resource_datas.xml
|
[
{
"docid": "b7d26224a2c52737aced4c89cb4a4873",
"score": "0.70218414",
"text": "def create\n @mt_manufacturing_resource_data = MtManufacturingResourceData.new(params[:mt_manufacturing_resource_data])\n \n respond_to do |format|\n if @mt_manufacturing_resource_data.save\n format.js { render :action => \"create_mt_manufacturing_resource_data\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mt_manufacturing_resource_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "522bd0dc98cfb466ea7b2b10c1cd07d9",
"score": "0.65334576",
"text": "def new\n @mt_manufacturing_resource_data = MtManufacturingResourceData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mt_manufacturing_resource_data }\n end\n end",
"title": ""
},
{
"docid": "d5a737b6e20e9a5f5f5536c59420a7cd",
"score": "0.6140932",
"text": "def create\n @mt_use_operating_resource_data = MtUseOperatingResourceData.new(params[:mt_use_operating_resource_data])\n \n respond_to do |format|\n if @mt_use_operating_resource_data.save\n format.js { render :action => \"create_mt_use_operating_resource_data\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mt_use_operating_resource_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a39e814f848b145d5b21377bffe6d22f",
"score": "0.6019085",
"text": "def update\n @mt_manufacturing_resource_data = MtManufacturingResourceData.find(params[:id])\n\n respond_to do |format|\n if @mt_manufacturing_resource_data.update_attributes(params[:mt_manufacturing_resource_data])\n format.html { redirect_to(@mt_manufacturing_resource_data) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mt_manufacturing_resource_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ccb39388b799f2ee79f3e0ee250c0fb1",
"score": "0.59719133",
"text": "def new\n @mt_use_operating_resource_data = MtUseOperatingResourceData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mt_use_operating_resource_data }\n end\n end",
"title": ""
},
{
"docid": "fc2565a49a3c58f8c7677636775f8876",
"score": "0.5970137",
"text": "def create_resource_type\n Chef::Log.debug \"Adding resource type: '#{ new_resource.name }'\"\n outfile_name = \"#{node['opennms']['conf']['home']}/etc/datacollection/#{new_resource.group_name}.xml\"\n doc = nil\n group_el = nil\n file_name = find_group(node['opennms']['conf']['home'], new_resource.group_name)\n # deal with the group existing but not the resource type\n if !file_name.nil?\n outfile_name = file_name\n #file = ::File.new(\"#{node['opennms']['conf']['home']}/etc/datacollection/#{new_resource.group_name}.xml\", \"r\")\n file = ::File.new(file_name, \"r\")\n doc = REXML::Document.new file\n doc.context[:attribute_quote] = :quote\n file.close\n group_el = doc.elements[\"/datacollection-group[@name='#{new_resource.group_name}']\"]\n else\n doc = REXML::Document.new\n doc.context[:attribute_quote] = :quote\n doc << REXML::XMLDecl.new\n group_el = doc.add_element 'datacollection-group', { 'name' => new_resource.group_name }\n end\n type_el = group_el.add_element 'resourceType', { 'name' => new_resource.name, 'label' => new_resource.label }\n if new_resource.resource_label\n type_el.add_attribute( 'resourceLabel' => new_resource.resource_label )\n end\n persist_el = type_el.add_element 'persistenceSelectorStrategy', { 'class' => new_resource.persistence_selector_strategy }\n new_resource.persistence_selector_strategy_params.each { |param|\n persist_el.add_element 'parameter', { 'key' => param.keys[0], 'value' => param[param.keys[0]]}\n }\n storage_el = type_el.add_element 'storageStrategy', { 'class' => new_resource.storage_strategy }\n new_resource.storage_strategy_params.each { |param|\n storage_el.add_element 'parameter', { 'key' => param.keys[0], 'value' => param[param.keys[0]]}\n }\n \n out = \"\"\n formatter = REXML::Formatters::Pretty.new(2)\n formatter.compact = true\n formatter.write(doc, out)\n ::File.open(outfile_name, \"w\"){ |file| file.puts(out) }\n # ensure there's an include-collection element in the default snmp-collection for this group\n opennms_snmp_collection_group new_resource.group_name do\n collection_name 'default'\n end\nend",
"title": ""
},
{
"docid": "81b4efbd16d860be3e0bc8ab6459a654",
"score": "0.56797415",
"text": "def create\n @mdl_resource = MdlResource.new(mdl_resource_params)\n\n respond_to do |format|\n if @mdl_resource.save\n format.html { redirect_to @mdl_resource, notice: 'Mdl resource was successfully created.' }\n format.json { render :show, status: :created, location: @mdl_resource }\n else\n format.html { render :new }\n format.json { render json: @mdl_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cad3981c357cfe42e7fd3672968059c",
"score": "0.5659341",
"text": "def execute!\n ensure_data_is_present!\n Request.new(resources_path, :body => { resource_type => data}, :sign => true).post.print(:yaml => true)\n end",
"title": ""
},
{
"docid": "c320d35722a3a7c0b80669ea6f423806",
"score": "0.5636221",
"text": "def show\n @mt_manufacturing_resource_data = MtManufacturingResourceData.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mt_manufacturing_resource_data }\n end\n end",
"title": ""
},
{
"docid": "18b4936ad6ca7ca4f69b7069b2775384",
"score": "0.56238663",
"text": "def post(resource, data)\n url = build_url(resource)\n fail ArgumentError, 'Data must be hash' unless data.is_a?(Hash)\n resp = ua.post(url, data, extheader)\n if (resp.status == 200)\n xs.xml_in(resp.content)\n else\n fail \"Could not post to #{url}: #{resp.status}\"\n end\n end",
"title": ""
},
{
"docid": "8b7cbe6286d80f8adc73e5e85325dd63",
"score": "0.56219244",
"text": "def manufacture_params\n params.require(:manufacture).permit(:result_no, :generate_no, :e_no, :facility_name, :facility_effect, :facility_lv, :facility_e_no, :item_name, :usage, :cost, :kind, :effect, :effect_lv, :potency, :precision, :total)\n end",
"title": ""
},
{
"docid": "70ea036dcc94ef536fb0c852920f4ec0",
"score": "0.5527254",
"text": "def resource_set(_agent, resource, msg='')\n logger.info(\"\\nresource_set: #{msg}\")\n if resource.is_a?(Array)\n type = resource[0]\n title = resource[1]\n property = resource[2]\n value = resource[3]\n else\n type = resource[:name]\n title = resource[:title]\n property = resource[:property]\n value = resource[:value]\n end\n create_and_apply_test_manifest(type, title, property, value)\n end",
"title": ""
},
{
"docid": "6cf9aa2c6488fd1c582fc04adb41aaef",
"score": "0.5511646",
"text": "def create\n @resourceset = Resourceset.new(params[:resourceset])\n\n respond_to do |format|\n if @resourceset.save\n format.html { redirect_to @resourceset, notice: 'Resourceset was successfully created.' }\n format.json { render json: @resourceset, status: :created, location: @resourceset }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resourceset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "794edadeaf9a817c6895c5a5655a35b8",
"score": "0.5457907",
"text": "def post(resource, data)\n url = self.build_url(resource)\n raise ArgumentError, \"Data must be hash\" unless data.is_a?(Hash)\n resp = self.ua.post(url, data, self.extheader)\n if ( resp.status == 200 )\n self.xs.xml_in(resp.content)\n else\n raise \"Could not post to #{url}: #{resp.status}\"\n end\n end",
"title": ""
},
{
"docid": "dbfac444a5fba109b8c78d4d84e2ec7c",
"score": "0.54038715",
"text": "def create\n @manufacturing_data = ManufacturingData.new(params[:manufacturing_data])\n @product = Product.find(params[:product_id])\n @manufacturing_data.product = @product\n\n\n respond_to do |format|\n if @manufacturing_data.save\n format.js { render :action => \"create_manufacturing\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @manufacturing_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dbfac444a5fba109b8c78d4d84e2ec7c",
"score": "0.54038715",
"text": "def create\n @manufacturing_data = ManufacturingData.new(params[:manufacturing_data])\n @product = Product.find(params[:product_id])\n @manufacturing_data.product = @product\n\n\n respond_to do |format|\n if @manufacturing_data.save\n format.js { render :action => \"create_manufacturing\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @manufacturing_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95a716db496c14c4dbd3d3465727e734",
"score": "0.5395639",
"text": "def post_data\n { resource_pluralized => [ attributes ] }\n end",
"title": ""
},
{
"docid": "c2f135ad23033bfca68c6965a8f2ffe0",
"score": "0.5374318",
"text": "def new\n @manufacturing_data = ManufacturingData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @manufacturing_data }\n end\n end",
"title": ""
},
{
"docid": "c2f135ad23033bfca68c6965a8f2ffe0",
"score": "0.5374318",
"text": "def new\n @manufacturing_data = ManufacturingData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @manufacturing_data }\n end\n end",
"title": ""
},
{
"docid": "c2f135ad23033bfca68c6965a8f2ffe0",
"score": "0.5374318",
"text": "def new\n @manufacturing_data = ManufacturingData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @manufacturing_data }\n end\n end",
"title": ""
},
{
"docid": "188299b26cbab061c7d0935f45525a42",
"score": "0.537378",
"text": "def create_resources\n\n \tself.foreman_medium_id = Resources::Foreman::Base.http_call('post', '/api/media/', :medium => {:name => \"#{self.name} #{self.major}.#{self.minor} Mirror\",\n :path => self.path,\n :os_family => self.os_family}).first[\"medium\"][\"id\"].to_i\n\n \tforeman_architecture_id = Architecture.find(self.architecture_id).foreman_id\n\n \tptable_id = Resources::Foreman::Ptable.index(:search => \"name ~ RedHat\").first.first[\"ptable\"][\"id\"]\n\n self.foreman_os_id = Resources::Foreman::OperatingSystem.create(:operatingsystem => {:name => self.name,\n :major => self.major,\n :minor => self.minor,\n :family=> self.os_family, \n :ptable_ids => [ptable_id],\n :medium_ids => [self.foreman_medium_id], \n :architecture_ids=> [foreman_architecture_id]}).first[\"operatingsystem\"][\"id\"]\n create_templates_to_os(self.foreman_os_id)\n rescue\n false\n end",
"title": ""
},
{
"docid": "33b3b3ef86060efd1797d50397fa49c8",
"score": "0.5372892",
"text": "def do_POST(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['id'] = generate_id(req.body)\n attributes['created-at'] = attributes['updated-at'] = Time.now.iso8601\n\n logger.debug \"Creating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, false)\n\n res.body = to_xml(resource, attributes)\n res['location'] = \"/#{domain}/#{resource}/#{id}.#{format}\"\n res['Content-Type'] = \"application/xml\"\n raise WEBrick::HTTPStatus::Created\n end",
"title": ""
},
{
"docid": "7b36e08edb5cf32e14e10bee3314193f",
"score": "0.53633964",
"text": "def new\n @se_manufacturing_data = SeManufacturingData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @se_manufacturing_data }\n end\n end",
"title": ""
},
{
"docid": "d4d749d4fa598281ab39c73ffa689663",
"score": "0.53534484",
"text": "def create\n @resource = Imodec::Resource.new(params[:imodec_resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to admin_resource_url(@resource), notice: 'Resource was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @@resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e01655de21a92bfe839f854d5a213bd4",
"score": "0.5345456",
"text": "def create\n begin\n # The JSON library will generate a JSON document from a hash that we give it.\n # Instead of trying to template a JSON document, we can just programmatically\n # populate a hash and convert it safely in one shot.\n json_document_hash = {}\n json_document_hash['name'] = @resource['name']\n json_document_hash['attributes'] = @resource['attributes'] if @resource['attributes']\n\n # POST the JSON document to create the resource.\n response = self.class.rest_post('/', JSON.generate(json_document_hash))\n rescue Exception\n raise Puppet::Error, \"Failed to create entity #{@resource[:name]}: #{$!}\"\n end\n end",
"title": ""
},
{
"docid": "d3c053ce9ddfa3a13d01455ac2fe4147",
"score": "0.5322534",
"text": "def create\n @personal_chef_resource = PersonalChefResource.new(personal_chef_resource_params)\n\n respond_to do |format|\n if @personal_chef_resource.save\n format.html { redirect_to @personal_chef_resource, notice: 'Personal chef resource was successfully created.' }\n format.json { render :show, status: :created, location: @personal_chef_resource }\n else\n format.html { render :new }\n format.json { render json: @personal_chef_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18d97d7f647a45edafd6cd14ccaace49",
"score": "0.5313501",
"text": "def set_resource_metadatum\n @resource_metadatum = ResourceMetadatum.find(params[:id])\n end",
"title": ""
},
{
"docid": "3bc62435c7fc21b44b75742acbabbcf6",
"score": "0.52842546",
"text": "def create\n @manufacturer = Manufacturer.new(params[:manufacturer])\n\n respond_to do |format|\n if @manufacturer.save\n format.html { redirect_to(manufacturers_url) }\n format.xml { render :xml => @manufacturer, :status => :created, :location => @manufacturer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @manufacturer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71edd5f433518d406d31f9408d208ad6",
"score": "0.52773994",
"text": "def generate_resource_tests(data) end",
"title": ""
},
{
"docid": "5d7286fea714ff361b3857c413fd1038",
"score": "0.52348316",
"text": "def create\n @mt_manufacturing_main_data = MtManufacturingMainData.new(params[:mt_manufacturing_main_data])\n \n respond_to do |format|\n if @mt_manufacturing_main_data.save\n format.js { render :action => \"create_mt_manufacturing_main_data\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mt_manufacturing_main_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b668c2a702e25cd19647225951b7d46",
"score": "0.5230311",
"text": "def set_fitting_instructions_resource(data)\n data.tap do |d|\n file_uid = d[:complex].delete(:fitting_instructions_resource)\n if file_uid.present?\n d[:simple][:fitting_instructions_resource] = Refinery::Resource.find_or_create_by(\n file_uid: file_uid\n )\n end\n end\n end",
"title": ""
},
{
"docid": "fac3eb8b77eb3cfc66a90314e1c79226",
"score": "0.52300525",
"text": "def create\n \n @resource = RDFS::Resource.new(params[:resource][:id])\n @resource.save\n \n respond_to do |format|\n flash[:notice] = 'Resource was successfully created.'\n format.html { redirect_to :action => 'show', :id => @resource }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n end\n\n end",
"title": ""
},
{
"docid": "fd32f871b8cb2a3f8925d9c6be4e855f",
"score": "0.522861",
"text": "def create\n Puppet.debug(self.class.to_s.split('::').last + ': Calling create method :')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.post('Server', @resource[:service_name], message(resource, 'POST'), {})\n @property_hash.clear\n [response, status_code, headers]\n end",
"title": ""
},
{
"docid": "59e2ab3df497af1ef46186a47b50de58",
"score": "0.5227237",
"text": "def save_resource_data(savetime)\n f = Chef::Resource::File.new(\"#{config[:path]}/resource.data\", run_context)\n f.backup config[:keep].to_i\n f.mode '0644'\n resource_data_content = ''\n all_resources.each do |r|\n resource_data_content << \"#{savetime} #{node.name} type=#{r.resource_name} name=#{r.name} source_line=#{r.source_line} updated=#{r.updated?}\"\n ivars = r.instance_variables.map { |ivar| ivar.to_sym } - Chef::Resource::HIDDEN_IVARS\n ivars.each do |ivar|\n if (value = r.instance_variable_get(ivar)) && !(value.respond_to?(:empty?) && value.empty?)\n resource_data_content << \" #{ivar.to_s.sub(/^@/, '')}=#{value.inspect}\"\n end\n end\n resource_data_content << \"\\n\"\n end\n f.content resource_data_content\n f.run_action(:create)\n end",
"title": ""
},
{
"docid": "bb17d7841de2911093bf33a5d016280a",
"score": "0.52221125",
"text": "def create\n @manufacturer = Manufacturer.new(params[:manufacturer])\n @manufacturer.save\n\n respond_with @manufacturer\n end",
"title": ""
},
{
"docid": "2e88b6b6a42b139dfd146b3c1a72e387",
"score": "0.5221636",
"text": "def create\n cmd = [\"#{create_delete_cmd} add --name=#{@resource[:name]}\"]\n jta_opt(cmd)\n cmd.push \"--jndi-name=#{@resource[:jndiname].inspect}\"\n cmd.push \"--driver-name=#{@resource[:drivername].inspect}\"\n cmd.push \"--min-pool-size=#{@resource[:minpoolsize].inspect}\"\n cmd.push \"--max-pool-size=#{@resource[:maxpoolsize].inspect}\"\n cmd.push \"--user-name=#{@resource[:username].inspect}\"\n cmd.push \"--password=#{@resource[:password].inspect}\"\n if @resource[:xa]\n xa_properties = xa_datasource_properties_wrapper(create_xa_properties)\n cmd.push \"--xa-datasource-properties=#{xa_properties}\"\n else\n cmd.push \"--connection-url=#{connection_url.inspect}\"\n end\n @resource[:options].each do |attribute, value|\n cmd.push \"--#{attribute}=#{value.inspect}\"\n end\n\n bring_up 'Datasource', cmd.join(' ')\n setenabled true\n end",
"title": ""
},
{
"docid": "fe7bd1c53baa41eb38c65130eab2425b",
"score": "0.52121246",
"text": "def resource(nm, desc) @all_resources[nm] = { :name => nm, :description => desc } ; end",
"title": ""
},
{
"docid": "b9eec964fa42a0c64b38ad86614dbb29",
"score": "0.52077174",
"text": "def create_resource_for(resource_name); end",
"title": ""
},
{
"docid": "e386d9bfc25f116813d9ee14b9e9b1b4",
"score": "0.5204996",
"text": "def create\n @chef_resource = ChefResource.new(chef_resource_params)\n\n respond_to do |format|\n if @chef_resource.save\n format.html { redirect_to edit_chef_resource_path(@chef_resource), notice: 'Chef resource was successfully updated.' }\n format.json { render :show, status: :created, location: edit_chef_resource_path(@chef_resource) }\n else\n format.html { render :new }\n format.json { render json: @chef_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2a0e89a2c44c28c57cba4e1465d76ac",
"score": "0.5191948",
"text": "def create\n if params[:resource_request].has_key? :resource_allocations_attributes\n params[:resource_request][:resource_allocations_attributes].each { |key,attribute| \n attribute.merge!({:nested => true}) unless attribute.nil?\n }\n end\n \n @resource_request = ResourceRequest.new(params[:resource_request])\n @resource_request.project = @project unless @project.nil?\n \n respond_to do |format|\n if @resource_request.save\n format.html { redirect_to(resource_resource_allocations_path(@resource_request.resource), :notice => 'Resource request was successfully created.') }\n format.xml { render :xml => @resource_request, :status => :created, :location => @resource_request }\n format.js\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource_request.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "ba8703cf80c393aa7a7e28049fb50e59",
"score": "0.51871836",
"text": "def create\n @manufacturer = Manufacturer.new(params[:manufacturer])\n\n\n respond_to do |format|\n if @manufacturer.save\n format.html { redirect_to(@manufacturer, :notice => 'Manufacturer was successfully created.') }\n format.xml { render :xml => @manufacturer, :status => :created, :location => @manufacturer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @manufacturer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc7ccd567d15e8b95b9944696df66e38",
"score": "0.5184693",
"text": "def create\n resource=load_resource(params[:resource], :admin)\n\n metric=Metric.by_key(params[:metric])\n bad_request(\"Unknown metric: #{params[:metric]}\") if metric.nil?\n\n value=params[:val]\n bad_request(\"Not a numeric value: #{value}\") if value && !Api::Utils.is_number?(value)\n\n measure=ManualMeasure.first(:conditions => ['resource_id=? and metric_id=?', resource.id, metric.id])\n if measure.nil?\n measure=ManualMeasure.new(:resource => resource, :user_login => current_user.login, :metric_id => metric.id)\n end\n\n measure.value = value\n measure.text_value = params[:text]\n measure.description = params[:desc]\n measure.save!\n\n respond_to do |format|\n format.json { render :json => jsonp(manual_measures_to_json(resource, [measure])) }\n format.xml { render :xml => xml_not_supported }\n end\n end",
"title": ""
},
{
"docid": "6eb02f739f61ef06f4d42865071ecad3",
"score": "0.5176597",
"text": "def put_memory(id, memory)\n data = <<EOF\n <Item \n xmlns=\"http://www.vmware.com/vcloud/v1.5\" \n xmlns:rasd=\"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData\" \n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n xmlns:ns12=\"http://www.vmware.com/vcloud/v1.5\" \n ns12:href=\"#{end_point}vApp/#{id}/virtualHardwareSection/memory\" \n ns12:type=\"application/vnd.vmware.vcloud.rasdItem+xml\" \n xsi:schemaLocation=\"http://www.vmware.com/vcloud/v1.5 #{end_point}v1.5/schema/master.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd\">\n <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>\n <rasd:Description>Memory Size</rasd:Description>\n <rasd:ElementName>#{memory} MB of memory</rasd:ElementName>\n <rasd:InstanceID>5</rasd:InstanceID>\n <rasd:Reservation>0</rasd:Reservation>\n <rasd:ResourceType>4</rasd:ResourceType>\n <rasd:VirtualQuantity>#{memory}</rasd:VirtualQuantity>\n <rasd:Weight>0</rasd:Weight>\n <Link rel=\"edit\" type=\"application/vnd.vmware.vcloud.rasdItem+xml\" href=\"#{end_point}vApp/#{id}/virtualHardwareSection/memory\"/>\n </Item>\nEOF\n\n request(\n :body => data,\n :expects => 202,\n :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.rasdItem+xml'},\n :method => 'PUT',\n :parser => Fog::ToHashDocument.new,\n :path => \"vApp/#{id}/virtualHardwareSection/memory\"\n )\n end",
"title": ""
},
{
"docid": "f4a182f896309c68f9f1034847a9d3a1",
"score": "0.51710427",
"text": "def create\n Puppet.debug(self.class.to_s.split('::').last + ': Calling create method :')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.post('Service', message(resource, 'POST'), {})\n [response, status_code, headers]\n end",
"title": ""
},
{
"docid": "f058448210ed8510432476b1b4b4d09b",
"score": "0.51660985",
"text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive_type => @resource[:primitive_type],\n :existing_resource => :false\n }\n @property_hash[:device_options] = @resource[:device_options] if ! @resource[:device_options].nil?\n @property_hash[:operations] = @resource[:operations] if ! @resource[:operations].nil?\n end",
"title": ""
},
{
"docid": "70b9daf83d60d5a9339070f82dfd80c9",
"score": "0.5164892",
"text": "def add\n @response = self.class.post(\"#{@server_uri}/resources_name.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "111b998c4c9b8f3908b19641eb86394a",
"score": "0.51556456",
"text": "def resource_params\n params.require(:resource).permit(:name, :resource_category_id, :service_ids => [], :resource_locations_attributes => [:id, :location_id, :quantity])\n end",
"title": ""
},
{
"docid": "764eb296a12588783e590b6197af1176",
"score": "0.5146757",
"text": "def create\n @se_manufacturing_data = SeManufacturingData.new(params[:se_manufacturing_data])\n @se_product = SeProduct.find(params[:se_product_id])\n @se_manufacturing_data.se_product = @se_product\n\n\n respond_to do |format|\n if @se_manufacturing_data.save\n format.js { render :action => \"create_se_manufacturing\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @se_manufacturing_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "904f8bf6b341c67d4cd140f5d09b90a7",
"score": "0.5139962",
"text": "def build_resource_data(name, data)\n properties = data[\"properties\"].reject { |v| %w{name sensitive}.include?(v[\"name\"]) || v[\"deprecated\"] }.sort_by! { |v| v[\"name\"] }\n\n r = {}\n\n # We want all our resources to show up in the main resource reference page\n r[\"resource_reference\"] = true\n\n # These properties are set to special values for only a few resources.\n r.merge!(special_properties(name))\n\n r[\"resource\"] = name\n r[\"resource_description_list\"] = build_resource_description(name, data[\"description\"])\n r[\"resource_new_in\"] = data[\"introduced\"] unless data[\"introduced\"].nil?\n r[\"syntax_full_code_block\"] = generate_resource_block(name, properties, data[\"default_action\"])\n r[\"syntax_properties_list\"] = nil\n r[\"syntax_full_properties_list\"] = friendly_full_property_list(name, properties)\n r[\"actions_list\"] = action_list(data[\"actions\"], data[\"default_action\"] )\n r[\"properties_list\"] = properties_list(properties)\n r[\"examples\"] = data[\"examples\"]\n\n r\n end",
"title": ""
},
{
"docid": "a3b1be0497e8b770f6dc2a91be928a0a",
"score": "0.5132314",
"text": "def create\n params[:educational_resource][:resource_list_id] = params[:resource_list_id]\n @educational_resource = EducationalResource.new(params[:educational_resource])\n\n respond_to do |format|\n if @educational_resource.save\n format.html { redirect_to [@educational_resource.resource_list, @educational_resource], notice: 'Educational resource was successfully created.' }\n format.json { render json: @educational_resource, status: :created, location: @educational_resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @educational_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "daf9e6c3fff855ad7509f51a9507da04",
"score": "0.51303875",
"text": "def destroy\n @mt_manufacturing_resource_data = MtManufacturingResourceData.find(params[:id])\n @mt_manufacturing_resource_data.destroy\n\n respond_to do |format|\n format.js { render :action => \"destroy_mt_manufacturing_resource_data\" }\n end\n end",
"title": ""
},
{
"docid": "2e0aae1b7be6db9ae4f6cae8617e9a3d",
"score": "0.51271206",
"text": "def create\n @resource_allocation = ResourceAllocation.new(params[:resource_allocation])\n\n respond_to do |format|\n if @resource_allocation.save\n flash[:notice] = 'ResourceAllocation was successfully created.'\n format.html { redirect_to(@resource_allocation) }\n format.xml { render :xml => @resource_allocation, :status => :created, :location => @resource_allocation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource_allocation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87c75c8d1a3523e6a42d6d6d22fac401",
"score": "0.5126491",
"text": "def new\n @mt_manufacturing_main_data = MtManufacturingMainData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mt_manufacturing_main_data }\n end\n end",
"title": ""
},
{
"docid": "6e47d600e4958904b65453ec28759769",
"score": "0.51085407",
"text": "def create\n @auto_manufacturer = AutoManufacturer.new(params[:auto_manufacturer])\n\n respond_to do |format|\n if @auto_manufacturer.save\n format.html { redirect_to @auto_manufacturer, notice: 'Auto manufacturer was successfully created.' }\n format.json { render json: @auto_manufacturer, status: :created, location: @auto_manufacturer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auto_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7da1986c1011b514dd4c757e729d063e",
"score": "0.5100703",
"text": "def new\n @bp_manufacturing_data = BpManufacturingData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bp_manufacturing_data }\n end\n end",
"title": ""
},
{
"docid": "be2d4b23dbd634f13d9af52c8da8bb9b",
"score": "0.5094567",
"text": "def create\n @appresource = Appresource.new(params[:appresource])\n\n respond_to do |format|\n if @appresource.save\n format.html { redirect_to @appresource, notice: 'Appresource was successfully created.' }\n format.json { render json: @appresource, status: :created, location: @appresource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @appresource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e25b94332894488afaff9386d1afd591",
"score": "0.50938326",
"text": "def create\n @resource = Resource.new(resource_params)\n @resource.unit_list = params[:resource][:unit_list].join(\",\")\n @resource.level_list = params[:resource][:level_list].join(\",\")\n @resource.resource_type_list = params[:resource][:resource_type_list].join(\",\")\n # @resource.cost_list = params[:resource][:cost_list].join(\",\")\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8a0676d59ff7359c7b308acadfe5625",
"score": "0.5088705",
"text": "def resource_set(agent, resource, msg='')\n logger.info(\"\\n#{msg}\")\n cmd = \"resource #{resource[:name]} '#{resource[:title]}' \" \\\n \"#{resource[:property]}='#{resource[:value]}'\"\n cmd = PUPPET_BINPATH + cmd\n on(agent, cmd, acceptable_exit_codes: [0, 2])\nend",
"title": ""
},
{
"docid": "a1595407b8e9e347d3fd84ae694c56af",
"score": "0.5084092",
"text": "def create\n @manufacturer = Manufacturer.new(params[:manufacturer])\n\n respond_to do |format|\n if @manufacturer.save\n flash[:notice] = 'Manufacturer was successfully created.'\n format.html { redirect_to(@manufacturer) }\n format.xml { render :xml => @manufacturer, :status => :created, :location => @manufacturer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @manufacturer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a27d64a6bd04ab8ed698591080c811d",
"score": "0.50813407",
"text": "def create\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : User click the manufacturer create button\"\n begin\n params.permit!\n \n manufacturer = {manufacturer:{manufacturer_name: params[\"name\"], manufacturer_code: params[\"mfr_code\"], manufacturer_abb:params[\"mfr_abb\"], address_one: params[\"address_one\"], addrsss_two: params[\"address_two\"], addrsss_three: params[\"address_three\"], city: params[\"city\"], state: params[\"state\"], country: params[\"country\"], supplier_id: params[\"new division\"][:supplier_id]}}\n manufacturer = RestClient.post $api_service+'/manufacturers',manufacturer\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : Manufacturer created successfully\"\n rescue => e\n Rails.logger.custom_log.error { \"#{e} manufacturer_controller create method\" }\n end\n redirect_to :action => \"index\"\n\n end",
"title": ""
},
{
"docid": "3c63f8ed75cedf4adf28a329cf56ca9d",
"score": "0.5079342",
"text": "def setresource\n @resource = Resourceweightage.update(params[:id],:cpu => params[:cpu], :ram => params[:ram], :nic => params[:nic])\n \n end",
"title": ""
},
{
"docid": "0de3af4a2c99d719f10ffea3bf759f96",
"score": "0.5074541",
"text": "def create\n @manufacture_material = ManufactureMaterial.new(manufacture_material_params)\n\n respond_to do |format|\n if @manufacture_material.save\n format.html { redirect_to @manufacture_material, notice: 'Manufacture material was successfully created.' }\n format.json { render :show, status: :created, location: @manufacture_material }\n else\n format.html { render :new }\n format.json { render json: @manufacture_material.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffb04c1a6cfe5a5f1e4f748d79a439c3",
"score": "0.507025",
"text": "def create\n @resource_group_tool = ResourceGroupTool.new(resource_group_tool_params.except(:resource_group_part))\n # authorize(@resource_group_tool)\n unless resource_group_tool_params[:resource_group_part].blank?\n @resource_group_part=@resource_group_tool.build_resource_group_part\n @resource_group_part.part=Part.find_by_nr(resource_group_tool_params[:resource_group_part])\n end\n\n respond_to do |format|\n if @resource_group_tool.save\n format.html { redirect_to @resource_group_tool, notice: 'Resource group tool was successfully created.' }\n format.json { render :show, status: :created, location: @resource_group_tool }\n else\n format.html { render :new }\n format.json { render json: @resource_group_tool.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf76e136c056fc561ebd1808891dc929",
"score": "0.506069",
"text": "def processResources(resource)\n o = PuppetResource.new\n o.type = resource['resource_type']\n o.title = resource['resource_title']\n o.status = resource['status']\n o.timestamp = resource['timestamp']\n o.new_value = resource['new_value']\n o.old_value = resource['old_value']\n o.class = resource['containing_class']\n\n o\nend",
"title": ""
},
{
"docid": "d88db39d07525ee4de0bbc84879ef1dc",
"score": "0.5056065",
"text": "def create\n @software_allocation = SoftwareAllocation.new(params[:software_allocation])\n\n respond_to do |format|\n if @software_allocation.save\n flash[:notice] = 'SoftwareAllocation was successfully created.'\n format.html { redirect_to(@software_allocation) }\n format.xml { render :xml => @software_allocation, :status => :created, :location => @software_allocation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @software_allocation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1facf54eee5829d662a806c9cd05172b",
"score": "0.50540686",
"text": "def create_resource\n build_resource\n resource.save\n end",
"title": ""
},
{
"docid": "47aa634e6ce0a63f5ea25d03c97c6e2b",
"score": "0.50491905",
"text": "def create\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive_class => @resource[:primitive_class],\n :provided_by => @resource[:provided_by],\n :primitive_type => @resource[:primitive_type],\n :promotable => @resource[:promotable],\n :existing_resource => :false\n }\n @property_hash[:parameters] = @resource[:parameters] if ! @resource[:parameters].nil?\n @property_hash[:operations] = @resource[:operations] if ! @resource[:operations].nil?\n @property_hash[:utilization] = @resource[:utilization] if ! @resource[:utilization].nil?\n @property_hash[:metadata] = @resource[:metadata] if ! @resource[:metadata].nil?\n @property_hash[:ms_metadata] = @resource[:ms_metadata] if ! @resource[:ms_metadata].nil?\n @property_hash[:cib] = @resource[:cib] if ! @resource[:cib].nil?\n end",
"title": ""
},
{
"docid": "eeefe4d214012928e6c2158cfacd518f",
"score": "0.5042958",
"text": "def set_resource_management12\n @resource_management12 = ResourceManagement12.find(params[:id])\n end",
"title": ""
},
{
"docid": "c28b04015313ddb77f9a7db677aa7fb2",
"score": "0.5042526",
"text": "def materiel_params\n params.require(:materiel).permit(:name, :description, :price, :availability, :image, :resource)\n end",
"title": ""
},
{
"docid": "2416b90623338119dd01d7f7eef56c8f",
"score": "0.5039091",
"text": "def create\n \n # @resources2 = Resource.all\n @resources= Resource.all\n \n @statuses=[]\n # # if params{:username}\n # # repeat_resouce= @resources.find{|item| item.resouce_id ==params{:resource_id}}\n # # if !repeat_resouce\n #\n # # else\n # p params{:username}\n # @resource.username = params[:username]\n # @resource.resouce_id = params[:resource_id]\n # @resource.resouce_type = params[:resource_type]\n # end\n # end\n\n resource_xml = params[:text]\n p resource_xml\n hash = Crack::XML.parse resource_xml\n arr = hash['items']['resource']\n\n p resource_xml\n p arr\n arr.each do |temp|\n #用来检查是否重复设置了同一resource\n @resources= Resource.all\n @repeat_resource= @resources.find{|item| item.resource_id == temp['resource_id']}\n if @repeat_resource\n @status={}\n @status['repeatresource']= temp['resource_id']\n @statuses.push(@status)\n else\n if(temp['username']&& temp['resource_id']&&temp['resource_type'] )\n @resource = Resource.new(params[:resource])\n @resource.username = temp['username'] \n @resource.resource_id = temp['resource_id']\n @resource.resource_type = temp['resource_type'] \n @resource.save\n @status={}\n @status['success']= temp['resource_id']\n @statuses.push(@status)\n else\n @status={}\n @status['errorparams']= temp['resource_id']\n @statuses.push(@status)\n end\n end\n end\n respond_to do |format|\n \n # if @resource.save\n # format.html { redirect_to(@resource, :notice => 'Resource was successfully created.') }\n # format.xml { render :xml => @resource, :status => :created, :location => @resource }\n # format.xml { render :xml => {:status=>@statuses} }\n format.xml\n # format.xml { render :xml => {@resource}}\n # else\n # format.html { render :action => \"new\" }\n # format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n # end\n \n end\nend",
"title": ""
},
{
"docid": "3991d9a80192bb9aea5e58a69ecbc2bb",
"score": "0.5035544",
"text": "def create\n @fedora_resource = FedoraResource.new(fedora_resource_params)\n\n respond_to do |format|\n if @fedora_resource.save\n format.html { redirect_to @fedora_resource, notice: 'Fedora resource was successfully created.' }\n format.json { render :show, status: :created, location: @fedora_resource }\n else\n format.html { render :new }\n format.json { render json: @fedora_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d992f94814c081e325264a7cc7fce854",
"score": "0.50342906",
"text": "def create\n p 'running ResourcesController#create'\n @resource = Resource.new(params[:resource])\n\n # try to scrape\n resource_object = Resource.scrape_data(@resource.raw_url)\n # add scraped data or nil\n @resource.keywords_scraped = resource_object[:keywords_scraped] ? resource_object[:keywords_scraped] : nil\n @resource.description_scraped = resource_object[:description_scraped] ? resource_object[:description_scraped] : nil\n @resource.title_scraped = resource_object[:title_scraped] ? resource_object[:title_scraped] : nil\n @resource.raw_html = resource_object[:raw_html] ? resource_object[:raw_html] : nil\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fdab54d2a7ef9a8b944a8669b547ce4c",
"score": "0.50334364",
"text": "def resource_params\n params.require(:refuelling).permit(:date, :mileage, :liter_price, :total_value, :gas_station)\n end",
"title": ""
},
{
"docid": "53eb042ec81039f23d2d8e8dc1c84fd4",
"score": "0.503224",
"text": "def post_cm_rest_resource(args = {})\n args[:headers] = { 'Content-Type' => 'application/json' }\n req_cm_rest_resource(args) { |req_args| API.post_req(req_args) }\n end",
"title": ""
},
{
"docid": "fc6b9aae4f25e70b06125c3cda9db95b",
"score": "0.5028018",
"text": "def resource_management9_params\n params.require(:resource_management9).permit(:Revenue_Sources, :Budget_Estimate, :Actual_Receipts, :Variation_Excess_or_Shortfall_in_Amount, :Variation_Excess_or_Shortfall_in_Percentage)\n end",
"title": ""
},
{
"docid": "b2eb5c1e388b2e29d7587c86e9e516c3",
"score": "0.5017603",
"text": "def add\n ensure_client\n required_attributes = %w[enclosureGroupUri hostname username password licensingIntent]\n required_attributes.each { |k| raise IncompleteResource, \"Missing required attribute: '#{k}'\" unless @data.key?(k) }\n\n optional_attrs = %w[enclosureUri firmwareBaselineUri force forceInstallFirmware state unmanagedEnclosure updateFirmwareOn]\n temp_data = @data.select { |k, _v| required_attributes.include?(k) || optional_attrs.include?(k) }\n response = @client.rest_post(self.class::BASE_URI, { 'body' => temp_data }, @api_version)\n new_data = @client.response_handler(response)\n old_name = @data.select { |k, _v| %w[name rackName].include?(k) } # Save name (if given)\n %w[username password hostname].each { |k| @data.delete(k) } # These are no longer needed\n set_all(new_data)\n set_all(old_name)\n update\n self\n end",
"title": ""
},
{
"docid": "c9fea410a1433f2bdaf85818d6e45de2",
"score": "0.50173134",
"text": "def create\n @manufacturing = Manufacturing.new(manufacturing_params)\n @address = @manufacturing.address\n @phone_numbers = @manufacturing.phone_numbers\n @common_data = @manufacturing.common_data\n @center_types = CenterType.all\n\n respond_to do |format|\n if @manufacturing.save\n format.html { redirect_to @manufacturing, notice: 'Manufacturing was successfully created.' }\n format.json { render :show, status: :created, location: @manufacturing }\n else\n format.html { render :new }\n format.json { render json: @manufacturing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "252375b87d69acc0e659fa5346afee33",
"score": "0.5017108",
"text": "def set_resource\n\t\tend",
"title": ""
},
{
"docid": "942930c0178c7d051cfe160d3c0375c4",
"score": "0.5008702",
"text": "def set_resource_management1\n @resource_management1 = ExpenditureOnSalaryAndPension.find(params[:id])\n end",
"title": ""
},
{
"docid": "0507f05a35e13c08fbd017ea411df9eb",
"score": "0.5007636",
"text": "def ar_save_resource\n @resource.save\n end",
"title": ""
},
{
"docid": "f987b9098e85765f509ee052cd888ee4",
"score": "0.4995984",
"text": "def create\n @hq_rsrc = HqRsrc.new(params[:hq_rsrc])\n params[:hq_rsrc][:new_hq_rsrc_usage_attributes] ||= {}\n params[:hq_rsrc][:existing_hq_rsrc_usage_attributes] ||= {}\n \n respond_to do |format|\n if @hq_rsrc.save\n flash[:notice] = 'Resource was successfully created.'\n format.html { redirect_to :action => :index }\n format.xml { render :xml => @hq_rsrc, :status => :created, :location => @hq_rsrc }\n else\n messages = '<ul>Error:'\n @hq_rsrc.errors.full_messages.each {|msg| messages += '<li>'+msg+'</li>'}\n messages += '</ul>'\n flash[:notice] = messages\n format.html { redirect_to :action => \"new\", :template => 'reflected/new' }\n format.xml { render :xml => @hq_rsrc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6bb5a99361028eece46546a52f043043",
"score": "0.4991298",
"text": "def generate_resource(data)\n target_folder = File.join(data[:output_folder], package)\n FileUtils.mkpath target_folder\n name = Google::StringUtils.underscore(data[:object].name)\n version = Google::StringUtils.underscore(data[:object].version)\n version = \"_\" + version unless version.empty?\n product_name = Google::StringUtils.underscore(data[:product_name])\n filepath = File.join(target_folder, \"resource_#{package}_#{product_name}_#{name}#{version}.go\")\n generate_resource_file data.clone.merge(\n default_template: 'templates/terraform/resource.erb',\n out_file: filepath\n )\n # TODO: error check goimports\n %x(goimports -w #{filepath})\n %x(gofmt -w #{filepath})\n\n generate_documentation(data)\n end",
"title": ""
},
{
"docid": "7c5c971a1be490cc38bd92ec77379ff4",
"score": "0.49877214",
"text": "def r_params\n params.require(:resource).permit(:name,\n :description,\n :monthlyCost,\n :pricePerUnit,\n :startDate,\n :annualCost,\n :startValue,\n :unit)\n end",
"title": ""
},
{
"docid": "34ba30c703ca955b578eb289bea9365b",
"score": "0.4985981",
"text": "def generate_resource(data)\n target_folder = File.join(data.output_folder, 'libraries')\n name = data.object.name.underscore\n\n data.generate(\n 'templates/inspec/singular_resource.erb',\n File.join(target_folder, \"google_#{data.product.api_name}_#{name}.rb\"),\n self\n )\n\n data.generate(\n 'templates/inspec/plural_resource.erb',\n File.join(target_folder, \"google_#{data.product.api_name}_#{name}\".pluralize + '.rb'),\n self\n )\n\n generate_documentation(data.clone, name, false)\n generate_documentation(data.clone, name, true)\n generate_properties(data.clone, data.object.all_user_properties)\n end",
"title": ""
},
{
"docid": "689b5e163a6de28a6cdc81184e2927ec",
"score": "0.49859357",
"text": "def set_manufacture\n @manufacture = Manufacture.find(params[:id])\n end",
"title": ""
},
{
"docid": "0187bd405408a05c241c0efe048407f8",
"score": "0.49821243",
"text": "def create\n @equipment = Equipment.new(params[:equipment])\n\n respond_to do |format|\n if @equipment.save\n \tTechnicalsEquipment.create(params[:technical_attribute].merge({:equipment_id => @equipment.id}) )\n format.html { redirect_to([:admin, @equipment], :notice => 'Equipment criada com sucesso.') }\n format.xml { render :xml => @equipment, :status => :created, :location => @equipment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @equipment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbfe62d0a8ff7e8992626e60af230c18",
"score": "0.49768192",
"text": "def create\n @epcformulary = Epcformulary.new(epcformulary_params)\n #@epcformulary.asformulary = @asformulary\n\n respond_to do |format|\n if @epcformulary.save\n format.html { redirect_to @epcformulary, notice: 'Epcformulary was successfully created.' }\n format.json { render :show, status: :created, location: @epcformulary }\n else\n format.html { render :new }\n format.json { render json: @epcformulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f3c32404ea93fbaa01e6d45e5833fc6",
"score": "0.49723172",
"text": "def set_manufacture\n @manufacture = Manufacture.find(params[:id])\n end",
"title": ""
},
{
"docid": "f98b87522c83db97099e23f09bd6b67f",
"score": "0.49688786",
"text": "def create\n debug 'Call: create'\n data = merged_data\n return if data.empty?\n write_to_file(resource[:path], data)\n end",
"title": ""
},
{
"docid": "f2bb73ec37f4e62539904b14eff30f76",
"score": "0.49672866",
"text": "def build_xml\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.TEMPLATE do\n xml.NAME resource[:name]\n xml.MEMORY resource[:memory]\n xml.CPU resource[:cpu]\n xml.VCPU resource[:vcpu]\n xml.DESCRIPTION resource[:description] if resource[:description]\n xml.OS do\n resource[:os].each do |k, v|\n xml.send(k.upcase, v)\n end\n end if resource[:os]\n resource[:disks].each do |disk|\n xml.DISK do\n disk.each do |k, v|\n xml.send(k.upcase, v)\n end\n end\n end if resource[:disks]\n resource[:nics].each do |nic|\n xml.NIC do\n nic.each do |k, v|\n xml.send(k.upcase, v)\n end\n end\n end if resource[:nics]\n xml.GRAPHICS do\n resource[:graphics].each do |k, v|\n xml.send(k.upcase, v)\n end\n end if resource[:graphics]\n xml.FEATURES do\n resource[:features].each do |k, v|\n xml.send(k.upcase, v)\n end\n end if resource[:features]\n xml.CONTEXT do\n resource[:context].each do |k, v|\n xml.send(k.upcase, v)\n end\n end if resource[:context]\n xml.SCHED_REQUIREMENTS resource[:sched_requirements] if resource[:sched_requirements]\n xml.SCHED_RANK resource[:sched_rank] if resource[:sched_rank]\n xml.SCHED_DS_REQUIREMENTS resource[:sched_ds_requirements] if resource[:sched_ds_requirements]\n xml.SCHED_DS_RANK resource[:sched_ds_rank] if resource[:sched_ds_rank]\n end\n end\n builder.to_xml\n end",
"title": ""
},
{
"docid": "4db6f90d6540c3f3223d8c7f7a785b9e",
"score": "0.49643221",
"text": "def create\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Creating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\"))\n response = connection.post(collection_path, to_xml, self.class.headers)\n self.id = id_from_response(response) \n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "e18ad7a2dc6c5ab51abdd1e6504e6b16",
"score": "0.49616626",
"text": "def create\n\tputs \"create\"\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e6c67446ae6e3623b4a5ada7cc42630",
"score": "0.49590516",
"text": "def create\n Puppet.debug(self.class.to_s.split('::').last + ': Calling create method :')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.post('ContentRule', @resource[:service_name], message(resource), {})\n\n # We clear the hash here to stop flush from triggering.\n @property_hash.clear\n\n [response, status_code, headers]\n end",
"title": ""
},
{
"docid": "4aa7c76b95ba589c2ab13a6d599f6050",
"score": "0.4955",
"text": "def create\n @uni_resource = UniResource.new(params[:uni_resource])\n\n respond_to do |format|\n if @uni_resource.save\n flash[:notice] = 'UniResource was successfully created.'\n format.html { redirect_to(@uni_resource) }\n format.xml { render :xml => @uni_resource, :status => :created, :location => @uni_resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @uni_resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "148f231a880bc39020f670c9677c5cfd",
"score": "0.49541268",
"text": "def create(resource, data={}) \n JSON.parse(@cli[\"/#{resource}\"].post(data))\n rescue RestClient::BadRequest=> e\n raise BadRequest, e.http_body\n end",
"title": ""
},
{
"docid": "ee9b60e655dc550b4460f530d4327d6d",
"score": "0.49525642",
"text": "def resource_management12_params\n params.require(:resource_management12).permit(:Revenue_Sources, :Buoyancy_Ratio, :Year)\n end",
"title": ""
},
{
"docid": "18b9bb288251b60d7cda516bcc799992",
"score": "0.49470404",
"text": "def chef_resource_params\n params.require(:chef_resource).permit(:resource_type, chef_properties_attributes: [ :id, :value, :value_type ], chef_attributes_attributes: [ :id, :name, :value, :_destroy ])\n end",
"title": ""
},
{
"docid": "e7c3efaba525782516466f95a68b9c00",
"score": "0.4944524",
"text": "def create\n @manufacturer = Manufacturer.new(params[:manufacturer])\n\n respond_to do |format|\n if @manufacturer.save\n masign_in @manufacturer\n format.html { redirect_to @manufacturer, notice: 'Manufacturer was successfully created.' }\n format.json { render json: @manufacturer, status: :created, location: @manufacturer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4acbafd0c5deab4d9e6da550bb042662",
"score": "0.49431792",
"text": "def create\n @manufacturer = Manufacturer.new(manufacturer_params)\n\n respond_to do |format|\n if @manufacturer.save\n format.html { redirect_to @manufacturer, notice: 'Производитель создан' }\n format.json { render :show, status: :created, location: @manufacturer }\n else\n format.html { render :new }\n format.json { render json: @manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b24c1f72ab453827978d53843e8860f",
"score": "0.4942457",
"text": "def post_resource(kind, template)\n tmpl_str = File.read(template)\n post_resource_str(kind, tmpl_str)\n end",
"title": ""
},
{
"docid": "8169fdc396ef6a317b4b571c98c589e8",
"score": "0.4941555",
"text": "def create\n\n #Can also be created with:\n # => curl -X POST -H \"Content-Type: application/json; charset=UTF-8\" -d '{\"sensor_datum\": {\"ppm\": \"400\",\"device_id\": \"1\"}}' localhost:3000/sensor_data.json\n # => curl -X POST -H \"Content-Type: application/json; charset=UTF-8\" -d '{\"sensor_datum\": {\"ppm\": \"400\", \"device_address\": \"42\"}}' localhost:3000/sensor_data.json\n\n @sensor_datum = SensorDatum.new(sensor_datum_params)\n authorize @sensor_datum\n\n @sensor_datum.resolve_device_id\n @sensor_datum.resolve_experiment_id\n\n respond_to do |format|\n if @sensor_datum.save\n format.html { redirect_to @sensor_datum, notice: 'Sensor datum was successfully created.' }\n format.json { render :show, status: :created, location: @sensor_datum }\n else\n format.html { render :new }\n format.json { render json: @sensor_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
270175cedf8690dcc9832651d52cb190
|
Public Returns the interval of from and to in seconds.
|
[
{
"docid": "c86a076ad00a9515131da3288169a2e7",
"score": "0.81248623",
"text": "def interval\n @to.to_i - @from.to_i\n end",
"title": ""
}
] |
[
{
"docid": "f17d3b0807cf3daa763c9c72a5622970",
"score": "0.747958",
"text": "def period_in_seconds\n (start_time.to_i..end_time.to_i)\n end",
"title": ""
},
{
"docid": "e84563efd9e1b173b8fbddf22f40b602",
"score": "0.690364",
"text": "def seconds_until\n (start_time - Time.now).to_i\n end",
"title": ""
},
{
"docid": "e84563efd9e1b173b8fbddf22f40b602",
"score": "0.690364",
"text": "def seconds_until\n (start_time - Time.now).to_i\n end",
"title": ""
},
{
"docid": "9bf038ff1831015121ba575cbd505c5a",
"score": "0.68711334",
"text": "def timeInterval()\n\t\t@duration\n\tend",
"title": ""
},
{
"docid": "66b4f508e850eec9f984bb9af159ad29",
"score": "0.68449134",
"text": "def to_sec(interval)\n interval / INTERVAL\n end",
"title": ""
},
{
"docid": "4c7cc8339f1e0c3dcc17bfed1a1850a1",
"score": "0.6721144",
"text": "def interval\n 30.seconds\n end",
"title": ""
},
{
"docid": "eb933d83f8ab4c891f9e147ace4526ec",
"score": "0.66702116",
"text": "def seconds\n (Time.now - @start_time).to_i\n end",
"title": ""
},
{
"docid": "ea8ddac6b9c7b444e2eead8f9f608402",
"score": "0.6482838",
"text": "def interval; end",
"title": ""
},
{
"docid": "ea8ddac6b9c7b444e2eead8f9f608402",
"score": "0.6482838",
"text": "def interval; end",
"title": ""
},
{
"docid": "edaa73054619cc3437c14031d32d3345",
"score": "0.6416766",
"text": "def time_range\n start_time..end_time\n end",
"title": ""
},
{
"docid": "a42d46ef49ee87faa192e3731beb29a8",
"score": "0.62817264",
"text": "def elapsed_seconds(start_time, end_time)\n end_time.to_i - start_time.to_i\nend",
"title": ""
},
{
"docid": "491cb45568f77320e2c69b3734232bfd",
"score": "0.627443",
"text": "def total_seconds\n (ends_at - Time.current).round\n end",
"title": ""
},
{
"docid": "1571fc11038f69a14c25b51742fa18bc",
"score": "0.625053",
"text": "def elapsed_seconds(start_time, end_time)\r\n end_time - start_time\r\nend",
"title": ""
},
{
"docid": "da8c7f6fc91f61462fbee5a01039e0b0",
"score": "0.6245283",
"text": "def seconds_remaining\n ends_at ? (ends_at - started_at).round : 0\n end",
"title": ""
},
{
"docid": "18aa336f42e47f4f61442b4ca60ad78b",
"score": "0.6237776",
"text": "def interval\n @attributes[:interval]\n end",
"title": ""
},
{
"docid": "83e750c0f0325935f4e613ba1f26d5b1",
"score": "0.6211376",
"text": "def to_seconds; @val end",
"title": ""
},
{
"docid": "a29f5279bb27de2c62288d20391718fc",
"score": "0.6203206",
"text": "def duration; ((endtime()- starttime()) / 60).to_i; end",
"title": ""
},
{
"docid": "8292320df21ea8dbebcc19d4b558c680",
"score": "0.61701846",
"text": "def elapsed_seconds(start_time, end_time)\n return (end_time - start_time)\nend",
"title": ""
},
{
"docid": "acae058095142c03ac69e49a3c172924",
"score": "0.6137695",
"text": "def in_seconds\n @seconds\n end",
"title": ""
},
{
"docid": "0b529d0ed832b7f3ebc252af477dc726",
"score": "0.6132442",
"text": "def interval ; @options[ :interval ] ; end",
"title": ""
},
{
"docid": "be89bbb0163b264936bea7d6d701997e",
"score": "0.61192787",
"text": "def seconds\n self * 60\n end",
"title": ""
},
{
"docid": "13b985580ca716b408b325402c455b75",
"score": "0.61080796",
"text": "def interval(from, to)\n return EmptyList if from > to\n interval_exclusive(from, to.next)\n end",
"title": ""
},
{
"docid": "900aad1019a30c22f38f94bb84eac149",
"score": "0.60795766",
"text": "def to_i\n self.in_seconds\n end",
"title": ""
},
{
"docid": "54f715ffb613e5fadc92788ca4c5d4b2",
"score": "0.60726434",
"text": "def span\n return 60.days if interval.zero?\n\n interval.days\n end",
"title": ""
},
{
"docid": "c2849d0a3f427d467457b0a319520a45",
"score": "0.60456383",
"text": "def seconds_left\n if @last_run\n [(@last_run + interval / 1000.0) - Time.now, 0].max\n else\n interval / 1000.0\n end\n end",
"title": ""
},
{
"docid": "0c05db6cdc60bf2873f6feeccc08257a",
"score": "0.60353786",
"text": "def seconds\n (hour * 60 * 60) + (min * 60)\n end",
"title": ""
},
{
"docid": "e295d6bc2260575a3be97a3b47e8757a",
"score": "0.6015945",
"text": "def seconds() self end",
"title": ""
},
{
"docid": "b2ed981ff46eaece4b000b4eea11580f",
"score": "0.6006453",
"text": "def seconds\n @seconds.abs % 60 * (@seconds < 0 ? -1 : 1)\n end",
"title": ""
},
{
"docid": "ddaf09ce8a3f3cded4a9f8a64a0b555b",
"score": "0.59662306",
"text": "def duration\n @duration ||= (range[1] - range[0]) / 1000.0\n end",
"title": ""
},
{
"docid": "dd59840b98002853fc00eeb40c38c95f",
"score": "0.59403485",
"text": "def time\n end_time - start_time\n end",
"title": ""
},
{
"docid": "061d75b3197265d9ec99f095aac9b17f",
"score": "0.5938108",
"text": "def seconds\n @time\n end",
"title": ""
},
{
"docid": "980e9857bc1008d3ed1c5ea8d52b2051",
"score": "0.5926649",
"text": "def seconds\n ((@died_at - @time) / 1000).to_i\n end",
"title": ""
},
{
"docid": "1ff4183c6f4d02f3f59c646bca978477",
"score": "0.5918872",
"text": "def seconds\n\t\t@seconds\n\tend",
"title": ""
},
{
"docid": "ac8236d3260e805fc336449b55cb9ee2",
"score": "0.5917001",
"text": "def to_i\n @seconds\n end",
"title": ""
},
{
"docid": "e7d9fb95c363808ae131b30cdd9904c0",
"score": "0.59124994",
"text": "def duration\n @range.last - @range.first\n end",
"title": ""
},
{
"docid": "09b6b2bbbabc9c6241084d08fa5a7d03",
"score": "0.5901378",
"text": "def interval_as_min_dot_sec\n seconds = @interval % 60\n if seconds > seconds.to_i\n #mpl3splt takes fractions of a second to hundredths of a second precision\n seconds = seconds.round(2)\n end\n min_dot_sec = \"#{(@interval.to_i / 60).floor}.#{seconds}\"\n end",
"title": ""
},
{
"docid": "ba9cb0c220e6685019a7ed855cac10f5",
"score": "0.58993936",
"text": "def to_seconds\n atom * factor\n end",
"title": ""
},
{
"docid": "e554a40ace208471b03527c36d109868",
"score": "0.58961594",
"text": "def duration\n if start_time && end_time\n end_time.to_i - start_time.to_i\n else\n 0.0\n end\n end",
"title": ""
},
{
"docid": "000c8d6e7d9acd13004ec2ef4976a275",
"score": "0.5892259",
"text": "def get_duration_integer_minutes\n\t\t((end_time - start_time) / 60).to_i\n\tend",
"title": ""
},
{
"docid": "7a2238f50bf0931d3965b57f55096735",
"score": "0.58684534",
"text": "def time_diff\n diff = (@start_at and @end_at) ? @end_at.to_time - @start_at.to_time : 0\n diff.round.to_i\n end",
"title": ""
},
{
"docid": "13212cc29ef1e14e7de3dfed9f40aca6",
"score": "0.58585525",
"text": "def seconds_between(start, stop)\n \n # we need this to be a float \n duration = 0.0\n \n # we just return if the start comes after the stop\n return duration if start > stop\n\n # If it's a weekday, examine it.\n if WORKING_DAYS.include? start.wday\n\n # If it's inside working hours, calculate\n if WORKING_HOURS.include? start.hour\n\n # Figure out how many seconds between now and then\n hours, mins, secs, ignore_fractions = Date::day_fraction_to_time(stop - start)\n duration = hours * 60 * 60 + mins * 60 + secs\n\n end\n\n end\n\n return duration\n end",
"title": ""
},
{
"docid": "01245c18cd669098262151241ea5cceb",
"score": "0.58560246",
"text": "def elapsed_time\n seconds = (self.end_at.to_i - self.start_at.to_i)\n (seconds / 60)\n end",
"title": ""
},
{
"docid": "1372dadd86c4281d8df194ccdf95dabd",
"score": "0.5842859",
"text": "def seconds\n _nudge[2]\n end",
"title": ""
},
{
"docid": "a2f22c152d3014fc23da675ece65a0ab",
"score": "0.5838129",
"text": "def range(start, finish)\n {\n 'duration' => ((finish - start) * 1000).to_i,\n 'start' => [start.to_i, start.usec/1000].join(''),\n #'end' => [finish.to_i, finish.usec/1000].join('')\n }\n end",
"title": ""
},
{
"docid": "b683b873a4d5e6ed0fa38794f0fead24",
"score": "0.5836599",
"text": "def calc_interval(number_events)\n\tprng = 60.00/number_events # temporal solution, IMPROVE\n\n\treturn (interval)\nend",
"title": ""
},
{
"docid": "8d2cc021df5fe7a0b120603e7ebaa108",
"score": "0.5836286",
"text": "def range(start, finish)\n {\n 'duration' => ((finish - start) * 1000).to_i,\n 'start' => [start.to_i, start.usec/1000].join(''),\n 'end' => [finish.to_i, finish.usec/1000].join('')\n }\n end",
"title": ""
},
{
"docid": "7bb6b083e6d7813309d45b26b06265ab",
"score": "0.58331794",
"text": "def duration\n (Time.now.to_f - @start) * 1000\n end",
"title": ""
},
{
"docid": "7bf92851c9b7875461db91fdd7134a49",
"score": "0.5820755",
"text": "def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend",
"title": ""
},
{
"docid": "8533a557b3a9fcaa1ac2bb416c8857f9",
"score": "0.5814599",
"text": "def seconds\n (duration + 0.4999).to_i\n end",
"title": ""
},
{
"docid": "ff680633d51e30d576a33019941a92f2",
"score": "0.58019155",
"text": "def measure(interval)\n interval[1] - interval[0]\n end",
"title": ""
},
{
"docid": "9e344c1530001ac898b2b805e64171a0",
"score": "0.580054",
"text": "def seconds_in_minutes(num_min)\n\tnum_min * 60\nend",
"title": ""
},
{
"docid": "34a69dc4d0e166de66016389a6e911b9",
"score": "0.5777785",
"text": "def getDaysBetween(from, to)\n\t\t(to - from).to_i + 1\n\tend",
"title": ""
},
{
"docid": "c790c05b9054b47dde66b37157f1296f",
"score": "0.5762533",
"text": "def calc_mins_till\n (@difference.round(2) / 60.00).round(2)\n end",
"title": ""
},
{
"docid": "144ba20fbb48de6cb658f7f65133d35e",
"score": "0.57394296",
"text": "def min_interval\n MIN_INTERVAL\n end",
"title": ""
},
{
"docid": "511eab83d42d5f1581f5aacb3bde1d3f",
"score": "0.57190347",
"text": "def seconds_until_end_of_day\n end_of_day.to_i - to_i\n end",
"title": ""
},
{
"docid": "4cdf6b2ccd4ec6079fd879c9b4edde3a",
"score": "0.5716653",
"text": "def duration\n (finish - start)/3600\n end",
"title": ""
},
{
"docid": "f5c4e5df24de8443084b2d2913ddba33",
"score": "0.57023543",
"text": "def time_diff_milli( start, finish )\n\n\t( finish - start )\n\nend",
"title": ""
},
{
"docid": "fc1fc3d1084440ea3401dde1eb4799f4",
"score": "0.57010555",
"text": "def duration\n self.end_time - self.start_time\n end",
"title": ""
},
{
"docid": "13bdf688ae53ac9207ca44d137cb7ea3",
"score": "0.564708",
"text": "def interval_in_cents(other_note=nil)\n (1200*Math.log2(Rational(1.0, interval(other_note)))).abs\n end",
"title": ""
},
{
"docid": "6980dd91929ce30893daf0de268a7139",
"score": "0.5643265",
"text": "def to_seconds\n \n period = nil\n case self.to_sym\n when :yearly\n period = \"1 year\"\n when :monthly\n period = \"1 month\"\n when :weekly\n period = \"1 week\"\n when :daily\n period = \"1 day\"\n when :hourly\n period = \"1 hour\"\n else\n period = self\n end\n \n matches = period.match(self.class::TO_TIME_MATCHER)\n if matches.nil?\n raise Exception::new(\"Invalid period specification: \" << self << \".\")\n end\n \n count = matches[1].to_i\n unit = matches[2].to_sym\n seconds = nil\n \n case unit\n when :year\n seconds = 365 * 24 * 60 * 60\n when :month\n seconds = 30 * 24 * 60 * 60\n when :week\n seconds = 7 * 24 * 60 * 60\n when :day\n seconds = 24 * 60 * 60\n when :hour\n seconds = 60 * 60\n when :second\n seconds = 1\n end\n \n return seconds * count\n end",
"title": ""
},
{
"docid": "22a932a7baad4877efe01ce9199d9cf8",
"score": "0.5637274",
"text": "def interval\n config_get('bfd_global', 'interval', @get_args)\n end",
"title": ""
},
{
"docid": "dbee166fb1929118db068b43590024d3",
"score": "0.5621757",
"text": "def get_minutes\n de = self.string_to_datetime(@from)\n a = self.string_to_datetime(@to)\n \n total = ((a.hour - de.hour) * 60) + (a.min - de.min)\n end",
"title": ""
},
{
"docid": "3896729915a716c529b83b744ab24d3e",
"score": "0.5605103",
"text": "def secs\n self / 3600.0\n end",
"title": ""
},
{
"docid": "410d380a8b0232ce871c1ec811336c17",
"score": "0.56035334",
"text": "def duration\n return -1.0 if @start_time.nil? || @end_time.nil?\n (@end_time - @start_time) / 60.0\n end",
"title": ""
},
{
"docid": "f0d903b59af715438ab760c6a39cef79",
"score": "0.56022584",
"text": "def interval\n (Date.current - limit.days) .. Date.tomorrow\n end",
"title": ""
},
{
"docid": "94c1cf792a2fd453642f00024b971353",
"score": "0.560181",
"text": "def time_diff_milli(start, finish)\n (finish - start) * 1000.0\n end",
"title": ""
},
{
"docid": "620654e45570187c6ebdf3b4dc6acfb3",
"score": "0.5600645",
"text": "def range\n @from..@to\n end",
"title": ""
},
{
"docid": "a59323d5a9fac59742cc38e3afbf7d43",
"score": "0.5600363",
"text": "def time_length\n (end_time.hour - start_time.hour) + (end_time.min - start_time.min) / 60.0\n end",
"title": ""
},
{
"docid": "8e4ed6e4ccaabf140da395185480f6a2",
"score": "0.5600363",
"text": "def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end",
"title": ""
},
{
"docid": "a8e2c0ed1e6bb498b5e39b7ee739d029",
"score": "0.55721575",
"text": "def minimum_interval\n 500\n end",
"title": ""
},
{
"docid": "9790ec9efaddcaaf0ddcf46390582af4",
"score": "0.5569983",
"text": "def leave_period_in_days\n (to - from + 1).to_i\n end",
"title": ""
},
{
"docid": "f305c7d90c3440250f5726acd09b6073",
"score": "0.55652237",
"text": "def range\n (@from..@to)\n end",
"title": ""
},
{
"docid": "a6d8b088ea94c8aabb4a2196dcb0b644",
"score": "0.55618525",
"text": "def seconds_until_end_of_day\n end_of_day.to_f - to_f\n end",
"title": ""
},
{
"docid": "ca8da5da30545a618826ec9d210a21fd",
"score": "0.5557248",
"text": "def send_interval\n @attributes[:send_interval]\n end",
"title": ""
},
{
"docid": "ca8da5da30545a618826ec9d210a21fd",
"score": "0.5557248",
"text": "def send_interval\n @attributes[:send_interval]\n end",
"title": ""
},
{
"docid": "03107e1dde5da9db7b3bcc1cb0aeeab8",
"score": "0.5551547",
"text": "def interval_param\n \"interval:auto\"\n end",
"title": ""
},
{
"docid": "fd06cf4d0887663168a21671e2df2856",
"score": "0.5547315",
"text": "def seconds_in_cycle(now)\n next_due_at(now) - previous_due_at(now)\n end",
"title": ""
},
{
"docid": "48b75573db38b8c820d3eca68b45e8f5",
"score": "0.55407816",
"text": "def to_seconds\n AVERAGE_FACTOR * atom\n end",
"title": ""
},
{
"docid": "48b75573db38b8c820d3eca68b45e8f5",
"score": "0.55407816",
"text": "def to_seconds\n AVERAGE_FACTOR * atom\n end",
"title": ""
},
{
"docid": "c5da963e4a3b2e80c76e54891fc8788b",
"score": "0.55353105",
"text": "def poll_intervals\n [0.5, 1, 2, 4, 8, 16]\n end",
"title": ""
},
{
"docid": "e9f2291901cc9c76146044ee34c6057a",
"score": "0.5534529",
"text": "def duration\n (@stop_time.nil? ? Time.now : @stop_time) - @start_time\n end",
"title": ""
},
{
"docid": "8523963ac932763084848f3d92533ea3",
"score": "0.55328166",
"text": "def intervals(from = nil, to = nil)\n return [] unless intervals_beginning\n \n from ||= intervals_beginning\n to ||= Time.now.beginning_of_next_day\n intervals = []\n \n @intervals.each do |start, stop|\n if from > start\n if stop > from\n stop = to if to < stop\n intervals.push [from, stop]\n end\n next\n elsif stop > to\n intervals.push [start, to] if start < to\n break\n end\n intervals.push([start, stop])\n end\n \n if @started_at && @started_at < to && to == Time.now.beginning_of_next_day\n intervals.push([@started_at, Time.now])\n end\n \n intervals\n end",
"title": ""
},
{
"docid": "5d7e71c32d0fcd675af69f01b4d34bec",
"score": "0.55261254",
"text": "def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end",
"title": ""
},
{
"docid": "dfd6fb28d1dd0700bc4354be091df6f0",
"score": "0.55214244",
"text": "def time_diff(start_time, end_time)\n #calculate time elapsed\n elapsed_seconds = ((self.end_time - self.start_time)).to_i\n mins, secs = elapsed_seconds.divmod(60)\n hours, mins = mins.divmod(60)\n days, hours = hours.divmod(24)\n return days, hours, mins, secs\nend",
"title": ""
},
{
"docid": "559f260a97923f97c037addb5d76ae0c",
"score": "0.5503297",
"text": "def seconds\n value_parts[2]\n end",
"title": ""
},
{
"docid": "559f260a97923f97c037addb5d76ae0c",
"score": "0.5503297",
"text": "def seconds\n value_parts[2]\n end",
"title": ""
},
{
"docid": "444d19186b5a3cc27415fb692b9ace81",
"score": "0.54937524",
"text": "def hitimes_duration_i1\n i = Hitimes::Interval.new\n i.start\n i.stop\nend",
"title": ""
},
{
"docid": "f7ad05cbbd10f6e3472236140c85dfce",
"score": "0.54910064",
"text": "def period_length_in_seconds\n @period_length_in_seconds ||= period_length.to_i.minutes.to_i\n end",
"title": ""
},
{
"docid": "d6b0299531090c3a8727f102f1dfd463",
"score": "0.5484593",
"text": "def time_range min, max\n spawn :@trange, [min, max].map { |e| time_to_long e }\n end",
"title": ""
},
{
"docid": "3bc3668247455db9415b65c7eb4abc0d",
"score": "0.5484392",
"text": "def elapsed\n (Time.now - @start_time).round\n end",
"title": ""
},
{
"docid": "aa78260506709a79d7782d37f5a88650",
"score": "0.5469466",
"text": "def interval=(_arg0); end",
"title": ""
},
{
"docid": "57277b4746129213ce982335c91ee471",
"score": "0.5465993",
"text": "def time_between(start_point, end_point)\n return 0 unless start_point.time && end_point.time\n end_point.time - start_point.time\n end",
"title": ""
},
{
"docid": "d95ab2e5c7605cbe53511ee18f18cea7",
"score": "0.54594517",
"text": "def time_interval(inter_val_num=15)\n\n require 'rubygems'\n require 'active_support'\n require 'active_support/time'\n\n cur_time = Time.now\n comp_time = cur_time - cur_time.sec - cur_time.min%15*60\n base_time = comp_time + 1.hour\n\n if comp_time < base_time\n comp_time = comp_time + inter_val_num.minutes\n end\n\n return comp_time.strftime(\"%M:%S\")\n\nend",
"title": ""
},
{
"docid": "95561aa01e3c1c4d9065fdc40969c4a5",
"score": "0.5456601",
"text": "def interval(key, default=0.0)\n\t\tstr = self.fetch(key.downcase, nil)\n\t\tif not str.nil?\n\t\t\tret = 0.0;\n\t\t\tstr.split(/:/).each { |str2|\n\t\t\t\tret += (ret * 60.0) + str2.to_f\n\t\t\t}\n\t\t\treturn ret\n\t\tend\n\t\treturn default\n\tend",
"title": ""
},
{
"docid": "654376f9cbe09840f4f494de8c7d853d",
"score": "0.5454878",
"text": "def to_i\n return @tv_sec\n end",
"title": ""
},
{
"docid": "329ee2ce6c5b9261c401259929db0b69",
"score": "0.54544985",
"text": "def to_range(from, to, step)\n to_time(from).to(to_time(to), step.minutes).collect { |t| t.to_s(:hrs_and_mins)} if step > 0\n end",
"title": ""
},
{
"docid": "1f93b05a8cd97a8c15bf7f5ef0b43aa7",
"score": "0.5450255",
"text": "def nowSeconds; Time.now.utc.to_i end",
"title": ""
},
{
"docid": "fab7c79fbb3e8824d0b9d979279a3be2",
"score": "0.54495054",
"text": "def period_in_secs\n if period_in_ns\n period_in_ns * (10**-9)\n end\n end",
"title": ""
},
{
"docid": "755aaeadb8ba8d80dc8ff3194df7780f",
"score": "0.544913",
"text": "def duration\n if ending >= beginning\n (ending.to_i - beginning.to_i)\n else\n start_of_day = TimeOfDay.new(0,0,0)\n end_of_day = TimeOfDay.new(23,59,59)\n duration_day_1 = (end_of_day.to_i - beginning.to_i) + 1\n duration_day_2 = (ending.to_i - start_of_day.to_i)\n duration_day_1 + duration_day_2\n end\n end",
"title": ""
},
{
"docid": "26e979adf92fe995e28cd21e066bca85",
"score": "0.5442599",
"text": "def monitoring_interval\n data[:monitoring_interval]\n end",
"title": ""
}
] |
424da54d4b9996a626f2fae3fab386cd
|
'0.123456' > 123456 '1.123456' > 123456
|
[
{
"docid": "8f9d32d9a13debce56ec6128c83e9d9c",
"score": "0.0",
"text": "def microseconds(time)\n ((time[:sec_fraction].to_f % 1) * 1_000_000).to_i\n end",
"title": ""
}
] |
[
{
"docid": "379a1ef459d4478962551c6b19387697",
"score": "0.68802655",
"text": "def number?(input)\n #edge case, doesn't deal with 1. or 1.30 it either adds a zero or takes one off\n input.to_i.to_s == input || input.to_f.to_s == input\nend",
"title": ""
},
{
"docid": "1d79655ecdb13ce1d5bfe765602a601d",
"score": "0.67846024",
"text": "def same_digits?(a, b)\n return a != b &&\n a.to_s.split(/(?=.)/).sort == b.to_s.split(/(?=.)/).sort\nend",
"title": ""
},
{
"docid": "218e51f656020c526d7633d94ac3cff4",
"score": "0.66444564",
"text": "def normalize_version_strings(first_string, second_string)\n if first_string.nil? || second_string.nil? || first_string.empty? || second_string.empty?\n return first_string, second_string\n end\n first_groups = first_string.split(\".\").length\n second_groups = second_string.split(\".\").length\n if first_groups != second_groups\n if first_groups > second_groups\n ((1..first_groups-second_groups).to_a).each do |digit|\n second_string += \".0\"\n end\n end\n if first_groups < second_groups\n ((1..second_groups-first_groups).to_a).each do |digit|\n first_string += \".0\"\n end\n end\n end\n return first_string, second_string\nend",
"title": ""
},
{
"docid": "11f5fb3c6796c3337a9ec3fb10748474",
"score": "0.6635693",
"text": "def stringnum_comparison(str1, str2)\n extract_digits(str1) <=> extract_digits(str2)\n end",
"title": ""
},
{
"docid": "8ba625ab8a29751dc9248c42c65ec284",
"score": "0.64306575",
"text": "def interesting_number(number)\n return false if number.to_s.split(\"\").length < 3 \n number.to_s.split(\"\").sort[0] == \"0\" ? number.to_s.split(\"\").delete_at(0) && number.to_s.split(\"\").push(\"0\") : x = x\n return number.to_s.split(\"\")[0] < number.to_s.split(\"\")[-1] ? number.to_s.split(\"\").sort == number.to_s.split(\"\") || false : number.to_s.split(\"\").sort.reverse == number.to_s.split(\"\") || false\nend",
"title": ""
},
{
"docid": "460490307ded3c195944d49554c2b983",
"score": "0.6298446",
"text": "def double?(num)\n num_str = num.to_s\n midpoint = num_str.length / 2\n num_str[0...midpoint] == num_str[midpoint..-1]\nend",
"title": ""
},
{
"docid": "ffcdcbe75cea3006d1fbae548718693b",
"score": "0.6282268",
"text": "def compare_version(v1, v2)\r\n v1 = v1.split('.')\r\n v2 = v2.split('.')\r\n longest = v1.length > v2.length ? v1 : v2\r\n (0...(longest.length)).each do |idx|\r\n one = v1[idx] || '0'\r\n two = v2[idx] || '0'\r\n return -1 if two.to_i > one.to_i\r\n return 1 if one.to_i > two.to_i\r\n end\r\n 0\r\nend",
"title": ""
},
{
"docid": "6323232bc8bcf13bf27afa8f0f9c449b",
"score": "0.62682724",
"text": "def test_decimals\n assert_equal( \"+(+(1., 2.2), 3.325)\" , @p.prefix_form(\"1.+2.2+3.325\") )\n assert_equal( \"+(0.0, .2)\" , @p.prefix_form(\"0.0+.2\") )\n assert_raise(ArgumentError) { @p.prefix_form(\".+1\") }\n end",
"title": ""
},
{
"docid": "d20f647103f2052ed2bd55359f8aa0dd",
"score": "0.6259577",
"text": "def triple_double(num1, num2)\n str1 = num1.to_s\n str2 = num2.to_s\n str1.match?(/(.)\\1\\1/) && str2.match?(/(.)\\1/) ? 1 : 0\nend",
"title": ""
},
{
"docid": "0ebc9c8c1aabbe1c4d9bf7930c0f39a2",
"score": "0.62392557",
"text": "def check_number(num)\n if num.include?('.')\n num.to_f.to_s == num\n else\n num.to_i.to_s == num\n end\nend",
"title": ""
},
{
"docid": "e3def238cf8f67b17904f3512fee88a9",
"score": "0.62095726",
"text": "def test_regexp_number_separator\n assert_equal '1.234', @TS_Regexp.format(1234, '.')\n end",
"title": ""
},
{
"docid": "1a4414ecc9fa969ab418694371ba9d56",
"score": "0.6186467",
"text": "def number\n number = number.to_s\n if number.includes?('.')\n number = number.to_f\n else\n number = number.to_i\n end\nend",
"title": ""
},
{
"docid": "8b15637dc7b42438a1ab33aeebd39f68",
"score": "0.6144723",
"text": "def has_leading_zeros?(value)\n if value.to_s.match(/\\./) # float value\n value.to_s.to_f.to_s.length != value.to_s.length\n else # integer value\n value.to_s.to_i.to_s.length != value.to_s.length\n end\n end",
"title": ""
},
{
"docid": "54618c102f912435d7a3a98cede98475",
"score": "0.6140433",
"text": "def modify(cost)\n answer = ''\n if cost == cost.to_f || cost == cost.to_i\n return cost\n else \n cost = cost.to_s\n arr = cost.split('.')\n arr[0].each_char do |c|\n if isNum?(c) \n answer += c.to_s\n end\n end\n end\n return answer.to_i + arr[1].to_i.round(2)* 0.01\nend",
"title": ""
},
{
"docid": "4d27a93cd8e1aecbb866d014db3b263d",
"score": "0.612046",
"text": "def value_is_float?(string)\n return false if string.scan(/\\./).length != 1\n sides = string.split('.')\n return sides[0].numeric? && sides[1].numeric? && sides[1].to_i >= 0\n end",
"title": ""
},
{
"docid": "31ccf2f5e23e1fee646e1384e8ec27f6",
"score": "0.61188745",
"text": "def CheckDecimals(str)\r\n currentdec = Sketchup.active_model.options[\"UnitsOptions\"][\"LengthPrecision\"]\r\n# puts \"currentdec #{currentdec}\\n\"\r\n str.chomp!('mm')\r\n str.chomp!('\"')\r\n while str[/0$/] == '0' #remove trailing 0's\r\n str.chop!\r\n# puts \"chopped #{str}\\n\"\r\n end\r\n bits = str.split('.')\r\n# puts \"bits #{bits}\\n\"\r\n if (bits.length == 2)\r\n newdec = bits[1].length\r\n# print \"newdec #{newdec}\\n\"\r\n if newdec > currentdec\r\n Sketchup.active_model.options[\"UnitsOptions\"][\"LengthPrecision\"] = newdec\r\n# puts \"precision set to #{newdec}\\n\"\r\n end\r\n else\r\n if (bits.length == 1) # then we don't have any decimal numbers so if we previously set it large, lets reduce it\r\n if (currentdec > 3)\r\n if (PhlatScript.isMetric)\r\n newdec = 2\r\n else\r\n newdec = 4\r\n end\r\n Sketchup.active_model.options[\"UnitsOptions\"][\"LengthPrecision\"] = newdec\r\n# puts \"precision set down to #{newdec}\\n\"\r\n end\r\n end\r\n \r\n end\r\n \r\n end",
"title": ""
},
{
"docid": "4fe6890128b26b3a677f64366aafa451",
"score": "0.60938174",
"text": "def string_numbers_same_format?(n1, n2)\n logger.info {\"VALIDANDO NUMEROS #{n1}, #{n2}\"}\n\n if n1.size == n2.size # 0010 y 0200\n return n1.size\n elsif n1[0] != \"0\" and n2[0] != \"0\" # 10 y 200\n return 0\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "80f970b37c5beb79e750905a616ba31a",
"score": "0.6056779",
"text": "def DivisionStringified(num1,num2)\n result = num1.to_f / num2.to_f\n result.round.to_s.chars.map(&:to_i).size <= 3 ? result.round : result.round(3)\nend",
"title": ""
},
{
"docid": "547c653b0572181980fe8e06442f07af",
"score": "0.6032538",
"text": "def numberfy(input_string)\n if input_string.include?(\".\")\n input_string.to_f\n else input_string.to_i\n end\nend",
"title": ""
},
{
"docid": "3f778cebb684ed426cf70309b60ea4c1",
"score": "0.60318667",
"text": "def double_number?(number)\n numstring = number.to_s\n if numstring.length.even?\n midpoint = numstring.length/2\n if numstring.slice(0, midpoint) == numstring.slice(-midpoint, midpoint)\n return true\n end\n end\n\n return false\nend",
"title": ""
},
{
"docid": "a9a1e00ee9ee70eaddb8b7495faa2c6b",
"score": "0.60248065",
"text": "def DivisionStringified(num1,num2)\n quotient = num1.to_f / num2.to_f\n\n \"#{quotient.round.to_s.reverse.gsub(/(...)(?=.)/, '\\1,').reverse}\"\nend",
"title": ""
},
{
"docid": "62e9ec906d0b640ec0a9aecad2c948f9",
"score": "0.60234827",
"text": "def numeric?(str)\n !str.to_s.match(/^-?[\\d.]+$/).nil?\n # str.to_i.to_s == str\nend",
"title": ""
},
{
"docid": "c48fc1dcc9307262cd261b3f89890f7d",
"score": "0.59885615",
"text": "def is_num(num)\n #First convert num to float or integer . If it is not a number, result will be 0.0. Convert that back in to string to confirm that it matches\n num.to_f.to_s == num || num.to_i.to_s == num\nend",
"title": ""
},
{
"docid": "764e443f49119c437f7642d43e284683",
"score": "0.5979624",
"text": "def float2?(input)\n /\\d/.match(input) && /^-?\\d*\\.?\\d*$/.match(input)\nend",
"title": ""
},
{
"docid": "934492fe46fd69f116959eb56b34198e",
"score": "0.5977472",
"text": "def is_double?(integer)\n string_int = integer.to_s\n middle = string_int.size / 2\n string_int[0, middle] == string_int[middle, string_int.size]\nend",
"title": ""
},
{
"docid": "fcc54379b6cf2ec3397e4f275d6f2b45",
"score": "0.59771335",
"text": "def test_numeric_and_string_comparison\n value1_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n value2_ = ::Versionomy.create([1, 9, 2, 1], :rubygems)\n assert(value2_ > value1_)\n end",
"title": ""
},
{
"docid": "e82fbb20451addb5c2f20d0fb7e80f61",
"score": "0.597022",
"text": "def like_f?\n return false unless self.to_f?\n\n num = self.without_leading_zeros\n (num.to_i != num.to_f) || num.include?(\".\")\n end",
"title": ""
},
{
"docid": "ccf08c4c74a611ef001ce11c41c951a0",
"score": "0.595084",
"text": "def has_strict_double?(num)\n has_double?(num.to_s.gsub(/([0-9])\\1{2,}/, '_'))\nend",
"title": ""
},
{
"docid": "32d9cd614b6ea354fa205bad017b76c4",
"score": "0.5939156",
"text": "def reformat(number)\n num_without_decimal = number.gsub('.','') \n unless num_without_decimal.length == 4\n num_without_decimal = '0' + num_without_decimal \n end\n num_without_decimal\n end",
"title": ""
},
{
"docid": "cc4dbc849dbaadc73c5b94098fc1996c",
"score": "0.5935559",
"text": "def test_numeric_and_string_comparison\n value1_ = ::Versionomy.create([1, 9, 2, 'a2'], :semver)\n value2_ = ::Versionomy.create([1, 9, 2], :semver)\n assert(value2_ > value1_)\n end",
"title": ""
},
{
"docid": "33ddc9a89d90f5e5e51b0a2b2d2629a3",
"score": "0.5930457",
"text": "def is_dec(str)\n\tstr == \".\"\nend",
"title": ""
},
{
"docid": "bc59491e7adc02079cb48174130f6f38",
"score": "0.5921854",
"text": "def test_basic_conversions\n assert_equal 1.292, 1.euro\n assert_equal 0.019, 1.rupee\n assert_equal 0.013, 1.yen\n assert_equal 1, 1.dollar\n end",
"title": ""
},
{
"docid": "bac5baa437aece9bc585f67b7355edd7",
"score": "0.5907641",
"text": "def can_be_number(string)\n forced_as_f = string.to_f # force string to be a float\n forced_as_i = string.to_i # force string to be an integer\n return string == forced_as_f.to_s || string == forced_as_i.to_s # see if either of the forced strings equal the original\nend",
"title": ""
},
{
"docid": "0d7dfc53a8c37c9fbb39386e4348610f",
"score": "0.5881798",
"text": "def double?(number)\n nb_str = number.to_s\n return false if nb_str.size.odd?\n\n size = nb_str.size / 2\n left_side = nb_str[0, size]\n right_side = nb_str[size, size]\n\n left_side == right_side\nend",
"title": ""
},
{
"docid": "d2535b285c6a243688648707aef49b4e",
"score": "0.58751416",
"text": "def float_or_interger(str)\n if str.include?\".\"\n num =str.to_f\n else\n num = str.to_i\n end\n return num\nend",
"title": ""
},
{
"docid": "691e7c1e18084ca255c358ea1a9740e1",
"score": "0.58717483",
"text": "def get_precision_of(num)\n str_num = num.to_s\n str_num.include?('.') ? str_num.length - str_num.index('.') - 1 : 0\nend",
"title": ""
},
{
"docid": "0ed11635cc340378409b067d7817be97",
"score": "0.586263",
"text": "def double?(num)\n power = num.digits.size / 2\n left, right = num.divmod(10**power)\n left == right\nend",
"title": ""
},
{
"docid": "01d3230f0aa806e3c77b1cb258232a87",
"score": "0.5854513",
"text": "def triple_double(num1,num2)\n numbers = num1.to_s.scan(/(\\d)\\1\\1/)\n return 0 if numbers.empty?\n numbers.flatten!.map! { |i| num2.to_s.scan(/#{i}{2}/) }\n numbers.flatten.empty? ? 0 : 1\nend",
"title": ""
},
{
"docid": "0408fdd7b1c3ce174d6946886140ca56",
"score": "0.584356",
"text": "def luck_check (str)\n raise ArgumentError if str.match?(/\\D/) || str.empty?\n middle = str.size / 2\n first_half, second_half = str.split(/(\\d{#{middle}})\\d?(\\d{#{middle}})/).last(2)\n first_half.to_i.digits.sum == second_half.to_i.digits.sum\nend",
"title": ""
},
{
"docid": "80b8ea037a8d8193699b20e667f9feb0",
"score": "0.5834027",
"text": "def float?(num)\n num.to_f().to_s()==num\nend",
"title": ""
},
{
"docid": "ae4622d550f9008a0485c995bc12e054",
"score": "0.58314085",
"text": "def commify(n)\n\tn.to_s =~ /([^\\.]*)(\\..*)?/\n\t\tint, dec = $1.reverse, $2 ? $2 : \"\"\n\twhile int.gsub!(/(,|\\.|^)(\\d{3})(\\d)/, '\\1\\2,\\3')\n\tend\n\tint.reverse + dec\nend",
"title": ""
},
{
"docid": "6ee8618de835ded1dfa1f717386a3b9e",
"score": "0.58302855",
"text": "def num(x,y)\n if x > 0 && y > 0\n return x.digits.first == y.digits.first\n else\n puts \"invalid\"\n end\nend",
"title": ""
},
{
"docid": "a176700535055ded05af3eb2a2e5cb2c",
"score": "0.58209825",
"text": "def <=>(str)\n [major, minor, tiny] <=> other.to_s.split('.').map { |n| Integer(n) }\n end",
"title": ""
},
{
"docid": "2cc17f069d01ba522b5374750327ea1f",
"score": "0.5806551",
"text": "def _versioncmp(a, b)\n a, b = a.to_s.split('.'), b.to_s.split('.')\n [a.length, b.length].max.times do |i|\n return -1 if a[i].to_i < b[i].to_i\n return 1 if a[i].to_i > b[i].to_i\n end\n return 0\nend",
"title": ""
},
{
"docid": "efc2aa14c72bd818807ddd5120a64ae3",
"score": "0.58043694",
"text": "def vampire_test(a,b)\n \"#{a * b}\".split('').sort == \"#{a}#{b}\".split('').sort \nend",
"title": ""
},
{
"docid": "947eb1c6bf6cc272e4209044f2ed7165",
"score": "0.5790049",
"text": "def triple_double(num1,num2)\n n = num1.digits.each_cons(3).select { |i| p i[0] == i[1] && i[0] == i[2] }\n n.any? && num2.to_s.include?(n[0][1..-1].join) ? 1 : 0\nend",
"title": ""
},
{
"docid": "3776ee8775574902a8ddf1dfd14023e4",
"score": "0.5784707",
"text": "def double_number?(num)\n str_num = num.to_s\n middle_index = (str_num.size - 1) / 2\n str_num.size.even? && str_num[0..middle_index] == str_num[(middle_index + 1)..-1]\nend",
"title": ""
},
{
"docid": "cc20465abd8ab4a2735e4d8aafb14997",
"score": "0.57832396",
"text": "def order_weight(strng)\n strng.split.sort_by(&:to_s).sort_by{ |v| v.to_i.digits.inject(:+) }.join(' ')\nend",
"title": ""
},
{
"docid": "b307655853d5f3ecaa82fcfd34d81013",
"score": "0.57817614",
"text": "def number?\n #just regex\n #most likely faster\n #than exception handling\n match = /\\b[0-9]+([.]{1}[0-9]+){0,1}\\b/.match(self)\n if match.nil?\n return false\n else\n return match[0]==self\n end\n end",
"title": ""
},
{
"docid": "78a3f061e5608b2cc52303e711838ac0",
"score": "0.5776494",
"text": "def float?(num)\n num.to_f.to_s == num\nend",
"title": ""
},
{
"docid": "0515610784638cdefab46aaf9a196fec",
"score": "0.57754457",
"text": "def float?(num)\n num == num.to_f.to_s\nend",
"title": ""
},
{
"docid": "0904c32a82f10a6c3535518ff87bbeca",
"score": "0.5768741",
"text": "def number_type b\n if b.include?(\".\")\n return b.to_f.round(2)\n else\n return b.to_i\n end\nend",
"title": ""
},
{
"docid": "85e5088d908a456b045e0341d6c4f734",
"score": "0.57442945",
"text": "def integer_or_float(x)\n if x.include?(\".\")\n return x.to_f\n else\n return x.to_i\n end\nend",
"title": ""
},
{
"docid": "d6a8ed98699a832e06d6968425a2ae52",
"score": "0.57399195",
"text": "def num_check(num_one,num_two)\n num_one.to_i.to_s == num_one &&num_two.to_i.to_s == num_two || num_one.to_f.to_s == num_one &&num_two.to_f.to_s == num_two\nend",
"title": ""
},
{
"docid": "f614988288d739bb1a8283b82fe80df7",
"score": "0.5735699",
"text": "def test_last_digit(a, b)\n return (a % 10 == b % 10);\n end",
"title": ""
},
{
"docid": "15123f18bc65be300649e6384e091778",
"score": "0.57345337",
"text": "def float?(word)\n (word.to_f.to_s != word) && word\n end",
"title": ""
},
{
"docid": "ac2bfa7ae6363b05c35d0e2533e20eac",
"score": "0.5731424",
"text": "def test_002_convert_float2\r\n\tresult = convert_float( '')\r\n\tassert close_enough( 0.0, result )\r\n end",
"title": ""
},
{
"docid": "7e011549e530065f05fe886f118f4956",
"score": "0.5722905",
"text": "def double_number?(number)\n number = number.to_s\n size = number.length\n \n return false if size.odd?\n\n half = size / 2\n number[0..(half - 1)] == number[half..-1]\nend",
"title": ""
},
{
"docid": "bbddc0f517f1f977e143d2ca4416875e",
"score": "0.5713183",
"text": "def dble_num?(num)\n str = num.to_s\n str.size.even? && (str[0...str.size/2] == str[str.size/2...str.size])\nend",
"title": ""
},
{
"docid": "0797b6613fab4426c438da5d557826a1",
"score": "0.57118183",
"text": "def TripleDouble(num1,num2)\n arr_num1 = num1.to_s.split(//).map(&:to_i)\n arr_num2 = num2.to_s.split(//).map(&:to_i)\n first_number_valid?(arr_num1) && second_number_valid?(arr_num2) ? 1 : 0\nend",
"title": ""
},
{
"docid": "3e2efa53d21c14b56de0d4976d2d4767",
"score": "0.56997836",
"text": "def number_type a\n if a.include?(\".\")\n return a.to_f.round(2)\n else\n return a.to_i\n end\nend",
"title": ""
},
{
"docid": "8bb67573823872a22164b6a56028d331",
"score": "0.5699555",
"text": "def as_val(s)\n if s < 1_000\n s\n elsif s >= 1_000_000_000_000\n (s / 1_000_000_000_000.0).round(1).to_s + 'T'\n elsif s >= 1_000_000_000\n (s / 1_000_000_000.0).round(1).to_s + 'B'\n elsif s >= 1_000_000\n (s / 1_000_000.0).round(1).to_s + 'M'\n elsif s >= 1_000\n (s / 1_000.0).round(1).to_s + 'K'\n end\nend",
"title": ""
},
{
"docid": "5876c98ba385ba9d4ee6d611318853e0",
"score": "0.568775",
"text": "def DivisionStringified(num1, num2)\n formatted_num = (num1.to_f / num2).round.to_s\n formatted_num.reverse.scan(/\\d\\d?\\d?/).join(',').reverse\nend",
"title": ""
},
{
"docid": "cc85a64951ad9ce94a5841fc604a42b1",
"score": "0.5685791",
"text": "def one_alternate(quiz)\na,b=quiz.to_s.split('.');[a.reverse.gsub(/(\\d{3})(?=\\d)/,'\\1,').reverse,b].join('.')\nend",
"title": ""
},
{
"docid": "31cf6c201f57fca26b829701fd972892",
"score": "0.5676242",
"text": "def _f(str)\n _n(str).gsub(/([\\d]+\\.?)(.*)/, '\\2')\n end",
"title": ""
},
{
"docid": "d47e23cb88aebb6ac2ec92d4a8c3578a",
"score": "0.5670698",
"text": "def to_number(value)\n return value.to_i unless value =~ /\\./\n return value.to_f if value =~ /\\./ \n end",
"title": ""
},
{
"docid": "e9cc7ff998a6175c1da90035891661d5",
"score": "0.56662554",
"text": "def mixed_fraction(string)\n improper = Rational(*(string.split('/').map(&:to_i)))\n integer = improper.to_i\n fraction = improper - integer\n \n return \"#{integer}\" if (fraction).numerator == 0\n return \"#{fraction}\" if integer == 0\n \"#{integer} #{fraction.abs}\"\nend",
"title": ""
},
{
"docid": "1b2a1d09d157f21876a849f921dca824",
"score": "0.5666072",
"text": "def double_num?(number)\n num_arr = number.digits.reverse\n midpoint = (num_arr.size / 2.0).ceil\n num_arr[0, midpoint] == num_arr[midpoint, num_arr.size - midpoint]\nend",
"title": ""
},
{
"docid": "afe4af6a118f54067993127e0817e5ad",
"score": "0.5665362",
"text": "def split_decimal(total_amount)\r\n total_amount = total_amount.to_s\r\n total_amount_array=total_amount.split(\".\")\r\n if total_amount_array[1]== \"00\" or total_amount_array[1]== \"0\"\r\n total_amount=total_amount_array[0]\r\n end\r\n return total_amount\r\n end",
"title": ""
},
{
"docid": "974b422d636f20363eaf1805aef29e30",
"score": "0.56637824",
"text": "def is_double?(num)\r\n if !num.to_s.size.even?\r\n false\r\n else\r\n total_size = num.to_s.size\r\n half_size = total_size/2\r\n num.to_s[0..(half_size-1)] == num.to_s[half_size...total_size]\r\n end\r\nend",
"title": ""
},
{
"docid": "5810a01a8a11bcdb2eb14c6d66aad62b",
"score": "0.56602067",
"text": "def criteria?(frac)\n n, d = frac.split('/')\n n.length > d.length\nend",
"title": ""
},
{
"docid": "8fd898d87947cf5c8df7b3b5997f234f",
"score": "0.5655149",
"text": "def no_float(str)\n\t(str.to_f) == 0\ntotal_cents = ((str).to_f * 100).to_i\nend",
"title": ""
},
{
"docid": "038235bc5b6659e7c95b032f60037dff",
"score": "0.5654063",
"text": "def number_is_valid_2?(number)\n str = number.to_s\n str.scan(/(\\d)\\1+/).length - str.scan(/(\\d)\\1\\1+/).length > 0\nend",
"title": ""
},
{
"docid": "2e834767362d5aad231df85d9013262c",
"score": "0.56523085",
"text": "def order_weight(str)\n str.split.sort.sort_by {|num| num.to_i.digits.reduce(:+)}.join(\" \")\nend",
"title": ""
},
{
"docid": "013501ca1a8834f329fd2a8ab1e61efe",
"score": "0.56454796",
"text": "def parse_decimal_part(str)\n map = if str.index('割')\n Numeja::JA_割合用小数\n else\n Numeja::JA_小数\n end\n keys = map.keys()\n keys.reduce(0) do |t, ja_digit|\n index = str.index(ja_digit)\n break t if index.nil?\n unit = str.slice!(0, index)\n str.slice!(0, 1)\n t += (unit.to_f * map[ja_digit])\n t\n end\n end",
"title": ""
},
{
"docid": "846104bb478ff2e891548939cc7a7e2d",
"score": "0.56407976",
"text": "def str_zero(n)\n n.to_s.sub(/\\.?0+$/, '')\nend",
"title": ""
},
{
"docid": "f4b7698ee3317a37a98b7a3f222e8122",
"score": "0.56172496",
"text": "def float?\n !!strip.match(/^-?\\d+\\.\\d+$/)\n end",
"title": ""
},
{
"docid": "e40db6cb5af0d836e681a95731da29bc",
"score": "0.5616051",
"text": "def solve(n)\n if n.to_s.length >= 6\n num = n.to_s[0..-3] + '.' + n.to_s[-2..-1]\n int_length = num.index('.')\n until int_length <= 3\n comma_idx = int_length - 3\n num = num[0...comma_idx] + ',' + num[comma_idx..-1]\n int_length -= 3\n end\n return num\n else\n return (n.to_f / 100).to_s\n end\nend",
"title": ""
},
{
"docid": "282276700291f5465ec4450a9b0eff96",
"score": "0.5615909",
"text": "def test_non_numeric_times\n v = Verify.new\n return_code = v.verify_fourth_pipeset('123.2s1', '123.12')\n assert_equal 1, return_code\n end",
"title": ""
},
{
"docid": "344d67c66c953b525ca9fcefc01eaf28",
"score": "0.5598628",
"text": "def test_cur_sec_greater\n \tassert(@bv.timestap_correct(1, \"123456.1111\", \"123457.1111\"))\n end",
"title": ""
},
{
"docid": "8d481b516519945d90733917126275e1",
"score": "0.5590974",
"text": "def float?(num)\n num.to_f.to_s == num # converts num to interger and back to string and then compares this with num.\n\n #num.match(/\\d/) # this asks is input num has any letters in it.\nend",
"title": ""
},
{
"docid": "8d481b516519945d90733917126275e1",
"score": "0.5590974",
"text": "def float?(num)\n num.to_f.to_s == num # converts num to interger and back to string and then compares this with num.\n\n #num.match(/\\d/) # this asks is input num has any letters in it.\nend",
"title": ""
},
{
"docid": "e523794529435500c36fe2581cb15251",
"score": "0.5590535",
"text": "def is_float?(input)\n input.to_f.to_s == input\nend",
"title": ""
},
{
"docid": "f10c183a25a1ca75cf683343ec93fed1",
"score": "0.5583616",
"text": "def test_is_nummeric\n assert(StringChecker.is_numeric?(\"+20\"))\n assert(StringChecker.is_numeric?(\"-020\"))\n assert(StringChecker.is_numeric?(\"123\"))\n assert(StringChecker.is_numeric?(\"0123\"))\n assert(!StringChecker.is_numeric?(\"1.2\"))\n assert(!StringChecker.is_numeric?(\"asdf\"))\n assert(!StringChecker.is_numeric?(\" \"))\n end",
"title": ""
},
{
"docid": "1a963adad42d1fcd749eaf7e8b53f033",
"score": "0.5582882",
"text": "def double?(number)\n size = number.to_s.size\n if number.to_s.size.even?\n number.to_s[0..size/2-1] == number.to_s[size/2..size]\n else\n false\n end\nend",
"title": ""
},
{
"docid": "7d32545982938741ab57e7443a6af5d9",
"score": "0.55804366",
"text": "def double_num?(int)\n # digits is even && left half = right half\n len = int.to_s.length\n arr = int.digits.reverse\n len.even? && arr.take(len / 2) == arr.drop(len / 2)\nend",
"title": ""
},
{
"docid": "637e27b12591bc732a02c57d53daa785",
"score": "0.5567091",
"text": "def boolIsBouncyInt i\n numDigits = i.to_s.length\n return false if numDigits < 3 # any number 0-99 is non-bouncy\n sortedNumber = i.to_s.each_char.sort.join.to_i\n sortedNumberReverse = i.to_s.each_char.sort.reverse.join.to_i\n return false if sortedNumber % 10 == sortedNumber / 10**(numDigits - 1)\n if i % 10 == sortedNumber % 10 # this means it's an ascending number\n return (not sortedNumber == i)\n elsif i % 10 == sortedNumberReverse % 10 # this means it's a descending number\n return (not sortedNumberReverse == i)\n end\n true\nend",
"title": ""
},
{
"docid": "135dfd70d5bc54f8e07a7d79c2f34a66",
"score": "0.556641",
"text": "def f(natural_number)\n string = natural_number.to_s\n string.reverse!\n \"0.#{string}\"\nend",
"title": ""
},
{
"docid": "86fac57c545ec6f488b7416df8d9f3f6",
"score": "0.5565987",
"text": "def test_numeric_comparison\n value1_ = ::Versionomy.create([1, 9, 2], :rubygems)\n value2_ = ::Versionomy.create([1, 9], :rubygems)\n assert(value2_ < value1_)\n value1_ = ::Versionomy.create([1, 9, 0], :rubygems)\n value2_ = ::Versionomy.create([1, 9], :rubygems)\n assert(value2_ == value1_)\n end",
"title": ""
},
{
"docid": "11a1844e625548f8e7329606a7227f99",
"score": "0.55655944",
"text": "def float_check(num)\n\tif num.include?(\".\")\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"title": ""
},
{
"docid": "11a1844e625548f8e7329606a7227f99",
"score": "0.55655944",
"text": "def float_check(num)\n\tif num.include?(\".\")\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"title": ""
},
{
"docid": "ee39e334e1e50b13fbc7135a455acf72",
"score": "0.55633867",
"text": "def valid_float_number?(num)\n num.to_f.to_s == num\nend",
"title": ""
},
{
"docid": "612a85e0626ed05e0a18d60f944f4037",
"score": "0.55622244",
"text": "def is_valid_num?(input)\n /[0-9]+\\.[0-9]{2}$/.match(input)\nend",
"title": ""
},
{
"docid": "d649ff139993b5b27d27c4318e79fc84",
"score": "0.5555525",
"text": "def numeric?(numberInput)\n numberInput = numberInput.to_s\n if numberInput =~ /^[-+]?[0-9]*\\.?[0-9]+$/\n \n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "84f62ab4d60e5ad31e6360297f07a5e9",
"score": "0.5552852",
"text": "def is_doubled?(num)\n str = num.to_s\n str.size.even? && str[0..str.size/2 -1] == str[str.size/2 ..-1]\nend",
"title": ""
},
{
"docid": "927cd78eabda6cbf3a2b43ce456afa6e",
"score": "0.5551291",
"text": "def convert_smaller_than_thousand(val)\n\t\tif val >= 100\n\t\t\tv1 = val/100\n\t\t\tval -= v1*100\n\n\t\t\t# Gives you a number of hundred tens units pattern \n\t\t\tconvert_hundred(v1)\n\t\t\tset_exponent(2)\n\t\t\tconvert_hundred(val)\n\t\t\t\n\t\telse\n\t\t\tconvert_hundred(val)\n\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8b378474062682bca76b874b84e138ba",
"score": "0.55477047",
"text": "def number?(obj)\n obj = obj.to_s unless obj.is_a? String\n /\\A[+-]?\\d+(\\.[\\d]+)?\\Z/.match obj\nend",
"title": ""
},
{
"docid": "4929921dca6f23fa26b064685911ee99",
"score": "0.5541909",
"text": "def eureka(num)\n num_arr = num.to_s.split('').collect{ |x| x.to_i }\n i = 0\n num1 = num_arr.reverse\n result1 = 0\n result2 = 0\n while i < num_arr.length\n result1 += num1[i] * (10 ** i)\n result2 += num_arr[i] ** (i + 1)\n i += 1\n end\n result1 == result2\n end",
"title": ""
},
{
"docid": "2ec0fa302a1c27c1ac95a87a4426e5ee",
"score": "0.5540011",
"text": "def strip_common_digits(num, den)\n # Rejct the trivial examples\n return nil, nil if num % 10 == 0 || den % 10 == 0\n\n a = num.to_s.split('').sort\n b = den.to_s.split('').sort\n\n # Case of 49/94 is a no go\n return nil, nil if a == b\n\n common = a & b\n unless common.length == 0\n a.reject!{|x| x == common.first}\n b.reject!{|x| x == common.first}\n\n # Case that one of the numbers is like 99 and both values were rejected\n return nil, nil if a.length == 0 || b.length == 0\n\n return a.first.to_f, b.first.to_f\n end\nend",
"title": ""
},
{
"docid": "0e310e99e22931bc3ada15fa5ac34b23",
"score": "0.5520498",
"text": "def compare_number_after_swap(num)\n swap_num = num.to_s\n\n swap_num = swap_num.reverse()\n\n return swap_num[1].to_i > swap_num[0].to_i\nend",
"title": ""
},
{
"docid": "ca232f720bc2d2273a629814738c49ca",
"score": "0.55179435",
"text": "def DvisionStringified(num1, num2)\n\tanswer = (num1 / num2).to_s\n\tif answer.length > 3\n\t\tanswer.insert(-4, \",\")\n\tend\n\treturn answer\nend",
"title": ""
}
] |
aa95246aeaf6dec3e1b1114208941591
|
Quotation: Just push the actual AST subtree onto the stack
|
[
{
"docid": "dcfab7af2402e1767d77dbe5578f6b20",
"score": "0.5976039",
"text": "def quote(sexp)\n [:pushl, sexp]\n end",
"title": ""
}
] |
[
{
"docid": "35c321a031bb5abe8a12c3d2a9e8367d",
"score": "0.58564436",
"text": "def expr(path_stack, nodeset, context = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "4585fd32aa433f592c8a2181f264b1d3",
"score": "0.5831294",
"text": "def push_parent_expression (exp)\n\n @previous_parent_expressions.push(@parent_expression) \\\n if @parent_expression\n\n @parent_expression = exp\n end",
"title": ""
},
{
"docid": "b14b85eedcbd5dfc04f1278ccac565fc",
"score": "0.5720246",
"text": "def squote!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 38 )\n\n type = SQUOTE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 173:10: '\\\\''\n match( 0x27 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 38 )\n\n end",
"title": ""
},
{
"docid": "624034efadfef4529efa57fe2bbf0f76",
"score": "0.5640398",
"text": "def push_plain(text)\n if @block_opened\n raise SyntaxError.new(\"Illegal Nesting: Nesting within plain text is illegal.\")\n end\n push_text text\n end",
"title": ""
},
{
"docid": "47f78d224f99f2cc605939737299587c",
"score": "0.5607476",
"text": "def ast; end",
"title": ""
},
{
"docid": "47f78d224f99f2cc605939737299587c",
"score": "0.5607476",
"text": "def ast; end",
"title": ""
},
{
"docid": "f381270928465855d88b01c591a62623",
"score": "0.56014425",
"text": "def wrap_up(expressions, stack, buf, stack_depth, multiple_expressions)\n stack << buf if (buf.length > 0)\n return stack unless multiple_expressions\n \n expressions << stack if stack.any?\n \n # Make sure that all of the expresisons get collapsed\n expressions = expressions.map do | e |\n compact_subexpr(e, stack_depth + 1)\n end\n \n return expressions\n end",
"title": ""
},
{
"docid": "182b697f1f3c2b3e60d0dfa30b6c8646",
"score": "0.55865943",
"text": "def do_back_quote s; a = mega_pop(s); b = mega_pop(s); b > a ? s[:stack].push(1) : s[:stack].push(0) end",
"title": ""
},
{
"docid": "f265ead7369c22be458b793c69077d5b",
"score": "0.5555205",
"text": "def latex_qtree\n \"\\\\Tree \" + to_s(delim='[]', nonterm_prefix='.')\n end",
"title": ""
},
{
"docid": "a6834ee3f1deece124e2df967cfad010",
"score": "0.5517998",
"text": "def stack(new_scope = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7c3590f2f7467766ace166e8898fe847",
"score": "0.5504124",
"text": "def dump_ast\n print_ast(@top_node, \"\")\n puts \"\"\n end",
"title": ""
},
{
"docid": "4148091e54ffc81a47b9a01d77090936",
"score": "0.54587406",
"text": "def build_ast(tree)\n if leaf?(tree)\n is_useful_terminal?(tree.first) ? tree : []\n else\n if is_useful_non_terminal?(tree.first)\n [[tree.first] + build_ast_in_forest(tree.butfirst)]\n else\n build_ast_in_forest(tree.butfirst)\n end\n end\n end",
"title": ""
},
{
"docid": "1b35719ec6c5ecb6d5c5e96c8287c3de",
"score": "0.545819",
"text": "def call(ast)\n ast\n end",
"title": ""
},
{
"docid": "65841f3bc3c51b42124fa94d4a4dcc16",
"score": "0.5444605",
"text": "def add\n match \"+\"\n comment \"+\"\n term\n emitln \"addl -(0x8*#{$stackdepth})(%rsp), %eax\"\nend",
"title": ""
},
{
"docid": "de4d737d865685ae8ea5ad1a3b414c74",
"score": "0.54385173",
"text": "def transform_in_order(tree, scope_stack)\n # some nodes have no type: include the first element in this case\n range = Symbol === tree[0] ? 1..-1 : 0..-1\n tree[range].each do |subtree|\n # obviously don't transform literals or token locations\n if Array === subtree && !(Fixnum === subtree[0])\n transform_tree(subtree, scope_stack)\n end\n end\n end",
"title": ""
},
{
"docid": "bebcd702c1aacddf5af942442bf8bd38",
"score": "0.54284954",
"text": "def do_asterisk s; a = mega_pop(s); b = mega_pop(s); s[:stack].push(a*b); end",
"title": ""
},
{
"docid": "b387db61d88707e3553a2593130ac278",
"score": "0.5426637",
"text": "def push_literal(*args)\n new_literal = Literal.new(self, *args)\n @literal_stack.push(new_literal)\n next_state_for_literal(new_literal)\n end",
"title": ""
},
{
"docid": "b387db61d88707e3553a2593130ac278",
"score": "0.5426637",
"text": "def push_literal(*args)\n new_literal = Literal.new(self, *args)\n @literal_stack.push(new_literal)\n next_state_for_literal(new_literal)\n end",
"title": ""
},
{
"docid": "b387db61d88707e3553a2593130ac278",
"score": "0.5426637",
"text": "def push_literal(*args)\n new_literal = Literal.new(self, *args)\n @literal_stack.push(new_literal)\n next_state_for_literal(new_literal)\n end",
"title": ""
},
{
"docid": "2bb274d6d26157b8de98525f0ec978fc",
"score": "0.5414097",
"text": "def quote!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 42 )\n\n type = QUOTE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 367:9: '\\\"'\n match( 0x22 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 42 )\n\n end",
"title": ""
},
{
"docid": "b7d696c822df2316b0db886de380cb35",
"score": "0.5408846",
"text": "def tree\n @flow_expression.tree\n end",
"title": ""
},
{
"docid": "8e178e9cf32dad54ba665fbd3919035b",
"score": "0.54075396",
"text": "def transform_tree(tree, scope_stack)\n if Symbol === tree[0]\n case tree[0]\n when :assign, :massign\n lhs, rhs = tree[1..2]\n begin\n add_variables_from_node(lhs, scope_stack)\n rescue SyntaxError => err\n wrap_node_with_error(tree)\n else\n transform_tree(rhs, scope_stack)\n end\n when :for\n vars, iterated, body = tree[1..3]\n add_variables_from_node(vars, scope_stack)\n transform_tree(iterated, scope_stack)\n transform_tree(body, scope_stack)\n when :var_ref\n # When we reach a :var_ref, we should know everything we need to know\n # in order to tell if it should be transformed into a :vcall.\n if tree[1][0] == :@ident && !scope_stack.has_variable?(tree[1][1])\n tree[0] = :vcall\n end\n when :class\n name, superclass, body = tree[1..3]\n if name[1][0] == :class_name_error || scope_stack.in_method?\n wrap_node_with_error(tree)\n else\n transform_tree(superclass, scope_stack) if superclass # superclass node\n scope_stack.with_closed_scope do\n transform_tree(body, scope_stack)\n end\n end\n when :module\n name, body = tree[1..2]\n if name[1][0] == :class_name_error || scope_stack.in_method?\n wrap_node_with_error(tree)\n else\n scope_stack.with_closed_scope do\n transform_tree(body, scope_stack) # body\n end\n end\n when :sclass\n singleton, body = tree[1..2]\n transform_tree(singleton, scope_stack)\n scope_stack.with_closed_scope do\n transform_tree(body, scope_stack)\n end\n when :def\n scope_stack.with_closed_scope(true) do\n param_node = tree[2]\n body = tree[3]\n transform_params_then_body(tree, param_node, body, scope_stack)\n end\n when :defs\n transform_tree(tree[1], scope_stack) # singleton could be a method call!\n scope_stack.with_closed_scope(true) do\n param_node = tree[4]\n body = tree[5]\n transform_params_then_body(tree, param_node, body, scope_stack)\n end\n when :lambda\n param_node, body = tree[1..2]\n scope_stack.with_open_scope do\n transform_params_then_body(tree, param_node, body, scope_stack)\n end\n when :rescue\n list, name, body = tree[1..3]\n transform_tree(list, scope_stack) if list\n # Don't forget the rescue argument!\n if name\n add_variables_from_node(name, scope_stack)\n end\n transform_tree(body, scope_stack)\n when :method_add_block\n call, block = tree[1..2]\n # first transform the call\n transform_tree(call, scope_stack)\n # then transform the block\n param_node, body = block[1..2]\n scope_stack.with_open_scope do\n begin\n if param_node\n transform_params(param_node[1], scope_stack)\n if param_node[2]\n add_variable_list(param_node[2], scope_stack, false)\n end\n end\n rescue SyntaxError\n wrap_node_with_error(tree)\n else\n transform_tree(body, scope_stack)\n end\n end\n when :binary\n # must check for named groups in a literal match. wowzerz.\n lhs, op, rhs = tree[1..3]\n if op == :=~\n if lhs[0] == :regexp_literal\n add_locals_from_regexp(lhs, scope_stack)\n transform_tree(rhs, scope_stack)\n elsif lhs[0] == :paren && !lhs[1].empty? && lhs[1] != [[:void_stmt]] && lhs[1].last[0] == :regexp_literal\n lhs[1][0..-2].each { |node| transform_tree(node, scope_stack) }\n add_locals_from_regexp(lhs[1].last, scope_stack)\n transform_tree(rhs, scope_stack)\n else\n transform_in_order(tree, scope_stack)\n end\n else\n transform_in_order(tree, scope_stack)\n end\n when :if_mod, :unless_mod, :while_mod, :until_mod, :rescue_mod\n # The AST is the reverse of the parse order for these nodes.\n transform_tree(tree[2], scope_stack)\n transform_tree(tree[1], scope_stack)\n when :alias_error, :assign_error # error already top-level! wrap it again.\n wrap_node_with_error(tree)\n else\n transform_in_order(tree, scope_stack)\n end\n else\n transform_in_order(tree, scope_stack)\n end\n end",
"title": ""
},
{
"docid": "2927599678f2690ef2556a033d3cde6f",
"score": "0.5406751",
"text": "def do_back_slash s; a = mega_pop(s); b = mega_pop(s); s[:stack] += [a,b] end",
"title": ""
},
{
"docid": "94eaccea1b33390091a82b3889b8b26a",
"score": "0.5372062",
"text": "def push_token(tk)\n @first_line = tk.line_no if @statement.empty?\n @statement << tk unless @level == 0 && [TkCOMMENT].include?(tk.class)\n end",
"title": ""
},
{
"docid": "08fa9f054fd2a85ac67f0e17758d06ec",
"score": "0.53716356",
"text": "def scopify(expr)\n expr = insert_b(expr)\n @i = 0\n n_expr = \"\"\n last_empty = 0\n open_b = 0\n open_p_b = 0\n open_m_b = 0\n eq = false\n stack = Array.new\n last_e = Array.new\n state = 0\n while @i < expr.size\n case expr[@i]\n # Each part between brackets is seen as a subexpression\n # and it is analyzed recoursively.\n when '('\n scp = Scp.new\n n_expr += expr[@i] + scp.scopify(extract(expr[(@i + 1)...expr.length])) \n @i += scp.count \n when /[\\*\\/]/\n # If there are open brackets of higher opertions\n # it closes them\n if open_m_b > 0\n n_expr += ')' * open_m_b\n last_empty = last_e.pop\n open_m_b = 0\n #open_b -= 1\n end\n if state == 2\n n_expr += ')' * open_p_b\n open_p_b = 0\n state = (stack.size > 0 ? stack.pop : 0)\n end\n # If it is not still analyzing a multiplication, it adds the brackets \n # following the rules\n unless state == 1\n n_expr.insert last_empty, '(' \n state = 1\n open_b += 1\n end\n n_expr += expr[@i]\n last_empty = n_expr.size # + 1\n when /[\\+\\-]/\n # higher priority operation brackets are closed\n # last_empty is shifted\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n state = 0\n open_b = 0\n open_p_b = 0\n n_expr += expr[@i]\n last_empty = n_expr.size\n when /\\^/\n # It begins to put between brackets the operation and its exponent\n if open_m_b > 0 then\n n_expr += \")\" * open_m_b\n last_empty = last_e.pop\n #open_b -= 1\n open_m_b = 0\n end\n n_expr.insert last_empty, '(' unless state == 2\n last_empty += 1 unless state == 2\n n_expr += expr[@i] + (expr[@i+1] == '(' ? '' : '(')\n open_p_b += (expr[@i+1] == '(' ? 1 : (state == 2 ? 1:2))\n stack.push state unless state == 2\n state = 2\n when /\\=/\n # The expression at the left of `=` is put between brackets\n # and a bracket at the right is opened\n # It closes previously opened brackets\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n n_expr += ')' * open_m_b if open_m_b >0\n open_b = 0\n open_p_b = 0\n open_m_b = 0\n n_expr = '(' + n_expr + ')' + expr[@i]\n n_expr += '('\n last_empty = n_expr.size\n state = 0\n eq = true\n when /\\>/\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n open_b = 0\n open_p_b = 0\n n_expr = '(' + n_expr + ')' + expr[@i]\n last_empty = n_expr.size\n when /\\:/\n n_expr.insert last_empty, '('\n n_expr += expr[@i]\n last_k = n_expr[(last_empty+1)...n_expr.size]\n open_m_b += 1 if \"mx:integ:as:from:\".include? last_k\n last_e.pop if last_e.count > 0 and (last_k == \"mx:\" or last_k == \"integ:\")# or last_k == \"solve:\")\n last_e.push last_empty if last_k == \"mx:\" or last_k == \"integ:\"# or last_k == \"solve:\"\n last_empty = n_expr.size\n open_b += 1 unless \"mx:integ:as:from:\".include? last_k\n when /\\\"/\n n_expr += expr[@i]\n @i += 1\n n_expr += discard(expr)\n last_empty = n_expr.length\n when /\\~/\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * (open_b - 1 ) if open_b - 1 > 0\n open_p_b = 0\n open_b = 1\n state = (stack.size > 0 ? stack.pop : 0)\n n_expr += expr[@i]\n last_empty = n_expr.size \n else\n n_expr += expr[@i]\n end\n @i += 1\n end\n # it closes all the opened brackets\n n_expr += ')' * open_m_b if open_m_b > 0\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n n_expr += ')' if eq\n return n_expr\n end",
"title": ""
},
{
"docid": "84929667d488dfb1e2a24d4035529576",
"score": "0.53641003",
"text": "def add_tree token\n @tree_stack.last.children << NaryTree.new(token)\n end",
"title": ""
},
{
"docid": "732eee64004166ef49317ca9f53278e9",
"score": "0.5361634",
"text": "def parse!\n ast = root\n error(\"Unexpected EOS (rest: '#{rest}')\") unless eos?\n error(\"Unclosed parentheses (#{unclosed_parens})\") unless unclosed_parens == 0\n ast\n end",
"title": ""
},
{
"docid": "3765c39d30bbb98edef25dcbc5b55dc0",
"score": "0.5331454",
"text": "def push_true\n \"stack_push(Qtrue);\"\n end",
"title": ""
},
{
"docid": "23a9aab8a6f434e55a9425a7298e14d8",
"score": "0.5312757",
"text": "def push_try\n p :push => @node.class.node_id, :stack => @try_stack.map { |t| t.node.class.node_id }\n @try_stack << Try.new(\n @scanner.pos,\n @line,\n @column,\n @doc_nesting,\n @indent,\n @node,\n @children,\n @child_names\n )\n end",
"title": ""
},
{
"docid": "62493f3536e3be9b6df2b1515d7112a2",
"score": "0.5308212",
"text": "def expression\n if is_addop($lookahead)\n emitln \"xor %eax, %eax\"\n else\n term\n end\n\n while is_addop($lookahead)\n emitln \"movl %eax, -(0x8*#{$stackdepth})(%rsp)\"\n case $lookahead\n when \"+\"\n add\n when \"-\"\n subtract\n else\n expected \"Addop\"\n end\n end\nend",
"title": ""
},
{
"docid": "5a2a4dd17ffe2eb197466c4d7147fc57",
"score": "0.5292099",
"text": "def stringexpr \n\t\n\t$cst.add_branch(\"StringExpr\")\n\t\n\tmatch_token(\"T_QUOTE\", $tokens[$index])\n\tcharList\n\tmatch_token(\"T_QUOTE\", $tokens[$index])\n\n\t$cst.ascend\n\t\nend",
"title": ""
},
{
"docid": "8e466722f58b94b0f60734733253bfff",
"score": "0.52866447",
"text": "def evaluate_tree ast\n n1, op, n2 = ast\n n1 = n1.is_a?(Array) ? evaluate_tree(n1) : n1\n n2 = n2.is_a?(Array) ? evaluate_tree(n2) : n2\n n1.send(op.to_sym, n2)\n end",
"title": ""
},
{
"docid": "c6a71bf984924a27151145137e862375",
"score": "0.52763194",
"text": "def quote!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n\n type = QUOTE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 166:9: '\\\"'\n match( 0x22 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 32 )\n\n end",
"title": ""
},
{
"docid": "b78961892078ddf1c5dac14794ca002e",
"score": "0.5273201",
"text": "def parse\n @stack.push @current_level\n program_node = program Sets::EMPTY_SET \n \n SyntaxTree.new program_node\n end",
"title": ""
},
{
"docid": "6eccc8dfc680f0ae6acf2dc5a5575159",
"score": "0.5259008",
"text": "def insert_b(expr)\n @i = 0\n string = false\n while @i < expr.size \n string = (expr[@i] == \"\\\"\") ? (string ? false : true) : (string)\n if (expr[@i] == '-' or expr[@i] == '+') and ((expr[@i - 1] == '(') or (@i == 0)) and !string then\n expr.insert @i, '()'\n end\n @i += 1\n end\n return expr\n end",
"title": ""
},
{
"docid": "131df4188713a676cbfba389cad02c22",
"score": "0.525109",
"text": "def push_self\n \"stack_push(c->self);\"\n end",
"title": ""
},
{
"docid": "4f15db412266c5ac10e279e87c33e9cb",
"score": "0.5243661",
"text": "def do_slash s; a = mega_pop(s); b = mega_pop(s); s[:stack].push(b/a); end",
"title": ""
},
{
"docid": "cf5176431ce06708e7f23e96048c555d",
"score": "0.5241553",
"text": "def push_literal(*args)\n new_literal = Literal.new(self, *args)\n @literal_stack.push(new_literal)\n\n if new_literal.words? && new_literal.backslash_delimited?\n if new_literal.interpolate?\n self.class.lex_en_interp_backslash_delimited_words\n else\n self.class.lex_en_plain_backslash_delimited_words\n end\n elsif new_literal.words? && !new_literal.backslash_delimited?\n if new_literal.interpolate?\n self.class.lex_en_interp_words\n else\n self.class.lex_en_plain_words\n end\n elsif !new_literal.words? && new_literal.backslash_delimited?\n if new_literal.interpolate?\n self.class.lex_en_interp_backslash_delimited\n else\n self.class.lex_en_plain_backslash_delimited\n end\n else\n if new_literal.interpolate?\n self.class.lex_en_interp_string\n else\n self.class.lex_en_plain_string\n end\n end\n end",
"title": ""
},
{
"docid": "7b5dc066156e52eafb343ecd85a026db",
"score": "0.5241484",
"text": "def paren_nest; end",
"title": ""
},
{
"docid": "7b5dc066156e52eafb343ecd85a026db",
"score": "0.5241484",
"text": "def paren_nest; end",
"title": ""
},
{
"docid": "7b5dc066156e52eafb343ecd85a026db",
"score": "0.5241484",
"text": "def paren_nest; end",
"title": ""
},
{
"docid": "427928d320d18dc38714403fc32a7fbd",
"score": "0.5237174",
"text": "def dig\n @stack.push(@stack.slice!(-3))\n end",
"title": ""
},
{
"docid": "9d623d3bb20bc39d0275c0c2db22c868",
"score": "0.5234708",
"text": "def dot( quote )\n\t\tquote.tree[:value].each { |e|\n case e[:type]\n when :binding\n do_binding\n when :bind_constant\n do_bind_constant\n when :eval\n do_eval\n when :bang\n\t\t\t\truby = pop[:value]\n\t\t\t\tself.bang( ruby )\n when :dot\n do_dot\n when :dup\n do_dup\n\t\t\twhen :symbol\n\t v = @fstack.get( e[:value] )\n\t\t\t\tif ( v.class == Hash ) and ( v[:type] == :constant ) then\n\t\t\t\t\tpush( v[:value] )\n\t\t\t\telse\n push( e )\n end\n else\n push( e )\n end\n\t\t}\n end",
"title": ""
},
{
"docid": "f939c24ca955dd7612dc29565545a712",
"score": "0.52006",
"text": "def create_tree(exp)\n \toperatorStack, nodeStack = [], []\n \n # define function to create new tree segment\n subtree = Proc.new {\n # pop operands where\n # a [operator] b\n b, a = nodeStack.pop, nodeStack.pop\n\t\t\tnodeStack.push(Tree::Node.new(operatorStack.pop, a, b))\n\t\t}\n \n \texp.split(\"\").each do |c|\n \t\t# Skip whitespace characters\n \t\tif c === \"\\s\"\n \t\t\tnext\n \t\telsif c === ')'\n \t\t\tuntil operatorStack.last === '(' do\n \t\t\t\tsubtree.call\n \t\t\tend\n \t\t\t# remove the remaining open parenthesis\n \t\t\toperatorStack.pop\n \t\telsif %w|+ - * / ^ (|.include? c\n \t\t\tif operatorStack.empty? || c === '('\n \t\t\t\toperatorStack.push(c)\n \t\t\telse\n \t\t\t\twhile precedence_of(operatorStack.last) >= precedence_of(c)\n \t\t\t\t\tsubtree.call\n \t\t\t\tend\n \t\t\t\toperatorStack.push(c)\n \t\t\tend\n \t\telse\n \t\t\tnodeStack.push(Tree::Node.new(c))\n \t\tend\n \tend\n\n \tuntil operatorStack.empty? do\n \t\tsubtree.call\n \tend\n \n # top element of the stack is the root element\n \tTree.new(nodeStack.pop)\n end",
"title": ""
},
{
"docid": "bef74d6b8a46b3dd674c5ea3048c5e83",
"score": "0.5196984",
"text": "def push_tree\n new_node = NaryTree.new nil\n @tree_stack.last.children << new_node\n @tree_stack.push new_node\n end",
"title": ""
},
{
"docid": "44932d28a6818a2799162cc727150bac",
"score": "0.51866776",
"text": "def push_nil\n \"stack_push(Qnil);\"\n end",
"title": ""
},
{
"docid": "8fc0cbc16ac0a37ed88d198de120c911",
"score": "0.51861906",
"text": "def tree\n while token = @tokens.next\n case token.type\n when :operator\n token.build(@nodes.pop, tree).tap do |node|\n @nodes.push(node)\n end\n when :value\n token.build.tap do |leaf|\n @nodes.push(leaf)\n end\n end\n end\n rescue StopIteration\n @nodes.last || Lexeme::Null.new\n end",
"title": ""
},
{
"docid": "df01fd4aa34cc2b5680c71987d2fa10c",
"score": "0.51770365",
"text": "def exp\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n __ADDITIONSUBSTRACTIONOPERATORS11__ = nil\n\n begin\n # at line 726:5: term ( ADDITIONSUBSTRACTIONOPERATORS term )*\n @state.following.push( TOKENS_FOLLOWING_term_IN_exp_1113 )\n term\n @state.following.pop\n # at line 726:10: ( ADDITIONSUBSTRACTIONOPERATORS term )*\n while true # decision 27\n alt_27 = 2\n look_27_0 = @input.peek( 1 )\n\n if ( look_27_0 == ADDITIONSUBSTRACTIONOPERATORS )\n alt_27 = 1\n\n end\n case alt_27\n when 1\n # at line 726:11: ADDITIONSUBSTRACTIONOPERATORS term\n __ADDITIONSUBSTRACTIONOPERATORS11__ = match( ADDITIONSUBSTRACTIONOPERATORS, TOKENS_FOLLOWING_ADDITIONSUBSTRACTIONOPERATORS_IN_exp_1116 )\n # --> action\n #Regla 2 GC\n @stack_operators.push(__ADDITIONSUBSTRACTIONOPERATORS11__.text)\n \n # <-- action\n @state.following.push( TOKENS_FOLLOWING_term_IN_exp_1143 )\n term\n @state.following.pop\n # --> action\n #Regla 4 GC / VS\n if(@stack_operators.last == '+' or\n @stack_operators.last == '-' or\n @stack_operators.last == '||' ) then\n operator = @stack_operators.pop\n operand_b = @stack_operands.pop\n operand_a = @stack_operands.pop\n result = get_avail\n generate(operator, operand_a, operand_b, result)\n free_avail(operand_a)\n free_avail(operand_b)\n free_avail_const(operand_a)\n free_avail_const(operand_b)\n @stack_operands.push(result)\n @stack_types.push(resulting_type(@stack_types.pop, @stack_types.pop, operator))\n end\n \n # <-- action\n\n else\n break # out of loop for decision 27\n end\n end # loop for decision 27\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "de71e7cf8f67552ac78080a7dced2506",
"score": "0.51728314",
"text": "def get_statement(ast, count=1)\n result = []\n n = -1\n iters = Array.new(count) {|e| n += 2 }\n iters.each do |i|\n result << ast.children[i]\n end\n result.each {|n| n.remove_from_parent! }\n result\nend",
"title": ""
},
{
"docid": "060bc58f85ddffc790d0f9030c1cc789",
"score": "0.516402",
"text": "def test_to_ruby_sexp\n sexp = nil\n assert_nothing_raised {\n sexp = @tree.to_ruby_sexp\n }\n assert_equal([:block, nil], sexp)\n end",
"title": ""
},
{
"docid": "94d4e34e5683bd7dd9b0dc1b1b0aff74",
"score": "0.5157106",
"text": "def push_literal(*args)\n new_literal = Literal.new(self, *args)\n @literal_stack.push(new_literal)\n\n if new_literal.words?\n if new_literal.interpolate?\n self.class.lex_en_interp_words\n else\n self.class.lex_en_plain_words\n end\n else\n if new_literal.interpolate?\n self.class.lex_en_interp_string\n else\n self.class.lex_en_plain_string\n end\n end\n end",
"title": ""
},
{
"docid": "bb1b32fce97120be4b4def32023787ef",
"score": "0.51558447",
"text": "def push(value)\n case value[0]\n when :CONTENT, :STRING_LITERAL\n value[1].gsub!(/\\n\\s*/, ' ') if strip_line_breaks?\n\n if !@stack.empty? && value[0] == @stack[-1][0]\n @stack[-1][1] << value[1]\n else\n @stack.push(value)\n end\n when :ERROR\n @stack.push(value) if @include_errors\n leave_object\n when :META_CONTENT\n @stack.push(value) if @include_meta_content\n else\n @stack.push(value)\n end\n\n self\n end",
"title": ""
},
{
"docid": "de47cacf75926ee0ea797d2b892d7f33",
"score": "0.51204646",
"text": "def postfix\n read_next.must_be_identifier!(\"(\")\n if next_token.is_identifier?(\")\")\n ASTList.create\n else\n args\n end.tap do\n read_next.must_be_identifier!(\")\")\n end\n end",
"title": ""
},
{
"docid": "7ae5f36a1747faf2b2a54c098cd5009a",
"score": "0.5120436",
"text": "def step3_when_ok ref, idx_in_union, concat, decision, token\n # pop stolen off of root, pop onto concat where reference once was\n if ! ref.parent? || ref.parent != concat\n no('sukland')\n end\n stolen = remove_child root_union, idx_in_union, :signed_by => concat\n idx_in_concat = ref.index_in_parent_assert\n refo = replace_child concat, idx_in_concat, stolen\n no('no') if refo.object_id != ref.object_id\n refo.parent_id = concat.parse_id\n refo.to_tombstone!\n root_union.prune!(:signed_by => concat)\n refo = nil\n\n # find all of the children for the union symbol that are left\n # recursive children, and add them to this union\n children_productions = root_union.production.children\n # we need to fake it so that the recursive hook is triggered\n root_union.production._building_this_parser = root_union\n idxs_added = []\n children_productions.each_with_index do |prod,idx|\n if ! prod.has_children? then next\n elsif left_recursive_concat_production?(prod)\n new_ref = nil\n cparse = prod.build_parse(\n root_union.parse_context,\n root_union,\n :recursive_hook => lambda do |_prod, _ctxt, _kls, _opts|\n new_ref = Reference.new _prod.building_this_parser\n new_ref\n end\n )\n new_ref.parent_id = cparse.parse_id # dangerous as all getout\n cparse.parent_clear! # dumb\n ridiculous_new_left_recursive_cparse cparse, new_ref\n idxs_added << add_child(root_union, cparse)\n else\n no(\"we have never dealt with this kind of grammar before\")\n end\n end\n root_union.production._building_this_parser = nil\n root_union.hook_once_after_union_take! do |up, take_decision, token|\n # this makes some assumptions about the beginning state of\n # the new concat\n # just to get it in the running\n take_decision.idxs_open.concat(idxs_added)\n end\n end",
"title": ""
},
{
"docid": "458fc6c9ebf9d153598be3aa0d4bccb2",
"score": "0.5117588",
"text": "def push_current_content(node, &block)\n stack.push(node)\n begin\n yield\n ensure\n pop\n end\n end",
"title": ""
},
{
"docid": "1cb582aac999d6ab44de9df611c350ee",
"score": "0.51070756",
"text": "def steamroll_ast(ast)\n steamroll_toplevel(ast)\n ast.each do |elem|\n steamroll_ast(elem) if elem.is_a? Array\n end\n ast\n end",
"title": ""
},
{
"docid": "a8bf5aeeab75debc015c8a19e3607460",
"score": "0.51030976",
"text": "def build_ast_in_forest(trees)\n if trees.empty?\n []\n else\n build_ast(trees.first) + build_ast_in_forest(trees.butfirst)\n end\n end",
"title": ""
},
{
"docid": "e34983f72602652d38592dc769b11cb4",
"score": "0.5101641",
"text": "def do_plus s; a = mega_pop(s); b = mega_pop(s); s[:stack].push(a+b); end",
"title": ""
},
{
"docid": "f3b99a988070c95391571a6bbaddf79c",
"score": "0.5094408",
"text": "def process_token(tk)\n # p tk.class, tk.text, @state, @level, @current_block, \"<br/>\"\n case @state\n when :first_statement\n return if process_initial_comment(tk)\n return if @statement.empty? && [TkSPACE, TkNL, TkCOMMENT].include?(tk.class)\n @comments_last_line = nil\n if @statement.empty? && tk.class == TkALIAS\n @state = :alias_statement\n @alias_values = []\n push_token(tk)\n return\n end\n return if process_simple_block_opener(tk)\n push_token(tk)\n return if process_complex_block_opener(tk)\n\n if balances?(tk)\n process_statement_end(tk)\n else\n @state = :balance\n end\n when :alias_statement\n push_token(tk)\n @alias_values << tk unless [TkSPACE, TkNL, TkCOMMENT].include?(tk.class)\n if @alias_values.size == 2\n @state = :first_statement\n if [NilClass, TkNL, TkEND_OF_SCRIPT, TkSEMICOLON].include?(peek_no_space.class)\n @done = true\n end\n end\n when :balance\n @statement << tk\n return unless balances?(tk)\n @state = :first_statement\n process_statement_end(tk)\n when :block_statement\n push_token(tk)\n return unless balances?(tk)\n process_statement_end(tk)\n when :pre_block\n @current_block = nil\n process_block_token(tk) unless tk.class == TkSEMICOLON\n @state = :block\n when :block\n process_block_token(tk)\n when :post_block\n if tk.class == TkSPACE\n @statement << tk\n return\n end\n\n process_statement_end(tk)\n @state = :block\n end\n\n if @first_line == tk.line_no && !@statement.empty? && TkCOMMENT === tk\n process_initial_comment(tk)\n end\n end",
"title": ""
},
{
"docid": "ab54031de86693273fb507dfcfa82c2a",
"score": "0.506388",
"text": "def push_block\n \"stack_push(cpu_current_block(state, c));\"\n end",
"title": ""
},
{
"docid": "335501257baae5be0fff9bc4d64ca4ff",
"score": "0.5061923",
"text": "def push_literal\n <<-CODE\n next_int;\n t1 = cpu_current_literals(state, c);\n t2 = fast_fetch(t1, _int);\n stack_push(t2);\n CODE\n end",
"title": ""
},
{
"docid": "fc451c9f9a9500b60822e1e5901d0146",
"score": "0.5058083",
"text": "def test_9dOrderByExpression\n\n assert_nothing_thrown(\"Creating AST objects\") { \n\n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG)\n\n var_AST = AST.new(\"sampledata/data.xml\")\n \n expression = OrderByExpression.new(\n BagExpression.new(CommaExpression.new(IntegerTerminal.new(521), IntegerTerminal.new(128))),\n BagExpression.new(CommaExpression.new(IntegerTerminal.new(22), IntegerTerminal.new(256))))\n\n #expression = OrderByExpression.new(\n # BagExpression.new(CommaExpression.new(IntegerTerminal.new(3), IntegerTerminal.new(18))),\n # BagExpression.new(CommaExpression.new(IntegerTerminal.new(18), IntegerTerminal.new(0))))\n\n expression.execute(var_AST)\n \n result = var_AST.VAR_QRES().pop()\n\n assert_equal(\"QRES::BagResult\", result.class.to_s())\n \n _result = result.pop()\n assert_equal(\"QRES::StructResult\", _result.class.to_s())\n \n assert_equal(256, _result.pop().VAR_OBJECT())\n assert_equal(521, _result.pop().VAR_OBJECT())\n \n _result = result.pop()\n assert_equal(\"QRES::StructResult\", _result.class.to_s())\n \n assert_equal(22, _result.pop().VAR_OBJECT())\n assert_equal(521, _result.pop().VAR_OBJECT())\n\n _result = result.pop()\n assert_equal(\"QRES::StructResult\", _result.class.to_s())\n \n assert_equal(256, _result.pop().VAR_OBJECT())\n assert_equal(128, _result.pop().VAR_OBJECT())\n\n assert_equal(22, result.pop().VAR_OBJECT())\n assert_equal(128, result.pop().VAR_OBJECT())\n }\n end",
"title": ""
},
{
"docid": "92d4b41da2c8acd36cbada4617b3de60",
"score": "0.5051769",
"text": "def build_parse_tree(exp)\n exp_arr = exp.split\n tree_stack = Stack.new\n tree = BinaryTree.new('')\n current_tree = tree\n exp_arr.each do |i|\n if i == '('\n current_tree.insert_left('')\n tree_stack.push(current_tree)\n current_tree = current_tree.left_child\n elsif i.match(/\\d/)\n current_tree.set_root_value(Integer(i))\n parent = tree_stack.pop\n current_tree = parent\n elsif ['+', '-', '*', '/'].include?(i)\n current_tree.set_root_value(i)\n current_tree.insert_right('')\n tree_stack.push(current_tree)\n current_tree = current_tree.right_child\n elsif i == ')'\n current_tree = tree_stack.pop\n else\n fail 'Invalid Argument'\n end\n end\n tree\nend",
"title": ""
},
{
"docid": "d0468bc4c33cc0fcb944de3342a60820",
"score": "0.505152",
"text": "def push! &put\n ( put || proc {|obj|} ).call @blocks[ @push_at & (@depth-1) ]\n @push_at += 1\n end",
"title": ""
},
{
"docid": "43ef5388b89f4f3144798bd6c2587bcb",
"score": "0.5048741",
"text": "def push_literal(*args); end",
"title": ""
},
{
"docid": "43ef5388b89f4f3144798bd6c2587bcb",
"score": "0.5048741",
"text": "def push_literal(*args); end",
"title": ""
},
{
"docid": "43ef5388b89f4f3144798bd6c2587bcb",
"score": "0.5048741",
"text": "def push_literal(*args); end",
"title": ""
},
{
"docid": "b582b356ef6d9b2b30f0ea0d89fdbbd1",
"score": "0.5046499",
"text": "def push\n command = make_command('.', source_tree_path)\n return prepare_execution_context(command, false, output: nil, errors: BLANK_SOURCE_TREE_ERROR) if blank_source_tree_path?\n\n execute_command(command)\n end",
"title": ""
},
{
"docid": "042ef0c67fd4a156eebd6b31e7dd9c9e",
"score": "0.50438076",
"text": "def test_proper_stack\n stack = TokenStack.new\n stack.push('4')\n stack.push('3')\n stack.push('*')\n terp = Interpreter.new(false, true)\n\n result = terp.binary_operation(0, stack)\n assert_equal 12, result\n end",
"title": ""
},
{
"docid": "fdff61cf0b5d614ce4808ffc15b1f7ce",
"score": "0.5025687",
"text": "def generate_syntax_tree\n build_ast(@parse_tree).first\n end",
"title": ""
},
{
"docid": "5d58ec3f485613b7cc78225a7f90ee93",
"score": "0.50199676",
"text": "def close_stack indent_level\r\n while @token_stack.size > 0 and @token_stack[-1].indent_level >= indent_level\r\n if @token_stack.size > 1 # if this is not the last token, add to parents\r\n @token_stack[-2].add_block_code self.convert(@token_stack[-1])\r\n else # this is the last token in the stack\r\n dump self.convert(@token_stack[-1])\r\n end\r\n @token_stack.pop\r\n end\r\n end",
"title": ""
},
{
"docid": "40d9896535115690b5b0d792266ee022",
"score": "0.5008522",
"text": "def visit_Squeel_Nodes_Literal(o, parent)\n Arel.sql(o.expr)\n end",
"title": ""
},
{
"docid": "f0572abaf7ad8989e5c2f8cc78854940",
"score": "0.50081486",
"text": "def rewrite_exp(t); rewrite(t.children[0]); end",
"title": ""
},
{
"docid": "ecb4e94c437bd36c7d523313440f8ced",
"score": "0.5003843",
"text": "def inspect; to_ast.inspect end",
"title": ""
},
{
"docid": "191e776376b838b83bb762a86da0d0bd",
"score": "0.4998047",
"text": "def push_constant\n append(\"@#{arg_2}\")\n append(\"D=A\")\n append(\"@SP\")\n append(\"A=M\")\n append(\"M=D\")\n increment_stack_pointer\n end",
"title": ""
},
{
"docid": "7e50090c4cf5b58f34b5e4806d5b8692",
"score": "0.49900013",
"text": "def to_tree() = puts(TTY::Tree.new({ '.' => as_tree }).render)",
"title": ""
},
{
"docid": "a9787c78f96915d932d9580878b0e143",
"score": "0.49757254",
"text": "def test_9aAsExpression\n \n assert_nothing_thrown(\"Creating AST objects\") { \n \n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG)\n \n var_AST = AST.new(\"sampledata/data.xml\")\n \n expression = AsExpression.new(FloatTerminal.new(11.321), \"test_object\")\n \n expression.execute(var_AST)\n\n result = var_AST.VAR_QRES().pop()\n \n assert_equal(\"QRES::BinderResult\", result.class.to_s())\n assert_equal(11.321, result.VAR_OBJECT().VAR_OBJECT())\n assert_equal(\"test_object\", result.VAR_NAME())\n \n expression = AsExpression.new(\n StructExpression.new(CommaExpression.new(IntegerTerminal.new(888), FloatTerminal.new(11.321))),\n \"test_complex_object\")\n \n expression.execute(var_AST)\n \n result = var_AST.VAR_QRES().pop()\n \n assert_equal(\"QRES::StructResult\", result.class.to_s())\n assert_equal(11.321, result.pop().VAR_OBJECT().VAR_OBJECT())\n assert_equal(888, result.pop().VAR_OBJECT().VAR_OBJECT()) \n \n expression = AsExpression.new(\n BagExpression.new(CommaExpression.new(IntegerTerminal.new(888), FloatTerminal.new(11.321))),\n \"test_complex_object\")\n \n expression.execute(var_AST)\n \n result = var_AST.VAR_QRES().pop()\n \n assert_equal(\"QRES::BagResult\", result.class.to_s())\n assert_equal(11.321, result.pop().VAR_OBJECT().VAR_OBJECT())\n assert_equal(888, result.pop().VAR_OBJECT().VAR_OBJECT())\n }\n end",
"title": ""
},
{
"docid": "c7759a2fa4431eba962b2ee9dd9233a8",
"score": "0.49721032",
"text": "def apply_function_concat(scope, ast)\n args = ast.children.map { |arg|\n scope, sql = apply_ast(scope, arg)\n \"(#{sql}::text)\"\n }\n\n return scope, \"(concat(#{args.join(',')}))\"\n end",
"title": ""
},
{
"docid": "7b0c83a4d6a320271517b44bfe0ab629",
"score": "0.49696207",
"text": "def stack; end",
"title": ""
},
{
"docid": "7b0c83a4d6a320271517b44bfe0ab629",
"score": "0.49696207",
"text": "def stack; end",
"title": ""
},
{
"docid": "a91e3f8b0c7de4c60ee1cd8219993e3d",
"score": "0.49602756",
"text": "def test_2WheresExpression\n \n assert_nothing_thrown(\"Creating AST objects\") { \n \n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG)\n \n var_AST = AST.new(\"sampledata/data.xml\")\n \n #((emp.address) where number==50).(street) \n expression = WhereExpression.new(\n DotExpression.new( \n NameExpression.new(\"emp\"), \n NameExpression.new(\"address\")), \n EqualExpression.new(\n NameExpression.new(\"number\"), \n IntegerTerminal.new(50)))\n \n expression.execute(var_AST)\n \n assert_equal(\"SBA35\", var_AST.VAR_QRES().pop().dereference(var_AST.VAR_STORE()).VAR_ID())\n \n expression = WhereExpression.new(\n DotExpression.new( \n NameExpression.new(\"emp\"), \n NameExpression.new(\"address\")), \n GreatherExpression.new(\n NameExpression.new(\"number\"), \n IntegerTerminal.new(48)))\n \n expression.execute(var_AST)\n \n result = var_AST.VAR_QRES().pop()\n \n assert_equal(\"SBA49\", result.pop().dereference(var_AST.VAR_STORE()).VAR_ID())\n assert_equal(\"SBA35\", result.pop().dereference(var_AST.VAR_STORE()).VAR_ID())\n }\n end",
"title": ""
},
{
"docid": "b85177935566ee28c3d15eb7e03f76e1",
"score": "0.49501333",
"text": "def test_9bGroupAsExpression\n\n assert_nothing_thrown(\"Creating AST objects\") { \n\n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG)\n\n var_AST = AST.new(\"sampledata/data.xml\")\n\n expression = GroupAsExpression.new(FloatTerminal.new(11.321), \"test_object\")\n\n expression.execute(var_AST)\n\n result = var_AST.VAR_QRES().pop()\n\n assert_equal(\"QRES::BinderResult\", result.class.to_s())\n assert_equal(11.321, result.VAR_OBJECT().VAR_OBJECT())\n assert_equal(\"test_object\", result.VAR_NAME())\n\n expression = GroupAsExpression.new(\n StructExpression.new(CommaExpression.new(IntegerTerminal.new(888), FloatTerminal.new(11.321))),\n \"test_complex_object\")\n\n expression.execute(var_AST)\n\n result = var_AST.VAR_QRES().pop()\n\n assert_equal(\"QRES::BinderResult\", result.class.to_s())\n \n result = result.pop()\n \n assert_equal(11.321, result.pop().VAR_OBJECT())\n assert_equal(888, result.pop().VAR_OBJECT()) \n\n expression = GroupAsExpression.new(\n BagExpression.new(CommaExpression.new(IntegerTerminal.new(888), FloatTerminal.new(11.321))),\n \"test_complex_object\")\n\n expression.execute(var_AST)\n\n result = var_AST.VAR_QRES().pop()\n\n assert_equal(\"QRES::BinderResult\", result.class.to_s())\n \n result = result.pop()\n \n assert_equal(\"QRES::BagResult\", result.class.to_s())\n \n assert_equal(11.321, result.pop().VAR_OBJECT())\n assert_equal(888, result.pop().VAR_OBJECT())\n }\n end",
"title": ""
},
{
"docid": "d9978b3ef30db698efa6dd4177d937c6",
"score": "0.49345228",
"text": "def inject(text)\n\t\t\tcontext = create_context\n\t\t\tinterpreter = Glyph::Interpreter.new text, context\n\t\t\tsubtree = interpreter.parse\n\t\t\tsubtree[:source] = context[:source]\n\t\t\t@node << subtree\n\t\t\tinterpreter\n\t\tend",
"title": ""
},
{
"docid": "1f6e45a1af2fb04bf22526d99ce8afce",
"score": "0.49341366",
"text": "def push\n @instructions << Instruction.new(:push)\n self\n end",
"title": ""
},
{
"docid": "a7979c404c193c314156683b1b862e9a",
"score": "0.49300832",
"text": "def push(stack, node)\n if stack.argument_definitions.last\n arg_type = stack.argument_definitions.last.type.unwrap\n if arg_type.kind.input_object?\n argument_defn = arg_type.arguments[node.name]\n else\n argument_defn = nil\n end\n elsif stack.directive_definitions.last\n argument_defn = stack.directive_definitions.last.arguments[node.name]\n elsif stack.field_definitions.last\n argument_defn = stack.field_definitions.last.arguments[node.name]\n else\n argument_defn = nil\n end\n stack.argument_definitions.push(argument_defn)\n stack.path.push(node.name)\n end",
"title": ""
},
{
"docid": "d9dac1528d759790ad991322abc08869",
"score": "0.49246225",
"text": "def push_scope(tag, time = Time.now.to_f, deduct_call_time_from_parent = true)\n stack = scope_stack\n transaction_sampler.notice_push_scope(time) if sampler_enabled?\n scope = ScopeStackElement.new(tag, time, deduct_call_time_from_parent)\n stack.push scope\n scope\n end",
"title": ""
},
{
"docid": "5de8a7790189157f877a75d56b4901d6",
"score": "0.49236444",
"text": "def test_3CommaExpression\n \n assert_nothing_thrown(\"Creating AST objects\") { \n \n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG)\n \n var_AST = AST.new(\"sampledata/data.xml\")\n \n expression = CommaExpression.new(CommaExpression.new(IntegerTerminal.new(600), StringTerminal.new(\"operator test\")), FloatTerminal.new(123.321))\n \n expression.execute(var_AST)\n \n result = var_AST.VAR_QRES().pop()\n \n assert_equal(\"QRES::BagResult\", result.class.to_s())\n \n _result = result.pop()\n \n assert_equal(\"QRES::StructResult\", _result.class.to_s())\n \n assert_equal(123.321, _result.pop().VAR_OBJECT())\n assert_equal(\"operator test\", _result.pop().VAR_OBJECT())\n \n assert_equal(123.321, result.pop().VAR_OBJECT())\n assert_equal(600, result.pop().VAR_OBJECT())\n }\n end",
"title": ""
},
{
"docid": "ded309ca611170fe571475fb93e3c70d",
"score": "0.49177268",
"text": "def rewrite_tree\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n return_value = RewriteTreeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal171 = nil\n char_literal174 = nil\n rewrite_tree_atom172 = nil\n rewrite_tree_element173 = nil\n\n tree_for_string_literal171 = nil\n tree_for_char_literal174 = nil\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token T__83\")\n stream_TREE_BEGIN = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token TREE_BEGIN\")\n stream_rewrite_tree_element = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_tree_element\")\n stream_rewrite_tree_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_tree_atom\")\n begin\n # at line 407:4: '^(' rewrite_tree_atom ( rewrite_tree_element )* ')'\n string_literal171 = match(TREE_BEGIN, TOKENS_FOLLOWING_TREE_BEGIN_IN_rewrite_tree_2871) \n if @state.backtracking == 0\n stream_TREE_BEGIN.add(string_literal171)\n end\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_2873)\n rewrite_tree_atom172 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_atom.add(rewrite_tree_atom172.tree)\n end\n # at line 407:27: ( rewrite_tree_element )*\n loop do #loop 79\n alt_79 = 2\n look_79_0 = @input.peek(1)\n\n if (look_79_0 == TREE_BEGIN || look_79_0.between?(TOKEN_REF, ACTION) || look_79_0 == RULE_REF || look_79_0 == T__81 || look_79_0 == T__93) \n alt_79 = 1\n\n end\n case alt_79\n when 1\n # at line 407:27: rewrite_tree_element\n @state.following.push(TOKENS_FOLLOWING_rewrite_tree_element_IN_rewrite_tree_2875)\n rewrite_tree_element173 = rewrite_tree_element\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_element.add(rewrite_tree_element173.tree)\n end\n\n else\n break #loop 79\n end\n end\n char_literal174 = match(T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_tree_2878) \n if @state.backtracking == 0\n stream_T__83.add(char_literal174)\n end\n # AST Rewrite\n # elements: rewrite_tree_element, rewrite_tree_atom\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 408:3: -> ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n # at line 408:6: ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(@adaptor.create_from_type!(TREE_BEGIN, \"TREE_BEGIN\"), root_1)\n\n @adaptor.add_child(root_1, stream_rewrite_tree_atom.next_tree)\n # at line 408:37: ( rewrite_tree_element )*\n while stream_rewrite_tree_element.has_next?\n @adaptor.add_child(root_1, stream_rewrite_tree_element.next_tree)\n\n end\n\n stream_rewrite_tree_element.reset();\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 39)\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "cbc33442ddd4ac494dd813b57fa95960",
"score": "0.49165678",
"text": "def expressions_from_iseq(bytecodes, locals)\n bytecodes.reduce([]) do |stack, inst|\n puts \"INST: #{inst}\"\n # annoyingly, labels have have their own format\n # UGGGGLY, TODO: refactor\n if inst.is_a?(Symbol) && inst.to_s =~ /^label/\n if ih = self.half_pop_if(inst, stack)\n stack << ih\n elsif iff = self.pop_if(inst, stack)\n stack << iff \n else \n stack << Label.new(inst)\n end\n\n next stack\n elsif inst.is_a?(Fixnum)\n # TODO: What's with the plain numbers?\n next stack\n end\n\n case inst[0]\n # TODO\n when :throw \n # TODO?\n when :trace, :pop, :putnil, :leave\n \n when :branchunless\n test = stack.pop\n if_hole = IfHole.new(test, inst[1], nil, nil, nil)\n stack << if_hole\n when :branchif\n stack << self.pop_while(inst, stack)\n when :jump\n stack << Jump.new(inst[1])\n\n when :putobject_OP_INT2FIX_O_0_C_ \n stack << Literal.new(0)\n when :putobject_OP_INT2FIX_O_1_C_ \n stack << Literal.new(1)\n when :putobject\n stack << Literal.new(inst[1])\n when :putstring\n stack << Literal.new(inst[1])\n when :putself\n stack << Self.new\n when :newarray\n stack << self.pop_array(inst[1], stack)\n when :duparrray\n stack << ArrayLiteral.new(inst[1].map{ |v| Literal.new(v)})\n\n when :getlocal\n stack << self.get_local(inst[2], inst[1])\n when :getlocal_OP__WC__1\n stack << self.get_local(1, inst[1])\n when :getlocal_OP__WC__0\n stack << self.get_local(0, inst[1])\n\n when :setlocal\n stack << self.pop_assignment(inst[2], inst[1], stack)\n when :setlocal_OP__WC__1\n stack << self.pop_assignment(1, inst[1], stack)\n when :setlocal_OP__WC__0\n stack << self.pop_assignment(0, inst[1], stack)\n\n when :send\n stack << self.pop_expression(inst[1], stack)\n when :opt_send_simple\n stack << self.pop_expression(inst[1], stack)\n when :opt_lt\n stack << self.pop_expression(inst[1], stack)\n when :opt_le\n stack << self.pop_expression(inst[1], stack)\n when :opt_plus\n stack << self.pop_expression(inst[1], stack)\n # TODO: The other opts and sends\n else\n puts \"UNKNOWN\"\n end\n\n stack\n end\n end",
"title": ""
},
{
"docid": "d6b45c1a8c6be1b01b188c186a42bad2",
"score": "0.49155965",
"text": "def stack(*args); end",
"title": ""
},
{
"docid": "3b3234ff36ff3b0e8c6095f576cdf98d",
"score": "0.49103147",
"text": "def test_9InExpression\n \n assert_nothing_thrown(\"Creating AST objects\") { \n \n # Set debug log level\n Common::Logger.setLogLevel(Common::VAR_DEBUG)\n \n var_AST = AST.new(\"sampledata/data.xml\")\n \n expression = InExpression.new(\n BagExpression.new(CommaExpression.new(IntegerTerminal.new(888), FloatTerminal.new(11.321))),\n BagExpression.new(CommaExpression.new(StringTerminal.new(\"Test\"), IntegerTerminal.new(888))))\n \n expression.execute(var_AST)\n\n result = var_AST.VAR_QRES().pop()\n \n assert_equal(\"QRES::BagResult\", result.class.to_s())\n assert_equal(0, result.VAR_OBJECT().size())\n \n expression = IntersectExpression.new(\n StructExpression.new(CommaExpression.new(IntegerTerminal.new(888), FloatTerminal.new(11.321))),\n StructExpression.new(CommaExpression.new(FloatTerminal.new(11.321), IntegerTerminal.new(888))))\n \n expression.execute(var_AST)\n \n result = var_AST.VAR_QRES().pop()\n \n assert_equal(\"QRES::BagResult\", result.class.to_s())\n assert_equal(11.321, result.pop().VAR_OBJECT())\n assert_equal(888, result.pop().VAR_OBJECT()) \n }\n end",
"title": ""
},
{
"docid": "309bc452bde6309445062888d93d3282",
"score": "0.49093232",
"text": "def getAST\n return @ast\n end",
"title": ""
},
{
"docid": "b5d8c5320ca8bdbd1e5e1a3e7573d055",
"score": "0.49015746",
"text": "def []=(context, ast)\n @trees[context] = ast\n end",
"title": ""
},
{
"docid": "3cc79bc4d715768e5b8b8544171a737e",
"score": "0.48978817",
"text": "def accept(evaluator)\n evaluator.astree(self)\n end",
"title": ""
},
{
"docid": "570857a777be859c63a72f9c30f03c3e",
"score": "0.48955458",
"text": "def push_cpath_top\n \"stack_push(global->object);\"\n end",
"title": ""
},
{
"docid": "aba165d3b58296658eab03f22df722ea",
"score": "0.48936132",
"text": "def back_quote(*rest)\n if (rest.length == 1)\n to_sexp(rest.first)\n else\n (s(:block) + (rest.collect do |exp|\n to_sexp(exp)\n end))\n end\n end",
"title": ""
},
{
"docid": "ac95141b92727bf14e3899befe4f4db1",
"score": "0.48884577",
"text": "def rewrite_tree\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 39 )\n return_value = RewriteTreeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal171 = nil\n char_literal174 = nil\n rewrite_tree_atom172 = nil\n rewrite_tree_element173 = nil\n\n tree_for_string_literal171 = nil\n tree_for_char_literal174 = nil\n stream_T__83 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__83\" )\n stream_TREE_BEGIN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token TREE_BEGIN\" )\n stream_rewrite_tree_element = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_tree_element\" )\n stream_rewrite_tree_atom = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_tree_atom\" )\n begin\n # at line 398:4: '^(' rewrite_tree_atom ( rewrite_tree_element )* ')'\n string_literal171 = match( TREE_BEGIN, TOKENS_FOLLOWING_TREE_BEGIN_IN_rewrite_tree_2866 )\n if @state.backtracking == 0\n stream_TREE_BEGIN.add( string_literal171 )\n end\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_atom_IN_rewrite_tree_2868 )\n rewrite_tree_atom172 = rewrite_tree_atom\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_atom.add( rewrite_tree_atom172.tree )\n end\n # at line 398:27: ( rewrite_tree_element )*\n while true # decision 79\n alt_79 = 2\n look_79_0 = @input.peek( 1 )\n\n if ( look_79_0 == TREE_BEGIN || look_79_0.between?( TOKEN_REF, ACTION ) || look_79_0 == RULE_REF || look_79_0 == T__81 || look_79_0 == T__93 )\n alt_79 = 1\n\n end\n case alt_79\n when 1\n # at line 398:27: rewrite_tree_element\n @state.following.push( TOKENS_FOLLOWING_rewrite_tree_element_IN_rewrite_tree_2870 )\n rewrite_tree_element173 = rewrite_tree_element\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_tree_element.add( rewrite_tree_element173.tree )\n end\n\n else\n break # out of loop for decision 79\n end\n end # loop for decision 79\n char_literal174 = match( T__83, TOKENS_FOLLOWING_T__83_IN_rewrite_tree_2873 )\n if @state.backtracking == 0\n stream_T__83.add( char_literal174 )\n end\n # AST Rewrite\n # elements: rewrite_tree_atom, rewrite_tree_element\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 399:3: -> ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n # at line 399:6: ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( TREE_BEGIN, \"TREE_BEGIN\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_rewrite_tree_atom.next_tree )\n # at line 399:37: ( rewrite_tree_element )*\n while stream_rewrite_tree_element.has_next?\n @adaptor.add_child( root_1, stream_rewrite_tree_element.next_tree )\n\n end\n\n stream_rewrite_tree_element.reset();\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 39 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "eac56597fbafb0c1c75a57728853deec",
"score": "0.48841345",
"text": "def test_addition\n @eval.load_stacks([5, 5, '+'])\n assert_equal 10, @eval.quick_maffs_a('+')\n end",
"title": ""
},
{
"docid": "bf47db8a20169d291240f8eda4a998c3",
"score": "0.48781037",
"text": "def arithmeticUnary(op)\n str = getTopOfStack + \"M=\"+op+\"M\"+\"\\n\"\n return str+\"\\n\"\nend",
"title": ""
},
{
"docid": "f15c88ceee03e9322f7ca82dbf3fae7e",
"score": "0.4874363",
"text": "def prefix_evaluation(expression)\n return nil if expression.class != String\n digits = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\",\"6\", \"7\", \"8\", \"9\"]\n operators = [\"+\", \"-\", \"*\", \"/\", \"**\"]\n expression_array = expression.split(\" \").reverse\n local_stack = Stack.new()\n expression_array.each do |element|\n if digits.include?(element)\n local_stack.push(element)\n elsif operators.include?(element)\n num1 = local_stack.pop()\n num2 = local_stack.pop()\n result = do_math(num1, num2, element)\n local_stack.push(result)\n else\n puts \"undefined character\"\n end\n end\n local_stack.top()\nend",
"title": ""
}
] |
01ff47f6d8b1db8e437cb17339fb4ccb
|
Retrieve a single page of AddOnResultInstance records from the API. Request is executed immediately.
|
[
{
"docid": "dde32c7287a8ef25d4c40c75f850e929",
"score": "0.0",
"text": "def get_page(target_url); end",
"title": ""
}
] |
[
{
"docid": "495dfe6e9a619e76b55e5f2d64b9b30a",
"score": "0.5801755",
"text": "def get_add_ons_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AddOnApi.get_add_ons ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10000000\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling AddOnApi.get_add_ons, must be smaller than or equal to 10000000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling AddOnApi.get_add_ons, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling AddOnApi.get_add_ons, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling AddOnApi.get_add_ons, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = \"/v1/add_on\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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 = ['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 => 'AddOnSearch')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AddOnApi#get_add_ons\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c81eef0ecbb93412ff7ca5f1032b7e48",
"score": "0.5692451",
"text": "def next_results\n return nil if item_page >= total_pages\n @ecs.send_request(@type,@opts,item_page+1)\n end",
"title": ""
},
{
"docid": "de00c20f1d8b368daf99f522646cc6e9",
"score": "0.56786466",
"text": "def next_results\n fire_request(next_link)\n end",
"title": ""
},
{
"docid": "65b0ce06edf167fde91c366d88743793",
"score": "0.5544741",
"text": "def index\n @equipment_addons = EquipmentAddon.paginate(page: params[:page], per_page: 20)\n end",
"title": ""
},
{
"docid": "211312a152d12adfcf1deec26a4b8542",
"score": "0.5535815",
"text": "def show\n res = AddOnBlueprint.render_as_json(@addon, root: :add_on, view: :detail)\n json_response(res)\n end",
"title": ""
},
{
"docid": "d12dae42f0168a0526daa6b21e8ffdc8",
"score": "0.54156756",
"text": "def index\n @business_add_ons = BusinessAddOn.all\n end",
"title": ""
},
{
"docid": "ea154d03f3239ce0f66af179b3789a7a",
"score": "0.53850394",
"text": "def all(options = {}, &block)\n url = \"#{API_BASE_URL}#{api_path}\"\n\n params = { per_page: 999 }.merge!(options)\n\n request_manager.GET(url, parameters: params, success: ->(operation, result) {\n records = []\n\n result[\"#{api_name}s\"].each do |params|\n records << new(params)\n end\n\n block.call(records, nil) if block\n }, failure: ->(operation, error) {\n block.call(nil, error) if block\n })\n\n self\n end",
"title": ""
},
{
"docid": "1aaa6e63e7304633f217d76c388969e8",
"score": "0.5279647",
"text": "def next_page!\n return nil if (self.offset + self.total_pages) >= self.total_count\n @query[:offset] = self.offset + self.limit\n self.update_ivals(Newznab::Api.get(api_function: self.function, **self.query))\n end",
"title": ""
},
{
"docid": "4c75cba24a42136d09bbfca2936a9006",
"score": "0.5256244",
"text": "def index\n @cup_add_ons = CupAddOn.all\n end",
"title": ""
},
{
"docid": "2af4024c02a859a0c81d0fc693b4d797",
"score": "0.5248636",
"text": "def index\n @additives = Rails.cache.fetch(\"additives#index_page#{params[:page]}\", :expires_in => 1.day) do\n Additive.paginate(:page => params[:page]).includes(:classification).includes(:origin).order('code ASC')\n end\n end",
"title": ""
},
{
"docid": "83e49d94540e733388683c2efb471b59",
"score": "0.52312547",
"text": "def fetch_next(start_record=skipped+@request_take)\n SearchResult.new(Subj3ct.request(@request_method, :query => query, :skip => start_record, :take => @request_take))\n end",
"title": ""
},
{
"docid": "b3349e40fbc96a345cfdbbc563271c2e",
"score": "0.5187231",
"text": "def results\n @query #.limit(@per_page).offset(@offset)\n end",
"title": ""
},
{
"docid": "9deba4d66e95791e39bad3b95bf62b13",
"score": "0.5185356",
"text": "def pagination\n self.results\n end",
"title": ""
},
{
"docid": "1dba8003616c487d271cf5816f5fb6ff",
"score": "0.51852363",
"text": "def get_results\n @results\n end",
"title": ""
},
{
"docid": "c8d6e67df4449dc87bbb60b690f49bc8",
"score": "0.51812136",
"text": "def get_all_results(response, skip_accessors_definition = false)\n results = Azure::Armrest::ArmrestCollection.create_from_response(response, model_class, skip_accessors_definition)\n nextlink = results.next_link\n\n while nextlink\n response = rest_get_without_encoding(nextlink)\n more = Azure::Armrest::ArmrestCollection.create_from_response(response, model_class, skip_accessors_definition)\n results.concat(more)\n nextlink = more.next_link\n end\n\n results\n end",
"title": ""
},
{
"docid": "71c7bdeb0bb3bd0c9653c18a9a92e793",
"score": "0.5178488",
"text": "def index(options = {})\n result = options.delete(:result)\n all = options.delete('all')\n all = true if all.nil?\n response = query(:get) do |req|\n req.params = options\n end\n data = json_parse(response.body)\n return data unless all\n\n if result\n result['items'].concat(data['items'])\n else\n result ||= data\n end\n\n if result['total_entries'] > result['items'].size\n result = index(options.merge(skip: result['items'].size,\n result: result))\n end\n return result\n end",
"title": ""
},
{
"docid": "31d228f14e4ba8aa50ba976580c819a4",
"score": "0.51779026",
"text": "def perform\n\n r = validate\n return r unless r.success?\n\n fetch_records\n\n api_response\n\n end",
"title": ""
},
{
"docid": "328f9616214d13cb4490a44149fa1a8a",
"score": "0.51749784",
"text": "def each(&block)\n process_results(&block)\n until next_page.nil?\n result = service.execute(next_page_url)\n process_results(&block)\n end\n end",
"title": ""
},
{
"docid": "0a0d1ce44fff79f14911fb8a0cec4d51",
"score": "0.5174436",
"text": "def all(options={})\n offset = nil\n results = []\n begin\n options.merge!(:limit => LIMIT_MAX, :offset => offset)\n response = records(options)\n results += response.records\n offset = response.offset\n end until offset.nil? || offset.empty? || results.empty?\n results\n end",
"title": ""
},
{
"docid": "f687e702d9bb719291ce53cfccdac547",
"score": "0.5171067",
"text": "def list\n with_error_handling do\n receipes = client.entries(\n DEFAULT_OPTIONS.merge(\n skip: skip,\n limit: limit\n )\n )\n transform_data(receipes)\n end\n end",
"title": ""
},
{
"docid": "8438ced2518a16b4d6d2a330fce52655",
"score": "0.5148217",
"text": "def results\n self.response\n end",
"title": ""
},
{
"docid": "8438ced2518a16b4d6d2a330fce52655",
"score": "0.5148217",
"text": "def results\n self.response\n end",
"title": ""
},
{
"docid": "899599b68efe4780dc7bd2a1673caab4",
"score": "0.51362294",
"text": "def populate_additional_results\n end",
"title": ""
},
{
"docid": "35e07d221f66d3943adce5e99bc37bab",
"score": "0.51235795",
"text": "def my_add_on\n @addons = @current_app.my_add_ons\n res = AddOnBlueprint.render_as_json(@addons, root: :add_ons, view: :my_add_on)\n json_response(res)\n # render json: res\n end",
"title": ""
},
{
"docid": "55b058298f943bba5d60e8afccdc336b",
"score": "0.5120744",
"text": "def index\n @instances = Instance.contains_ESA_instance_name.paginate(:page => params[:page], :per_page => 5)\n \n end",
"title": ""
},
{
"docid": "2293a7b25bfe5b9fae465e3b4ac89742",
"score": "0.5113434",
"text": "def instances\n get_json(instances_endpoint)\n end",
"title": ""
},
{
"docid": "827f4343fbbcef7c0a1df102d2fc470a",
"score": "0.5107664",
"text": "def retrieve_all(type)\n begin\n object_data = []\n _page = 1\n begin\n _result = @api.resource(type.to_sym).call(:index, params = { :page => _page.to_s })\n object_data.concat(_result['results'])\n _page += 1\n end while _result['results'] != []\n rescue => e\n raise(Exception, \"\\n Could not retreive dat from #{@url} for type #{type}: #{e.inspect}\")\n end\n object_data\nend",
"title": ""
},
{
"docid": "f5544708e6ca1b71913dbf033d3e9ef3",
"score": "0.5104841",
"text": "def index\n @exhibitions = Exhibition.added_by(current_admin_user).page(params[:page]).per(10)\n end",
"title": ""
},
{
"docid": "b4bf40fb5d940ae61713d193feff8cdd",
"score": "0.508955",
"text": "def each\n loop do\n results.each do |result|\n yield(result)\n end\n go_next!\n end\n rescue UserEngage::NoNextPageAvailableException\n true\n end",
"title": ""
},
{
"docid": "e0108af878804c27b9fc3acaeadb2962",
"score": "0.5089301",
"text": "def results\n self.response\n end",
"title": ""
},
{
"docid": "8f4cc2d267606d3b61a61b539edad8ea",
"score": "0.5082758",
"text": "def results_on(result)\n @results << result\n end",
"title": ""
},
{
"docid": "937a8d5cfcbf31c464a31c40c6757698",
"score": "0.50819516",
"text": "def all\n @page[:per_page] = Mole::Addon.count\n @addons = Mole::Addon.order(:id).paginate(@page)\n\n respond_to do |format|\n format.html { render 'index' }\n format.json { render json: @addons, callback: params[:callback] }\n format.xml { render xml: @addons }\n end\n end",
"title": ""
},
{
"docid": "097fa3b0425594191e61d28759ddd366",
"score": "0.50799215",
"text": "def list_results\n # Interface method\n end",
"title": ""
},
{
"docid": "ee8a390512a58baba49e78778b888c37",
"score": "0.5075915",
"text": "def index\n @external_apis = ExternalApi.all\n end",
"title": ""
},
{
"docid": "46ad2c3a0c13344c3d8bc54c7638aa47",
"score": "0.5073953",
"text": "def show\n @event_import_results = @event_import_file.event_import_results.page(params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "b810ee604c79de3a5fe7854e478d06a8",
"score": "0.5064705",
"text": "def first\n get_results_per_page.first\n end",
"title": ""
},
{
"docid": "b810ee604c79de3a5fe7854e478d06a8",
"score": "0.5064705",
"text": "def first\n get_results_per_page.first\n end",
"title": ""
},
{
"docid": "009c6b3abf6e0004f6eafa0b4b68809d",
"score": "0.50611925",
"text": "def results_example(line_item)\n results_service = AtomicLti::Services::Results.new(@application_instance, @lti_token)\n result = results_service.list(line_item[\"id\"])\n @line_item_results = JSON.parse(result)\n end",
"title": ""
},
{
"docid": "ec20ac47f554c0ab90f2797a3f2e3ef3",
"score": "0.50513744",
"text": "def index\n respond_with(current_account.backend_apis.accessible.oldest_first.paginate(pagination_params))\n end",
"title": ""
},
{
"docid": "f684305ae1f7f08790e9bc0e34ad7120",
"score": "0.50513077",
"text": "def fetch\n fetch_response['results']\n end",
"title": ""
},
{
"docid": "f684305ae1f7f08790e9bc0e34ad7120",
"score": "0.50513077",
"text": "def fetch\n fetch_response['results']\n end",
"title": ""
},
{
"docid": "ecc750c437c260d95f4f449a8c0fb046",
"score": "0.50502723",
"text": "def next_page\n return nil if (@offset + @page_count) >= @total_count\n update_ivals(ComicVine::API.search(@resource, @query, {:limit => @limit, :page => (((@offset + @page_count) / @limit) + 1)}))\n end",
"title": ""
},
{
"docid": "047be8d152f8726d5e3e0126c5e40f30",
"score": "0.5043558",
"text": "def swapi_all(url = nil)\n all_results = []\n uri = URI(url || swapi_url)\n\n request = Net::HTTP.get_response(uri)\n response = JSON.parse(request.body)\n\n # Recursively get all results if the endpoint is paginated\n all_results.concat(swapi_all(response['next'])) if response['next'].present?\n\n all_results.concat(\n response['results'].map { |r| format_response(r, etag: request['etag']) }\n )\n rescue *ALL_NET_HTTP_ERRORS\n Rails.logger.error e.message\n []\n end",
"title": ""
},
{
"docid": "e32f03d0829d487929c44f202b206d19",
"score": "0.5041996",
"text": "def records(options={})\n options[\"sortField\"], options[\"sortDirection\"] = options.delete(:sort) if options[:sort]\n results = self.class.get(worksheet_url, query: options).parsed_response\n check_and_raise_error(results)\n RecordSet.new(results)\n end",
"title": ""
},
{
"docid": "4dfd418066d41e96269476bb274c1e39",
"score": "0.5039388",
"text": "def records_plus_one\n memoize :records_plus_one do\n filtered_and_sorted_relation.limit(@page_size + 1).load\n end\n end",
"title": ""
},
{
"docid": "4989208ac9afb48b00be253e56d62841",
"score": "0.50380176",
"text": "def all method, result_name, options = {}\n page_number = 1\n results = []\n\n # this allows page size to be overidden but NOT page_number as I want to\n # control that to know when we have all results\n options = {\"PageSize\" => 500}.merge options\n\n begin\n options.merge!({\n \"PageNumber\" => page_number,\n })\n\n last_result = self.send(method, options)\n\n results << last_result[result_name]\n results.flatten!\n\n\n if last_result['TotalResultsCount']\n total_results = last_result['TotalResultsCount']\n else\n total_results = 0\n end\n logger.debug \"#{results.length} / #{total_results}\"\n page_number+=1\n end while results.length < total_results-1\n\n last_result.merge({\n result_name => results\n })\n end",
"title": ""
},
{
"docid": "e3c05fa72e305cc8ec695effc32b53e4",
"score": "0.5024713",
"text": "def next\r\n next_result = Hash.new\r\n APIS.each do |api|\r\n api_module_name = Object.const_get('HawatelSearchJobs').const_get('Api').const_get(api)\r\n api_inst_var = instance_variable_get(\"@\"+api.downcase)\r\n api_sym_name = api.downcase.to_sym\r\n\r\n if api_inst_var[:activated] && next_result?(api_sym_name)\r\n next_result[api_sym_name] = api_module_name.page({:settings => api_inst_var,\r\n :page => @jobs_table[api_sym_name].page + 1,\r\n :query_key => @jobs_table[api_sym_name].key})\r\n end\r\n end\r\n\r\n return nil if next_result.empty?\r\n\r\n @jobs_table = next_result\r\n end",
"title": ""
},
{
"docid": "f327fed5b56559029e344694e317ef05",
"score": "0.50134146",
"text": "def index\n validate_arguments!\n\n addons = api.request(\n :expects => [200, 206],\n :headers => { \"Accept\" => \"application/vnd.heroku+json; version=edge\" },\n :method => :get,\n :path => \"/apps/#{app}/addons\"\n ).body\n\n attachments = api.request(\n :expects => [200, 206],\n :headers => { \"Accept\" => \"application/vnd.heroku+json; version=edge\" },\n :method => :get,\n :path => \"/apps/#{app}/addon-attachments\"\n ).body\n attachments_by_resource = {}\n attachments.each do |attachment|\n next unless attachment[\"app\"][\"name\"] == app\n addon_uuid = attachment[\"addon\"][\"id\"]\n attachments_by_resource[\"#{addon_uuid}\"] ||= []\n attachments_by_resource[\"#{addon_uuid}\"] << attachment['name']\n end\n\n if addons.empty?\n display(\"#{app} has no add-ons.\")\n else\n styled_header(\"#{app} Add-on Resources\")\n styled_array(addons.map do |addon|\n addon_name = addon['name'].downcase\n [\n addon['plan']['name'],\n \"@#{addon_name}\",\n attachments_by_resource[addon['id']].join(\", \")\n ]\n end)\n end\n end",
"title": ""
},
{
"docid": "1099328e5d33439785285094d639458a",
"score": "0.5002611",
"text": "def request!\n return if has_requested?\n sleep_for = wait_for_request_delay\n if(sleep_for)\n sleep(sleep_for)\n end\n xml_query = api.builder do |xml|\n xml.eloquaType do\n xml.template!(:object_type, remote_object.remote_type)\n end\n xml.searchQuery(build_query)\n\n # This won't harm anything but it is changing the\n # fields to its mapped elouqa name.\n if(!fields.blank? && fields.is_a?(Array))\n fields.map! do |field|\n field = remote_object.eloqua_attribute(field)\n end\n xml.fieldNames do\n xml.template!(:array, fields)\n end\n end\n\n xml.pageNumber(page)\n xml.pageSize(limit)\n end\n\n # Add timestamp of when we made request\n @_query_started = Time.now\n result = api.request(:query, xml_query)\n\n # Clear collection\n collection.clear\n\n # Mark as requested\n @has_requested = true\n\n\n if(result[:entities])\n @total_pages = result[:total_pages].to_i\n entities = Eloqua.format_results_for_array(result, :entities, :dynamic_entity)\n records = entities.inject([]) do |records, entity|\n record_attrs = {}\n entity_id = entity[:id]\n entity[:field_value_collection][:entity_fields].each do |entity_attr|\n record_attrs[entity_attr[:internal_name]] = entity_attr[:value]\n end\n record_attrs[remote_object.primary_key] = entity_id\n record_object = remote_object.new(record_attrs, :remote)\n\n collection << record_object\n end\n collection\n else\n @total_pages = 0\n false\n end\n end",
"title": ""
},
{
"docid": "64a5aacbdafde0223281251245084a72",
"score": "0.50025743",
"text": "def request_next_page!\n return 0 if all_pages_requested?\n\n query_params.merge!(offset: next_offset) if next_offset.present?\n\n # TODO: have lower-level methods (e.g. #get_resource) implement retries\n resp_arr = client.with_retries do\n client.get_resource(\n Lever::Client::BASE_PATHS[resource_class.name.demodulize.tableize.to_sym], # e.g. '/opportunities'\n resource_class, # e.g. Lever::Opportunity\n nil,\n query: query_params\n ) do |response|\n self.next_offset = response['next']\n self.all_pages_requested = !response['hasNext']\n end\n end\n\n hydrated_resources.push(*resp_arr)\n\n resp_arr.length\n end",
"title": ""
},
{
"docid": "b5569377ed94bb3c38b4462e2be814fe",
"score": "0.50010544",
"text": "def get_events(opts = {})\n url = Util::Config.get('endpoints.base_url') + Util::Config.get('endpoints.events')\n url = build_url(url, opts)\n\n response = RestClient.get(url, get_headers())\n body = JSON.parse(response.body)\n\n events = body['results'].collect do |event|\n Components::Event.create_summary(event)\n end\n\n Components::ResultSet.new(events, body['meta'])\n end",
"title": ""
},
{
"docid": "43aad5ccdd1a919d44b27561c45f3ba1",
"score": "0.4998629",
"text": "def get_next_results\n\n q = (params[:query].nil?) ? 'name NOT NULL' : params[:query]\n index = params[:id].to_i\n\n all = DataSets.get_groups(q)\n if all.size >= index\n @results = EntryBuilder.process_entries( all[index] )\n @element_id = index+1\n render :partial => \"data/entry\"\n end\n\n end",
"title": ""
},
{
"docid": "17bd201c98789d675d78f5ef95d349fc",
"score": "0.4997852",
"text": "def fetch_employees\n @fetch_employees ||= client.employees\n end",
"title": ""
},
{
"docid": "c87ff6dd757684aedf0b99e641c4b559",
"score": "0.49949816",
"text": "def index\n @o_all = get_records(params[:page])\n \n end",
"title": ""
},
{
"docid": "8dea3ef7cee9ce5d8000a49b8484c111",
"score": "0.4991635",
"text": "def get_records(query)\n resp = client.get(:path => \"#{base_path}/records\", :query => query)\n extract_response('records', resp)\n end",
"title": ""
},
{
"docid": "0982277e40982ab4eb7f660d0c2c337f",
"score": "0.499104",
"text": "def next\n @client.get(@request[:url], {}, :query => (@request[:query]).merge(:since_id => @last_id))\n end",
"title": ""
},
{
"docid": "f729c8b0a484a3fb89e2c799f4353999",
"score": "0.4980783",
"text": "def get\n ensure_client!\n\n client.get_all([self]).first\n end",
"title": ""
},
{
"docid": "1e9aaaad3f8165c5cdaed98033335362",
"score": "0.49783722",
"text": "def next_page\n if @page < @page_count\n @client.find(@query, :page_size => @page_size,\n :page_index => @page + 1)\n end\n end",
"title": ""
},
{
"docid": "88cc1f2810e7027d7610ad0a8eb96231",
"score": "0.49778375",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordByExternalIDResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "c3b7c47ad2c820a5186c45e4db549988",
"score": "0.49760255",
"text": "def results\n self['results'].map do |result|\n BrainstemAdaptor::Record.new(result['key'], result['id'], self)\n end\n end",
"title": ""
},
{
"docid": "19db1fb85ab130eee9d4d5498dd16219",
"score": "0.49700353",
"text": "def index\n @import_results_from_urls = ImportResultsFromUrl.all\n end",
"title": ""
},
{
"docid": "b8e566eeef3134716865c97ea0ba7653",
"score": "0.4964448",
"text": "def index\n # Get the records for the entity.\n begin\n @parcel = get_paginated_records_for(\n :for => Instance,\n :entity => params[:entity_id],\n :start_index => params[:start_index],\n :max_results => params[:max_results],\n :order_by => params[:order_by],\n :direction => params[:direction],\n :conditions => params[:conditions]\n )\n render :response => :GETALL\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n \n end",
"title": ""
},
{
"docid": "d2a97c49384772759000f7616ff995fd",
"score": "0.49601212",
"text": "def batch_one\n @batch_one ||= begin\n response = client.search.call(operation, message: query)\n records = response_records(response, response_type)\n @records_found = response_return(response, response_type)[:records_found].to_i\n @records_retrieved = records.count\n @query_id = response_return(response, response_type)[:query_id].to_i\n records\n end\n end",
"title": ""
},
{
"docid": "aacd35e10acdcd53e5279a224e17aa1e",
"score": "0.49571455",
"text": "def index\n @item_records = @item.item_records.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @item_records }\n end\n end",
"title": ""
},
{
"docid": "0a1e634c3537a0ea1757798ae8c75be9",
"score": "0.49540055",
"text": "def results\n parse_response @raw_response = @client.fql_multiquery(query_map)\n end",
"title": ""
},
{
"docid": "a740451570daa406ccbd957b1cd07f72",
"score": "0.49527565",
"text": "def next\n response = self.class.get(\"#@uri/next/#@timestamp\")\n create_new_record(response)\n end",
"title": ""
},
{
"docid": "e49617837b50c7074ca914d4bccf06f8",
"score": "0.4951363",
"text": "def fetch_all_records(opts={})\n a = Mechanize.new\n \n # Fetch the initial index page, which contains the form data we need\n # to request index pages by number\n a.get(URL) do |initial_index_page|\n \n page_number = 1\n index_page = initial_index_page\n while true do\n begin\n process_page(index_page, page_number) do |new_index_page, name, license_type|\n puts \" name=#{name}, license_type=#{license_type}\"\n yield OpencorporatesBotRecord.new(\n :name => name,\n :license_type => license_type,\n :reporting_date => Time.now.utc.iso8601(2)\n )\n index_page = new_index_page\n end\n page_number += 1\n rescue NoMoreData\n break\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6120b1d4c8b6f64456dcc8e8f8e615b8",
"score": "0.49495795",
"text": "def index\n @events = Event.active.occurs_first.limit(100)\n respond_with @events\n end",
"title": ""
},
{
"docid": "63e85944b5bf48885fc9ef24348f2bdb",
"score": "0.49464095",
"text": "def index\n @result_items = ResultItem.all\n end",
"title": ""
},
{
"docid": "310e3aa06d2ad3a0b90202e7b205e8cf",
"score": "0.49446854",
"text": "def enumerator\n response = get_initial_response\n Enumerator.new do |yielder|\n loop do\n response.records.each { |item| yielder << item }\n\n after_cursor = response.after\n break if after_cursor.nil?\n\n @options[:params] ||= {}\n @options[:params] = @options[:params].merge(after: after_cursor)\n response = @service.list(@options.merge(after: after_cursor))\n end\n end.lazy\n end",
"title": ""
},
{
"docid": "850c2e458b7c3d1745cfdb87f2a50694",
"score": "0.49396703",
"text": "def get_all(url, initial_options = {})\n options = initial_options.clone\n options[:params] ||= {}\n options[:params][:page] = 1\n options[:params][:per_page] = 100 # maximum number of records per page\n\n data = []\n begin\n response = get(url, options)\n data = data.concat(response.parsed)\n options = initial_options\n end while url = response.hateoas[:next]\n\n data\n end",
"title": ""
},
{
"docid": "d7a90a1c124442b2d5c54b1480e6624c",
"score": "0.4932577",
"text": "def index\n @additional_service_records = AdditionalServiceRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @additional_service_records }\n end\n end",
"title": ""
},
{
"docid": "cf3783c607cd320467b448b5e6dc1fc0",
"score": "0.49312586",
"text": "def index\n entries = FilterEntriesService.new(query_params).perform\n json_response(entries, :ok, pagination_details(entries))\n end",
"title": ""
},
{
"docid": "67759656e7121a7db3543c9aad1de1e5",
"score": "0.49307817",
"text": "def results\n raise ApplicationIDNotSet if Yahoo::SE.application_id.nil?\n @request = Yahoo::SE::Request.new(Yahoo::SE::Inlinks::SERVICE_PATH, @options)\n @results = @request.results\n end",
"title": ""
},
{
"docid": "c171f741b95eed9901261ff1be22093c",
"score": "0.4929887",
"text": "def getRecords(query)\n puts query\n\n puts \"in getRecords\"\n record = @client.query_all(\"#{query}\") #where emailId = #{emailId}\")\n return record.to_a\n #explain = @client.explain(\"#{query}\")\n #puts explain.class\n #puts explain\n\n #find = @client.find('Lead', '00Q3D000003QtdjUAC')\n #puts find\n=begin\n puts \"hello\"\n puts record.class\n\n puts record\n puts record.first.Id\n puts record.first.fetch('Id')\n\n\n puts record.to_a[0].attrs['Id']\n puts \"***********\"\n #puts record.to_a[0].describe\n puts \"***********\"\n lead = record.first\n puts lead.sobject_type\n puts lead.fetch('Id')\n puts lead.Id\n=end\n=begin\n #we cant update records like below\n lead.Name = \"testtttttt\"\n puts lead.save\n\n puts lead.destroy\n jsonRecord = EnziRestforce.getJson(record)\n puts \"@@@@@@@@@@@@@@@@@@@@@@@@@\"\n puts jsonRecord.size\n puts jsonRecord[1].fetch('Id')\n rec = jsonRecord[0]\n puts rec.Id\n puts rec.sobject_type\n \n puts rec.fetch('Id')\n puts \"@@@@@@@@@@@@@@@@@@@@@@@@@\"\n=end\n end",
"title": ""
},
{
"docid": "b4babd73dbbe185dbf8d19d5a7d5af48",
"score": "0.49274716",
"text": "def add_status\n EngineyardAPI::API.get(\"#{@path}/add_instances\")\n end",
"title": ""
},
{
"docid": "18844ac2d8c999c0d87ce297eb0e0766",
"score": "0.4923492",
"text": "def api_results\n visible_fields = @collection.visible_fields_for(@current_user, snapshot_id: @snapshot_id)\n\n fields_by_es_code = visible_fields.index_by &:es_code\n\n items = results()\n\n items.each do |item|\n properties = item['_source']['properties']\n item['_source']['identifiers'] = []\n item['_source']['properties'] = {}\n\n properties.each_pair do |es_code, value|\n field = fields_by_es_code[es_code]\n if field\n item['_source']['properties'][field.code] = field.api_value(value)\n end\n end\n end\n\n items\n end",
"title": ""
},
{
"docid": "18844ac2d8c999c0d87ce297eb0e0766",
"score": "0.4923492",
"text": "def api_results\n visible_fields = @collection.visible_fields_for(@current_user, snapshot_id: @snapshot_id)\n\n fields_by_es_code = visible_fields.index_by &:es_code\n\n items = results()\n\n items.each do |item|\n properties = item['_source']['properties']\n item['_source']['identifiers'] = []\n item['_source']['properties'] = {}\n\n properties.each_pair do |es_code, value|\n field = fields_by_es_code[es_code]\n if field\n item['_source']['properties'][field.code] = field.api_value(value)\n end\n end\n end\n\n items\n end",
"title": ""
},
{
"docid": "3e8fa84e983f40ce45c43ac4384cc280",
"score": "0.49226758",
"text": "def index\n @external_events = ExternalEvent.all\n end",
"title": ""
},
{
"docid": "70f2ffbfb4f6c488c7008d2d794a6df3",
"score": "0.49162614",
"text": "def results\n raise ApplicationIDNotSet if Yahoo::SE.application_id.nil?\n @request = Yahoo::SE::Request.new(Yahoo::SE::Pages::SERVICE_PATH, @options)\n @results = @request.results\n end",
"title": ""
},
{
"docid": "8d567bc2437e092d16cef0c4a2e3b5dd",
"score": "0.49156582",
"text": "def all\n response = get('findAll', {'page' => 1, 'limit' => 50}).body\n if response.success?\n response.result = response.body['data'].map do |id, offer|\n HasOffers::Models::Offer.parse(offer)\n end\n end\n\n response\n end",
"title": ""
},
{
"docid": "c6d6a310b05257bbd39d1d1cf916d571",
"score": "0.49135637",
"text": "def index\n @responses = @website.responses.includes(:page)\n end",
"title": ""
},
{
"docid": "b918cc042e361e52f8c219bef07e3591",
"score": "0.49127394",
"text": "def results(params={})\n @conn.get(\"/#{API_VERSION}/results\", params)\n end",
"title": ""
},
{
"docid": "3ce3162f4aa188b2d0e93777e0000bf1",
"score": "0.49114868",
"text": "def next\n return nil if @next.nil?\n Page.new( @client, @api_model, @next, {} )\n end",
"title": ""
},
{
"docid": "92c7dea288efab5b817719f40f60e4d8",
"score": "0.48942056",
"text": "def return_search_results\n \n #ecode results\n result = ActiveSupport::JSON.decode(open(@url).read)[\"responseData\"][\"results\"]\n \n #for each result, add to an array to an array\n result.each do |page|\n @search_results << [ page['title'], page['url'], page['content'] ] \n end\n \n return @search_results\n \n end",
"title": ""
},
{
"docid": "86daa950ab1c1571fdab5b3719a632e4",
"score": "0.48853165",
"text": "def each(&block)\n unless empty?\n process_results(&block)\n unless next_page.nil?\n # ensure request gets executed with the same options\n query.execute(URI.decode next_page_url).each(&block)\n end\n end\n end",
"title": ""
},
{
"docid": "86daa950ab1c1571fdab5b3719a632e4",
"score": "0.48853165",
"text": "def each(&block)\n unless empty?\n process_results(&block)\n unless next_page.nil?\n # ensure request gets executed with the same options\n query.execute(URI.decode next_page_url).each(&block)\n end\n end\n end",
"title": ""
},
{
"docid": "b1998d040815d985f5a2f7e8ce778dce",
"score": "0.4881422",
"text": "def index\n @scrape_result = ScrapeResult.new\n @scrape_results = ScrapeResult.paginate(page: params[:page], per_page: 1).order('id DESC')\n end",
"title": ""
},
{
"docid": "25a6325952306306f340be63175e0acf",
"score": "0.48809025",
"text": "def item_dump_call\n wf.list(ALL_PAGE_SIZE, :all).response.items\n end",
"title": ""
},
{
"docid": "c25aabf91532b47eda4117fb7d2fcaaf",
"score": "0.48796263",
"text": "def listing(options={})\n path = \"\"\n options= {:query =>options}\n OodleResponse.from_xml(get(path, options))\n end",
"title": ""
},
{
"docid": "628acdd836324af0f995adebef8a5cc9",
"score": "0.48756516",
"text": "def index\n @increase_points = IncreasePoint.all\n end",
"title": ""
},
{
"docid": "2b87f7b624600eb7b56c59112f45bb66",
"score": "0.4875437",
"text": "def next\n @options[:start] = @options[:start] + @options[:results]\n @options[:results] = total_results_available - @options[:start] if last?\n results\n end",
"title": ""
},
{
"docid": "044964de47d046cf1aca75263b396d30",
"score": "0.48753574",
"text": "def results\n response.results\n end",
"title": ""
},
{
"docid": "044964de47d046cf1aca75263b396d30",
"score": "0.48753574",
"text": "def results\n response.results\n end",
"title": ""
},
{
"docid": "df1c7543215ec8a6597684043a48b1c0",
"score": "0.48751822",
"text": "def add_result(result)\n @query_results << result\n end",
"title": ""
},
{
"docid": "48785423164981ef5ba0790757df1b94",
"score": "0.48746496",
"text": "def show(api_params)\n raw = api_request(ADDONS, SHOW, api_params)\n @addon = raw[:body].first unless raw.nil?\n self\n end",
"title": ""
},
{
"docid": "aea350b4f207d503f89612c97b4b5f5a",
"score": "0.48723415",
"text": "def next_page\n @next_page ||= @client.get(@raw_page['nextRecordsUrl']).body if has_next_page?\n end",
"title": ""
},
{
"docid": "e59a3bf5a47ffea21b7c33e9b5876c04",
"score": "0.48708352",
"text": "def index\n @employees = Employee.paginate(page: params[:page])\n @responses = Response.where('employee_id' => params[:id])\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"title": ""
},
{
"docid": "7cde32ef98436aa8d174927ef5b01c2b",
"score": "0.4864172",
"text": "def index\n @query_results = QueryResult.all\n end",
"title": ""
},
{
"docid": "62bc4018f33a0f93470bf391ab535ada",
"score": "0.4861452",
"text": "def index\n @foreign_enterprises = ForeignEnterprise.page(params[:page]).order(\"updated_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foreign_enterprises }\n end\n end",
"title": ""
},
{
"docid": "0bfc44427a47bec2062b04ea5bafeebf",
"score": "0.4861023",
"text": "def fetch # rubocop:disable Metrics/AbcSize\n resp = Faraday.new(ENDPOINT, headers: { \"If-None-Match\" => etag }).get\n # return if there aren't any changes since last fetching\n return unless resp.status == 200\n\n data = YAML.safe_load resp.body\n all_success = true\n data[\"root\"][\"items\"].each { |doc| all_success &&= parse_page doc }\n self.etag = resp[:etag] if all_success\n @index.save\n end",
"title": ""
}
] |
5937bcf29609352ce4077ea5a2a14343
|
Retrieves the result of the next page. Returns nil if there is no next page or no pages at all.
|
[
{
"docid": "6e7c5694b5aa889f49e7a2ca2a45274c",
"score": "0.0",
"text": "def next_page\n next_request = page_iterator.next\n self.instance_eval { @env = next_request.env } if next_request\n next_request\n end",
"title": ""
}
] |
[
{
"docid": "f4d0edd66ec324dfe61b18a418f7d317",
"score": "0.7915024",
"text": "def get_next_page\n response = @next_method.call(@next_link).value! unless @next_method.nil?\n unless response.nil?\n @next_link = response.body.next_link\n @value = response.body.value\n self\n end\n end",
"title": ""
},
{
"docid": "f4d0edd66ec324dfe61b18a418f7d317",
"score": "0.7915024",
"text": "def get_next_page\n response = @next_method.call(@next_link).value! unless @next_method.nil?\n unless response.nil?\n @next_link = response.body.next_link\n @value = response.body.value\n self\n end\n end",
"title": ""
},
{
"docid": "f4d0edd66ec324dfe61b18a418f7d317",
"score": "0.7915024",
"text": "def get_next_page\n response = @next_method.call(@next_link).value! unless @next_method.nil?\n unless response.nil?\n @next_link = response.body.next_link\n @value = response.body.value\n self\n end\n end",
"title": ""
},
{
"docid": "7bf136ce3c2377463a66c2f47125546c",
"score": "0.74237645",
"text": "def next_page\n if @position >= @response.length\n return nil\n end\n\n page = @response[@position...(@position + 10)]\n @position += 10\n\n return page\n end",
"title": ""
},
{
"docid": "8df3002b4e9b0b76022dba5a5b9f9f17",
"score": "0.7343157",
"text": "def next_page(options = nil)\n next_page_async(options).get\n end",
"title": ""
},
{
"docid": "9e31e29b287774c1ed4e79f986530ade",
"score": "0.73251444",
"text": "def next\n return nil if data[:next].nil?\n client.get(data[:next])\n end",
"title": ""
},
{
"docid": "aea350b4f207d503f89612c97b4b5f5a",
"score": "0.72642356",
"text": "def next_page\n @next_page ||= @client.get(@raw_page['nextRecordsUrl']).body if has_next_page?\n end",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "dfe418a24e9a7a6dcfc995b4185e744b",
"score": "0.72052115",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "ab1bd19276eaf4dd82babc15e5ccc32c",
"score": "0.72001016",
"text": "def next_page\n return if last_page?\n perform_request\n end",
"title": ""
},
{
"docid": "3e98b8d6e58f824de0f88c63e422b4fd",
"score": "0.71964896",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "3e98b8d6e58f824de0f88c63e422b4fd",
"score": "0.71964896",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "3e98b8d6e58f824de0f88c63e422b4fd",
"score": "0.71964896",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "3e98b8d6e58f824de0f88c63e422b4fd",
"score": "0.71964896",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "3e98b8d6e58f824de0f88c63e422b4fd",
"score": "0.71964896",
"text": "def get_NextPage()\n \t return @outputs[\"NextPage\"]\n \tend",
"title": ""
},
{
"docid": "c81eef0ecbb93412ff7ca5f1032b7e48",
"score": "0.71725327",
"text": "def next_results\n return nil if item_page >= total_pages\n @ecs.send_request(@type,@opts,item_page+1)\n end",
"title": ""
},
{
"docid": "5c52342df99d24638a3a5bb13cc1de2c",
"score": "0.71714044",
"text": "def next_page\n @api.search(@result_type, @params.merge(page: @metadata.page + 1)) if @metadata.page < @metadata.pages\n end",
"title": ""
},
{
"docid": "5563fc66cf2b999ecfd4dfa889b51f06",
"score": "0.7161404",
"text": "def next_page\n return nil unless(@media)\n self.pages[@page + 2] if(@page < @total)\n end",
"title": ""
},
{
"docid": "3ce3162f4aa188b2d0e93777e0000bf1",
"score": "0.7146215",
"text": "def next\n return nil if @next.nil?\n Page.new( @client, @api_model, @next, {} )\n end",
"title": ""
},
{
"docid": "3f7ad0d36a0e5fdb136cd3edec500529",
"score": "0.7139091",
"text": "def get_next_page(response)\n return nil unless response.headers[:link]\n\n matches = response.headers[:link].match('<([^>]+)>; rel=\"next\"')\n return matches[1] if matches\n end",
"title": ""
},
{
"docid": "7fc0f72c7146abf1a72dc49fc8b1093a",
"score": "0.7088961",
"text": "def next\n @links.key?(:next) ? Page.new(@links[:next]) : nil\n end",
"title": ""
},
{
"docid": "1aaa6e63e7304633f217d76c388969e8",
"score": "0.70464027",
"text": "def next_page!\n return nil if (self.offset + self.total_pages) >= self.total_count\n @query[:offset] = self.offset + self.limit\n self.update_ivals(Newznab::Api.get(api_function: self.function, **self.query))\n end",
"title": ""
},
{
"docid": "3157a7eff7b5500eef24c0eee557986e",
"score": "0.7044109",
"text": "def next_page\n if defined?(@next_page)\n @next_page\n else\n @next_page = if @next_page_data\n response = parse(@client.get(@next_page_data['path']))\n self.class.new(response, type: @type, client: @client)\n end\n end\n end",
"title": ""
},
{
"docid": "1e9aaaad3f8165c5cdaed98033335362",
"score": "0.7035725",
"text": "def next_page\n if @page < @page_count\n @client.find(@query, :page_size => @page_size,\n :page_index => @page + 1)\n end\n end",
"title": ""
},
{
"docid": "9e9c4113c802560ce695e080c7a76aa7",
"score": "0.7018285",
"text": "def next_page\n next_cursor\n end",
"title": ""
},
{
"docid": "9796de0e9cc72745fb9636d3ec6cca95",
"score": "0.7016913",
"text": "def next_page; page(\"next\"); end",
"title": ""
},
{
"docid": "2075eae6b0870a911baff88be2313322",
"score": "0.7008338",
"text": "def next\n @position += 1\n if !valid? and @next_page != nil\n request = Request.new({\n method: Request::GET,\n url: @next_page\n })\n @next_page = nil\n response = @client.process_request request\n parse response\n rewind\n end\n valid? ? current : false\n end",
"title": ""
},
{
"docid": "c3917a6103418316ce16aec3d6aee690",
"score": "0.695772",
"text": "def next_page!\n @page_token = @result[\"nextPageToken\"] if @result\n end",
"title": ""
},
{
"docid": "4607d08b00b5e8de6e629a1726330401",
"score": "0.6942176",
"text": "def next_page\n current_page < total_pages ? (current_page + 1): nil\n end",
"title": ""
},
{
"docid": "c858087fd98d5896da2f13af1d623010",
"score": "0.6941787",
"text": "def next\n if last? then nil else Page.new(@paginator, @number + 1) end\n end",
"title": ""
},
{
"docid": "87a9541dae38658437166f99d5d0d062",
"score": "0.69409484",
"text": "def next\n if @options[\"page\"] && !cbp_request?\n clear_cache\n @options[\"page\"] = @options[\"page\"].to_i + 1\n elsif (@query = @next_page)\n # Send _only_ url param \"?page[after]=token\" to get the next page\n @options.page&.delete(\"before\")\n fetch(true)\n else\n clear_cache\n @resources = []\n end\n end",
"title": ""
},
{
"docid": "6b4d30a3656bf907f80bf1bc6f4f7694",
"score": "0.6933964",
"text": "def get_next_page(doc)\n\t\tdoc.xpath(@@XPATH_NEXT_PAGE).each do |node|\n\t\t\treturn node[\"href\"]\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "2119e7e620623fe2cdc5b8929af20494",
"score": "0.69323075",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "94e45d06a15798dd18c6e0c2a4523ad1",
"score": "0.69312453",
"text": "def next_page\n @page = @page.next\n doc_content = open(\"#{@url}?page=#{@page}\", \"User-Agent\" => @user_agent)\n @doc = Nokogiri::HTML( doc_content )\n page_results = self.parse_page\n page_results\n end",
"title": ""
},
{
"docid": "5f48b73f874b73b897a1a2fdf71358cd",
"score": "0.69275194",
"text": "def next_page\n graph.first_object [page_subject, Ldp.nextPage, nil]\n end",
"title": ""
},
{
"docid": "5f48b73f874b73b897a1a2fdf71358cd",
"score": "0.69275194",
"text": "def next_page\n graph.first_object [page_subject, Ldp.nextPage, nil]\n end",
"title": ""
},
{
"docid": "5f128a9c923706c3d0bd5bf73e0be275",
"score": "0.6924887",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "5f128a9c923706c3d0bd5bf73e0be275",
"score": "0.6924887",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "5f128a9c923706c3d0bd5bf73e0be275",
"score": "0.6924887",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "5f128a9c923706c3d0bd5bf73e0be275",
"score": "0.6924887",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "5f128a9c923706c3d0bd5bf73e0be275",
"score": "0.6924887",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "9a90a6e2935aaa3fdab0cd6f8b7f76d2",
"score": "0.6910794",
"text": "def next_page\n current_page < page_count ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "7cf22ae108c167b168a70bad1456afb8",
"score": "0.69054615",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "3fb9ddb9ef062d3d6c89a44540ffcef5",
"score": "0.68786585",
"text": "def next_page\r\n current_page < page_count ? (current_page + 1) : nil\r\n end",
"title": ""
},
{
"docid": "e94c3b190745b060ba338c288dec6be2",
"score": "0.6816146",
"text": "def next_page\n current_page < total_pages ? (current_page + 1) : nil\n end",
"title": ""
},
{
"docid": "532dfa040fd899cbde052b3faf74c9bc",
"score": "0.67754966",
"text": "def next_page\n return nil if current_page >= total_pages\n return 1 if current_page < 1\n\n current_page + 1\n end",
"title": ""
},
{
"docid": "ecc750c437c260d95f4f449a8c0fb046",
"score": "0.67419636",
"text": "def next_page\n return nil if (@offset + @page_count) >= @total_count\n update_ivals(ComicVine::API.search(@resource, @query, {:limit => @limit, :page => (((@offset + @page_count) / @limit) + 1)}))\n end",
"title": ""
},
{
"docid": "7d1b2ba8eedeb88eeba8dfb5a9f5d575",
"score": "0.6729572",
"text": "def next_page\n return nil unless next_page?\n self.class.new( @options.merge({:page => @options[:page]+1}) )\n end",
"title": ""
},
{
"docid": "311643bd3dad1d4d4d00c9e916602cce",
"score": "0.67234385",
"text": "def next_page\n return nil if last_page?\n\n self.class.new(\n reinit_endpoint(\n override_req_params: { page: current_page + 1 }\n ).do_get\n )\n end",
"title": ""
},
{
"docid": "b239cec4278c54c4da74458533862d31",
"score": "0.6721565",
"text": "def next_result_set(current_result_set)\n if current_result_set\n response = current_result_set.pages.next\n response.present? ? response : current_result_set.pages.next\n else\n self.result_set.pages.next\n end\n end",
"title": ""
},
{
"docid": "7aafc3859727bf3fbaa19511a82bf039",
"score": "0.6720491",
"text": "def next_page\n RGhost::PsObject.new :next_page\n end",
"title": ""
},
{
"docid": "2ade29a72b8eeb334cd386d6f78c01fb",
"score": "0.67071784",
"text": "def next_page\n api.send(self.method, options.merge(:page => self.page.to_i + 1)) if self.page.to_i < self.pages.to_i\n end",
"title": ""
},
{
"docid": "2ade29a72b8eeb334cd386d6f78c01fb",
"score": "0.67071784",
"text": "def next_page\n api.send(self.method, options.merge(:page => self.page.to_i + 1)) if self.page.to_i < self.pages.to_i\n end",
"title": ""
},
{
"docid": "216e0bb449fcd242d5089da71a8d05c7",
"score": "0.66632545",
"text": "def next_page\n detect { |link| link.rel == Link::Rel::NEXT }\n end",
"title": ""
},
{
"docid": "e3c19b312c18e7ef269b9c02f220a941",
"score": "0.6657807",
"text": "def next_page\n pages.each_cons(2) do |page, next_page|\n return next_page if page == current_page\n end\n end",
"title": ""
},
{
"docid": "788ebfcda9ccb3f6bcc2e75e9ec85e54",
"score": "0.66565937",
"text": "def next_page\n return [@page + 1, @page_count].min()\n end",
"title": ""
},
{
"docid": "4eb4790303f6c9cd339ca4e6b63c7ff3",
"score": "0.6639607",
"text": "def next_page page\n next_element = page.search(\"ul.pagination li\").at(\"li.active\").next_element\n # Return Next Element\n return next_element.nil? ? nil : next_element.at(\"a\")[\"href\"]\n end",
"title": ""
},
{
"docid": "ec60dec172b2cbcb1bcf5b510f33d8e1",
"score": "0.6639014",
"text": "def next_page\n return nil if (@offset + @page_count) >= @total_count\n update_ivals(ComicVine::API.send(@resource, {:limit => @limit, :offset => (@offset + @page_count)}))\n end",
"title": ""
},
{
"docid": "d562a3a9ca5785cb24728fdd713992eb",
"score": "0.66340095",
"text": "def next_page(client = request.client)\n raise ArgumentError, 'missing client' if client.nil?\n\n return nil unless link[:next]\n\n client.get(request.path, link[:next])\n end",
"title": ""
},
{
"docid": "28f5f231542dbe9211f320a1c58472b1",
"score": "0.6627398",
"text": "def next_search_result_page(params = T.unsafe(nil), opts = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b4d3c034a06631961e70d729931a06fe",
"score": "0.6622631",
"text": "def next\n @pager.page(@number + 1) if next?\n end",
"title": ""
},
{
"docid": "dc8cf1d0a7c375630dd81183e2dd84be",
"score": "0.6603906",
"text": "def advance_to_next_page_results\n if(! @next_page_link.nil? && @next_page_link.length > 0)\n @browser.goto(@next_page_link)\n end\n end",
"title": ""
},
{
"docid": "95698f77dffa11a6ac8931a0a89ab6a3",
"score": "0.659035",
"text": "def next_page\n @lock.synchronize do\n if @params.empty?\n raise ArgumentError, \"No active search currently cached\"\n end\n page = @params[:page].to_i\n page = 1 if page < 1\n @params[:page] = page + 1\n execute\n end\n end",
"title": ""
},
{
"docid": "b587ed2635e2d67ec0f2cb56f618440e",
"score": "0.65853757",
"text": "def next_page\n self.class.new(resource_wrapper, params, *request_page.call, &request_page)\n end",
"title": ""
},
{
"docid": "85da3db7bc13ecd23759d416883aa84a",
"score": "0.6580347",
"text": "def next_page(options = {})\n default_options = {\n :restricted => nil,\n :public => true\n }\n options = default_options.merge(options)\n find_next_or_previous_page(\"next\", options)\n end",
"title": ""
},
{
"docid": "6565fd2886d885e522c99fdae865473a",
"score": "0.65788496",
"text": "def next_page\n @current_page + 1 if has_next_page?\n end",
"title": ""
},
{
"docid": "c526226aa288fcf4996685853f6affb8",
"score": "0.6574711",
"text": "def request_next_page!\n return 0 if all_pages_requested?\n\n # \"cache\" this value before we update `next_page_url`, so we can provide it to the Page instance\n new_page_url = next_page_url\n # TODO: have lower-level methods (e.g. #get_from_harvest_api) implement retries\n resp_arr = client.with_retries do\n if new_page_url.present?\n client.get_from_harvest_api(new_page_url)\n else\n # If the id is part of the params, bring it out and append to URL\n ending = client.path_id(query_params[:id])\n client.get_from_harvest_api(\"#{resource_class::ENDPOINT}#{ending}\", query_params.except(:id))\n end\n end\n\n links = LinkHeaderParser.parse(client.link.to_s, base: client.class.base_uri)\n self.next_page_url = links.find { |link| link.relation_types == ['next'] }&.target_uri\n self.all_pages_requested = next_page_url.nil?\n\n # If the response only returns one element, then\n # it does not return it in a list. This if checks\n # for that and wraps the singular result in an array.\n if resp_arr.is_a? Hash\n resp_arr = [resp_arr]\n end\n\n # e.g. [...].map { |resource_hash| GreenhouseIo::Application.new(resource_hash) }\n results = resp_arr.map { |resource_hash| resource_class.new(resource_hash) }\n hydrated_resources.push(*results)\n new_page = Page.new(results, dehydrate_after_iteration: dehydrate_after_iteration, url: new_page_url)\n hydrated_pages.push(new_page)\n\n resp_arr.length\n end",
"title": ""
},
{
"docid": "f471420d1d57c1b9dc00d3b219597387",
"score": "0.65745556",
"text": "def get_next_page(response)\n next_page_url = response.headers[:link].match(/^<([^>]*)>; rel=\\\"next/)\n request_uri = URI.parse(next_page_url.captures.first)\n endpoint = [request_uri.path.split('/').last, request_uri.query].join('?')\n sleep TIME_BETWEEN_CALLS\n call(endpoint: endpoint)\n end",
"title": ""
},
{
"docid": "06bc3b09bc26ecc2576121ae2b86a36c",
"score": "0.6567901",
"text": "def next\n @pager.page(@number + 1) if next?\n end",
"title": ""
},
{
"docid": "06bc3b09bc26ecc2576121ae2b86a36c",
"score": "0.6567901",
"text": "def next\n @pager.page(@number + 1) if next?\n end",
"title": ""
},
{
"docid": "08cea083c175379b8a04364590de9700",
"score": "0.6560749",
"text": "def next_page\n if next_page_number\n resource_class.all(default_options.merge(page: next_page_number))\n end\n end",
"title": ""
},
{
"docid": "91263a52fd6420e3509e4317205bc6ef",
"score": "0.6560622",
"text": "def next\n if link = link('next')\n session.get_url(link.href)\n end\n end",
"title": ""
},
{
"docid": "39c2e6479559a55d407c26a19b4ddcc1",
"score": "0.65426785",
"text": "def next!\n update(read: true) ? next_page : false\n end",
"title": ""
},
{
"docid": "6cf2c16276d8a7914b457adf657130b5",
"score": "0.6535264",
"text": "def next_page\n @page_cursor.next_page\n if @leftover.size > 0\n @page_cursor.down_by(@leftover.size)\n end\n end",
"title": ""
},
{
"docid": "afd7ee38adaeab3d70e37b76441d472d",
"score": "0.6531556",
"text": "def next(options = {})\n options = options.reverse_merge(published_only: true)\n page = LessonPage.next(row_order, lesson_id)\n page = (options[:published_only] ? page.published : page).try(:first)\n if page.nil?\n lesson = self.lesson.next(options)\n unless lesson.nil?\n page = (options[:published_only] ? lesson.lesson_pages.published : lesson.lesson_pages).try(:first)\n end\n end\n page\n end",
"title": ""
},
{
"docid": "f47a83332e81c8103fcbdf61f3983095",
"score": "0.65274984",
"text": "def next_url\n next_page ? url(next_page) : nil\n end",
"title": ""
},
{
"docid": "ab731d12f437c120f5010080bd4d5001",
"score": "0.6520952",
"text": "def next_page\n self.page + 1\n end",
"title": ""
},
{
"docid": "60afbd791694f76ae3cc63c167d997e0",
"score": "0.6516166",
"text": "def next\n return if empty_queue?\n data = CrawlResult.new crawl next_url\n data.result\n end",
"title": ""
},
{
"docid": "47fef8728a8dea3184ac575a5c2687af",
"score": "0.6515979",
"text": "def get_next_page(page_number, return_content=true)\n do_request(:p => page_number, :c => return_content, :s => 'next')[0]\n end",
"title": ""
},
{
"docid": "75737590fda5287b60c34ca4efae9c0e",
"score": "0.65065724",
"text": "def next_page\n return nil unless @is_next_url_str_valid\n @url_str = next_url_str\n @page = InWebPage.new(url_str)\n @page_count += 1\n\n # Prepare for getting the page which follows.\n @doc = REXML::Document.new(@page.to_s)\n resumption_token = nil\n @doc.root.elements.each(XPATH_NEXT_PAGE){|e| resumption_token = e.text}\n\n @query_str_next_page = \"resumptionToken=#{resumption_token}\"\n @is_next_url_str_valid = !resumption_token.nil?\n true\n end",
"title": ""
},
{
"docid": "c7876e47d036d4565483ca298e7d8c75",
"score": "0.6506506",
"text": "def next\n raise \"Unable to build sequence. No Comic Defined For Page.\" if self.comic_id == nil\n pages = Page.find_all_by_comic_id_and_is_shown(self.comic.id, \"1\")\n sequence = pages.index(self.id)\n if sequence != nil\n pages[sequence]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "34a11670981d0af3c5bbba2fd0e053dd",
"score": "0.6501582",
"text": "def next_page\n @dataset.next_page\n end",
"title": ""
},
{
"docid": "1b9a6d43055e03aad7e9f1194eeacfa7",
"score": "0.64995414",
"text": "def next_item\n return nil unless more_items?\n return response.cursor if response.respond_to?(:cursor)\n\n response.offset + response.limit\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "68b91df5a0354c64e2bdf91b50aaedfb",
"score": "0.649367",
"text": "def get_next_page(response)\n next_page_url = response.headers[:link].match(/^<([^>]*)>; rel=\\\"next/)\n request_uri = URI.parse(next_page_url.captures.first)\n # TODO: remove.. not generic\n base_uri = '/services/4.0/'\n endpoint = [request_uri.path.split(base_uri).last, request_uri.query].join('?')\n sleep @time_between_calls\n call(endpoint: endpoint)\n end",
"title": ""
},
{
"docid": "bcca091e61852b25156a14904bc5c60a",
"score": "0.6487835",
"text": "def next; @pager.page(@page+1); end",
"title": ""
}
] |
60edfa654e1984faac6e8d854fa1425b
|
strio.readlines(sep=$/) > array strio.readlines(limit) > array strio.readlines(sep,limit) > array See IOreadlines.
|
[
{
"docid": "ee7683c7aa6a761d9ad5ca82af305042",
"score": "0.73956734",
"text": "def readlines(sep=$/, limit=nil)\n raise IOError, \"not opened for reading\" unless @readable\n ary = []\n sep, limit = getline_args(sep, limit)\n if limit == 0\n raise ArgumentError, \"invalid limit: 0 for readlines\"\n end\n while line = getline(sep, limit)\n ary << line\n end\n ary\n end",
"title": ""
}
] |
[
{
"docid": "2d4e2cd819fabd05539905f1789a23ca",
"score": "0.70573956",
"text": "def readlines(eol=$/)\n ary = []\n\n while line = self.gets(eol)\n ary << line\n end\n\n ary\n end",
"title": ""
},
{
"docid": "408650d4ab56b0e427dfda8c4cd300a7",
"score": "0.69978017",
"text": "def readlines(sep=$/)\n return nil unless advance!\n\n lines = []\n while line = gets(sep)\n lines << line\n end\n\n lines\n end",
"title": ""
},
{
"docid": "8a43fac394c35a3ddddcb71a5a9bb1ad",
"score": "0.6878981",
"text": "def retrieve_lines\n if(io)\n io.pos = @history_pos if @history_pos\n @leftover << io.read(4096).to_s\n while(data = io.read(4096))\n @leftover << data.to_s\n end\n @history_pos = io.pos\n result = @leftover.split(delimiter)\n @leftover.replace @leftover.end_with?(delimiter) ? '' : result.pop.to_s\n result\n else\n []\n end\n end",
"title": ""
},
{
"docid": "f3f5fa94ca1595271ce9af240e08c38c",
"score": "0.6852367",
"text": "def readlines(separator = $/)\n end",
"title": ""
},
{
"docid": "d02da24047df51bf89664a34f538804e",
"score": "0.68150294",
"text": "def lines(separator = $RS)\n split separator\n end",
"title": ""
},
{
"docid": "d45502c40fdca8aaf205fc3df39e15dd",
"score": "0.67056364",
"text": "def read!\n objects = []\n last_terminator_index = @data.rindex(terminator)\n if last_terminator_index\n last_terminator_index += 1 # include the following \\n\n objects = consume!(last_terminator_index + 1) # extract upto las terminator positin, +1 because it's an index\n objects = objects.split(terminator).delete_if{|item| item.nil? || item.size == 0}\n end\n return objects\n end",
"title": ""
},
{
"docid": "3e86cc730ff8965950a0123e9399ea21",
"score": "0.66956645",
"text": "def get_array_from_text unparsed\n return unparsed.split(\"\\n\").map{|s| s.chomp}\nend",
"title": ""
},
{
"docid": "e5d2f19fb77734f2c44a85b9a5088997",
"score": "0.66026497",
"text": "def readlines(filename, separator = $/)\n\t end",
"title": ""
},
{
"docid": "2248c893c6c5cf449341c14b72d329fd",
"score": "0.6586064",
"text": "def read(file_name)\n f = File.open(file_name)\n arr = []\n while(!f.eof)\n arr.push(f.readline.chomp.split(\" \").to_a) \n end\n arr\nend",
"title": ""
},
{
"docid": "2248c893c6c5cf449341c14b72d329fd",
"score": "0.6586064",
"text": "def read(file_name)\n f = File.open(file_name)\n arr = []\n while(!f.eof)\n arr.push(f.readline.chomp.split(\" \").to_a) \n end\n arr\nend",
"title": ""
},
{
"docid": "503bce8bb2d6fe08a042d77484930e42",
"score": "0.6549677",
"text": "def get_lines(path)\n ::IO.read(path).split(\"\\n\")\nend",
"title": ""
},
{
"docid": "dd75dc4a94795cf729b222be47067135",
"score": "0.6547854",
"text": "def to_array(separator = \"\\t\")\n array = Array.new\n each do |line|\n line.chomp!\n if line.include?(separator)\n array << line.split(separator)\n else\n array << line\n end\n end\n array\n end",
"title": ""
},
{
"docid": "8c776d0d0ae4a86ca6a069a150211a46",
"score": "0.64598936",
"text": "def lines\n io.lines.map(&:chomp)\n end",
"title": ""
},
{
"docid": "6b39193c90b4deda9605b00606435b43",
"score": "0.64401203",
"text": "def read_lines(eol: $/)\n self.readlines(eol, chomp: true)\n end",
"title": ""
},
{
"docid": "c61eab036d61b5916d7f49ab5c9b2b55",
"score": "0.642439",
"text": "def splitLine(data)\n\n\tdataar = []\n\n\twhile !data.nil? and data.length > 0 do\n\n\t\tcase data[0, 1]\n\t\twhen '\"'\n\t\t\tdataar.push(data[1..data.index('\"', 1)-1])\n\t\t\tdata = data[data.index('\"', 1)+2..data.length]\n\t\twhen '['\n\t\t\tdataar.push(data[1..data.index(']')-1])\n\t\t\tdata = data[data.index(']')+2..data.length]\n\t\telse\n\t\t\tdataar.push(data[0..data.index(' ')-1])\n\t\t\tdata = data[data.index(' ')+1..data.length]\n\t\tend\n\tend\n\n\treturn dataar\n\nend",
"title": ""
},
{
"docid": "7869cc1824bec5e82c8cf33f69bb7377",
"score": "0.64055234",
"text": "def readall\n return [] unless open()\n @fr.pos=@pos\n result= []\n while s=readline do\n\t @pos=@fr.pos\n result << s\n end\n return result\n ensure\n close\n end",
"title": ""
},
{
"docid": "1e0e4a134eebc95b04d7d2482ee60548",
"score": "0.6397968",
"text": "def to_array(str,separater=\",\")\n ary=[]\n str.each_line do |line|\n ary << line.chomp.split(separater)\n end\n ary\n end",
"title": ""
},
{
"docid": "026cb9ca22c5ce08ef6e89ed691745e0",
"score": "0.63930726",
"text": "def read_file_to_arr(path_to_file)\n arr_lines = Array.new\n text = File.open(path_to_file).read\n text.each_line do |line|\n line.gsub!(/\\n/, \"\")\n arr_lines.push(line)\n end\n return arr_lines\nend",
"title": ""
},
{
"docid": "bd861169f530c077d19e3847198dcb84",
"score": "0.6391923",
"text": "def read_file(fn=@filename, delim=@delim)\n data = Array.new\n File.open(fn).each do |line|\n data << line.strip.split(delim)\n end\n return data\n end",
"title": ""
},
{
"docid": "4bce1b59b562313c0b295c0f505c3242",
"score": "0.637377",
"text": "def get_from_file(path)\n\n array = []\n file = File.open(path)\n if file != nil\n array = file.readlines.map(&:chomp) # Discard the final '\\n'\n file.close\n end\n\n return array\n\nend",
"title": ""
},
{
"docid": "4bce1b59b562313c0b295c0f505c3242",
"score": "0.637377",
"text": "def get_from_file(path)\n\n array = []\n file = File.open(path)\n if file != nil\n array = file.readlines.map(&:chomp) # Discard the final '\\n'\n file.close\n end\n\n return array\n\nend",
"title": ""
},
{
"docid": "7fc8610f4a1c3b1276373fad83e1b696",
"score": "0.6335403",
"text": "def file_open(file)\n File.open(file, 'r').each_line.map(&:strip).map { |x| x.split('') }\nend",
"title": ""
},
{
"docid": "5633380b107ba0a765dd2fe22fdc9ad8",
"score": "0.63145727",
"text": "def convert_input_to_array(file_path)\n input_data = File.read(file_path)\n\n input_data.split(\"\\n\")\nend",
"title": ""
},
{
"docid": "5633380b107ba0a765dd2fe22fdc9ad8",
"score": "0.63145727",
"text": "def convert_input_to_array(file_path)\n input_data = File.read(file_path)\n\n input_data.split(\"\\n\")\nend",
"title": ""
},
{
"docid": "47415c4286b04313b6eab2abbf813b3d",
"score": "0.6267083",
"text": "def read_simple_file file\n arr = []\n File.foreach(file) do |line|\n arr << line.delete(\"\\n\")\n end\n return arr\nend",
"title": ""
},
{
"docid": "611ed091f8245afd6da3f79c3256d441",
"score": "0.62640053",
"text": "def to_a\n array = split(@sep) # Split string by path separator\n array.delete(\"\") # Remove empty elements\n array\n end",
"title": ""
},
{
"docid": "34a21b37b73d4ebb3ba27f12cc692426",
"score": "0.626277",
"text": "def lines \n tmp = string.split(\"\\n\")\n tmp += [\"\"] if string[-1].chr == \"\\n\" # don't forget the trailing \\n\n tmp\n end",
"title": ""
},
{
"docid": "f88e28e44ec37f50c0528e374dd37da3",
"score": "0.6259892",
"text": "def to_a\n split // # comparison with `scan /./` shows that `split //` is faster over large datasets\n end",
"title": ""
},
{
"docid": "34a28628c69830a331a6cf95d9fff43b",
"score": "0.62474185",
"text": "def to_array\n File.read(file_location).split(@line_delimiter)\n end",
"title": ""
},
{
"docid": "ce3939fb0c5aa8cd967a02c2d9313979",
"score": "0.62426317",
"text": "def fileReader(filePath)\n\toutList = Array.new()\n\tFile.open(filePath).readlines.each do |line|\n\t\toutList.push(line.strip.to_i())\n\tend\n\toutList.pop\t\t\t\t\t\t\t\t\t\t# Remove empty last entry\n\treturn outList\nend",
"title": ""
},
{
"docid": "6ed58de6d8e4bbbe9a80aa797920c1fd",
"score": "0.624068",
"text": "def read_lines\n\t\t@open_file.read.split(/\\n/).reject{ |r| r == \" \"}\n\tend",
"title": ""
},
{
"docid": "906e37a93dd85327bb6a76c85578c502",
"score": "0.6209519",
"text": "def readlines_until(io,separator='')\n lines = []\n\n until io.eof?\n line = io.readline\n line.chomp!\n\n break if line == separator\n\n lines << line\n end\n\n return lines\n end",
"title": ""
},
{
"docid": "4f400e07b9c1df055e3ffa6dfc72203f",
"score": "0.6204354",
"text": "def readlines\n contents = []\n while ((line = gets) && line.length > 0)\n contents << line\n end\n contents\n end",
"title": ""
},
{
"docid": "4f400e07b9c1df055e3ffa6dfc72203f",
"score": "0.6204354",
"text": "def readlines\n contents = []\n while ((line = gets) && line.length > 0)\n contents << line\n end\n contents\n end",
"title": ""
},
{
"docid": "cd212d8614a48a12dd99e51f8ff9206a",
"score": "0.6202714",
"text": "def readFile(fname)\n counter = 1\n triArray = Array.new(100)\n \n file = File.new(fname, \"r\")\n while (line = file.gets) \n a = line.split(' ').map{ |x| x.to_i }\n triArray[counter - 1] = a\n counter = counter + 1\n end\n file.close\n \n return triArray\n end",
"title": ""
},
{
"docid": "edb5b90260aa79c9ee6f149e85542f3b",
"score": "0.6196736",
"text": "def read_lines\n lines = []\n while has_more_lines?\n lines << read_line\n end\n lines\n end",
"title": ""
},
{
"docid": "94a82bd719fae92efe589768003c09bf",
"score": "0.6192443",
"text": "def readlines\r\n return [\r\n \"PING :id\\r\\n\",\r\n \"PRIVMSG #target :msg\\r\\n\",\r\n \"NOTICE #target :msg\\r\\n\",\r\n \"MODE #target modestr [limit] [user] [banmask]\\r\\n\",\r\n \"TOPIC #channel [topic]\\r\\n\",\r\n \"NAMES [*#channellist]\\r\\n\",\r\n \"LIST [*#channellist [server]]\\r\\n\",\r\n \"INVITE [nickname] [channel]\\r\\n\",\r\n \"KICK *#channellist *nicklist [:comment]\\r\\n\",\r\n \"NICK nick\\r\\n\",\r\n \"WHOIS nick\\r\\n\",\r\n \"USER username hostname servername :realname\\r\\n\",\r\n \"433 nickinuse :message\\r\\n\",\r\n \"311 thisnick nick user host server :realname\\r\\n\",\r\n \"401 thisnick nick :msg\"\r\n ]\r\n end",
"title": ""
},
{
"docid": "be2944b4d6e490ac81916c06b05172a1",
"score": "0.6168105",
"text": "def read_file(io,lines)\n io.readlines.each { |line| lines << line.chomp }\nend",
"title": ""
},
{
"docid": "6a208978424ed73bb1d57be680666fa5",
"score": "0.6157003",
"text": "def parse_file(filename)\n arr = []\n File.open(filename, 'r') do |f|\n f.each_line do |line|\n arr << line.chomp\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "0e1a803a634a671b02d6cb0dd4af4a41",
"score": "0.61527675",
"text": "def readInput(filename) \n \treturn File.readlines(filename).map { |e| e.split(' ') }\nend",
"title": ""
},
{
"docid": "719f0dfe5a1bb81ac2183b57613aeb53",
"score": "0.6143703",
"text": "def get_file_lines(archivo)\n file = open(archivo)\n text = file.read\n text.split(\"\\n\")\nend",
"title": ""
},
{
"docid": "7971e3e805aaaf774eabe31fa303d242",
"score": "0.61323816",
"text": "def textToArray(filename)\n textfile = File.open(filename, 'r')\n filearr = textfile.to_a\n returnArr = []\n filearr.each do |item|\n returnArr.push(item.chomp)\n end\n return returnArr\nend",
"title": ""
},
{
"docid": "54122ac11dc409752bad798465dcc609",
"score": "0.61279476",
"text": "def read_file_to_array\n\tFile.readlines(ARGV.first).to_s\nend",
"title": ""
},
{
"docid": "d0552b7a4331ac107f36aa3b89bc2722",
"score": "0.6114476",
"text": "def get_lines(text)\n lines = text.split(/\\s*\\n/)\n max = 99 # length up to the end of round 1 result, including DIN\n lines.each do |line|\n next unless line.match(/^001 /)\n next unless line.length > max\n max+= 10 * (1 + (line.length - max - 1) / 10) # increase by multiples of 10, the length of 1 result (including 2-space prefix)\n end\n lines.each_index do |i|\n line = lines[i]\n next unless line.match(/^001 /)\n next unless line.length < max\n line+= ' ' * (max - line.length)\n lines[i] = line\n end\n lines\n end",
"title": ""
},
{
"docid": "1a168fddf60d450b3a793210d1ec6fa2",
"score": "0.6112753",
"text": "def split_text(text, lines) # takes in string, returns array of strings\n array = []\n if text.size < 76\n array << text\n else\n lines.times do\n array << text[0..75]\n text = text[76..-1]\n end\n end\n array\nend",
"title": ""
},
{
"docid": "2a59a0e6a8d83bcc085437ad1ce438eb",
"score": "0.6108778",
"text": "def readlines ; ::File.readlines(path) ; end",
"title": ""
},
{
"docid": "0f7b439860406e3df2c872d04533cdff",
"score": "0.6103732",
"text": "def shell_split; end",
"title": ""
},
{
"docid": "c6d2a522123286c0ff4c79f284f41591",
"score": "0.6099091",
"text": "def output_file_to_array(raw_file)\n file_to_read = File.read(raw_file)\n file_to_array = file_to_read.split(\"\\n\")\n end",
"title": ""
},
{
"docid": "075d6bd1208dbaf181b548aaced29bc6",
"score": "0.60810804",
"text": "def lines(string)\n io = StringIO.new(string)\n result = io.readlines\n io.close\n\n result\n end",
"title": ""
},
{
"docid": "c1f48f2e21e7b5225252222e68d705c8",
"score": "0.60753006",
"text": "def text_splitter\n @string_array = @arr.split(\"\\n----\\n\").to_a\n end",
"title": ""
},
{
"docid": "71a9b6710d07e67ea61d6f42fe9f6773",
"score": "0.6072361",
"text": "def read_file(filename)\n return File.read(filename).strip.split(' ')\nend",
"title": ""
},
{
"docid": "a7e8e4022a4e0cf4cd1e86eafe61ddd4",
"score": "0.60558975",
"text": "def lines_list\n lines_list = raw_text.to_textual.split(/\\n/)\n end",
"title": ""
},
{
"docid": "430b8e691e3eab9fe25eb638bdee4038",
"score": "0.60422",
"text": "def retrieve_lines(path,lns)\n\tlines = []\n\tcount = 1\n\tIO.foreach(path) { |line| \n\t\tif(lns.include? count)\n\t\t\tlines << line\n\t\t\tlns.shift\n\t\tend\n\t\tcount += 1\n\t\tbreak if (lns.count == 0)\n\t}\n\treturn lines\nend",
"title": ""
},
{
"docid": "3787e59c1f075be3fa72fb5986ae868a",
"score": "0.60385585",
"text": "def read_file_to_array(filename)\n file = File.new(filename, \"r\")\n arr = file.readlines.collect { |l| l.split }\n file.close\n arr.flatten\n end",
"title": ""
},
{
"docid": "556bb57c1cb686d26403353f75a5fe15",
"score": "0.60136694",
"text": "def split; end",
"title": ""
},
{
"docid": "8a705e1df264a8592e720f514ff3346c",
"score": "0.6005593",
"text": "def split([sep[, limit]]) \n end",
"title": ""
},
{
"docid": "748f977116fca7b2ef3057a6d7916595",
"score": "0.60037935",
"text": "def str2array(str)\n main_arr = []\n str = str.gsub(/\\r/, '')\n str_arr = str.split(/\\n/)\n str_arr.each do |s|\n node = s.split(': ')\n sim_arr = [node[0], node[1].strip] \n main_arr << sim_arr\n end\n return main_arr\n end",
"title": ""
},
{
"docid": "a43b51e8adbe2407c08722f57f5888d2",
"score": "0.59937924",
"text": "def file_lines(input_filename)\n File.readlines(input_filename).map {|l| l.strip }\n end",
"title": ""
},
{
"docid": "87632d5cf0ebf9d0ba6409cf86770e8d",
"score": "0.5992154",
"text": "def file_to_array(file_name)\n result = file_read(file_name) if file_exist?(file_name)\n return nil unless result && result != \"\"\n return result.to_s.split(\"\\n\")\n end",
"title": ""
},
{
"docid": "c7e8778d2700d5c229d7bb6be1b69d90",
"score": "0.59920794",
"text": "def readlines(*rest) end",
"title": ""
},
{
"docid": "7e5ccaa7dbc45f07b6c7a2489628f5eb",
"score": "0.5984883",
"text": "def read_lines(filename) \n data = []\n File.open(filename, \"r\") do |infile| \n while (line = infile.gets)\n clean = line.strip\n data << clean if !clean.empty?\n end\n end\n data\n end",
"title": ""
},
{
"docid": "38a1503b6262684ebb31963e1081f804",
"score": "0.5967646",
"text": "def lines\n file.readlines.sort.map { |line| line.split(' ')[2..-1] }\n end",
"title": ""
},
{
"docid": "751cdb2c75aaea7890ee937c5b1e9e2a",
"score": "0.5959874",
"text": "def get_file_lines(file_name)\n file = open(file_name)\n text = file.read\n lines = text.split(\"\\n\")\n return lines\nend",
"title": ""
},
{
"docid": "88e9ee1ba04398b552f82f33dbfb2b25",
"score": "0.59543675",
"text": "def to_a\n # Split string by path separator\n if @win\n array = tr(File::SEPARATOR, File::ALT_SEPARATOR).split(@sep)\n else\n array = split(@sep)\n end\n array.delete('') # Remove empty elements\n array\n end",
"title": ""
},
{
"docid": "7b26e977d97563b28bd45cf618f4455d",
"score": "0.59537315",
"text": "def read_lines filename\n lines = []\n File.open(filename, \"r\").each_line do |line|\n lines << line.chomp\n end\n\n return lines\nend",
"title": ""
},
{
"docid": "a7f1685b8e3c3d40fced01a66600b79d",
"score": "0.5950945",
"text": "def lines\n to_s.split \"\\n\"\n end",
"title": ""
},
{
"docid": "3e43cf8f5a2df1b3dac4f8a149d04c5f",
"score": "0.5947906",
"text": "def read_from_txt(filepath)\n result_arr = []\n File.open(filepath).each do |line|\n result_arr << line\n end\n result_arr\nend",
"title": ""
},
{
"docid": "263afff921e42d02c6ff24fe19b24a3e",
"score": "0.5923166",
"text": "def filetoarray (filename)\n thearray = []\n File.open(filename, 'r') do |token|\n while line = token.gets\n thearray.push(line.delete(\"\\n\"))\n end\n end\n return thearray\n end",
"title": ""
},
{
"docid": "1b8f261cf7110632a341ad10a2bda180",
"score": "0.5923046",
"text": "def file_to_array(file_name)\n result = file_read(file_name) if file_exist?(file_name)\n return nil unless result\n return result.to_s.split(\"\\n\")\n end",
"title": ""
},
{
"docid": "9b11a30e0357b2bca2f7703e59590b2c",
"score": "0.5920095",
"text": "def ria (p)\n a = []\n `cat #{p}`.each_line {|l| a.push l.strip.to_i }\n return a\n end",
"title": ""
},
{
"docid": "c7616c4cf227e9570007d00ff8d06062",
"score": "0.59039915",
"text": "def retrlines(cmd); end",
"title": ""
},
{
"docid": "66d15dbbac7ccb0b0fc1828c0694745f",
"score": "0.59014654",
"text": "def read_file(fname=nil)\n return if fname.nil?\n # Array we use to store entries\n lines = Array.new\n # Deal with DOS line endings by reading in file, then manually splitting on DOS line ending\n File.open(fname).each_line do |line|\n lines = line.split(/\\r\\n?/).map(&:chomp)\n end\n return lines\nend",
"title": ""
},
{
"docid": "5a82a3caf398c04e81222ecb2a9b7664",
"score": "0.58984053",
"text": "def lines\n lines = []\n file = File.new(@filepath, 'r')\n file.each_line.each_slice(4) do |line|\n ## removes 4th line which is always blank\n line.pop\n ## normalises length of line before adding it to array\n lines << line.map {|subline| '%-27.27s' % subline.chomp }\n end\n return lines\n end",
"title": ""
},
{
"docid": "e02b5356c5518b0fb4c7d5b30a996862",
"score": "0.5896919",
"text": "def getLines(lines)\n lines = removeComments(lines)\n lines = spaceSymbols(lines)\n lines = getStrConst(lines)\n return lines\nend",
"title": ""
},
{
"docid": "2239f54779dd31358f6e0807ee6b9e07",
"score": "0.58831286",
"text": "def lines\n if string.respond_to?(:lines)\n string.lines.to_a\n else\n [string.to_s]\n end\n end",
"title": ""
},
{
"docid": "233cce0771d43e86c10e6388ff40b089",
"score": "0.58686185",
"text": "def convert_arr(incoming_text)\n incoming_text.split(\"\\n\")\n end",
"title": ""
},
{
"docid": "b1c8c638cd4aafa479cd6651eccb384c",
"score": "0.58645636",
"text": "def lines\n if string.respond_to?(:lines)\n string.lines.to_a\n else\n string.to_a\n end\n end",
"title": ""
},
{
"docid": "496197c5719028dc1aa692e662ee9e90",
"score": "0.5861556",
"text": "def split_lines(s)\n s.split(/\\r\\n|\\r|\\n/)\n end",
"title": ""
},
{
"docid": "57fa4e713a5a6bffb9b63f8ee891bd1f",
"score": "0.58557713",
"text": "def scan_to_array(all_one_line)\n all_one_line.scan(/../)\n end",
"title": ""
},
{
"docid": "3530dc70a5123945e6699169bc21323b",
"score": "0.58549464",
"text": "def parse(file)\n File.readlines(file).map(&:chomp)\nend",
"title": ""
},
{
"docid": "bc9a557fe118188318e4263aef8a818e",
"score": "0.5854758",
"text": "def read_string_array_with_length\n read_int.times.map { read_string_int }\n end",
"title": ""
},
{
"docid": "af0597a512cbd9058dc2625862af32e1",
"score": "0.5853638",
"text": "def read_lines(eol: $/)\n self.open(\"r\"){|f| f.read_lines(eol: eol) }\n end",
"title": ""
},
{
"docid": "250ac12c3c229fa2d029feae4a5a89fb",
"score": "0.58523524",
"text": "def mock_get_file_list\n\tdirectory_list = Array.new\n\tcontents = File.read(\"../tudo.txt\")\n\tcontents.each_line do |line|\n\t\tif line =~/Pasta de/\n\t\t\tline = line.slice(33..-1)\n\t\t\tif File::ALT_SEPARATOR!=nil && line.count(File::ALT_SEPARATOR) > line.count(File::SEPARATOR) \n\t\t\t\tline.gsub!(File::ALT_SEPARATOR,File::SEPARATOR)\n\t\t\tend\n\t\t\tdirectory_list << line if line.size > 2\n\t\t\t#puts line\n\t\tend\n\tend\n\treturn directory_list\nend",
"title": ""
},
{
"docid": "c89c443ef6394d095e805e03358d7c78",
"score": "0.5843335",
"text": "def get_lines(filename); end",
"title": ""
},
{
"docid": "c3cf20560c31afb1bbf4e132b89ead6b",
"score": "0.5840074",
"text": "def lines()\r\n @lines = []\r\n each { |l| @lines << \"#{l}\" }\r\n return @lines\r\n end",
"title": ""
},
{
"docid": "d9e4227aecfca86859fad0621cbb9354",
"score": "0.58357346",
"text": "def lines\n format_raw!.map(&:strip).delete_if { |a| a == \"\" }\n end",
"title": ""
},
{
"docid": "d0a75fcf8ed80b58f7c67d6023d8d9ec",
"score": "0.5832175",
"text": "def read_lines(io)\n buffer = +''\n while line = io.gets\n buffer << line\n yield line\n end\n buffer\n end",
"title": ""
},
{
"docid": "db6a0178dc820cf03da80cab1219b0fe",
"score": "0.58316463",
"text": "def lines\n ret = []\n for i in 1..self.count do\n ret << self[i]\n end\n ret\n end",
"title": ""
},
{
"docid": "d76c7865396a0b4f254f7b8990212f29",
"score": "0.58293957",
"text": "def nice_lines\n # note: $/ is the platform's newline separator\n split($/).select{|l| not l.blank? }\n end",
"title": ""
},
{
"docid": "d76c7865396a0b4f254f7b8990212f29",
"score": "0.58293957",
"text": "def nice_lines\n # note: $/ is the platform's newline separator\n split($/).select{|l| not l.blank? }\n end",
"title": ""
},
{
"docid": "46507d087a1ffa493b67abda084aa164",
"score": "0.58250964",
"text": "def lines(force = false)\n raw_data(force).lines.to_a\n end",
"title": ""
},
{
"docid": "6f99a3867f286a55ea8656c952b0e5b0",
"score": "0.5818992",
"text": "def to_a()\n\t\t@list.split(\"\\n\")\n\tend",
"title": ""
},
{
"docid": "08153347c7641a0f0fe36cba2d2dca7a",
"score": "0.5815828",
"text": "def customsplit(t)\n t = t.dup\n e = []\n while i = t.index(\"\\n\") do\n e.push(t.slice!(0..i))\n end\n if t.size != 0 then\n e.push t\n end\n return e\n end",
"title": ""
},
{
"docid": "72c129ca29cde3fbb794aa572284ad63",
"score": "0.5806382",
"text": "def split(pat, limit)\n end",
"title": ""
},
{
"docid": "fa507abfae3c1d4b2282a07df0750114",
"score": "0.5804375",
"text": "def file_to_array(filename)\n\tfile = File.open(filename, 'r')\n\tfile.each_line do |line|\n\t\tarr = []\n\t\tarr.push(line + \"\\n\")\n\t\treturn arr\n\tend\nend",
"title": ""
},
{
"docid": "91b37ec144ac9234f7df4bd954603713",
"score": "0.5794995",
"text": "def lines\n escaped = content.scan(/(\\\\n|\\\\t|\\\\r)/)\n escaped.empty? ? content.split(/\\n/, -1) : [content]\n end",
"title": ""
},
{
"docid": "800ecbd24ded1f35d2680f3b512b6958",
"score": "0.5789046",
"text": "def file_to_array(filename)\n\tfile = File.open(filename)\n\tfile.each_line do |line|\n\t\tarr = []\n\t\tarr.push(line + \"\\n\")\n\t\treturn arr\n\tend\nend",
"title": ""
},
{
"docid": "355da188e623eac40098d1462d904596",
"score": "0.5780226",
"text": "def getInts\n integers = Array.new(0)\n File.open('IntegerArray.txt').each_line{ |s|\n s.gsub!(/\\n?/, \"\")\n integers.push(s)\n }\n integers\nend",
"title": ""
},
{
"docid": "7ebb0a3c18c6fbade7c3861cd21f441f",
"score": "0.5769223",
"text": "def initialize(str)\n @arys = []\n str.lines.map(&:strip).each do |line|\n if line =~ /\\d \\d/\n arys << []\n else\n arys.last << line.split('')\n end\n end\n end",
"title": ""
},
{
"docid": "a5980950f82209d23cc23cf36aac9f2c",
"score": "0.57651216",
"text": "def string_split string\n string.split(/\\n|\\r\\n/)\n end",
"title": ""
}
] |
a10ca2a0d47cea4f509093e8f1cfd1fe
|
POST /searches POST /searches.json
|
[
{
"docid": "6be325d7f27b9b97d7c53940fdf199b6",
"score": "0.6280838",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to new_search_path(:pane => 'pane3', :search_id => @search.id) }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "69fcecb5d5eaaf40ec8b2cedc3a2ca4c",
"score": "0.7552998",
"text": "def create_search(params = {})\n post(\"/searches\", params)\n end",
"title": ""
},
{
"docid": "2dffef85e1b18b784304671583084fa1",
"score": "0.713603",
"text": "def create_saved_search(query)\n post(\"/saved_searches/create\", :query => query)\n end",
"title": ""
},
{
"docid": "aa45d0d8100951e44ba3ec13d4144614",
"score": "0.6959443",
"text": "def post_search( post_search_request, opts = {})\n\n data, _status_code, _headers = post_search_request.create_http_request(@api_client,opts )\n return data\n end",
"title": ""
},
{
"docid": "e22582cba68566fc9edb4ddfee82fa44",
"score": "0.69167674",
"text": "def create\n @search_set = SearchSet.new(params[:search_set].slice(:title, :description))\n\n searches = params[:search_set][:searches].select(&:present?).collect { |search_id| Search.find(search_id)}\n @search_set.searches << searches\n\n respond_to do |format|\n if @search_set.save\n format.html { redirect_to @search_set, notice: 'Search set was successfully created.' }\n format.json { render json: @search_set, status: :created, location: @search_set }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65451527b8116532fb6131406790c1e0",
"score": "0.68476737",
"text": "def create\n SearchesForm.new(search_params).save\n\n respond_to do |format|\n format.html { redirect_to after_write_path }\n format.json { render :show, status: :created, location: @search }\n end\n end",
"title": ""
},
{
"docid": "709e6ce4bb36b8d19147e7148b61a339",
"score": "0.6740868",
"text": "def index\n @searches = SearchService.call(search_params)\n @inserted_data = search_params\n end",
"title": ""
},
{
"docid": "397d98ee87615663311524efdf483aee",
"score": "0.66739285",
"text": "def create\n @search = Search.create!(params[:search])\n respond_with @search\n end",
"title": ""
},
{
"docid": "6f5e1487e0a479908ba79d032cd4baa5",
"score": "0.66688097",
"text": "def index\n @searches = Search.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searches }\n end\n end",
"title": ""
},
{
"docid": "6f5e1487e0a479908ba79d032cd4baa5",
"score": "0.66688097",
"text": "def index\n @searches = Search.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searches }\n end\n end",
"title": ""
},
{
"docid": "6f5e1487e0a479908ba79d032cd4baa5",
"score": "0.66688097",
"text": "def index\n @searches = Search.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searches }\n end\n end",
"title": ""
},
{
"docid": "c16895dd3f6846c92b3359e86dc7b6ef",
"score": "0.66532016",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search succsessful' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :index }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77bb1e69a926bef73888ba0e173857ed",
"score": "0.6630432",
"text": "def create\n Search.create\n @search = Search.new(search_params)\n respond_to do |format|\n if @search.save\n @results = search(@search.term, @search.location)\n if @results == nil\n format.html { render :new, notice: 'No options available with particular request' }\n format.json { redirect_to :new, notice: 'No options available with particular request' }\n else\n format.html { redirect_to @search, notice: '' }\n format.json { render :show, status: :created, location: @search }\n end\n else\n format.html { render :new }\n format.json { redirect_to :new, notice: 'No options available with particular request' }\n end\n end\n end",
"title": ""
},
{
"docid": "bcff8483a80ab458412e430abe33bd0b",
"score": "0.6615934",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, :notice => 'Search was successfully created.' }\n format.json { render :json => @search, :status => :created, :location => @search }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @search.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1797ff4a272170395dcf03350b726063",
"score": "0.66150004",
"text": "def index\n @searches = Search.all\n\n respond_to do |format|\n format.html \n format.json { render json: @searches }\n end\n end",
"title": ""
},
{
"docid": "66df7973fc915243a099ff058eba283b",
"score": "0.66087157",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f757e4a6c501bb78499d196edc661ea",
"score": "0.65900815",
"text": "def index\n @searches = Search.new\n end",
"title": ""
},
{
"docid": "981a35ba595e60554f317bda91de6456",
"score": "0.65802395",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search}\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cddecb64e1591691a44a67b72c1df13",
"score": "0.657208",
"text": "def search_document()\n request = Net::HTTP::Post.new(@uri.request_uri, initheader = {'Content-Type' =>'application/json', 'charset'=>'utf-8'})\n begin\n request.body = @search\n res = get_respons(request)\n JSON.parse(res.body)\n rescue => ex\n p(ex.message)\n end\nend",
"title": ""
},
{
"docid": "f35e4882e1e2e9f0954ccfb0c7fab50f",
"score": "0.6567824",
"text": "def create\n @search = Search.new(searches_params)\n\n if @search.save\n render :show\n end\n end",
"title": ""
},
{
"docid": "a463d933e9db7ef7b4af190c72f6d781",
"score": "0.6556189",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a463d933e9db7ef7b4af190c72f6d781",
"score": "0.6556189",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a463d933e9db7ef7b4af190c72f6d781",
"score": "0.6556189",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a463d933e9db7ef7b4af190c72f6d781",
"score": "0.6556189",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "752e546225fce80c52162a689183684f",
"score": "0.65506697",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "752e546225fce80c52162a689183684f",
"score": "0.65506697",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "752e546225fce80c52162a689183684f",
"score": "0.65506697",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "752e546225fce80c52162a689183684f",
"score": "0.65506697",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "752e546225fce80c52162a689183684f",
"score": "0.65506697",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "752e546225fce80c52162a689183684f",
"score": "0.65506697",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0394c33ebe7f4563cee455cd4de69c96",
"score": "0.6515494",
"text": "def create\n @saved_search = SavedSearch.new(saved_search_params)\n @saved_search.user_id = current_user.id\n respond_to do |format|\n if @saved_search.save\n format.json { render json: {saved_search: @saved_search}, status: :ok }\n else\n format.json { render json: @saved_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d34018779c77d6fd090d194c045ffc41",
"score": "0.6498937",
"text": "def create\n @search = Search.new(search_params)\n @providers = search_providers\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4741f2515c6133fa454db211f988f87",
"score": "0.64906913",
"text": "def json_POST_search(request)\n options = search_options(request)\n data = request.env['rack.input'].read\n JSON.parse(data).map do |topic, lat, lon|\n t = Time.now\n results = search(input, lat, lon, options).to_hash\n results[:time] = Time.now - t\n results\n end.to_json\n end",
"title": ""
},
{
"docid": "d6f741b9cb03e323aba13883caff11e9",
"score": "0.64539313",
"text": "def create\n if (@search = current_session.searches.where(query: params[:query]).first_or_create).empty?\n begin\n documents = Twitter.search(params[:query], count: 100, lang: :en, include_entities: true).statuses\n rescue Twitter::Error => error\n raise Error, \"unable to contact Twitter (#{$!})\", $!.backtrace\n end\n \n # set up clusterer\n clusterer = Clustering::HAC.new(documents, measure: :intersection_size)\n \n # create results from the clusters\n clusterer.cluster!.sort[0..9].each_with_index do |cluster, position|\n begin\n @search.results.create!(\n source_engine: clusterer.class, url: cluster.url,\n position: position, media_urls: cluster.media_urls,\n time_delta: cluster.time_delta\n )\n rescue Exception => e\n logger.info e\n next # skip if fails validations\n end\n end\n end\n \n respond_with @search, template: 'search/results'\n end",
"title": ""
},
{
"docid": "daa214dc435952ee4f051e79097d9d13",
"score": "0.6447311",
"text": "def search(data)\n resource_uri = \"#{@resource_uri}/search\"\n return @client.post(resource_uri, data)\n end",
"title": ""
},
{
"docid": "f80b6d6b751c733f857e67ff204bae76",
"score": "0.6429915",
"text": "def search\n \t@results = Result.all\n @search = Search.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { rrender :action => \"results\" }\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": "34e936759bcade74e1f474579950fe27",
"score": "0.64173424",
"text": "def log_search\n if params[:query].present? && params[:page].present?\n @session.searches.create(query: params[:query], page: params[:page])\n head :ok\n else\n head :bad_request\n end\n end",
"title": ""
},
{
"docid": "e629b7e6a6ba5f06f08bf9ca07beec19",
"score": "0.639012",
"text": "def create\n @search = Search.new(params[:search])\n \n # for POSTs directed from program_browse (subject) page\n @search.subjects = [] << SUBJECTSHASH[params[:subject]] unless params[:subject].nil?\n \n # for POSTs directed from places_browse (map) page\n @search.regions = [] << params[:location] unless params[:location].nil?\n\n # join all parameters into one string to save to database\n @search.regions = @search.regions.join(\"; \") unless (@search.regions.class.name == \"String\" || @search.regions.nil?)\n @search.subjects = @search.subjects.join(\"; \") unless (@search.subjects.class.name == \"String\" || @search.subjects.nil?)\n @search.sizes = @search.sizes.join(\"; \") unless (@search.sizes.class.name == \"String\" || @search.sizes.nil?)\n\n # set params if nil\n @search.length_min_param ||= \"weeks\"\n @search.length_max_param ||= \"years\"\n @search.length_min_number ||= 0\n @search.length_max_number ||= 2\n @search.price_min ||= 0\n @search.price_max ||= 99999\n\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8276c24afb8fcafa38802040bcc3d6d0",
"score": "0.63606304",
"text": "def search\n http = Net::HTTP.new(uri.host, uri.port)\n http.read_timeout = 5000\n request = Net::HTTP::Post.new(uri.request_uri)\n request.set_form_data(@search_params)\n @response = http.request(request)\n end",
"title": ""
},
{
"docid": "8a02a76b4ac0ad6038ebd47ce4a703b9",
"score": "0.63529027",
"text": "def create\n search_term = search_params[\"searched_name\"]\n search_artist(search_term)\n\n # @search = Search.new(search_params)\n\n # respond_to do |format|\n # if @search.save\n # format.html { redirect_to @search, notice: 'Search was successfully created.' }\n # format.json { render :show, status: :created, location: @search }\n # else\n # format.html { render :new }\n # format.json { render json: @search.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "c01d3bd2e55ca737374c096b78c50e68",
"score": "0.634711",
"text": "def index\n @search = Search.new\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "37aec0948db2d9d1a553548d27ea2d58",
"score": "0.63452625",
"text": "def index\n @searches = Search.all\n end",
"title": ""
},
{
"docid": "de21b35e36f1c3eb7a6bed5043d272dd",
"score": "0.63395053",
"text": "def create\n @search = current_user.searches.build(search_params)\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"title": ""
},
{
"docid": "c75ae5b98f60e32e21e53d4ec64e46e3",
"score": "0.63329494",
"text": "def search\n query = Query.where(text: params[:query].downcase).first_or_initialize\n if query.save\n broadcast_queries\n return render json: query\n end\n end",
"title": ""
},
{
"docid": "1bedb55403f8fa2773eb6dd264131906",
"score": "0.6286014",
"text": "def saved_search_create(query, options={})\n response = post('saved_searches/create', options.merge(:query => query))\n format.to_s.downcase == 'xml' ? response['saved_search'] : response\n end",
"title": ""
},
{
"docid": "7b7abc73acbba739fad353f0b0bd6f7a",
"score": "0.62717664",
"text": "def create\n @search = Search.new(params[:search])\n\n respond_to do |format|\n if @saved_search.save\n format.html { redirect_to(:back) }\n else\n format.html { redirect_to(:back) }\n end\n end\n end",
"title": ""
},
{
"docid": "960ce4bcd44bad7c9fa46a0173303524",
"score": "0.62636864",
"text": "def create\n @search = Search.new(params[:search]) #query string\n @search.save\n redirect_to @search\n end",
"title": ""
},
{
"docid": "3ded61418100ad5d126bc749ffee0247",
"score": "0.6261041",
"text": "def index\n # @searches = Search.all\n end",
"title": ""
},
{
"docid": "7906c81fede435782b2a43f0b0ee3f7a",
"score": "0.6257668",
"text": "def search\n self.class.post('/_search').parsed_response\n self.class.post('/_search').response.code\n end",
"title": ""
},
{
"docid": "999fdd60e4ac29099dd03f3dc5e2d955",
"score": "0.6256356",
"text": "def create\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n #format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.html { redirect_to @search }\n format.json { render action: 'edit', status: :created, location: @search }\n else\n format.html { render action: 'new' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e68bd1760fadc1dede791e43f3f8ee77",
"score": "0.6249332",
"text": "def create\n\n #check if user signs in or not\n @search = nil\n @user = User.find(1) if User.count > 0\n if current_user.nil?\n @search = Search.create(search_params)\n #all the public search without signing in will be marked with user_id equals to 1\n if @user.nil?\n @user = User.new(user_name:\"admin\",email:\"admin@newbie.com\",encrypted_password:\"012340\", password:\"012340\")\n @user.id = 1\n @user.save!\n end\n @search = @user.searches.create(search_params)\n #@search.user_id = 0\n else\n @user = current_user\n @search = @user.searches.create(search_params)\n p @search\n end\n\n # GET SCORE FOR THIS SEARCH\n results = get_results(@search.text)\n @search.score = results[\"final_score\"]\n @urls = results[\"urls\"]\n # results[\"matching_ids\"]\n\n #for testing, default score value 66\n #@search.score = 100 if @search.score.nil?\n\n respond_to do |format|\n if @search.save\n #format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.html { redirect_to \"/searches/#{@search.id}\", notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ddd5f2d666a79238dc58b117fdc359b1",
"score": "0.62344825",
"text": "def save_incomplete_searches\n if params[:term].present?\n search = Search.new(term: params[:term])\n search.save\n\n #this could be a separated service/app so we could have space for horizontal scale.\n #this is only a optional return that we could use if this project had real articles,\n #something that could make easier for the user find what he is searching for.\n search_result = [\"Just a Sample Article\", \"Another Sample Article\"]\n end\n\n render json: search_result\n end",
"title": ""
},
{
"docid": "db769adc9e0fad89d456230797ac3dcf",
"score": "0.62202865",
"text": "def index\n raise QueryParamError, \"q param is required to perform a search\" if params[:q].blank?\n\n jsonator perform_search(params[:q], build_opts_from(params))\n end",
"title": ""
},
{
"docid": "6757469707c1998f9416380431932280",
"score": "0.6219034",
"text": "def create\n\t @search = Search.create!(params[:search])\n\t redirect_to @search\n \tend",
"title": ""
},
{
"docid": "0fcfcec5f84db7ddef4a2cd12acf3185",
"score": "0.62169623",
"text": "def create\n params[:search][:query].strip!\n params[:search][:category].strip!\n \n @search = Search.find_or_create_by_query_and_category(params[:search][:query], params[:search][:category])\n \n respond_to do |format|\n if @search.search\n # format.html { redirect_to @search, notice: 'Search was successfully created.' }\n # format.json { render json: @search, status: :created, location: @search }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5dbbaf7d47fd4160cc191db58b48d13",
"score": "0.62054",
"text": "def search\n redirect_to get_create_search_index_url(:key => 'keyword', :value => params[:q], :new => true)\n end",
"title": ""
},
{
"docid": "16f1dc33ae2cbfdcdc2565688932d417",
"score": "0.6200099",
"text": "def search\n result = Event.search query: { match: { 'keywords' => params[:q] } }\n\n render json: result\n end",
"title": ""
},
{
"docid": "cadca27ba125ce082707340f2866bcec",
"score": "0.6188128",
"text": "def create\n \t\tsearchterm = current_user.searches.new(:search_term=>params[:searchterm],:type=>\"graph\")\n \t\t# check condition for searchterm is saved or not.\n if searchterm.save\n # response to the JSON\n render json: { success: true,message: \"Search Term Successfully Created.\", response: searchterm.as_json },:status=>200\n else\n render :json=> { success: false, message: searchterm.errors },:status=> 203\n end\n \tend",
"title": ""
},
{
"docid": "43615a249560753ffbd2dd6144c2bede",
"score": "0.61658835",
"text": "def create\n @search = Search.new(params[:search])\n session[:keyword] = params[:search][:keyword]\n\n respond_to do |format|\n if @search.save\n session[:search_id] = Search.last.id\n format.html { redirect_to results_path, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "771d56ec1caf49ae7e6809b2198e213f",
"score": "0.6163846",
"text": "def create\n @site_search = SiteSearch.new(params[:site_search])\n\n respond_to do |format|\n if @site_search.save\n format.html { redirect_to @site_search, notice: 'Site search was successfully created.' }\n format.json { render json: @site_search, status: :created, location: @site_search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e297c028f262831c9b45c8f54ba3993b",
"score": "0.61530346",
"text": "def index\n @posts = Post.search(search_params[:search]) || []\n @users = User.search(search_params[:search]) || []\n @stores = Store.search(search_params[:search]) || []\n\n render json: { posts: @posts, users: @users, stores: @stores }, status: :ok\n end",
"title": ""
},
{
"docid": "b89104d1dc836fb40353991056b8e1aa",
"score": "0.61505663",
"text": "def create\n @search = @participant.build_search(params[:search])\n @search.step = 1\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to new_search_path }\n # format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render \"searches/steps/step0\" }\n # format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c65ce9499702eec7e603d78230127e3f",
"score": "0.6147935",
"text": "def create\n \t\t@searchterm = current_user.searches.create(:search_term=>params[:searchterm],:type=>\"graph\")\n \tend",
"title": ""
},
{
"docid": "ffe7239d96ccf380c2db5bf509fec552",
"score": "0.6144999",
"text": "def create\n @searches = current_user.searches.all\n @search = current_user.searches.new(search_params)\n # @search.user = current_user\n respond_to do |format|\n if @search.save\n format.html\n format.js\n else\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "05bbe37e3d28a93274d01d085c705573",
"score": "0.6142862",
"text": "def create\n\n Search.last.try(:destroy)\n @search = Search.new(params[:search].try(:permit!))\n #raise StandardError\n respond_to do |format|\n\n if @search.save\n format.html { redirect_to searches_path }\n format.json { render action: 'show', status: :created, location: @search }\n else\n format.html { render action: 'new' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f6adec0997c4f34dbbe84bf5c4a40bf",
"score": "0.6141066",
"text": "def create \n @search = Search.create(search_params)\n redirect_to @search\n end",
"title": ""
},
{
"docid": "aa3a83e22b8b9d5250dca47ec6e64509",
"score": "0.6129963",
"text": "def index\n @saved_searches = current_user.saved_searches\n respond_to do |format|\n format.json { render json: {saved_searches: @saved_searches}, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "782a39b2b78602e08ac47f47500d8856",
"score": "0.61198705",
"text": "def create\n @search = Search.create(search_params)\n redirect_to @search\n\n end",
"title": ""
},
{
"docid": "0ab57dbd60bf84f34d347bf42712dc8d",
"score": "0.6110768",
"text": "def create\n\n user = current_user\n user ||= User.new_guest\n\n @url = params[\"search\"][\"query_url\"]\n\n # links search to user account\n @search = Search.find_or_initialize_by(query_url: @url)\n\n # update attributes\n @search.update_attributes!(updated_at: Time.now)\n\n @search.users << user\n\n respond_to do |format|\n if @search.save!\n format.html { redirect_to submit_path :url => @url }\n else\n format.html { redirect_to submit_path :url => @url, notice: 'Search unable to be created!' }\n end\n end\n end",
"title": ""
},
{
"docid": "481fe21a722ce0d9d175c4064650814c",
"score": "0.6101494",
"text": "def all\n @searches = Search.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searches }\n end\n end",
"title": ""
},
{
"docid": "93ff83582ba6b422b005c415e0202bbc",
"score": "0.6096377",
"text": "def create\n @search_query = SearchQuery.new(search_query_params)\n\n respond_to do |format|\n if @search_query.save\n format.html { redirect_to @search_query, notice: 'Search query was successfully created.' }\n format.json { render :show, status: :created, location: @search_query }\n else\n format.html { render :new }\n format.json { render json: @search_query.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "329132df3d15d45f2d87c394da2a8507",
"score": "0.60961556",
"text": "def create\n @search = Search.new(params[:search])\n session[:search_id] = params[:search][:id]\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bda631b2aef711ba6748e081d239bca",
"score": "0.60888344",
"text": "def search_index(title, ingredients)\n JSON.parse(Typhoeus::Request.post(\n api_url('search_index'),\n :headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},\n :params => {:key => Punchr.api_key, :title => title, :ingredients => ingredients}\n ).body)\n end",
"title": ""
},
{
"docid": "9e3e4b6d09d5db6841a0128cb6041948",
"score": "0.60798395",
"text": "def index\n @researches = Research.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @researches }\n end\n end",
"title": ""
},
{
"docid": "d338827ea038cfa14f8bed6ddac91cac",
"score": "0.6056569",
"text": "def create\n \t\tsearchterm = current_user.searches.new(:search_term=>params[:searchterm],:type=>\"question\")\n \t\t# check condition for searchterm is saved or not.\n if searchterm.save\n # response to the JSON\n \trender json: { success: true,message: \"Search Term Successfully Created.\", response: searchterm.as_json('search') },:status=>200\n else\n render :json=> { success: false, message: searchterm.errors },:status=> 203\n end\n \tend",
"title": ""
},
{
"docid": "7a056b944430c7958c59d377ebaddc09",
"score": "0.605072",
"text": "def search\n search_query = params[:q]\n # TODO: search comments here\n # This is a collection route, so:\n # - we don't need a resource id\n # - we should return a collection\n head :ok # just return 200 OK without rendering nothing\n end",
"title": ""
},
{
"docid": "24e1c00d6ec1f11d60e968472471e89a",
"score": "0.60497767",
"text": "def create\n @search = Search.new(params[:search])\n if @search.valid?\n\n # Build the custom parameters hash and don't clutter the url with empty params.\n temp = {}\n temp.merge!(:taxon => params[\"search\"][\"taxon_id\"]) if !params[\"search\"][\"taxon_id\"].empty?\n temp.merge!(:subtaxons => params[\"search\"][\"subtaxons\"]) if params[\"search\"][\"subtaxons\"] == \"1\"\n temp.merge!(:min_price => params[\"search\"][\"min_price\"]) if !params[\"search\"][\"min_price\"].empty?\n temp.merge!(:max_price => params[\"search\"][\"max_price\"]) if !params[\"search\"][\"max_price\"].empty?\n temp.merge!(:keywords => params[\"search\"][\"keywords\"]) if !params[\"search\"][\"keywords\"].empty?\n temp.merge!(:sort => params[\"sort_type\"]) if !params[\"sort_type\"].nil?\n redirect_to temp.merge(:action => 'show')\n else\n render :action => 'new'\n end\n end",
"title": ""
},
{
"docid": "a52ac0ed2a6a84837c86e13ae52d857d",
"score": "0.60491085",
"text": "def index\n #@searches = Search.all\n\n end",
"title": ""
},
{
"docid": "ac44d3667ad6d76391dd79153a367101",
"score": "0.60398734",
"text": "def search\n\n @posts = Post.search do\n keywords params[:query]\n end.results\n\n respond_to do |format|\n format.html { render :action => \"index\" }\n format.xml { render :xml => @posts }\n end\nend",
"title": ""
},
{
"docid": "8d5a942a3df90500347ddd53c41de90b",
"score": "0.60339093",
"text": "def create\n @search = Search.find_or_initialize_by(search_params) # will cache search results on after_create\n\n respond_to do |format|\n if @search.save\n format.html { redirect_to @search }\n # format.json { render action: 'show', status: :created, location: @search }\n else\n format.html { redirect_to root_url(anchor: 'search'), alert: @search.errors }\n # format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "977cd6c98418822cf3ffc62b74f9464a",
"score": "0.6030767",
"text": "def index\n @posts = Post.search params[:search]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end",
"title": ""
},
{
"docid": "aa335a703924dcc720474bbe236ada7b",
"score": "0.6026269",
"text": "def create\n \n @search = Search.find_by(search_params)\n \n if @search\n redirect_to search_url(@search)\n else\n @search = Search.new(search_params)\n\n respond_to do |format|\n if @search.save\n if current_user\n SavedSearch.create(user_id: current_user.id, search_id: @search.id)\n end\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render action: 'show', status: :created, location: @search }\n else\n format.html { render action: 'new' }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1bcde32ef30182dcd8b35bd1cfec1874",
"score": "0.59958273",
"text": "def search\n\t\t#sleep(10)\n\t\tputs \"params are:\"\n\t\tputs params.to_s\n\t\tputs \"permitted params are:\"\n\t\tputs permitted_params\n\t\tcontext = permitted_params[:context]\n\t\t## this is the whole text.\n\t\tquery = permitted_params[:query]\n\t\tinformation = permitted_params[:information]\n\t\t## suggest query is the last word of the query.\n\t\t## so it is possible, that we want the whole query also to be sent.\n\t\tsuggest_query = permitted_params[:suggest_query]\n\t\tlast_successfull_query = permitted_params[:last_successfull_query]\n\t\tresults = nil\n\n\t\tdirection = permitted_params[:direction]\n\n\t\tif information \n\t\t\tresults = Result.information({:information => information})\n\t\telse\n\t\t\t# so the prefix is either the suggest_query, or the whole_Query.\n\t\t\tresults = Result.debug_suggest_r({:prefix => (suggest_query || query), :whole_query => query, :context => context, :last_successfull_query => last_successfull_query, :basic_query => params[:basic_query], :direction => direction})\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.json do \n\t\t\t\t#puts \"came to render json\"\n\t\t\t\trender :json => {results: results, status: 200}\n\t\t\tend\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "a5d36f5437cc21290fbcce0a035ec706",
"score": "0.5990889",
"text": "def create\n \n \n \n \n @search = Search.new(params[:search])\n if !(params[:subject].nil?)\n @search.subjects = [] << SUBJECTSHASH[params[:subject]]\n end\n if !(params[:location].nil?)\n @search.regions = [] << params[:location]\n end\n \n \n @search.regions = @search.regions.join(\"; \") unless (@search.regions.class.name == \"String\" || @search.regions.nil?)\n @search.subjects = @search.subjects.join(\"; \") unless (@search.subjects.class.name == \"String\" || @search.subjects.nil?)\n @search.sizes = @search.sizes.join(\"; \") unless (@search.sizes.class.name == \"String\" || @search.sizes.nil?)\n\n if @search.length_min_param.nil?\n @search.length_min_param = \"weeks\"\n end\n if @search.length_max_param.nil?\n @search.length_max_param = \"years\"\n end\n if @search.length_min_number.nil?\n @search.length_min_number = 0\n end\n if @search.length_max_number.nil?\n @search.length_max_number = 2\n end\n if @search.price_min.nil?\n @search.price_min = 0\n end\n if @search.price_max.nil?\n @search.price_max = 99999\n end\n \n respond_to do |format|\n if @search.save\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render json: @search, status: :created, location: @search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d640b285285acc5079741453ab4045bc",
"score": "0.59881675",
"text": "def create\n @search = Search.new(search_params)\n\n begin\n data_acquisition\n\n respond_to do |format|\n if @search.save!\n format.html { redirect_to @search, notice: 'Search was successfully created.' }\n format.json { render :show, status: :created, location: @search }\n else\n format.html { render :new }\n format.json { render json: @search.errors, status: :unprocessable_entity }\n end\n end\n rescue => e\n flash[:notice] = e\n puts e\n redirect_to(new_search_path)\n end\n end",
"title": ""
},
{
"docid": "5431bad1b9558d83ee7b7e271d5b1ba3",
"score": "0.5983521",
"text": "def create\n @search_results = Search.search(params[:labelname])\n redirect_to(search_path(@search_results))\n end",
"title": ""
},
{
"docid": "17313c012834165b5c4e5223060f2312",
"score": "0.5979229",
"text": "def create\n has_missing_elements = params[:name].blank? || \n (params[:query].blank? && params[:all_scopes].nil?) || \n ![ true, false ].include?(params[:all_scopes])\n \n if has_missing_elements\n respond_to do |format|\n format.html { disable_action }\n # TODO: implement format.xml { render :xml => '', :status => 406 }\n format.json { error_to_back_or_home(\"Please provide a valid search definition\", false, 406) } \n end\n else\n @saved_search = SavedSearch.new\n \n if @saved_search.submit(params.merge(:user_id => current_user.id))\n respond_to do |format|\n format.html { disable_action }\n # TODO: implement format.xml { render :xml => @saved_search, :status => :created, :location => @saved_search }\n format.json { \n render :json => { \n :success => { \n :message => \"The search '#{@saved_search.name}' has been successfully saved.\", \n :resource => saved_search_url(@saved_search)\n }\n }.to_json, :status => 201\n }\n end\n else # submission failed\n respond_to do |format|\n format.html { disable_action }\n # TODO: implement format.xml { render :xml => '', :status => 500 }\n format.json { \n error_list = []\n @saved_search.errors.to_a.each { |e| error_list << e[1] } \n error_to_back_or_home(error_list, false, 500)\n }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c9e86a8067c11f18901578fd61cb43bb",
"score": "0.597762",
"text": "def saved_search_create(query, options={})\n saved_search = post(\"/1/saved_searches/create.json\", options.merge(:query => query))\n Twitter::SavedSearch.new(saved_search)\n end",
"title": ""
},
{
"docid": "efe6eaa9fcdb1afa3a95fc8c944663fe",
"score": "0.5976962",
"text": "def create\n @motor_search = Motor::Search.new(params[:motor_motor_search])\n\n respond_to do |format|\n if @motor_search.save\n format.html { redirect_to @motor_search, notice: 'Motor search was successfully created.' }\n format.json { render json: @motor_search, status: :created, location: @motor_search }\n else\n format.html { render action: \"new\" }\n format.json { render json: @motor_search.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "506793ddae0b3b4572a33b861f36f47c",
"score": "0.59763134",
"text": "def search\n @tags = Tag.all #:q\n \n respond_to do |format|\n format.html # search.html.erb\n format.json { render json: tags }\n end\n end",
"title": ""
},
{
"docid": "54ed67e78dab652e0770ca3b329b7766",
"score": "0.59750617",
"text": "def search\n @results = searchPlace(params[:q])\n respond_to do |format|\n format.html\n format.json { render json: @results[0] }\n end\n end",
"title": ""
},
{
"docid": "a1975e0d8ebba83ffd9d5d40a5fa6c71",
"score": "0.5972488",
"text": "def create\n @search = Search.new(params[:search])\n if @search.valid?\n\n # Build the custom parameters hash and don't clutter the url with empty params.\n temp = {}\n temp.merge!(:taxon => params[\"search\"][\"taxon_id\"]) if !params[\"search\"][\"taxon_id\"].empty?\n temp.merge!(:subtaxons => params[\"search\"][\"subtaxons\"]) if params[\"search\"][\"subtaxons\"] == \"1\"\n temp.merge!(:min_price => params[\"search\"][\"min_price\"]) if !params[\"search\"][\"min_price\"].empty?\n temp.merge!(:max_price => params[\"search\"][\"max_price\"]) if !params[\"search\"][\"max_price\"].empty?\n temp.merge!(:keywords => params[\"search\"][\"keywords\"]) if !params[\"search\"][\"keywords\"].empty?\n\n redirect_to temp.merge(:action => 'show')\n else\n render :action => 'new'\n end\n end",
"title": ""
},
{
"docid": "e551b303dc12f31886a6ed4e169db799",
"score": "0.5966764",
"text": "def index\n @search = Search.new\n @searches = action_state.searches\n end",
"title": ""
}
] |
55d603364fc32b3c88031c07fff9ab6b
|
DELETE /user_interests/1 DELETE /user_interests/1.json
|
[
{
"docid": "582fd901bc58c093da37fe486135243e",
"score": "0.78206766",
"text": "def destroy\n @user_interest.destroy\n respond_to do |format|\n format.html { redirect_to user_interests_url, notice: 'User interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "dc39fd0fcc1e21da2a26fd0884ac43fb",
"score": "0.82381713",
"text": "def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n \n if @user_interest.save\n render json: {\n status: 200,\n message: \"Successfully deleted user interest\",\n user_interests: @user_interest\n }.to_json\n else\n render json: {\n status: 500,\n message: \"Couldn't delete user interest.\",\n errors: @user_interest.errors\n }.to_json\n end\n end",
"title": ""
},
{
"docid": "5a3b28297ec01d83fc25ebc33f8600aa",
"score": "0.77141714",
"text": "def remove_interest\n @interest = Interest.where(\"user_id = ? and property_id= ?\",params[:user_id],params[:property_id])\n @interest.first.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2d1e85f43924a06f7618ff90a3ee17dc",
"score": "0.75651866",
"text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end \n end",
"title": ""
},
{
"docid": "47ad0cbdd1227e2b3d90866f2697d2ab",
"score": "0.75215346",
"text": "def destroy\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "891e0eaadafeef249fd3068ec90f38e8",
"score": "0.7494549",
"text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "094cd239c9b5b5c2473296a9116cf281",
"score": "0.7478659",
"text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38afa3eb0acee67ff252328f52819b62",
"score": "0.739025",
"text": "def deleteInterest(interest)\n \n end",
"title": ""
},
{
"docid": "38afa3eb0acee67ff252328f52819b62",
"score": "0.739025",
"text": "def deleteInterest(interest)\n \n end",
"title": ""
},
{
"docid": "3a856a3abea98819accb1bd163a9cc78",
"score": "0.7322573",
"text": "def destroy\n authorize @interest\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: t('flash.notice.destroied.') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "205034f9d75848b118c63349c96df1b0",
"score": "0.72696763",
"text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "205034f9d75848b118c63349c96df1b0",
"score": "0.72696763",
"text": "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e3c08d119f86c6e6fa62cfc15694ff7",
"score": "0.72190297",
"text": "def destroy\n @person_interest = PersonInterest.find(params[:id])\n @person_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to person_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7fe3e5141f16fe1c75c6d13e6e2c641",
"score": "0.71185344",
"text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "427080b3bd161df639c295ed783c3336",
"score": "0.7013864",
"text": "def destroy\n @interested_user = InterestedUser.find(params[:id])\n @interested_user.destroy\n\n respond_to do |format|\n format.html { redirect_to interested_users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1568c33e62b40bdfca008fe5c816cb0",
"score": "0.6986424",
"text": "def destroy\n @users_interests_link.destroy\n respond_to do |format|\n format.html { redirect_to users_interests_links_url, notice: 'Users interests link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "083fddde852407bc5a42f531a6d5818a",
"score": "0.6973418",
"text": "def destroy\n @student_interest.destroy\n respond_to do |format|\n format.html { redirect_to student_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4735930162946b6b5d4c1e773583e3a",
"score": "0.6949236",
"text": "def destroy\n @interests = Interests.find(params[:id])\n @interests.destroy\n flash[:notice] = 'Interests was successfully removed.'\n\n respond_to do |format|\n format.html { redirect_to(interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6d137c7c1465ef2cc5b71bff3b1833f8",
"score": "0.6893673",
"text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n redirect_to interests_path\n end",
"title": ""
},
{
"docid": "f3b6627d9f18812a84df79a08d9d4ab1",
"score": "0.688916",
"text": "def destroy\n @event_interest = EventInterest.find(params[:id])\n @event_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to event_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8d8af73f149a9ce7639d3f675c44350",
"score": "0.6824658",
"text": "def destroy\n @monthly_interest = MonthlyInterest.find(params[:id])\n @monthly_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to monthly_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8dfda1170918a31c23c6e683ae245965",
"score": "0.67654705",
"text": "def destroy\n @interesting = Interesting.find(params[:id])\n @interesting.destroy\n\n respond_to do |format|\n format.html { redirect_to interestings_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9aefc0c99a93b425ff141b22be9f49f9",
"score": "0.667585",
"text": "def destroy\n @interest_point.destroy\n respond_to do |format|\n format.html { redirect_to interest_points_url, notice: 'Interest point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "feb19bf13c5a49adeb60bc3c7791e458",
"score": "0.6673659",
"text": "def destroy\n @api_v1_mentorship_interest.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentorship_interests_url, notice: 'Mentorship interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee01f25fd611a76715dca8788f49a39c",
"score": "0.66576165",
"text": "def destroy\n @brochure_interest = BrochureInterest.find(params[:id])\n @brochure_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(brochure_interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aa06b296ed582c6dca8c8ab7d99ce1eb",
"score": "0.6657217",
"text": "def destroy\n user_interest = UserInterest.find(params[:id])\n @content = Content.find(user_interest.content_id)\n authorize user_interest\n if user_interest.status == 'Interested' && user_interest.recommendation.nil?\n user_interest.destroy\n elsif user_interest.recommendation.present? && user_interest.status != 'Completed'\n user_interest.update(status: nil)\n end\n if params[:redirect_from] == 'user_show'\n @redirect_from = params[:redirect_from]\n @user = current_user\n end\n respond_to do |format|\n format.html {redirect_to catalogue_path}\n format.js\n end\n end",
"title": ""
},
{
"docid": "3a62917dbdaf1b0fd1ceaf5377dc4eaf",
"score": "0.65810555",
"text": "def destroy\n @brochure_interest = BrochureInterest.find(params[:id])\n @brochure_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_brochure_interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0231fdc00e33793612baf10723add94c",
"score": "0.65360045",
"text": "def destroy\n @eventinterest.destroy\n respond_to do |format|\n format.html { redirect_to eventinterests_url, notice: 'Eventinterest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f74a32c6fdb67babd4a903e37b5baa4",
"score": "0.64503336",
"text": "def delete\n render json: User.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "5ed985747bd4b369ca2ba1c4c567426c",
"score": "0.6448433",
"text": "def destroy\n @interest_group.destroy\n respond_to do |format|\n format.html { redirect_to interest_groups_url, notice: 'Interest group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8e69eb3ff3374e0db6fa9eb17958df65",
"score": "0.6441767",
"text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "7d4211eb95b15fc1c73bdfe4b979b654",
"score": "0.6441358",
"text": "def destroy\n @interest_area = InterestArea.find(params[:id])\n @interest_area.destroy\n\n respond_to do |format|\n format.html { redirect_to interest_areas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "429fb9f07581f04af61e921081743228",
"score": "0.6423282",
"text": "def destroy\n @exam_user = ExamUser.find(params[:id])\n @exam_user.destroy\n\n respond_to do |format|\n format.html { redirect_to exam_users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d180e2e27b56d809e1c87ec19e360ab8",
"score": "0.6417056",
"text": "def destroy\n @userin = UserInvestor.find(params[:id])\n if @userin.destroy\n render json: { status: 'OK', results: 'user investor has been deleted',\n errors: nil }, status: :ok\n else\n render json: { status: 'FAIL', results: nil,\n errors: 'user failed to delete' },\n status: :unprocesable_entity\n end\n end",
"title": ""
},
{
"docid": "0397dbc59b71cff99b2821a4d7641ed0",
"score": "0.640054",
"text": "def destroy\n @interested = Interested.find(params[:id])\n @interested.destroy\n\n respond_to do |format|\n format.html { redirect_to interesteds_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f404cdf07a96168e496267e50974db3a",
"score": "0.63868874",
"text": "def destroy\n @followup_interview = FollowupInterview.find(params[:id])\n @followup_interview.destroy\n\n respond_to do |format|\n format.html { redirect_to followup_interviews_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5eb5282d2177bcf20cb56bd714bc0688",
"score": "0.63691854",
"text": "def destroy\n @tour_interest_list.destroy\n respond_to do |format|\n format.html { redirect_to tour_interest_lists_url, notice: 'Tour interest list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c3c4376da9103020106dafec9ae284c4",
"score": "0.63612616",
"text": "def destroy\n @user = current_user\n @review_like = ReviewLike.find(params[:id]).delete\n render json: { msg: \"Delete Successful\" }\n end",
"title": ""
},
{
"docid": "55956a21503c1563899afaca579e8be6",
"score": "0.6341858",
"text": "def destroy\n @user_biography = UserBiography.find(params[:id])\n @user_biography.destroy\n\n respond_to do |format|\n format.html { redirect_to user_biographies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9726e5906847e86574cbf497f2ac9759",
"score": "0.63397616",
"text": "def delete(user)\n Rails.logger.debug \"Call to photo.delete\"\n if !self.file.blank?\n Util.delete_image(self.file) #Delete the image file from the image server\n end\n reqUrl = \"/api/photo/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password'])#Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end",
"title": ""
},
{
"docid": "1f1673670ad57ef3249586bb44c34808",
"score": "0.6330497",
"text": "def destroy\n @media_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to media_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "004684b42dfd32f12251bde7d032ad01",
"score": "0.63115835",
"text": "def destroy\n @interest_on_housing_loan.destroy\n respond_to do |format|\n format.html { redirect_to interest_on_housing_loans_url, notice: 'Interest on housing loan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "835c46035f10a367f7e177a0a34f5992",
"score": "0.6300666",
"text": "def delete\n render json: Like.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "c3fb71b877fd552f8bc708a7bbcea3c9",
"score": "0.62846965",
"text": "def recipe_delete # /v1/user/:id/recipes/:recipe_id (DELETE)\n params[:recipes] = params[:recipe_id]\n recipes_delete\n end",
"title": ""
},
{
"docid": "d1f0a8e8c97a0438790f1ddeeecaca29",
"score": "0.62832385",
"text": "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"title": ""
},
{
"docid": "0622678a44992f97fd1378dbb14ff3d7",
"score": "0.6274412",
"text": "def destroy\n @point_of_interest = PointOfInterest.find(params[:id])\n @point_of_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(point_of_interests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.6271109",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "229aa12d7bfa619199779227cc5da77a",
"score": "0.6269673",
"text": "def destroy\n @interest_profiler.destroy\n respond_to do |format|\n format.html { redirect_to interest_profilers_url, notice: 'Interest profiler was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b278e378ecea6cb03cc5608e076f4335",
"score": "0.626758",
"text": "def destroy\n @user_study.destroy\n respond_to do |format|\n format.html { redirect_to user_studies_url, notice: 'User study was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6963349645aa3d9f1c8eabe1a77ce6a8",
"score": "0.6265876",
"text": "def destroy\n @user_responsibility.destroy\n respond_to do |format|\n format.html { redirect_to user_responsibilities_url, notice: \"User responsibility was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "182b74e57b258e74049d678c56055993",
"score": "0.6260086",
"text": "def destroy\n @institucional = Institucional.find(params[:id])\n @institucional.destroy\n\n respond_to do |format|\n format.html { redirect_to institucionals_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.62569934",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "814142ca535476589c199b9cf489c1df",
"score": "0.6255591",
"text": "def destroy\n @user_like = UserLike.find(params[:id])\n @user_like.destroy\n\n respond_to do |format|\n format.html { redirect_to user_likes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e88d3dc87e8555f1f82e059d8edb57b1",
"score": "0.6252488",
"text": "def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"title": ""
},
{
"docid": "f6e2c6242cca2701db367bdb54658dea",
"score": "0.62463075",
"text": "def destroy\n @postulate_area_interest.destroy\n respond_to do |format|\n format.html { redirect_to postulate_area_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d11c80964b0edc93b70b0292d33a39c",
"score": "0.6245934",
"text": "def destroy\n @interview = Interview.find(params[:id])\n @interview.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url, notice: \"Interview #{@interview.name} deleted\" }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d12c074733c8615e33479715bbd5e9c0",
"score": "0.6244799",
"text": "def destroy\n @inspiration = current_user.inspirations.find(params[:id])\n @inspiration.destroy\n\n respond_to do |format|\n format.html { redirect_to @inspiration.discussion }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2d5f14a74beaa2b0556d213fcb3f7a08",
"score": "0.62396055",
"text": "def destroy\n @project_area_interest.destroy\n respond_to do |format|\n format.html { redirect_to project_area_interests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "11ea59e4ce1803e67b3352fd2eaf9a0d",
"score": "0.62251294",
"text": "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6225115",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "8412d693fd475cb8f222f90b6a98bbae",
"score": "0.621429",
"text": "def delete\n render json: Users.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "02ff3ce385bb423f1e33ccf273507657",
"score": "0.6211737",
"text": "def user_management_delete_user id\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/users\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"id\" => id,\n \"client_id\" => @client_id,\n \"client_secret\" => @client_secret,\n }\n\n # validate and preprocess url\n query_url = APIHelper.clean_url query_builder\n\n # prepare headers\n headers = {\n \"user-agent\" => \"IAMDATA V1\",\n \"accept\" => \"application/json\"\n }\n\n # invoke the API call request to fetch the response\n response = Unirest.delete query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 404\n raise APIException.new \"Not found\", 404, response.raw_body\n elsif response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\n end\n\n response.body\n end",
"title": ""
},
{
"docid": "a334e3b90750816e6da685121d5574ba",
"score": "0.62081206",
"text": "def update\n # only the owner can edit his / her profile info\n if current_user.id == @user.id\n respond_to do |format|\n if @user.update(user_params)\n\n # update the user interests, too\n if params[:user_interests]\n\n param_interests = []\n\n # transform the params into integers so they can be compared to the ids\n params[:user_interests].each do |i|\n param_interests << i.to_i\n end\n\n # puts \"INTERESTS PARAMS = \" + param_interests.to_s + \"\\n\"\n\n # get current user_interests\n current_user_interest_ids = current_user.interests.pluck(:id)\n # puts \"CURRENT INTERESTS = \" + current_user_interest_ids.to_s + \"\\n\"\n\n # the ids in params list that are not in current list need to be added\n interests_to_add = param_interests - current_user_interest_ids\n # puts \"INTERESTS TO ADD = \" + interests_to_add.to_s + \"\\n\"\n\n if interests_to_add.count > 0\n interests_to_add.each do |interest_id|\n UserInterest.create(user_id: current_user.id, interest_id: interest_id)\n end\n end\n\n # the ids in current list that are not in params list need to be deleted from user_interests\n interests_to_delete = current_user_interest_ids - param_interests\n # puts \"INTERESTS TO DELETE = \" + interests_to_delete.to_s + \"\\n\"\n\n if interests_to_delete.count > 0\n interests_to_delete.each do |interest_id|\n u = UserInterest.where(user_id: current_user.id, interest_id: interest_id)\n if u\n u.first.destroy\n end\n end\n end\n\n format.json { render :json => {:success=>true, :message=>\"User and user interests was successfully updated.\"} }\n else\n format.json { render :json => {:success=>true, :message=>\"User was successfully updated. No user interests detected.\"} }\n end # end of if params\n else\n format.json { render :json => {:success=>false, :message=>\"User could not be updated.\"} }\n end # end of if .update\n end # end of respond\n else\n respond_to do |format|\n format.json { render :json => {:success=>false, :message=>\"You are not the owner of this profile.\"} }\n end\n end\n end",
"title": ""
},
{
"docid": "9d3ab6c9bd31df88d4344f89801ff16c",
"score": "0.6206533",
"text": "def destroy\n @inspiration.destroy\n render json: @inspiration\n end",
"title": ""
},
{
"docid": "3a48a117f7dd0668e33413a4f35160e0",
"score": "0.62041426",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"title": ""
},
{
"docid": "3a48a117f7dd0668e33413a4f35160e0",
"score": "0.62041426",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"title": ""
},
{
"docid": "d4458b3cf6631b401f38da0412634b33",
"score": "0.6200567",
"text": "def delete_by_id(user_id)\n Iterable.request(conf, \"/users/byUserId/#{user_id}\").delete\n end",
"title": ""
},
{
"docid": "a3304f1e748028fa570b5ae2ba903bb8",
"score": "0.61982876",
"text": "def destroy\n @user.likes.each do |like|\n @contribution = like.contribution\n @contribution.points -= 1\n @contribution.save\n end\n @user.likes.destroy_all\n @user.contributions.destroy_all\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f12c61d0529fc24ee67bef7ce26dc58a",
"score": "0.6195536",
"text": "def destroy\n \t\t@interested = Interested.find(params[:id])\n \t\t@interested.destroy\n\n \t\trespond_to do |format|\n \t\t\tformat.html { redirect_to interested_url }\n \t\t\tformat.json {head :no_content }\n \t\tend\n \tend",
"title": ""
},
{
"docid": "6363f734840ef2265ee58cf8c07ab193",
"score": "0.6188223",
"text": "def destroy\n @instagram_user.destroy\n respond_to do |format|\n format.html { redirect_to instagram_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a4566f127997dc0eb3e04d5144d155d",
"score": "0.6183955",
"text": "def destroy\n standard_destroy(Interest, params[:id])\n #if Volunteer.joins(:volunteer_interests).where(volunteer_interests: {interest_id: @interest.id}).count > 0\n end",
"title": ""
},
{
"docid": "359d7d82e892b05609467e17e3a1a18c",
"score": "0.6181944",
"text": "def destroy\n @user_person = UserPerson.find(params[:id])\n @user_person.destroy\n\n respond_to do |format|\n format.html { redirect_to user_people_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ceb51f7ce3b398f21f3c8ed6397978a8",
"score": "0.61816144",
"text": "def destroy\n @user_figure = UserFigure.find(params[:id])\n @user_figure.destroy\n\n respond_to do |format|\n format.html { redirect_to user_figures_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bf42b70221760e3241fc7950c0291794",
"score": "0.6170544",
"text": "def destroy\n \"\"\"\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n \"\"\"\n end",
"title": ""
},
{
"docid": "4eb929ea0f2e8da438e5732152899038",
"score": "0.6170199",
"text": "def destroy\n @user_photo = UserPhoto.find(params[:id])\n @user_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to user_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "af6e6d733ff84831e5f7ce2c5c580ff6",
"score": "0.6169051",
"text": "def destroy\n @project_interest_point.destroy\n respond_to do |format|\n format.html { redirect_to project_interest_points_url, notice: 'Project interest point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57af95057e82ad119f93235fdfb02d87",
"score": "0.61661154",
"text": "def destroy\n @house_interest_list.destroy\n respond_to do |format|\n format.html {redirect_to house_interest_lists_url, notice: 'House interest list was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "142a7d7ae29c0160033799a26db1b450",
"score": "0.6161121",
"text": "def destroy\n tempid = @injury.user_id\n @injury.destroy\n respond_to do |format|\n format.html { redirect_to user_path(tempid), notice: 'Injury was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5afe9026a6587696b06b7f81fd2d6c99",
"score": "0.6154452",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7a5eea7c7a07ce3e7f95fa50802d596e",
"score": "0.6145921",
"text": "def delete path\n make_request(path, \"delete\", {})\n end",
"title": ""
},
{
"docid": "c0247d913d654198a94cbb1a286e840e",
"score": "0.6144381",
"text": "def destroy\n @user_detail = UserDetail.find(params[:id])\n @user_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to user_details_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "204412d5433670c6bec769246e1d24d4",
"score": "0.6140114",
"text": "def destroy\n @instathreat_user.destroy\n respond_to do |format|\n format.html { redirect_to instathreat_users_url, notice: 'Instathreat user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b6c129125e23295d37b7908d9c92b2fe",
"score": "0.61393213",
"text": "def destroy\n @recipe = current_user.recipes.find(params[:id])\n @recipe.destroy\n respond_to do |format|\n format.html { redirect_to recipes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "92545cfeee2b858202aa29373db53439",
"score": "0.6139044",
"text": "def destroy\n @user_follow_user = UserFollowUser.find(params[:id])\n @user_follow_user.destroy\n\n respond_to do |format|\n format.html { redirect_to user_follow_users_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "58d015f349f8e886e3ddd1964c5d3a83",
"score": "0.61349624",
"text": "def destroy\n @user = User.find(params[:user_id])\n @note = @user.notes.find(params[:id])\n @note.destroy\n respond_to do |format|\n format.html { redirect_to user_notes_path(@user) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31ef9cc207e679702a81dca08cbe8b02",
"score": "0.61337703",
"text": "def destroy\n @user = Meetup.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to meetups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f204c6d174121fd089bf4a2fd1c1f21",
"score": "0.6126422",
"text": "def destroy\n @user_quest = UserQuest.find(params[:id])\n @user_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_quests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c5b416c5d79ebfd606faa6d87a9906b3",
"score": "0.61230993",
"text": "def destroy\n @usertest = Usertest.find(params[:id])\n @usertest.destroy\n\n respond_to do |format|\n format.html { redirect_to usertests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a5fa70c332d8f1813b1ec3ba14adb40d",
"score": "0.61225665",
"text": "def destroy\n @user_id = UserId.find(params[:id])\n @user_id.destroy\n\n respond_to do |format|\n format.html { redirect_to user_ids_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "360426e2a850aac27731d4be1b66cf87",
"score": "0.6122463",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d37dcf3a50b858e9be7ee2f0ca59d8af",
"score": "0.6120105",
"text": "def destroy\n @admin_interview = Interview.find(params[:id])\n @admin_interview.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_interviews_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9552048f4df401d2441a4dce4f43eeca",
"score": "0.6111839",
"text": "def delete(path, data = {})\n self.class.delete path, :body => data.merge(:u => access_token)\n end",
"title": ""
},
{
"docid": "4518e1070d4de8fdd66956ce771943c3",
"score": "0.6108649",
"text": "def destroy\n @user_skill = UserSkill.find(params[:id])\n @user_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to user_skills_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2bebf8672354a10585810ef3bb0214ad",
"score": "0.61068815",
"text": "def destroy\n @sample_user.destroy\n respond_to do |format|\n format.html { redirect_to sample_users_url, notice: 'Sample user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4af71f6a3ab9087a98388b2696f6837",
"score": "0.61056346",
"text": "def destroy\n @wise = Wise.find(params[:id])\n @wise.destroy\n @user = User.find(@wise.user_id)\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to wises_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e0ec8e3e6eb0ebdb61769d54e582fa55",
"score": "0.6099584",
"text": "def destroy\n @user_photo.destroy\n respond_to do |format|\n format.html { redirect_to user_photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8105dfdcdda1962907168ac402ece543",
"score": "0.60990584",
"text": "def destroy\n @internships_user = InternshipsUser.find(params[:id])\n @internships_user.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e80575b6179809f2d1456618a2dee327",
"score": "0.6098653",
"text": "def destroy\n @smalluser = Smalluser.find(params[:id])\n @smalluser.destroy\n\n respond_to do |format|\n format.html { redirect_to smallusers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2b51eb37f9b31b1553f8b31f6def30ff",
"score": "0.6098312",
"text": "def destroy\n raise params.inspect\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9f699c2f96e0141230b9759ae372c13f",
"score": "0.609803",
"text": "def destroy\n @knowledge = current_user.knowledges.find(params[:id])\n @knowledge.destroy\n\n respond_to do |format|\n format.html { redirect_to knowledges_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f82c6f730c28180eaae084c53dd122f",
"score": "0.60974807",
"text": "def destroy\n @api_v1_follower = Api::V1::Follower.where('follower_id =? and user_id =?', @current_user.id, params[:id]).first\n if @api_v1_follower.destroy\n head :no_content\n else \n render json: { error: 'not allowed' }, status: 401\n end\n end",
"title": ""
}
] |
6ce4b378179b248a633638c66c634a73
|
Update the target field.
|
[
{
"docid": "734caeaf45617d3175c85e06285ec049",
"score": "0.0",
"text": "def update_field_value!(data, field, mode = nil)\n value = get_field_value(data, field)\n array = value.is_a?(Array)\n value = yield(value)\n case mode\n when :required then # Keep value as array.\n when :forbidden then value = value.first\n else value = value.first unless array || value.many?\n end\n set_field_value!(data, field, value)\n end",
"title": ""
}
] |
[
{
"docid": "742513cfb06c5a4feebb333ca4b554b7",
"score": "0.7071639",
"text": "def update!(**args)\n @target = args[:target] if args.key?(:target)\n end",
"title": ""
},
{
"docid": "742513cfb06c5a4feebb333ca4b554b7",
"score": "0.7071639",
"text": "def update!(**args)\n @target = args[:target] if args.key?(:target)\n end",
"title": ""
},
{
"docid": "037746075421b4875af6cc34fa3e4e87",
"score": "0.7035637",
"text": "def update_target\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d938a7ab8b7eea10f000f50fa5194ebb",
"score": "0.6630591",
"text": "def update!(**args)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_type = args[:target_type] if args.key?(:target_type)\n end",
"title": ""
},
{
"docid": "8bf173182eb26e434427bab8f3392548",
"score": "0.65073454",
"text": "def update\n @target.update(target_params)\n flash[:notice] = 'Target was successfully updated.' if @target.save\n respond_with(@target, :location => borrower_targets_url(@target.borrower_id))\n end",
"title": ""
},
{
"docid": "d1014b92a606d0179ab492def3094065",
"score": "0.6439222",
"text": "def update\n respond_to do |format|\n if @target.update(target_params)\n format.html { redirect_to @target, notice: 'Target was successfully updated.' }\n format.json { render :show, status: :ok, location: @target }\n else\n format.html { render :edit }\n format.json { render json: @target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92fcdfcdf72c0754c95eafc30d375f3e",
"score": "0.636585",
"text": "def target=(value)\r\n @p.target = value\r\n end",
"title": ""
},
{
"docid": "2bcea53fb314c35573608334a7011f42",
"score": "0.6358648",
"text": "def update\n follow_target!\n end",
"title": ""
},
{
"docid": "7d6397ba15d371c87f221a0086eaa2cc",
"score": "0.63354844",
"text": "def update!(**args)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_mime_type = args[:target_mime_type] if args.key?(:target_mime_type)\n @target_resource_key = args[:target_resource_key] if args.key?(:target_resource_key)\n end",
"title": ""
},
{
"docid": "fa296bd5c7e62fa144be7969218de9f6",
"score": "0.63202494",
"text": "def update\n @target = Target.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n if @target.update_attributes(params[:target])\n format.html { redirect_to @target, notice: 'Target was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5868dbab2cef8786bfe1a96c6d62a646",
"score": "0.63153034",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "5868dbab2cef8786bfe1a96c6d62a646",
"score": "0.63153034",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "5868dbab2cef8786bfe1a96c6d62a646",
"score": "0.6315134",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "5868dbab2cef8786bfe1a96c6d62a646",
"score": "0.6315134",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "5868dbab2cef8786bfe1a96c6d62a646",
"score": "0.6315134",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "8591b5d0eabaa9ba57b97547382411bc",
"score": "0.63112336",
"text": "def target=(in_target)\n\t\t\t\t@target = in_target\n\t\t\tend",
"title": ""
},
{
"docid": "4ad95763b34c6df93d327c08d606ca03",
"score": "0.62825894",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "4ad95763b34c6df93d327c08d606ca03",
"score": "0.62825894",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "4ad95763b34c6df93d327c08d606ca03",
"score": "0.62825894",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "4ad95763b34c6df93d327c08d606ca03",
"score": "0.62825894",
"text": "def target=(value)\n @target = value\n end",
"title": ""
},
{
"docid": "84e33b01699aff798e10589d88d9117b",
"score": "0.6282223",
"text": "def update\n\n respond_to do |format|\n if @target.update(target_params)\n format.html { redirect_to @target, notice: t(:target_updated) }\n format.json { render :show, status: :ok, location: @target }\n else\n format.html { render :edit }\n format.json { render json: @target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1ff90d6e10855ea346bd2c3ee7a09ad",
"score": "0.62437415",
"text": "def update\n @target = @user.targets.find(params[:id])\n respond_to do |format|\n if @target.update_attributes(params[:target])\n format.html { redirect_to targets_url, notice: 'Target was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7339dc3bef0d23bf7150aec58da2e68",
"score": "0.6229192",
"text": "def update!(**args)\n @first_party_targeting = args[:first_party_targeting] if args.key?(:first_party_targeting)\n end",
"title": ""
},
{
"docid": "096794b9de76423ac494fb499c11dcc8",
"score": "0.6223445",
"text": "def update!(**args)\n @daypart_targeting = args[:daypart_targeting] if args.key?(:daypart_targeting)\n @geo_targeting = args[:geo_targeting] if args.key?(:geo_targeting)\n @inventory_size_targeting = args[:inventory_size_targeting] if args.key?(:inventory_size_targeting)\n @inventory_type_targeting = args[:inventory_type_targeting] if args.key?(:inventory_type_targeting)\n @placement_targeting = args[:placement_targeting] if args.key?(:placement_targeting)\n @technology_targeting = args[:technology_targeting] if args.key?(:technology_targeting)\n @user_list_targeting = args[:user_list_targeting] if args.key?(:user_list_targeting)\n @video_targeting = args[:video_targeting] if args.key?(:video_targeting)\n end",
"title": ""
},
{
"docid": "e3231525497ef0cb17c34c74b961a1d1",
"score": "0.62088627",
"text": "def update!(target = adjustable)\n return amount if closed? || source.blank?\n\n amount = source.compute_amount(target)\n attributes = { amount: amount, updated_at: Time.current }\n attributes[:eligible] = source.promotion.eligible?(target) if promotion?\n update_columns(attributes)\n amount\n end",
"title": ""
},
{
"docid": "c7fcc4ef0e31f907802147fdabbe1716",
"score": "0.61990315",
"text": "def update\n @target = Target.find(params[:id])\n\n respond_to do |format|\n if @target.update_attributes(params[:target])\n format.html { redirect_to @target, notice: 'Target was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f186c8e5b473ea805642a8511513887",
"score": "0.6184238",
"text": "def update\n @target = Target.find(params[:id])\n\n if @target.update(params[:target])\n head :no_content\n else\n render json: @target.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9bdb55413b7ff1504dd6755b1ba3500e",
"score": "0.61627245",
"text": "def update(target, document, options)\n document.send(\"#{options.foreign_key}=\", target ? target.id : nil)\n new(document, options, target)\n end",
"title": ""
},
{
"docid": "6ab587b4ecffe0e8cacbe5e1bc34a344",
"score": "0.6145667",
"text": "def update_attribute\r\n end",
"title": ""
},
{
"docid": "6ab587b4ecffe0e8cacbe5e1bc34a344",
"score": "0.6145667",
"text": "def update_attribute\r\n end",
"title": ""
},
{
"docid": "9377e77a405498e3dbb37aa1907e1974",
"score": "0.61002237",
"text": "def target=(target)\n @target = target\n @ori_target = target\n end",
"title": ""
},
{
"docid": "9377e77a405498e3dbb37aa1907e1974",
"score": "0.61002237",
"text": "def target=(target)\n @target = target\n @ori_target = target\n end",
"title": ""
},
{
"docid": "e2bc2d01fcb10eefb7e475a1e1801cee",
"score": "0.6099977",
"text": "def target=(target)\n @target = target\n end",
"title": ""
},
{
"docid": "64e99a21f9b0ef78f4b8c61edae30efa",
"score": "0.60980886",
"text": "def target= value\r\n value = value.to_s\r\n @attributes['target'] = value\r\n value.to_number\r\n end",
"title": ""
},
{
"docid": "a243a1eeca0ff1ecdb636d21751bcd33",
"score": "0.6064673",
"text": "def target=(target); end",
"title": ""
},
{
"docid": "a243a1eeca0ff1ecdb636d21751bcd33",
"score": "0.6064673",
"text": "def target=(target); end",
"title": ""
},
{
"docid": "ebcb0dc0009dd1d272057417c24a2512",
"score": "0.60601485",
"text": "def target=(target)\n @target = target\n end",
"title": ""
},
{
"docid": "5f796048743c916f450a310815732bc8",
"score": "0.60475296",
"text": "def update\n respond_to do |format|\n if @dr_target.update(dr_target_params)\n format.html { redirect_to @dr_target, notice: 'Dr target was successfully updated.' }\n format.json { render :show, status: :ok, location: @dr_target }\n else\n format.html { render :edit }\n format.json { render json: @dr_target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "514512506c99f5a478e2a337061e7da9",
"score": "0.6029279",
"text": "def update\n @target = Target.find_by!(name: params[:id])\n\n respond_to do |format|\n if @target.update(target_params)\n format.html { redirect_to @target, notice: 'Target was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e805fb74f98105d00367982983701fef",
"score": "0.60253316",
"text": "def target=(p)\n @target = p.freeze\n @value = @target.dup\n @value << \" #{@data}\" if @data != \"\"\n @value.freeze\n end",
"title": ""
},
{
"docid": "41a93f3b3d3720a3ad0d76744b1a2079",
"score": "0.6016352",
"text": "def update\n @target = Target.find(params[:id])\n\n respond_to do |format|\n if @target.update_attributes(params[:target])\n format.html { redirect_to(@target, :notice => 'Target was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @target.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f094b0d94a0cf6876767667f801ff2dc",
"score": "0.60073966",
"text": "def update_target(id, value = nil)\n if id.nil?\n raise LinkemperorCustomerException.new('id should not be empty')\n end\n parameters = {'target_keyword' => {'value' => value}}\n exec_post(parameters, 'put', \"#{@base_path}/api/v2/customers/target_keywords/#{id}.json?api_key=#{@api_key}\")\n end",
"title": ""
},
{
"docid": "9fa5370f257feb57f314c99dd24eaf0c",
"score": "0.5980677",
"text": "def update\n respond_to do |format|\n if @source_field.update(source_field_params)\n format.html { redirect_to @source_field, notice: 'Source field was successfully updated.' }\n format.json { render :show, status: :ok, location: @source_field }\n else\n format.html { render :edit }\n format.json { render json: @source_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa4ff0ea880c6e0c075238420b01d52b",
"score": "0.5980575",
"text": "def update!(**args)\n @source = args[:source] if args.key?(:source)\n @target = args[:target] if args.key?(:target)\n end",
"title": ""
},
{
"docid": "94c964e0db1b39883f757ababd1058fe",
"score": "0.5977648",
"text": "def target=(target)\n @@target = target\n end",
"title": ""
},
{
"docid": "af56bdd3ff715ea68465c4d8a4656465",
"score": "0.59765697",
"text": "def update(target_name = nil)\n Blazing::Commands.run(:update, :target_name => target_name, :options => options)\n end",
"title": ""
},
{
"docid": "1618ed15cf25911c81cc0d290bcd2de8",
"score": "0.59758663",
"text": "def update!(**args)\n @utilization_target = args[:utilization_target] if args.key?(:utilization_target)\n end",
"title": ""
},
{
"docid": "1618ed15cf25911c81cc0d290bcd2de8",
"score": "0.59758663",
"text": "def update!(**args)\n @utilization_target = args[:utilization_target] if args.key?(:utilization_target)\n end",
"title": ""
},
{
"docid": "406a9b15a020ca5356b5a64cd045b95f",
"score": "0.5962483",
"text": "def update!(**args)\n @field_id = args[:field_id] if args.key?(:field_id)\n @source_type = args[:source_type] if args.key?(:source_type)\n end",
"title": ""
},
{
"docid": "406a9b15a020ca5356b5a64cd045b95f",
"score": "0.5962483",
"text": "def update!(**args)\n @field_id = args[:field_id] if args.key?(:field_id)\n @source_type = args[:source_type] if args.key?(:source_type)\n end",
"title": ""
},
{
"docid": "30b5b885dfdcebc0557418cba437517f",
"score": "0.595994",
"text": "def update_single_attribute(attribute,new_value,source=nil)\n self.source = source\n self.send(\"#{attribute}=\",new_value)\n updated = self.valid_attribute?(attribute)\n updated = self.save(:validate => false) if updated\n updated\n end",
"title": ""
},
{
"docid": "68df0910d24f6a23315f2fdaf5a959a7",
"score": "0.59462756",
"text": "def update(target, document, options)\n target_ids = target.map do |t|\n t.save! if t.new_record?\n t.id\n end\n document.send(\"#{options.foreign_key}=\", target_ids)\n instantiate(document, options, target)\n end",
"title": ""
},
{
"docid": "221d63e3e3f714684c41963294c1e7ad",
"score": "0.59446007",
"text": "def update_attribute\n end",
"title": ""
},
{
"docid": "221d63e3e3f714684c41963294c1e7ad",
"score": "0.59446007",
"text": "def update_attribute\n end",
"title": ""
},
{
"docid": "2ab32071fe8aa358738140a16226f0a8",
"score": "0.5920225",
"text": "def update(target, document, options)\n document.send(\"#{options.foreign_key}=\", target ? target.id : nil)\n instantiate(document, options, target)\n end",
"title": ""
},
{
"docid": "940cdd7ec3329188ea076ad87ca6032c",
"score": "0.59192914",
"text": "def update!(**args)\n @new_value = args[:new_value] if args.key?(:new_value)\n @original_value_pattern = args[:original_value_pattern] if args.key?(:original_value_pattern)\n @target_group_kinds = args[:target_group_kinds] if args.key?(:target_group_kinds)\n @target_json_path = args[:target_json_path] if args.key?(:target_json_path)\n @target_namespaces = args[:target_namespaces] if args.key?(:target_namespaces)\n end",
"title": ""
},
{
"docid": "a78ab0420c9a86faa4a1122b93cd7215",
"score": "0.5900431",
"text": "def update!(**args)\n @add_target = args[:add_target] if args.key?(:add_target)\n @labels = args[:labels] if args.key?(:labels)\n @remove_target = args[:remove_target] if args.key?(:remove_target)\n end",
"title": ""
},
{
"docid": "a78ab0420c9a86faa4a1122b93cd7215",
"score": "0.5900431",
"text": "def update!(**args)\n @add_target = args[:add_target] if args.key?(:add_target)\n @labels = args[:labels] if args.key?(:labels)\n @remove_target = args[:remove_target] if args.key?(:remove_target)\n end",
"title": ""
},
{
"docid": "6500397514f0a461b6f3bd3f066bcd4d",
"score": "0.59000134",
"text": "def update_target(id, visit_value = nil)\n if id.nil?\n raise LinkemperorCustomerException.new('id should not be empty')\n end\n parameters = {'target' => {'visit_value' => visit_value}}\n exec_post(parameters, 'put', \"#{@base_path}/api/v2/customers/targets/#{id}.json?api_key=#{@api_key}\")\n end",
"title": ""
},
{
"docid": "7a485ac32387e47323b574bb32c7cb55",
"score": "0.5895785",
"text": "def target=(target)\n @target = [target]\n loaded!\n end",
"title": ""
},
{
"docid": "662bb124dbab9f1bd5aa10e405e961ac",
"score": "0.58901566",
"text": "def mark_target_modified\n if defined?(@resource) and restarget = @resource.should(:target) and restarget != @property_hash[:target]\n self.class.modified(restarget)\n end\n self.class.modified(@property_hash[:target]) if @property_hash[:target] != :absent and @property_hash[:target]\n end",
"title": ""
},
{
"docid": "783f40ecd4568a920055a8b633605a65",
"score": "0.5885565",
"text": "def set_target\n @target = Target.where(user: current_user).find(params[:target_id] || params[:id])\n end",
"title": ""
},
{
"docid": "3eaff3011f10e8efd73fbca31e0ba010",
"score": "0.58795017",
"text": "def set_target\n @target = Target.find(params[:id])\n end",
"title": ""
},
{
"docid": "9e74dd93552444dba15ac9402fd7e397",
"score": "0.5871288",
"text": "def target=(target)\n if target.nil?\n fail ArgumentError, 'invalid value for \"target\", target cannot be nil.'\n end\n @target = target\n end",
"title": ""
},
{
"docid": "9e74dd93552444dba15ac9402fd7e397",
"score": "0.5871288",
"text": "def target=(target)\n if target.nil?\n fail ArgumentError, 'invalid value for \"target\", target cannot be nil.'\n end\n @target = target\n end",
"title": ""
},
{
"docid": "9e74dd93552444dba15ac9402fd7e397",
"score": "0.5871288",
"text": "def target=(target)\n if target.nil?\n fail ArgumentError, 'invalid value for \"target\", target cannot be nil.'\n end\n @target = target\n end",
"title": ""
},
{
"docid": "9e74dd93552444dba15ac9402fd7e397",
"score": "0.5871288",
"text": "def target=(target)\n if target.nil?\n fail ArgumentError, 'invalid value for \"target\", target cannot be nil.'\n end\n @target = target\n end",
"title": ""
},
{
"docid": "9e74dd93552444dba15ac9402fd7e397",
"score": "0.5871288",
"text": "def target=(target)\n if target.nil?\n fail ArgumentError, 'invalid value for \"target\", target cannot be nil.'\n end\n @target = target\n end",
"title": ""
},
{
"docid": "7fce23fdc8fdf8bfd01a0ed00be3ed90",
"score": "0.58591133",
"text": "def set_target\n @target = Target.find(params[:id])\n end",
"title": ""
},
{
"docid": "7fce23fdc8fdf8bfd01a0ed00be3ed90",
"score": "0.58591133",
"text": "def set_target\n @target = Target.find(params[:id])\n end",
"title": ""
},
{
"docid": "7fce23fdc8fdf8bfd01a0ed00be3ed90",
"score": "0.58591133",
"text": "def set_target\n @target = Target.find(params[:id])\n end",
"title": ""
},
{
"docid": "c178ef3f63bd98c16790d75f380ab768",
"score": "0.583882",
"text": "def update\n @yearly_target = YearlyTarget.find(params[:id])\n\n respond_to do |format|\n if @yearly_target.update_attributes(params[:yearly_target])\n format.html { redirect_to yearly_targets_path, notice: 'Yearly target was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @yearly_target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6f0ac60422a106db74c83388079eb51",
"score": "0.5831281",
"text": "def update_text_field(sender)\n demo_label.stringValue = demo_textfield.stringValue\n debug \"Label text updated with new text:\\n #{demo_textfield.stringValue}\"\n end",
"title": ""
},
{
"docid": "0259af24da0784134a946090cee15a1c",
"score": "0.5824522",
"text": "def target=(target)\n if target.is_a? Entity\n @target = target\n else\n @target = target.to_s\n end\n end",
"title": ""
},
{
"docid": "38143da667ffc0c44d93908503697450",
"score": "0.5790245",
"text": "def update!(**args)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "38143da667ffc0c44d93908503697450",
"score": "0.5790245",
"text": "def update!(**args)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "38143da667ffc0c44d93908503697450",
"score": "0.5790245",
"text": "def update!(**args)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "16cb35104ef30f395b9327684f790166",
"score": "0.57877994",
"text": "def target_update(key, value)\n Chef::Log.debug \"Got #{key}:#{value} Stored: #{@cur_settings[key]}\"\n unless @cur_settings[key] == value\n run_command({ :command => \"iscsiadm -m node -T #{@new_resource.target} -p #{@new_resource.ip}:#{@new_resource.port} -o update -n #{key} -v #{value}\" })\n @new_resource.updated = true\n Chef::Log.info \"updated target #{@new_resource.target} settings: #{key} = #{value}\"\n end\n end",
"title": ""
},
{
"docid": "23ff37e913adeabd9387a420da706b30",
"score": "0.57852477",
"text": "def set_target(raw_data_array)\n target_string = raw_data_array.shift\n $target = target_string.to_f\n end",
"title": ""
},
{
"docid": "32bbe432d847189db2ec46e98ba72cbd",
"score": "0.5781632",
"text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @target_id = args[:target_id] if args.key?(:target_id)\n @unchanged_names = args[:unchanged_names] if args.key?(:unchanged_names)\n end",
"title": ""
},
{
"docid": "32bbe432d847189db2ec46e98ba72cbd",
"score": "0.5781632",
"text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @target_id = args[:target_id] if args.key?(:target_id)\n @unchanged_names = args[:unchanged_names] if args.key?(:unchanged_names)\n end",
"title": ""
},
{
"docid": "882da3f12e34a0e0b6f482155cdc2856",
"score": "0.57733697",
"text": "def update_target\n # get pixel movement rate\n pix = $BlizzABS.pixel\n # find target or return to creator depending on the type\n case @type\n when BlizzABS::REMOnReturn then @x, @y = @creator.x, @creator.y\n when BlizzABS::REMHomingSkill, BlizzABS::REMHomingItem\n @x, @y = @target.x, @target.y\n end\n # if special type and very close to target\n if (@type == BlizzABS::REMOnReturn || @type == BlizzABS::REMHomingSkill ||\n @type == BlizzABS::REMHomingItem) &&\n Math.hypot(@x * 32 / pix - @real_x / 4, @y * 32 / pix - @real_y / 4) <= 8\n # set to target's position\n moveto(@x / pix, @y / pix)\n end\n end",
"title": ""
},
{
"docid": "6ba99b1388644a795c857f51159aad21",
"score": "0.57692444",
"text": "def target=(target)\n @target = target\n loaded!\n end",
"title": ""
},
{
"docid": "6ba99b1388644a795c857f51159aad21",
"score": "0.5768745",
"text": "def target=(target)\n @target = target\n loaded!\n end",
"title": ""
},
{
"docid": "46167e23b269a3fe6406ca42922f1ebe",
"score": "0.5756044",
"text": "def target=(value)\r\n check_value(targets, value, 'target')\r\n @target = value\r\n end",
"title": ""
},
{
"docid": "3c52d069ba165448378c1b579f81172b",
"score": "0.57491124",
"text": "def set_target\n @target = Target.find(params[:id])\n end",
"title": ""
},
{
"docid": "77a0ebadf9bf651ca24d6b22678a5ace",
"score": "0.5734536",
"text": "def update\n @public_target = PublicTarget.find(params[:id])\n\n respond_to do |format|\n if @public_target.update_attributes(params[:public_target])\n format.html { redirect_to @public_target, notice: 'Public target was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @public_target.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c354e31967f46602e31495ec53e2764f",
"score": "0.57330674",
"text": "def write(value)\n target.send(\"#{target_attribute}=\", value)\n end",
"title": ""
},
{
"docid": "3480a97beebfa0df699839fb4c4f197e",
"score": "0.57188785",
"text": "def update(field, value)\n send \"#{field}=\", value\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "6efa713386be072ba6773ab645f4d0b7",
"score": "0.571482",
"text": "def update!(**args)\n @field = args[:field] if args.key?(:field)\n end",
"title": ""
},
{
"docid": "55630c3aa54b50408d217318b50b2305",
"score": "0.57127297",
"text": "def update!(**args)\n @field_path = args[:field_path] if args.key?(:field_path)\n end",
"title": ""
},
{
"docid": "55630c3aa54b50408d217318b50b2305",
"score": "0.57127297",
"text": "def update!(**args)\n @field_path = args[:field_path] if args.key?(:field_path)\n end",
"title": ""
},
{
"docid": "1b4388bfdb42b48d3b26105f48c7769e",
"score": "0.57014626",
"text": "def update!(**args)\n @document = args[:document] if args.key?(:document)\n @removed_target_ids = args[:removed_target_ids] if args.key?(:removed_target_ids)\n @target_ids = args[:target_ids] if args.key?(:target_ids)\n end",
"title": ""
},
{
"docid": "1b4388bfdb42b48d3b26105f48c7769e",
"score": "0.57014626",
"text": "def update!(**args)\n @document = args[:document] if args.key?(:document)\n @removed_target_ids = args[:removed_target_ids] if args.key?(:removed_target_ids)\n @target_ids = args[:target_ids] if args.key?(:target_ids)\n end",
"title": ""
}
] |
ae9c9d0fae9b11afca225672dea328b0
|
Decide whether and where to move. There is a 75% chance the monster will move at all, and if it does, it will move towards the palayer if the player is within 6 tiles of the moster.
|
[
{
"docid": "0fb4ebc0d82789de49f182ffb063f078",
"score": "0.0",
"text": "def choose_move(player_coords)\n return nil unless rand < 0.75\n\n x_difference = @coords[:x] - player_coords[:x]\n y_difference = @coords[:y] - player_coords[:y]\n directions = { x: [:left, :right], y: [:up, :down] }\n if x_difference.abs + y_difference.abs <= 6\n axis = x_difference.abs > y_difference.abs ? :x : :y\n direction = @coords[axis] > player_coords[axis] ? directions[axis][0] : directions[axis][1]\n else\n direction = [:left, :right, :up, :down][rand(0..3)]\n end\n return direction\n end",
"title": ""
}
] |
[
{
"docid": "803163898f743f94f5430877bbe33098",
"score": "0.72797126",
"text": "def move_type_toward_player\n # Get difference in player coordinates\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n # Get absolute value of difference\n abs_sx = sx > 0 ? sx : -sx\n abs_sy = sy > 0 ? sy : -sy\n # If separated by 20 or more tiles matching up horizontally and vertically\n if sx + sy >= 20\n # Random\n move_random\n return\n end\n # Branch by random numbers 0-5\n case rand(6)\n when 0..3 # Approach player\n move_toward_player\n when 4 # random\n move_random\n when 5 # 1 step forward\n move_forward\n end\n end",
"title": ""
},
{
"docid": "803163898f743f94f5430877bbe33098",
"score": "0.72797126",
"text": "def move_type_toward_player\n # Get difference in player coordinates\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n # Get absolute value of difference\n abs_sx = sx > 0 ? sx : -sx\n abs_sy = sy > 0 ? sy : -sy\n # If separated by 20 or more tiles matching up horizontally and vertically\n if sx + sy >= 20\n # Random\n move_random\n return\n end\n # Branch by random numbers 0-5\n case rand(6)\n when 0..3 # Approach player\n move_toward_player\n when 4 # random\n move_random\n when 5 # 1 step forward\n move_forward\n end\n end",
"title": ""
},
{
"docid": "761e27fe09c6bfbb8201286853260749",
"score": "0.72776306",
"text": "def move_type_toward_player\r\n # Get difference in player coordinates\r\n sx = @x - $game_player.x\r\n sy = @y - $game_player.y\r\n # Get absolute value of difference\r\n abs_sx = sx > 0 ? sx : -sx\r\n abs_sy = sy > 0 ? sy : -sy\r\n # If separated by 20 or more tiles matching up horizontally and vertically\r\n if sx + sy >= 20\r\n # Random\r\n move_random\r\n return\r\n end\r\n # Branch by random numbers 0-5\r\n case rand(6)\r\n when 0..3 # Approach player\r\n move_toward_player\r\n when 4 # random\r\n move_random\r\n when 5 # 1 step forward\r\n move_forward\r\n end\r\n end",
"title": ""
},
{
"docid": "b1578616f47dd56bbedd16e29390e2e3",
"score": "0.70912236",
"text": "def move_type_toward_player\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n if sx.abs + sy.abs >= 20\n move_random\n else\n case rand(6)\n when 0..3; move_toward_player\n when 4; move_random\n when 5; move_forward\n end\n end\n end",
"title": ""
},
{
"docid": "82c82ad1aa6ec6dbc2b539c898dc529a",
"score": "0.7018108",
"text": "def move_type_toward_player\n if near_the_player?\n case rand(6)\n when 0 then move_toward_player\n when 1 then move_toward_player\n when 2 then move_toward_player\n when 3 then move_toward_player\n when 4 then move_random\n when 5 then move_forward\n end\n else\n move_random\n end\n end",
"title": ""
},
{
"docid": "99d89275b8f641a331d88cfa08a966b1",
"score": "0.68602353",
"text": "def move_toward_player\n # Determine Correct Distance to Target for Looping Maps\n sx, sy = character_distance($game_player)\n # If coordinates are equal\n if sx == 0 and sy == 0\n return\n end\n # Get absolute value of difference\n abs_sx = sx.abs\n abs_sy = sy.abs\n # If horizontal and vertical distances are equal\n if abs_sx == abs_sy\n # Increase one of them randomly by 1\n rand(2) == 0 ? abs_sx += 1 : abs_sy += 1\n end\n # If horizontal distance is longer\n if abs_sx > abs_sy\n # Move towards player, prioritize left and right directions\n sx > 0 ? move_left : move_right\n if not moving? and sy != 0\n sy > 0 ? move_up : move_down\n end\n # If vertical distance is longer\n else\n # Move towards player, prioritize up and down directions\n sy > 0 ? move_up : move_down\n if not moving? and sx != 0\n sx > 0 ? move_left : move_right\n end\n end\n end",
"title": ""
},
{
"docid": "6a103cb129b7cc9e30e7ea427ec6677b",
"score": "0.68549824",
"text": "def move?\r\n \tif @move_count < 3\r\n\t if @current_gold.zero? && @current_silver.zero?\r\n\t true\r\n\t else\r\n\t \tfalse\r\n\t end\r\n\telsif @current_gold < 2 && @current_silver < 3\r\n\t \ttrue\r\n\telse\r\n\t\tfalse\r\n\tend\r\n end",
"title": ""
},
{
"docid": "bcae32ca12dd0e2ce9aa171c08b0d982",
"score": "0.68094087",
"text": "def move_type_toward_player\n # プレイヤーの座標との差を求める\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n # 差の絶対値を求める\n abs_sx = sx > 0 ? sx : -sx\n abs_sy = sy > 0 ? sy : -sy\n # 縦横あわせて 20 タイル以上離れている場合\n if abs_sx + abs_sy >= 20\n # ランダム\n move_random\n return\n end\n # 乱数 0~5 で分岐\n case rand(6)\n when 0..3 # プレイヤーに近づく\n move_toward_player\n when 4 # ランダム\n move_random\n when 5 # 一歩前進\n move_forward\n end\n end",
"title": ""
},
{
"docid": "f4aed1282169876c718dcc7828635aa5",
"score": "0.680596",
"text": "def winning_move\n simulate_move(@player_num)\n end",
"title": ""
},
{
"docid": "f91de41b96ed0c53755811be27130a4f",
"score": "0.6764566",
"text": "def move_type_toward_player\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n abs_sx = sx > 0 ? sx : -sx\n abs_sy = sy > 0 ? sy : -sy\n if sx + sy >= 20\n move_random\n return\n end\n move_toward_player\n end",
"title": ""
},
{
"docid": "a1d2ad4f321ff315c8c9b23052e1d957",
"score": "0.6727474",
"text": "def move_legal? player, row, column, tile\n\tto_row = get_row tile\n\tto_column = get_column tile\n\tif player == 1\n\t\treturn true if (((to_column == column + 1) || (to_column == column - 1)) && \n\t\t\t(to_row == row - 1) && (@checkers_state[to_row][to_column] == \"0\"))\n\telsif player == 2\n\t\treturn true if (((to_column == column + 1) || (to_column == column - 1)) && \n\t\t\t(to_row == row + 1) && (@checkers_state[to_row][to_column] == \"0\"))\n\tend\n\tif (player == 1 && (to_row == row - 2))\n\t\tif ((to_column == column + 2) && (@checkers_state[row-1][column+1] == \"2\"))\n\t\t\teat_piece(player, row-1, column+1)\n\t\t\tjump_again?(player, row, column)\n\t\t\treturn true\n\t\telsif ((to_column == column - 2) && (@checkers_state[row-1][column-1] == \"2\"))\n\t\t\teat_piece(player, row-1, column-1)\n\t\t\tjump_again?(player, row, column)\n\t\t\treturn true\n\t\tend\n\telsif (player == 2 && (to_row == row + 2))\n\t\tif ((to_column == column + 2) && (@checkers_state[row+1][column+1] == \"1\"))\n\t\t\teat_piece(player, row+1, column+1)\n\t\t\tjump_again?(player, row, column)\n\t\t\treturn true\n\t\telsif ((to_column == column - 2) && (@checkers_state[row+1][column-1] == \"1\"))\n\t\t\teat_piece(player, row+1, column-1)\n\t\t\tjump_again?(player, row, column)\n\t\t\treturn true\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "32344de59e39fb0cb4651d3abfe84ed1",
"score": "0.6643576",
"text": "def valid_move?\n if attack_move? == true\n true\n elsif pawn_first_move?\n if @pawn_piece == \"P(w)\"\n first_move_white\n elsif @pawn_piece == \"P(b)\"\n first_move_black\n end\n else\n if @pawn_piece == \"P(w)\"\n normal_move_white\n elsif @pawn_piece == \"P(b)\"\n normal_move_black\n end\n end\n end",
"title": ""
},
{
"docid": "9adf96b99020a0042ecd3e7565fc192d",
"score": "0.66010076",
"text": "def check_move(dir)\n\n @direction = dir\n\n #These tiles cannot be walked on\n solids = [Boulder, Wall]\n\n #Get object of next tile according to direction\n found_obj = $map.adjacent_tile(@x, @y, @direction)\n\n #If tile is not solid enable walking\n if not solids.include?(found_obj.class)\n\n case found_obj\n #Use medicine if in adjacent tile\n when Medicine\n @health += 25 unless @health == 100\n found_obj.die\n # Kill grass if in adjacent tile\n when Grass\n found_obj.die\n # Kill ruby if in adjacent tile and add to rubies gathered\n when Ruby\n @rubies_gathered += 1\n found_obj.die\n #Exit found?\n when Exit\n @exit_flag = true\n end\n\n #Set target player will walk to\n set_target(@direction)\n #Update player position in map\n $map.update(self, @target_x, @target_y)\n @state = :moving\n\n end\n\n #If left or right meets boulder --- see if it's pushable\n if (found_obj.class == Boulder) && ([:left, :right].include?(@direction))\n\n #If the tile behind the boulder is empty make pushing available - and avoid pushing through the air\n if $map.adjacent_tile(found_obj.x, found_obj.y, @direction).class == NilClass &&\n $map.adjacent_tile(found_obj.x, found_obj.y, :down).class != NilClass\n\n #Update boulder position in map\n $map.update(found_obj, found_obj.x + (@direction == :right ? 32 : -32), found_obj.y)\n #Set boulder to be pushed\n @push_boulder = found_obj\n #Tell the boulder that it's being pushed\n @push_boulder.state = :pushed\n #Update player position in map\n set_target(@direction)\n $map.update(self, @target_x, @target_y)\n #Trigger on screen movement\n @state = :moving\n #Play boulder push sound\n @push_sound.play(1, 1, false)\n\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "3cd1d895123bec921a5b86cfb1bc7f5a",
"score": "0.6559277",
"text": "def process_movement(move, treasureAndMonster)\n flee = rand()\n if(treasureAndMonster < 0 && move != \"R\" && move != \"F\")\n puts(\"FIGHT OR RUN!\")\n return false\n elsif(treasureAndMonster < 0 && move == \"R\" && flee > 0.7)\n loop do\n puts('WHICH WAY DO YOU WANT TO FLEE?')\n move = get_movement\n if(@map.isPossibleMove(move))\n @map.move(move)\n return true\n else\n puts(@map.getMoveError(move))\n end\n end\n elsif(treasureAndMonster < 0 && move == \"R\" && flee < 0.7)\n puts('NO YOU MUST STAND AND FIGHT')\n sleep(2)\n getToFight(treasureAndMonster)\n return true\n elsif(treasureAndMonster <0 && move == \"F\")\n getToFight(treasureAndMonster)\n return true\n elsif(move == \"Q\")\n puts(\"YOUR SCORE IS #{get_score}\")\n exit\n elsif(move == \"T\")\n puts(\"\\n********************************\\n\")\n puts(\"* YOUR TALLY AT PRESENT IS #{get_score} *\")\n puts(\"********************************\\n\")\n sleep(3)\n return true\n elsif(move == \"I\")\n inventory\n @map.updatePreviousRoom\n sleep(2)\n return true\n elsif(move == \"C\" && @food == 0)\n puts(\"YOU HAVE NO FOOD\")\n elsif(move == \"C\")\n eat_food\n @map.updatePreviousRoom\n sleep(2)\n return true\n elsif(move == \"F\" && treasureAndMonster >= 0)\n puts(\"THERE IS NOTHING TO FIGTH HERE\")\n elsif(move == \"P\")\n pick_up_treasure(treasureAndMonster)\n @map.setEmptyRoom\n sleep(2)\n return true\n elsif(move == \"M\" && @amulet == 1)\n @map.teleport\n sleep(2)\n return true\n else\n if(@map.isPossibleMove(move))\n @map.move(move)\n return true\n else\n puts(@map.getMoveError(move))\n return false\n end\n end\n end",
"title": ""
},
{
"docid": "62ff274e95fb21de31b038c8296d01a9",
"score": "0.65516293",
"text": "def move\n potential_move ||= winning_move\n potential_move ||= living_move\n potential_move ||= random_move\n end",
"title": ""
},
{
"docid": "74602dc8db8b99cb7bb292357b70a4f0",
"score": "0.6536479",
"text": "def best_move(player, _depth = 0)\n best_effort, i_was_just_guessing = best_effort_move(player)\n return best_effort unless i_was_just_guessing\n\n center = @board.size / 2\n # test if empty\n if @board.available?(center)\n return center, false\n else\n end\n end",
"title": ""
},
{
"docid": "a05a98cf99a467bff5bc7ba35e66cd59",
"score": "0.6512894",
"text": "def move\n return win_lose if win_lose\n \n if current_game.turns == 1\n ai_first_move\n elsif current_game.turns == 3\n ai_second_move\n elsif current_game.turns == 5\n ai_third_move\n else\n ai_other_moves\n end\n\n end",
"title": ""
},
{
"docid": "3f5ed172e4b51bd61080a102d49188d3",
"score": "0.6498456",
"text": "def eaten?\n monster_position == player_position\n end",
"title": ""
},
{
"docid": "86a9c2fbf68c78a589ce9a8132a8be5a",
"score": "0.6480603",
"text": "def next_move(player)\n case @difficulty_level\n when 1 then random_only\n when 2 then block_win_random(player)\n when 3 then win_block_random(player)\n end\n end",
"title": ""
},
{
"docid": "08b9d355b69fa151b14c17111798ff11",
"score": "0.64756674",
"text": "def move\n if clear_shot? && @energy > 0\n take_action(FIRE)\n elsif battery = find_closest_battery\n move_toward(battery)\n else\n move_toward(find_enemy)\n end\n end",
"title": ""
},
{
"docid": "e88515aa7c32aca051ce74f1b884ce65",
"score": "0.6468709",
"text": "def move_away_from_player\n # Determine Correct Distance to Target for Looping Maps\n sx, sy = character_distance($game_player)\n # If coordinates are equal\n if sx == 0 and sy == 0\n return\n end\n # Get absolute value of difference\n abs_sx = sx.abs\n abs_sy = sy.abs\n # If horizontal and vertical distances are equal\n if abs_sx == abs_sy\n # Increase one of them randomly by 1\n rand(2) == 0 ? abs_sx += 1 : abs_sy += 1\n end\n # If horizontal distance is longer\n if abs_sx > abs_sy\n # Move away from player, prioritize left and right directions\n sx > 0 ? move_right : move_left\n if not moving? and sy != 0\n sy > 0 ? move_down : move_up\n end\n # If vertical distance is longer\n else\n # Move away from player, prioritize up and down directions\n sy > 0 ? move_down : move_up\n if not moving? and sx != 0\n sx > 0 ? move_right : move_left\n end\n end\n end",
"title": ""
},
{
"docid": "1bd1c75eefcf03f0ce0ee354622b7cc4",
"score": "0.6465944",
"text": "def move\n if @direction == \"N\" && (@yCoord + 1) <= @yMax\n @yCoord += 1\n elsif @direction == \"S\" && (@yCoord - 1) >= 0\n @yCoord -= 1\n elsif @direction == \"W\" && (@xCoord - 1) >= 0\n @xCoord -= 1\n elsif @direction == \"E\" && (@xCoord + 1) <= @xMax\n @xCoord += 1\n else\n puts \"You cannot move outside of the plateau!\"\n end\n end",
"title": ""
},
{
"docid": "f882fdca6e52b2834367f55d3900526b",
"score": "0.6459511",
"text": "def move\n\tif poisoned\n\t @hp = @hp * 200 / 201\n\tend\n\t\n\tif @hp <= 0\n\t Game.player.score += score\n\t Game.player.cash += cash\n\t \n\t self.alive = false\n\t Game.scene.remove_object self\n\tend\n\tfinished if Config.monsters_end_at[0] == position[0] and Config.monsters_end_at[1] == position[1]\n\treturn unless self.alive\n\t\n\tif !@dir\n\t @dir = Game.scene.shortest_path_from position\n\t finished if @dir == true\n\t return unless self.alive\n\t @goal = [position[0].round + @dir[0], position[1].round + @dir[1]]\n\telse\n\t if Game.scene.towers[@goal]\n\t @dir = false\n\t @position[0] = @position[0].round\n\t @position[1] = @position[1].round\n\t return\n\t end\n\t \n\t position[0] += @dir[0] * effective_speed\n\t position[1] += @dir[1] * effective_speed\n\t \n\t if (@dir[0] < 0 and position[0] <= @goal[0]) or (@dir[0] > 0 and position[0] >= @goal[0]) or\n\t (@dir[1] < 0 and position[1] <= @goal[1]) or (@dir[1] > 0 and position[1] >= @goal[1])\n\t \n\t @dir = Game.scene.shortest_path_from @goal\n\t finished if @dir == true\n\t return unless self.alive\n\t \n\t waitingmove = (position[0]-@goal[0]).abs + (position[1]-@goal[1]).abs\n\t @position = @goal\n\t @goal = [position[0].round + @dir[0], position[1].round + @dir[1]]\n\t @position[0] += waitingmove * @dir[0]\n\t @position[1] += waitingmove * @dir[1]\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "151da8697662adf0b61b0c6d18e1940c",
"score": "0.6441173",
"text": "def intelligent_move(board)\n offensive(board) || defensive(board) || random(board)\n end",
"title": ""
},
{
"docid": "75278cc83ac8ac934202a04c6b64366a",
"score": "0.642856",
"text": "def player_move(gamepiece, new_x, new_y)\n false\n last_moved = self.last_piece\n if last_moved.moved == 0 && last_moved.user_id != self.player_white_id && self.player_white_id == gamepiece.user_id\n !self.is_obstructed?(gamepiece, new_x, new_y)\n elsif last_moved.moved > 0 && last_moved.user_id != gamepiece.user_id\n !self.is_obstructed?(gamepiece, new_x, new_y)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "63285ded8d40bfe3cc60a0c689e52ce4",
"score": "0.6411781",
"text": "def is_possible_move_to()\n \n if(has_moved == false)\n \n a = @x + movelist[0][0]\n b = @y + movelist[0][1]\n \n if (Board.includes?(a,b))\n \n if (tile[a][b].color == !@color)\n \n elsif (tile[a][b].nil?)\n \n can_move_to.push(tile[a][b], \"Move\")\n \n else\n \n puts'cant move this piece in this direction'\n break\n \n \n end\n end \n end\n \n a = @x + movelist[1][0]\n b = @y + movelist[1][1]\n \n if(Board.includes?(a,b))\n \n if(tile[a][b].nil?)\n \n can_move_to.push(tile[a][b], \"Move\")\n end\n end\n \n \n for i in 2...3\n \n a = @x + movelist[i][0]\n b = @y + movelist[i][1]\n \n loop do\n \n if(Board.includes?(a,b))\n \n if(tile[a][b].color == !@color)\n \n can_move_to.push(tile[a][b], \"Eat\")\n break\n #pice is eaten \n \n else\n \n puts'cant move this piece in this direction'\n break\n end\n end\n break if(longmovement == false)\n end\n end\n end",
"title": ""
},
{
"docid": "7d0053d17b18f1b7a28e321dc0ea1532",
"score": "0.6410985",
"text": "def move(direction)\n if @player.littleroot == 'second' # Free to explore town but can't leave\n if direction == 'up'\n if @pos_x == 1 && (@pos_y == 13 || @pos_y == 14) #If trying to exit at top\n # Little guy stops you\n @map[2][10] = 'S'\n @map[2][11] = 'boy'\n reset_map 0.5\n @map[2][11] = 'S'\n @map[2][12] = 'boy'\n reset_map 0.5\n @map[2][12] = 'S'\n @map[2][13] = 'boy'\n reset_map 0.5\n @map[2][13] = 'S'\n # Top exit is two spots wide, little guy takes appropriate pathing depending on player\n if @pos_y == 13\n @map[2][14] = 'boy'\n reset_map(0.5)\n @map[2][14] = 'S'\n @map[1][14] = 'boy'\n reset_map 0.5\n @map[1][14] = 'S'\n @map[0][14] = 'boy'\n reset_map 0.5\n @map[0][14] = 'E'\n @map[0][13] = 'boy'\n reset_map 0.5\n cant_leave_speech \n @map[0][13] = 'E'\n @map[0][14] = 'boy'\n reset_map 0.5\n @map[0][14] = 'E'\n @map[1][14] = 'boy'\n reset_map 0.5\n @map[1][14] = 'S'\n @map[2][14] = 'boy'\n reset_map 0.5\n @map[2][14] = 'S'\n\n else\n @map[1][13] = 'boy'\n reset_map 0.5\n @map[1][13] = 'S'\n @map[0][13] = 'boy'\n reset_map 0.5\n @map[0][13] = 'E'\n @map[0][14] = 'boy'\n reset_map 0.5\n cant_leave_speech\n @map[0][14] = 'E'\n @map[0][13] = 'boy'\n reset_map 0.5\n @map[0][13] = 'E'\n @map[1][13] = 'boy'\n reset_map 0.5\n @map[1][13] = 'S'\n end\n # Guy walks back to his guard spot\n @map[2][13] = 'boy'\n reset_map 0.5\n @map[2][13] = 'S'\n @map[2][12] = 'boy'\n reset_map 0.5\n @map[2][12] = 'S'\n @map[2][11] = 'boy'\n reset_map 0.5\n @map[2][11] = 'S'\n @map[2][10] = 'boy'\n end\n end\n end\n\n if direction == 'up'\n case @pos_x\n when 7\n case @pos_y\n when 8 # Enter Player Home\n PlayerHomeHouse.new(@player, 'bot').begin\n when 17 # Prof Birch's House\n ProfBirchHome.new(@player).begin\n end\n when 15\n if @pos_y == 11 # Prof Birch's Pokemon Lab\n ProfBirchLab.new(@player).begin\n end\n when 1 \n if @pos_y == 13 || @pos_y == 14 # Exit map at top to Route101 Map\n\n if @player.littleroot == 'third' && @talk == 0\n slowly(\"I can hear someone shouting down the\\nroad here.\")\n reset_map\n slowly(\"What should I do? What should we do?\\nSomeody has to go help...\")\n reset_map\n @talk += 1 # Don't do the talk again\n elsif @player.littleroot == 'second'\n nil\n else\n @player.littleroot = 'normal' # Set the little root map to be loaded next time\n Route101.new(@player).begin\n end\n end\n end\n end\n\n \n super # Carry on as normal\n end",
"title": ""
},
{
"docid": "822345aba22a13eeb746457cd5bb35fe",
"score": "0.64059997",
"text": "def update_self_movement\n return if $game_system.story_mode?\n if !@pathfinding_moves.empty?\n process_pathfinding_movement\n #elsif BattleManager.valid_battler?(self) && @current_target\n # chase_target\n elsif near_the_screen? && @stop_count > stop_count_threshold\n case @move_type\n when 1; move_type_random\n when 2; move_type_toward_player\n when 3; move_type_custom\n end\n end\n end",
"title": ""
},
{
"docid": "33a304f968825760d9ee73efaf1c8ca5",
"score": "0.63755476",
"text": "def move_away_from_player\n sx = distance_x_from_player\n sy = distance_y_from_player\n if sx != 0 or sy != 0\n if sx.abs > sy.abs # Horizontal distance is longer\n sx > 0 ? move_right : move_left # Prioritize left-right\n if @move_failed and sy != 0\n sy > 0 ? move_down : move_up\n end\n else # Vertical distance is longer\n sy > 0 ? move_down : move_up # Prioritize up-down\n if @move_failed and sx != 0\n sx > 0 ? move_right : move_left\n end\n end\n end\n end",
"title": ""
},
{
"docid": "005795b2d3bd35f10a5e00cc54f06079",
"score": "0.63477945",
"text": "def next_turn\n return false unless @game_on\n @monster.move\n if eaten?\n @winner = false\n @game_on = false\n true\n end\n end",
"title": ""
},
{
"docid": "192f5e63e2ac7bdde12b783692186f81",
"score": "0.6347253",
"text": "def check_for_castling_movement(piece)\n if piece.is_a?(King) && piece.color == \"white\"\n @white_king_moves = 1\n elsif piece.is_a?(Rook) && piece.color == \"white\" && @initial_column == 0 &&\n @initial_row == 0\n @left_white_rook_moves = 1\n elsif piece.is_a?(Rook) && piece.color == \"white\" && @initial_column == 0 &&\n @initial_row == 7\n @right_white_rook_moves = 1\n\n elsif piece.is_a?(King) && piece.color == \"black\"\n @black_king_moves = 1\n elsif piece.is_a?(Rook) && piece.color == \"black\" && @initial_column == 7 &&\n @initial_row == 0\n @left_black_rook_moves = 1\n elsif piece.is_a?(Rook) && piece.color == \"black\" && @initial_column == 7 &&\n @initial_row == 7\n @right_black_rook_moves = 1\n end\n end",
"title": ""
},
{
"docid": "c6ec439755fd0ce098ea0c0b0d00b470",
"score": "0.633869",
"text": "def act\n\t\t#If the creature is hostile and the player is in the same room, it will attack the player\n\t\tif hostile and $currentRoom == location\n\t\t\tattack\n\t\t#The Second thing a creature can do is move. If it is not static, it has a 50%\n\t\t#chance of moving to another adjacent room\t\t\n\t\telsif !@static\n\t\t\tif ((rand(100)+1)>50)\n\t\t\t\tmove\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2cbdfcaec4e0713af48c37a0ad21db55",
"score": "0.6336911",
"text": "def input_move\n x, y, x_diff, y_diff = input_target_cell\n\n return unless dungeon_cell_exists? x, y # player can't move there if a dungeon cell doesn't exist in that location\n return if enemy_at x, y # player can't move there if there is an enemy in that location\n\n state.x += x_diff # increments x by x_diff (so player moves left or right)\n state.y += y_diff # same with y and y_diff ( so player moves up or down)\n update_line_of_sight # updates visible cells\n end",
"title": ""
},
{
"docid": "0844a8361db5e843702580a82017d3c4",
"score": "0.6336748",
"text": "def d6(player, monster)\n\t\t\tdamage = (rand(1..6) + player.atkval)\n\t\t\tcrit_hit = rand(1..100)\n\n\t\t\t#Determine if the player's attack lands a critical hit for a damage modifier of 2x\n\t\t\tif player.level <=9 && crit_hit <= 15\n\t\t\t\tputs \"CRITICAL HIT!\"\n\t\t\t\tdamage *= 2\n\t\t\telsif player.level >=10 && crit_hit <= 20\n\t\t\t\tputs \"CRITICAL HIT!\"\n\t\t\t\tdamage *= 2\n\t\t\telse\n\t\t\t\tdamage = damage\n\t\t\tend\n\n\t\t\tmonster.hp -= damage\n\n\t\t\tif monster.hp >= 1\n\t\t\t\tputs \"#{player.name} slices the #{monster.name} for #{damage} HP!\"\n\t\t\t\taction\n\t\t\telse\n\t\t\t\tputs \"#{player.name} slays the #{monster.name} with a wicked blow!\"\n\t\t\t\tmonster_death\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "bb845721f5b9de6f553f1d2679927d2f",
"score": "0.6325816",
"text": "def setup_move\n # if allowed to change speed\n if @ai.state != BlizzABS::AI::MoveOnly\n # if return state and in caterpillar\n if @ai.state == BlizzABS::AI::Return && @cindex != nil\n # set to idle state\n @ai.state = BlizzABS::AI::Idle\n end\n # reset moving speed\n @move_speed = @normal_speed\n # increase moving speed if knockback\n @move_speed += 1 if @ai.state == BlizzABS::AI::Knockback\n # if in caterpillar\n elsif @cindex != nil\n # set to idle state\n @ai.state = BlizzABS::AI::Idle\n end\n end",
"title": ""
},
{
"docid": "d06dc986d782dbb57535088f9d13bd4b",
"score": "0.63216555",
"text": "def move(warrior)\n \t# Used to check if an enemy is near\n \tenemy_near = false\n \t# Scope the room in front\n \tscope_the_room(warrior, :forward)\n\n \t# Look at the spaces from warrior.look\n \t@@room_information[:spaces_ahead].each do |space|\n \t\tif space.captive?\n \t\t\t# If there is a captive nearest, we break so that the warrior moves forward\n \t\t\tbreak\n \t\telsif space.enemy?\n \t\t\t# Checks for the first enemy. Break if one is found and set enemy_near to true\n \t\t\tenemy_near = true\n \t\t\tbreak\n \t\tend\n \tend\n\n \t# Get the difference of previous health and current health to\n \t# determine if damage was taken\n \tdifference = @health - warrior.health\n\n \t# Don't want to die, so run\n \tif warrior.health <= @@THRESHHOLD and difference > 0\n \t\t@state = self.method(:run)\n \t\tupdate(warrior)\n \t# If the player hasn't taken damage and health is not full set \n \t# the state to rest and update\n \telsif difference <= 0 and @health != @@MAX_HEALTH\n \t\t@state = self.method(:rest)\n \t\tupdate(warrior)\n \t# If there is a captive ahead set the state to rescue and update\n \telsif warrior.feel.captive?\n \t\t@state = self.method(:rescue)\n \t\tupdate(warrior)\n \t# If there is an enemy ahead, set the state to attack and update\n \telsif warrior.feel.enemy? or enemy_near\n \t\t@state = self.method(:attack)\n \t\tupdate(warrior)\n \t# If there is a wall, turn around\n \telsif warrior.feel.wall?\n \t\twarrior.pivot!\n \t# If we found the stairs but are missing captives, we turn around to save them!\n \telsif warrior.feel.stairs? and @@room_information[:captives] > 0\n \t\twarrior.pivot!\n \telse\n \t\t# Otherwise walk\n \t\twarrior.walk!\n \tend\n end",
"title": ""
},
{
"docid": "a083f4446b45084848908202d84dc1db",
"score": "0.62932944",
"text": "def next_move_correct?(ary,attacking = false)\n false\n end",
"title": ""
},
{
"docid": "534088aff6539c37ee7cec230d9e3db0",
"score": "0.6267869",
"text": "def move(move,player)\n\n\t\t#Checks if move is valid\n\t\tif !(@board_matrix[move] == 0)\n\t\t\traise \"Position already filled\"\n\t\t\treturn\n\t\telsif !((0...8) === move)\n\t\t\traise \"Position must be between 0 - 8\"\n\t\tend\n\t\t#Makes move\n\n\n\n\t\t#Checks for wining condition?\n\n\tend",
"title": ""
},
{
"docid": "e7c8b4da4e7050857926b0ec03719b62",
"score": "0.62649405",
"text": "def turn_toward_player\n # Don't Turn if Direction Fix is ON\n return if @direction_fix\n # Determine Correct Distance to Target for Looping Maps\n sx, sy = character_distance($game_player)\n # If coordinates are equal\n if sx == 0 and sy == 0\n return\n end \n # If horizontal distance is longer\n if sx.abs > sy.abs\n # Turn to the right or left towards player\n sx > 0 ? turn_left : turn_right\n # If vertical distance is longer\n else\n # Turn up or down towards player\n sy > 0 ? turn_up : turn_down\n end\n end",
"title": ""
},
{
"docid": "4e507478fb31319a60b74f494710b43a",
"score": "0.6263893",
"text": "def move\n\t\texits = []\n\t\t#Determine which exits are available. Build an array of possible exits\n\t\tif $map.rooms[@location].north.to_i > -1 then exits << \"north\" end\n\t\tif $map.rooms[@location].northeast.to_i > -1 then exits << \"northeast\" end\n\t\tif $map.rooms[@location].east.to_i > -1 then exits << \"east\" end\n\t\tif $map.rooms[@location].southeast.to_i > -1 then exits << \"southeast\" end\n\t\tif $map.rooms[@location].south.to_i > -1 then exits << \"south\" end\n\t\tif $map.rooms[@location].southwest.to_i > -1 then exits << \"southwest\" end\n\t\tif $map.rooms[@location].west.to_i > -1 then exits << \"west\" end\n\t\tif $map.rooms[@location].northwest.to_i > -1 then exits << \"northwest\" end\n\t\tif $map.rooms[@location].up.to_i > -1 then exits << \"up\" end\n\t\tif $map.rooms[@location].down.to_i > -1 then exits << \"down\" end\n\t\t\n\t\t#Randomly choose one exit\n\t\tif exits.length > 0 then moved = true end\n\t\tr = rand(exits.length)\n\t\t\n\t\t#If the creature started in the same room as the player, tell the player about the move\n\t\tif @location == $currentRoom then\n\t\t\tputs(\"#{@name} leaves to the #{exits[r]}.\")\n\t\tend\n\t\t#Set the creature's location to the chose exit's target location\n\t\tcase( exits[r] )\n\t\t\twhen \"north\" then @location = $map.rooms[@location].north\n\t\t\twhen \"northeast\" then @location = $map.rooms[@location].northeast\n\t\t\twhen \"east\" then @location = $map.rooms[@location].east\n\t\t\twhen \"southeast\" then @location = $map.rooms[@location].southeast\n\t\t\twhen \"south\" then @location = $map.rooms[@location].south\n\t\t\twhen \"southwest\" then @location = $map.rooms[@location].southwest\n\t\t\twhen \"west\" then @location = $map.rooms[@location].west\n\t\t\twhen \"northwest\" then @location = $map.rooms[@location].northwest\n\t\t\twhen \"up\" then @location = $map.rooms[@location].up\n\t\t\twhen \"down\" then @location = $map.rooms[@location].down\n\t\tend\n\t\t#If the creature arrives in the same room as the player, tell the player\n\t\tif @location == $currentRoom then\n\t\t\tputs(\"#{@name} arrives.\")\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "fbaf5b8daec44d659e09da6ca75ce8f4",
"score": "0.62615114",
"text": "def moves_to_win\n @_moves_to_win ||= moves_to_score * max_score\n end",
"title": ""
},
{
"docid": "d44821384a7b0b2bcc121e319136c613",
"score": "0.6258663",
"text": "def internalMove\n\n if !@next_position.nil?\n x = (@next_position[0] - @center[0])\n y = (@next_position[1] - @center[1])\n distance = Math.sqrt((x**2 + y**2))\n\n if(distance <= @move_percent[0].abs || distance <= @move_percent[1].abs)\n if (@mull_count <= 0)\n chooseNextTile\n end\n\n chooseInternalTarget\n @mull_count -= 1\n else\n @sprite.x += @move_percent[0]\n @sprite.y += @move_percent[1]\n end\n\n @center = [(@sprite.w / 2) + @sprite.x, (@sprite.h / 2) + @sprite.y]\n end\n end",
"title": ""
},
{
"docid": "30ce65e24ba96b407781fc86ca57d295",
"score": "0.623892",
"text": "def move_type_escape_player\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n abs_sx = sx > 0 ? sx : -sx\n abs_sy = sy > 0 ? sy : -sy\n if sx + sy >= 20\n move_random\n return\n end\n move_away_from_player\n end",
"title": ""
},
{
"docid": "7e2fa4dac6fc3e23a2f55308e90726ca",
"score": "0.6230858",
"text": "def battler_movement_update(battler)\n if battler.hit_animation and not \n (battler.now_action.nil? and not battler.attack?)\n set_move_postion(battler)\n end\n end",
"title": ""
},
{
"docid": "dc27355223c307f767da7a1e6bd68167",
"score": "0.6230433",
"text": "def attack_worth_it?(piece, attacking_pos, pos)\n enemy_piece = board.return_piece(attacking_pos)\n my_piece_value = board.return_piece_value(piece.to_s.split(\"\")[1].to_sym)\n enemy_piece.nil? ? enemy_piece_value = 10 : enemy_piece_value = board.return_piece_value(enemy_piece.to_s.split(\"\")[1].downcase.to_sym)\n\n #testing move placement\n game.current_player.color == \"white\" ? current_claimed_pieces = game.claimed_black_pieces.count : current_claimed_pieces = game.claimed_white_pieces.count\n board.place_move(piece, attacking_pos, game)\n board.erase_piece(pos)\n game.current_player.color == \"white\" ? new_claimed_pieces = game.claimed_black_pieces : new_claimed_pieces = game.claimed_white_pieces\n\n enemy_moves = get_all_moves(game.enemy_color(color))\n\n if enemy_counter?(enemy_moves, attacking_pos)\n if my_piece_value <= enemy_piece_value\n game.reverse_move(game.current_player.color, current_claimed_pieces, new_claimed_pieces, attacking_pos)\n board.place_move(piece, pos, game)\n return true\n else\n game.reverse_move(game.current_player.color, current_claimed_pieces, new_claimed_pieces, attacking_pos)\n board.place_move(piece, pos, game)\n return false\n end\n else\n game.reverse_move(game.current_player.color, current_claimed_pieces, new_claimed_pieces, attacking_pos)\n board.place_move(piece, pos, game)\n return true\n end\n\n end",
"title": ""
},
{
"docid": "49fa94066e4b50314cd889d743b30008",
"score": "0.62218535",
"text": "def monster_attack\n\t\t\tputs \"The #{monster.name} attacks #{player.name}!\"\n\t\t\t#rolling for success\n\t\t\tmscore = rand(1..20)\n\n\t\t\tif mscore >= 8\n\t\t\t\tmonster_attack_success\n\t\t\telse\n\t\t\t\tputs \"The #{monster.name} misses with its attack!\"\n\t\t\t\taction\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "5c786cde067741801b11211144493608",
"score": "0.6219279",
"text": "def move_for(entity, battle); end",
"title": ""
},
{
"docid": "69e975ce6252610309342c8156f9204c",
"score": "0.62119573",
"text": "def move!\n return if @road.dist_btw_next_car(self) <= ONE_UNIT\n\n if about_to_enter_lane?\n enter_lane!\n elsif about_to_leave_lane?\n leave_lane!\n else\n move_a_unit!\n end\n end",
"title": ""
},
{
"docid": "4ab6424cad75ff27ba13e5f14677206e",
"score": "0.621183",
"text": "def enemy_move\n # choose random available position and remove it from list of available positions\n y, x = @available_positions.delete(@available_positions.sample)\n\n if @player_grid[y][x] # hit\n @player_grid[y][x] = 'x'\n\n true\n else # miss\n @player_grid[y][x] = '*'\n\n false\n end\nend",
"title": ""
},
{
"docid": "fc813026eb3965c81f182eba53adee12",
"score": "0.62098813",
"text": "def check_collisions\r\n @x_cell = @player_x / Cell::WIDTH\r\n @y_cell = @player_y / Cell::HEIGHT\r\n @x_sub_cell = @player_x % Cell::WIDTH\r\n @y_sub_cell = @player_y % Cell::HEIGHT\r\n\r\n if @player_move_x == 0 && @player_move_y == 0\r\n @map_cell = @map[ @y_cell ][ @x_cell + 1 ]\r\n\r\n if @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.direction == Cell::MOVING_EAST \\\r\n && @player_x >= ( @map_cell.left.to_i - ( Cell::WIDTH - Cell::MARGIN ) )\r\n\r\n @player_move_x = @map_cell.left.to_i - ( Cell::WIDTH - Cell::MARGIN ) - @player_x\r\n end\r\n\r\n @map_cell = @map[ @y_cell ][ @x_cell - 1 ]\r\n\r\n if @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.direction == Cell::MOVING_WEST \\\r\n && @player_x <= @map_cell.right.to_i + Cell::MARGIN\r\n\r\n @player_move_x = @map_cell.right.to_i + Cell::MARGIN - @player_x\r\n end\r\n\r\n @map_cell = @map[ @y_cell + 1 ][ @x_cell ]\r\n\r\n if @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.direction == Cell::MOVING_NORTH \\\r\n && @player_y >= ( @map_cell.top.to_i - ( Cell::HEIGHT - Cell::MARGIN ) )\r\n\r\n @player_move_y = @map_cell.top.to_i - ( Cell::HEIGHT - Cell::MARGIN ) - @player_y\r\n end\r\n\r\n @map_cell = @map[ @y_cell - 1 ][ @x_cell ]\r\n\r\n if @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.direction == Cell::MOVING_SOUTH \\\r\n && @player_y <= ( @map_cell.bottom.to_i + Cell::MARGIN )\r\n\r\n @player_move_y = @map_cell.bottom.to_i + Cell::MARGIN - @player_y\r\n end\r\n end\r\n\r\n # Check for collisions while player is moving west\r\n #\r\n if @player_move_x > 0\r\n @map_cell = @map[ @y_cell ][ @x_cell + 1 ]\r\n\r\n if @map_cell.value == Cell::EMPTY_CELL\r\n # Let the player keep on walkin'...\r\n elsif @map_cell.value == Cell::END_CELL\r\n show_end_screen\r\n elsif @map_cell.value == Cell::DOOR_CELL \\\r\n && @map_cell.state == Door::STATE_OPEN\r\n # Let the player pass through the open door...\r\n elsif @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.state == Pushwall::STATE_MOVING\r\n\r\n if @player_x >= ( @map_cell.left.to_i - ( Cell::WIDTH - Cell::MARGIN ) )\r\n @player_move_x = @map_cell.left.to_i - ( Cell::WIDTH - Cell::MARGIN ) - @player_x\r\n end\r\n elsif @x_sub_cell >= ( Cell::WIDTH - Cell::MARGIN )\r\n @player_move_x = -( @x_sub_cell - ( Cell::WIDTH - Cell::MARGIN ) )\r\n end\r\n\r\n # Check for collisions while player is moving east\r\n #\r\n elsif @player_move_x < 0\r\n @map_cell = @map[ @y_cell ][ @x_cell - 1 ]\r\n\r\n if @map_cell.value == Cell::EMPTY_CELL\r\n # Let the player keep on walkin'...\r\n elsif @map_cell.value == Cell::END_CELL\r\n show_end_screen\r\n elsif @map_cell.value == Cell::DOOR_CELL \\\r\n && @map_cell.state == Door::STATE_OPEN\r\n # Let the player pass through the open door...\r\n elsif @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.state == Pushwall::STATE_MOVING\r\n\r\n if @player_x <= ( @map_cell.right.to_i + Cell::MARGIN )\r\n @player_move_x = @map_cell.right.to_i + Cell::MARGIN - @player_x\r\n end\r\n elsif @x_sub_cell <= Cell::MARGIN\r\n @player_move_x = Cell::MARGIN - @x_sub_cell\r\n end\r\n end\r\n\r\n # Check for collisions while player is moving south\r\n #\r\n if @player_move_y > 0\r\n @map_cell = @map[ @y_cell + 1 ][ @x_cell ]\r\n\r\n if @map_cell.value == Cell::EMPTY_CELL\r\n # Let the player keep on walkin'...\r\n elsif @map_cell.value == Cell::END_CELL\r\n show_end_screen\r\n elsif @map_cell.value == Cell::DOOR_CELL \\\r\n && @map_cell.state == Door::STATE_OPEN\r\n # Let the player pass through the open door...\r\n elsif @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.state == Pushwall::STATE_MOVING\r\n\r\n if @player_y >= ( @map_cell.top.to_i - ( Cell::HEIGHT - Cell::MARGIN ) )\r\n @player_move_y = @map_cell.top.to_i - ( Cell::HEIGHT - Cell::MARGIN ) - @player_y\r\n end\r\n elsif @y_sub_cell >= ( Cell::HEIGHT - Cell::MARGIN )\r\n @player_move_y = -( @y_sub_cell - ( Cell::HEIGHT - Cell::MARGIN ) )\r\n end\r\n\r\n # Check for collisions while player is moving north\r\n #\r\n elsif @player_move_y < 0\r\n @map_cell = @map[ @y_cell - 1 ][ @x_cell ]\r\n\r\n if @map_cell.value == Cell::EMPTY_CELL\r\n # Let the player keep on walkin'...\r\n elsif @map_cell.value == Cell::END_CELL\r\n show_end_screen\r\n elsif @map_cell.value == Cell::DOOR_CELL \\\r\n && @map_cell.state == Door::STATE_OPEN\r\n # Let the player pass through the open door...\r\n elsif @map_cell.value == Cell::SECRET_CELL \\\r\n && @map_cell.state == Pushwall::STATE_MOVING\r\n\r\n if @player_y <= ( @map_cell.bottom.to_i + Cell::MARGIN )\r\n @player_move_y = @map_cell.bottom.to_i + Cell::MARGIN - @player_y\r\n end\r\n elsif @y_sub_cell <= Cell::MARGIN\r\n @player_move_y = Cell::MARGIN - @y_sub_cell\r\n end\r\n end\r\n\r\n @player_x = clip_value( @player_x + @player_move_x, Cell::WIDTH, @map_x_size - Cell::WIDTH )\r\n @player_y = clip_value( @player_y + @player_move_y, Cell::HEIGHT, @map_y_size - Cell::HEIGHT )\r\n\r\n @player_move_x = 0\r\n @player_move_y = 0\r\n end",
"title": ""
},
{
"docid": "e12dc99751724e498d50e70cbeebc1b4",
"score": "0.619255",
"text": "def HumanMove(skakiera_Human_Thinking)\r\n # UNCOMMENT TO SHOW INNER THINKING MECHANISM!\r\n #if(huo_debug == true)\r\n #{\r\n #\tConsole.WriteLine(\"HumanMove called\");\r\n #\tConsole.ReadKey();\r\n #}\r\n\r\n # 2009 version 1 change\r\n #if (@@First_Call_Human_Thought == true)\r\n #{\r\n #\t\t# store initial chessboard position\r\n #\t\tfor (iii_Human = 0; iii_Human <= 7; iii_Human++)\r\n #\t\t{\r\n #\t\t\tfor (jjj_Human = 0; jjj_Human <= 7; jjj_Human++)\r\n #\t\t\t{\r\n #\t\t\t\tskakiera_Human_Thinking[(iii_Human),(jjj_Human)] = Skakiera_Human_Thinking_init[(iii_Human),(jjj_Human)];\r\n #\t\t\t\tSkakiera_Human_Move_0[(iii_Human),(jjj_Human)] = Skakiera_Human_Thinking_init[(iii_Human),(jjj_Human)];\r\n #\t\t\t}\r\n #\t\t}\r\n #}\r\n\r\n\r\n # scan chessboard . find a piece of the human player . move to all\r\n # possible squares . check correctness and legality of move . if\r\n # all ok then measure the move's score . do the best move and handle\r\n # over to the ComputerMove function to continue analysis in the next\r\n # move (deeper depth...)\r\n \r\n\r\n for www1 in 0..7 do\r\n for rrr1 in 0..7 do\r\n\r\n if (((@@Who_Is_Analyzed.CompareTo(\"Human\") == 0) && ((((skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"Black King\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"Black Queen\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"Black Rook\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"Black Knight\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"Black Bishop\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"Black Pawn\") == 0)) && (@@m_PlayerColor.CompareTo(\"Black\") == 0)) || (((skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"White King\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"White Queen\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"White Rook\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"White Knight\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"White Bishop\") == 0) || (skakiera_Human_Thinking[(www1), (rrr1)].CompareTo(\"White Pawn\") == 0)) && (@@m_PlayerColor.CompareTo(\"White\") == 0)))))\r\n for ww in 0..7 do \r\n for rr in 0..7 do\r\n #try{\r\n\r\n # HUO DEBUG\r\n # Να αλλάξω το FinishingColumn / Rank έτσι ώστε να παίρνει όλες τις τιμές (-7 έως +7)!\r\n @@MovingPiece = skakiera_Human_Thinking[(www1), (rrr1)];\r\n @@m_StartingColumnNumber = www1 + 1;\r\n @@m_FinishingColumnNumber = ww + 1; #www1+ww;\r\n @@m_StartingRank = rrr1 + 1;\r\n @@m_FinishingRank = rr + 1; # rrr1+rr;\r\n\r\n # HUO DEBUG\r\n #if((@@m_StartingColumnNumber == 4) && (@@m_StartingRank == 7))\r\n #{\r\n #\tif((@@m_FinishingColumnNumber == 1) && (@@m_FinishingRank == 4))\r\n #\t{\r\n #\t\tConsole.WriteLine(\"test ok!\");\r\n #\t}\r\n #}\r\n\r\n # check the move\r\n CheckHumanMove(skakiera_Human_Thinking);\r\n # UNCOMMENT TO SHOW INNER THINKING MECHANISM!\r\n #if(huo_debug == true)\r\n #{\r\n #\tConsole.WriteLine(\"RETURNED TO HumanMove\");\r\n #\tConsole.ReadKey();\r\n #}\r\n end#end for rr\r\n end#end for ww\r\n end#end if (((@@Who_Is_Analyzed.CompareTo(\"Human\") == 0)\r\n\r\n end#end for rrr1\r\n end#end for www1\r\n\r\n # perform the best move of human opponent\r\n @@MovingPiece = skakiera_Human_Thinking[(@@Best_Move_Human_StartingColumnNumber - 1), (@@Best_Move_Human_StartingRank - 1)];\r\n skakiera_Human_Thinking[(@@Best_Move_Human_StartingColumnNumber - 1), (@@Best_Move_Human_StartingRank - 1)] = \"\";\r\n skakiera_Human_Thinking[(@@Best_Move_Human_FinishingColumnNumber - 1), (@@Best_Move_Human_FinishingRank - 1)] = @@MovingPiece;\r\n\r\n # call ComputerMove for the HY throught process to continue\r\n @@Move_Analyzed = @@Move_Analyzed + 1;\r\n\r\n @@Who_Is_Analyzed = \"HY\";\r\n\r\n for i in 0..7 do\r\n for j in 0..7 do\r\n @@Skakiera_Move_After[(i), (j)] = skakiera_Human_Thinking[(i), (j)];\r\n end\r\n end\r\n\r\n #######################################\r\n # UNCOMMENT TO (TRY TO) USE THREADS...\r\n #######################################\r\n # Issues with threads: You must have a seperate ComputerMove function for each\r\n # level of thinking (that is why I have the ComputerMove2,4,6 and 8 functions).\r\n # If you try to have only one ComputerMove function and call it will the thread\r\n # calling code depicted below, you will end up calling a new ComputerMove function\r\n # every time you start a new thread, thus having the program not thinking! :)\r\n # HOWEVER, I have found out that the use of threads is not going to work after\r\n # all because each branch of thinking (e.g. for ThinkingDepth = 4: ComputerMove2,\r\n # HumanMove, ComputerMove4, HumanMove, found the best move for that variant, go\r\n # back to the loop of ComputerMove2, HumanMove, ComputerMove4, HumanMove, found\r\n # the best move for that variant etc) must be completed sequentially. If you\r\n # attempt to create a new thread each time the ComputerMove4 needs to be called,\r\n # then the computer will lose the proper order of thinking (which is controlled\r\n # by the ComputerMove4 \"for\" loop) and the program will not function correctly.\r\n ######################################/\r\n\r\n #if (@@Move_Analyzed == 2)\r\n #{\r\n # HuoChess_main newChess = HuoChess_main.new;\r\n # # Creating a Thread reference object in one line from a member method\r\n # Thread thr2 = new Thread(new ParameterizedThreadStart(HuoChess_main.ComputerMove2));\r\n # #HuoChess_main.ComputerMove2(@@Skakiera_Move_After);\r\n # thr2.Start(@@Skakiera_Move_After);\r\n # Console.WriteLine(\"New thread started (@@Move analyzed = 2)\");\r\n #}\r\n #elsif (@@Move_Analyzed == 4)\r\n #{\r\n # HuoChess_main newChess = HuoChess_main.new;\r\n # # Creating a Thread reference object in one line from a member method\r\n # Thread thr2 = new Thread(new ParameterizedThreadStart(HuoChess_main.ComputerMove2));\r\n # #HuoChess_main.ComputerMove4(@@Skakiera_Move_After);\r\n # thr2.Start(@@Skakiera_Move_After);\r\n # Console.WriteLine(\"New thread started (@@Move analyzed = 4)\");\r\n #}\r\n\r\n ##########/\r\n # 2009 v4 change\r\n ##########/\r\n # v0.82\r\n if (@@Move_Analyzed == 2)\r\n @@HuoChess_new_depth_2.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 4)\r\n @@HuoChess_new_depth_4.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 6)\r\n @@HuoChess_new_depth_6.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 8)\r\n @@HuoChess_new_depth_8.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 10)\r\n @@HuoChess_new_depth_10.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 12)\r\n @@HuoChess_new_depth_12.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 14)\r\n @@HuoChess_new_depth_14.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 16)\r\n @@HuoChess_new_depth_16.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 18)\r\n @@HuoChess_new_depth_18.ComputerMove_template(@@Skakiera_Move_After);\r\n elsif (@@Move_Analyzed == 20)\r\n @@HuoChess_new_depth_20.ComputerMove_template(@@Skakiera_Move_After);\r\n end\r\n # v0.82\r\n ##########/\r\n # 2009 v4 change\r\n ##########/\r\n\r\n end",
"title": ""
},
{
"docid": "c6722e5f3f20c773673627a79b0dcf7c",
"score": "0.61778325",
"text": "def pick_move\t\t\n\t\t# Naive AI: always take one turn, and walk towards the target if possible\n\t\tmyself = self.entity.get(:display)\n\t\t\n\t\t# Randomly decide if you should go horizontally or vertically first\n\t\t# Otherwise, you'll always close distance on the shortest axis\n\t\tif rand(2) == 1\n\t\t\t# Try to move horizontally first\n\t\t\tx = get_move_x_dir\n\t\t\ty = x == myself.x ? get_move_y_dir : myself.y\n\t\telse\n\t\t\t# try to move vertically first\n\t\t\ty = get_move_y_dir\n\t\t\tx = y == myself.y ? get_move_x_dir : myself.x\n\t\tend\n\t\t\t\t\n\t\treturn {:x => x, :y => y}\n\tend",
"title": ""
},
{
"docid": "347ab5e6d183b311304c4f341080acd5",
"score": "0.617435",
"text": "def player_move_on_cracked_floor_update\n if (sys_tag = system_tag) == CrackedSoil\n $game_map.data[@x, @y, 0] = $game_map.data[@x, @y, 0] + 1\n # The player falls if it has not the right speed and it's now a hole\n $game_temp.common_event_id = Game_CommonEvent::HOLE_FALLING if system_tag == Hole && @move_speed < 5\n elsif sys_tag == Hole\n $game_temp.common_event_id = Game_CommonEvent::HOLE_FALLING\n end\n end",
"title": ""
},
{
"docid": "092ed025c25c90d0eab502d2bcd1839d",
"score": "0.61721236",
"text": "def move_away_from_player\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n if sx == 0 and sy == 0\n return\n end\n abs_sx = sx.abs\n abs_sy = sy.abs\n if abs_sx == abs_sy\n rand(2) == 0 ? abs_sx += 1 : abs_sy += 1\n end\n if abs_sx > abs_sy\n sx > 0 ? move_right : move_left\n if not moving?\n rand(2) == 1 ? move_down : move_up\n end\n else\n sy > 0 ? move_down : move_up\n if not moving?\n rand(2) == 1 ? move_right : move_left\n end\n end\n end",
"title": ""
},
{
"docid": "202315fa829b81012ddca0e12cc3d0b2",
"score": "0.61632687",
"text": "def move\n\t\tself.location += rand(1..6)\n# keeps track of horses location\n# move will make the example horse move forward a random number 1-10 characters\n\tend",
"title": ""
},
{
"docid": "a5ad6bf7676b3f8f0a08030a9b819869",
"score": "0.61601764",
"text": "def test_do_not_move\n @player.visits = 7\n @player.current_location = @sutter_creek\n @g.move_from_location(@player)\n assert_equal(@sutter_creek, @player.current_location)\n end",
"title": ""
},
{
"docid": "25b9761e0f5aa273beae213132a79c7b",
"score": "0.61436385",
"text": "def move(direction)\n\t\tif direction.casecmp('n') == 0 && game_map.is_valid_move(\"n\") == true\n\t\t\tgame_map.player_row -= 1\n\t\t\tadjust_map(game_map.player_col, game_map.player_row)\n\n\t\telsif direction.casecmp('s') == 0 && game_map.is_valid_move(\"s\") == true\n\t\t\tgame_map.player_row += 1\n\t\t\tadjust_map(game_map.player_col, game_map.player_row)\n\n\t\telsif direction.casecmp('e') == 0 && game_map.is_valid_move(\"e\") == true\n\t\t\tgame_map.player_col += 1\n\t\t\tadjust_map(game_map.player_col, game_map.player_row)\n\n\t\telsif direction.casecmp('w') == 0 && game_map.is_valid_move(\"w\") == true\n\t\t\tgame_map.player_col -= 1\n\t\t\tadjust_map(game_map.player_col, game_map.player_row)\n\n\t\telse\n\t\t\tinsert_text(\"That is not a valid move.\\n\")\n\t\tend\n\n\t\tif rand(100) > 50\n\t\t\tfight\n\t\telse\n\t\t\t# do nothing\n\t\tend\n\tend",
"title": ""
},
{
"docid": "03833bda82a13638777625c6c14fc676",
"score": "0.6138797",
"text": "def move\n stepx = rand(3) - 1\n stepy = rand(3) - 1\n @x += stepx * @step\n @y += stepy * @step\n\n # x,y limitter\n @x = 0 if @x < 0\n @x = @max_x if @x > @max_x\n @y = 0 if @y < 0\n @y = @max_y if @y > @max_y\n end",
"title": ""
},
{
"docid": "c417e2160ad4c72735b9f74135bfda1e",
"score": "0.61357355",
"text": "def move_away_from_player\r\n # Get difference in player coordinates\r\n sx = @x - $game_player.x\r\n sy = @y - $game_player.y\r\n # If coordinates are equal\r\n if sx == 0 and sy == 0\r\n return\r\n end\r\n # Get absolute value of difference\r\n abs_sx = sx.abs\r\n abs_sy = sy.abs\r\n # If horizontal and vertical distances are equal\r\n if abs_sx == abs_sy\r\n # Increase one of them randomly by 1\r\n rand(2) == 0 ? abs_sx += 1 : abs_sy += 1\r\n end\r\n # If horizontal distance is longer\r\n if abs_sx > abs_sy\r\n # Move away from player, prioritize left and right directions\r\n sx > 0 ? move_right : move_left\r\n if not moving? and sy != 0\r\n sy > 0 ? move_down : move_up\r\n end\r\n # If vertical distance is longer\r\n else\r\n # Move away from player, prioritize up and down directions\r\n sy > 0 ? move_down : move_up\r\n if not moving? and sx != 0\r\n sx > 0 ? move_right : move_left\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "c8f673070ed0dec9d97e38379fb727bd",
"score": "0.61335194",
"text": "def turn_away_from_player\n # Don't Turn if Direction Fix is ON\n return if @direction_fix\n # Determine Correct Distance to Target for Looping Maps\n sx, sy = character_distance($game_player)\n # If coordinates are equal\n if sx == 0 and sy == 0\n return\n end \n # If horizontal distance is longer\n if sx.abs > sy.abs\n # Turn to the right or left away from player\n sx > 0 ? turn_right : turn_left\n # If vertical distance is longer\n else\n # Turn up or down away from player\n sy > 0 ? turn_down : turn_up\n end\n end",
"title": ""
},
{
"docid": "6cbe133765d27400b5005f98d5dd70dd",
"score": "0.6128136",
"text": "def determine_next_move\n\t\t#$logger.debug {\n\t\t#\traise \"#{ self } already moved\" if moved?\n\t\t#}\n\n\t\treturn true if collective_assembled?\n\n\t\tif evading?\n\t\t\t# Handle evasion elsewhere\n\t\t\t$logger.info \"#{ self } evading\"\n\t\t\treturn true\n\t\tend\n\n\t\treturn false if !orders?\n\n\t\t# Following happens when razing hills.\n\t\tif neighbor_enemies?(2)\n\t\t\t$logger.info { \" #{ self } right next to enemy, staying and ignoring orders.\" }\n\t\t\treturn :STAY\n\t\tend\n\n\t\tsquare.neighbors do |n|\n\t\t\tif n.food?\n\t\t\t\t$logger.info { \"#{ self } right next to food #{ n }.\" }\n\t\t\t\treturn :STAY\t\n\t\t\tend\n\t\tend\n\n\t\torder_sq = @orders[0].square\n\t\torder_order = @orders[0].order\n\t\t$logger.info \"Determining direction order #{ order_order } on #{ order_sq} for #{ self }\"\n\n\t\tif order_order == :DEFEND_HILL\n\t\t\td = Distance.get self.square, order_sq \n\n\t\t\t# Use of in_peril in order to get closer to hill than in_view\n\t\t\tif d.in_peril?\n\t\t\t\t# if on hill itself, move away\n\t\t\t\tif self.square == order_sq\n\t\t\t\t\t$logger.info { \"Defender moving away from hill #{ order_sq.to_s}.\" }\n\t\t\t\t\ttmp = self.default\n\t\t\t\t\ttmp = false if tmp.nil?\n\t\t\t\t\ttmp\n\t\t\t\telse\n\t\t\t\t\t$logger.info { \"Defending hill #{ order_sq.to_s}.\" }\n\t\t\t\t\t#return :STAY\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend \n\t\tend\n\n\n\t\tif order_order == :DEFEND\n\t\t\td = Distance.get self.square, order_sq \n\n\t\t\t# Use of distance in order to get closer to location than in_view\n\t\t\tif ( self.square == order_sq ) or\n\t\t\t ( d.in_attack_range? and\n\t\t\t $pointcache.has_direct_path self.square, order_sq\n\t\t\t )\n\t\t\t\t$logger.info { \"Defending square #{ order_sq.to_s}.\" }\n\n\t\t\t\t#return :STAY\n\t\t\t\treturn false\n\t\t\tend \n\t\tend\n\nif false\n\t\t# check if harvest target is water\n\t\tif order_order == :HARVEST and evading?\n\t\t\tsq = order_sq\n\t\t\td = Distance.get self, sq\n\n\t\t\t# Use of in_danger here is not because of attack, but because\n\t\t\t# we want to get closer to the target square than in_view\n\t\t\tif d.in_danger? and @ai.map[ sq.row ][sq.col].water?\n\t\t\t\t$logger.info { \"#{ self.to_s } harvest target #{ sq } is water. Can't get any closer\" }\n\t\t\t\t@orders[0].offset = [ -( sq.row - self.row ), - (sq.col - self.col ) ]\n\t\t\t\t$logger.info { \"Set order offset to #{ @orders[0].offset }.\" }\n\t\t\t\t#return :STAY\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\nend\n\n\t\tif @orders[0].order == :ASSEMBLE\n\t\t\t# NB: method assemble removes :ASSEMBLE and other orders\n\t\t\t# from collective members\n\t\t\tif collective and collective.assemble\n\t\t\t\treturn :STAY\n\t\t\tend\n\t\tend\n\n\n\t\t#\n\t\t# Actual, regular movement\n\t\t#\n\n\t\tai.turn.check_maxed_out\n\t\titem = $pointcache.get self.square, order_sq\n\n\t\tif not item.nil? \n\t\t\tif item[3]\n\t\t\t\t$logger.info \"Invalid pointcache item detected\" # #{ item }\"\n\t\t\tend\n\n\t\t\titem[2]\t# is a direction\n\t\telse\n\t\t\t# This should never happen any more - but it does.....\n\t\t\t$logger.info \"WARNING: Nil item from pointcache\"\n\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bfdd15cc407c60e41fb31e045b500f96",
"score": "0.6124997",
"text": "def move_toward_player(is_player = true)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # is it the player\n if is_player\n # calculate differences in x and y\n dx, dy = @x - $game_player.x, @y - $game_player.y\n else # or only his remembered position\n # calculate differences in x and y\n dx = @AI_data.find_x > 0 ? @x - @AI_data.find_x : 0\n dy = @AI_data.find_y > 0 ? @y - @AI_data.find_y : 0\n end\n # determines where to move according to the x and y differences\n if dx < 0 && dy.abs <= pix*3.0/2 # player is right\n rand(pix*2).times {@force_move.push(6)}\n elsif dx > 0 && dy.abs <= pix*3.0/2 # player is left\n rand(pix*2).times {@force_move.push(4)}\n elsif dx.abs <= pix*3.0/2 && dy < 0 # player is down\n rand(pix*2).times {@force_move.push(2)}\n elsif dx.abs <= pix*3.0/2 && dy > 0 # player is up\n rand(pix*2).times {@force_move.push(8)}\n elsif dx > 0 && dy > 0 # player is up left\n rand(pix*2).times {@force_move.push(7)}\n elsif dx > 0 && dy < 0 # player is down left\n rand(pix*2).times {@force_move.push(1)}\n elsif dx < 0 && dy > 0 # player is up right\n rand(pix*2).times {@force_move.push(9)}\n elsif dx < 0 && dy < 0 # player is down right\n rand(pix*2).times {@force_move.push(3)}\n end\n end",
"title": ""
},
{
"docid": "bfdd15cc407c60e41fb31e045b500f96",
"score": "0.6124997",
"text": "def move_toward_player(is_player = true)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # is it the player\n if is_player\n # calculate differences in x and y\n dx, dy = @x - $game_player.x, @y - $game_player.y\n else # or only his remembered position\n # calculate differences in x and y\n dx = @AI_data.find_x > 0 ? @x - @AI_data.find_x : 0\n dy = @AI_data.find_y > 0 ? @y - @AI_data.find_y : 0\n end\n # determines where to move according to the x and y differences\n if dx < 0 && dy.abs <= pix*3.0/2 # player is right\n rand(pix*2).times {@force_move.push(6)}\n elsif dx > 0 && dy.abs <= pix*3.0/2 # player is left\n rand(pix*2).times {@force_move.push(4)}\n elsif dx.abs <= pix*3.0/2 && dy < 0 # player is down\n rand(pix*2).times {@force_move.push(2)}\n elsif dx.abs <= pix*3.0/2 && dy > 0 # player is up\n rand(pix*2).times {@force_move.push(8)}\n elsif dx > 0 && dy > 0 # player is up left\n rand(pix*2).times {@force_move.push(7)}\n elsif dx > 0 && dy < 0 # player is down left\n rand(pix*2).times {@force_move.push(1)}\n elsif dx < 0 && dy > 0 # player is up right\n rand(pix*2).times {@force_move.push(9)}\n elsif dx < 0 && dy < 0 # player is down right\n rand(pix*2).times {@force_move.push(3)}\n end\n end",
"title": ""
},
{
"docid": "ce3c18d8394cd00eb2063c97778123fe",
"score": "0.61247456",
"text": "def update( elapsed )\r\n # super elapsed\r\n\r\n # wander\r\n if attacking.nil? && @position == :standing && rand(1..1200) == 1 && @wander_range > 0\r\n if ( exit = @room.exits.sample)\r\n destination = exit.destination\r\n direction = exit.direction\r\n if direction && destination && destination.area == @room.area\r\n move( direction )\r\n end\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "37bf1eaa1f3b1ff88aa86f6f2ba7ee8b",
"score": "0.6118838",
"text": "def can_move?\n for r in 0..7\n for f in 0..7\n pos = Position.new(r,f)\n piece = @state[r][f]\n if piece[0] == @current_player\n if piece[1] == 'P'\n oc = (@current_player == 'B' ? 'W' : 'B')\n factor = (@current_player == 'B' ? -1 : 1)\n for k in -1..1\n if valid_move?(pos, Position.new(r+factor,f+k))\n return true\n end\n end\n if valid_move?(pos, Position.new(r+2*factor,f))\n return true\n end\n elsif piece[1] == 'R' or piece[1] == 'B' or piece[1] == 'Q'\n if piece[1] == 'R' or piece[1] == 'Q'\n for k in 0..r-1\n if file_move(pos, Position.new(k, f))\n return true\n end\n end\n for k in r+1..7\n if file_move(pos, Position.new(k, f))\n return true\n end\n end\n for k in 0..f-1\n if rank_move(pos, Position.new(r, k))\n return true\n end\n end\n for k in f+1..7\n if rank_move(pos, Position.new(r, k))\n return true\n end\n end\n end\n if piece[1] == 'B' or piece[1] == 'Q'\n nr = r\n nf = f\n while nr>0 and nf>0\n nr = nr-1\n nf = nf-1\n if diag_move(pos, Position.new(nr, nf))\n return true\n end\n end\n nr = r\n nf = f\n while nr<7 and nf<7\n nr = nr+1\n nf = nf+1\n if diag_move(pos, Position.new(nr, nf))\n return true\n end\n end\n nr = r\n nf = f\n while nr>0 and nf<7\n nr = nr-1\n nf = nf+1\n if diag_move(pos, Position.new(nr, nf))\n return true\n end\n end\n nr = r\n nf = f\n while nr<7 and nf>0\n nr = nr+1\n nf = nf-1\n if diag_move(pos, Position.new(nr, nf))\n return true\n end\n end\n end\n elsif piece[1] == 'N'\n if valid_move?(pos, Position.new(r-1,f-2))\n return true\n elsif valid_move?(pos, Position.new(r-1,f+2))\n return true\n elsif valid_move?(pos, Position.new(r-2,f-1))\n return true\n elsif valid_move?(pos, Position.new(r-2,f+1))\n return true\n elsif valid_move?(pos, Position.new(r+1,f-2))\n return true\n elsif valid_move?(pos, Position.new(r+1,f+2))\n return true\n elsif valid_move?(pos, Position.new(r+2,f-1))\n return true\n elsif valid_move?(pos, Position.new(r+2,f+1))\n return true\n end\n elsif piece[1] == 'K'\n if valid_move?(pos, Position.new(r-1,f-1))\n return true\n elsif valid_move?(pos, Position.new(r-1,f))\n return true\n elsif valid_move?(pos, Position.new(r-1,f+1))\n return true\n elsif valid_move?(pos, Position.new(r,f-1))\n return true\n elsif valid_move?(pos, Position.new(r,f+1))\n return true\n elsif valid_move?(pos, Position.new(r+1,f-1))\n return true\n elsif valid_move?(pos, Position.new(r+1,f))\n return true\n elsif valid_move?(pos, Position.new(r+1,f+1))\n return true\n end\n if castle? pos, Position.new(pos.rank, 2) or castle? pos, Position.new(pos.rank, 6)\n return true\n end\n end\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "14a24a12207543459e670264d4b1d4ca",
"score": "0.61111635",
"text": "def calculate_winning_move()\r\n puts \"Sorry mate! I am still being implemented. Will assist you soon in making a winning move.\"\r\n end",
"title": ""
},
{
"docid": "03563f4772b92647e6b246677e10c713",
"score": "0.6108137",
"text": "def is_possible_move(xOrig, yOrig, xDest, yDest)\n if @calculation_board.tab_piece[xOrig][yOrig] == nil # We check that there is a piece to move.\n return false\n end\n \n xDist = (xDest - xOrig).abs\n yDist = (yDest - yOrig).abs\n dist = xDist + yDist\n \n if xOrig < 0 || xOrig > 7 || yOrig < 0 || yOrig > 7 # The piece should be into the board.\n return false\n end\n \n if xDest < 0 || xDest > 7 || yDest < 0 || yDest > 7 # The piece should not go out of the board.\n return false\n end\n \n if !@calculation_board.tab_piece[xOrig][yOrig].p_is_king # We check that the piece is going the right way.\n if @calculation_board.tab_piece[xOrig][yOrig].p_is_white && xDest > xOrig # White pieces must go top. \n return false\n end\n \n if !@calculation_board.tab_piece[xOrig][yOrig].p_is_white && xDest < xOrig # Black pieces must go down.\n return false\n end\n end\n \n if dist % 2 != 0 || dist > 4 # We check if the move is authorized.\n return false\n end\n \n if @calculation_board.tab_piece[xDest][yDest] != nil # We check that the destination case is free.\n return false\n end\n \n if dist == 4 # If the move implied to eat another. \n moved_piece = @calculation_board.tab_piece[xOrig][yOrig]\n skipped_piece = @calculation_board.tab_piece[(xOrig + xDest) / 2][(yOrig + yDest) / 2]\n \n if skipped_piece == nil # We forbid the player to jump over an empty case.\n return false\n end\n \n if (skipped_piece.p_is_white == true && moved_piece.p_is_white == true) || (skipped_piece.p_is_white == false && moved_piece.p_is_white == false) # We forbid the player to eat his own pieces.\n return false\n end\n end\n \n # At this point, the move is totally allowed.\n \n return true\n \n end",
"title": ""
},
{
"docid": "ba1a2b308fd051bcfbcc663414c42e81",
"score": "0.61063755",
"text": "def process_movement(move, treasure, monster, infoRoom)\n flee = rand()\n if(monster != 0 && move != \"R\" && move != \"F\")\n puts(\"FIGHT OR RUN!\")\n return false\n elsif(monster != 0 && move == \"R\" && flee > 0.7)\n loop do\n puts('WHICH WAY DO YOU WANT TO FLEE?')\n move = get_movement\n if isPossibleMove(move, infoRoom)\n move(move, infoRoom)\n return true\n else\n p errorMove(move)\n return false\n end\n end\n elsif(monster != 0 && move == \"R\" && flee < 0.6)\n puts('NO YOU MUST STAND AND FIGHT')\n sleep(2)\n bePrepared(infoRoom['monster_id'])\n return true\n elsif(monster != 0 && move == \"F\")\n bePrepared(infoRoom['monster_id'])\n return true\n elsif(move == \"Q\")\n update_info_player('time_playing', get_time_playing(@startTime, Time.now))\n puts(\"YOUR SCORE IS #{get_score}\")\n exit\n elsif(move == \"T\")\n puts(\"\\n********************************\\n\")\n puts(\"* YOUR TALLY AT PRESENT IS #{get_score} *\")\n puts(\"********************************\\n\")\n sleep(3)\n return true\n elsif(move == \"I\")\n inventory\n update_info_player('prev_room', @currentRoom)\n sleep(2)\n return true\n elsif(move == \"C\" && @food == 0)\n puts(\"YOU HAVE NO FOOD\")\n elsif(move == \"C\")\n eat_food\n update_info_player('prev_room', @currentRoom)\n sleep(2)\n return true\n elsif(move == \"F\" && monster == 0)\n puts(\"THERE IS NOTHING TO FIGTH HERE\")\n elsif(move == \"P\" && treasure == 0)\n puts(\"THERE IS NOTHING TO PICK UP\")\n sleep(2)\n return true\n elsif(move == \"P\")\n @wealth += infoRoom['treasure_value']\n update_info_player('wealth', @wealth)\n update_info_map(@currentRoom, 'treasure', 0)\n elsif(move == \"M\" && @amulet == 1)\n teleport\n sleep(2)\n return true\n else\n if isPossibleMove(move, infoRoom)\n move(move, infoRoom)\n return true\n else\n p errorMove(move)\n return false\n end\n end\n end",
"title": ""
},
{
"docid": "57f5dfcb9f18189e4a24ceeb6766a87f",
"score": "0.6104857",
"text": "def move\n\t\t@move = rand(6)\n\t\tputs \"NPC played:\"\n\t\tif self.rock > 0 && @move < self.rock\n\t\t\tputs \"ROCK\"\n\t\t\treturn 0\n\t\telsif self.paper > 0 && @move < (self.rock + self.paper)\n\t\t\tputs \"PAPER\"\n\t\t\treturn 1\n\t\telse\n\t\t\tputs \"SCISSORS\"\n\t\t\treturn 2\n\t\tend\n\tend",
"title": ""
},
{
"docid": "86b7cd7851b3bfff05d40a581c51dc13",
"score": "0.6096933",
"text": "def move\n case @facing\n when 'N'\n @y += 1 if move_possible?(@x, @y+1)\n when 'S'\n @y -= 1 if move_possible?(@x, @y-1)\n when 'E'\n @x += 1 if move_possible?(@x+1, @y)\n when 'W'\n @x -= 1 if move_possible?(@x-1, @y)\n else\n raise 'Wrong move.'\n end\n end",
"title": ""
},
{
"docid": "f3a61ef4b2025ca7d8a9a658f29562a4",
"score": "0.6090565",
"text": "def check_move(tile)\n if self.checked_tiles.include?(tile)\n puts \"Already revealed position\"\n play_turn\n end\n end",
"title": ""
},
{
"docid": "33c12e029d2bf2774e513a4c7ce328ce",
"score": "0.6087359",
"text": "def check_move (x, y, map)\n # Check if -1 <= x <= 1 and the position the bot wants to be at is Air\n map.in_bounds(@x + x, @y + y) and x.between?(-1, 1) and y.between?(-1, 1) and map.get(@x + x, @y + y).is_ghost\n end",
"title": ""
},
{
"docid": "9a398d899a6357ff733ef8eea99811b4",
"score": "0.6085399",
"text": "def move_legal?(move)\n# i think it makes sure it stays on the board\n return true if move[0].between?(0, 7) && move[1].between?(0,7)\n false\n end",
"title": ""
},
{
"docid": "4c52dabfda0ed74a5d2ae0cec3db18f2",
"score": "0.60791814",
"text": "def set_move_target_postion\n @battler_one_target = nil\n if @movement and @step_foward\n action_step_foward\n elsif @movement and @action_all and not @action_center\n action_target_all\n elsif @movement and @action_center\n action_target_center\n elsif @movement and not @step_foward and not \n @action_center and not @action_all\n action_one_target\n else\n @target_x = @actual_x\n @target_y = @actual_y\n end\n end",
"title": ""
},
{
"docid": "85b5c55e2d8dc8fc664b506a5558101b",
"score": "0.6077212",
"text": "def best_move\n find_at_risk_square(mark) ||\n find_at_risk_square(@human.mark) ||\n center_square ||\n corner_play ||\n board.unmarked_keys.sample\n end",
"title": ""
},
{
"docid": "98e9bf5e57c07f1a9c65aad62d821f82",
"score": "0.6064427",
"text": "def valid_move?(x_destination, y_destination, knight = false)\n return false if x_destination == x_position && y_destination == y_position\n return false if !(0..7).cover?(x_destination) || !(0..7).cover?(y_destination)\n return true if knight\n !obstructed?(x_destination, y_destination)\n end",
"title": ""
},
{
"docid": "4f59e6e06005c59ae2ed7697ac28fab2",
"score": "0.60643804",
"text": "def move\n return move_if_valid(@robot.y + directions[@robot.f][0], @robot.x + directions[@robot.f][1], @robot)\n end",
"title": ""
},
{
"docid": "4eeab9cb433fa876325b6113c5a1213f",
"score": "0.6056019",
"text": "def winning_move?(col, row, player)\r\n # TODO clean this method up, it's pretty ugly right now\r\n left_count = get_count(col, row, player) { |col, row| [col - 1, row] }\r\n right_count = get_count(col, row, player) { |col, row| [col + 1, row] }\r\n # checking as we add, so no need to check up from current coordinates\r\n down_count = get_count(col, row, player) { |col, row| [col, row + 1] }\r\n down_left_count = get_count(col, row, player) { |col, row| [col - 1, row + 1] }\r\n up_right_count = get_count(col, row, player) { |col, row| [col + 1, row - 1] }\r\n up_left_count = get_count(col, row, player) { |col, row| [col - 1, row - 1] }\r\n down_right_count = get_count(col, row, player) { |col, row| [col + 1, row + 1] }\r\n\r\n\r\n if (left_count + 1 + right_count >= 4 ||\r\n down_count + 1 >= 4 ||\r\n down_left_count + 1 + up_right_count >= 4 ||\r\n up_left_count + 1 + down_right_count >= 4)\r\n return true\r\n else\r\n return false\r\n end\r\n end",
"title": ""
},
{
"docid": "7a0c533cfa63f76b1a051fa9039a8161",
"score": "0.60504395",
"text": "def move(entity, direction)\n moved = false\n x, y = translate(entity.position, direction)\n \n if stairs?(x,y)\n\tif entity == @hero && up?(x,y)\n\t ascend! \n\telsif entity == @hero && down?(x,y)\n\t descend! \n\tend\n\tmoved = true\n end\n\n if entity_at?(x,y)\n\tif entity_at(x,y).type == :gold\n\t # collect gold!\n\t @gold ||= 0\n\t @gold = @gold + entity_at(x,y).amount\n\t @entities[@current_depth] -= [entity_at(x,y)]\n\tend\n end\n\n unless moved || wall?(x,y)\n\tentity.move(direction)\n\tmoved = true\n end\n\n moved\n end",
"title": ""
},
{
"docid": "4fff58d68862f1ce6fcfac90299ba8a5",
"score": "0.60441643",
"text": "def first_round_strategy(computer_move)\n if $player_points == [1]\n computer_move = 8\n elsif $player_points == [3]\n computer_move = 6\n elsif $player_points == [7]\n computer_move = 2\n elsif $player_points == [9]\n computer_move = 0\n else\n computer_move = rand(9)\n end\n return computer_move\nend",
"title": ""
},
{
"docid": "46950a2b0f18573d3ee7fb0e70727958",
"score": "0.6043642",
"text": "def move_away_from_player\n # Get difference in player coordinates\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n # If coordinates are equal\n if sx == 0 and sy == 0\n return\n end\n # Get absolute value of difference\n abs_sx = sx.abs\n abs_sy = sy.abs\n # If horizontal and vertical distances are equal\n if abs_sx == abs_sy\n # Increase one of them randomly by 1\n rand(2) == 0 ? abs_sx += 1 : abs_sy += 1\n end\n # If horizontal distance is longer\n if abs_sx > abs_sy\n # Move away from player, prioritize left and right directions\n sx > 0 ? move_right : move_left\n if not moving? and sy != 0\n sy > 0 ? move_down : move_up\n end\n # If vertical distance is longer\n else\n # Move away from player, prioritize up and down directions\n sy > 0 ? move_down : move_up\n if not moving? and sx != 0\n sx > 0 ? move_right : move_left\n end\n end\n end",
"title": ""
},
{
"docid": "46950a2b0f18573d3ee7fb0e70727958",
"score": "0.6043642",
"text": "def move_away_from_player\n # Get difference in player coordinates\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n # If coordinates are equal\n if sx == 0 and sy == 0\n return\n end\n # Get absolute value of difference\n abs_sx = sx.abs\n abs_sy = sy.abs\n # If horizontal and vertical distances are equal\n if abs_sx == abs_sy\n # Increase one of them randomly by 1\n rand(2) == 0 ? abs_sx += 1 : abs_sy += 1\n end\n # If horizontal distance is longer\n if abs_sx > abs_sy\n # Move away from player, prioritize left and right directions\n sx > 0 ? move_right : move_left\n if not moving? and sy != 0\n sy > 0 ? move_down : move_up\n end\n # If vertical distance is longer\n else\n # Move away from player, prioritize up and down directions\n sy > 0 ? move_down : move_up\n if not moving? and sx != 0\n sx > 0 ? move_right : move_left\n end\n end\n end",
"title": ""
},
{
"docid": "46950a2b0f18573d3ee7fb0e70727958",
"score": "0.6043642",
"text": "def move_away_from_player\n # Get difference in player coordinates\n sx = @x - $game_player.x\n sy = @y - $game_player.y\n # If coordinates are equal\n if sx == 0 and sy == 0\n return\n end\n # Get absolute value of difference\n abs_sx = sx.abs\n abs_sy = sy.abs\n # If horizontal and vertical distances are equal\n if abs_sx == abs_sy\n # Increase one of them randomly by 1\n rand(2) == 0 ? abs_sx += 1 : abs_sy += 1\n end\n # If horizontal distance is longer\n if abs_sx > abs_sy\n # Move away from player, prioritize left and right directions\n sx > 0 ? move_right : move_left\n if not moving? and sy != 0\n sy > 0 ? move_down : move_up\n end\n # If vertical distance is longer\n else\n # Move away from player, prioritize up and down directions\n sy > 0 ? move_down : move_up\n if not moving? and sx != 0\n sx > 0 ? move_right : move_left\n end\n end\n end",
"title": ""
},
{
"docid": "84941687ea5460d4367678e507434262",
"score": "0.6043585",
"text": "def first_move?\n ((position_y).eql?(1) && white? || (position_y).eql?(6) && black?)\n end",
"title": ""
},
{
"docid": "c501b4e4ba17d913c0f813c2d4d9c52f",
"score": "0.60365397",
"text": "def battler_custom_move(battler, pos_x, pos_y)\n return if battler.nil?\n return if battler.actor? and not $game_party.actors.include?(battler)\n return if !battler.actor? and not $game_troop.enemies.include?(battler)\n battler.target_x = pos_x\n battler.target_y = pos_y\n battler.move_pose = true\n battler_face_direction(battler)\n end",
"title": ""
},
{
"docid": "a8c3ce7a58e2e556c5bd092953741d3c",
"score": "0.60316545",
"text": "def determine_action(walls, units, unit, debug_draw, attack_only)\n\n me = units[unit]\n\n return {} unless me.hp > 0\n \n height = walls.length\n width = walls[0].length\n \n target_map = copy_world(walls)\n\n target_count = 0\n \n # add everyone to the map with enemies as E and friendlies as walls\n # excluding those with no hitpoints\n units.each do |unit|\n next if unit.hp <= 0 \n \n if unit.kind != me.kind\n target_map[unit.y][unit.x] = 'E'\n target_count += 1\n else\n target_map[unit.y][unit.x] = '#'\n end\n end\n\n return {end: true} if target_count == 0\n \n # Don't move if already in range of a target\n # We need the targets ordered by hitpoints then reading\n # order\n\n targets = []\n\n row = me.y\n col = me.x\n\n # classify the targets into a coordinate array, hit point count and reading order\n if row >=1 and target_map[row-1][col] == 'E'\n # Up\n unit = get_unit_at(units,row-1,col)\n targets << [[row-1,col],unit.hp,0]\n end\n \n if col >=1 and target_map[row][col-1] == 'E'\n # Left\n unit = get_unit_at(units,row,col-1)\n targets << [[row,col-1],unit.hp,1]\n end\n \n if col < width-1 and target_map[row][col+1] == 'E'\n # Right\n unit = get_unit_at(units,row,col+1)\n targets << [[row,col+1],unit.hp,2]\n end\n \n if row < height-1 and target_map[row+1][col] == 'E'\n # Down\n unit = get_unit_at(units,row+1,col)\n targets << [[row+1,col],unit.hp,3]\n end\n\n unless targets.empty?\n min_hp = targets.map{|n| n[1]}.min\n\n targets = targets.filter{|n| n[1] == min_hp}\n\n targets = targets.sort_by{|n| n[2]}\n\n target = targets.first[0]\n target_unit = get_unit_at(units, target[0], target[1])\n \n return {attack: target_unit}\n end\n\n return {} if attack_only\n \n # for all enemies mark the target attack positions with ?\n (0...height).each do |row|\n (0...width).each do |col|\n\n this_unit = target_map[row][col]\n\n if target_map[row][col] == 'E'\n # left target\n if col >=1 and target_map[row][col-1] == '.'\n target_map[row][col-1] = '?'\n end\n\n # right target\n if col < width-1 and target_map[row][col+1] == '.'\n target_map[row][col+1] = '?'\n end\n\n # above target\n if row >=1 and target_map[row-1][col] == '.'\n target_map[row-1][col] = '?'\n end\n\n # below target\n if row < height-1 and target_map[row+1][col] == '.'\n target_map[row+1][col] = '?'\n end\n \n end\n\n end\n end\n \n draw_world(target_map, []) if debug_draw\n\n path_map = copy_world(target_map)\n \n # Now iteratively fill out the distances from me\n\n path_map[me.y][me.x] = 0\n changes = 0\n\n loop do\n\n (0...height).each do |row|\n (0...width).each do |col|\n if ['.', '?'].include? path_map[row][col]\n lowest_value = [1000]\n # left\n if col >=1 and path_map[row][col-1].is_a? Numeric\n lowest_value << path_map[row][col-1]\n end\n \n # right target\n if col < width-1 and path_map[row][col+1].is_a? Numeric\n lowest_value << path_map[row][col+1]\n end\n \n # above target\n if row >=1 and path_map[row-1][col].is_a? Numeric\n lowest_value << path_map[row-1][col]\n end\n \n # below target\n if row < height-1 and path_map[row+1][col].is_a? Numeric\n lowest_value << path_map[row+1][col]\n end\n \n lowest_value = lowest_value.min\n \n if lowest_value < 1000\n path_map[row][col] = lowest_value + 1\n changes += 1\n end\n \n end\n end\n end\n\n if changes == 0\n break\n else\n changes = 0\n end\n \n end\n\n draw_world(path_map, []) if debug_draw\n \n # Target locations - Anywhere where the original map has a question nmark\n # and the path map has a number ...\n # The targets will be a map of coordinates and cost\n\n reachable_targets = {}\n \n (0...height).each do |row|\n (0...width).each do |col|\n\n if target_map[row][col] == '?' and path_map[row][col].is_a? Numeric\n\n reachable_targets[[row,col]] = path_map[row][col]\n \n end\n \n end\n end\n\n min = reachable_targets.values.min || 0\n nearest_targets = reachable_targets.filter {|coord,distance| distance == min}\n\n # No reachable target, return no action\n return {} if nearest_targets.length == 0\n \n # Sort by reading order\n # Default sorting of arrays will do this for us\n\n target = nearest_targets.sort.first[0]\n\n # Sadly we need to now path find again to find the best route to that target\n\n path_map = copy_world(target_map)\n\n # This time the target is the centre of the path finding...\n path_map[target[0]][target[1]] = 0\n changes = 0\n\n loop do\n\n (0...height).each do |row|\n (0...width).each do |col|\n if ['.', '?'].include? path_map[row][col]\n lowest_value = [1000]\n # left target\n if col >=1 and path_map[row][col-1].is_a? Numeric\n lowest_value << path_map[row][col-1]\n end\n \n # right target\n if col < width-1 and path_map[row][col+1].is_a? Numeric\n lowest_value << path_map[row][col+1]\n end\n \n # above target\n if row >=1 and path_map[row-1][col].is_a? Numeric\n lowest_value << path_map[row-1][col]\n end\n \n # below target\n if row < height-1 and path_map[row+1][col].is_a? Numeric\n lowest_value << path_map[row+1][col]\n end\n \n lowest_value = lowest_value.min\n \n if lowest_value < 1000\n path_map[row][col] = lowest_value + 1\n changes += 1\n end\n \n end\n end\n end\n\n if changes == 0\n break\n else\n changes = 0\n end\n \n end\n\n draw_world(path_map, []) if debug_draw\n\n # now we must choose where to move to, meaning the square around us\n # with smallest path find value... if there more than one sort by reading\n # order\n\n moves = {}\n\n row = me.y\n col = me.x\n \n # Left?\n if col >=1 and path_map[row][col-1].is_a? Numeric\n moves[[row,col-1]] = path_map[row][col-1]\n end\n\n # Right?\n if col < width-1 and path_map[row][col+1].is_a? Numeric\n moves[[row,col+1]] = path_map[row][col+1]\n end\n\n # Up?\n if row >=1 and path_map[row-1][col].is_a? Numeric\n moves[[row-1,col]] = path_map[row-1][col]\n end\n \n # Down?\n if row < height-1 and path_map[row+1][col].is_a? Numeric\n moves[[row+1,col]] = path_map[row+1][col]\n end\n\n min = moves.values.min\n best_moves = moves.filter {|coord,distance| distance == min}\n\n best_move = best_moves.sort.first[0]\n \n {move: [best_move[0], best_move[1]]}\n \nend",
"title": ""
},
{
"docid": "20185c4f2388732363e8bd05fd292c30",
"score": "0.60315233",
"text": "def fall\n\t\t# If the player is jumping\n\t\tif @jumping == true\n\t\t\t# If the player can jump no higher, start falling\n\t\t\tif @draw_y <= 0 || @y_offset >= 69 # Maximum jump height is 69px | 2 blocks + \"wiggle room\"\n\t\t\t\t@jumping = false\n\t\t\t\t@jump_vel = 0\n\t\t\telse\n\t\t\t\t# Else, keep jumping\n\t\t\t\t@jump_vel -= @delta_vel\n\t\t\t\tjump_dist = @jump_vel.to_i\n\t\t\t\t@draw_y -= jump_dist\n\t\t\t\t@y_offset += jump_dist\n\t\t\t\tupdate_position\n\t\t\t\t\n\t\t\t\t# Check if the player hit a ceiling\n\t\t\t\t# TODO: Make jumps that collide with ceiling tiles less derpy\n\t\t\t\tif @rect.y1 > 0\n\t\t\t\t while $grid[@rect.y1 / 32][@rect.x1 / 32].is_solid? ||\n $grid[@rect.y1 / 32][@rect.x2 / 32].is_solid?\n @draw_y += 1\n stop_jump\n update_position\n end\n\t\t\t\telse\n\t\t\t\t\tstop_jump\n\t\t\t\tend\n\t\t\tend \n\t\t# Else, if the player hasn't reached the limit of the map, obey gravity\t& fall\n\t\telsif @rect.y2 < $level_height * 32\n\t\t\t@jump_vel += @delta_vel * 2\n\t\t\tif @jump_vel > 10\n\t\t\t\t@jump_vel = 10\t# Max velocity is 5px/sec\n\t\t\tend\n\t\t\tjump_dist = @jump_vel.to_i\n\t\t\t@draw_y += jump_dist\n\t\t\t@y_offset -= jump_dist\n\t\t\tupdate_position\n\t\t\t\n\t\t\t# Check collision with floor\n\t\t\tif @y < $level_height - 1\n\t\t\t while $grid[@rect.y2 / 32][@rect.x1 / 32].is_solid? ||\n\t\t\t $grid[@rect.y2 / 32][@rect.x2 / 32].is_solid?\n @draw_y -= 1\n @y_offset = -1 # Indicate that player is grounded\n landed = true\n update_position\n end\n\n\t\t\t\t# Keeps player from floating 1px above the ground\n\t\t\t\tif landed\n\t\t\t\t\t@draw_y += 1\n\t\t\t\t\t@jump_vel = 2\n\t\t\t\t\tupdate_position\n\t\t\t\tend\n\t\t\t\t\n\t\t\tend\n\t\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7700152d7951b6f4606c1f018746a2dc",
"score": "0.6029143",
"text": "def setup_move\n # stop if not allowed to change speed\n return if @ai.state == BlizzABS::AI::MoveOnly\n # set to idle state if return state\n @ai.state = BlizzABS::AI::Idle if @ai.state == BlizzABS::AI::Return\n # reset moving speed\n @move_speed = @normal_speed\n # increase moving speed if knockback\n @move_speed += 1 if @ai.state == BlizzABS::AI::Knockback\n end",
"title": ""
},
{
"docid": "242666452343d342d86facad1fc55fe2",
"score": "0.6029062",
"text": "def update_move_postion\n @moving = true\n @battler.idle_pose = false\n @move_speed = set_move_speed\n speed = @move_speed / 100.0\n @distance_x = @battler.target_x - @battler.actual_x\n @distance_y = @battler.target_y - @battler.actual_y\n @move_x = @move_y = 1\n if @distance_x.abs < @distance_y.abs\n @move_x = 1.0 / (@distance_y.abs.to_f / @distance_x.abs)\n elsif @distance_y.abs < @distance_x.abs\n @move_y = 1.0 / (@distance_x.abs.to_f / @distance_y.abs)\n end\n @speed_x = speed * (@distance_x == 0 ? 0 : (@distance_x > 0 ? 8 : -8))\n @speed_y = speed * (@distance_y == 0 ? 0 : (@distance_y > 0 ? 8 : -8))\n @battler.actual_x += (@move_x * @speed_x).round\n @battler.actual_y += (@move_y * @speed_y).round\n if @battler.teleport_to_target\n @battler.actual_x = @battler.target_x\n @battler.actual_y = @battler.target_y\n @battler.teleport_to_target = false\n end\n end",
"title": ""
},
{
"docid": "aed21181ec46ca9ff1f20d8cdfb85d16",
"score": "0.60229003",
"text": "def move_toward_player\n # get pixel movement rate\n pix = BlizzABS.pixel\n # calculates differences in x and y\n dx, dy = @x - ($game_player.x+pix/2)/pix, @y - ($game_player.y+pix*3/4)/pix\n # determines where to move according to the x and y differences\n if dx > 0 && dy > 0 # player is up left\n move_left if !move_upper_left && !move_up\n elsif dx > 0 && dy < 0 # player is down left\n move_left if !move_lower_left && !move_down\n elsif dx < 0 && dy > 0 # player is up right\n move_right if !move_upper_right && !move_up\n elsif dx < 0 && dy < 0 # player is down right\n move_right if !move_lower_right && !move_down\n elsif dx < 0 && dy == 0 # player is right\n move_right\n elsif dx > 0 && dy == 0 # player is left\n move_left\n elsif dx == 0 && dy < 0 # player is down\n move_down\n elsif dx == 0 && dy > 0 # player is up\n move_up\n end\n end",
"title": ""
},
{
"docid": "aed21181ec46ca9ff1f20d8cdfb85d16",
"score": "0.60229003",
"text": "def move_toward_player\n # get pixel movement rate\n pix = BlizzABS.pixel\n # calculates differences in x and y\n dx, dy = @x - ($game_player.x+pix/2)/pix, @y - ($game_player.y+pix*3/4)/pix\n # determines where to move according to the x and y differences\n if dx > 0 && dy > 0 # player is up left\n move_left if !move_upper_left && !move_up\n elsif dx > 0 && dy < 0 # player is down left\n move_left if !move_lower_left && !move_down\n elsif dx < 0 && dy > 0 # player is up right\n move_right if !move_upper_right && !move_up\n elsif dx < 0 && dy < 0 # player is down right\n move_right if !move_lower_right && !move_down\n elsif dx < 0 && dy == 0 # player is right\n move_right\n elsif dx > 0 && dy == 0 # player is left\n move_left\n elsif dx == 0 && dy < 0 # player is down\n move_down\n elsif dx == 0 && dy > 0 # player is up\n move_up\n end\n end",
"title": ""
},
{
"docid": "ac6dc4e06b61b9a0aacd6cf986feaf1e",
"score": "0.6022588",
"text": "def moves_to_score\n @_moves_to_score ||=\n begin\n positions = [cheese_pos, player_pos]\n if pit_pos.between?(positions.min, positions.max)\n if pit_pos > player_pos\n player_pos + map_size - cheese_pos\n else\n map_size - player_pos + cheese_pos\n end\n else\n (cheese_pos - player_pos).abs\n end\n end\n end",
"title": ""
},
{
"docid": "54dbaa0701277a13f3912b5eb50383e8",
"score": "0.60207045",
"text": "def move(direction)\n \n # Exit map at bottom\n if direction == 'down' && @pos_x == 19 && (@pos_y == 11 || @pos_y == 12) \n if @player.route101 == 'first' # No escape!\n cant_leave_speech('up')\n else # Load map\n LittleRoot.new(@player,0,14).begin\n end\n end\n \n # Because cliff moves 2 spots down & bottom is always 'L', stops odd scenarios where 'G' moves\n if direction =='down' && @map[@pos_x - 1][@pos_y] == \"L\"\n @saved_variable = 'S'\n end\n\n # Exit map at top\n direction == 'up' && @pos_x == 1 && (@pos_y == 9 || @pos_y == 10 || @pos_y == 11 || @pos_y == 12) ? exit! : nil\n\n # Can't go around the bag\n if @player.route101 == 'first' && direction == 'left' && @pos_y == 8 && (@pos_x == 15 || @pos_x == 16 || @pos_x == 17)\n cant_leave_speech('right')\n end\n \n # Interact with bag\n if @player.route101 == 'first'\n if (direction == 'left' && @pos_x == 14 && @pos_y == 9) || (direction == 'up' && @pos_x == 15 && @pos_y == 8)\n loop do\n pokemon = TTY::Prompt.new.select(\"Prof. BIRCH is in trouble!\\nRelease a POKEMON and rescue him!\",%w(TREECKO TORCHIC MUDKIP))\n case pokemon\n when 'TREECKO'\n puts \"GRASS POKEMON\"\n choice = TTY::Prompt.new.select(\"Do you choose this POKEMON?\", %w(YES NO))\n if choice == 'YES'\n choice = Treecko.new(5)\n battle(choice)\n else\n reset_map\n end\n when 'TORCHIC'\n puts \"FIRE POKEMON\"\n choice = TTY::Prompt.new.select(\"Do you choose this POKEMON?\", %w(YES NO))\n if choice == 'YES'\n choice = Torchic.new(5)\n battle(choice)\n else\n reset_map\n end\n when 'MUDKIP'\n puts \"WATER POKEMON\"\n choice = TTY::Prompt.new.select(\"Do you choose this POKEMON?\", %w(YES NO))\n if choice == 'YES'\n choice = Mudkip.new(5)\n battle(choice)\n else\n reset_map\n end\n end\n end\n end\n end\n\n super # Otherwise act as normal\n end",
"title": ""
},
{
"docid": "d87d40d9251739b1090f26c580a6208f",
"score": "0.6020422",
"text": "def can_move_toward_target?(x, y)\r\n # Get difference in player coordinates\r\n sx = @x - x\r\n sy = @y - y\r\n # If coordinates are equal, return false\r\n return false if sx == 0 and sy == 0\r\n # Get absolute value of difference\r\n abs_sx = sx.abs\r\n abs_sy = sy.abs\r\n # Passable Testings\r\n pass = {2 => passable?(@x, @y, 2), 4 => passable?(@x, @y, 4), \r\n 6 => passable?(@x, @y, 6), 8 => passable?(@x, @y, 8),\r\n 24 => passable?(@x, @y, 2) && passable?(@x, @y + 1, 4),\r\n 26 => passable?(@x, @y, 2) && passable?(@x, @y + 1, 6),\r\n 42 => passable?(@x, @y, 4) && passable?(@x - 1, @y, 2),\r\n 48 => passable?(@x, @y, 4) && passable?(@x - 1, @y, 8),\r\n 62 => passable?(@x, @y, 6) && passable?(@x + 1, @y, 2),\r\n 68 => passable?(@x, @y, 6) && passable?(@x + 1, @y, 8),\r\n 84 => passable?(@x, @y, 8) && passable?(@x, @y - 1, 4),\r\n 86 => passable?(@x, @y, 8) && passable?(@x, @y - 1, 6)}\r\n # Movement Testings\r\n if abs_sx > abs_sy\r\n if sx != 0\r\n if sx > 0\r\n return true, 4 if pass[4]\r\n sy > 0 ? (return true, 8 if pass[84]) : (return true, 2 if pass[24])\r\n else\r\n return true, 6 if pass[6]\r\n sy > 0 ? (return true, 8 if pass[86]) : (return true, 2 if pass[26])\r\n end\r\n end\r\n if sy != 0\r\n if sy > 0\r\n return true, 8 if pass[8]\r\n sx > 0 ? (return true, 4 if pass[48]) : (return true, 6 if pass[68])\r\n else\r\n return true, 2 if pass[2]\r\n sx > 0 ? (return true, 4 if pass[42]) : (return true, 6 if pass[62])\r\n end\r\n end\r\n else\r\n if sy != 0\r\n if sy > 0\r\n return true, 8 if pass[8]\r\n sx > 0 ? (return true, 4 if pass[48]) : (return true, 6 if pass[68])\r\n else\r\n return true, 2 if pass[2]\r\n sx > 0 ? (return true, 4 if pass[42]) : (return true, 6 if pass[62])\r\n end\r\n end\r\n if sx != 0\r\n if sx > 0\r\n return true, 4 if pass[4]\r\n sy > 0 ? (return true, 8 if pass[84]) : (return true, 2 if pass[24])\r\n else\r\n return true, 6 if pass[6]\r\n sy > 0 ? (return true, 8 if pass[86]) : (return true, 2 if pass[26])\r\n end\r\n end\r\n end\r\n # Return False if No Possible Moves\r\n return false\r\n end",
"title": ""
},
{
"docid": "f0083ebdc872c50a8a81f78676dd6a87",
"score": "0.60182387",
"text": "def use_movement( n )\r\n success = (n <= @movement) ? (@movement -= n) : false\r\n try_add_to_regen_mobs\r\n return success\r\n end",
"title": ""
},
{
"docid": "3e04e4c747d25170b7e76d5bf33d4ec0",
"score": "0.6017143",
"text": "def valid_move?(x,y)\n if self.game.square_occupied?(x,y)\n self.white? != self.game.find_piece(x,y).white?\n elsif x < 0 || x > 7 || y < 0 || y > 7\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "bb5a8646b2c5d998ebdcf07bd88f021d",
"score": "0.60150754",
"text": "def move(world_array, all_objects)\n target_person = nearest_person(all_objects)\n if target_person\n if target_person.get_x_location < @x_location\n if can_move_west(world_array)\n move_west(world_array)\n end\n elsif target_person.get_x_location > @x_location\n if can_move_east(world_array)\n move_east(world_array)\n end\n elsif target_person.get_y_location < @y_location\n if can_move_north(world_array)\n move_north(world_array)\n end\n elsif target_person.get_y_location > @y_location\n if can_move_south(world_array)\n move_south(world_array)\n end\n else\n puts 'PERSON ON MONSTER TILE'\n end\n else\n move_random(world_array)\n end\n end",
"title": ""
},
{
"docid": "b339686e307be5457d313525bbd5a3ee",
"score": "0.6014778",
"text": "def move( move_to, board, game ) #the state of the board is passed\n\t\tsave_pos = @position\n\t\tmoves = next_moves(board)\n\t\tif(\tboard.on_board?(move_to) ) #check that the move is on the board\n\t\t if( moves.include?(move_to) ) #check that it's a real move\n\t\t\t if( move_to != position ) #can't move to the same spot\n\t\t\t\t\tif( board.at_position(move_to).allegiance != @ally ) #can't move onto ally \n\t\t\t\t\t\tif( !self.is_a?(Knight) && path_blocked?(move_to,board) ) #something in the way\n\t\t\t\t\t\t\tputs \"There is something blocking the way!\"\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t@position = move_to #set the new position\n\t\t\t\t\t\t\tactive = game.active\n\t\t\t\t\t\t\tgame.switch_turns\n\t\t\t\t\t\t\tif(game.check(active))\n\t\t\t\t\t\t\t\tgame.switch_turns\n\t\t\t\t\t\t\t\t@position = save_pos\n\t\t\t\t\t\t\t\tputs \"You can't move into check!\"\n\t\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tgame.switch_turns\n\t\t\t\t\t\t\t\treturn true\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\tputs \"Friendly fire is not activated!\"\n\t\t\t\t\t\treturn false\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tputs \"You have to actually MOVE the piece\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tputs \"That's not a valid move...\"\n\t\t\t\treturn false\n\t\t\tend\n\t\telse\n\t\t\tputs \"You can't move off the board, yah cheater!\"\n\t\t\treturn false #return false if move_to can't resolve\n\t\tend\n\tend",
"title": ""
},
{
"docid": "86744205a017a47b04cd15c58f81e496",
"score": "0.60121113",
"text": "def evaluate_position(player)\n if @board[player.position()] != nil # nil go to end\n snake_or_ladder = @board[player.position()] # snake or ladder\n snake_or_ladder.move_player(player)\n end\n end",
"title": ""
},
{
"docid": "23a1ee14d29d66c037187752dfd965ca",
"score": "0.60097986",
"text": "def normal_move_allowed?(move)\n end_pos = move.path[-1]\n team = move.piece.colour\n if empty?(end_pos)\n return true \n else\n if get_piece(end_pos).colour == team # a piece can't capture a piece of the same team\n return false\n elsif move.piece.type == 'pawn' # a pawn can't make its normal move if there is an enemy piece in front of it\n return false\n else\n return true\n end\n end\n end",
"title": ""
},
{
"docid": "39ad4e473d496504ab6de60fc2f0250d",
"score": "0.60089314",
"text": "def move_random(world_array)\n good_movement = false\n while !good_movement\n movement = rand(4)\n good_movement = true\n if movement == 0 and can_move_south(world_array)\n move_south(world_array)\n elsif movement == 1 and can_move_west(world_array)\n move_west(world_array)\n elsif movement == 2 and can_move_north(world_array)\n move_north(world_array)\n elsif movement == 3 and can_move_east(world_array)\n move_east(world_array)\n elsif no_possible_moves(world_array)\n # do nothing\n else\n good_movement = false\n end\n end\n end",
"title": ""
}
] |
3a73f310bb909993f7a5049df5f1b62c
|
This method sets the first server of a new game. It sets it to which ever player is passed to it.
|
[
{
"docid": "1cf8bf4a077d71b116f0d81ea87dee91",
"score": "0.6428113",
"text": "def server(player)\n\t\t\t$server = player\n\t\t\tnew_serve($server)\n\t\tend",
"title": ""
}
] |
[
{
"docid": "009edbea51f20d341e5891c41eb7b22c",
"score": "0.7125115",
"text": "def set_server\n @gameserver = Gameserver.find(params[:id])\n end",
"title": ""
},
{
"docid": "009edbea51f20d341e5891c41eb7b22c",
"score": "0.7125115",
"text": "def set_server\n @gameserver = Gameserver.find(params[:id])\n end",
"title": ""
},
{
"docid": "eaf4424b4a742656648d421da092681e",
"score": "0.69596666",
"text": "def switch_serve(server)\n\t\t\tif @current_game.check_status == \"#{@player1} wins\" || @current_game.check_status == \"#{@player2} wins\"\n\t\t\t\tself.new_game\n\t\t\telse\n\t\t\t\tif $server == @player1\n\t\t\t\t\t$server = @player2\n\t\t\t\t\tself.hitter1\n\t\t\n\t\t\t\telse\n\t\t\t\t\t$server = @player1\n\t\t\t\t\tself.hitter2\n\t\t\t\tend\n\t\t\t\t\tnew_serve($server)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "e0357dc801034157c52612219715994b",
"score": "0.6821455",
"text": "def first_player=(player)\n self.first_team = singles_player_team(player)\n end",
"title": ""
},
{
"docid": "bc23eb825f453b2fd664955f095aa286",
"score": "0.65557635",
"text": "def one_player\n\n if go_first? == true\n game = Game.new(Players::Human.new(\"X\"), Players::Computer.new(\"O\"))\n game.play\n\n else\n game = Game.new(Players::Computer.new(\"X\"), Players::Human.new(\"O\"))\n game.play\n end # inner if\n end",
"title": ""
},
{
"docid": "4f7c913b97b747ebd755c7d9389f335c",
"score": "0.63090545",
"text": "def set_game_player\n @game_player = GamePlayer.find( params[:id] )\n end",
"title": ""
},
{
"docid": "ed3f7a2d734db1141a76b9cd7a8d828c",
"score": "0.6280265",
"text": "def set_starting_player\n starting_player = [Player.human, Player.computer].sample\n self.started_by = starting_player\n self.goes = starting_player\n self.first_player_type = starting_player\n self.second_player_type = self.versus\n end",
"title": ""
},
{
"docid": "1880872d504b786572db6400eb38cb37",
"score": "0.6236844",
"text": "def set_game_player\n @game_player = GamePlayer.find( params[:id] )\n end",
"title": ""
},
{
"docid": "41df27c3edd7012053adfbf30e6c32ae",
"score": "0.622349",
"text": "def second_player=(player)\n self.second_team = singles_player_team(player)\n end",
"title": ""
},
{
"docid": "1eebc58ebb69d49e5f43a6c7230c0fd0",
"score": "0.61704874",
"text": "def switch_player\n @current_player = @current_player == @players.first ? @players.last : @players.first\n end",
"title": ""
},
{
"docid": "2fc18387b97b710fe914570bb1f04249",
"score": "0.6149852",
"text": "def set_server\n @server = Server.find(params[:id])\n end",
"title": ""
},
{
"docid": "2fc18387b97b710fe914570bb1f04249",
"score": "0.6149852",
"text": "def set_server\n @server = Server.find(params[:id])\n end",
"title": ""
},
{
"docid": "2fc18387b97b710fe914570bb1f04249",
"score": "0.6149852",
"text": "def set_server\n @server = Server.find(params[:id])\n end",
"title": ""
},
{
"docid": "2fc18387b97b710fe914570bb1f04249",
"score": "0.6149852",
"text": "def set_server\n @server = Server.find(params[:id])\n end",
"title": ""
},
{
"docid": "2fc18387b97b710fe914570bb1f04249",
"score": "0.6149852",
"text": "def set_server\n @server = Server.find(params[:id])\n end",
"title": ""
},
{
"docid": "aa154a304cbf6104d01f37af9c36157e",
"score": "0.6144412",
"text": "def set_game_player\n @game_player = GamePlayer.find(params[:id])\n end",
"title": ""
},
{
"docid": "97d522f6adb81e7fd9a261076ad593e5",
"score": "0.61117446",
"text": "def set_player\n\n end",
"title": ""
},
{
"docid": "ba1e24e92bf995bed3948709411e6558",
"score": "0.609233",
"text": "def set_server\r\n @server = Server.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "c48455b2ccd0de2a2932d9346d6fc33b",
"score": "0.6082096",
"text": "def set_players_for_first\n Game::FIRST_MARKETS.each do |market|\n team_id = @game[\"first_#{market}_team_id\".to_sym]\n\n if team_id\n set_players_instance_variable(market, Team.find(team_id).players)\n else \n set_players_instance_variable(market, @game.teams.first.players)\n end\n end\n end",
"title": ""
},
{
"docid": "22035d073c438f88eda4b5b456eac7a3",
"score": "0.6056288",
"text": "def switch_server\n self.connection = nil\n servers << servers.shift\n end",
"title": ""
},
{
"docid": "8e902742d8726e7843fc88aabb282d35",
"score": "0.60317826",
"text": "def set_server(s)\n @server = s\n @this = @this.server(s) if @this\n self\n end",
"title": ""
},
{
"docid": "8e902742d8726e7843fc88aabb282d35",
"score": "0.60317826",
"text": "def set_server(s)\n @server = s\n @this = @this.server(s) if @this\n self\n end",
"title": ""
},
{
"docid": "512a681ce58e5a2a13dabdec0e5b9e2d",
"score": "0.60139877",
"text": "def choose_first\n num = 1 + rand(2)\n puts \"Player #{num} will start the game.\"\n if num == 1\n @current_player = @player1\n else\n @current_player = @player2\n end\n end",
"title": ""
},
{
"docid": "891f296ede7971abf2356c2bc680be78",
"score": "0.60136676",
"text": "def switch_player\n if @current_player == @players[0]\n @current_player = @players[1]\n else\n @current_player = @players[0]\n end\n end",
"title": ""
},
{
"docid": "2e04a3debdbc0d25f780b4e1aa6048c0",
"score": "0.6002065",
"text": "def set_game\n @game = current_creator.games.find(params[:id])\n end",
"title": ""
},
{
"docid": "b950ce36f4d3cdc1f377757cf7766a59",
"score": "0.5999843",
"text": "def start\n\t\tif @state == :READY\n\t\t\t@players.each do |p|\n\t\t\t\tputs \"#{p.username} starting game\"\n\t\t\t\tp.socket.send({\"startGame\" => true}.to_json)\n\t\t\tend\t\n\t\t\t@state = :PLAYING\n\t\tend\n\tend",
"title": ""
},
{
"docid": "46866c05c073214a239638372a62123c",
"score": "0.5994083",
"text": "def set_server\n @server = Server.find(params[:id])\n end",
"title": ""
},
{
"docid": "8056e9ae8f9e940138525ea8b8c34d62",
"score": "0.5978079",
"text": "def set_mini_game\n @mini_game = MiniGame.find(params[:id])\n @machine = @mini_game.machine \n end",
"title": ""
},
{
"docid": "fba6bf70a28e6fe3b2fdd68b314ee022",
"score": "0.5974589",
"text": "def set_games_player\n @games_player = GamesPlayer.find(params[:id])\n end",
"title": ""
},
{
"docid": "900021b820267a34d12fe0aa6190e4c3",
"score": "0.59717286",
"text": "def set_game\n @game = Game.find(params[:game_id] ||= params[:id])\n end",
"title": ""
},
{
"docid": "336b246feed95aa560088c29bc431d95",
"score": "0.59713775",
"text": "def switch_players!\n if current_player==player1\n @current_player=player2\n else\n @current_player=player1\n end\n end",
"title": ""
},
{
"docid": "4aa68b2aba5d328dedcaa0ad994fd7a1",
"score": "0.59684294",
"text": "def set_mini_game\n @mini_game = MiniGame.find(params[:id])\n end",
"title": ""
},
{
"docid": "eadb5c9298c992ef4cbebd76bec9ca37",
"score": "0.5958383",
"text": "def set_game_beginning\n reset_session\n params[:move] = Hash.new()\n params[:move][:left_hand] = \"\"\n params[:move][:right_hand] = \"\"\n session[:players] = [:player0, :player1]\n session[:player] = :player0\n session[:players].each do |player|\n session[player] = Hash.new()\n session[player][:health] = 15\n [:left_hand, :right_hand].each do |hand|\n session[player][hand] = \"B\"\n end\n end\n \n end",
"title": ""
},
{
"docid": "4031968b3f781e39ca3369e0d629d47c",
"score": "0.5936211",
"text": "def game_starter\n if path == \"/start_game\"\n @game = Game.new\n end\n end",
"title": ""
},
{
"docid": "8306a98d31ec85c313051c34105694a0",
"score": "0.5930786",
"text": "def start_new(player)\n self.update(current_player: player, board_state: '_' * 9)\n end",
"title": ""
},
{
"docid": "461ce19b426afa3f4e0e0b84357e515b",
"score": "0.59299326",
"text": "def set_match\n @match = Match.find(params[:id])\n @host = false\n if current_user and current_user.id == @match.player1_id\n @host = true\n end\n end",
"title": ""
},
{
"docid": "7823440e21f03b832d28db5119510b07",
"score": "0.5928481",
"text": "def set_gameplayer\r\n @gameplayer = Gameplayer.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "552717a8e723e63b7bff0c12c5f610bb",
"score": "0.59160626",
"text": "def set_game\n @game = Game.find(params[:game_id] || params[:id])\n end",
"title": ""
},
{
"docid": "0d1f590f57809d2848344fa43e6464d5",
"score": "0.59112823",
"text": "def set_player\n @player = Player.find(params[:id])\n if @player.game != @game\n redirect_to game_players_path, alert: \"Player #{params[:id]} does not belong to Game #{@game.id}.\"\n end\n end",
"title": ""
},
{
"docid": "f6853e57d3387b8ac21c270548134e3e",
"score": "0.59108084",
"text": "def setCurrentPlayer(id, name)\n @current_player_id = id\n @current_player = name\nend",
"title": ""
},
{
"docid": "4e722ce1b8414eb6564c5e1b2ae3022d",
"score": "0.59061724",
"text": "def setplayer1\r\n\t\t\t@player1 = \"O\"\r\n\t\tend",
"title": ""
},
{
"docid": "a35c4e058c07ecee56be5e870cd00a4e",
"score": "0.58962685",
"text": "def set_server\n @server = Server.find(params[:id])\n if params.has_key?(:server) and params[:server].has_key?(:need_password)\n @server.need_password = params[:server][:need_password]\n else\n @server.need_password = !@server.password.empty?\n end\n\n # remeber last entered server\n session[:server_id] = params[:id]\n end",
"title": ""
},
{
"docid": "2ad0e95ef5c279ecf84bc229f1461340",
"score": "0.58940244",
"text": "def set_server\n @server = current_user.servers.find(params[:id])\n end",
"title": ""
},
{
"docid": "f56c2f268fb5f0dd7049bf00458a6ac0",
"score": "0.5889377",
"text": "def reinitialize_game(player)\n self.quit_game = false\n self.current_player = player\n\n puts \"\"\n puts \"Welcome to a new version of the 2 Player Game.\"\n puts \"\"\n\n end",
"title": ""
},
{
"docid": "c727c5b06a01b95292ae067b731f564e",
"score": "0.58874595",
"text": "def set_game_session_player\n @game_session_player = GameSessionPlayer.find(params[:id])\n end",
"title": ""
},
{
"docid": "7291306088bc86ee90cb83cbd6754878",
"score": "0.5877696",
"text": "def change_current_player\n game_state.current_player_seat = next_seat\n end",
"title": ""
},
{
"docid": "a949a761ce42302356d63a03b0f27687",
"score": "0.58618444",
"text": "def start_new_game\n say \"\\nStarting a new game.\"\n @client.start_new_game\n end",
"title": ""
},
{
"docid": "fa0f03862be7544c40be914e496a5079",
"score": "0.5854477",
"text": "def start_new_game\n x = create_player_x\n o = create_player_o\n \n @game = Game.start_game(x, o)\n end",
"title": ""
},
{
"docid": "1bccd18dbf1a486d5271f7c8d24ea42d",
"score": "0.5843156",
"text": "def switch_player()\n\t\tif $current_player == @player1\n\t\t\t$current_player = @player2\n\t\telse \n\t\t\t$current_player = @player1\n\t\tend \n\tend",
"title": ""
},
{
"docid": "b4a8e53f828856ce38b75615074dad94",
"score": "0.58427125",
"text": "def set_game\n @game = current_club_player.games.find(params[:id])\n end",
"title": ""
},
{
"docid": "f11a965d902b73b1c16c8c9578da6ec6",
"score": "0.583901",
"text": "def start\n SocketController.init_game(self.users, self.id)\n end",
"title": ""
},
{
"docid": "da3b6963c2f44e7e89c1775760b3afe4",
"score": "0.5830861",
"text": "def set_bot_server\n @bot_server = BotServer.find(params[:id])\n end",
"title": ""
},
{
"docid": "55d897f53b2639682ba1cce95e798807",
"score": "0.58110934",
"text": "def set_server\n @server = Server.includes(:user).includes(:votes).find(params[:id])\n end",
"title": ""
},
{
"docid": "b3e82a4861d6a598be01cae9042a460d",
"score": "0.57804376",
"text": "def change_player\n\t\tif @current_player == @player1\n\t\t\t@current_player = @player2\n\t\t\t@opponent_player = @player1\n\t\telse\n\t\t\t@current_player = @player1\n\t\t\t@opponent_player = @player2\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8b3500f939031f68aa5689f36b912ea7",
"score": "0.5779458",
"text": "def set_current_player(player)\n\t\tself.current_player = player\n send_update\n\tend",
"title": ""
},
{
"docid": "ae51b376b793a749734f63d512797371",
"score": "0.5768689",
"text": "def change_player \n if @current_player == 0\n @current_player = 1\n elsif @current_player == 1\n @current_player = 0\n end\n end",
"title": ""
},
{
"docid": "3011381e87b1b534a6e4290a3691e12e",
"score": "0.5768158",
"text": "def set_players(player1, player2)\n @p1, @p2 = player1, player2\n (@p1.starts) ? @current_player = @p1 : @current_player = @p2\n end",
"title": ""
},
{
"docid": "fabfdc1313b5566b0f147e21888a45f8",
"score": "0.5764701",
"text": "def two_players\n\n if go_first? == true\n game = Game.new(Players::Human.new(\"X\"), Players::Human.new(\"O\"))\n game.play\n\n else\n game = Game.new(Players::Human.new(\"O\"), Players::Human.new(\"X\"))\n game.play\n end # inner if\n end",
"title": ""
},
{
"docid": "74a9342c0406a62bb01a98b4210f38ef",
"score": "0.5758989",
"text": "def switch_players(player_one, player_two)\n self.current_player = current_player == player_one ? player_two : player_one\n\n end",
"title": ""
},
{
"docid": "0e41c1eda1deb5fb264e9661bee62e19",
"score": "0.5751363",
"text": "def set_first_teams\n Game::FIRST_MARKETS.each do |market|\n if @game[\"first_#{market}_team_id\".to_sym]\n instance_variable_set(\n \"@first_#{market}_team\", @game.send(\"first_team_to_get\", market).name)\n end\n end\n end",
"title": ""
},
{
"docid": "aa2669860b85521a7b8a2a4d1baa5481",
"score": "0.5745492",
"text": "def set_game\n @game = Game.find_by(id: params[:id])\n if(!@game)\n respond_to do |format|\n format.html { redirect_to games_path, alert: 'An Error occurred.' }\n format.json { render :show, status: :ok, location: games_path }\n end\n return\n elsif (@game.name != params[:name])\n respond_to do |format|\n format.html { redirect_to games_path, alert: 'Wrong game name.' }\n format.json { render :show, status: :ok, location: games_path }\n end\n return\n end\n\n session[:current_game_name] = @game.name\n if user_signed_in? && @game.user_id == 1\n @game.user_id = current_user.id\n end\n end",
"title": ""
},
{
"docid": "18b5cc75100b81f4e06516ce7e32df0f",
"score": "0.57256305",
"text": "def switch_players\n temp = @current_player\n @current_player = @opposing_player\n @opposing_player = temp\n end",
"title": ""
},
{
"docid": "93dd0cec712cdcd3538c5dfdd004e142",
"score": "0.57134706",
"text": "def establish_connection_with_server\n\t $game_client = GameClient.new\n $scene = Scene_Pong_Client.new\n end",
"title": ""
},
{
"docid": "205b39ef70318b873722e67139a39c28",
"score": "0.571217",
"text": "def regist_server(server)\n @server[server.uri] = server\n mutex.synchronize do\n @primary_server = server unless @primary_server\n end\n end",
"title": ""
},
{
"docid": "40ad24dd314604045c4db9c3c4070119",
"score": "0.5707571",
"text": "def set_game\n @game = Game.find(params[:id])\n unless @logged_in and @logged_in.update_site?\n @game.readonly!\n end\n end",
"title": ""
},
{
"docid": "a3eacf43e77288f3c4f324b56b334eed",
"score": "0.5705767",
"text": "def switch_players\n \n if @current_asker == @player1\n @current_asker = @player2\n @current_responder = @player1\n else\n @current_asker = @player1\n @current_responder = @player2\n end\n\n end",
"title": ""
},
{
"docid": "cd867045d1090743d3666eabeb22dbf9",
"score": "0.5700733",
"text": "def set_game\n @game = current_user.games.find(params[:id]||params[:game_id])\n end",
"title": ""
},
{
"docid": "fb73fe55dbe6fec92a1b8098562461ef",
"score": "0.5697188",
"text": "def set_game\n @game = Game.find(params[:id])\n if current_user.nil?\n if @game != current_game_owner.game\n redirect_to root_path, alert: 'No tiene permiso para acceder a este juego'\n end\n end\n end",
"title": ""
},
{
"docid": "0348cc94fcd7abcb11acd3e078e01fc3",
"score": "0.56957436",
"text": "def set_game\n @game = Game.find(params[:game_id])\n end",
"title": ""
},
{
"docid": "0348cc94fcd7abcb11acd3e078e01fc3",
"score": "0.56957436",
"text": "def set_game\n @game = Game.find(params[:game_id])\n end",
"title": ""
},
{
"docid": "0348cc94fcd7abcb11acd3e078e01fc3",
"score": "0.56957436",
"text": "def set_game\n @game = Game.find(params[:game_id])\n end",
"title": ""
},
{
"docid": "0348cc94fcd7abcb11acd3e078e01fc3",
"score": "0.56957436",
"text": "def set_game\n @game = Game.find(params[:game_id])\n end",
"title": ""
},
{
"docid": "5a0ab9141d51cab962a260cc364c3756",
"score": "0.569036",
"text": "def new_game\n player1 = @players[0]\n player2 = @players[1]\n @game = Game.new(player1, player2, best_of, rules)\n game.play\n end",
"title": ""
},
{
"docid": "84c9724108b68aa46357be144439c5fb",
"score": "0.56884146",
"text": "def set_game\n @game = game.find(params[:id])\n end",
"title": ""
},
{
"docid": "a0311a476399d8a77dbc22608aa3b0c1",
"score": "0.5688221",
"text": "def start_game(player)\n if @role == \"player\"\n computer_game(player)\n else\n player_game(player)\n end\n end",
"title": ""
},
{
"docid": "69ef96f9c6e520dd5915f87e13f2362f",
"score": "0.5687751",
"text": "def new_game \n\t\t@game = create_game message[:player], message[:ships]\n\t\tWebsocketRails[:updates].trigger(:created_game, @game)\n\tend",
"title": ""
},
{
"docid": "bdfc168e31b67b7dc51aa0039904b67c",
"score": "0.56876725",
"text": "def first_move\n computer.move if @first_player == COMPUTER_PLAYER\n @on_move = HUMAN_PLAYER\n end",
"title": ""
},
{
"docid": "0075006f8d73dbd5b3914f5648d441c3",
"score": "0.5682346",
"text": "def switch_players\n @current_player, @other_player = @other_player, @current_player\n end",
"title": ""
},
{
"docid": "0075006f8d73dbd5b3914f5648d441c3",
"score": "0.5682346",
"text": "def switch_players\n @current_player, @other_player = @other_player, @current_player\n end",
"title": ""
},
{
"docid": "657f6269f6b24858d3f6df71291a16b2",
"score": "0.56699556",
"text": "def change_current_player\n current_player == player_1 ? @current_player = @player_2 : @current_player = @player_1\n end",
"title": ""
},
{
"docid": "75dc468a4a9d89033da4d2b61a75be29",
"score": "0.5669055",
"text": "def set_game\n @game = Admin::Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "62358506881f2a7cc919e160016031e9",
"score": "0.5659438",
"text": "def network(player)\n @networks[player] = true\n end",
"title": ""
},
{
"docid": "659a336517fb2c7f11587008079c1167",
"score": "0.5659401",
"text": "def start_game\n\t\tself.game_is_started = true\n send_update\n end",
"title": ""
},
{
"docid": "479c8d81cd2dd8327dee7c59b95e4e2b",
"score": "0.565788",
"text": "def switch_player\n if @active_player == @player1\n @active_player = @player2\n else\n @active_player = @player1\n end\n end",
"title": ""
},
{
"docid": "2ec57f03616a2729b688f973512af7fd",
"score": "0.5652114",
"text": "def set_game\n id = params[:id]\n if id == nil\n id = params[:game_id]\n end\n if id != nil \n @game = Game.find(id)\n end\n end",
"title": ""
},
{
"docid": "8a68cb5e2748b907df94859b3103c65f",
"score": "0.5649515",
"text": "def set_game\n\t\t@game = Game.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "33a3e142d275a943b6e7dee6c7fe151f",
"score": "0.56467783",
"text": "def set_game\n if Game.where(id: params[:id]).exists?\n @game = Game.find(params[:id])\n else\n @game = Game.new\n end\n end",
"title": ""
},
{
"docid": "8e38bd92db53f1051fa2b5f803532ec3",
"score": "0.5645592",
"text": "def setplayer2\r\n\t\t\t@player2 = \"X\"\r\n\t\tend",
"title": ""
},
{
"docid": "a250178a3b06708bad5b0b4f1a832de6",
"score": "0.5640149",
"text": "def mini_player(value)\n @ole.MiniPlayer = value\n nil\n end",
"title": ""
},
{
"docid": "a19f029044e01e7d473633e7159d68ce",
"score": "0.5629998",
"text": "def start(player)\n precondition do\n raise \"Player not provided.\" if player.nil?\n end\n @game.sync\n @game.start player\n end",
"title": ""
},
{
"docid": "a7f20dbbb09fc9105657dc1b3907dd9b",
"score": "0.56220865",
"text": "def new_game\n\t\tclear\n\t\tget_username\n\t\tselect_level\n\t\tget_deck\n\t\tshuffle\n\t\tget_hand\n\t\tcontinue_game\n\tend",
"title": ""
},
{
"docid": "a011feeab61a3414f083f277982aa9d5",
"score": "0.5616331",
"text": "def switch_current_player\n @current_player = @current_player == @player1 ? @player2 : @player1\n end",
"title": ""
},
{
"docid": "b481aeb40a5689194d9470c3be344976",
"score": "0.56023836",
"text": "def switch_player(player)\n if player == @player1\n player = @player2\n else \n player = @player1\n end\n end",
"title": ""
},
{
"docid": "c9d79c590ea75ab87e4c31c002850bf9",
"score": "0.56003606",
"text": "def change_player\n @curr_player == @player1 ? @curr_player = @player2 : @curr_player = @player1\n end",
"title": ""
},
{
"docid": "1130721bda3d2e2d75e859743b58b689",
"score": "0.55999917",
"text": "def set_game\n @game = Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "1130721bda3d2e2d75e859743b58b689",
"score": "0.55990446",
"text": "def set_game\n @game = Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "1130721bda3d2e2d75e859743b58b689",
"score": "0.5598952",
"text": "def set_game\n @game = Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "1130721bda3d2e2d75e859743b58b689",
"score": "0.55976593",
"text": "def set_game\n @game = Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "1130721bda3d2e2d75e859743b58b689",
"score": "0.55976593",
"text": "def set_game\n @game = Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "1130721bda3d2e2d75e859743b58b689",
"score": "0.55976593",
"text": "def set_game\n @game = Game.find(params[:id])\n end",
"title": ""
}
] |
40c32620a0f740be2fd86e7677d834ca
|
Raw rendering of a template to a string. It is similar to render, except that it does not set the +response_body+ and it should be guaranteed to always return a string. If a component extends the semantics of +response_body+ (as ActionController extends it to be anything that responds to the method each), this method needs to be overridden in order to still return a string.
|
[
{
"docid": "88bd87a45de74cfc6e738e706ff55d83",
"score": "0.72087115",
"text": "def render_to_string(*args, &block)\n options = _normalize_render(*args, &block)\n render_to_body(options)\n end",
"title": ""
}
] |
[
{
"docid": "7e5f9b212687b97fac3032a98b58ca30",
"score": "0.6988887",
"text": "def render_to_string(options = {})\n AbstractController::Renderer.body_to_s(render_to_body(options))\n end",
"title": ""
},
{
"docid": "88f2e92d76c1e940b7e80e06e9670549",
"score": "0.6944123",
"text": "def render_to_string(options = {})\n AbstractController::RenderingController.body_to_s(render_to_body(options))\n end",
"title": ""
},
{
"docid": "76e792bb18426b28683812c1e089c740",
"score": "0.69317526",
"text": "def render\n return to_s\n end",
"title": ""
},
{
"docid": "f1e84c31f0dd6e7956cf0c41a6c423e7",
"score": "0.6896296",
"text": "def render\n sb = StringIO.new\n append_to_string_builder(sb)\n sb.string\n end",
"title": ""
},
{
"docid": "baa541de5454f9d815bcc52c7a49b7a1",
"score": "0.6896044",
"text": "def render_to_string(*)\n orig_stream = response.stream\n super\n ensure\n if orig_stream\n response.instance_variable_set(:@stream, orig_stream)\n end\n end",
"title": ""
},
{
"docid": "baa541de5454f9d815bcc52c7a49b7a1",
"score": "0.6896044",
"text": "def render_to_string(*)\n orig_stream = response.stream\n super\n ensure\n if orig_stream\n response.instance_variable_set(:@stream, orig_stream)\n end\n end",
"title": ""
},
{
"docid": "5e55d6cf8fa6a18e086c62319a8e8e3e",
"score": "0.6892703",
"text": "def render_to_string(options = nil, &block) #:doc:\n render(options, &block)\n ensure\n response.content_type = nil\n erase_render_results\n reset_variables_added_to_assigns\n end",
"title": ""
},
{
"docid": "81c3173fa13a6ae03b21d21257a3c870",
"score": "0.68668807",
"text": "def render\n render = @_template.render(self) #, &body)\n\n result = render.to_s\n\n if layout\n if layout_object = site.lookup_layout(layout)\n result = layout_object.render(self){ result }\n #else\n # raise \"No such layout -- #{layout}\"\n end\n end\n\n result.to_s.strip\n end",
"title": ""
},
{
"docid": "bbb7abed816d34c03085915698fe08fd",
"score": "0.68253094",
"text": "def render_to_string(*args, &block)\n controller.send(:render_to_string, *args, &block)\n end",
"title": ""
},
{
"docid": "2b3e7769b06fff514bf36347d38de097",
"score": "0.6779265",
"text": "def raw_output(s)\n template.raw(s)\n end",
"title": ""
},
{
"docid": "7619b37af1801d7eb84d6e2e3790c126",
"score": "0.67572325",
"text": "def __render__(locals = {})\n @locals = OpenStruct.new(locals)\n ERB.new(@content, nil, nil, \"@erbout\").result(binding)\n rescue TemplateError => ex\n raise ex\n rescue StandardError => ex\n raise TemplateError.new(self, ex.message, ex)\n end",
"title": ""
},
{
"docid": "6525d1ddcb75607ccad403137ca6ef31",
"score": "0.67523617",
"text": "def render_to_string(*args, &block); end",
"title": ""
},
{
"docid": "eca7a34f2c6237501b4a9004ff4bef62",
"score": "0.67418474",
"text": "def rendered_content\n @rendered || self.to_s\n end",
"title": ""
},
{
"docid": "7b6c5e7ef7522ae6547dc48e56bb3d8d",
"score": "0.6670543",
"text": "def _render_template\n case @template\n when String\n @builder.instance_eval @template, __FILE__, __LINE__\n when Proc\n @builder.instance_exec *@args, &@template\n end\n @builder.to_str\n end",
"title": ""
},
{
"docid": "e0d796301df8f0e30380e25c3109ab45",
"score": "0.6668733",
"text": "def render(*args, &render_block)\n # return cached copy if it available\n return @rendered unless @rendered.nil?\n\n capture_sections\n\n # add to content string args and block result if its present\n args.ensure_array(:flatten, :compact).each do |a|\n self[:render_arguments] << a if a.is_a?(String)\n end\n if block_given?\n result = instance_exec(self, &render_block) || empty_html\n result.is_a?(String) && self[:render_block] << result\n end\n\n do_render\n do_wrap\n\n if @template.output_buffer.nil?\n # when render called from code, just return content as a String\n @rendered\n else\n # in template context, write content to templates buffer\n concat(@rendered)\n empty_html\n end\n end",
"title": ""
},
{
"docid": "027a0859ba92f8506fe778bbda0be9fc",
"score": "0.6665938",
"text": "def render\n\t\treturn ERB.new(@template).result(binding())\n\tend",
"title": ""
},
{
"docid": "66d75c92fbff94ddaf51a83f0085940f",
"score": "0.66440475",
"text": "def rails_render(*args)\n rails_controller_instance.render_to_string(*args)\n rescue ActionView::MissingTemplate\n nil\n end",
"title": ""
},
{
"docid": "e96665f132387efeb524178252094d67",
"score": "0.6638685",
"text": "def render_template\n _render(:template)\n end",
"title": ""
},
{
"docid": "ba614492c17de001ef8d500f67ba8d27",
"score": "0.6636304",
"text": "def rendered\n ActiveSupport::Deprecation.warn(\"response.rendered has been deprecated. Use tempate.rendered instead\", caller)\n @template.instance_variable_get(:@_rendered)\n end",
"title": ""
},
{
"docid": "2d432e8c17f1f4d3b36578098fc4b800",
"score": "0.6632605",
"text": "def render_safe\n RENDER_SAFE\n end",
"title": ""
},
{
"docid": "16d1d29c8371aa7a23d0bb8d51163a21",
"score": "0.6627257",
"text": "def render_content\n content.to_s\n end",
"title": ""
},
{
"docid": "bcefab7ad3fbe72bd018127f294a8783",
"score": "0.6619036",
"text": "def render\n renderable ? content : \"\"\n end",
"title": ""
},
{
"docid": "f2c6339bd5fe486ba659afd67a5e7118",
"score": "0.66181433",
"text": "def view_string(template, params={})\n params[:_controller] = self\n template = template.to_s + '.rhtml' if template.instance_of? Symbol\n @@erb_template.new(template.to_s, params).string\n end",
"title": ""
},
{
"docid": "e0e3d88badb5e3593b392911df77f0c5",
"score": "0.6615354",
"text": "def render(*args, &block)\n super(*args, &block)\n\n options = _normalize_render(*args, &block)\n\n self.content_type ||= Mime[lookup_context.rendered_format].to_s\n self.response_body = ::Tilt.new(\"app/views/#{options[:prefixes].first}/#{options[:template]}.html.erb\").render(:foo => \"bar\")\n end",
"title": ""
},
{
"docid": "92ce193b8b412bb62542cacc99cbc16c",
"score": "0.6607856",
"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": "eb58c2fddce303d0423c72fd0473d383",
"score": "0.65825874",
"text": "def render_plain; end",
"title": ""
},
{
"docid": "27334fd60cef7a6bb0440f1c6ac47616",
"score": "0.65823734",
"text": "def render_to_string(context, properties = {})\n render(context, properties).string\n end",
"title": ""
},
{
"docid": "27334fd60cef7a6bb0440f1c6ac47616",
"score": "0.65823734",
"text": "def render_to_string(context, properties = {})\n render(context, properties).string\n end",
"title": ""
},
{
"docid": "27334fd60cef7a6bb0440f1c6ac47616",
"score": "0.65823734",
"text": "def render_to_string(context, properties = {})\n render(context, properties).string\n end",
"title": ""
},
{
"docid": "27334fd60cef7a6bb0440f1c6ac47616",
"score": "0.65823734",
"text": "def render_to_string(context, properties = {})\n render(context, properties).string\n end",
"title": ""
},
{
"docid": "ece17fd969fd418f6e1a40ef7c03ee84",
"score": "0.65698785",
"text": "def to_html\n @rendered ||= ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "390a4ed933d3aacda29ea3e729ead0c9",
"score": "0.65448344",
"text": "def render\n context.render(template.content) { to_html }\n end",
"title": ""
},
{
"docid": "b33fc7a48528d23b8d1e8c4513130a71",
"score": "0.6536213",
"text": "def render\n to_s\n end",
"title": ""
},
{
"docid": "c18af95b6df65e20000f3cb7cb8c69ed",
"score": "0.6535803",
"text": "def render\n require 'erb'\n ERB.new(@template).result(binding)\n end",
"title": ""
},
{
"docid": "6201c683dc981a2627baee2e6ce96ebe",
"score": "0.6521098",
"text": "def render_string(params={})\n # {{{\n @response[:html] = '' unless @response[:html]\n @response[:html] << params[:html].to_s\n @response[:script] << params[:script].gsub(\"\\n\",' ') if params[:script]\n end",
"title": ""
},
{
"docid": "e6728acb47b00eb51797e6ca36ebc7a7",
"score": "0.65152377",
"text": "def rails_render(*args)\n return if rails_api_controller?\n\n rails_controller_instance.render_to_string(*args)\n rescue ActionView::MissingTemplate\n nil\n end",
"title": ""
},
{
"docid": "24eb7c062baa64ae08320c6f842f4249",
"score": "0.6504214",
"text": "def render(**context)\n Rendering.new(context, &block).to_s\n end",
"title": ""
},
{
"docid": "b1f7fd1bb4e798dbf1f73d485c45dc29",
"score": "0.6498862",
"text": "def render_to_body(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "86d6dff412be87ea11860ae68e918037",
"score": "0.6468772",
"text": "def render_component_as_string(options) #:doc:\n component_logging(options) do\n response = component_response(options, false)\n\n if redirected = response.redirected_to\n render_component_as_string(redirected)\n else\n response.body\n end\n end\n end",
"title": ""
},
{
"docid": "3d237046a1b61405715b550c6c3e943d",
"score": "0.64661723",
"text": "def render_component_as_string(options) #:doc:\n component_logging(options) do\n response = component_response(options, false)\n\n if redirected = response.redirected_to\n render_component_as_string(redirected)\n else\n response.body\n end\n end\n end",
"title": ""
},
{
"docid": "4a1265052b6c147b6fc740f41a7728e0",
"score": "0.6459963",
"text": "def render\n body\n end",
"title": ""
},
{
"docid": "27fd9ace277ebb6df907282a5ae77a9b",
"score": "0.64218956",
"text": "def render() ERB.new(@template, nil, '-').result( binding ) end",
"title": ""
},
{
"docid": "5cfc6ca2d78a8bc3e312a45f4ba7665e",
"score": "0.6421573",
"text": "def _render_template(options) #:nodoc:\n if options.delete(:stream)\n Rack::Chunked::Body.new view_context.render_body(options)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "fab0c5c78c71d1121953611f2400b23f",
"score": "0.6421219",
"text": "def render(template_name, presenter=nil)\n if @render_disabled == true\n raise GentleREST::CachingError,\n \"Rendering has been disabled because this response was cached.\"\n end\n if presenter == nil\n # No Presenter object was supplied, use the controller's default\n # Presenter object or an empty Presenter.\n presenter = GentleREST::Presenter.default_presenter(\n self.options[:controller])\n end\n if @layout == nil\n self.body = GentleREST::Template.render(template_name, presenter)\n else\n outer_template, outer_presenter = @layout\n if outer_presenter == nil\n # Same as above, no layout Presenter supplied, use defaults.\n outer_presenter = GentleREST::Presenter.default_presenter(\n self.options[:controller])\n end\n self.body = GentleREST::Template.render(\n outer_template, outer_presenter, {\n :inner_template => template_name,\n :inner_presenter => presenter\n }\n )\n end\n return self.body\n end",
"title": ""
},
{
"docid": "057568111720abc5bb24f4e719bba1e2",
"score": "0.6406267",
"text": "def template\n call || _renderer.render(self)\n end",
"title": ""
},
{
"docid": "d6e8c220c562fe2a093366253f55539c",
"score": "0.63905555",
"text": "def render(options = {})\n internal_template.render options\n end",
"title": ""
},
{
"docid": "bb67cb6b57932c5f4374decc85c4915d",
"score": "0.6385933",
"text": "def render\n @templates.reverse.inject(nil) do |previous, template|\n context = vars.binding do |*args|\n what = args.first\n what ? vars.content_for(what) : previous\n end\n \n case template\n when Haml::Engine\n self.class.silence_warnings do\n template.to_html(context)\n end\n when Sass::Engine\n self.class.silence_warnings do\n template.to_css\n end\n when String\n ERB.new(template).result(context)\n else\n raise \"don't know how to handle templates of class #{template.class.name.inspect}\"\n end\n end\n end",
"title": ""
},
{
"docid": "0d78211f1d612d9b8d77785e707edf5b",
"score": "0.6378489",
"text": "def escaped_raw_template\n h(self.source.raw_template)\n end",
"title": ""
},
{
"docid": "8234774c049fb3bf6b7ed7f9278e9e3d",
"score": "0.6378229",
"text": "def render\n puts to_s\n end",
"title": ""
},
{
"docid": "cbd36c7cf15b1898d974fab7e28a7397",
"score": "0.63763475",
"text": "def rendered\n template.instance_variable_get(:@_rendered)\n end",
"title": ""
},
{
"docid": "940a899bc965715a73512ad413ee920d",
"score": "0.6373806",
"text": "def render\n render = @_template.render(self) #, &body)\n\n self.summary = render.summary # TODO: make part of neapolitan?\n\n result = render.to_s\n\n if layout\n if layout_object = site.lookup_layout(layout)\n result = layout_object.render(self){ result }\n #else\n # raise \"No such layout -- #{layout}\" unless layout\n end\n end\n\n result.to_s.strip\n end",
"title": ""
},
{
"docid": "c59da81e84d827303af41e3f576f81b4",
"score": "0.6371992",
"text": "def render_erb(string,b)\n render_response execute_template(string,b)\n end",
"title": ""
},
{
"docid": "e7321d3684f227093d3d2acad1aa879c",
"score": "0.6371666",
"text": "def _render_compiled_template(compiled_template)\n self.instance_eval \"def __render(); #{compiled_template}; end\"\n begin\n self.send(:__render) do |*names|\n self.instance_variable_get(\"@content_for_#{names.first}\")\n end\n ensure\n class << self; self end.class_eval{ remove_method(:__render) } rescue nil\n end\n end",
"title": ""
},
{
"docid": "64e98c9576a3bdaf7c6ce905762799a2",
"score": "0.636877",
"text": "def render\n ''\n end",
"title": ""
},
{
"docid": "89738132733fdd3e104004b1d1dc2fb2",
"score": "0.6368532",
"text": "def render_to_string_with_template_streaming(*args, &block) # :nodoc\n # Ensure renders within a render_to_string aren't considered\n # top-level.\n with_template_streaming_condition do\n render_to_string_without_template_streaming(*args, &block)\n end\n end",
"title": ""
},
{
"docid": "eccb76c51461344b475471b78f1f9d74",
"score": "0.63595665",
"text": "def _render_\n document.to_s\n end",
"title": ""
},
{
"docid": "3c01c5fe02c64d4a69b9e6c76bbdb4d6",
"score": "0.6351823",
"text": "def render\n analyze\n _evaluate\n _process_bodies if @options[:extra] && @options[:extra][:process_body]\n return @results.join\n end",
"title": ""
},
{
"docid": "0b997709d82fda40424d03bd16fbab0c",
"score": "0.63280535",
"text": "def render_body\n _render(:body_template)\n end",
"title": ""
},
{
"docid": "80df483104a6d9ebeb142cc706024e05",
"score": "0.6310585",
"text": "def render\n old_template = template\n result = nil\n File.open(full_template_path, 'r') do |f|\n self.template = f.read\n result = render_string\n end\n\n result\n ensure\n self.template = old_template\n end",
"title": ""
},
{
"docid": "23d5e91057245fd43f50caccd4ba6e9b",
"score": "0.6298388",
"text": "def render_to_string(*args); end",
"title": ""
},
{
"docid": "8656f230d55e2e2518f4baf4504f5615",
"score": "0.62930566",
"text": "def render\n # cleaning content from possible irb stuff. Partial and Helper tags are OK.\n if ComfortableMexicanSofa.config.disable_irb && ![CmsTag::Partial, CmsTag::Helper].member?(self.class)\n content.to_s.gsub('<%', '<%').gsub('%>', '%>')\n else\n content.to_s\n end\n end",
"title": ""
},
{
"docid": "5789b65da729e0e73eb2d8a1a2ebc3e4",
"score": "0.6291198",
"text": "def render()\n ERB.new(File.read(\"webroot/tmp_resp.rhtml\")).result(binding)\n end",
"title": ""
},
{
"docid": "03432ddcd44fe054444006f70d394a5a",
"score": "0.629046",
"text": "def render(params={}) # FIXME: rescue\n ([]).tap do |rt|\n tp = document_template.content\n ev = Liquid::Template.parse(tp).render(self.assigns, { registers: self.registers })\n rw = page.account.rewriters.any? ? page.account.rewriters.rewrite!(ev) : ev\n\n rt << rw\n rt << 'text/html'\n end\n end",
"title": ""
},
{
"docid": "233027c02931ba217831fd15adf13637",
"score": "0.6288287",
"text": "def render(template); end",
"title": ""
},
{
"docid": "c4f7f4a65048503d96201fbf4fcaa567",
"score": "0.62832725",
"text": "def render()\n # return self.render_compact() if self.body.nil? && self.params.length == 0\n parts = []\n parts << self.render_description()\n parts << self.params.map(&:render_doc).join(\"\\n\") unless self.params.length == 0\n parts << self.render_return_type()\n parts << \"def \" + self.name + self.render_params()\n parts << self.body.indent(2) unless self.body.nil?\n parts << \"end\"\n\n body = parts.compact.join(\"\\n\").gsub(/(\\s+)$/, \"\")\n\n return Ginny.mod(body, self.modules) if self.modules.length > 0\n return body\n end",
"title": ""
},
{
"docid": "1424fed75287278fd0d90ef2988fa91e",
"score": "0.62811023",
"text": "def raw_body\n headless? ? @raw.to_s : @body.to_s\n end",
"title": ""
},
{
"docid": "62b57498e0868fa2d1e8edc14f787d39",
"score": "0.62796897",
"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": "77249f5ced0f814c89a23c2f874c5af8",
"score": "0.62727314",
"text": "def render(template, locals = nil)\n locals ||= instance_variables.each_with_object({}) do |ivar, h|\n h[ivar] = instance_variable_get(ivar)\n end\n content_type :html\n body template.new(locals).to_s\n end",
"title": ""
},
{
"docid": "bd93691c2db34122af2ad0f673fbf9c5",
"score": "0.6267835",
"text": "def render_to_body(options = nil, &block) #:doc:\n render(options, &block)\n response.body\n ensure\n response.content_type = nil\n erase_render_results\n reset_variables_added_to_assigns\n end",
"title": ""
},
{
"docid": "1fb45696f048d28bf0bf543f315726e6",
"score": "0.6256796",
"text": "def render\n content_type = @original_response.headers['Content-Type']\n return @original_response unless content_type =~ %r{text/html}\n\n return @original_response unless @configuration.ui.badge_enabled\n\n modified_response = Rack::Response.new([], @original_response.status, @original_response.headers)\n modified_response.write(modified_body)\n modified_response.finish\n\n response = @original_response.response\n response.close if response.respond_to?(:close)\n\n ResponseWrapper.new(@original_response.status,\n @original_response.headers,\n modified_response)\n end",
"title": ""
},
{
"docid": "4cf721933967cd6310e478b9a5d47019",
"score": "0.62567693",
"text": "def render_to_string(path, opts={})\n if ENV['RACK_ENV'] == 'production'\n template = Thread.current[:\"#{path}\"] || Thread.current[:\"#{path}\"] = Tilt.new(path, opts)\n else\n template = Tilt.new(path, opts)\n end\n\n ::I18n.with_exception_handler(:raise_all_exceptions) do\n string = template.render(renderer_scope)\n string.respond_to?(:force_encoding) ? string.force_encoding(\"utf-8\") : string\n end\n end",
"title": ""
},
{
"docid": "4a56a4ebfb60f93230f4fb192617b85e",
"score": "0.6237606",
"text": "def render_text(text)\n text.to_html!\n @response[:html] << text\n end",
"title": ""
},
{
"docid": "2e8b6465e9552c38e4bd40f216ac3265",
"score": "0.6235191",
"text": "def render\n template_body = Tilt.new(@template).render(self)\n if @layout\n layout = Dir[File.join(File.dirname(@template), @layout) + '*'].first\n raise \"-: Snack :- Unable to locate layout at: '#@layout'\" unless layout\n @body = Tilt.new(layout).render(self) { template_body }\n end\n @body || template_body\n end",
"title": ""
},
{
"docid": "30d30288d55842519184ef40ee24864d",
"score": "0.6231525",
"text": "def render_template(template, status = nil, type = \"rhtml\") #:doc:\n add_variables_to_assigns\n render_text(@template.render_template(type, template), status)\n end",
"title": ""
},
{
"docid": "dec4a238e0ca36577e111b853e8e02d6",
"score": "0.62237436",
"text": "def render(context_class, slim_options)\n context = context_class.new(@template)\n\n ::Slim::Template.new(slim_options) { source }.render(context)\n rescue Exception => exception\n UI.info exception.message\n end",
"title": ""
},
{
"docid": "bdb4f75eb9cea95a3452dc3c77093172",
"score": "0.6218647",
"text": "def render(*args, &block)\n options = _normalize_render(*args, &block)\n rendered_body = render_to_body(options)\n if options[:html]\n _set_html_content_type\n else\n _set_rendered_content_type rendered_format\n end\n self.response_body = rendered_body\n end",
"title": ""
},
{
"docid": "195d0b081b34cbaeee5193f69a58f54c",
"score": "0.61906344",
"text": "def render_to_string name=nil, opts={}\n opts[:render_to_string] = true\n render name, opts\n end",
"title": ""
},
{
"docid": "4cfa769ba4ebf69fb987c3d5fc007dd1",
"score": "0.61897093",
"text": "def __render__\n __result__.__render__ # haha, wtf?\n end",
"title": ""
},
{
"docid": "78e2d7191d025995577419645e14dddd",
"score": "0.6183999",
"text": "def render( **kwargs )\n ## note: Ruby >= 2.5 has ERB#result_with_hash - use later - why? why not?\n @template.result( Context.new( **kwargs ).get_binding )\n end",
"title": ""
},
{
"docid": "78e2d7191d025995577419645e14dddd",
"score": "0.6183999",
"text": "def render( **kwargs )\n ## note: Ruby >= 2.5 has ERB#result_with_hash - use later - why? why not?\n @template.result( Context.new( **kwargs ).get_binding )\n end",
"title": ""
},
{
"docid": "38e5ae0339de7c392211d4862098c9ca",
"score": "0.6176014",
"text": "def render\n if rendered?\n super\n else\n File.read source\n end\n end",
"title": ""
},
{
"docid": "19f204a994adcad9e0774d2fcc9920d8",
"score": "0.61753404",
"text": "def render(obj = Object.new, locals = {})\n output = template.result(obj.instance_eval {binding})\n end",
"title": ""
},
{
"docid": "c31aed6cea62b1a7ea361f6bf0a8a269",
"score": "0.6163449",
"text": "def render_view(template, params={})\n # {{{\n params[:_controller] = self\n template = (template.to_s << '.rhtml') if template.instance_of? Symbol\n content = @@erb_template.new(template, params).string\n @response[:html] << content\n @response[:script] << params[:script].gsub(\"\\n\",' ') if params[:script]\n end",
"title": ""
},
{
"docid": "4bc6af458192aa16e904da4ccdb888bc",
"score": "0.6161927",
"text": "def render_response(body, status=200, headers={})\n if status == 200 &&\n full_path != '/login' &&\n params['_ajax'] != 'yes' &&\n !headers.has_key?('Content-Type')\n body = template_wrap(body)\n end\n\n response = Rack::Response.new body, status, headers\n response.finish\n end",
"title": ""
},
{
"docid": "0d544d8407ccc16b5c42375168ca3809",
"score": "0.61587715",
"text": "def render_body\r\n @rendered_body\r\n end",
"title": ""
},
{
"docid": "20f47b914c5b485875852b8ffe96f362",
"score": "0.6155397",
"text": "def body\n @body ||= renderer.render(view_context, template: \"#{templates_dir}/#{@text_message_method}\")\n end",
"title": ""
},
{
"docid": "e11ebe0f6f505de78cef5e6be139613a",
"score": "0.61533767",
"text": "def render_string(*args)\n render_with(:render_string, *args)\n end",
"title": ""
},
{
"docid": "ab2fd52dfed8a94f6d1128e46e74d825",
"score": "0.6152853",
"text": "def render(context)\n html_output_for(live_response)\n end",
"title": ""
},
{
"docid": "21e62cfd9a9102ffe484a2a1ee743dfe",
"score": "0.61500144",
"text": "def render(*args, &block)\n options = args.first || {}\n\n # This is a method provided by ActionView::Rendering that provides options like prefix and template.\n # For example, if this is the PostsController and the action is #show, then this will provide:\n # {:prefixes=>[\"posts\"], :template=>\"show\"}\n _normalize_options(options)\n\n rendered_body = render_to_body(options)\n\n # This is basically what Rails will do if the response is HTML.\n # #rendered_format is provided by ActionView\n if rendered_format\n response.content_type = rendered_format.to_s\n end\n self.response_body = rendered_body\n end",
"title": ""
},
{
"docid": "57fa595a4e6f73e6d81d14133ce54bc5",
"score": "0.61489385",
"text": "def render( renderstate )\n\t\treturn ''\n\tend",
"title": ""
},
{
"docid": "96225cd88f67b67217e4bc2613f9b241",
"score": "0.61364764",
"text": "def render(*args)\n raise 'missing controller' unless controller?\n\n instance = controller.new\n instance.set_response! ActionDispatch::Request.new({})\n instance.render_to_string(*args)\n end",
"title": ""
},
{
"docid": "8d6e410c053f6c2ad558b9c722af33ab",
"score": "0.61343974",
"text": "def component\n raise DoubleRenderError, component_instance if @rendered\n\n @rendered = component_instance.render_in(view_context).html_safe\n end",
"title": ""
},
{
"docid": "f4c0dac105b1236c92700719055736ef",
"score": "0.6124803",
"text": "def render_to_string_with_template_streaming(*args, &block) # :nodoc\n push_render_stack_frame do\n render_to_string_without_template_streaming(*args, &block)\n end\n end",
"title": ""
},
{
"docid": "7d4a53db51027ac8e0e9ca560d953cbf",
"score": "0.61095977",
"text": "def render(r)\n end",
"title": ""
},
{
"docid": "7d4a53db51027ac8e0e9ca560d953cbf",
"score": "0.61095977",
"text": "def render(r)\n end",
"title": ""
},
{
"docid": "06a0239bcf7ca5a7f19aebd90237fba6",
"score": "0.61066645",
"text": "def _render_compiled_template(compiled_template, input_path=\"(compiled erb)\")\n self.instance_eval \"def __render(); #{compiled_template}; end\", input_path\n begin\n self.send(:__render) do |*names|\n self.instance_variable_get(\"@content_for_#{names.first}\")\n end\n ensure\n class << self; self end.class_eval{ remove_method(:__render) } rescue nil\n end\n end",
"title": ""
},
{
"docid": "48fd91f8bb54087ef7abbad75eb0de54",
"score": "0.6105095",
"text": "def render_text(text = nil, status = nil, &block) #:doc:\n return if performed?\n add_variables_to_assigns\n @response.headers[\"Status\"] = status || DEFAULT_RENDER_STATUS_CODE\n @response.body = block_given? ? block : text\n @performed_render = true\n end",
"title": ""
},
{
"docid": "1c28acc1e87211a3da02d266b28b63f0",
"score": "0.61043394",
"text": "def render(params={})\n into, text = parameters(params, :to, :text)\n\n case into\n when :html, nil # :man, :manpage\n if ::Redcarpet::VERSION < '2'\n prepare_engine(params).to_html\n else\n prepare_engine(params).render(text)\n end\n else\n super(params)\n end\n end",
"title": ""
},
{
"docid": "557e4767c702f5a15f3bcc19dc4c8bac",
"score": "0.60998356",
"text": "def render(string)\n @engine.render(string)\n end",
"title": ""
},
{
"docid": "3ad48c1f66a3972302635112debb5a69",
"score": "0.6099744",
"text": "def render_custom\n #raise ArgumentError unless File.exist?(template)\n result = erb(template)\n publish(result) \n end",
"title": ""
}
] |
40125e73585faba234313b71542f0398
|
replace history state on subsequent renderings
|
[
{
"docid": "5184edec8701a849dd3459438f02bece",
"score": "0.55057216",
"text": "def updated()\n self.updateHistory()\n end",
"title": ""
}
] |
[
{
"docid": "39366c4d5ba1b12ce438fa182000d8b7",
"score": "0.65033925",
"text": "def history\n render layout: false\n end",
"title": ""
},
{
"docid": "d61e59f59db56dd6e8e145b82f847a70",
"score": "0.64458877",
"text": "def refresh()\n self.route(history.state.path, history.state.query)\n end",
"title": ""
},
{
"docid": "d61e59f59db56dd6e8e145b82f847a70",
"score": "0.6445318",
"text": "def refresh()\n self.route(history.state.path, history.state.query)\n end",
"title": ""
},
{
"docid": "d61e59f59db56dd6e8e145b82f847a70",
"score": "0.6445318",
"text": "def refresh()\n self.route(history.state.path, history.state.query)\n end",
"title": ""
},
{
"docid": "0755a51fc328727b75ab2d2afab8b662",
"score": "0.62891996",
"text": "def replace(url,data,title=nil)\n `history.replaceState(#{data.to_n}, #{title}, #{url})`\n end",
"title": ""
},
{
"docid": "4019f77deecbcd920c0b244b771e4047",
"score": "0.61496854",
"text": "def history_back\n generic_history_back(history)\n add_to_line_history\n end",
"title": ""
},
{
"docid": "a9ec07ae0bf57ca632a96c60ddc4498c",
"score": "0.60456437",
"text": "def history; end",
"title": ""
},
{
"docid": "a9ec07ae0bf57ca632a96c60ddc4498c",
"score": "0.60456437",
"text": "def history; end",
"title": ""
},
{
"docid": "a9ec07ae0bf57ca632a96c60ddc4498c",
"score": "0.60456437",
"text": "def history; end",
"title": ""
},
{
"docid": "0a40f5049f48efed9618bbe39710e5cf",
"score": "0.59943694",
"text": "def replace(new_history)\n if new_history.is_a?(HistoryBuffer)\n new_history = new_history.instance_variable_get(:@history)\n end\n @history.replace(new_history)\n end",
"title": ""
},
{
"docid": "33f57ec7f0c2849919b7587133c75752",
"score": "0.5965771",
"text": "def update_history\n return if already_updated\n return if history_disabled # easy when doing mass db modifications (like with fixutes)\n clear_cache\n update_history_bulk_insert\n already_updated=true\n end",
"title": ""
},
{
"docid": "812ab957b88f8cadc7c440d1159fda7a",
"score": "0.59651506",
"text": "def history\n end",
"title": ""
},
{
"docid": "c92721cb61aa1b70a2185205e1feddca",
"score": "0.5963313",
"text": "def write_history\n return super if SqueezeHistory.disabled?\n config[:history] = squeezed_history\n super\n end",
"title": ""
},
{
"docid": "8250107abfe72fc82bcd562201297123",
"score": "0.5928424",
"text": "def remove_slug_history!\n previous_slugs.each { |s| self.class.cache_slug_lookup!(s, nil) }\n super\n end",
"title": ""
},
{
"docid": "4b4730fd0471ee2a193d6112efec9c12",
"score": "0.59251875",
"text": "def set_state_history\r\n @state_history = StateHistory.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "d741506e46333cb873e53583e5cc9fbb",
"score": "0.5921303",
"text": "def transact\n history_backup = @history.dup\n begin\n yield self\n ensure\n @history = history_backup\n end\n end",
"title": ""
},
{
"docid": "f485dc108919392fe77b818bd3295e7d",
"score": "0.5874538",
"text": "def visit(url)\n @forward_history.clear\n @back_history.push(url)\n @current = url\n end",
"title": ""
},
{
"docid": "c464b174a72c72f830c5f8beb47e79aa",
"score": "0.58654976",
"text": "def reset_history\n @@history = []\n end",
"title": ""
},
{
"docid": "42435e2c54cd23b35602e4bcb94597f7",
"score": "0.5860272",
"text": "def history; config[:history] ||= []; end",
"title": ""
},
{
"docid": "c87d07662f4acab2d6027f530a8b3d6c",
"score": "0.58325446",
"text": "def history\n @list_action = true\n render_response(\"shared/history/run_history\", \"working_div\") do find_history end\n end",
"title": ""
},
{
"docid": "aafbc07de270002206b1b7dc268b8c97",
"score": "0.580413",
"text": "def history=(_arg0); end",
"title": ""
},
{
"docid": "874d1621d43cc143d36c1eeaefe37d19",
"score": "0.5803818",
"text": "def history=(v); end",
"title": ""
},
{
"docid": "08009145c771ee3d921dc5e9a3f3ef44",
"score": "0.57908946",
"text": "def history_forward\n generic_history_forward(history)\n add_to_line_history\n end",
"title": ""
},
{
"docid": "2e349ebc5b9949be948f3556e6594255",
"score": "0.5786104",
"text": "def back(steps)\n steps.times do\n break if @back_history.empty?\n url = @back_history.pop\n @forward_history.push(url)\n end\n @current = if @back_history.tail\n @back_history.tail.obj\n else\n @homepage\n end\n end",
"title": ""
},
{
"docid": "2f48281d2e9222d9d0d63cc3652e42b9",
"score": "0.5785554",
"text": "def before_render\n manage_link_stack\n end",
"title": ""
},
{
"docid": "8dbbd172007ac515e6bfbd9355ac34cb",
"score": "0.5764439",
"text": "def back\n show_main_menu\n set_replace_last_true\n end",
"title": ""
},
{
"docid": "98c1e1def8c02974cc3bfb63bac287cb",
"score": "0.57447857",
"text": "def navigate(path, query)\n history.state.scrollY = window.scrollY\n history.replaceState(history.state, nil, history.path)\n Main.scrollTo = 0\n self.route(path, query)\n history.pushState({path: path, query: query}, nil, path)\n window.onresize()\n Main.latest = false if path\n end",
"title": ""
},
{
"docid": "3b44dc529de8f632af4616b8f3212b3b",
"score": "0.57037765",
"text": "def history=(new_history)\n @history = new_history\n end",
"title": ""
},
{
"docid": "e30a7d4eb0176531212653cf67089444",
"score": "0.56959456",
"text": "def undo\n raise NoMethodError, \"no state history\" unless self.respond_to? :history\n recall history.pop(2)[0] \n save\n end",
"title": ""
},
{
"docid": "f8329fa81994212b93ba3859290186b1",
"score": "0.5674384",
"text": "def restore_state; end",
"title": ""
},
{
"docid": "73b3989b6b581a000eacc3fd5f101f04",
"score": "0.56590873",
"text": "def store_history\n session[:history] ||= []\n session[:history].delete_at(0) if session[:history].size >= 5\n session[:history] << request.url\n end",
"title": ""
},
{
"docid": "e840dc6c501e9f016ea21467441d7e54",
"score": "0.5656963",
"text": "def set_history\n\t\t@history = History.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "477953ca6d822675ef44949907992a81",
"score": "0.56415516",
"text": "def back(session, how_many = 1)\n session[:history] ||= []\n last = nil\n\n (1..how_many.to_i).each do\n last = session[:history].pop\n\n if logger.debug?\n if last.nil?\n logger.debug(\"history: history empty, not removing anything\")\n else\n logger.debug(\"history: removed #{last}\")\n end\n end\n end\n\n if last.nil? and @default\n # if we have a default location, and history\n # is empty, redirect to it.\n last = @default.dup\n\n # don't store the rendering of our default location\n # if it is rendered by our application\n if @default.respond_to?(:[])\n logger.debug(\"not storing the next request\")\n session[:skip_next] = 1\n end\n else\n # when we redirect back, we need to avoid saving uri\n # when we call store_location after the redirect\n logger.debug(\"not storing the next request\")\n session[:skip_next] = 1\n end\n last\n end",
"title": ""
},
{
"docid": "516c1a7c4da2651de29087c21378628a",
"score": "0.5624449",
"text": "def history=(value)\n @history = value\n end",
"title": ""
},
{
"docid": "516c1a7c4da2651de29087c21378628a",
"score": "0.5624449",
"text": "def history=(value)\n @history = value\n end",
"title": ""
},
{
"docid": "516c1a7c4da2651de29087c21378628a",
"score": "0.5624449",
"text": "def history=(value)\n @history = value\n end",
"title": ""
},
{
"docid": "37c512151b362050a811f59a41b60793",
"score": "0.5617911",
"text": "def set_other_history\n @other_history = OtherHistory.find(params[:id])\n add_breadcrumb @other_history, @other_history\n rescue ActiveRecord::RecordNotFound\n render_404\n end",
"title": ""
},
{
"docid": "e641d7fc54005a8d51bd0a6dcad71a4c",
"score": "0.5616566",
"text": "def history=(new_history)\n @history.clear\n\n new_history.each do |url|\n @history << URI(url)\n end\n\n return @history\n end",
"title": ""
},
{
"docid": "81d116b71b810bd4c9053d7e42f65a00",
"score": "0.5593354",
"text": "def render_back\n if session[:prev_referer].present?\n prev_url = session[:prev_referer]\n if prev_url.include?(\"workspaces\")\n prev_url = \"/\" + prev_url.split(\"/\")[1]\n end\n redirect_to prev_url\n end\n end",
"title": ""
},
{
"docid": "c2c5b0f125923dd6b2b679a3a06572c6",
"score": "0.5590058",
"text": "def init_history\n Thread.current[:versioning_history] = nil\n end",
"title": ""
},
{
"docid": "6e565778a323c1e4e180a25e417b3d70",
"score": "0.55822426",
"text": "def set_back_path\n unless @new_back_path_queue.present? # prevents this from breaking if called multiple times during one request\n @current_back_path_queue = session[:back_path] || [root_url]\n @new_back_path_queue = @current_back_path_queue.dup # create a copy so the two aren't linked to the same memory address\n if @current_back_path_queue.include?(current_path) # if we are revisiting an old link in the queue, let's clean up the queue (prevents infinite loops)\n @new_back_path_queue.pop(@new_back_path_queue.length - @new_back_path_queue.index(current_path)) # remove everyting in the queue visited after this link in the queue\n end \n @new_back_path_queue.push(current_path)\n @new_back_path_queue.shift if @new_back_path_queue.length > 5 # manage queue size maximum\n session[:back_path] = @new_back_path_queue unless @new_back_path_queue == @current_back_path_queue # don't hit session again if back path queue hasn't changed\n end\n end",
"title": ""
},
{
"docid": "c5039d3241c403c57bba194149c44372",
"score": "0.55692047",
"text": "def back\n @history.pop\n end",
"title": ""
},
{
"docid": "c5039d3241c403c57bba194149c44372",
"score": "0.55692047",
"text": "def back\n @history.pop\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5552622",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "dddec0fc7f64193193758748a311f1e5",
"score": "0.5551071",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "14abca569e95e958c7b92e604b104c5f",
"score": "0.55426157",
"text": "def force_store(session, request, response)\n session[:history] ||= []\n\n # don't store refresh\n if request.request_uri == session[:history].last\n logger.debug(\"history: skipped refresh request\")\n return\n end\n\n session[:history].push(request.request_uri)\n while session[:history].size > @max do\n session[:history].shift\n end\n logger.debug(\"history: added #{request.request_uri}\")\n end",
"title": ""
},
{
"docid": "4411d930af9ab7f8bac39a83bc1e9b4b",
"score": "0.5533633",
"text": "def store_browse_history\n session[:history] ||= []\n # Only store new pages (don't count reloads)\n if (session[:history].last != \"#{request.protocol}#{request.host_with_port}#{request.fullpath}\")\n session[:history] << \"#{request.protocol}#{request.host_with_port}#{request.fullpath}\"\n session[:history].slice!(0, [session[:history].size - 2, 0].max) # Keep the most recent two\n end\n end",
"title": ""
},
{
"docid": "2fc3ac6c980eb996a7c90633220884b3",
"score": "0.5531204",
"text": "def set_refuelling_history\n @history = RefuellingHistory.find(params[:id])\n end",
"title": ""
},
{
"docid": "06259c523a1c7a90881733cf1d355738",
"score": "0.552589",
"text": "def after_initialize\n\t\tself.current_history = History.new( :parent_class => self.class.name, :parent_id => self.id, :state_in => self.state )\n\tend",
"title": ""
},
{
"docid": "d3c76f89f11b7ef0ce89de6cea0b7bca",
"score": "0.55185515",
"text": "def set_page_history\n @page_history = PageHistory.find(params[:id])\n end",
"title": ""
},
{
"docid": "113e8fa983dae8c9d74d1fb95fa82f4f",
"score": "0.5517275",
"text": "def load_history; end",
"title": ""
},
{
"docid": "113e8fa983dae8c9d74d1fb95fa82f4f",
"score": "0.5517275",
"text": "def load_history; end",
"title": ""
},
{
"docid": "84d51149c304829fb03c2b455e28d424",
"score": "0.5516781",
"text": "def push_to_history(object)\n return if object == history[history_index]\n\n @history = history[0, history_index + 1]\n history << object\n @history_index = history.size - 1\n end",
"title": ""
},
{
"docid": "d7f816a5a42b65fbc3cfa1450c7e1abb",
"score": "0.550622",
"text": "def transact\n history_backup = @agent.history.dup\n begin\n yield self\n ensure\n @agent.history = history_backup\n end\n end",
"title": ""
},
{
"docid": "cc4b8e83ba82ac2722ed2c9b3658eb67",
"score": "0.5502456",
"text": "def back_navigation\n # session[:last_page] = nil\n session[:page_history] ||= []\n # session[:page_history].delete ''\n previous_page = request.env['HTTP_REFERER']\n current_page = (request.env['rack.url_scheme'] + '://' + request.env['HTTP_HOST'] + request.env['REQUEST_PATH']).to_s\n unless previous_page.nil?\n # remove trailing / and any params\n prev_link = [previous_page.to_s.gsub(/\\/$/, '').gsub(/\\?.*/, ''), session[:prev_title]]\n session[:page_history] << prev_link\n # do a little cleanup, mostly for development session\n session[:page_history].compact!\n session[:page_history].uniq!\n session[:page_history] = session[:page_history].select{|link| link.kind_of? Array }\n\n # if the current link is already in the page history, then delete all history after it.\n # remove trailing / and any params\n curr_link = [current_page.gsub(/\\/$/, '').gsub(/\\?.*/, ''), session[:title]]\n index = nil\n session[:page_history].each do |link|\n if (link[0] == curr_link[0]) || (link[1] == curr_link[1])\n index = session[:page_history].index(link)\n break\n end\n end\n unless index.nil?\n if index == 0\n session[:page_history].clear\n else\n session[:page_history] = session[:page_history][0..(index - 1)]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9551a9ce6333fc9346db3529f582ef1a",
"score": "0.5483947",
"text": "def set_link_history\n @link_history = LinkHistory.find(params[:id])\n end",
"title": ""
},
{
"docid": "4000a8dc0b57a6b5e66d3bdadae6ee91",
"score": "0.54629993",
"text": "def revert_state\n\t\t\t@stack = @saved_stack\n\t\tend",
"title": ""
},
{
"docid": "82543a30e452e1fc2cd8cf56ed5116ad",
"score": "0.5458786",
"text": "def navigate(event)\n destination = event.target.attributes['href'].value\n window.parent.frames.content.history.replaceState({}, nil, destination)\n end",
"title": ""
},
{
"docid": "87094a0f53124fef97c5fa51a651b726",
"score": "0.54447615",
"text": "def reverse_changes!\n replace(reverse_changes)\n end",
"title": ""
},
{
"docid": "912682e2f0afc38b9065529115ce451a",
"score": "0.54411125",
"text": "def set_back_path\n unless @new_back_path_queue.present? # prevents this from breaking if called multiple times during one request\n current_back_path_queue = session[:back_path] || [root_path]\n @new_back_path_queue = current_back_path_queue.dup # create a copy so the two aren't linked to the same memory address\n if current_back_path_queue.include?(current_path) # if we are revisiting an old link in the queue, let's clean up the queue (prevents infinite loops)\n @new_back_path_queue.pop(@new_back_path_queue.length - @new_back_path_queue.index(current_path)) # remove everyting in the queue visited after this link in the queue\n end \n @new_back_path_queue.push(current_path)\n @new_back_path_queue.shift if @new_back_path_queue.length > 10 # manage queue size maximum\n session[:back_path] = @new_back_path_queue unless @new_back_path_queue == current_back_path_queue # don't hit database again if back path queue hasn't changed\n end\n end",
"title": ""
},
{
"docid": "0e305b6a73de76810e87264f4b048d9c",
"score": "0.54259986",
"text": "def update_history( calculation )\n history = session[:history] ? session[:history] : []\n history.push( calculation.as_string )\n session[:history] = history.last( 10 )\n end",
"title": ""
},
{
"docid": "03b6f345d129eb18fb204e9dca7ee355",
"score": "0.54259443",
"text": "def set_history\n @history = History.find(params[:id])\n end",
"title": ""
},
{
"docid": "69e517c29df410f908cb60854afc5d98",
"score": "0.54227036",
"text": "def history_session\n session[:history] ||= []\n @searches = searches_from_history # <- in BlacklightController\n end",
"title": ""
},
{
"docid": "50ee9b865c79029b0305bdc844b5da81",
"score": "0.5413812",
"text": "def manipulate!(history)\n @history = history\n return @history if previous_edited?\n do_manipulate\n @history\n end",
"title": ""
},
{
"docid": "6fa29b4d27b85e0df24cf19dd27bb9ec",
"score": "0.54126984",
"text": "def history\n # return not_allowed unless history_allowed?\n @limit = params[:limit];\n @draft = Draft.find(params[:id])\n @versions = Kaminari.paginate_array(@draft.versions).page(params[:page]).per(@limit)\n #@versions = Irwi.config.paginator.paginate(@draft.versions, page: params[:page]) # Paginating them\n # render_template(@draft.new_record? ? 'no' : 'history')\n end",
"title": ""
},
{
"docid": "0a20795a279219690a015d4d56fd2357",
"score": "0.54122865",
"text": "def set_link_compensation_history\n super\n end",
"title": ""
},
{
"docid": "4464202e5ed47f739f87126085da3b42",
"score": "0.5404604",
"text": "def back(sender)\n if @state\n #@state.save\n end\n @delegate.action_flow_back\n end",
"title": ""
},
{
"docid": "821db883f0bf4c16c615287f65994c71",
"score": "0.5402345",
"text": "def clear_history\n history.empty\n end",
"title": ""
},
{
"docid": "793d04c8ddc6062810b13baef21ae9a5",
"score": "0.5401865",
"text": "def history_url\n end",
"title": ""
},
{
"docid": "dc0745a54e839d0d6cc9712c8d36b616",
"score": "0.5401637",
"text": "def cleanup\n @history.clear\n @history\n end",
"title": ""
},
{
"docid": "eb70b7d6173243909a674edbb32cf8b8",
"score": "0.53968215",
"text": "def with_proxy_history(statefile=nil)\n with_statefile(statefile) do |this|\n this.proxy_history.each {|h| yield h }\n end\n end",
"title": ""
},
{
"docid": "eb70b7d6173243909a674edbb32cf8b8",
"score": "0.53968215",
"text": "def with_proxy_history(statefile=nil)\n with_statefile(statefile) do |this|\n this.proxy_history.each {|h| yield h }\n end\n end",
"title": ""
},
{
"docid": "a06e5e7edebd84a58b6d35fe364531f2",
"score": "0.5380821",
"text": "def back_to_game\n @special_state = false\n end",
"title": ""
},
{
"docid": "09d69ae9440159252f4b2a51c12151d0",
"score": "0.5364455",
"text": "def history\n structure[:history].dup\n end",
"title": ""
},
{
"docid": "faa5911576d450d3972d3b4df1be8706",
"score": "0.53373307",
"text": "def before_rendering( renderstate )\n\t\t@content.clear\n\t\trenderstate.subscribe( self.key, self )\n\tend",
"title": ""
},
{
"docid": "78b3a3f6e00a2a1f2f7b2af31d6eb0fc",
"score": "0.5334096",
"text": "def save\n raise NoMethodError, \"no state history\" unless self.respond_to? :history\n history.push State.new(*values) #need to have a history method \n self\n end",
"title": ""
},
{
"docid": "2d5717d98b1e12e37333aac46d1956cc",
"score": "0.53242785",
"text": "def history=(transformations)\n @__transformations__ = transformations\n end",
"title": ""
},
{
"docid": "fe48c1367797ab96b7a79bf038fd96b0",
"score": "0.5324055",
"text": "def after_changeable_save\n self.changeable_history_class.new_from_changeable(self) unless self.no_history\n self.no_history = false\n true\n end",
"title": ""
},
{
"docid": "6305f1ae6670585ca9006a34a8850851",
"score": "0.5320655",
"text": "def history_navigation\n buf = []\n buf << \"<h2>Site History</h2>\"\n buf << \"<ul>\"\n unless session[:page_history].nil?\n session[:page_history].select{|link| !link[1].nil?}.each do |link|\n buf << list_item(link_to(link[1], link[0]))\n end\n end\n buf << \"</ul>\"\n div_id('history', buf.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "b337dfee7e6c62671caac54635a88d2a",
"score": "0.52976596",
"text": "def to_prev_state_set()\n self.state_set_index = state_set_index - 1\n end",
"title": ""
},
{
"docid": "6d6c59371fefbf8d40820d42a0896e58",
"score": "0.529685",
"text": "def add_to_search_history search\n session[:history] ||= []\n\n session[:history].unshift(search.id)\n\n if session[:history].length > blacklight_config.search_history_window\n session[:history] = session[:history].slice(0, blacklight_config.search_history_window)\n end\n end",
"title": ""
},
{
"docid": "2f133478bb5eeefeb102e6717617c894",
"score": "0.5291045",
"text": "def back_to_current\n change_show_time_to_current\n render :update do |page|\n page[:show_time_setting].replace_html :partial => \"layouts/show_time_setting\"\n page[:page_jp_title].replace_html \"ホーム\"\n# page[:layout_calendar].replace_html :partial => \"layouts/calendar_menu\"\n page[:menu_clusters].replace_html :partial => \"menu_clusters\"\n page[:contents_i].replace_html :partial => \"home/back_to_current\" \n end\n end",
"title": ""
},
{
"docid": "2576a9561b14a47f8a61ec251ff79915",
"score": "0.52901185",
"text": "def determine_redirect_link_from_previous_state\n # redirect back to edit form of faculty\n if(session[:data_save][\"faculty\"].present?&&session[:data_save][\"isEdit\"])\n link_to 'Back', edit_admin_faculty_path(id: session[:data_save][\"faculty\"][\"id\"]), class: \"button\"\n else\n #redirect back to new form\n link_to 'Back', new_admin_faculty_path, class: \"button\"\n end\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.